move howto to top-level menu

This commit is contained in:
ForestOfLight
2025-12-29 22:35:20 -08:00
Unverified
parent 5e764bfb48
commit f561d281ee
4 changed files with 18 additions and 18 deletions
+3 -4
View File
@@ -34,6 +34,9 @@ export class MenuForm {
if (selection === 0) {
new BuilderForm(this.player);
return void 0;
} else if (selection == structureCollection.getInstanceNames().length + 2) {
MenuFormBuilder.buildHowTo().show(this.player);
return void 0;
} else {
selection--;
const selectedInstanceName = structureCollection.getInstanceNames()[selection];
@@ -80,10 +83,6 @@ export class MenuForm {
return MenuFormBuilder.buildAllStructures().show(this.player).then((response) => {
if (response.canceled)
return;
if (response.selection === structureCollection.getWorldStructureIds().length + 1) {
MenuFormBuilder.buildHowTo().show(this.player);
return;
}
const selectedStructureId = structureCollection.getWorldStructureIds()[response.selection];
return selectedStructureId || this.getOtherStructureId();
});
+7 -6
View File
@@ -13,6 +13,7 @@ export class MenuFormBuilder {
allInstanceNameForm.button(`${structureCollection.get(instanceName).isEnabled() ? '§2' : '§c'}${instanceName}`);
});
allInstanceNameForm.button({ translate: 'construct.mainmenu.newinstance' });
allInstanceNameForm.button({ translate: 'construct.mainmenu.howto' });
return allInstanceNameForm;
}
@@ -45,12 +46,12 @@ export class MenuFormBuilder {
static buildHowTo() {
const message = { rawtext: [
{ translate: 'construct.mainmenu.selectstructure.howto.add.header' }, { text: '\n' },
{ translate: 'construct.mainmenu.selectstructure.howto.add.structureblock' }, { text: '\n' },
{ translate: 'construct.mainmenu.selectstructure.howto.add.or' }, { text: '\n' },
{ translate: 'construct.mainmenu.selectstructure.howto.add.mcstructure' }, { text: '\n' },
{ text: '\n' }, { translate: 'construct.mainmenu.selectstructure.howto.remove.header' }, { text: '\n' },
{ translate: 'construct.mainmenu.selectstructure.howto.remove.body' }, { text: '\n' },
{ translate: 'construct.mainmenu.howto.add.header' }, { text: '\n' },
{ translate: 'construct.mainmenu.howto.add.structureblock' }, { text: '\n' },
{ translate: 'construct.mainmenu.howto.add.or' }, { text: '\n' },
{ translate: 'construct.mainmenu.howto.add.mcstructure' }, { text: '\n' },
{ text: '\n' }, { translate: 'construct.mainmenu.howto.remove.header' }, { text: '\n' },
{ translate: 'construct.mainmenu.howto.remove.body' }, { text: '\n' },
] };
return new ActionFormData()
.title(this.menuTitle)