How to use the @casual-simulation/aux-common.calculateFormattedBotValue function in @casual-simulation/aux-common

To help you get started, we’ve selected a few @casual-simulation/aux-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github casual-simulation / aux / src / aux-server / aux-web / aux-player / PlayerApp / PlayerApp.ts View on Github external
private _updateInput(
        calc: BotCalculationContext,
        bot: Bot,
        tag: string,
        options: Partial
    ) {
        this.inputDialogInput = tag;
        this.inputDialogType = options.type || 'text';
        this.inputDialogSubtype = options.subtype || 'basic';
        this._inputDialogTarget = bot;
        this.inputDialogInputValue =
            calculateFormattedBotValue(
                calc,
                this._inputDialogTarget,
                this.inputDialogInput
            ) || '';

        if (typeof options.placeholder !== 'undefined') {
            this.inputDialogPlaceholder = options.placeholder;
        } else {
            this.inputDialogPlaceholder = this.inputDialogInput;
        }
    }
github casual-simulation / aux / src / aux-server / aux-web / aux-player / MenuBot / MenuBot.ts View on Github external
private _updateLabel(calc: BotCalculationContext, bot: Bot) {
        let label = bot.tags['aux.label'];
        if (label) {
            this.label = calculateFormattedBotValue(calc, bot, 'aux.label');
            const labelColor = bot.tags['aux.label.color'];
            if (labelColor) {
                this.labelColor = calculateFormattedBotValue(
                    calc,
                    bot,
                    'aux.label.color'
                );
            } else {
                this.labelColor = '#000';
            }
        } else {
            this.label = '';
        }
    }
}
github casual-simulation / aux / src / aux-server / aux-web / aux-player / MenuBot / MenuBot.ts View on Github external
private _updateLabel(calc: BotCalculationContext, bot: Bot) {
        let label = bot.tags['aux.label'];
        if (label) {
            this.label = calculateFormattedBotValue(calc, bot, 'aux.label');
            const labelColor = bot.tags['aux.label.color'];
            if (labelColor) {
                this.labelColor = calculateFormattedBotValue(
                    calc,
                    bot,
                    'aux.label.color'
                );
            } else {
                this.labelColor = '#000';
            }
        } else {
            this.label = '';
        }
    }
}