miduo_client/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_QiJieSingleTre...

58 lines
2.1 KiB
Lua
Raw Normal View History

2021-09-09 11:10:43 +08:00
----- --七界试炼单个遗物 -----
local QiJieSingleTreasure = {}
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local QijieHolyConfig=ConfigManager.GetConfig(ConfigName.QijieHolyConfig)
2021-09-10 10:30:50 +08:00
local PropertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
2021-09-09 11:10:43 +08:00
function QiJieSingleTreasure:InitComponent(gameObject)
self.spLoader = SpriteLoader.New()
self.attriText = Util.GetGameObject(gameObject,"AttriText"):GetComponent("Text")
self.title = Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
self.Img = Util.GetGameObject(gameObject,"Image"):GetComponent("Image")
self.costIcon = Util.GetGameObject(gameObject,"cost/Icon"):GetComponent("Image")
self.costNum = Util.GetGameObject(gameObject,"cost/Num"):GetComponent("Text")
self.activeBtn = Util.GetGameObject(gameObject,"activeBtn")
self.activeText = Util.GetGameObject(self.activeBtn,"Text")
end
function QiJieSingleTreasure:BindEvent()
Util.AddClick(self.activeBtn,function()
PopupTipPanel.ShowTip("我知道了")
end)
end
function QiJieSingleTreasure:AddListener()
end
function QiJieSingleTreasure:RemoveListener()
end
function QiJieSingleTreasure:OnShow(_parent,...)
self.parent =_parent
self.data = ...
self.sortingOrder =_parent.sortingOrder
self.title.text = self.data.Name
self.Img.sprite = self.spLoader:LoadSprite(artResourcesConfig[self.data.Icon].Name)
self.costIcon.sprite = self.spLoader:LoadSprite(GetSpriteNameByItemId(self.data.Cost[1]))
2021-09-10 10:30:50 +08:00
local text1 = string.format( "%s/%s",BagManager.GetTotalItemNum(self.data.Cost[1]),self.data.Cost[2])
if BagManager.GetTotalItemNum(self.data.Cost[1]) < self.data.Cost[2] then
text1 = string.format( "<color=#d70f09>%s</color>",text1)
end
self.costNum.text = text1
if self.data.Desc then
self.attriText.text = self.data.Desc
else
self.attriText.text = "表里是空的!"
end
2021-09-09 11:10:43 +08:00
end
function QiJieSingleTreasure:OnClose()
end
function QiJieSingleTreasure:OnDestroy()
self.spLoader:Destroy()
end
return QiJieSingleTreasure