Beispiel #1
0
        private void OnChangeTeam(object sender, EventArgs e)
        {
            ComboBox team     = (ComboBox)sender;
            char     new_team = team.SelectedItem.ToString()[0];

            Properties.Settings.Default.OptionTeam = new_team;
            Properties.Settings.Default.Save();
            FormPainter.PaintStyle(ParentForm, new_team);
        }
Beispiel #2
0
        public MainForm()
        {
            InitializeComponent();

            m_btn_timer.Text = m_pop_timer;

            if (!string.IsNullOrEmpty(m_settings.TimeRemaining))
            {
                Text = Text + " - " + m_settings.TimeRemaining;
                AddActivationTimer();
            }

            palette = FormPainter.PaintStyle(this, m_settings.OptionTeam);

            Dictionary <string, Panel> button_panels = new Dictionary <string, Panel>();

            button_panels.Add(m_teams.First(), m_lyt_friend_buttons);
            button_panels.Add(m_teams.Last(), m_lyt_target_buttons);

            foreach (string team in m_teams)
            {
                // Construt inner structure
                m_locations[team] = new List <RenamableButton>();
                m_states[team]    = new Dictionary <RenamableButton, LocationState>();

                // Fill location structure
                Panel button_panel = button_panels[team];
                m_locations[team].AddRange(button_panel.Controls.OfType <RenamableButton>());

                // Fill state structure
                foreach (RenamableButton key in m_locations[team])
                {
                    m_states[team].Add(key, new LocationState());
                }

                m_locations[team].First().InitCheckedStatus();
            }
        }