void SetBtnContent(ShopItemType mType) { UIDragonMallMgr.GetInstance().mDragonMallScrollViewControl.deleteBg(); UIDragonMallMgr.GetInstance().mDragonMallScrollViewControl.ReFresh(mType); ClearBtnSprite(); if (mType == ShopItemType.HotSale) { mSpriteR[0].gameObject.SetActive(true); mSpriteL[0].gameObject.SetActive(false); } else if (mType == ShopItemType.Egg) { mSpriteR[1].gameObject.SetActive(true); mSpriteL[1].gameObject.SetActive(false); } else if (mType == ShopItemType.Item) { mSpriteR[2].gameObject.SetActive(true); mSpriteL[2].gameObject.SetActive(false); } else if (mType == ShopItemType.Active) { mSpriteR[3].gameObject.SetActive(true); mSpriteL[3].gameObject.SetActive(false); } }
private async Task UpdateItems(int userId, int netId, ShopItemType itemType, bool commerce) { switch (itemType) { case ShopItemType.OUTFIT: await GetUserOutfits(userId, netId, commerce); break; case ShopItemType.XPBOOST: break; case ShopItemType.CURRENCY: break; case ShopItemType.DONATION: break; case ShopItemType.WEAPONTINT: await GetUserWeaponTints(userId, netId, commerce); break; default: break; } }
public void ChangeShopCategory(ShopItemType shopMenuCategory) { if (m_ShopUIManager != null) { m_ShopUIManager.InitCategoryShown(shopMenuCategory); } }
public void SetCamFilter(bool IsOn) { if (IsOn) { _typeFilter = ShopItemType.Camera; ShowShopItems(); } }
public ShopItemViewModel(int id, string name, string image, ShopItemType type) { Id = id; Name = name; Image = image; Type = type; }
public void SetFenceFilter(bool IsOn) { if (IsOn) { _typeFilter = ShopItemType.Fence; ShowShopItems(); } }
public void SetSceneryFilter(bool IsOn) { if (IsOn) { _typeFilter = ShopItemType.Scenery; ShowShopItems(); } }
public void SetTrackFilter(bool IsOn) { if (IsOn) { _typeFilter = ShopItemType.Track; ShowShopItems(); } }
public void SetRoadFilter(bool IsOn) { if (IsOn) { _typeFilter = ShopItemType.Road; ShowShopItems(); } }
public void SetActiveDetail(ActiveShopItem data, ShopItemType _type, int index) { Shop_Index = index; this.ActiveItemdata = data; this._type = _type; SingleType.gameObject.SetActive(true); MultipleType.gameObject.SetActive(false); if (data.disPrice == 0) { SetTagMoneyName(data.mType, data.price, data.pName, mMoney); // if(data.mType == 0) mMoney.text = string.Format(Core.Data.stringManager.getString(20091), colorString +data.price.ToString()+"[-]", Core.Data.stringManager.getString(5037), data.pName); // else if(data.mType == 1) mMoney.text = string.Format(Core.Data.stringManager.getString(20091), colorString + data.price.ToString() + "[-]", Core.Data.stringManager.getString(5070),data.pName); // else mMoney.text = string.Format(Core.Data.stringManager.getString(20091), colorString + data.price.ToString() + "[-]", Core.Data.stringManager.getString(5166),data.pName); } else { SetTagMoneyName(data.mType, data.disPrice, data.pName, mMoney); // if(data.mType == 0) mMoney.text = string.Format(Core.Data.stringManager.getString(20091),colorString+ data.disPrice.ToString()+"[-]", Core.Data.stringManager.getString(5037),data.pName); // else if(data.mType == 1) mMoney.text = string.Format(Core.Data.stringManager.getString(20091), colorString + data.disPrice.ToString()+"[-]", Core.Data.stringManager.getString(5070),data.pName); // else mMoney.text = string.Format(Core.Data.stringManager.getString(20091), colorString + mdata.discount[1].ToString()+"[-]", Core.Data.stringManager.getString(5166),data.pName); } mDescription.text = data.des; mName.text = string.Format(Core.Data.stringManager.getString(20092), data.pName); }
public ShopItemInterface(ContentManager content, string whiteRectAsset, Skin itemSkin, SpriteFont smallFont, SkinAction buyClicked, int cost, int x, int y, int itemWidth, int itemHeight, string tongueAsset) { // Initialize image objects bgImg = content.Load <Texture2D>(whiteRectAsset); costString = cost.ToString() + "c"; name = itemSkin.Name; this.skinBought = buyClicked; this.ItemSkin = itemSkin; this.Cost = cost; this.font = smallFont; bgColor.R = 124; bgColor.G = 216; bgColor.B = 247; // Initialize positioning objects bgRect = new Rectangle(x, y, BG_WIDTH, BG_HEIGHT); namePos = new Vector2(bgRect.X + (bgRect.Width / 2 - (int)(font.MeasureString(name).X / 2)), bgRect.Y + SPACING); buyButton = new MenuButton(new OnButtonClick(SkinClicked), LanguageTranslator.Translate("Buy") + " (" + cost + "c)", content, 0, 0, true, font); buyButton.X = bgRect.X + (bgRect.Width / 2 - (buyButton.Width / 2)); buyButton.Y = bgRect.Bottom - buyButton.Height - SPACING; costPos = new Vector2(bgRect.X + (bgRect.Width / 2 - (int)(font.MeasureString(costString).X / 2)), buyButton.Y - SPACING - (int)(font.MeasureString(costString).Y)); snake = new Snake(itemSkin, 0, 0, content, tongueAsset); snake.X = bgRect.X + (bgRect.Width / 2 - (snake.Width / 2)); snake.Y = (int)costPos.Y - snake.Height - SPACING; itemType = ShopItemType.Skin; }
public void ShowConfirmBuyWnd(byte onlyID, byte shopID, uint itemSum = 1, bool bNewGide = false) { { ShopItemType byShopType = FishConfig.Instance.m_ShopInfo.ShopMap[shopID].ShopItemMap[onlyID].ShopType; if (PlayerRole.Instance.ShopManager.IsNeedShare(byShopType)) { GlobalHallUIMgr.Instance.GameShare.ShowExchage(FishConfig.Instance.m_ShopInfo.ShopMap[shopID].ShopItemMap[onlyID].ItemInfo.ItemID, PlayerRole.Instance.RoleInfo.RoleMe.GetTotalCashSum()); return; } } if (m_BaseWndObject != null) { return; } Init(); if (bNewGide) { m_FishIcon.SetActive(true); } // GlobalHallUIMgr.Instance.ShowMask(true, 30); m_TweenAnim.ResetToBeginning(); m_TweenAnim.PlayForward(); m_ItemOnlyID = onlyID; m_ShopID = shopID; tagShopItemStr pItemStr = FishConfig.Instance.m_ShopInfo.ShopMap[shopID].ShopItemStrMap[onlyID]; string str = pItemStr.ItemDec; str = str.Replace("/n", "\n"); m_ItemDescribeLabel.text = str; m_GoodsSprite.spriteName = pItemStr.ItemIcon; if (FishConfig.Instance.m_ShopInfo.ShopMap[shopID].ShopItemMap[onlyID].ShopType == ShopItemType.SIT_Entity || FishConfig.Instance.m_ShopInfo.ShopMap[shopID].ShopItemMap[onlyID].ShopType == ShopItemType.SIT_PhonePay) //if (m_ShopID == (byte)(Shop_Type.Shop_Material + 1)) { m_BtnObj[2].SetActive(false); m_BtnObj[3].SetActive(false); m_ItemName.gameObject.SetActive(true); byte exchangeSum = PlayerRole.Instance.RoleInfo.GetCanUseCashSum();//(byte)(PlayerRole.Instance.RoleVip.GetUseMedalSum() - PlayerRole.Instance.RoleInfo.RoleMe.GetCashSum()); if (exchangeSum == 0) { m_UIButton[0].isEnabled = false; } m_ItemName.text = string.Format(StringTable.GetString("Shop_Exchange_Sum"), exchangeSum); m_ItemSum = 1; } else { m_GoodsSum.text = "x " + Utility.NumToThousand(FishConfig.Instance.m_ShopInfo.ShopMap[shopID].ShopItemMap[onlyID].ItemInfo.ItemSum); m_ItemSum = itemSum; m_ItemSumLabel.text = m_ItemSum.ToString(); } GetItemPrice(); m_ItemPriceLabel.text = (m_ItemSum * m_ItemPrice).ToString(); m_UIButton[2].isEnabled = false; WndManager.Instance.Push(m_BaseWndObject); }
public void SetAisle(ShopItemType itemType) { var filtered = new List <AisleItemFilter>(); for (int i = 0; i < Objects.Length; i++) { if (Objects[i].AllowedItemTypes.HasFlag(itemType)) { filtered.Add(Objects[i]); } } var active = Random.Range(0, filtered.Count); for (int i = 0; i < Objects.Length; i++) { Objects[i].gameObject.SetActive(false); } if (filtered.Count > 0) { filtered[active].gameObject.SetActive(true); } else { Objects[Random.Range(0, Objects.Length)].gameObject.SetActive(true); } }
void RefreshItems(ShopItemType _type) { curShopItemType = _type; DestroyItem(); switch ((int)_type) { case 0: ItemContainer.RefreshItems(GameCenter.shopMng.RedeemShopItemDic); uicroll.ResetPosition(); break; case 1: ItemContainer.RefreshItems(GameCenter.shopMng.NormalShopItemDic); uicroll.ResetPosition(); break; case 2: ItemContainer.RefreshItems(GameCenter.shopMng.EquipmentShopItemDic); uicroll.ResetPosition(); break; case 3: ItemContainer.RefreshItems(GameCenter.shopMng.ExploitShopItemDic); uicroll.ResetPosition(); break; case 4: ItemContainer.RefreshItems(GameCenter.shopMng.ReputationShopItemDic); uicroll.ResetPosition(); break; case 5: ItemContainer.RefreshItems(GameCenter.shopMng.ScoresShopItemDic); uicroll.ResetPosition(); break; case 6: ItemContainer.RefreshItems(GameCenter.shopMng.CashShopItemDic); uicroll.ResetPosition(); break; default: break; } RefeshRes(); }
public ShopTransactionItem(ShopItemType shopItemType, GenericRequestRewardResultType result, string internalId, string args) { InternalId = internalId; ShopType = shopItemType; Result = result; Arguments = args; SetTransactionTime(); }
public void OpenWndByType(ShopItemType _type) { //if (CurType != _type) 这样会导致有时候无法跳转 //{ CurType = _type; GameCenter.uIMng.SwitchToUI(GUIType.SHOPWND); //} //OpenShopWnd(); }
public void SetSecretShopTag(bool key, ActiveShopItem data, ShopItemType _type, int index) { if (_UISecretShopTag == null) { CreateSecretShopTag(); } _UISecretShopTag.gameObject.SetActive(key); _UISecretShopTag.SetActiveDetail(data, _type, index); }
void ShowShopItemByType(ShopItemType type) { if (m_lastSelectType == type) { return; } m_lastSelectType = type; ShowItem(m_shops, type); }
void ShowBagItemByType(ShopItemType type) { if (null != m_prefab) { if (Skins.Count > m_bagItems.Count) { for (int i = m_bagItems.Count; i < Skins.Count; i++) { GameObject uiObject = (GameObject)GameObject.Instantiate(m_prefab); uiObject.transform.SetParent(m_parent); uiObject.transform.localScale = Vector3.one; UIBagItem item = Util.AddComponent <UIBagItem>(uiObject); m_bagItems.Add(item); } } for (int i = 0; i < m_bagItems.Count; i++) { if (i < Skins.Count) { int val = Skins[i]; EquipInfo info = InfoMgr <EquipInfo> .Instance.GetInfo(val); if (null != info) { if (type == ShopItemType.ShopItem_ALL) { m_bagItems[i].SetBagItemInfo(info); Util.SetActive(m_bagItems[i].Cache, true); } else { if (info.equipType + 1 == (int)type) { m_bagItems[i].SetBagItemInfo(info); Util.SetActive(m_bagItems[i].Cache, true); } else { Util.SetActive(m_bagItems[i].Cache, false); } } } else { Util.SetActive(m_bagItems[i].Cache, false); } } else { Util.SetActive(m_bagItems[i].Cache, false); } } } }
void BuyObject(ShopItemType type, int amount) { int wholeCost = ShopItemCost[type] * amount; if (ClassManager.InventoryScript.Money.AddAmount(-wholeCost)) { ClassManager.InventoryScript.BlockAmounts[ShopItemInvAmounts[type]] += amount; Debug.Log($"Bought {amount} of {type} for {wholeCost}"); } }
internal static UInt32 Count(this ShopItemType itemType) { UInt32 v = (UInt32)itemType; v = v - ((v >> 1) & 0x55555555); // reuse input as temporary v = (v & 0x33333333) + ((v >> 2) & 0x33333333); // temp UInt32 c = ((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24; // count return(c); }
public void SetCategory(ShopItemType category) { if (CurrentCategory == category) { return; } Debug.LogFormat("ChangeCategory {0}", category); CurrentCategory = category; }
public override void HandleRequest(ShopItemType type) { if (type == ShopItemType.Pack) { Console.WriteLine("Buy pack logic! Handler: {0}", this.GetType().Name); } else if (successor != null) { successor.HandleRequest(type); } }
//constructor public ShopItem(int id, ShopItemType type, String name, string category, int licence, int cost, bool addressable, Sprite image = null) { Id = id; Type = type; Name = name; Category = category; Licence = licence; Cost = cost; Addressable = addressable; Image = image; }
void SetPanel(ShopItemType type) { if (type == ShopItemType.Vip) { _Panel.baseClipRegion = new Vector4(-1f, -115f, 1110f, 384f); } else { _Panel.baseClipRegion = new Vector4(-1f, -80, 1110f, 450f); } }
public void UpdateAisleState(ShopItemType type) { Etoggle.SetState(_state.HasFlag(TileStates.E)); Ntoggle.SetState(_state.HasFlag(TileStates.N)); Wtoggle.SetState(_state.HasFlag(TileStates.W)); Stoggle.SetState(_state.HasFlag(TileStates.S)); E.SetAisleState(_state.HasFlag(TileStates.E), _state.HasFlag(TileStates.N), _state.HasFlag(TileStates.S), type); W.SetAisleState(_state.HasFlag(TileStates.W), _state.HasFlag(TileStates.S), _state.HasFlag(TileStates.N), type); S.SetAisleState(_state.HasFlag(TileStates.S), _state.HasFlag(TileStates.E), _state.HasFlag(TileStates.W), type); N.SetAisleState(_state.HasFlag(TileStates.N), _state.HasFlag(TileStates.W), _state.HasFlag(TileStates.E), type); }
/// <summary> /// /// </summary> public void ChangeCategory(int categoryID) { if (categoryID == 0) { sortByType = ShopItemType.None; } else { categoryID = categoryID - 1; sortByType = bl_ShopData.Instance.categorys[categoryID].itemType; } InstanceItems(); }
public ShopItemCard(uint cardGUID, CardView cardView, ShopCategory category, ShopItemType itemType, byte tier, string[] sortingNames, int sortingWeight, Price buyPrice, Price upgradePrice, Price sellPrice, Faction faction, bool canBeSold) : base(cardGUID, cardView) { Category = category; ItemType = itemType; Tier = tier; SortingNames = sortingNames; SortingWeight = sortingWeight; BuyPrice = buyPrice; UpgradePrice = upgradePrice; SellPrice = sellPrice; Faction = faction; CanBeSold = canBeSold; }
public void ReFresh(ShopItemType mType) { SetPanel(mType); if (mType != ShopItemType.Active) { NormalShopRefresh(mType); } else { ActiveShopRefresh(mType); } mScrollView.verticalScrollBar.value = 0.0f; mGrid.Reposition(); }
void OpenWndByType() { ShopItemType _type = GameCenter.shopMng.CurType; for (int i = 0; i < toggles.Length; i++) { if (toggles[i].value) { _type = (ShopItemType)(i); break; } } RefreshItems(_type); }