Exemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();

            initializeTrayIcon();
            assignEventHandlers();

            selected   = new bool[(int)Position.noe];
            enemies    = new Enemy[(int)Position.noe];
            countdowns = new List <Countdown>();

            for (Position pos = Position.top; pos < Position.noe; ++pos)
            {
                enemies[(int)pos] = new Enemy(pos, false); // We assume no mods to summ spell CDs for now.
            }

            hkManager  = new HotKeyManager(this.hook_KeyDown);
            hotkeyForm = new HotKeyForm(hkManager);

            populateDefaultHotkeyOptions();
            hkManager.disableHotkeys();

            // Checks if League of Legends is running
            Timer ingameChecker = new Timer();

            ingameChecker.Interval = 500;
            ingameChecker.Tick    += new System.EventHandler(this.checkIfInGame_Tick);
            ingameChecker.Start();

            // Checks if any countdown is complete, and removes if so.
            Timer countdownMonitor = new Timer();

            countdownMonitor.Interval = 5000;
            countdownMonitor.Tick    += new System.EventHandler(this.monitorCountdowns_Tick);
            countdownMonitor.Start();
        }
Exemplo n.º 2
0
        public HotKeyForm(HotKeyManager hkManager_)
        {
            InitializeComponent();
            hkManager           = hkManager_;
            this.button1.Click += new EventHandler(this.okButton_Click);
            this.AcceptButton   = this.button1;

            this.Resize      += new System.EventHandler(this.onResize);
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.onClose);

            int posx = 50;
            int sumx = 260;
            int posy = 25;
            int sumy = 25;

            for (Position pos = Position.top; pos < Position.noe; pos++)
            {
                HotkeyDisplayControl hkDisplayControl = new HotkeyDisplayControl();

                Label label = Form1.createDefaultLabel(pos.ToString());
                label.Text      = pos.ToString();
                label.Location  = new Point(posx - 40, posy + 30);
                label.ForeColor = Color.Black;

                exscape.HotkeyControl hkControl = createDefaultHotkeyControl(pos.ToString());
                hkControl.TextChanged += new EventHandler(hotkeyControl_TextChanged);
                hkControl.Location     = new Point(posx, posy += 30);

                hkDisplayControl.label            = label;
                hkDisplayControl.hkControl        = hkControl;
                hkDisplayControls[pos.ToString()] = hkDisplayControl;

                this.Controls.Add(label);
                this.Controls.Add(hkControl);
            }

            for (Spell spell = Spell.flash; spell < Spell.noe; spell++)
            {
                HotkeyDisplayControl hkDisplayControl = new HotkeyDisplayControl();

                Label label = Form1.createDefaultLabel(spell.ToString());
                label.Text      = spell.ToString();
                label.Location  = new Point(sumx - 55, sumy + 30);
                label.ForeColor = Color.Black;

                exscape.HotkeyControl hkControl = createDefaultHotkeyControl(spell.ToString());
                hkControl.TextChanged += new EventHandler(hotkeyControl_TextChanged);
                hkControl.Location     = new Point(sumx, sumy += 30);

                hkDisplayControl.label              = label;
                hkDisplayControl.hkControl          = hkControl;
                hkDisplayControls[spell.ToString()] = hkDisplayControl;

                this.Controls.Add(label);
                this.Controls.Add(hkControl);
            }

            HotkeyDisplayControl clearControl = new HotkeyDisplayControl();
            Label clearLabel = Form1.createDefaultLabel("clear");

            clearLabel.Text      = "clear";
            clearLabel.Location  = new Point(sumx - 55, sumy + 30);
            clearLabel.ForeColor = Color.Black;

            exscape.HotkeyControl clearHkControl = createDefaultHotkeyControl("clear");
            clearHkControl.TextChanged += new EventHandler(hotkeyControl_TextChanged);
            clearHkControl.Location     = new Point(sumx, sumy += 30);

            clearControl.label         = clearLabel;
            clearControl.hkControl     = clearHkControl;
            hkDisplayControls["clear"] = clearControl;

            this.Controls.Add(clearLabel);
            this.Controls.Add(clearHkControl);

            this.Hide();
        }