碎片属性图片修改提交

dev_chengFeng
jiaoyangna 2020-09-25 23:09:48 +08:00 committed by JieLing
parent 907d092c04
commit b7b6b4189c
2 changed files with 24 additions and 5 deletions

View File

@ -41,6 +41,8 @@ function BagResolveAnCompoundPanel:InitComponent()
this.layout2Text=Util.GetGameObject(self.gameObject, "bg/layout2/Text"):GetComponent("Text")
--碎片合成
this.frame=Util.GetGameObject(self.gameObject, "bg/layout3/frame"):GetComponent("Image")
this.chipFrame=Util.GetGameObject(self.gameObject, "bg/layout3/chipFrame")
this.propertyIma =Util.GetGameObject(self.gameObject, "bg/layout3/property")
this.icon=Util.GetGameObject(self.gameObject, "bg/layout3/icon"):GetComponent("Image")
this.Slider=Util.GetGameObject(self.gameObject, "bg/layout3/Slider")--:GetComponent("Slider")
this.numText=Util.GetGameObject(self.gameObject, "bg/layout3/Slider/numText"):GetComponent("Text")
@ -272,9 +274,18 @@ function this.OnShowLayout3Data()
this.frame.sprite=Util.LoadSprite(itemData.frame)
this.icon.sprite=Util.LoadSprite(itemData.icon)
this.resolveName.text=itemData.itemConfig.Name
this.chipFrame:SetActive(false)
this.propertyIma:SetActive(false)
local gameSetting = ConfigManager.GetConfigData(ConfigName.GameSetting, 1)
if itemData.itemConfig.ItemType==ItemType.HeroDebris then--碎片
this.chipFrame:SetActive(true)
this.chipFrame:GetComponent("Image").sprite = Util.LoadSprite(GetHeroChipQuantityImageByquality(itemData.itemConfig.Quantity))
if itemData.itemConfig.PropertyName and itemData.itemConfig.PropertyName > 0 then
this.propertyIma:SetActive(true)
this.propertyIma:GetComponent("Image").sprite = Util.LoadSprite(GetJobSpriteStrByJobNum(itemData.itemConfig.PropertyName))
else
this.propertyIma:SetActive(false)
end
this.nameText.text=Language[10209]
this.btnCompoundText.text=Language[10210]
local maxCompoundValue = math.floor(itemData.num/itemData.itemConfig.UsePerCount)

View File

@ -29,6 +29,7 @@ function ShopBuyPopup:InitComponent()
this.costTip = Util.GetGameObject(self.gameObject, "tipImage/costTips")
end
--绑定事件(用于子类重写)
function ShopBuyPopup:BindEvent()
Util.AddClick(this.backBtn, function()
@ -105,12 +106,19 @@ function ShopBuyPopup:OnOpen(shopType, shopItemId)
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
this.itemContent.text = string.gsub(itemConfig[goodsId].ItemDescribe, "\\n", "\n")
this.itemIcon.sprite = SetIcon(goodsId)
LogGreen("itemConfig[this.shopItemInfo.Goods[1][1]].ItemType:"..itemConfig[this.shopItemInfo.Goods[1][1]].ItemType)
this.itemBg.sprite = SetFrame(goodsId)
if itemConfig[this.shopItemInfo.Goods[1][1]].ItemType == 2 then
this.itemBg.sprite = Util.LoadSprite(GetHeroChipQuantityImageByquality(itemConfig[this.shopItemInfo.Goods[1][1]].Quantity))
Util.GetGameObject(self.gameObject, "tipImage/item/proima"):SetActive(true)
Util.GetGameObject(self.gameObject, "tipImage/item/proima"):GetComponent("Image").sprite = Util.LoadSprite(GetJobSpriteStrByJobNum(itemConfig[this.shopItemInfo.Goods[1][1]].PropertyName))
Util.GetGameObject(self.gameObject,"tipImage/item/chip").gameObject:SetActive(true)
Util.GetGameObject(self.gameObject,"tipImage/item/chip"):GetComponent("Image").sprite = Util.LoadSprite(GetHeroChipQuantityImageByquality(itemConfig[this.shopItemInfo.Goods[1][1]].Quantity))
if itemConfig[this.shopItemInfo.Goods[1][1]].PropertyName and itemConfig[this.shopItemInfo.Goods[1][1]].PropertyName > 0 then
Util.GetGameObject(self.gameObject, "tipImage/item/proima"):SetActive(true)
Util.GetGameObject(self.gameObject, "tipImage/item/proima"):GetComponent("Image").sprite = Util.LoadSprite(GetJobSpriteStrByJobNum(itemConfig[this.shopItemInfo.Goods[1][1]].PropertyName))
else
Util.GetGameObject(self.gameObject, "tipImage/item/proima"):SetActive(false)
end
else
this.itemBg.sprite = SetFrame(goodsId)
Util.GetGameObject(self.gameObject,"tipImage/item/chip").gameObject:SetActive(false)
Util.GetGameObject(self.gameObject, "tipImage/item/proima"):SetActive(false)
end
this.itemNum.text = this.goods[1][2]