javascript/features/playground/playground_commands.js
// Handles the |player| modifying the |setting|, which represents a numeric value.
Handles the |player| modifying the |setting|, which represents a numeric value.
Handles the |player| modifying the |setting| which represents a numeric value .
async handleNumberSettingModification(player, setting) {
        const answer = await Question.ask(player, {
            question: setting.identifier,
            message: setting.description + '\nThe default value is {FFA500}' +
                     setting.defaultValue + '{A9C4E4}',
            leftButton: 'Update'
        });
        if (!answer)
            return;  
        if (!isSafeInteger(answer)) {
            return await MessageBox.display(player, {
                title: 'Invalid value for the ' + setting.identifier + ' setting!',
                message: Message.format(Message.LVP_SETTING_INVALID_NUMBER, answer)
            });
        }
        this.settings_().setValue(setting.identifier, toSafeInteger(answer));
        this.announceSettingChangeToAdministrators(player, setting);
        return await MessageBox.display(player, {
            title: 'The setting has been disabled!',
            message: Message.format(Message.LVP_SETTING_UPDATED, setting.identifier, answer)
        });
    }
async handleNumberSettingModification ( player , setting ) { const answer = await Question . ask ( player , { question : setting . identifier , message : setting . description + '\nThe default value is {FFA500}' + setting . defaultValue + '{A9C4E4}' , leftButton : 'Update' } ) ; if ( ! answer ) return ; if ( ! isSafeInteger ( answer ) ) { return await MessageBox . display ( player , { title : 'Invalid value for the ' + setting . identifier + ' setting!' , message : Message . format ( Message . LVP_SETTING_INVALID_NUMBER , answer ) } ) ; } this . settings_ ( ) . setValue ( setting . identifier , toSafeInteger ( answer ) ) ; this . announceSettingChangeToAdministrators ( player , setting ) ; return await MessageBox . display ( player , { title : 'The setting has been disabled!' , message : Message . format ( Message . LVP_SETTING_UPDATED , setting . identifier , answer ) } ) ; }
Handles the |player| modifying the |setting|, which represents a numeric value.
Handles the |player| modifying the |setting| which represents a numeric value .
// the |player| cancelled the dialog.