Example #1
0
 private void ComboboxStateOverride_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
 {
     if (AmeisenBot != null)
     {
         ((AmeisenBotLogic)AmeisenBot.Logic).ChangeMode((BotMode)comboboxStateOverride.SelectedItem);
         buttonStateConfig.IsEnabled = StateConfigWindows.ContainsKey((BotMode)comboboxStateOverride.SelectedItem);
     }
 }
Example #2
0
 private void ComboboxStateOverride_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
 {
     if (AmeisenBot != null)
     {
         AmeisenBot.StateMachine.StateOverride = (BotState)comboboxStateOverride.SelectedItem;
         buttonStateConfig.IsEnabled           = StateConfigWindows.ContainsKey((BotState)comboboxStateOverride.SelectedItem);
     }
 }
Example #3
0
        private void ButtonStateConfig_Click(object sender, RoutedEventArgs e)
        {
            if (StateConfigWindows.ContainsKey((BotMode)comboboxStateOverride.SelectedItem))
            {
                Window selectedWindow = StateConfigWindows[(BotMode)comboboxStateOverride.SelectedItem];
                selectedWindow.ShowDialog();

                if (((IStateConfigWindow)selectedWindow).ShouldSave)
                {
                    AmeisenBot.ReloadConfig(((IStateConfigWindow)selectedWindow).Config);
                    SaveConfig();
                }
            }
        }