void ExitHandler(GuiPopup inPopup, E_PopupResultCode inResult) { if (inResult == E_PopupResultCode.Ok) { QuitApplication(); } }
//--------------------------------------------------------- public static void HidePopup(GuiPopup popup) { if (popup != null) { popup.ForceClose(); } }
// ------ void DoUpgradeResultHandler(GuiPopup inPopup, E_PopupResultCode inResult) { if (inResult == E_PopupResultCode.Ok) { SetItem(m_ResearchItem); // refresh data after upgrade } }
static void OnResult(GuiPopup popup, E_PopupResultCode result) { /*if ( m_Popup == popup ) * { * m_Popup.SetButtonVisible( true ); * }*/ }
static void OnResult(GuiPopup popup, E_PopupResultCode result) { if (m_Popup == popup) { m_Popup.SetButtonVisible(true); } }
// ------ void ResetWaitResultHandler(GuiPopup inPopup, E_PopupResultCode inResult) { //Debug.Log("Waiting for buy finished. popup: " + inResult + " action status " + BuyActionStatus); if (inResult == E_PopupResultCode.Success) { if (m_ResetCloudAction != null && m_ResetCloudAction.isSucceeded == true) { //Debug.Log(Time.realtimeSinceStartup + " " + m_ResetCloudAction.status); } Owner.Back(); ResearchSupport.Instance.AnyResearchItemChanged(); SendResult(E_PopupResultCode.Success); } else { Owner.Back(); SendResult(E_PopupResultCode.Failed); } m_Cost = 0; m_RefundedMoney = 0; m_ResearchGUIDs = null; m_ResetCloudAction = null; m_CheckEquipCloudAction = null; }
public override GuiPopup ShowPopup(string popupName, string caption, string text, PopupHandler handler = null) { if (ActiveScreenName == popupName) { return(activeScreen as GuiPopup); } InputManager.FlushInput(); _DisableTopScreen(); _ShowScreen(popupName); GuiPopup popup = activeScreen as GuiPopup; if (popup != null && ActiveScreenName == popupName) { popup.SetCaption(caption); popup.SetText(text); popup.SetHandler(handler); } RefreshMenu(); return(ActiveScreenName == popupName ? popup : null); }
void MigrateGuestResult(GuiPopup popup, E_PopupResultCode result) { if (result == E_PopupResultCode.Cancel) { base.ShowScreen("PlayerProfile", false); } }
void ForgotPasswordHandler(GuiPopup inPopup, E_PopupResultCode inResult) { if (inResult != E_PopupResultCode.Cancel) { Owner.ShowPopup("MessageBox", TextDatabase.instance[0103044], TextDatabase.instance[inResult == E_PopupResultCode.Ok ? 0103047 : 0103042]); } }
// ------ void DoResearchResultHandler(GuiPopup inPopup, E_PopupResultCode inResult) { SetItem(m_ResearchItem); if (inResult == E_PopupResultCode.Success) { //Owner.Back(); } }
//------------------------------------------------------------------------------------------------------------- static void OnResult(GuiPopup popup, E_PopupResultCode result) { m_Popup.SetButtonVisible(true); if (m_Handler != null) { m_Handler(popup, result); } }
void BuyResultHandler(GuiPopup inPopup, E_PopupResultCode inResult) { if (inResult == E_PopupResultCode.Success || inResult == E_PopupResultCode.Cancel) { //success //ShopItemId selItem = m_ItemScroller.GetSelectedItem(); UpdateItemButtons(); } }
void OnFeedbackConfirmation(GuiPopup inPopup, E_PopupResultCode inResult) { if (inResult != E_PopupResultCode.Ok) { return; } ShowFeedbackForm(); }
void BuyResultHandler(GuiPopup inPopup, E_PopupResultCode inResult) { if (inResult == E_PopupResultCode.Success || inResult == E_PopupResultCode.Cancel) { //success ShopItemId selItem = m_ShopScroller.GetSelectedItem(); UpdateBuyButton(selItem); UpdateCurrentPage(selItem, true); } }
// ------ void ResetTreeResultHandler(GuiPopup inPopup, E_PopupResultCode inResult) { //if(inResult == E_PopupResultCode.Success) { foreach (ResearchItem item in m_Items) { item.StateChanged(); } } }
// HANDLERS void OnLogoutConfirmation(GuiPopup inPopup, E_PopupResultCode inResult) { if (inResult != E_PopupResultCode.Ok) { return; } CloudUser.instance.LogoutLocalUser(); GuiFrontendMain.ShowLoginMenu(); }
// HANDLERS void OnAuthenticationResult(GuiPopup inPopup, E_PopupResultCode inResult) { if (inResult == E_PopupResultCode.Success) { Exit(); } else { ShowScreen("FirstLogin", true); } }
// HANDLERS void OnLeaveConfirmation(GuiPopup inPopup, E_PopupResultCode inResult) { if (inResult != E_PopupResultCode.Ok) { return; } //Debug.Log("Exiting game"); GuiFrontendIngame.GotoMainMenu(); }
void AuthenticationResultHandler(GuiPopup inPopup, E_PopupResultCode inResult) { if (inResult == E_PopupResultCode.Success) { // close login menu Owner.Exit(); } else { //Owner.Back(); } }
IEnumerator DoUpgradeCoroutine(int upgradeIndex) { WeaponSettings.Upgrade upgrade = m_ResearchItem.GetUpgrade(upgradeIndex); if (upgrade.GoldCost > 0 && ResearchSupport.Instance.HasPlayerEnoughFunds(upgrade.GoldCost, true) == false) { ShopItemId desired = new ShopItemId((int)upgrade.ParentID, GuiShop.E_ItemType.Weapon); ShopItemId reqIAP = ShopDataBridge.Instance.GetIAPNeededForItem(desired, upgradeIndex); if (reqIAP.IsEmpty()) { yield break; } bool buySucceed = true; GuiShopNotFundsPopup.Instance.AddFundsID = reqIAP; GuiPopup popup = Owner.ShowPopup("NotFundsPopup", "", "", (inPopup, inResult) => { switch (inResult) { case E_PopupResultCode.Cancel: buySucceed = false; break; case E_PopupResultCode.Failed: buySucceed = false; break; } }); //Debug.Log("Popup Visible:" + popup.IsVisible); while (popup.IsVisible == true) { yield return(new WaitForEndOfFrame()); } if (buySucceed == false) { yield break; } //Debug.Log("IAP success:" + buySucceed); } if (ResearchSupport.Instance.HasPlayerEnoughFunds(upgrade.GoldCost, true)) { GuiPopupDoUpgrade popik = Owner.ShowPopup("DoUpgrade", "", "", DoUpgradeResultHandler) as GuiPopupDoUpgrade; popik.SetItem(m_ResearchItem, upgradeIndex); } }
IEnumerator BuyCoroutine(ShopItemId selId) { if (!ShopDataBridge.Instance.HaveEnoughMoney(selId, -1)) { ShopItemId reqIAP = ShopDataBridge.Instance.GetIAPNeededForItem(selId, -1); if (reqIAP.IsEmpty()) { yield break; } bool buySucceed = true; GuiShopNotFundsPopup.Instance.AddFundsID = reqIAP; GuiPopup popup = Owner.ShowPopup("NotFundsPopup", "", "", (inPopup, inResult) => { switch (inResult) { case E_PopupResultCode.Cancel: buySucceed = false; break; case E_PopupResultCode.Failed: buySucceed = false; break; } }); //Debug.Log("Popup Visible:" + popup.IsVisible); while (popup.IsVisible == true) { yield return(new WaitForEndOfFrame()); } if (buySucceed == false) { yield break; } //Debug.Log("IAP success:" + buySucceed); } if (ShopDataBridge.Instance.HaveEnoughMoney(selId, -1)) { //show buy confirm dialog GuiShopBuyPopup.Instance.SetBuyItem(selId); Owner.ShowPopup("ShopBuyPopup", "", "", BuyResultHandler); } }
//----------------------------------------------------------------------------------------------------------------- void InternalPopupHandler(GuiPopup inPopup, E_PopupResultCode inResult) { switch (inResult) { // forcefully closed case E_PopupResultCode.Failed: SendEvent(E_Event.Closed); return; // unhandled cases default: break; } Debug.Log("Unhandled popup result: " + inResult); }
IEnumerator JoinGang_Coroutine(string master) { m_IsJoining = true; bool canJoin = GuiFrontendMain.IsVisible; if (canJoin == true) { if (m_Master == null && IsVisible == false) { var friend = GameCloudManager.friendList.friends.Find(obj => obj.PrimaryKey == master); string nickname = GuiBaseUtils.FixNameForGui(friend.Nickname); string caption = TextDatabase.instance[0109064]; //string.Format(TextDatabase.instance[0109064], nickname); string text = string.Format(TextDatabase.instance[0109065], nickname); GuiPopup popup = GuiFrontendMain.ShowPopup("ConfirmDialog", caption, text, (inPopup, inResult) => { if (inResult != E_PopupResultCode.Ok) { canJoin = false; } }); while (popup.IsVisible == true) { yield return(new WaitForEndOfFrame()); if (m_IsJoining == false) { popup.ForceClose(); } } } if (canJoin == true) { canJoin = JoinGang(master); } } UpdateStatus(master, canJoin); m_IsJoining = false; }
void BuyWaitResultHandler(GuiPopup inPopup, E_PopupResultCode inResult) { //Debug.Log("Waiting for buy finished. popup: " + inResult + " action status " + BuyActionStatus); if (inResult == E_PopupResultCode.Success) { CloseDialog(); SendResult(E_PopupResultCode.Success); } else { //buy failed string strBuyFailed = TextDatabase.instance[02030042]; Owner.ShowPopup("ShopMessageBox", "", strBuyFailed, FailMessageBoxHandler); } m_BuyItemId = ShopItemId.EmptyId; m_BuyCloudAction = null; }
void SelectFriendPopupHandler(GuiPopup inPopup, E_PopupResultCode inResult) { SelectFriendDialog popup = inPopup as SelectFriendDialog; if (popup == null) { Debug.LogError("This handler can be used only with SelectFriendDialog !!!"); return; } if (popup.selectedFriend == SelectFriendDialog.SHOW_BEST_RESULTS) { m_StatisticsView.SetStatisticsMode(Statistics.E_Mode.CompareWithBest, ""); } else { m_StatisticsView.SetStatisticsMode(Statistics.E_Mode.CompareWithFriend, popup.selectedFriend); } }
// ------ void BuyWaitResultHandler(GuiPopup inPopup, E_PopupResultCode inResult) { //Debug.Log("Waiting for buy finished. popup: " + inResult + " action status " + BuyActionStatus); if (inResult == E_PopupResultCode.Success) { Owner.Back(); m_ResearchItem.StateChanged(); SendResult(E_PopupResultCode.Ok); } else { Owner.Back(); SendResult(E_PopupResultCode.Failed); } m_ResearchItem = null; #if !TEMPORARY_UPGRADE_HACK m_UpgradeCloudAction = null; #endif }
void BuyWaitResultHandler(GuiPopup inPopup, E_PopupResultCode inResult) { //Debug.Log("Waiting for buy finished. popup: " + inResult + " action status " + BuyActionStatus); if (inResult == E_PopupResultCode.Success) { Owner.Back(); ResearchSupport.Instance.AnyResearchItemChanged(); m_ResearchItem.StateChanged(); SendResult(E_PopupResultCode.Success); } else { Owner.Back(); SendResult(E_PopupResultCode.Failed); } m_ResearchItem = null; m_BuyCloudAction = null; m_CheckEquipCloudAction = null; }
//----------------------------------------------------------------------------------------------------------------- void OnMessageBoxEvent(GuiPopup popup, E_PopupResultCode result) { if (m_IsConnectingToLobby) { m_IsConnectingToLobby = false; LobbyClient.ToLobbyConnectionResult -= OnLobbyConnectionResult; } if (m_IsLookingForServer) { if (result == E_PopupResultCode.Ok) // User pressed the cancel button { LobbyClient.CancelFindServer(m_LastJoinRequestId); } m_IsLookingForServer = false; } if (m_IsConnectingToServer) { m_IsConnectingToServer = false; } }
void WaitForAIPurchaseHandler(GuiPopup inPopup, E_PopupResultCode inResult) { Owner.Back(); //hide buy dialog SendResult(inResult); }
void NoIAPServiceHandler(GuiPopup inPopup, E_PopupResultCode inResult) { Owner.Back(); //hide buy dialog SendResult(E_PopupResultCode.Failed); }