进度条规则
This commit is contained in:
parent
f58563c1c3
commit
78f0b9d91b
@ -35,6 +35,11 @@ function HeroCell:refresh(heroEntity, isGray)
|
||||
local fragmentCount = DataManager.BagData.ItemData:getItemNumById(heroEntity:getFragmentId())
|
||||
local needFragmentCount = materials[1] or 1
|
||||
self.progressTx:setText(fragmentCount .. "/" .. needFragmentCount)
|
||||
if fragmentCount >= needFragmentCount then
|
||||
self.progress:setSprite(GConst.ATLAS_PATH.COMMON, "common_progress_1", nil, self.progress:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER))
|
||||
else
|
||||
self.progress:setSprite(GConst.ATLAS_PATH.COMMON, "common_progress_2", nil, self.progress:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER))
|
||||
end
|
||||
self.progress:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = fragmentCount / needFragmentCount
|
||||
self.lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, heroEntity:getLv()))
|
||||
if heroEntity:isUnlock() then
|
||||
@ -62,6 +67,11 @@ function HeroCell:refreshWithCfgId(id, isGray)
|
||||
local fragmentCount = DataManager.BagData.ItemData:getItemNumById(heroInfo.item_id)
|
||||
local needFragmentCount = materials[1] or 1
|
||||
self.progressTx:setText(fragmentCount .. "/" .. needFragmentCount)
|
||||
if fragmentCount >= needFragmentCount then
|
||||
self.progress:setSprite(GConst.ATLAS_PATH.COMMON, "common_progress_1", nil, self.progress:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER))
|
||||
else
|
||||
self.progress:setSprite(GConst.ATLAS_PATH.COMMON, "common_progress_2", nil, self.progress:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER))
|
||||
end
|
||||
self.progress:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = fragmentCount / needFragmentCount
|
||||
self.lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, lv))
|
||||
self.lvTx:setVisible(true)
|
||||
|
||||
@ -40,7 +40,14 @@ function HeroDetailUI:_display(lvChange)
|
||||
local fragmentCount = DataManager.BagData.ItemData:getItemNumById(self.heroEntity:getFragmentId())
|
||||
local needFragmentCount = materials[1] or 1
|
||||
uiMap["hero_detail_ui.bg.fragment_num"]:setText(fragmentCount .. "/" .. needFragmentCount)
|
||||
uiMap["hero_detail_ui.bg.slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = fragmentCount / needFragmentCount
|
||||
|
||||
local slider = uiMap["hero_detail_ui.bg.slider"]
|
||||
if fragmentCount >= needFragmentCount then
|
||||
slider:setSprite(GConst.ATLAS_PATH.COMMON, "common_progress_1", nil, slider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER))
|
||||
else
|
||||
slider:setSprite(GConst.ATLAS_PATH.COMMON, "common_progress_2", nil, slider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER))
|
||||
end
|
||||
slider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = fragmentCount / needFragmentCount
|
||||
|
||||
local activeCount = self.heroEntity:getActiveRogueCount()
|
||||
local skillList = self.heroEntity:getRogueSkillList()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user