Ejemplo n.º 1
0
 /// <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();
     });
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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();
         }
     });
 }
Ejemplo n.º 4
0
        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;
            }
        }
Ejemplo n.º 5
0
 private void OnMainPlayerDie()
 {
     MsgBoxAPI.ShowMsgBox("dead!!!", "continue the game?", "exit|continue", (arg) =>
     {
         if ((int)arg == 0)
         {
             m_game.GameExit();
         }
         else
         {
             m_game.RebornPlayer();
         }
     });
 }
Ejemplo n.º 6
0
        /// <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();
                }
            });
        }
Ejemplo n.º 7
0
        /// <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();
                }
            });
        }