public void HideView(IViewOwner owner) { if (IsInitialized == false) { return; } if (Owner != owner) { return; } if (IsVisible == false) { return; } IsVisible = false; OnViewHide(); if (Layout != null) { Layout.Show(false); } Owner = null; }
public void ShowView(IViewOwner owner) { if (IsInitialized == false) { return; } if (Owner != null) { return; } if (IsVisible == true) { return; } IsVisible = true; Owner = owner; if (Layout != null) { Layout.Show(true); } OnViewShow(); }
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); } }
void OnFreeGoldPressed(GUIBase_Widget widget) { IViewOwner owner = Owner; owner.Back(); owner.ShowScreen("Shop:4"); }
// ----- protected override void OnViewInit() { base.OnViewInit(); if (m_ScreenLayout == null) { Debug.LogError("GuiConfirmDialog<" + name + "> :: There is not any layout specified for dialog!"); return; } GUIBase_Button.TouchDelegate[] upgradeDlgts = new GUIBase_Button.TouchDelegate[] { Upgrade1Touch, Upgrade2Touch, Upgrade3Touch, Upgrade4Touch }; for (int i = 0; i < ResearchItem.MAX_PARAMS; i++) { m_Params[i] = new Param(); m_Params[i].Parent = GuiBaseUtils.GetChild <GUIBase_Widget>(Layout, "Param" + (i + 1)); m_Params[i].OrigPos = m_Params[i].Parent.transform.localPosition; m_Params[i].Name = GuiBaseUtils.GetChildLabel(m_Params[i].Parent, "ParamName"); m_Params[i].Value = GuiBaseUtils.GetChildLabel(m_Params[i].Parent, "ParamValue"); } m_UpgradeArea = GetWidget(Layout, "Upgrade_Area").GetComponent <GUIBase_Widget>(); for (int i = 0; i < ResearchItem.MAX_UPGRADES; i++) { GUIBase_Widget parent = GuiBaseUtils.GetChild <GUIBase_Widget>(m_UpgradeArea, "Upgrade" + (i + 1)); m_Upgrades[i].m_Parent = parent; m_Upgrades[i].m_UpgradeIcon.Relink(parent); m_Upgrades[i].m_Button = GuiBaseUtils.GetChild <GUIBase_Button>(parent, "Button"); m_Upgrades[i].m_Button.RegisterTouchDelegate(upgradeDlgts[i]); m_Upgrades[i].m_CostGold = GuiBaseUtils.GetChild <GUIBase_Widget>(parent, "CostGold"); m_Upgrades[i].m_CostMoney = GuiBaseUtils.GetChild <GUIBase_Widget>(parent, "CostMoney"); m_Upgrades[i].m_CostVal = GuiBaseUtils.GetChild <GUIBase_Label>(parent, "CostVal"); m_Upgrades[i].m_Name = GuiBaseUtils.GetChild <GUIBase_Label>(parent, "Name"); m_Upgrades[i].m_Researched = GuiBaseUtils.GetChild <GUIBase_Widget>(parent, "Researched"); } m_ResearchButton = PrepareButton(m_ScreenLayout, "Research_Button", null, Delegate_Research); PrepareButton(m_ScreenLayout, "Close_Button", null, Delegate_Close); PrepareButton(m_ScreenLayout, "Funds_Button", null, (widget) => { if (BuildInfo.Version.Stage != BuildInfo.Stage.Beta) { IViewOwner owner = Owner; owner.Back(); owner.ShowScreen("Shop:3"); } }); m_Name = PrepareLabel(m_ScreenLayout, "Name"); m_Explanation = PrepareTextArea(m_ScreenLayout, "Explanation"); m_Description = PrepareTextArea(m_ScreenLayout, "Description"); m_Price = PrepareLabel(m_ScreenLayout, "Price"); m_PriceArea = GetWidget(Layout, "Price_Area").GetComponent <GUIBase_Widget>(); m_Image = GetWidget(Layout, "Image").GetComponent <GUIBase_Sprite>(); }
// ------ // Hierarchy is established - initialize visuals public void Show(IViewOwner owner) { m_IsVisible = true; m_Owner = owner; RecomputeState(); RefreshVisuals(); m_Icon.Show(); }
// PUBLIC METHODS public void Init(IViewOwner owner) { m_Owner = owner; // setup input m_InputController.OnProcessInput += OnProcessInput; InputManager.Register(m_InputController); }
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); }
// ------ public void Hide() { m_IsVisible = false; m_Owner = null; m_Icon.Hide(); }
// MONOBEHAVIOUR INTERFACE void Awake() { m_Menu = GetComponent <GuiMenu>(); CloudUser.authenticationChanged += OnUserAuthenticationChanged; }