Start 0.8 support

This commit is contained in:
sladecraven 2021-05-23 00:03:37 +02:00
parent 3d23807820
commit b93a29f7fc
16 changed files with 63 additions and 46 deletions

View File

@ -58,7 +58,7 @@ export class SoSActorSheet extends ActorSheet {
formData.gears = this.actor.data.items.filter( item => item.type == 'gear').concat( this.actor.data.items.filter( item => item.type == 'container') );
// Build the gear tree
formData.gearsRoot = formData.gears.filter(item => item.data.containerid == "");
formData.gearsRoot = formData.gears.filter(item => item.data.data.containerid == "");
for ( let container of formData.gearsRoot) {
if ( container.type == 'container') {
container.data.contains = []
@ -134,12 +134,12 @@ export class SoSActorSheet extends ActorSheet {
});
html.find('.skill-label a').click((event) => {
const li = $(event.currentTarget).parents(".item");
const skill = this.actor.getOwnedItem(li.data("item-id"));
const skill = this.actor.get.items(li.data("item-id"));
this.actor.rollSkill(skill);
});
html.find('.weapon-label a').click((event) => {
const li = $(event.currentTarget).parents(".item");
const weapon = this.actor.getOwnedItem(li.data("item-id"));
const weapon = this.actor.get.items(li.data("item-id"));
this.actor.rollWeapon(weapon);
});
html.find('.skill-value').change((event) => {

View File

@ -38,7 +38,7 @@ export class SoSCardDeck {
this.cleanCardList();
// Randomize deck
while (this.data.deck.length != NB_POKER_CARD) {
let idx = new Roll("1d54").roll().total;
let idx = new Roll("1d54").roll( {async:false} ).total;
if (!this.data.cardState[idx - 1]) {
if (idx == 53) { // Red Joker
this.data.deck.push( { cardName: 'jr' } );

View File

@ -227,7 +227,7 @@
{{!-- Gears Tab --}}
<div class="tab gears" data-group="primary" data-tab="gears">
<div>
<h4>Total Encumbrance : {{totalEncumbrance}} / {{stats.strength.value}}</h4>
<h4>Total Encumbrance : {{totalEncumbrance}} / {{data.data.stats.strength.value}}</h4>
</div>
<div><h4>Weapons</h4></div>
<ul class="item-list alternate-list">
@ -248,9 +248,9 @@
{{#each armors as |armor key|}}
<li class="item flexrow list-item" data-item-id="{{armor.id}}">
<img class="sheet-skill-img" src="{{armor.img}}"/>
<span class="armor-label">{{armor.name}}</span>
<span class="armor-label">{{armor.data.name}}</span>
<div class="item-controls">
<a class="item-control item-worn" title="Worn">{{#if armor.data.worn}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-worn" title="Worn">{{#if armor.data.data.worn}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
@ -262,20 +262,20 @@
{{#each gearsRoot as |gear key|}}
<li class="item flexrow list-item" data-item-id="{{gear.id}}">
<img class="sheet-skill-img" src="{{gear.img}}"/>
<span class="conseq-label">{{gear.name}}</span>
<span class="conseq-label">{{gear.data.name}}</span>
<div class="item-controls">
<a class="item-control item-equip" title="Worn">{{#if armor.data.worn}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-equip" title="Worn">{{#if gear.data.data.worn}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
<ul class="item-list alternate-list list-item-margin1">
{{#each data.contains as |subgear key|}}
{{#each data.data.contains as |subgear key|}}
<li class="item flexrow list-item" data-item-id="{{subgear.id}}">
<img class="sheet-skill-img" src="{{subgear.img}}"/>
<span class="conseq-label">{{subgear.name}}</span>
<span class="conseq-label">{{subgear.data.name}}</span>
<div class="item-controls">
<a class="item-control item-equip" title="Worn">{{#if armor.data.worn}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-equip" title="Worn">{{#if subgear.data.data.worn}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>

View File

@ -1,14 +1,15 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
<img class="profile-img" src="{{data..img}}" data-edit="img" title="{{data..name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
<h1 class="charname"><input name="name" type="text" value="{{data..name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{#with data}}
<div class="tab" data-group="primary">
<div class="flexrow">
@ -35,6 +36,8 @@
<label class="generic-label">Is VAC ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="data.vac" {{checked data.vac}}/></label>
</div>
{{/with}}
{{>"systems/foundryvtt-shadows-over-sol/templates/item-commongear-sheet.html"}}
</div>

View File

@ -1,3 +1,4 @@
{{#with data}}
<div class="flexrow">
<label class="generic-label">Big</label>
<input type="text" name="data.big" value="{{data.big}}" data-dtype="Number"/>
@ -48,4 +49,4 @@
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
</div>
{{/with}}

View File

@ -1,8 +1,8 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
<img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
<h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</div>
</header>
@ -13,7 +13,7 @@
<div class="flexrow">
<label class="generic-label">Container</label>
<input type="text" name="data.container" value="{{data.container}}" data-dtype="Number"/>
<input type="text" name="data.container" value="{{data.data.container}}" data-dtype="Number"/>
</div>
{{>"systems/foundryvtt-shadows-over-sol/templates/item-commongear-sheet.html"}}
</div>

View File

@ -1,8 +1,8 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
<img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
<h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</div>
</header>

View File

@ -1,13 +1,14 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
<img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
<h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{#with data}}
<div class="tab" data-group="primary">
<div class="flexcol">
@ -35,6 +36,7 @@
</div>
</div>
</div>
{{/with}}
</section>
</form>

View File

@ -1,13 +1,14 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
<img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
<h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{#with data}}
<div class="flexcol">
<label class="generic-label">Card</label>
@ -20,6 +21,7 @@
</div>
</div>
</div>
{{/with}}
</section>
</form>

View File

@ -1,8 +1,8 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
<img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
<h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</div>
</header>
@ -13,7 +13,7 @@
<div class="flexcol">
<label class="generic-label">Description</label>
<div class="form-group medium-editor">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
{{editor content=data.ata.description target="data.description" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -1,14 +1,14 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
<img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
<h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{#with data}}
<div class="flexcol">
<label class="generic-label">Vector</label>
<input type="text" name="data.vector" value="{{data.vector}}" data-dtype="String"/>
@ -28,6 +28,6 @@
</div>
</div>
</div>
{{/with}}
</section>
</form>

View File

@ -1,14 +1,14 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
<img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
<h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{#with data}}
<div class="tab" data-group="primary">
<div class="flexcol">
<label class="generic-label">Type</label>
@ -29,6 +29,7 @@
</div>
</div>
</div>
{{/with}}
</section>
</form>

View File

@ -1,13 +1,14 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
<img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
<h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{#with data}}
<div class="tab" data-group="primary">
<div class="flexcol">
@ -23,6 +24,7 @@
</div>
</div>
</div>
{{/with}}
</section>
</form>

View File

@ -1,8 +1,8 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
<img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
<h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</div>
</header>
@ -10,7 +10,7 @@
<section class="sheet-body">
<div class="tab" data-group="primary">
{{#with data}}
<div class="flexrow">
<label class="generic-label">Cruise</label>
<input type="text" name="data.cruise" value="{{data.cruise}}" data-dtype="Number"/>
@ -35,6 +35,8 @@
<label class="generic-label">Structure</label>
<input type="text" name="data.structure" value="{{data.structure}}" data-dtype="Number"/>
</div>
{{/with}}
{{>"systems/foundryvtt-shadows-over-sol/templates/item-commongear-sheet.html"}}
</div>

View File

@ -1,13 +1,14 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
<img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
<h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{#with data}}
<div class="tab" data-group="primary">
<div class="flexcol">
@ -30,6 +31,7 @@
</div>
</div>
</div>
{{/with}}
</section>
</form>

View File

@ -1,13 +1,14 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
<img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
<h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{#with data}}
<div class="tab" data-group="primary">
@ -82,6 +83,7 @@
<label class="generic-label">Spread ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="data.spread" {{checked data.spread}}/></label>
</div>
{{/with}}
{{>"systems/foundryvtt-shadows-over-sol/templates/item-commongear-sheet.html"}}
</div>