This commit is contained in:
puxuan 2025-08-19 20:31:19 +08:00
parent 78d6b533e0
commit 9f41da288b
23 changed files with 204 additions and 132 deletions

View File

@ -1,9 +1,5 @@
local hero_star = { local hero_star = {
[1]={ [1]={
["cost_2"]={
30,
5
},
["cost_3"]={ ["cost_3"]={
30, 30,
5 5
@ -15,258 +11,262 @@ local hero_star = {
["cost_5"]={ ["cost_5"]={
30, 30,
5 5
},
["cost_6"]={
30,
5
} }
}, },
[2]={ [2]={
["cost_2"]={
40,
14
},
["cost_3"]={ ["cost_3"]={
40, 40,
14 14
}, },
["cost_4"]={ ["cost_4"]={
40, 40,
10 14
}, },
["cost_5"]={ ["cost_5"]={
40, 40,
10 10
},
["cost_6"]={
40,
10
} }
}, },
[3]={ [3]={
["cost_2"]={
55,
23
},
["cost_3"]={ ["cost_3"]={
55, 55,
23 23
}, },
["cost_4"]={ ["cost_4"]={
55, 55,
15 23
}, },
["cost_5"]={ ["cost_5"]={
55, 55,
15 15
},
["cost_6"]={
55,
15
} }
}, },
[4]={ [4]={
["cost_2"]={
70,
32
},
["cost_3"]={ ["cost_3"]={
70, 70,
32 32
}, },
["cost_4"]={ ["cost_4"]={
70, 70,
20 32
}, },
["cost_5"]={ ["cost_5"]={
70, 70,
20 20
},
["cost_6"]={
70,
20
} }
}, },
[5]={ [5]={
["cost_2"]={
85,
40
},
["cost_3"]={ ["cost_3"]={
85, 85,
40 40
}, },
["cost_4"]={ ["cost_4"]={
85, 85,
25 40
}, },
["cost_5"]={ ["cost_5"]={
85, 85,
25 25
},
["cost_6"]={
85,
25
} }
}, },
[6]={ [6]={
["cost_2"]={
100,
49
},
["cost_3"]={ ["cost_3"]={
100, 100,
49 49
}, },
["cost_4"]={ ["cost_4"]={
100, 100,
30 49
}, },
["cost_5"]={ ["cost_5"]={
100, 100,
30 30
},
["cost_6"]={
100,
30
} }
}, },
[7]={ [7]={
["cost_2"]={
115,
58
},
["cost_3"]={ ["cost_3"]={
115, 115,
58 58
}, },
["cost_4"]={ ["cost_4"]={
115, 115,
35 58
}, },
["cost_5"]={ ["cost_5"]={
115, 115,
35 35
},
["cost_6"]={
115,
35
} }
}, },
[8]={ [8]={
["cost_2"]={
130,
67
},
["cost_3"]={ ["cost_3"]={
130, 130,
67 67
}, },
["cost_4"]={ ["cost_4"]={
130, 130,
40 67
}, },
["cost_5"]={ ["cost_5"]={
130, 130,
40 40
},
["cost_6"]={
130,
40
} }
}, },
[9]={ [9]={
["cost_2"]={
145,
75
},
["cost_3"]={ ["cost_3"]={
145, 145,
75 75
}, },
["cost_4"]={ ["cost_4"]={
145, 145,
45 75
}, },
["cost_5"]={ ["cost_5"]={
145, 145,
45 45
},
["cost_6"]={
145,
45
} }
}, },
[10]={ [10]={
["cost_2"]={
160,
84
},
["cost_3"]={ ["cost_3"]={
160, 160,
84 84
}, },
["cost_4"]={ ["cost_4"]={
160, 160,
50 84
}, },
["cost_5"]={ ["cost_5"]={
160, 160,
50 50
},
["cost_6"]={
160,
50
} }
}, },
[11]={ [11]={
["cost_2"]={
175,
93
},
["cost_3"]={ ["cost_3"]={
175, 175,
93 93
}, },
["cost_4"]={ ["cost_4"]={
175, 175,
56 93
}, },
["cost_5"]={ ["cost_5"]={
175, 175,
56 56
},
["cost_6"]={
175,
56
} }
}, },
[12]={ [12]={
["cost_2"]={
200,
102
},
["cost_3"]={ ["cost_3"]={
200, 200,
102 102
}, },
["cost_4"]={ ["cost_4"]={
200, 200,
62 102
}, },
["cost_5"]={ ["cost_5"]={
200, 200,
62 62
},
["cost_6"]={
200,
62
} }
}, },
[13]={ [13]={
["cost_2"]={
225,
110
},
["cost_3"]={ ["cost_3"]={
225, 225,
110 110
}, },
["cost_4"]={ ["cost_4"]={
225, 225,
68 110
}, },
["cost_5"]={ ["cost_5"]={
225, 225,
68 68
},
["cost_6"]={
225,
68
} }
}, },
[14]={ [14]={
["cost_2"]={
250,
120
},
["cost_3"]={ ["cost_3"]={
250, 250,
120 120
}, },
["cost_4"]={ ["cost_4"]={
250, 250,
76 120
}, },
["cost_5"]={ ["cost_5"]={
250, 250,
76 76
},
["cost_6"]={
250,
76
} }
}, },
[15]={ [15]={
["cost_2"]={
275,
130
},
["cost_3"]={ ["cost_3"]={
275, 275,
130 130
}, },
["cost_4"]={ ["cost_4"]={
275, 275,
85 130
}, },
["cost_5"]={ ["cost_5"]={
275, 275,
85 85
},
["cost_6"]={
275,
85
} }
} }
} }

View File

@ -665,6 +665,12 @@ local LocalizationGlobalConst =
TASK_DESC_2 = "TASK_DESC_2", TASK_DESC_2 = "TASK_DESC_2",
IDLE_DESC_1 = "IDLE_DESC_1", IDLE_DESC_1 = "IDLE_DESC_1",
SUMMON_DESC_2 = "SUMMON_DESC_2", 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 return LocalizationGlobalConst

View File

@ -664,7 +664,13 @@ local localization_global =
["TALENT_DESC_3"] = "等级达到{0}可研发", ["TALENT_DESC_3"] = "等级达到{0}可研发",
["TASK_DESC_2"] = "成就", ["TASK_DESC_2"] = "成就",
["IDLE_DESC_1"] = "挂机", ["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 return localization_global

View File

@ -12,10 +12,10 @@ local task_daily_challenge = {
["desc"]="通关时{0}色元素英雄释放技能{1}次" ["desc"]="通关时{0}色元素英雄释放技能{1}次"
}, },
[5]={ [5]={
["desc"]="{0}回合内击败最终首领" ["desc"]="10回合内击败最终首领"
}, },
[6]={ [6]={
["desc"]="通关时,{0}颜色元素造成伤害占比超过{1}%" ["desc"]="通关时,{0}造成伤害占比超过{1}%"
} }
} }
local config = { local config = {

View File

@ -9,7 +9,7 @@ local task_daily_challenge = {
}, },
[4]={ [4]={
["desc"]="通关时{0}色元素英雄释放技能{1}次"
}, },
[5]={ [5]={

View File

@ -9,10 +9,10 @@ local task_daily_challenge = {
["desc"]="Link 8 or more elements in battle {0} times and beat the stage" ["desc"]="Link 8 or more elements in battle {0} times and beat the stage"
}, },
[4]={ [4]={
["desc"]="Defeat the final boss within 10 rounds" ["desc"]="通关时{0}色元素英雄释放技能{1}次"
}, },
[5]={ [5]={
["desc"]="{0} damage dealt exceeds {1}% of total damage and beat the stage" ["desc"]="Defeat the final boss within 10 rounds"
}, },
[6]={ [6]={
["desc"]="{0} damage dealt exceeds {1}% of total damage and beat the stage" ["desc"]="{0} damage dealt exceeds {1}% of total damage and beat the stage"

View File

@ -9,10 +9,10 @@ local task_daily_challenge = {
["desc"]="Conectar 8 o más elementos {0} veces en combate al completar la fase." ["desc"]="Conectar 8 o más elementos {0} veces en combate al completar la fase."
}, },
[4]={ [4]={
["desc"]="Derrotar al jefe final en 10 rondas." ["desc"]="通关时{0}色元素英雄释放技能{1}次"
}, },
[5]={ [5]={
["desc"]="{0} causa más del {1}% del daño al completar la fase." ["desc"]="Derrotar al jefe final en 10 rondas."
}, },
[6]={ [6]={
["desc"]="{0} causa más del {1}% del daño al completar la fase." ["desc"]="{0} causa más del {1}% del daño al completar la fase."

View File

@ -9,7 +9,7 @@ local task_daily_challenge = {
}, },
[4]={ [4]={
["desc"]="通关时{0}色元素英雄释放技能{1}次"
}, },
[5]={ [5]={

View File

@ -9,10 +9,10 @@ local task_daily_challenge = {
["desc"]="Hubungkan 8 elemen atau lebih sebanyak {0} kali dalam battle" ["desc"]="Hubungkan 8 elemen atau lebih sebanyak {0} kali dalam battle"
}, },
[4]={ [4]={
["desc"]="Kalahkan Boss terakhir dalam 10 giliran" ["desc"]="通关时{0}色元素英雄释放技能{1}次"
}, },
[5]={ [5]={
["desc"]="{0} menyebabkan lebih dari {1}% DMG saat lolos stage" ["desc"]="Kalahkan Boss terakhir dalam 10 giliran"
}, },
[6]={ [6]={
["desc"]="{0} menyebabkan lebih dari {1}% DMG saat lolos stage" ["desc"]="{0} menyebabkan lebih dari {1}% DMG saat lolos stage"

View File

@ -9,10 +9,10 @@ local task_daily_challenge = {
["desc"]="クエストをクリアする、且つ{0}回以上8連消しを行う。" ["desc"]="クエストをクリアする、且つ{0}回以上8連消しを行う。"
}, },
[4]={ [4]={
["desc"]="10ターン以内に最終ボスを撃破する。" ["desc"]="通关时{0}色元素英雄释放技能{1}次"
}, },
[5]={ [5]={
["desc"]="クエストをクリアする、且つ{0}が合計ダメージ{1}%以上を貢献する。" ["desc"]="10ターン以内に最終ボスを撃破する。"
}, },
[6]={ [6]={
["desc"]="クエストをクリアする、且つ{0}が合計ダメージ{1}%以上を貢献する。" ["desc"]="クエストをクリアする、且つ{0}が合計ダメージ{1}%以上を貢献する。"

View File

@ -9,10 +9,10 @@ local task_daily_challenge = {
["desc"]="스테이지 클리어시, 전투에서 8개 또는 그 이상의 원소를 {0}번 연결하기" ["desc"]="스테이지 클리어시, 전투에서 8개 또는 그 이상의 원소를 {0}번 연결하기"
}, },
[4]={ [4]={
["desc"]="10턴 이내에 최종 보스 처치하기" ["desc"]="通关时{0}色元素英雄释放技能{1}次"
}, },
[5]={ [5]={
["desc"]="스테이지 클리어 시, {0}이(가) 입힌 대미지가 전체 피해의 {1}% 초과하기" ["desc"]="10턴 이내에 최종 보스 처치하기"
}, },
[6]={ [6]={
["desc"]="스테이지 클리어 시, {0}이(가) 입힌 대미지가 전체 피해의 {1}% 초과하기" ["desc"]="스테이지 클리어 시, {0}이(가) 입힌 대미지가 전체 피해의 {1}% 초과하기"

View File

@ -9,10 +9,10 @@ local task_daily_challenge = {
["desc"]="Durante a conclusão, conecte 8 ou mais elementos na batalha {0} vezes" ["desc"]="Durante a conclusão, conecte 8 ou mais elementos na batalha {0} vezes"
}, },
[4]={ [4]={
["desc"]="Derrote o chefe final em 10 turnos" ["desc"]="通关时{0}色元素英雄释放技能{1}次"
}, },
[5]={ [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]={ [6]={
["desc"]="Ao concluir, a porcentagem de dano causado por {0} deve ser superior a {1}%" ["desc"]="Ao concluir, a porcentagem de dano causado por {0} deve ser superior a {1}%"

View File

@ -9,7 +9,7 @@ local task_daily_challenge = {
}, },
[4]={ [4]={
["desc"]="通关时{0}色元素英雄释放技能{1}次"
}, },
[5]={ [5]={

View File

@ -9,10 +9,10 @@ local task_daily_challenge = {
["desc"]="เมื่อผ่านด่าน เชื่อมโยง 8 ธาตุหรือขึ้นไป{0}ครั้งในการต่อสู้" ["desc"]="เมื่อผ่านด่าน เชื่อมโยง 8 ธาตุหรือขึ้นไป{0}ครั้งในการต่อสู้"
}, },
[4]={ [4]={
["desc"]="เอาชนะบอสตัวสุดท้ายภายใน 10 รอบ" ["desc"]="通关时{0}色元素英雄释放技能{1}次"
}, },
[5]={ [5]={
["desc"]="มื่อผ่านด่าน {0}สร้างดาเมจมากกว่า{1}%" ["desc"]="อาชนะบอสตัวสุดท้ายภายใน 10 รอบ"
}, },
[6]={ [6]={
["desc"]="เมื่อผ่านด่าน {0}สร้างดาเมจมากกว่า{1}%" ["desc"]="เมื่อผ่านด่าน {0}สร้างดาเมจมากกว่า{1}%"

View File

@ -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" ["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]={ [4]={
["desc"]="Hạ BOSS Cuối trong 10 hiệp" ["desc"]="通关时{0}色元素英雄释放技能{1}次"
}, },
[5]={ [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]={ [6]={
["desc"]="Khi vượt ải, tỷ lệ sát thương do {0} gây ra vượt quá {1}%" ["desc"]="Khi vượt ải, tỷ lệ sát thương do {0} gây ra vượt quá {1}%"

View File

@ -9,10 +9,10 @@ local task_daily_challenge = {
["desc"]="通關時戰鬥中連接8個或以上元素{0}次" ["desc"]="通關時戰鬥中連接8個或以上元素{0}次"
}, },
[4]={ [4]={
["desc"]="10回合內擊敗最終首領" ["desc"]="通关时{0}色元素英雄释放技能{1}次"
}, },
[5]={ [5]={
["desc"]="通關時,{0}造成傷害佔比超過{1}%" ["desc"]="10回合內擊敗最終首領"
}, },
[6]={ [6]={
["desc"]="通關時,{0}造成傷害佔比超過{1}%" ["desc"]="通關時,{0}造成傷害佔比超過{1}%"

View File

@ -1976,9 +1976,9 @@ function GFunc.getStarImg(starType)
if starType == GConst.HeroConst.STAR_TYPE.LV_1 then if starType == GConst.HeroConst.STAR_TYPE.LV_1 then
return GConst.ATLAS_PATH.COMMON, "common_star_1" return GConst.ATLAS_PATH.COMMON, "common_star_1"
elseif starType == GConst.HeroConst.STAR_TYPE.LV_2 then 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 else
return GConst.ATLAS_PATH.COMMON, "common_info" return GConst.ATLAS_PATH.COMMON, "common_star_3"
end end
end end

View File

@ -106,6 +106,10 @@ function HeroManager:getMatchTypeIcon(matchType)
return GConst.HeroConst.MATCH_ICON_NAME[matchType] return GConst.HeroConst.MATCH_ICON_NAME[matchType]
end end
function HeroManager:getMatchTypeBg(matchType)
return GConst.ATLAS_PATH.COMMON, "common_quality_" .. matchType
end
function HeroManager:getMatchTypeName(matchType, needColor) function HeroManager:getMatchTypeName(matchType, needColor)
local name = I18N:getGlobalText("ELEMENT_NAME_" .. matchType) local name = I18N:getGlobalText("ELEMENT_NAME_" .. matchType)
if name and needColor then if name and needColor then

View File

@ -70,7 +70,7 @@ function HeroDetailUI:onLoadRootComplete()
self.qltBgTx = uiMap["hero_detail_ui.common.qlt_bg.qlt_tx"] 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.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.pageBtns = {}
self.pageBtnTxs = {} self.pageBtnTxs = {}
self.pageBtnLocks = {} self.pageBtnLocks = {}
@ -190,7 +190,8 @@ function HeroDetailUI:updateSide()
end end
function HeroDetailUI:updateHero() 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 elementTxRectWidth = self.elementDesc:getRectWidth()
local elementTxWidth = self.elementDesc:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth local elementTxWidth = self.elementDesc:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth
if elementTxWidth > elementTxRectWidth then if elementTxWidth > elementTxRectWidth then
@ -199,7 +200,8 @@ function HeroDetailUI:updateHero()
self.elementBg:setSizeDeltaX(52 + elementTxRectWidth) self.elementBg:setSizeDeltaX(52 + elementTxRectWidth)
end 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:getSkeletonGraphic().enabled = false
self.spineObjAvatar:loadAssetAsync(self.heroEntity:getModelId(), function() self.spineObjAvatar:loadAssetAsync(self.heroEntity:getModelId(), function()
self.spineObjAvatar:getSkeletonGraphic().enabled = true self.spineObjAvatar:getSkeletonGraphic().enabled = true
@ -278,6 +280,7 @@ function HeroDetailUI:showHeroInfo()
self.heroInfo:initPrefabHelper() self.heroInfo:initPrefabHelper()
self.heroInfo:genAllChildren() self.heroInfo:genAllChildren()
self.compHero = self.heroInfo:addLuaComponent(COMP_HERO) self.compHero = self.heroInfo:addLuaComponent(COMP_HERO)
self.compHero:setParentUI(self)
end end
self.compHero:setHeroData(self.heroEntity, self.onlyLook) self.compHero:setHeroData(self.heroEntity, self.onlyLook)

View File

@ -31,6 +31,16 @@ function HeroInfoComp:init()
self.upgrade = uiMap["hero_info.up"] self.upgrade = uiMap["hero_info.up"]
self.bgElement = uiMap["hero_info.element_bg"] self.bgElement = uiMap["hero_info.element_bg"]
self.btnAttr = uiMap["hero_info.bg_6.attr_btn"] 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.skill = {}
self.skillIcon = {} self.skillIcon = {}
@ -49,8 +59,8 @@ function HeroInfoComp:init()
self.spineObjSkill:setVisible(false) self.spineObjSkill:setVisible(false)
-- self.spineObjLv:setVisible(false) -- self.spineObjLv:setVisible(false)
self.spineObj:setVisible(false) self.spineObj:setVisible(false)
self.txUpdesc:setText("升1级") self.txUpdesc:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_15, 1))
self.txUpdesc5:setText("升5级") self.txUpdesc5:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_15, 5))
self.btnUp:addClickListener(function() self.btnUp:addClickListener(function()
ModuleManager.HeroManager:upgradeHero(self.heroEntity:getCfgId(), self.heroEntity) ModuleManager.HeroManager:upgradeHero(self.heroEntity:getCfgId(), self.heroEntity)
@ -62,6 +72,9 @@ function HeroInfoComp:init()
end end
ModuleManager.HeroManager:upgradeHero(self.heroEntity:getCfgId(), self.heroEntity, canLvUpLv) ModuleManager.HeroManager:upgradeHero(self.heroEntity:getCfgId(), self.heroEntity, canLvUpLv)
end) end)
self.gotoBtn:addClickListener(function()
self.parentUI:changePage(GConst.HeroConst.PANEL_TYPE.STAR)
end)
self.btnskillDescTxs:addClickListener(function() self.btnskillDescTxs:addClickListener(function()
local cfg = ConfigManager:getConfig("skill")[self.heroEntity:getBaseSkill()] local cfg = ConfigManager:getConfig("skill")[self.heroEntity:getBaseSkill()]
if cfg.buff_id and #cfg.buff_id > 0 then if cfg.buff_id and #cfg.buff_id > 0 then
@ -76,6 +89,10 @@ function HeroInfoComp:init()
end) end)
end end
function HeroInfoComp:setParentUI(parentUI)
self.parentUI = parentUI
end
function HeroInfoComp:setHeroData(heroEntity, onlyLook) function HeroInfoComp:setHeroData(heroEntity, onlyLook)
self.curLevel = heroEntity:getLv() self.curLevel = heroEntity:getLv()
self.heroEntity = heroEntity self.heroEntity = heroEntity
@ -130,10 +147,10 @@ function HeroInfoComp:refresh(checkLevel)
if skillUnlcokLv > lv then if skillUnlcokLv > lv then
-- skillLv:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, skillLvs[i] or 0)) -- skillLv:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, skillLvs[i] or 0))
skillLv:setText(I18N:getGlobalText(I18N.GlobalConst.LV_UNLOCK, skillUnlcokLv)) 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 else
if nextLvUp then if nextLvUp then
skillLv:setText(nextLvUp .. "提升") skillLv:setText(nextLvUp .. I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_17))
else else
skillLv:setText(GConst.EMPTY_STRING) skillLv:setText(GConst.EMPTY_STRING)
end end
@ -151,6 +168,7 @@ function HeroInfoComp:refresh(checkLevel)
-- self.bgFragment:setVisible(not self.heroEntity:isMaxLv()) -- self.bgFragment:setVisible(not self.heroEntity:isMaxLv())
local canLvUp = self.heroEntity:canLvUp() local canLvUp = self.heroEntity:canLvUp()
local nextLv = self.heroEntity:getNextLv()
-- self.imgFragment:setVisible(not canLvUp) -- self.imgFragment:setVisible(not canLvUp)
local lv = self.heroEntity:getLv() local lv = self.heroEntity:getLv()
@ -178,37 +196,65 @@ function HeroInfoComp:refresh(checkLevel)
hpStr = self.heroEntity:getCfgHp(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR hpStr = self.heroEntity:getCfgHp(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
atkStr = self.heroEntity:getCfgAtk(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR atkStr = self.heroEntity:getCfgAtk(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
end 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() -- local costId = self.heroEntity:getLvUpCostId()
-- self.imgUpIcon:setSprite(GFunc.getIconRes(costId)) -- self.imgUpIcon:setSprite(GFunc.getIconRes(costId))
-- self.txUpdesc:setText(str) -- self.txUpdesc:setText(str)
-- self.txUpNum:setText(materials[2]) -- self.txUpNum:setText(materials[2])
self.txHp:setText(hpStr) self.txHp:setText(hpStr)
self.txAtk:setText(atkStr) self.txAtk:setText(atkStr)
if canLvUp then if self.heroEntity:isMaxLv() then
self.btnUp:addRedPoint(70, 40, 0.6) self.btnUp:setActive(false)
else self.btnUp5:setActive(false)
self.btnUp:removeRedPoint() self.gotoBtn:setActive(false)
end 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))
-- self.spineObjLv:setVisible(canLvUp) for i,v in ipairs(self.costCells) do
if canLvUp then v:setActive(false)
self.btnUp:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[1]) end
self.btnUp5:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[2])
-- self.spineObjLv:playAnim("animation", true, false)
else else
self.btnUp:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[3]) self.btnUp:setActive(true)
self.btnUp5:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[3]) 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
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])
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
end end
self.btnUp:setTouchEnable(true) -- self.needStarNode = uiMap["hero_info.up.need_star_node"]
self.btnUp:setActive(not self.heroEntity:isMaxLv()) -- self.needStarNodeDescTx1 = uiMap["hero_info.up.need_star_node.desc_tx_1"]
self.btnUp5:setTouchEnable(true) -- self.needStarNodeStarImg = uiMap["hero_info.up.need_star_node.star_img"]
self.btnUp5:setActive(not self.heroEntity:isMaxLv()) -- self.needStarNodeDescTx2 = uiMap["hero_info.up.need_star_node.desc_tx_2"]
if isLvChange then if isLvChange then
self.spineObj:setVisible(true) self.spineObj:setVisible(true)

View File

@ -23,6 +23,10 @@ end
function HeroSkillInfoUI:onLoadRootComplete() function HeroSkillInfoUI:onLoadRootComplete()
local uiMap = self.root:genAllChildren() local uiMap = self.root:genAllChildren()
self.root:addClickListener(function()
self:closeUI()
end)
uiMap["hero_skill_info_ui.content.btn_close"]:addClickListener(function() uiMap["hero_skill_info_ui.content.btn_close"]:addClickListener(function()
self:closeUI() self:closeUI()
end) end)
@ -77,7 +81,7 @@ function HeroSkillInfoUI:refreshSkillIcon()
self.icon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(skillId)) self.icon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(skillId))
if skillUnlcokLv > lv then 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)) self.unlockTx:setText(I18N:getGlobalText(I18N.GlobalConst.LV_UNLOCK, skillUnlcokLv))
local meshProComp = self.unlockTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO) local meshProComp = self.unlockTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO)

View File

@ -20,9 +20,8 @@ function StarInfoComp:init()
self.currLvTx = uiMap["star_info.info_node.curr_lv_tx"] self.currLvTx = uiMap["star_info.info_node.curr_lv_tx"]
self.nextLvTx = uiMap["star_info.info_node.next_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.descTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4))
self.upBtnTx:setText("升星")
self.lvBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4)) self.lvBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4))
self.upBtn:addClickListener(function() self.upBtn:addClickListener(function()
ModuleManager.HeroManager:upgradeHeroStar(self.heroEntity:getCfgId()) ModuleManager.HeroManager:upgradeHeroStar(self.heroEntity:getCfgId())

View File

@ -419,7 +419,11 @@ function HeroEntity:getLvUpLv()
local count = 0 local count = 0
local totalCost1 = 0 local totalCost1 = 0
local totalCost2 = 0 local totalCost2 = 0
local nextLv = self:getNextLv()
for i = 1, 5 do for i = 1, 5 do
if self.data.lv + i > nextLv then
break
end
local lv = self.data.lv + i local lv = self.data.lv + i
local nextLvInfo = ConfigManager:getConfig("hero_level")[lv] local nextLvInfo = ConfigManager:getConfig("hero_level")[lv]
if not nextLvInfo then if not nextLvInfo then