fix bug
This commit is contained in:
parent
78d6b533e0
commit
9f41da288b
@ -1,9 +1,5 @@
|
||||
local hero_star = {
|
||||
[1]={
|
||||
["cost_2"]={
|
||||
30,
|
||||
5
|
||||
},
|
||||
["cost_3"]={
|
||||
30,
|
||||
5
|
||||
@ -15,258 +11,262 @@ local hero_star = {
|
||||
["cost_5"]={
|
||||
30,
|
||||
5
|
||||
},
|
||||
["cost_6"]={
|
||||
30,
|
||||
5
|
||||
}
|
||||
},
|
||||
[2]={
|
||||
["cost_2"]={
|
||||
40,
|
||||
14
|
||||
},
|
||||
["cost_3"]={
|
||||
40,
|
||||
14
|
||||
},
|
||||
["cost_4"]={
|
||||
40,
|
||||
10
|
||||
14
|
||||
},
|
||||
["cost_5"]={
|
||||
40,
|
||||
10
|
||||
},
|
||||
["cost_6"]={
|
||||
40,
|
||||
10
|
||||
}
|
||||
},
|
||||
[3]={
|
||||
["cost_2"]={
|
||||
55,
|
||||
23
|
||||
},
|
||||
["cost_3"]={
|
||||
55,
|
||||
23
|
||||
},
|
||||
["cost_4"]={
|
||||
55,
|
||||
15
|
||||
23
|
||||
},
|
||||
["cost_5"]={
|
||||
55,
|
||||
15
|
||||
},
|
||||
["cost_6"]={
|
||||
55,
|
||||
15
|
||||
}
|
||||
},
|
||||
[4]={
|
||||
["cost_2"]={
|
||||
70,
|
||||
32
|
||||
},
|
||||
["cost_3"]={
|
||||
70,
|
||||
32
|
||||
},
|
||||
["cost_4"]={
|
||||
70,
|
||||
20
|
||||
32
|
||||
},
|
||||
["cost_5"]={
|
||||
70,
|
||||
20
|
||||
},
|
||||
["cost_6"]={
|
||||
70,
|
||||
20
|
||||
}
|
||||
},
|
||||
[5]={
|
||||
["cost_2"]={
|
||||
85,
|
||||
40
|
||||
},
|
||||
["cost_3"]={
|
||||
85,
|
||||
40
|
||||
},
|
||||
["cost_4"]={
|
||||
85,
|
||||
25
|
||||
40
|
||||
},
|
||||
["cost_5"]={
|
||||
85,
|
||||
25
|
||||
},
|
||||
["cost_6"]={
|
||||
85,
|
||||
25
|
||||
}
|
||||
},
|
||||
[6]={
|
||||
["cost_2"]={
|
||||
100,
|
||||
49
|
||||
},
|
||||
["cost_3"]={
|
||||
100,
|
||||
49
|
||||
},
|
||||
["cost_4"]={
|
||||
100,
|
||||
30
|
||||
49
|
||||
},
|
||||
["cost_5"]={
|
||||
100,
|
||||
30
|
||||
},
|
||||
["cost_6"]={
|
||||
100,
|
||||
30
|
||||
}
|
||||
},
|
||||
[7]={
|
||||
["cost_2"]={
|
||||
115,
|
||||
58
|
||||
},
|
||||
["cost_3"]={
|
||||
115,
|
||||
58
|
||||
},
|
||||
["cost_4"]={
|
||||
115,
|
||||
35
|
||||
58
|
||||
},
|
||||
["cost_5"]={
|
||||
115,
|
||||
35
|
||||
},
|
||||
["cost_6"]={
|
||||
115,
|
||||
35
|
||||
}
|
||||
},
|
||||
[8]={
|
||||
["cost_2"]={
|
||||
130,
|
||||
67
|
||||
},
|
||||
["cost_3"]={
|
||||
130,
|
||||
67
|
||||
},
|
||||
["cost_4"]={
|
||||
130,
|
||||
40
|
||||
67
|
||||
},
|
||||
["cost_5"]={
|
||||
130,
|
||||
40
|
||||
},
|
||||
["cost_6"]={
|
||||
130,
|
||||
40
|
||||
}
|
||||
},
|
||||
[9]={
|
||||
["cost_2"]={
|
||||
145,
|
||||
75
|
||||
},
|
||||
["cost_3"]={
|
||||
145,
|
||||
75
|
||||
},
|
||||
["cost_4"]={
|
||||
145,
|
||||
45
|
||||
75
|
||||
},
|
||||
["cost_5"]={
|
||||
145,
|
||||
45
|
||||
},
|
||||
["cost_6"]={
|
||||
145,
|
||||
45
|
||||
}
|
||||
},
|
||||
[10]={
|
||||
["cost_2"]={
|
||||
160,
|
||||
84
|
||||
},
|
||||
["cost_3"]={
|
||||
160,
|
||||
84
|
||||
},
|
||||
["cost_4"]={
|
||||
160,
|
||||
50
|
||||
84
|
||||
},
|
||||
["cost_5"]={
|
||||
160,
|
||||
50
|
||||
},
|
||||
["cost_6"]={
|
||||
160,
|
||||
50
|
||||
}
|
||||
},
|
||||
[11]={
|
||||
["cost_2"]={
|
||||
175,
|
||||
93
|
||||
},
|
||||
["cost_3"]={
|
||||
175,
|
||||
93
|
||||
},
|
||||
["cost_4"]={
|
||||
175,
|
||||
56
|
||||
93
|
||||
},
|
||||
["cost_5"]={
|
||||
175,
|
||||
56
|
||||
},
|
||||
["cost_6"]={
|
||||
175,
|
||||
56
|
||||
}
|
||||
},
|
||||
[12]={
|
||||
["cost_2"]={
|
||||
200,
|
||||
102
|
||||
},
|
||||
["cost_3"]={
|
||||
200,
|
||||
102
|
||||
},
|
||||
["cost_4"]={
|
||||
200,
|
||||
62
|
||||
102
|
||||
},
|
||||
["cost_5"]={
|
||||
200,
|
||||
62
|
||||
},
|
||||
["cost_6"]={
|
||||
200,
|
||||
62
|
||||
}
|
||||
},
|
||||
[13]={
|
||||
["cost_2"]={
|
||||
225,
|
||||
110
|
||||
},
|
||||
["cost_3"]={
|
||||
225,
|
||||
110
|
||||
},
|
||||
["cost_4"]={
|
||||
225,
|
||||
68
|
||||
110
|
||||
},
|
||||
["cost_5"]={
|
||||
225,
|
||||
68
|
||||
},
|
||||
["cost_6"]={
|
||||
225,
|
||||
68
|
||||
}
|
||||
},
|
||||
[14]={
|
||||
["cost_2"]={
|
||||
250,
|
||||
120
|
||||
},
|
||||
["cost_3"]={
|
||||
250,
|
||||
120
|
||||
},
|
||||
["cost_4"]={
|
||||
250,
|
||||
76
|
||||
120
|
||||
},
|
||||
["cost_5"]={
|
||||
250,
|
||||
76
|
||||
},
|
||||
["cost_6"]={
|
||||
250,
|
||||
76
|
||||
}
|
||||
},
|
||||
[15]={
|
||||
["cost_2"]={
|
||||
275,
|
||||
130
|
||||
},
|
||||
["cost_3"]={
|
||||
275,
|
||||
130
|
||||
},
|
||||
["cost_4"]={
|
||||
275,
|
||||
85
|
||||
130
|
||||
},
|
||||
["cost_5"]={
|
||||
275,
|
||||
85
|
||||
},
|
||||
["cost_6"]={
|
||||
275,
|
||||
85
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -665,6 +665,12 @@ local LocalizationGlobalConst =
|
||||
TASK_DESC_2 = "TASK_DESC_2",
|
||||
IDLE_DESC_1 = "IDLE_DESC_1",
|
||||
SUMMON_DESC_2 = "SUMMON_DESC_2",
|
||||
HERO_DESC_15 = "HERO_DESC_15",
|
||||
HERO_DESC_16 = "HERO_DESC_16",
|
||||
HERO_DESC_17 = "HERO_DESC_17",
|
||||
HERO_DESC_18 = "HERO_DESC_18",
|
||||
HERO_DESC_19 = "HERO_DESC_19",
|
||||
HERO_DESC_20 = "HERO_DESC_20",
|
||||
}
|
||||
|
||||
return LocalizationGlobalConst
|
||||
@ -664,7 +664,13 @@ local localization_global =
|
||||
["TALENT_DESC_3"] = "等级达到{0}可研发",
|
||||
["TASK_DESC_2"] = "成就",
|
||||
["IDLE_DESC_1"] = "挂机",
|
||||
["SUMMON_DESC_2"] = "限时祈愿",
|
||||
["SUMMON_DESC_2"] = "召唤",
|
||||
["HERO_DESC_15"] = "升{0}级",
|
||||
["HERO_DESC_16"] = "升星",
|
||||
["HERO_DESC_17"] = "提升",
|
||||
["HERO_DESC_18"] = "去升级",
|
||||
["HERO_DESC_19"] = "星级达到{0}",
|
||||
["HERO_DESC_20"] = "可继续升级",
|
||||
}
|
||||
|
||||
return localization_global
|
||||
@ -12,10 +12,10 @@ local task_daily_challenge = {
|
||||
["desc"]="通关时{0}色元素英雄释放技能{1}次"
|
||||
},
|
||||
[5]={
|
||||
["desc"]="{0}回合内击败最终首领"
|
||||
["desc"]="10回合内击败最终首领"
|
||||
},
|
||||
[6]={
|
||||
["desc"]="通关时,{0}颜色元素造成伤害占比超过{1}%"
|
||||
["desc"]="通关时,{0}造成伤害占比超过{1}%"
|
||||
}
|
||||
}
|
||||
local config = {
|
||||
|
||||
@ -9,7 +9,7 @@ local task_daily_challenge = {
|
||||
|
||||
},
|
||||
[4]={
|
||||
|
||||
["desc"]="通关时{0}色元素英雄释放技能{1}次"
|
||||
},
|
||||
[5]={
|
||||
|
||||
|
||||
@ -9,10 +9,10 @@ local task_daily_challenge = {
|
||||
["desc"]="Link 8 or more elements in battle {0} times and beat the stage"
|
||||
},
|
||||
[4]={
|
||||
["desc"]="Defeat the final boss within 10 rounds"
|
||||
["desc"]="通关时{0}色元素英雄释放技能{1}次"
|
||||
},
|
||||
[5]={
|
||||
["desc"]="{0} damage dealt exceeds {1}% of total damage and beat the stage"
|
||||
["desc"]="Defeat the final boss within 10 rounds"
|
||||
},
|
||||
[6]={
|
||||
["desc"]="{0} damage dealt exceeds {1}% of total damage and beat the stage"
|
||||
|
||||
@ -9,10 +9,10 @@ local task_daily_challenge = {
|
||||
["desc"]="Conectar 8 o más elementos {0} veces en combate al completar la fase."
|
||||
},
|
||||
[4]={
|
||||
["desc"]="Derrotar al jefe final en 10 rondas."
|
||||
["desc"]="通关时{0}色元素英雄释放技能{1}次"
|
||||
},
|
||||
[5]={
|
||||
["desc"]="{0} causa más del {1}% del daño al completar la fase."
|
||||
["desc"]="Derrotar al jefe final en 10 rondas."
|
||||
},
|
||||
[6]={
|
||||
["desc"]="{0} causa más del {1}% del daño al completar la fase."
|
||||
|
||||
@ -9,7 +9,7 @@ local task_daily_challenge = {
|
||||
|
||||
},
|
||||
[4]={
|
||||
|
||||
["desc"]="通关时{0}色元素英雄释放技能{1}次"
|
||||
},
|
||||
[5]={
|
||||
|
||||
|
||||
@ -9,10 +9,10 @@ local task_daily_challenge = {
|
||||
["desc"]="Hubungkan 8 elemen atau lebih sebanyak {0} kali dalam battle"
|
||||
},
|
||||
[4]={
|
||||
["desc"]="Kalahkan Boss terakhir dalam 10 giliran"
|
||||
["desc"]="通关时{0}色元素英雄释放技能{1}次"
|
||||
},
|
||||
[5]={
|
||||
["desc"]="{0} menyebabkan lebih dari {1}% DMG saat lolos stage"
|
||||
["desc"]="Kalahkan Boss terakhir dalam 10 giliran"
|
||||
},
|
||||
[6]={
|
||||
["desc"]="{0} menyebabkan lebih dari {1}% DMG saat lolos stage"
|
||||
|
||||
@ -9,10 +9,10 @@ local task_daily_challenge = {
|
||||
["desc"]="クエストをクリアする、且つ{0}回以上8連消しを行う。"
|
||||
},
|
||||
[4]={
|
||||
["desc"]="10ターン以内に最終ボスを撃破する。"
|
||||
["desc"]="通关时{0}色元素英雄释放技能{1}次"
|
||||
},
|
||||
[5]={
|
||||
["desc"]="クエストをクリアする、且つ{0}が合計ダメージ{1}%以上を貢献する。"
|
||||
["desc"]="10ターン以内に最終ボスを撃破する。"
|
||||
},
|
||||
[6]={
|
||||
["desc"]="クエストをクリアする、且つ{0}が合計ダメージ{1}%以上を貢献する。"
|
||||
|
||||
@ -9,10 +9,10 @@ local task_daily_challenge = {
|
||||
["desc"]="스테이지 클리어시, 전투에서 8개 또는 그 이상의 원소를 {0}번 연결하기"
|
||||
},
|
||||
[4]={
|
||||
["desc"]="10턴 이내에 최종 보스 처치하기"
|
||||
["desc"]="通关时{0}色元素英雄释放技能{1}次"
|
||||
},
|
||||
[5]={
|
||||
["desc"]="스테이지 클리어 시, {0}이(가) 입힌 대미지가 전체 피해의 {1}% 초과하기"
|
||||
["desc"]="10턴 이내에 최종 보스 처치하기"
|
||||
},
|
||||
[6]={
|
||||
["desc"]="스테이지 클리어 시, {0}이(가) 입힌 대미지가 전체 피해의 {1}% 초과하기"
|
||||
|
||||
@ -9,10 +9,10 @@ local task_daily_challenge = {
|
||||
["desc"]="Durante a conclusão, conecte 8 ou mais elementos na batalha {0} vezes"
|
||||
},
|
||||
[4]={
|
||||
["desc"]="Derrote o chefe final em 10 turnos"
|
||||
["desc"]="通关时{0}色元素英雄释放技能{1}次"
|
||||
},
|
||||
[5]={
|
||||
["desc"]="Ao concluir, a porcentagem de dano causado por {0} deve ser superior a {1}%"
|
||||
["desc"]="Derrote o chefe final em 10 turnos"
|
||||
},
|
||||
[6]={
|
||||
["desc"]="Ao concluir, a porcentagem de dano causado por {0} deve ser superior a {1}%"
|
||||
|
||||
@ -9,7 +9,7 @@ local task_daily_challenge = {
|
||||
|
||||
},
|
||||
[4]={
|
||||
|
||||
["desc"]="通关时{0}色元素英雄释放技能{1}次"
|
||||
},
|
||||
[5]={
|
||||
|
||||
|
||||
@ -9,10 +9,10 @@ local task_daily_challenge = {
|
||||
["desc"]="เมื่อผ่านด่าน เชื่อมโยง 8 ธาตุหรือขึ้นไป{0}ครั้งในการต่อสู้"
|
||||
},
|
||||
[4]={
|
||||
["desc"]="เอาชนะบอสตัวสุดท้ายภายใน 10 รอบ"
|
||||
["desc"]="通关时{0}色元素英雄释放技能{1}次"
|
||||
},
|
||||
[5]={
|
||||
["desc"]="เมื่อผ่านด่าน {0}สร้างดาเมจมากกว่า{1}%"
|
||||
["desc"]="เอาชนะบอสตัวสุดท้ายภายใน 10 รอบ"
|
||||
},
|
||||
[6]={
|
||||
["desc"]="เมื่อผ่านด่าน {0}สร้างดาเมจมากกว่า{1}%"
|
||||
|
||||
@ -9,10 +9,10 @@ local task_daily_challenge = {
|
||||
["desc"]="Khi vượt ải, trong chiến đấu có {0} lần kết nối 8 nguyên tố trở lên"
|
||||
},
|
||||
[4]={
|
||||
["desc"]="Hạ BOSS Cuối trong 10 hiệp"
|
||||
["desc"]="通关时{0}色元素英雄释放技能{1}次"
|
||||
},
|
||||
[5]={
|
||||
["desc"]="Khi vượt ải, tỷ lệ sát thương do {0} gây ra vượt quá {1}%"
|
||||
["desc"]="Hạ BOSS Cuối trong 10 hiệp"
|
||||
},
|
||||
[6]={
|
||||
["desc"]="Khi vượt ải, tỷ lệ sát thương do {0} gây ra vượt quá {1}%"
|
||||
|
||||
@ -9,10 +9,10 @@ local task_daily_challenge = {
|
||||
["desc"]="通關時,戰鬥中連接8個或以上元素{0}次"
|
||||
},
|
||||
[4]={
|
||||
["desc"]="10回合內擊敗最終首領"
|
||||
["desc"]="通关时{0}色元素英雄释放技能{1}次"
|
||||
},
|
||||
[5]={
|
||||
["desc"]="通關時,{0}造成傷害佔比超過{1}%"
|
||||
["desc"]="10回合內擊敗最終首領"
|
||||
},
|
||||
[6]={
|
||||
["desc"]="通關時,{0}造成傷害佔比超過{1}%"
|
||||
|
||||
@ -1976,9 +1976,9 @@ function GFunc.getStarImg(starType)
|
||||
if starType == GConst.HeroConst.STAR_TYPE.LV_1 then
|
||||
return GConst.ATLAS_PATH.COMMON, "common_star_1"
|
||||
elseif starType == GConst.HeroConst.STAR_TYPE.LV_2 then
|
||||
return GConst.ATLAS_PATH.COMMON, "common_point"
|
||||
return GConst.ATLAS_PATH.COMMON, "common_star_2"
|
||||
else
|
||||
return GConst.ATLAS_PATH.COMMON, "common_info"
|
||||
return GConst.ATLAS_PATH.COMMON, "common_star_3"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -106,6 +106,10 @@ function HeroManager:getMatchTypeIcon(matchType)
|
||||
return GConst.HeroConst.MATCH_ICON_NAME[matchType]
|
||||
end
|
||||
|
||||
function HeroManager:getMatchTypeBg(matchType)
|
||||
return GConst.ATLAS_PATH.COMMON, "common_quality_" .. matchType
|
||||
end
|
||||
|
||||
function HeroManager:getMatchTypeName(matchType, needColor)
|
||||
local name = I18N:getGlobalText("ELEMENT_NAME_" .. matchType)
|
||||
if name and needColor then
|
||||
|
||||
@ -70,7 +70,7 @@ function HeroDetailUI:onLoadRootComplete()
|
||||
self.qltBgTx = uiMap["hero_detail_ui.common.qlt_bg.qlt_tx"]
|
||||
self.starComp = uiMap["hero_detail_ui.common.hero_node.star_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.STAR_CELL)
|
||||
|
||||
self.btnTxs = {I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4), "升星"}
|
||||
self.btnTxs = {I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4), I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_16)}
|
||||
self.pageBtns = {}
|
||||
self.pageBtnTxs = {}
|
||||
self.pageBtnLocks = {}
|
||||
@ -190,7 +190,8 @@ function HeroDetailUI:updateSide()
|
||||
end
|
||||
|
||||
function HeroDetailUI:updateHero()
|
||||
self.elementDesc:setText(ModuleManager.HeroManager:getMatchTypeName(self.heroEntity:getMatchType()))
|
||||
local matchType = self.heroEntity:getMatchType()
|
||||
self.elementDesc:setText(ModuleManager.HeroManager:getMatchTypeName(matchType))
|
||||
local elementTxRectWidth = self.elementDesc:getRectWidth()
|
||||
local elementTxWidth = self.elementDesc:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth
|
||||
if elementTxWidth > elementTxRectWidth then
|
||||
@ -199,7 +200,8 @@ function HeroDetailUI:updateHero()
|
||||
self.elementBg:setSizeDeltaX(52 + elementTxRectWidth)
|
||||
end
|
||||
|
||||
self.heroElement:setSprite(GConst.ATLAS_PATH.HERO, ModuleManager.HeroManager:getMatchTypeIcon(self.heroEntity:getMatchType()))
|
||||
self.elementBg:setSprite(ModuleManager.HeroManager:getMatchTypeBg(matchType))
|
||||
self.heroElement:setSprite(GConst.ATLAS_PATH.ICON_HERO, ModuleManager.HeroManager:getMatchTypeIcon(matchType))
|
||||
self.spineObjAvatar:getSkeletonGraphic().enabled = false
|
||||
self.spineObjAvatar:loadAssetAsync(self.heroEntity:getModelId(), function()
|
||||
self.spineObjAvatar:getSkeletonGraphic().enabled = true
|
||||
@ -278,6 +280,7 @@ function HeroDetailUI:showHeroInfo()
|
||||
self.heroInfo:initPrefabHelper()
|
||||
self.heroInfo:genAllChildren()
|
||||
self.compHero = self.heroInfo:addLuaComponent(COMP_HERO)
|
||||
self.compHero:setParentUI(self)
|
||||
end
|
||||
|
||||
self.compHero:setHeroData(self.heroEntity, self.onlyLook)
|
||||
|
||||
@ -31,6 +31,16 @@ function HeroInfoComp:init()
|
||||
self.upgrade = uiMap["hero_info.up"]
|
||||
self.bgElement = uiMap["hero_info.element_bg"]
|
||||
self.btnAttr = uiMap["hero_info.bg_6.attr_btn"]
|
||||
self.gotoBtn = uiMap["hero_info.up.goto_btn"]
|
||||
self.needStarNode = uiMap["hero_info.up.need_star_node"]
|
||||
self.needStarNodeDescTx1 = uiMap["hero_info.up.need_star_node.desc_tx_1"]
|
||||
self.needStarNodeStarImg = uiMap["hero_info.up.need_star_node.star_img"]
|
||||
self.needStarNodeDescTx2 = uiMap["hero_info.up.need_star_node.desc_tx_2"]
|
||||
uiMap["hero_info.up.goto_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_18))
|
||||
self.needStarNodeDescTx2:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_20))
|
||||
local meshProComp = self.needStarNodeDescTx2:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO)
|
||||
local contentWidth = meshProComp.preferredWidth
|
||||
self.needStarNodeDescTx2:setSizeDeltaX(contentWidth)
|
||||
|
||||
self.skill = {}
|
||||
self.skillIcon = {}
|
||||
@ -49,8 +59,8 @@ function HeroInfoComp:init()
|
||||
self.spineObjSkill:setVisible(false)
|
||||
-- self.spineObjLv:setVisible(false)
|
||||
self.spineObj:setVisible(false)
|
||||
self.txUpdesc:setText("升1级")
|
||||
self.txUpdesc5:setText("升5级")
|
||||
self.txUpdesc:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_15, 1))
|
||||
self.txUpdesc5:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_15, 5))
|
||||
|
||||
self.btnUp:addClickListener(function()
|
||||
ModuleManager.HeroManager:upgradeHero(self.heroEntity:getCfgId(), self.heroEntity)
|
||||
@ -62,6 +72,9 @@ function HeroInfoComp:init()
|
||||
end
|
||||
ModuleManager.HeroManager:upgradeHero(self.heroEntity:getCfgId(), self.heroEntity, canLvUpLv)
|
||||
end)
|
||||
self.gotoBtn:addClickListener(function()
|
||||
self.parentUI:changePage(GConst.HeroConst.PANEL_TYPE.STAR)
|
||||
end)
|
||||
self.btnskillDescTxs:addClickListener(function()
|
||||
local cfg = ConfigManager:getConfig("skill")[self.heroEntity:getBaseSkill()]
|
||||
if cfg.buff_id and #cfg.buff_id > 0 then
|
||||
@ -76,6 +89,10 @@ function HeroInfoComp:init()
|
||||
end)
|
||||
end
|
||||
|
||||
function HeroInfoComp:setParentUI(parentUI)
|
||||
self.parentUI = parentUI
|
||||
end
|
||||
|
||||
function HeroInfoComp:setHeroData(heroEntity, onlyLook)
|
||||
self.curLevel = heroEntity:getLv()
|
||||
self.heroEntity = heroEntity
|
||||
@ -130,10 +147,10 @@ function HeroInfoComp:refresh(checkLevel)
|
||||
if skillUnlcokLv > lv then
|
||||
-- skillLv:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, skillLvs[i] or 0))
|
||||
skillLv:setText(I18N:getGlobalText(I18N.GlobalConst.LV_UNLOCK, skillUnlcokLv))
|
||||
skillBg:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, "frame_1")
|
||||
skillBg:setSprite(GConst.ATLAS_PATH.ICON_ITEM, "frame_1")
|
||||
else
|
||||
if nextLvUp then
|
||||
skillLv:setText(nextLvUp .. "提升")
|
||||
skillLv:setText(nextLvUp .. I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_17))
|
||||
else
|
||||
skillLv:setText(GConst.EMPTY_STRING)
|
||||
end
|
||||
@ -151,6 +168,7 @@ function HeroInfoComp:refresh(checkLevel)
|
||||
-- self.bgFragment:setVisible(not self.heroEntity:isMaxLv())
|
||||
|
||||
local canLvUp = self.heroEntity:canLvUp()
|
||||
local nextLv = self.heroEntity:getNextLv()
|
||||
-- self.imgFragment:setVisible(not canLvUp)
|
||||
|
||||
local lv = self.heroEntity:getLv()
|
||||
@ -178,37 +196,65 @@ function HeroInfoComp:refresh(checkLevel)
|
||||
hpStr = self.heroEntity:getCfgHp(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
|
||||
atkStr = self.heroEntity:getCfgAtk(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
|
||||
end
|
||||
local costs = {}
|
||||
costs[1] = {id = self.heroEntity:getFragmentId(), num = materials[1], type = 1}
|
||||
costs[2] = {id = self.heroEntity:getLvUpCostId(), num = materials[2], type = 1}
|
||||
for i,v in ipairs(self.costCells) do
|
||||
v:refreshByConfig(costs[i])
|
||||
end
|
||||
-- local costId = self.heroEntity:getLvUpCostId()
|
||||
-- self.imgUpIcon:setSprite(GFunc.getIconRes(costId))
|
||||
-- self.txUpdesc:setText(str)
|
||||
-- self.txUpNum:setText(materials[2])
|
||||
self.txHp:setText(hpStr)
|
||||
self.txAtk:setText(atkStr)
|
||||
if canLvUp then
|
||||
self.btnUp:addRedPoint(70, 40, 0.6)
|
||||
if self.heroEntity:isMaxLv() then
|
||||
self.btnUp:setActive(false)
|
||||
self.btnUp5:setActive(false)
|
||||
self.gotoBtn:setActive(false)
|
||||
self.needStarNode:setActive(false)
|
||||
elseif lv >= nextLv then
|
||||
self.btnUp:setActive(false)
|
||||
self.btnUp5:setActive(false)
|
||||
self.gotoBtn:setActive(true)
|
||||
self.needStarNode:setActive(true)
|
||||
local star = self.heroEntity:getStar()
|
||||
local currStar = star%5 + 1
|
||||
self.needStarNodeDescTx1:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_19, currStar))
|
||||
local meshProComp = self.needStarNodeDescTx1:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO)
|
||||
local contentWidth = meshProComp.preferredWidth
|
||||
self.needStarNodeDescTx1:setSizeDeltaX(contentWidth)
|
||||
self.needStarNode:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_HORIZONTAL_OR_VERTICAL_LAYOUT):RefreshLayout()
|
||||
local starType = math.ceil(currStar / 5)
|
||||
self.needStarNodeStarImg:setSprite(GFunc.getStarImg(starType))
|
||||
|
||||
for i,v in ipairs(self.costCells) do
|
||||
v:setActive(false)
|
||||
end
|
||||
else
|
||||
self.btnUp:removeRedPoint()
|
||||
self.btnUp:setActive(true)
|
||||
self.btnUp5:setActive(true)
|
||||
self.gotoBtn:setActive(false)
|
||||
self.needStarNode:setActive(false)
|
||||
|
||||
local costs = {}
|
||||
costs[1] = {id = self.heroEntity:getFragmentId(), num = materials[1], type = 1}
|
||||
costs[2] = {id = self.heroEntity:getLvUpCostId(), num = materials[2], type = 1}
|
||||
for i,v in ipairs(self.costCells) do
|
||||
v:setActive(true)
|
||||
v:refreshByConfig(costs[i])
|
||||
end
|
||||
|
||||
-- self.spineObjLv:setVisible(canLvUp)
|
||||
if canLvUp then
|
||||
self.btnUp:addRedPoint(70, 30, 0.6)
|
||||
self.btnUp5:addRedPoint(70, 30, 0.6)
|
||||
self.btnUp:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[1])
|
||||
self.btnUp5:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[2])
|
||||
-- self.spineObjLv:playAnim("animation", true, false)
|
||||
else
|
||||
self.btnUp:removeRedPoint()
|
||||
self.btnUp5:removeRedPoint()
|
||||
self.btnUp:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[3])
|
||||
self.btnUp5:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[3])
|
||||
end
|
||||
self.btnUp:setTouchEnable(true)
|
||||
self.btnUp:setActive(not self.heroEntity:isMaxLv())
|
||||
self.btnUp5:setTouchEnable(true)
|
||||
self.btnUp5:setActive(not self.heroEntity:isMaxLv())
|
||||
end
|
||||
-- self.needStarNode = uiMap["hero_info.up.need_star_node"]
|
||||
-- self.needStarNodeDescTx1 = uiMap["hero_info.up.need_star_node.desc_tx_1"]
|
||||
-- self.needStarNodeStarImg = uiMap["hero_info.up.need_star_node.star_img"]
|
||||
-- self.needStarNodeDescTx2 = uiMap["hero_info.up.need_star_node.desc_tx_2"]
|
||||
|
||||
if isLvChange then
|
||||
self.spineObj:setVisible(true)
|
||||
|
||||
@ -23,6 +23,10 @@ end
|
||||
function HeroSkillInfoUI:onLoadRootComplete()
|
||||
local uiMap = self.root:genAllChildren()
|
||||
|
||||
self.root:addClickListener(function()
|
||||
self:closeUI()
|
||||
end)
|
||||
|
||||
uiMap["hero_skill_info_ui.content.btn_close"]:addClickListener(function()
|
||||
self:closeUI()
|
||||
end)
|
||||
@ -77,7 +81,7 @@ function HeroSkillInfoUI:refreshSkillIcon()
|
||||
|
||||
self.icon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(skillId))
|
||||
if skillUnlcokLv > lv then
|
||||
self.skillIcon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, "frame_1")
|
||||
self.skillIcon:setSprite(GConst.ATLAS_PATH.ICON_ITEM, "frame_1")
|
||||
|
||||
self.unlockTx:setText(I18N:getGlobalText(I18N.GlobalConst.LV_UNLOCK, skillUnlcokLv))
|
||||
local meshProComp = self.unlockTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO)
|
||||
|
||||
@ -20,9 +20,8 @@ function StarInfoComp:init()
|
||||
self.currLvTx = uiMap["star_info.info_node.curr_lv_tx"]
|
||||
self.nextLvTx = uiMap["star_info.info_node.next_lv_tx"]
|
||||
|
||||
-- self.upBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4))
|
||||
self.upBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_16))
|
||||
-- self.descTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4))
|
||||
self.upBtnTx:setText("升星")
|
||||
self.lvBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4))
|
||||
self.upBtn:addClickListener(function()
|
||||
ModuleManager.HeroManager:upgradeHeroStar(self.heroEntity:getCfgId())
|
||||
|
||||
@ -419,7 +419,11 @@ function HeroEntity:getLvUpLv()
|
||||
local count = 0
|
||||
local totalCost1 = 0
|
||||
local totalCost2 = 0
|
||||
local nextLv = self:getNextLv()
|
||||
for i = 1, 5 do
|
||||
if self.data.lv + i > nextLv then
|
||||
break
|
||||
end
|
||||
local lv = self.data.lv + i
|
||||
local nextLvInfo = ConfigManager:getConfig("hero_level")[lv]
|
||||
if not nextLvInfo then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user