[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:
WBHarry 2025-12-24 01:09:51 +01:00 committed by GitHub
parent f8b003b304
commit 92b31b71a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 21 deletions

View file

@ -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": {

View file

@ -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;
} }

View file

@ -36,6 +36,10 @@
} }
} }
.hint {
text-align: center;
}
footer { footer {
margin-top: 10px; margin-top: 10px;
button { button {

View file

@ -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",

View file

@ -1,12 +1,5 @@
<div class="ownership-outer-container"> <div class="ownership-outer-container">
<div class="form-group"> {{#if showOwnership}}
<div class="form-fields">
<label>{{localize "DAGGERHEART.APPLICATIONS.OwnershipSelection.default"}}</label>
<select name="default" data-dtype="Number" disabled>
{{selectOptions ownershipDefaultOptions selected=defaultOwnership labelAttr="label" valueAttr="value" localize=true }}
</select>
</div>
</div>
<ul class="ownership-list"> <ul class="ownership-list">
{{#each ownership as |player id|}} {{#each ownership as |player id|}}
<li class="ownership-container"> <li class="ownership-container">
@ -18,6 +11,9 @@
</li> </li>
{{/each}} {{/each}}
</ul> </ul>
{{else}}
<span class="hint">{{localize "DAGGERHEART.APPLICATIONS.OwnershipSelection.noPlayers"}}</span>
{{/if}}
<footer class="flexrow"> <footer class="flexrow">
<button type="submit">{{localize "Save"}}</button> <button type="submit">{{localize "Save"}}</button>
</footer> </footer>