using UnityEngine; using BrewMonster.Network; namespace BrewMonster.UI { /// /// Attach to the in-game button: sends LOGOUT(1) and returns to Select Role. /// public class BtnBackToSelectRole : MonoBehaviour { public void OnClick() { // CECUIManager.Instance.ShowMessageBox( // title: "Thoát", // message: "Đang rời khỏi Thế Giới Hoàn Mỹ", // messageBoxType: MessageBoxType.YesButton // ); // CECGameRun.Instance.GetPendingLogOut().AppendForSaveConfig(new CECPendingLogoutHalf()); // UnityGameSession.ReturnToSelectRole(); OnCommandRepick(); } // void CDlgSystem3::OnCommandRepick(const char *szCommand) // { // a_LogOutput(1, "CDlgSystem3::OnCommandRepick "); // // if( !GetGameUIMan()->m_pDlgExit->IsShow() && // !GetGameUIMan()->GetDialog("Game_Quit") ) // { // AUIDialog *pMsgBox = NULL; // GetGameUIMan()->MessageBox("Game_Quit", // GetGameUIMan()->GetStringFromTable(CECCrossServer::Instance().IsOnSpecialServer() ? 10131 : 202), // MB_YESNO, A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); // pMsgBox->SetIsModal(false); // } // } void OnCommandRepick() { CECUIManager.Instance.ShowMessageBoxYes("Thoát", CECUIManager.Instance.GetInGameUIMan().GetStringFromTable(202), null, OnClickYes); } void OnClickYes() { CECGameRun.Instance.GetPendingLogOut().AppendForSaveConfig(new CECPendingLogoutHalf()); if (!UnityGameSession.Instance.GameSession.IsConnectedInternet) { //force log out half EC_Game.GetGameRun().SetLogoutFlag(1); } } } }