public void GetItemInfoToSell(GameItem item, Sprite outer, Sprite inner) { thisItem = item; i_SpriteOuter.sprite = outer; i_SpriteInner.sprite = inner; i_SpriteItem.sprite = item.sprite; t_ItemName.text = item.GetNameByForgeLevel(); t_Rarity.text = item.rarityNative; if (PlayerManager.instance.GetCurrentLocation() == 0) { marketPrice = item.GetFirstMarketPriceValue(); t_MarketPrice.text = item.GetFirstMarketPriceValue().ToString(); } else if (PlayerManager.instance.GetCurrentLocation() == 1) { marketPrice = item.GetSecondMarketPriceValue(); t_MarketPrice.text = item.GetSecondMarketPriceValue().ToString(); } else { marketPrice = item.GetThirdMarketPriceValue(); t_MarketPrice.text = item.GetThirdMarketPriceValue().ToString(); } }
private void Sell() { Debug.LogFormat("selling {0} {1} {2}", thisItem.GetNameByForgeLevel(), thisItem.GetSecondMarketPriceValue(), thisItem.GetCurrentPriceByForgeLevel()); UIManager.instance.OnSell(); SellingUIListener.instance.GetItemInfoToSell(thisItem, i_SpriteOuter.sprite, i_SpriteInner.sprite); SellingUIListener.instance.Negotiate(); }
public void OnNotify(GameItem item) { thisItem = item; if (thisItem.isAllocated) { gameObject.SetActive(true); ActiveAllHolders(); if (item.rarity == Item.Rarity.COMMON) { t_ItemName.color = ItemColorDefine.COMMON_TEXT_COLOR; t_Rarity.color = ItemColorDefine.COMMON_TEXT_COLOR; i_SpriteOuter.sprite = sp_CommonOuter; i_SpriteInner.sprite = sp_CommonInner; } else if (item.rarity == Item.Rarity.RARE) { t_ItemName.color = ItemColorDefine.RARE_TEXT_COLOR; t_Rarity.color = ItemColorDefine.RARE_TEXT_COLOR; i_SpriteOuter.sprite = sp_RareOuter; i_SpriteInner.sprite = sp_RareInner; } else if (item.rarity == Item.Rarity.LEGENDARY) { t_ItemName.color = ItemColorDefine.LGD_TEXT_COLOR; t_Rarity.color = ItemColorDefine.LGD_TEXT_COLOR; i_SpriteOuter.sprite = sp_LegendaryOuter; i_SpriteInner.sprite = sp_LegendaryInner; } else { t_ItemName.color = ItemColorDefine.ANCIENT_TEXT_COLOR; t_Rarity.color = ItemColorDefine.ANCIENT_TEXT_COLOR; i_SpriteOuter.sprite = sp_AncientOuter; i_SpriteInner.sprite = sp_AncientInner; } t_ItemName.text = item.GetNameByForgeLevel(); t_Rarity.text = item.rarityNative; //t_SellingCost.text = item.GetCurrentPriceByForgeLevel().ToString(); i_SpriteItem.sprite = item.sprite; // Raw price only t_AMarketPrice.text = item.GetFirstMarketPriceValue().ToString(); t_BMarketPrice.text = item.GetSecondMarketPriceValue().ToString(); t_CMarketPrice.text = item.GetThirdMarketPriceValue().ToString(); var maintainStb = new StringBuilder(Localizer.instance.GetTextFromLocal("t_Maintain_key")); maintainStb.Append(": "); maintainStb.Append(item.GetMaintainValue()); t_Maintain.text = maintainStb.ToString(); //t_AMarketPrice.text = GetFormattedMarketPrice(item.GetFirstMarketPriceValue()); //t_BMarketPrice.text = GetFormattedMarketPrice(item.GetSecondMarketPriceValue()); //t_CMarketPrice.text = GetFormattedMarketPrice(item.GetThirdMarketPriceValue()); //t_AMarketPrice.color = GetMarketPriceColor(item.firstMarketPrice); //t_BMarketPrice.color = GetMarketPriceColor(item.secondMarketPrice); //t_CMarketPrice.color = GetMarketPriceColor(item.thirdMarketPrice); Debug.Log(Inventory.instance.GetMaintain()); } else { InactiveAllHolders(); gameObject.SetActive(false); } }