コード例 #1
0
ファイル: ControlBarForm.cs プロジェクト: sonygod/dotahit
        public void PrepareControls()
        {
            int sentinelPlayers = (sentinelPlayersLL.Tag is int) ? (int)sentinelPlayersLL.Tag : 1;
            int scourgePlayers  = (scourgePlayersLL.Tag is int) ? (int)scourgePlayersLL.Tag : 1;

            /*
             * set Ac[0]=Player(0)
             * set Ac[1]=Player(1)
             * set Ac[2]=Player(2)
             * set Ac[3]=Player(3)
             * set Ac[4]=Player(4)
             * set Ac[5]=Player(5)
             * set AC[0]=Player(6)
             * set AC[1]=Player(7)
             * set AC[2]=Player(8)
             * set AC[3]=Player(9)
             * set AC[4]=Player(10)
             * set AC[5]=Player(11)
             * set Ad=Player(12)
             * set AD=Player(15)
             */

            foreach (player p in player.players)
            {
                int number = p.get_id();

                if (number >= 1 && number <= 5)
                {
                    p.playing = (number <= sentinelPlayers);
                }
                else
                if (number >= 7 && number <= 11)
                {
                    p.playing = (number <= scourgePlayers + 6);
                }
                else
                {
                    p.playing = false;
                }
            }

            Current.player = player.players[1];

            Current.player.gold_changed += new DotaHIT.Jass.Native.Events.DHJassEventHandler(ControlPanelForm_gold_changed);
            Current.player.message      += new DotaHIT.Jass.Native.Events.DHJassEventHandler(ControlPanelForm_message);

            Current.player.unit_summon += new DotaHIT.Jass.Native.Events.DHJassEventHandler(player_unit_summon);

            if (actionsForm != null)
            {
                actionsForm.Close();
                actionsForm = null;
            }

            isPrepared = true;
        }
コード例 #2
0
ファイル: ControlBarForm.cs プロジェクト: sonygod/dotahit
        private void actionsB_Click(object sender, EventArgs e)
        {
            if (Current.map == null)
            {
                MessageBox.Show("Load a map first, then select a hero");
                return;
            }
            else
            if (Current.unit == null)
            {
                MessageBox.Show("Select a hero first");
                return;
            }

            if (actionsForm == null)
            {
                actionsForm       = new ActionsForm();
                actionsForm.Owner = this;
            }

            actionsForm.Visible = !actionsForm.Visible;
        }
コード例 #3
0
ファイル: ControlBarForm.cs プロジェクト: sonygod/dotahit
        private void actionsB_Click(object sender, EventArgs e)
        {
            if (Current.map == null)
            {
                MessageBox.Show("Load a map first, then select a hero");
                return;
            }
            else
                if (Current.unit == null)
                {
                    MessageBox.Show("Select a hero first");
                    return;
                }

            if (actionsForm == null)
            {
                actionsForm = new ActionsForm();
                actionsForm.Owner = this;
            }

            actionsForm.Visible = !actionsForm.Visible;
        }
コード例 #4
0
ファイル: ControlBarForm.cs プロジェクト: sonygod/dotahit
        public void PrepareControls()
        {
            int sentinelPlayers = (sentinelPlayersLL.Tag is int) ? (int)sentinelPlayersLL.Tag : 1;
            int scourgePlayers = (scourgePlayersLL.Tag is int) ? (int)scourgePlayersLL.Tag : 1;

            /*
             * set Ac[0]=Player(0)
             * set Ac[1]=Player(1)
             * set Ac[2]=Player(2)
             * set Ac[3]=Player(3)
             * set Ac[4]=Player(4)
             * set Ac[5]=Player(5)
             * set AC[0]=Player(6)
             * set AC[1]=Player(7)
             * set AC[2]=Player(8)
             * set AC[3]=Player(9)
             * set AC[4]=Player(10)
             * set AC[5]=Player(11)
             * set Ad=Player(12)
             * set AD=Player(15)
             */

            foreach (player p in player.players)
            {
                int number = p.get_id();

                if (number >= 1 && number <= 5)
                    p.playing = (number <= sentinelPlayers);
                else
                if (number >= 7 && number <= 11)
                    p.playing = (number <= scourgePlayers + 6);
                else
                    p.playing = false;
            }

            Current.player = player.players[1];

            Current.player.gold_changed += new DotaHIT.Jass.Native.Events.DHJassEventHandler(ControlPanelForm_gold_changed);
            Current.player.message += new DotaHIT.Jass.Native.Events.DHJassEventHandler(ControlPanelForm_message);

            Current.player.unit_summon += new DotaHIT.Jass.Native.Events.DHJassEventHandler(player_unit_summon);

            if (actionsForm != null)
            {
                actionsForm.Close();
                actionsForm = null;
            }

            isPrepared = true;
        }