예제 #1
0
 private void BasicChatCommandButton_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     if (this.commandDetailsControl is ChatCommandDetailsControl)
     {
         this.ShowCommandEditor(new BasicChatCommandEditorControl(this, BasicCommandTypeEnum.Chat));
     }
     else if (this.commandDetailsControl is InteractiveButtonCommandDetailsControl)
     {
         InteractiveButtonCommandDetailsControl interactiveCommandDetails = (InteractiveButtonCommandDetailsControl)this.commandDetailsControl;
         this.ShowCommandEditor(new BasicInteractiveButtonCommandEditorControl(this, interactiveCommandDetails.Game, interactiveCommandDetails.Version, interactiveCommandDetails.Scene,
                                                                               (InteractiveButtonControlModel)interactiveCommandDetails.Control, BasicCommandTypeEnum.Chat));
     }
     else if (this.commandDetailsControl is InteractiveTextBoxCommandDetailsControl)
     {
         InteractiveTextBoxCommandDetailsControl interactiveCommandDetails = (InteractiveTextBoxCommandDetailsControl)this.commandDetailsControl;
         this.ShowCommandEditor(new BasicInteractiveTextBoxCommandEditorControl(this, interactiveCommandDetails.Game, interactiveCommandDetails.Version, interactiveCommandDetails.Scene,
                                                                                (InteractiveTextBoxControlModel)interactiveCommandDetails.Control, BasicCommandTypeEnum.Chat));
     }
     else if (this.commandDetailsControl is EventCommandDetailsControl)
     {
         EventCommandDetailsControl eventCommandDetails = (EventCommandDetailsControl)this.commandDetailsControl;
         if (eventCommandDetails.OtherEventType != OtherEventTypeEnum.None)
         {
             this.ShowCommandEditor(new BasicEventCommandEditorControl(this, eventCommandDetails.OtherEventType, BasicCommandTypeEnum.Chat));
         }
         else
         {
             this.ShowCommandEditor(new BasicEventCommandEditorControl(this, eventCommandDetails.EventType, BasicCommandTypeEnum.Chat));
         }
     }
     else if (this.commandDetailsControl is TimerCommandDetailsControl)
     {
         this.ShowCommandEditor(new BasicTimerCommandEditorControl(this, BasicCommandTypeEnum.Chat));
     }
 }
예제 #2
0
        protected override async Task OnLoaded()
        {
            if (this.commandDetailsControl != null)
            {
                CommandBase command = this.commandDetailsControl.GetExistingCommand();

                if (this.commandDetailsControl is InteractiveJoystickCommandDetailsControl)
                {
                    this.ShowCommandEditor(new EmptyCommandEditorControl(this, this.commandDetailsControl));
                }
                else if (command != null && command.Actions.Count > 0)
                {
                    if (command.IsBasic)
                    {
                        if (command is ChatCommand)
                        {
                            this.ShowCommandEditor(new BasicChatCommandEditorControl(this, (ChatCommand)command));
                        }
                        else if (command is InteractiveButtonCommand)
                        {
                            InteractiveButtonCommandDetailsControl interactiveCommandDetails = (InteractiveButtonCommandDetailsControl)this.commandDetailsControl;
                            this.ShowCommandEditor(new BasicInteractiveButtonCommandEditorControl(this, interactiveCommandDetails.Game, interactiveCommandDetails.Version, (InteractiveButtonCommand)command));
                        }
                        else if (command is InteractiveTextBoxCommand)
                        {
                            InteractiveTextBoxCommandDetailsControl interactiveCommandDetails = (InteractiveTextBoxCommandDetailsControl)this.commandDetailsControl;
                            this.ShowCommandEditor(new BasicInteractiveTextBoxCommandEditorControl(this, interactiveCommandDetails.Game, interactiveCommandDetails.Version, (InteractiveTextBoxCommand)command));
                        }
                        else if (command is EventCommand)
                        {
                            this.ShowCommandEditor(new BasicEventCommandEditorControl(this, (EventCommand)command));
                        }
                        else if (command is TimerCommand)
                        {
                            this.ShowCommandEditor(new BasicTimerCommandEditorControl(this, (TimerCommand)command));
                        }
                    }
                    else
                    {
                        this.ShowCommandEditor(new AdvancedCommandEditorControl(this, this.commandDetailsControl));
                    }
                }
                else if (this.commandDetailsControl is CustomCommandDetailsControl || this.commandDetailsControl is ActionGroupCommandDetailsControl)
                {
                    this.BasicChatCommandButton.Visibility  = Visibility.Collapsed;
                    this.BasicSoundCommandButton.Visibility = Visibility.Collapsed;
                }
            }

            await base.OnLoaded();
        }