diff --git a/lua/app/config/hero_star.lua b/lua/app/config/hero_star.lua index a0b78344..bcb4ef2b 100644 --- a/lua/app/config/hero_star.lua +++ b/lua/app/config/hero_star.lua @@ -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 } } } diff --git a/lua/app/config/localization/localization_global_const.lua b/lua/app/config/localization/localization_global_const.lua index 18f2e2c9..47000cc1 100644 --- a/lua/app/config/localization/localization_global_const.lua +++ b/lua/app/config/localization/localization_global_const.lua @@ -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 \ No newline at end of file diff --git a/lua/app/config/strings/cn/global.lua b/lua/app/config/strings/cn/global.lua index e7142c50..a48385cc 100644 --- a/lua/app/config/strings/cn/global.lua +++ b/lua/app/config/strings/cn/global.lua @@ -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 \ No newline at end of file diff --git a/lua/app/config/strings/cn/task_daily_challenge.lua b/lua/app/config/strings/cn/task_daily_challenge.lua index be10cfae..7cedecbe 100644 --- a/lua/app/config/strings/cn/task_daily_challenge.lua +++ b/lua/app/config/strings/cn/task_daily_challenge.lua @@ -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 = { diff --git a/lua/app/config/strings/de/task_daily_challenge.lua b/lua/app/config/strings/de/task_daily_challenge.lua index a9363e61..62d615cb 100644 --- a/lua/app/config/strings/de/task_daily_challenge.lua +++ b/lua/app/config/strings/de/task_daily_challenge.lua @@ -9,7 +9,7 @@ local task_daily_challenge = { }, [4]={ - + ["desc"]="通关时{0}色元素英雄释放技能{1}次" }, [5]={ diff --git a/lua/app/config/strings/en/task_daily_challenge.lua b/lua/app/config/strings/en/task_daily_challenge.lua index 276551e1..c12faf01 100644 --- a/lua/app/config/strings/en/task_daily_challenge.lua +++ b/lua/app/config/strings/en/task_daily_challenge.lua @@ -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" diff --git a/lua/app/config/strings/es/task_daily_challenge.lua b/lua/app/config/strings/es/task_daily_challenge.lua index 56908d68..800dffc7 100644 --- a/lua/app/config/strings/es/task_daily_challenge.lua +++ b/lua/app/config/strings/es/task_daily_challenge.lua @@ -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." diff --git a/lua/app/config/strings/fr/task_daily_challenge.lua b/lua/app/config/strings/fr/task_daily_challenge.lua index a9363e61..62d615cb 100644 --- a/lua/app/config/strings/fr/task_daily_challenge.lua +++ b/lua/app/config/strings/fr/task_daily_challenge.lua @@ -9,7 +9,7 @@ local task_daily_challenge = { }, [4]={ - + ["desc"]="通关时{0}色元素英雄释放技能{1}次" }, [5]={ diff --git a/lua/app/config/strings/id/task_daily_challenge.lua b/lua/app/config/strings/id/task_daily_challenge.lua index 49e6eb65..f17a9cba 100644 --- a/lua/app/config/strings/id/task_daily_challenge.lua +++ b/lua/app/config/strings/id/task_daily_challenge.lua @@ -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" diff --git a/lua/app/config/strings/ja/task_daily_challenge.lua b/lua/app/config/strings/ja/task_daily_challenge.lua index 594bdc2f..85f7d251 100644 --- a/lua/app/config/strings/ja/task_daily_challenge.lua +++ b/lua/app/config/strings/ja/task_daily_challenge.lua @@ -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}%以上を貢献する。" diff --git a/lua/app/config/strings/ko/task_daily_challenge.lua b/lua/app/config/strings/ko/task_daily_challenge.lua index 606680f3..4af0da4d 100644 --- a/lua/app/config/strings/ko/task_daily_challenge.lua +++ b/lua/app/config/strings/ko/task_daily_challenge.lua @@ -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}% 초과하기" diff --git a/lua/app/config/strings/pt/task_daily_challenge.lua b/lua/app/config/strings/pt/task_daily_challenge.lua index 32c3c034..1cd44a83 100644 --- a/lua/app/config/strings/pt/task_daily_challenge.lua +++ b/lua/app/config/strings/pt/task_daily_challenge.lua @@ -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}%" diff --git a/lua/app/config/strings/ru/task_daily_challenge.lua b/lua/app/config/strings/ru/task_daily_challenge.lua index a9363e61..62d615cb 100644 --- a/lua/app/config/strings/ru/task_daily_challenge.lua +++ b/lua/app/config/strings/ru/task_daily_challenge.lua @@ -9,7 +9,7 @@ local task_daily_challenge = { }, [4]={ - + ["desc"]="通关时{0}色元素英雄释放技能{1}次" }, [5]={ diff --git a/lua/app/config/strings/th/task_daily_challenge.lua b/lua/app/config/strings/th/task_daily_challenge.lua index 4b22c1b8..5b0727a3 100644 --- a/lua/app/config/strings/th/task_daily_challenge.lua +++ b/lua/app/config/strings/th/task_daily_challenge.lua @@ -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}%" diff --git a/lua/app/config/strings/vi/task_daily_challenge.lua b/lua/app/config/strings/vi/task_daily_challenge.lua index 7ee58cd3..efdf643e 100644 --- a/lua/app/config/strings/vi/task_daily_challenge.lua +++ b/lua/app/config/strings/vi/task_daily_challenge.lua @@ -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}%" diff --git a/lua/app/config/strings/zh/task_daily_challenge.lua b/lua/app/config/strings/zh/task_daily_challenge.lua index 7c061246..5590e766 100644 --- a/lua/app/config/strings/zh/task_daily_challenge.lua +++ b/lua/app/config/strings/zh/task_daily_challenge.lua @@ -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}%" diff --git a/lua/app/global/global_func.lua b/lua/app/global/global_func.lua index 4342e7e8..696813aa 100644 --- a/lua/app/global/global_func.lua +++ b/lua/app/global/global_func.lua @@ -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 diff --git a/lua/app/module/hero/hero_manager.lua b/lua/app/module/hero/hero_manager.lua index 8953461e..f9c60cb3 100644 --- a/lua/app/module/hero/hero_manager.lua +++ b/lua/app/module/hero/hero_manager.lua @@ -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 diff --git a/lua/app/ui/hero/hero_detail_ui.lua b/lua/app/ui/hero/hero_detail_ui.lua index 60c5dafe..242ed645 100644 --- a/lua/app/ui/hero/hero_detail_ui.lua +++ b/lua/app/ui/hero/hero_detail_ui.lua @@ -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) diff --git a/lua/app/ui/hero/hero_info_comp.lua b/lua/app/ui/hero/hero_info_comp.lua index b2b9d57e..38be4420 100644 --- a/lua/app/ui/hero/hero_info_comp.lua +++ b/lua/app/ui/hero/hero_info_comp.lua @@ -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) - else - self.btnUp:removeRedPoint() - end + 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)) - -- self.spineObjLv:setVisible(canLvUp) - if canLvUp then - 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) + for i,v in ipairs(self.costCells) do + v:setActive(false) + end else - self.btnUp:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[3]) - self.btnUp5:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[3]) + 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 + + 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 - self.btnUp:setTouchEnable(true) - self.btnUp:setActive(not self.heroEntity:isMaxLv()) - self.btnUp5:setTouchEnable(true) - self.btnUp5:setActive(not self.heroEntity:isMaxLv()) + -- 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) diff --git a/lua/app/ui/hero/hero_skill_info_ui.lua b/lua/app/ui/hero/hero_skill_info_ui.lua index 44cc4610..41aa20b2 100644 --- a/lua/app/ui/hero/hero_skill_info_ui.lua +++ b/lua/app/ui/hero/hero_skill_info_ui.lua @@ -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) diff --git a/lua/app/ui/hero/star_info_comp.lua b/lua/app/ui/hero/star_info_comp.lua index 8b505401..efd52bf4 100644 --- a/lua/app/ui/hero/star_info_comp.lua +++ b/lua/app/ui/hero/star_info_comp.lua @@ -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()) diff --git a/lua/app/userdata/hero/hero_entity.lua b/lua/app/userdata/hero/hero_entity.lua index 1773be4d..243cdc53 100644 --- a/lua/app/userdata/hero/hero_entity.lua +++ b/lua/app/userdata/hero/hero_entity.lua @@ -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