Merge Settings & Set Layer form pages

This commit is contained in:
ForestOfLight
2025-04-19 10:55:23 -07:00
Unverified
parent a524706f50
commit 53438f3c60
3 changed files with 6 additions and 15 deletions
@@ -91,8 +91,8 @@ export class InstanceEditForm {
this.instance.decreaseLayer();
new InstanceEditForm(this.player, this.instanceName);
break;
case InstanceEditButtons.SetLayer:
this.setLayerForm();
case InstanceEditButtons.Settings:
this.settingsForm();
break;
case InstanceEditButtons.Move:
this.instance.move(this.player.dimension.id, this.player.location);
@@ -103,9 +103,6 @@ export class InstanceEditForm {
case InstanceEditButtons.MainMenu:
new MenuForm(this.player, { jumpToInstance: false });
break;
case InstanceEditButtons.Settings:
this.settingsForm();
break;
default:
this.player.sendMessage(`§cUnknown option: ${option}`);
break;
@@ -152,6 +149,7 @@ export class InstanceEditForm {
if (response.canceled)
return;
this.instance.setVerifierEnabled(response.formValues[0]);
this.instance.setLayer(parseInt(response.formValues[1]));
});
}
}
@@ -26,14 +26,6 @@ export class InstanceEditFormBuilder {
.submitButton('Rename');
}
static buildSetLayer(maxLayer, currentLayer) {
return new ModalFormData()
.title(MenuFormBuilder.menuTitle)
.label('Use the slider to select the layer. Use 0 for all layers.')
.slider("Layer", 0, maxLayer, 1, currentLayer)
.submitButton('Set Layer');
}
static async buildStatistics(instance) {
const buildStatisticsForm = new ActionFormData()
.title(MenuFormBuilder.menuTitle)
@@ -48,7 +40,9 @@ export class InstanceEditFormBuilder {
static buildSettings(instance) {
return new ModalFormData()
.title(MenuFormBuilder.menuTitle)
.label('Use the slider to select the layer. Use 0 for all layers.')
.toggle('Toggle block validation.', instance.options.verifier.isEnabled)
.slider("Layer", 0, maxLayer, 1, currentLayer)
.submitButton('§aApply');
}
}
@@ -8,7 +8,6 @@ export const InstanceEditButtons = Object.freeze({
Delete: '§cDelete Instance',
NextLayer: 'Increase Layer',
PreviousLayer: 'Decrease Layer',
SetLayer: 'Set Layer',
Move: 'Move Here',
Statistics: 'Statistics',
Settings: 'Settings'