start reformating strings into RawMessages
This commit is contained in:
@@ -20,10 +20,21 @@ export class BuilderForm {
|
||||
for (let i = 0; i < optionIds.length; i++) {
|
||||
const option = BuilderOptions.get(optionIds[i]);
|
||||
const changedToValue = option.setValue(this.player.id, formValues[i]);
|
||||
if (changedToValue === true)
|
||||
this.player.sendMessage(`§a${option.displayName} is now enabled!§7 ${option.howToUse}`);
|
||||
else if (changedToValue === false)
|
||||
this.player.sendMessage(`§c${option.displayName} is now disabled.`)
|
||||
if (changedToValue === true) {
|
||||
this.player.sendMessage({ rawtext: [
|
||||
{ text: `§a` },
|
||||
option.displayName,
|
||||
{ translate: 'construct.option.enabled' },
|
||||
{ text: `§7 ` },
|
||||
{ translate: option.howToUse }
|
||||
]});
|
||||
} else if (changedToValue === false) {
|
||||
this.player.sendMessage({ rawtext: [
|
||||
{ text: `§c` },
|
||||
option.displayName,
|
||||
{ translate: 'construct.option.disabled' }
|
||||
]});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ export class BuilderFormBuilder {
|
||||
.title(MenuFormBuilder.menuTitle);
|
||||
for (const optionId of BuilderOptions.getOptionIds()) {
|
||||
const option = BuilderOptions.get(optionId);
|
||||
form.toggle(`${option.displayName}`, { defaultValue: option.isEnabled(player.id), tooltip: option.description });
|
||||
form.toggle(option.displayName, { defaultValue: option.isEnabled(player.id), tooltip: option.description });
|
||||
}
|
||||
form.submitButton('§2Apply');
|
||||
form.submitButton({ translate: "construct.menu.submit" });
|
||||
return form;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user