mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
[PR][Fix] Cleaned Up Countdown Ownership View (#1459)
* Removed the disabled default ownership select in the ownership view. Added a fallback text incase there are no players added yet * Corrected noPlayers condition
This commit is contained in:
parent
f8b003b304
commit
92b31b71a7
5 changed files with 22 additions and 21 deletions
|
|
@ -586,6 +586,7 @@
|
||||||
},
|
},
|
||||||
"OwnershipSelection": {
|
"OwnershipSelection": {
|
||||||
"title": "Ownership Selection - {name}",
|
"title": "Ownership Selection - {name}",
|
||||||
|
"noPlayers": "No players to assign ownership to",
|
||||||
"default": "Default Ownership"
|
"default": "Default Ownership"
|
||||||
},
|
},
|
||||||
"ReactionRoll": {
|
"ReactionRoll": {
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ export default class OwnershipSelection extends HandlebarsApplicationMixin(Appli
|
||||||
|
|
||||||
async _prepareContext(_options) {
|
async _prepareContext(_options) {
|
||||||
const context = await super._prepareContext(_options);
|
const context = await super._prepareContext(_options);
|
||||||
context.ownershipDefaultOptions = CONFIG.DH.GENERAL.basicOwnershiplevels;
|
|
||||||
context.ownershipOptions = CONFIG.DH.GENERAL.simpleOwnershiplevels;
|
context.ownershipOptions = CONFIG.DH.GENERAL.simpleOwnershiplevels;
|
||||||
context.defaultOwnership = this.defaultOwnership;
|
context.defaultOwnership = this.defaultOwnership;
|
||||||
context.ownership = game.users.reduce((acc, user) => {
|
context.ownership = game.users.reduce((acc, user) => {
|
||||||
|
|
@ -52,6 +51,7 @@ export default class OwnershipSelection extends HandlebarsApplicationMixin(Appli
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
context.showOwnership = Boolean(Object.keys(context.ownership).length);
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hint {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
footer {
|
footer {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
button {
|
button {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "daggerheart",
|
"id": "daggerheart",
|
||||||
"title": "Daggerheart",
|
"title": "Daggerheart",
|
||||||
"description": "An unofficial implementation of the Daggerheart system",
|
"description": "An unofficial implementation of the Daggerheart system",
|
||||||
"version": "1.3.2",
|
"version": "1.4.0",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "13.346",
|
"minimum": "13.346",
|
||||||
"verified": "13.351",
|
"verified": "13.351",
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,19 @@
|
||||||
<div class="ownership-outer-container">
|
<div class="ownership-outer-container">
|
||||||
<div class="form-group">
|
{{#if showOwnership}}
|
||||||
<div class="form-fields">
|
<ul class="ownership-list">
|
||||||
<label>{{localize "DAGGERHEART.APPLICATIONS.OwnershipSelection.default"}}</label>
|
{{#each ownership as |player id|}}
|
||||||
<select name="default" data-dtype="Number" disabled>
|
<li class="ownership-container">
|
||||||
{{selectOptions ownershipDefaultOptions selected=defaultOwnership labelAttr="label" valueAttr="value" localize=true }}
|
<img src="{{player.img}}" />
|
||||||
</select>
|
<span>{{player.name}}</span>
|
||||||
</div>
|
<select name="{{concat "ownership." id}}" data-dtype="Number">
|
||||||
</div>
|
{{selectOptions @root.ownershipOptions selected=player.ownership labelAttr="label" valueAttr="value" localize=true }}
|
||||||
<ul class="ownership-list">
|
</select>
|
||||||
{{#each ownership as |player id|}}
|
</li>
|
||||||
<li class="ownership-container">
|
{{/each}}
|
||||||
<img src="{{player.img}}" />
|
</ul>
|
||||||
<span>{{player.name}}</span>
|
{{else}}
|
||||||
<select name="{{concat "ownership." id}}" data-dtype="Number">
|
<span class="hint">{{localize "DAGGERHEART.APPLICATIONS.OwnershipSelection.noPlayers"}}</span>
|
||||||
{{selectOptions @root.ownershipOptions selected=player.ownership labelAttr="label" valueAttr="value" localize=true }}
|
{{/if}}
|
||||||
</select>
|
|
||||||
</li>
|
|
||||||
{{/each}}
|
|
||||||
</ul>
|
|
||||||
<footer class="flexrow">
|
<footer class="flexrow">
|
||||||
<button type="submit">{{localize "Save"}}</button>
|
<button type="submit">{{localize "Save"}}</button>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue