private void HandleStairs(StairMovement s) { StairMovmentType stairMovement = m_engine.GameState.IsStairMovementSpecial(s == m_engine.Actions.MoveUpStairs); switch (stairMovement) { case StairMovmentType.QuitGame: { string text = "Leaving the dungeon will end the game early and delete your current character. To stop playing now and continue your adventure later, use save instead."; TwoButtonDialog d = new TwoButtonDialog(m_window, text); d.Closed += (o, e) => { if (((TwoButtonDialog)o).DialogResult == true) { // Do quit here? How do you quit SL? go back to main menu? } }; d.Show(); break; } case StairMovmentType.WinGame: { // Don't save if player closes window with dialog up. // m_gameInstance.ShouldSaveOnClose = false; string text = "Congratulations, you have completed the magecrawl tech demo! " + m_engine.Player.Name + " continues on without you in search of further treasure and fame. Consider telling your story to others, including the creator."; OneButtonDialog d = new OneButtonDialog(m_window, text); d.Closed += (o, e) => { // Do quit here? How do you quit SL? go back to main menu? }; d.Show(); break; } case StairMovmentType.None: { s(); m_window.UpdateWorld(); return; } } }
private void HandleStairs(StairMovement s) { StairMovmentType stairMovement = m_engine.GameState.IsStairMovementSpecial(s == m_engine.Actions.MoveUpStairs); switch (stairMovement) { case StairMovmentType.QuitGame: m_gameInstance.SetHandlerName("QuitGame", QuitReason.leaveDungeom); break; case StairMovmentType.WinGame: // Don't save if player closes window with dialog up. m_gameInstance.ShouldSaveOnClose = false; string winString = "Congratulations, you have completed the magecrawl tech demo! " + m_engine.Player.Name + " continues on without you in search of further treasure and fame. Consider telling your story to others, including the creator."; m_gameInstance.SetHandlerName("OneButtonDialog", new Pair<OnOneButtonComplete, string>(OnWinDialogComplete, winString)); break; case StairMovmentType.None: s(); m_gameInstance.UpdatePainters(); return; } }