// ------ GuiPopupResearchWait.E_AsyncOpStatus GetActionStatus() { if (m_CheckEquipCloudAction == null) { if (/*(m_BuyCloudAction.isFailed == true) ||*/ (m_BuyCloudAction.isSucceeded == true)) { m_CheckEquipCloudAction = GuiShopUtils.ValidateEquip(); if (m_CheckEquipCloudAction != null) { GameCloudManager.AddAction(m_CheckEquipCloudAction); return(DeduceActionStatus(m_CheckEquipCloudAction)); } else { return(GuiPopupResearchWait.E_AsyncOpStatus.Finished); } } else { return(DeduceActionStatus(m_BuyCloudAction)); } } else { return(DeduceActionStatus(m_CheckEquipCloudAction)); } }
void OnFreeButton(bool inside) { if (!inside) { return; } GuiShopUtils.EarnFreeGold(new ShopItemId((int)E_FundID.TapJoyInApp, GuiShop.E_ItemType.Fund)); }
void FixEquipList() { BaseCloudAction action = GuiShopUtils.ValidateEquip(); if (action != null) { //Debug.Log("FixEquipListAfterResearch"); GameCloudManager.AddAction(action); } }
public void SendRequestForSpawn() { GameState.State = ClientGameState.WaitingForSpawn; //check equip before spawn: BaseCloudAction action = GuiShopUtils.ValidateEquip(); if (action != null) { Debug.Log("Fixing Equip before spawn"); GameCloudManager.AddAction(action); } StartCoroutine(WaitForCloudManagerForSpawn()); }
// ------ GuiPopupResearchWait.E_AsyncOpStatus GetActionStatus() { if (m_GetPPICloudAction == null) { if (m_ResetCloudAction.isDone == true) { m_GetPPICloudAction = new FetchPlayerPersistantInfo(CloudUser.instance.authenticatedUserID); GameCloudManager.AddAction(m_GetPPICloudAction); return(DeduceActionStatus(m_GetPPICloudAction)); } else { return(DeduceActionStatus(m_ResetCloudAction)); } } else { if (m_CheckEquipCloudAction == null) { if (m_GetPPICloudAction.isDone == true) { m_CheckEquipCloudAction = GuiShopUtils.ValidateEquip(); if (m_CheckEquipCloudAction != null) { GameCloudManager.AddAction(m_CheckEquipCloudAction); return(DeduceActionStatus(m_CheckEquipCloudAction)); } else { return(GuiPopupResearchWait.E_AsyncOpStatus.Finished); } } else { return(DeduceActionStatus(m_GetPPICloudAction)); } } else { return(DeduceActionStatus(m_CheckEquipCloudAction)); } } }
void OnBuyButton(bool inside) { if (!inside) { return; } ShopItemId selId = m_ShopScroller.GetSelectedItem(); //IAP funds kupujeme za realne penize a bez confirm dialogu (uzivatel musi nastesti potvrdit system dialog) bool iap = ShopDataBridge.Instance.IsIAPFund(selId); if (iap) { //buy iap (different from buying other stuff) if (ShopDataBridge.Instance.IAPServiceAvailable()) { ShopDataBridge.Instance.IAPRequestPurchase(selId); #if IAP_USE_MFLIVE Owner.ShowPopup("ShopStatusIAP", TextDatabase.instance[02900014], TextDatabase.instance[02030097], WaitForAIPurchaseHandler); #else GuiShopStatusIAP iapPopup = Owner.ShowPopup("ShopStatusIAP", TextDatabase.instance[02900014], TextDatabase.instance[02900015], WaitForAIPurchaseHandler) as GuiShopStatusIAP; iapPopup.BuyIAPItem = selId; #endif } else { //service not available Owner.ShowPopup("ShopMessageBox", TextDatabase.instance[02900016], TextDatabase.instance[02900017], NoIAPServiceHandler); } } else if (ShopDataBridge.Instance.IsFreeGold(selId)) { GuiShopUtils.EarnFreeGold(selId); } else { //check funds, show buy if not enought and show buy confirm dialog StartCoroutine("BuyCoroutine", selId); } }
// 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); }
void ShowFreeGold() { #if !UNITY_STANDALONE //Dont show freegold on webplayer and standalone GuiShopUtils.EarnFreeGold(new ShopItemId((int)E_FundID.TapJoyInApp, GuiShop.E_ItemType.Fund)); #endif }
//------------------------------------------ BUTTON HANDLERS void OnFreeGoldTouch() { GuiShopUtils.ShowOffers(); }