void OnFreeButton(bool inside) { if (!inside) { return; } GuiShopUtils.EarnFreeGold(new ShopItemId((int)E_FundID.TapJoyInApp, GuiShop.E_ItemType.Fund)); }
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 }