/// <summary> /// end the game /// </summary> private void OnGameEnd() { m_game = null; MsgBoxAPI.ShowMsgBox("Game Over", "your score for this game is: " + cur_score, "OK", (arg) => { UIManager.Instance.GoBackPage(); }); }
void Start() { var arg = new UIMsgBox.UIMsgBoxArg(); arg.title = "megbox Test"; arg.content = "it works! lol"; arg.btnText = "OK|Cancel|Close"; //UIManager.Instance.OpenWindow("Common/UIMsgBox", arg); MsgBoxAPI.ShowMsgBox("I am a msg box", "MsgBox with title", "OK|cancle|close", OnMsgBoxClick); }
public void OnBtnUserInfo() { MsgBoxAPI.ShowMsgBox("re-login", "want to relogin?", "ok|cancel", btnNum => { if ((int)btnNum == 0) { HomeModule module = ModuleManager.Instance.GetModule(ModuleConst.HomeModule) as HomeModule; module.TryReLogin(); } }); }
public void OpenModule(string name, object arg) { switch (name) { case ModuleConst.PVEModule: case ModuleConst.PVPModule: ModuleManager.Instance.ShowModule(name, arg); break; default: MsgBoxAPI.ShowMsgBox(name, "Module to be implemented...", "ok"); break; } }
private void OnMainPlayerDie() { MsgBoxAPI.ShowMsgBox("dead!!!", "continue the game?", "exit|continue", (arg) => { if ((int)arg == 0) { m_game.GameExit(); } else { m_game.RebornPlayer(); } }); }
/// <summary> /// Pause the game /// </summary> public void OnBtnPauseGame() { m_game.Pause(); MsgBoxAPI.ShowMsgBox("Pause", "Exit this game?", "OK|Resume Game", (arg) => { if ((int)arg == 0) { m_game.Terminate(); } else { m_game.Resume(); } }); }
/// <summary> /// when the main player is died /// </summary> private void OnMainPlayerDie() { m_game.Pause(); MsgBoxAPI.ShowMsgBox("You died!!!", "reborn to play again?", "exit|continue", (arg) => { if ((int)arg == 0) { m_game.Terminate(); } else { m_game.Resume(); m_game.RebornPlayer(); } }); }