Minor fixes +v9 support

This commit is contained in:
sladecraven 2021-12-20 11:54:19 +01:00
parent 474f34dadc
commit 22a92588e8
6 changed files with 22 additions and 15 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -5,14 +5,13 @@ export class PegasusCombat extends Combat {
/* -------------------------------------------- */ /* -------------------------------------------- */
async rollInitiative(ids, formula = undefined, messageOptions = {} ) { async rollInitiative(ids, formula = undefined, messageOptions = {} ) {
console.log("Initiative is requested !!!");
ids = typeof ids === "string" ? [ids] : ids; ids = typeof ids === "string" ? [ids] : ids;
const currentId = this.combatant._id; const currentId = this.combatant._id;
for (let cId = 0; cId < ids.length; cId++) { for (let cId = 0; cId < ids.length; cId++) {
const c = this.getCombatant(ids[cId]); const c = this.combatants.get(ids[cId]);
let initBonus = c.actor ? c.actor.getInitiativeScore() : 0; let initBonus = c.actor ? c.actor.getInitiativeScore() : 0;
await this.updateEmbeddedEntity("Combatant", { _id: c._id, initiative: initBonus }); let id = c._id || c.id;
await this.updateEmbeddedDocuments("Combatant", { _id: id, initiative: initBonus });
} }
return this; return this;

View File

@ -95,6 +95,12 @@ Hooks.once("ready", function () {
}); });
} }
// CSS patch for v9
if (game.version) {
let sidebar = document.getElementById("sidebar");
sidebar.style.width = "min-content";
}
welcomeMessage(); welcomeMessage();
}); });

View File

@ -1,6 +1,6 @@
{ {
"author": "Uberwald", "author": "Uberwald",
"compatibleCoreVersion": "0.8.9", "compatibleCoreVersion": "9",
"description": "Pegasus RPG system for FoundryVTT", "description": "Pegasus RPG system for FoundryVTT",
"download": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg/fvtt-pegasus-rpg.zip", "download": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg/fvtt-pegasus-rpg.zip",
"esmodules": [ "esmodules": [
@ -50,9 +50,9 @@
"styles": [ "styles": [
"styles/simple.css" "styles/simple.css"
], ],
"templateVersion": 20, "templateVersion": 21,
"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.20", "version": "0.0.21",
"background" : "./images/ui/pegasus_welcome_page.webp" "background" : "./images/ui/pegasus_welcome_page.webp"
} }

View File

@ -314,6 +314,7 @@
"range": "", "range": "",
"action": "", "action": "",
"type": "", "type": "",
"powersource": "",
"effects": "", "effects": "",
"purchasedeffects": "" "purchasedeffects": ""
}, },

View File

@ -27,16 +27,14 @@
<input type="text" class="input-numeric-short padd-right" name="data.cost" value="{{data.cost}}" data-dtype="Number"/> <input type="text" class="input-numeric-short padd-right" name="data.cost" value="{{data.cost}}" data-dtype="Number"/>
</li> </li>
<li class="flexrow"><label class="generic-label">NRG Spent</label> <li class="flexrow"><label class="generic-label">NRG Spent</label>
<select class="competence-base flexrow" type="text" name="data.costtype" value="{{data.costtype}}" data-dtype="String"> <input type="text" class="input-numeric-short padd-right" name="data.costtype" value="{{data.costtype}}" data-dtype="Number"/>
{{#select data.family}}
<option value="once">Once</option>
<option value="perlevel">Per Level</option>
<option value="perround">Per Round</option>
{{/select}}
</select>
</li> </li>
<li class="flexrow"><label class="generic-label">Range</label> <li class="flexrow"><label class="generic-label">Range</label>
<input type="text" class="input-numeric-short padd-right" name="data.range" value="{{data.range}}" data-dtype="Number"/> <select class="competence-base flexrow" type="text" name="data.range" value="{{data.range}}" data-dtype="String">
{{#select data.range}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-range.html notapplicable=true}}
{{/select}}
</select>
</li> </li>
<li class="flexrow"><label class="generic-label">Action</label> <li class="flexrow"><label class="generic-label">Action</label>
<select class="competence-base flexrow" type="text" name="data.action" value="{{data.action}}" data-dtype="String"> <select class="competence-base flexrow" type="text" name="data.action" value="{{data.action}}" data-dtype="String">
@ -58,6 +56,9 @@
{{/select}} {{/select}}
</select> </select>
</li> </li>
<li class="flexrow"><label class="generic-label">Power Source</label>
<input type="text" class="padd-right" name="data.powersource" value="{{data.powersource}}" data-dtype="String"/>
</li>
<li class="flexrow"><label class="generic-label">Available Effects</label> <li class="flexrow"><label class="generic-label">Available Effects</label>
<div class="small-editor item-text-long-line"> <div class="small-editor item-text-long-line">
{{editor content=data.effects target="data.effects" button=true owner=owner editable=editable}} {{editor content=data.effects target="data.effects" button=true owner=owner editable=editable}}