This commit is contained in:
sladecraven 2022-01-12 17:21:37 +01:00
parent 5479605214
commit a5eb96cd97
8 changed files with 35 additions and 13 deletions

View File

@ -348,6 +348,11 @@ export class PegasusItemSheet extends ItemSheet {
specArray.push( newItem ); specArray.push( newItem );
await this.object.update( { 'data.recoveryrollspec': specArray} ); await this.object.update( { 'data.recoveryrollspec': specArray} );
} }
if ( event.toElement.className =='drop-effect-specaffected') {
let specArray = duplicate(this.object.data.data.specaffected);
specArray.push( newItem );
await this.object.update( { 'data.specaffected': specArray} );
}
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -23,7 +23,11 @@ export class PegasusUtility {
Handlebars.registerHelper('upper', function (text) { Handlebars.registerHelper('upper', function (text) {
return text.toUpperCase(); return text.toUpperCase();
}); });
Handlebars.registerHelper('upperFirst', function (text) {
if (typeof text !== 'string') return text
return text.charAt(0).toUpperCase() + text.slice(1)
});
} }

View File

@ -1160,6 +1160,7 @@ ul, li {
.ul-level1 { .ul-level1 {
padding-left: 2rem; padding-left: 2rem;
} }
.drop-effect-specaffected,
.drop-effect-spec, .drop-effect-spec,
.drop-ability-weapon, .drop-ability-weapon,
.drop-ability-armor, .drop-ability-armor,

View File

@ -100,9 +100,9 @@
"styles": [ "styles": [
"styles/simple.css" "styles/simple.css"
], ],
"templateVersion": 49, "templateVersion": 51,
"title": "Pegasus RPG", "title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "0.0.49", "version": "0.0.51",
"background" : "./images/ui/pegasus_welcome_page.webp" "background" : "./images/ui/pegasus_welcome_page.webp"
} }

View File

@ -180,6 +180,7 @@
"genre": "", "genre": "",
"effectlevel": 0, "effectlevel": 0,
"stataffected": "", "stataffected": "",
"specaffected": [],
"statdice": false, "statdice": false,
"bonusdice": false, "bonusdice": false,
"otherdice": false, "otherdice": false,

View File

@ -230,8 +230,9 @@
<li class="item stat flexrow list-item" data-arme-id="{{effect.id}}" data-item-id="{{effect._id}}"> <li class="item stat flexrow list-item" data-arme-id="{{effect.id}}" data-item-id="{{effect._id}}">
<img class="sheet-competence-img" src="{{effect.img}}" /> <img class="sheet-competence-img" src="{{effect.img}}" />
<span class="generic-label">{{effect.name}}</span> <span class="generic-label">{{effect.name}}</span>
<span class="generic-label">{{effect.data.type}}</span> <span class="generic-label">{{upperFirst effect.data.type}}</span>
<span class="generic-label">{{effect.data.genre}}</span> <span class="generic-label">{{upperFirst effect.data.genre}}</span>
<span class="generic-label">Lvl:{{effect.data.effectlevel}}</span>
<div class="item-controls"> <div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></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> <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>

View File

@ -35,6 +35,22 @@
<input type="text" class="input-numeric-short padd-right" name="data.effectlevel" value="{{data.effectlevel}}" data-dtype="Number"/> <input type="text" class="input-numeric-short padd-right" name="data.effectlevel" value="{{data.effectlevel}}" data-dtype="Number"/>
</li> </li>
<li class="flexrow"> <label class="generic-label">Affected Specialisations </label></li>
<li class="flexrow">
<ul class="ul-level1">
<li class="flexrow"><div class="drop-effect-specaffected"><label>Drop Specialisations here !</label></div>
</li>
{{#each data.specaffected as |spec idx|}}
<li class="flexrow">
<label name="data.specaffected[{{idx}}].name"><a class="view-subitem" data-type="specaffected" data-index="{{idx}}">{{spec.name}}</a></label>
<div class="item-controls padd-left">
<a class="item-control delete-subitem padd-left" data-type="specaffected" data-index="{{idx}}" title="Delete Spec"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</li>
{{#if (eq data.genre "positive")}} {{#if (eq data.genre "positive")}}
<li class="flexrow"><label class="generic-label">Affected Stat</label> <li class="flexrow"><label class="generic-label">Affected Stat</label>

View File

@ -18,13 +18,7 @@
{{/select}} {{/select}}
</select> </select>
</li> </li>
<li class="flexrow"><label class="generic-label">Move Rate (MR)</label>
<select class="competence-base flexrow" type="text" name="data.MR" value="{{data.MR}}" data-dtype="Number">
{{#select data.MR}}
{{{optionsDiceList}}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Level</label> <li class="flexrow"><label class="generic-label">Level</label>
<select class="competence-base flexrow" type="text" name="data.level" value="{{data.level}}" data-dtype="Number"> <select class="competence-base flexrow" type="text" name="data.level" value="{{data.level}}" data-dtype="Number">
{{#select data.level}} {{#select data.level}}