private void IC_OnKeyDown(object sender, KeyArgs e) { if (m_FloorSelect != null) { if (!m_FloorSelect.OnKeyDown(e)) { m_FloorSelect = null; } } else if (m_CoinsDialog != null) { if (!m_CoinsDialog.OnKeyDown(e)) { m_CoinsDialog = null; } } else { if (e.Key == Keys.Escape) { DoExit(); } } }
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(); } } }
private void IC_OnClick(object sender, DragArgs e) { if( e.Abort ) 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); Game.Tutorial.FinishPiece(TutorialSystem.TutorialPiece.ClickTower); m_FloorSelect = new FloorSelectDialog(t.Size - 3, Game.ScreenWidth, Game.ScreenHeight, Game); break; } } } }