void M_Input_OnKeyUp(object sender, KeyArgs e) { if (m_MessageBox != null) { } else if (m_CoinsDialog != null) { if (!m_CoinsDialog.OnKeyDown(e)) { m_CoinsDialog = null; } } else if (m_EndScreen != null) { } else if (m_PauseMenu != null) { if (e.Key == Keys.Escape) { SoundManager.Inst.PlaySound(SoundManager.SEInst.MenuCancel); UnPause(); } } else if (m_GamePanel.CellDialog != null) { if (!m_GamePanel.CellDialog.OnKeyUp(e)) { m_GamePanel.CloseCellDialog(); SoundManager.Inst.PlaySound(SoundManager.SEInst.MenuCancel); } } else { if (e.Key == Keys.Escape) { SoundManager.Inst.PlaySound(SoundManager.SEInst.MenuAccept); Pause(); } } }
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 M_Input_OnClick(object sender, DragArgs e) { if (e.Abort) { return; } int iX = e.CurrentX; int iY = e.CurrentY; if (m_MessageBox != null) { MessageBoxResult res = m_MessageBox.HandleClick(iX, iY); if (res != MessageBoxResult.NoResult) { DoMessageBoxResult(res); } } else if (m_CoinsDialog != null) { if (m_CoinsDialog.HandleClick(e.CurrentX, e.CurrentY)) { return; } m_CoinsDialog = null; } else if (m_EndScreen != null) { if (!m_EndScreen.HandleClick(iX, iY)) { m_EndScreen = null; } } else if (m_PauseMenu != null) { if (!m_PauseMenu.HandleClick(iX, iY)) { switch (m_PauseMenu.m_iSelection) { case 0: // Resume Game UnPause(); break; case 1: // Reset Puzzle m_Puzzle.Reset(); UnHideAllClues(); UnPause(); break; case 2: // Unhide Clues UnHideAllClues(); UnPause(); break; case 3: // Buy Coins m_CoinsDialog = new BuyCoinsModal(); break; case 4: // Options break; case 5: // Save & Exit UnPause(); SavePuzzle(); Game.GotoScene(new HubScene(Game)); break; } } } else { foreach (UIPanel p in m_UIPanels) { if (p.Contains(e.CurrentX, e.CurrentY)) { p.Click(e.CurrentX, e.CurrentY); break; } } } }
public void DoBuyCoins(MessageBoxContext context) { Pause(); m_CoinsDialog = new BuyCoinsModal(); }