public InteractiveTextBoxCommandDetailsControl(InteractiveTextBoxCommand command) { this.command = command; this.Control = command.TextBox; InitializeComponent(); }
public BasicInteractiveTextBoxCommandEditorControl(CommandWindow window, InteractiveTextBoxCommand command) { this.window = window; this.command = command; InitializeComponent(); }
public BasicInteractiveTextBoxCommandEditorControl(CommandWindow window, InteractiveGameModel game, InteractiveGameVersionModel version, InteractiveTextBoxCommand command) { this.window = window; this.game = game; this.version = version; this.command = command; InitializeComponent(); }
public InteractiveTextBoxCommandDetailsControl(InteractiveGameModel game, InteractiveGameVersionModel version, InteractiveTextBoxCommand command) { this.Game = game; this.Version = version; this.command = command; this.Control = command.TextBox; InitializeComponent(); }
private async void SaveButton_Click(object sender, RoutedEventArgs e) { await this.window.RunAsyncOperation(async() => { int sparkCost = 0; if (!int.TryParse(this.SparkCostTextBox.Text, out sparkCost) || sparkCost < 0) { await MessageBoxHelper.ShowMessageDialog("Spark cost must be 0 or greater"); return; } ActionBase action = this.actionControl.GetAction(); if (action == null) { if (this.actionControl is ChatActionControl) { await MessageBoxHelper.ShowMessageDialog("The chat message must not be empty"); } else if (this.actionControl is SoundActionControl) { await MessageBoxHelper.ShowMessageDialog("The sound file path must not be empty"); } return; } RequirementViewModel requirements = new RequirementViewModel(); if (this.command == null) { this.command = new InteractiveTextBoxCommand(this.game, this.scene, this.textBox, requirements); ChannelSession.Settings.InteractiveCommands.Add(this.command); } this.command.TextBox.cost = sparkCost; await ChannelSession.Connection.UpdateInteractiveGameVersion(this.version); this.command.UseChatModeration = this.UseChatModerationCheckBox.IsChecked.GetValueOrDefault(); this.command.IsBasic = true; this.command.Actions.Clear(); this.command.Actions.Add(action); await ChannelSession.SaveSettings(); this.window.Close(); }); }
public override async Task <CommandBase> GetNewCommand() { if (await this.Validate()) { RequirementViewModel requirements = this.Requirements.GetRequirements(); if (this.command == null) { this.command = new InteractiveTextBoxCommand(this.Game, this.Scene, this.Control, requirements); ChannelSession.Settings.InteractiveCommands.Add(this.command); } this.command.TextBox.cost = int.Parse(this.SparkCostTextBox.Text); this.command.UseChatModeration = this.UseChatModerationCheckBox.IsChecked.GetValueOrDefault(); this.command.Unlocked = this.UnlockedControl.Unlocked; this.command.Requirements = requirements; await ChannelSession.Connection.UpdateInteractiveGameVersion(this.Version); return(this.command); } return(null); }