void Delegate_Migrate(GUIBase_Widget inInstigator) { bool invalid = false; if (string.IsNullOrEmpty(m_Email) == true) { invalid = true; } if (invalid == false) { Match match = new Regex(EMAIL_PATTERN).Match(m_Email ?? ""); invalid = match.Success ? false : true; } if (invalid == false) { UserRequestMigrate action = new UserRequestMigrate(PrimaryKey, Password, m_Email); GameCloudManager.AddAction(action); PrimaryKey = string.Empty; Password = string.Empty; IViewOwner owner = Owner; owner.Back(); SendResult(E_PopupResultCode.Ok); owner.ShowPopup("MessageBox", TextDatabase.instance[00107032], TextDatabase.instance[m_FinalMessageID], InfoPopupConfirmation); } else { Owner.ShowPopup("MessageBox", TextDatabase.instance[00107030], TextDatabase.instance[00107040], null); } }
// ------ public void ButtonPressed() { if (m_Owner != null) { GuiPopupViewResearchItem popik = m_Owner.ShowPopup("ViewResearchItem", "", "", null) as GuiPopupViewResearchItem; popik.SetItem(this); } }
IEnumerator PasswordRecoveryRequest_Coroutine() { if (string.IsNullOrEmpty(m_UserName) == true) { yield break; } string username = m_UserName; IViewOwner owner = Owner; owner.Back(); GuiPopupMessageBox popup = (GuiPopupMessageBox)owner.ShowPopup("MessageBox", TextDatabase.instance[0103044], TextDatabase.instance[0103043]); popup.SetButtonVisible(false); yield return(new WaitForSeconds(0.2f)); string primaryKey; { UserGetPrimaryKey action = new UserGetPrimaryKey(username); GameCloudManager.AddAction(action); while (action.isDone == false) { yield return(new WaitForEndOfFrame()); } primaryKey = action.primaryKey; } E_PopupResultCode result; { ForgotPassword action = new ForgotPassword(primaryKey); GameCloudManager.AddAction(action); while (action.isDone == false) { yield return(new WaitForEndOfFrame()); } result = action.isSucceeded == true ? E_PopupResultCode.Ok : E_PopupResultCode.Failed; } popup.ForceClose(); SendResult(result); }
IEnumerator AddNewFriend_Coroutine() { string username = Username; string primaryKey = PrimaryKey; string nickname = Nickname; string message = Message; IViewOwner owner = Owner; owner.Back(); GuiPopupMessageBox popup = (GuiPopupMessageBox)owner.ShowPopup("MessageBox", TextDatabase.instance[02040204], TextDatabase.instance[00103043]); popup.SetButtonVisible(false); yield return(new WaitForSeconds(0.2f)); if (string.IsNullOrEmpty(primaryKey) == true) { UserGetPrimaryKey action = new UserGetPrimaryKey(username); GameCloudManager.AddAction(action); while (action.isDone == false) { yield return(new WaitForEndOfFrame()); } primaryKey = action.primaryKey; } GameCloudManager.friendList.AddNewFriend(primaryKey, username, nickname, message); popup.ForceClose(); SendResult(E_PopupResultCode.Ok); }
// GUIVIEW INTERFACE protected override void OnViewShow() { base.OnViewShow(); GuiBaseUtils.RegisterButtonDelegate(Layout, "Close_Button", () => { Owner.Back(); SendResult(E_PopupResultCode.Cancel); }, null); GuiBaseUtils.RegisterButtonDelegate(Layout, "OK_Button", () => { IViewOwner owner = Owner; owner.Back(); switch (m_Type) { case E_Type.None: break; case E_Type.Item: if (m_Data != null) { var item = (UserGuideAction_Offers.ItemDesc)m_Data; owner.ShowScreen("ResearchMain:" + item.Item.m_GuiPageIndex); item.Item.ButtonPressed(); } break; case E_Type.PremiumAcct: owner.ShowPopup("PremiumAccount", "", "", null); break; case E_Type.MoreApps: owner.DoCommand("MoreApps"); break; case E_Type.FreeGold: // show tapjoy native plugin gui GuiShopUtils.EarnFreeGold(new ShopItemId((int)E_FundID.TapJoyInApp, GuiShop.E_ItemType.Fund)); break; case E_Type.Hat: owner.ShowScreen("Shop:2"); break; case E_Type.Consumable: owner.ShowScreen("Shop:0"); break; default: throw new System.IndexOutOfRangeException(); } SendResult(E_PopupResultCode.Ok); }, null); }