/// <summary> /// When Emotes, moods, and Icons have been pre-populated the call is made to /// get the asset infos for the moods, emotes, and icons we can play. /// </summary> private void CheckIfAllPossibleEmotesIconsMoodsHaveBeenParsed() { if (mMoodsParsed && mIconsParsed && mEmotesParsed) { string itemTypes = ItemType.MOOD + "," + ItemType.EMOTE + "," + ItemType.EMOTICON; InventoryProxy inventoryProxy = GameFacade.Instance.RetrieveProxy <InventoryProxy>(); inventoryProxy.GetPlayerAnimations(itemTypes, inventoryProxy.HandlePlayerAnimationResponse); } }
private static void HandleBuyCashOk(Action <string> onOk) { Console.WriteLine("HandleBuyCashOk"); InventoryProxy inventoryProxy = GameFacade.Instance.RetrieveProxy <InventoryProxy>(); string urlParams = "p=" + inventoryProxy.SecurePaymentInfo; JSDispatcher jsd = new JSDispatcher(); jsd.RequestCashStore(urlParams, onOk); GameFacade.Instance.SendNotification(GameFacade.GET_CASH_GUI_CLOSED); }
/// <summary> /// Used by the inventory controller to force a search so the correct items /// populate the display /// </summary> /// <param name="storeName"></param> /// <param name="itemType">Comma separated list of itemTypeNames</param> public void Search(string storeName, string itemTypes) { mCurrentSearchResultsXml = null; HideInfoAndOverlayFrames(); ClearStoreButtons(); DisableItemButtons(); mCurrentItemType = itemTypes; InventoryProxy inventoryProxy = GameFacade.Instance.RetrieveProxy <InventoryProxy>(); inventoryProxy.GetStoreInventory(storeName, itemTypes, mCurrentStartIndex, mBlockSize, inventoryProxy.HandleStoreInventoryResponse); }
private void PreviousPage() { HideInfoAndOverlayFrames(); DisableNextPrevButtons(); ClearStoreButtons(); // TODO: Do range checking mCurrentStartIndex -= mBlockSize; InventoryProxy inventoryProxy = GameFacade.Instance.RetrieveProxy <InventoryProxy>(); inventoryProxy.GetPlayerInventory(mCurrentStartIndex, mBlockSize, inventoryProxy.HandlePlayerInventoryResponse); }
public override void EnterState() { mAvatarMediator = GameFacade.Instance.RetrieveMediator <AvatarMediator>(); GameFacade.Instance.RetrieveMediator <GreenScreenRoomCameraStateMachine>().StartShoppingCamera(); GameFacade.Instance.RetrieveMediator <GreenScreenRoomInputStateMachine>().MovementDisabled(); InventoryProxy inventoryProxy = GameFacade.Instance.RetrieveProxy <InventoryProxy>(); inventoryProxy.BeginShopping(); Vector3 flattenedForward = GameFacade.Instance.RetrieveMediator <GreenScreenRoomCameraMediator>().MainCamera.transform.forward; flattenedForward.y = 0.0f; flattenedForward.Normalize(); mAvatarMediator.LocalAvatarEntity.UnityGameObject.transform.rotation = Quaternion.LookRotation((-1.0f * flattenedForward), Vector3.up); mAvatarMediator.LocalAvatarEntity.Nametag.Visible = false; mAvatarMediator.HideForeignAvatars(); }
public override void EnterState() { CreateInventoryButtons(); List <IWidget> gridFrames = new List <IWidget>(); foreach (KeyValuePair <GuiFrame, Button> kvp in mGridItemButtons) { gridFrames.Add(kvp.Key); } mItemDisplayGrid.SetPositions(gridFrames, mGridHeight, mGridWidth, 0); mItemDisplayGrid.SetPagination(mBlockSize, 0); mPaginationLabel.Text = String.Format("Page {0}/{1}", mItemDisplayGrid.CurrentPage.ToString(), mItemDisplayGrid.GetTotalPages().ToString()); mCurrentStartIndex = 0; DisableNextPrevButtons(); InventoryProxy inventoryProxy = GameFacade.Instance.RetrieveProxy <InventoryProxy>(); inventoryProxy.GetPlayerInventory(mCurrentStartIndex, mBlockSize, inventoryProxy.HandlePlayerInventoryResponse); mOverlayWindow.Showing = false; mItemInfoFrame.Showing = false; mPlayerInventoryFrame.Showing = true; mCategorySideBar.Showing = true; }
/// <summary> /// Send REQUEST_ITEM_PURCHASE notification /// </summary> /// <param name="itemOffer">Item being purchased</param> private void SendPurchaseNotification(XmlElement itemOfferNode) { XmlElement priceNode = (XmlElement)itemOfferNode.SelectSingleNode("price/money"); string itemOfferId = itemOfferNode.GetAttribute("id"); string currency = priceNode.GetAttribute("currencyName"); string itemName = itemOfferNode.GetAttribute("title"); string price = priceNode.GetAttribute("amount"); if (itemOfferId == "") { throw new ArgumentNullException("itemOfferId must be supplied with PurchaseRequest"); } if (currency == "") { throw new ArgumentNullException("currency must be supplied with PurchaseRequest"); } // Make purchase request InventoryProxy inventoryProxy = GameFacade.Instance.RetrieveProxy <InventoryProxy>(); inventoryProxy.PurchaseRequest(itemOfferId, currency, inventoryProxy.HandlePurchaseResponse); // Log for metrics if (currency == "HOUTS") { EventLogger.Log(LogGlobals.CATEGORY_SHOPPING, LogGlobals.CLICKED_ON_CASH_ITEM_BUY_CONFIRM, itemName, price); } else if (currency == "VCOIN") { EventLogger.Log(LogGlobals.CATEGORY_SHOPPING, LogGlobals.CLICKED_ON_COIN_ITEM_BUY_CONFIRM, itemName, price); } // Mix panel funnel metrics string currencyProps = "{\"currency\":\"" + currency + "\"}"; FunnelGlobals.Instance.LogFunnel(FunnelGlobals.FUNNEL_PURCHASE, FunnelGlobals.CLICKED_CONFIRM, currencyProps); }