Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        protected override void OnResize(EventArgs e)
        {
            float h = (Size.Height / m_old_size.Height);
            float w = (Size.Width / m_old_size.Width);

            List <Control> controls = new List <Control>();

            FormPainter.GetControls(this, controls);
            foreach (Control control in controls)
            {
                control.Font = new Font(control.Font.FontFamily, control.Font.SizeInPoints * h, control.Font.Style);
            }
            m_old_size = Size;
            base.OnResize(e);
        }
Ejemplo n.º 3
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();
            }
        }