feat: rename /option -> /builder
This commit is contained in:
+12
-12
@@ -3,36 +3,36 @@ import { Command } from '../classes/Commands/Command';
|
||||
import { PlayerCommandOrigin } from '../classes/Commands/PlayerCommandOrigin';
|
||||
import { BuilderOptions } from '../classes/Builder/BuilderOptions';
|
||||
|
||||
export class OptionCommand extends Command {
|
||||
export class BuilderCommand extends Command {
|
||||
constructor() {
|
||||
super({
|
||||
name: 'option',
|
||||
description: 'construct.commands.option',
|
||||
name: 'builder',
|
||||
description: 'construct.commands.builder',
|
||||
allowedSources: [PlayerCommandOrigin],
|
||||
mandatoryParameters: [
|
||||
{ name: 'optionId', type: CustomCommandParamType.Enum },
|
||||
{ name: 'builderOption', type: CustomCommandParamType.Enum },
|
||||
{ name: 'state', type: CustomCommandParamType.Boolean }
|
||||
],
|
||||
enums: [
|
||||
{ name: 'optionId', values: ['easyPlace', 'fastEasyPlace', 'materialGrabber'] }
|
||||
{ name: 'builderOption', values: ['easyPlace', 'fastEasyPlace', 'materialGrabber'] }
|
||||
],
|
||||
permissionLevel: CommandPermissionLevel.Any,
|
||||
callback: (source, optionId, state) => this.run(source, optionId, state)
|
||||
callback: (source, builderOption, state) => this.run(source, builderOption, state)
|
||||
});
|
||||
}
|
||||
|
||||
run(source, optionId, state) {
|
||||
if (!BuilderOptions.get(optionId)) {
|
||||
source.sendMessage({ translate: 'construct.commands.option.unknownOption', with: [optionId] });
|
||||
run(source, builderOption, state) {
|
||||
if (!BuilderOptions.get(builderOption)) {
|
||||
source.sendMessage({ translate: 'construct.commands.builder.unknownOption', with: [builderOption] });
|
||||
return void 0;
|
||||
}
|
||||
system.run(() => {
|
||||
const player = source.getSource();
|
||||
BuilderOptions.setValue(optionId, player.id, state);
|
||||
source.sendMessage({ translate: 'construct.commands.option.success', with: [optionId, String(state)] });
|
||||
BuilderOptions.setValue(builderOption, player.id, state);
|
||||
source.sendMessage({ translate: 'construct.commands.builder.success', with: [builderOption, String(state)] });
|
||||
});
|
||||
return { status: CustomCommandStatus.Success };
|
||||
}
|
||||
}
|
||||
|
||||
export const optionCommand = new OptionCommand();
|
||||
export const builderCommand = new BuilderCommand();
|
||||
@@ -22,7 +22,7 @@ import './commands/LayerCommand';
|
||||
import './commands/NextLayerCommand';
|
||||
import './commands/PrevLayerCommand';
|
||||
import './commands/VerifierCommand';
|
||||
import './commands/OptionCommand';
|
||||
import './commands/BuilderCommand';
|
||||
import './commands/InstanceInfoCommand';
|
||||
import './commands/StatsCommand';
|
||||
import './commands/MaterialsCommand';
|
||||
|
||||
@@ -160,10 +160,10 @@ construct.commands.verifier=Toggle block validation overlay for a Construct inst
|
||||
construct.commands.verifier.enabled=§aEnabled verifier for instance "%1". ## Insert string: instance name
|
||||
construct.commands.verifier.disabled=§aDisabled verifier for instance "%1". ## Insert string: instance name
|
||||
|
||||
## construct:option
|
||||
construct.commands.option=Toggle your Construct builder options.
|
||||
construct.commands.option.success=§aSet option "%1" to %2. ## Insert strings: option name, option value
|
||||
construct.commands.option.unknownOption=§cUnknown option "%1". ## Insert string: option name
|
||||
## construct:builder
|
||||
construct.commands.builder=Toggle your Construct builder options.
|
||||
construct.commands.builder.success=§aSet option "%1" to %2. ## Insert strings: option name, option value
|
||||
construct.commands.builder.unknownOption=§cUnknown option "%1". ## Insert string: option name
|
||||
|
||||
## construct:instanceinfo
|
||||
construct.commands.instanceinfo=Print Construct instance details to chat.
|
||||
|
||||
Reference in New Issue
Block a user