Exemplo n.º 1
0
 public override void Click(int x, int y)
 {
     if (m_Coins.HandleClick(x, y))
     {
         GameScene.DoBuyCoins(GameScene.MessageBoxContext.None);
     }
     else
     {
         foreach (UIButton b in m_Buttons)
         {
             if (b.Enabled)
             {
                 if (b.Click(x, y))
                 {
                     OnButton(b.ButtonID);
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
        private void IC_OnClick(object sender, DragArgs e)
        {
            if (e.Abort)
            {
                return;
            }

            if (m_MessageBox != null)
            {
                MessageBoxResult result = m_MessageBox.HandleClick(e.CurrentX, e.CurrentY);
                if (result != MessageBoxResult.NoResult)
                {
                    DoMessageBoxResult(result);
                }
                return;
            }

            if (m_SoundDialog != null)
            {
                m_SoundDialog.HandleClick(e.CurrentX, e.CurrentY);
                return;
            }

            if (m_OptionsDialog != null)
            {
                if (m_OptionsDialog.HandleClick(e.CurrentX, e.CurrentY))
                {
                    return;
                }

                // Options exited
                m_OptionsDialog = null;
            }

            if (m_CoinsDialog != null)
            {
                if (m_CoinsDialog.HandleClick(e.CurrentX, e.CurrentY))
                {
                    return;
                }
                m_CoinsDialog = null;
            }

            if (m_VipDialog != null)
            {
                if (!m_VipDialog.HandleClick(e.CurrentX, e.CurrentY))
                {
                    m_VipDialog = null;
                }
                return;
            }

            if (m_FloorSelect != null)
            {
                if (!m_FloorSelect.HandleClick(e.CurrentX, e.CurrentY))
                {
                    m_FloorSelect = null;
                }
            }
            else
            {
                foreach (Tower t in m_Towers)
                {
                    if (t.Click(e.CurrentX, e.CurrentY))
                    {
                        //ActivateTower(t);
                        SoundManager.Inst.PlaySound(SoundManager.SEInst.MenuAccept);
                        Game.Tutorial.FinishPiece(TutorialSystem.TutorialPiece.ClickTower);
                        m_FloorSelect = new FloorSelectDialog(t.Size - 3, Game.ScreenWidth, Game.ScreenHeight, Game);
                        break;
                    }
                }

                if (m_ResetTutorial.Click(e.CurrentX, e.CurrentY))
                {
                    m_MessageBox = new MessageBox("Are you sure you want to restart the tutorial?", MessageBoxButtons.YesNo, (int)MessageBoxContext.ResetTutorial, Game.ScreenWidth, Game.ScreenHeight);
                }
                if (m_Options.Click(e.CurrentX, e.CurrentY))
                {
                    m_OptionsDialog = new Options(Game);
                }
                if (m_BuyCoins.Click(e.CurrentX, e.CurrentY) ||
                    m_Coins.HandleClick(e.CurrentX, e.CurrentY))
                {
                    m_CoinsDialog = new BuyCoinsModal();
                }
                if (m_Exit.Click(e.CurrentX, e.CurrentY))
                {
                    DoExit();
                }
                if (m_SignOut.Click(e.CurrentX, e.CurrentY))
                {
                    m_MessageBox = new MessageBox("Are you sure you want to sign out?", MessageBoxButtons.YesNo, (int)MessageBoxContext.SignOut, Game.ScreenWidth, Game.ScreenHeight);
                }
                if (m_VIP.HandleClick(e.CurrentX, e.CurrentY))
                {
                    m_VipDialog = new VIPDialog();
                }
            }
        }