Improved order of steps (#1232)

This commit is contained in:
WBHarry 2025-10-26 12:57:46 +01:00 committed by GitHub
parent d4f80b6fa1
commit 07cdcf2d78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -83,9 +83,9 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
static PARTS = {
tabs: { template: 'systems/daggerheart/templates/characterCreation/tabs.hbs' },
class: { template: 'systems/daggerheart/templates/characterCreation/tabs/class.hbs' },
ancestry: { template: 'systems/daggerheart/templates/characterCreation/tabs/ancestry.hbs' },
community: { template: 'systems/daggerheart/templates/characterCreation/tabs/community.hbs' },
class: { template: 'systems/daggerheart/templates/characterCreation/tabs/class.hbs' },
traits: { template: 'systems/daggerheart/templates/characterCreation/tabs/traits.hbs' },
experience: { template: 'systems/daggerheart/templates/characterCreation/tabs/experience.hbs' },
domainCards: { template: 'systems/daggerheart/templates/characterCreation/tabs/domainCards.hbs' },
@ -95,6 +95,13 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
};
static TABS = {
class: {
active: false,
cssClass: '',
group: 'setup',
id: 'class',
label: 'DAGGERHEART.APPLICATIONS.CharacterCreation.tabs.class'
},
ancestry: {
active: true,
cssClass: '',
@ -109,13 +116,6 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
id: 'community',
label: 'DAGGERHEART.APPLICATIONS.CharacterCreation.tabs.community'
},
class: {
active: false,
cssClass: '',
group: 'setup',
id: 'class',
label: 'DAGGERHEART.APPLICATIONS.CharacterCreation.tabs.class'
},
traits: {
active: false,
cssClass: '',
@ -156,10 +156,10 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
v.cssClass = v.active ? 'active' : '';
switch (v.id) {
case 'community':
case 'ancestry':
v.disabled = this.setup.visibility < 2;
break;
case 'class':
case 'community':
v.disabled = this.setup.visibility < 3;
break;
case 'traits':
@ -192,7 +192,7 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
}
async _prepareContext(_options) {
this.tabGroups.setup = this.tabGroups.setup ?? 'ancestry';
this.tabGroups.setup = this.tabGroups.setup ?? 'class';
const context = await super._prepareContext(_options);
context.tabs = this._getTabs(this.constructor.TABS);
@ -266,13 +266,13 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
context.isLastTab = this.tabGroups.setup === 'equipment';
switch (this.tabGroups.setup) {
case null:
case 'ancestry':
case 'class':
context.nextDisabled = this.setup.visibility === 1;
break;
case 'community':
case 'ancestry':
context.nextDisabled = this.setup.visibility === 2;
break;
case 'class':
case 'community':
context.nextDisabled = this.setup.visibility === 3;
break;
case 'traits':
@ -363,11 +363,11 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
case 4:
return this.getNrSelectedTrait() === 6 ? 5 : 4;
case 3:
return this.setup.class.uuid && this.setup.subclass.uuid ? 4 : 3;
return this.setup.community.uuid ? 4 : 3;
case 2:
return this.setup.community.uuid ? 3 : 2;
return this.setup.primaryAncestry.uuid ? 3 : 2;
case 1:
return this.setup.primaryAncestry.uuid ? 2 : 1;
return this.setup.class.uuid && this.setup.subclass.uuid ? 2 : 1;
}
}
@ -473,10 +473,10 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
static setupGoNext() {
switch (this.setup.visibility) {
case 2:
this.tabGroups.setup = 'community';
this.tabGroups.setup = 'ancestry';
break;
case 3:
this.tabGroups.setup = 'class';
this.tabGroups.setup = 'community';
break;
case 4:
this.tabGroups.setup = 'traits';