From 594d5ac6c6d62d42a52983f7d6c86de389ad882d Mon Sep 17 00:00:00 2001 From: chenxi Date: Fri, 21 Apr 2023 22:41:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=A4=E5=AE=B3=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/global/global_const.lua | 10 ++++++++++ lua/app/module/hero/hero_manager.lua | 5 +++++ lua/app/ui/battle/cell/unit_result_report_cell.lua | 5 ++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lua/app/global/global_const.lua b/lua/app/global/global_const.lua index 9d79bb20..8d72c458 100644 --- a/lua/app/global/global_const.lua +++ b/lua/app/global/global_const.lua @@ -371,6 +371,16 @@ GConst.HERO_FRAME_QLT = { [7] = "frame_7", } +GConst.HERO_SMALL_FRAME_QLT = { + [1] = "frame_small_1", + [2] = "frame_small_2", + [3] = "frame_small_3", + [4] = "frame_small_4", + [5] = "frame_small_5", + [6] = "frame_small_6", + [7] = "frame_small_7", +} + GConst.HERO_FRAME_GRAY_QLT = { [1] = "frame_gray_1", [2] = "frame_gray_2", diff --git a/lua/app/module/hero/hero_manager.lua b/lua/app/module/hero/hero_manager.lua index cc8848f5..a11b9532 100644 --- a/lua/app/module/hero/hero_manager.lua +++ b/lua/app/module/hero/hero_manager.lua @@ -40,6 +40,11 @@ function HeroManager:getHeroIcon(heroId) return cfg and tostring(cfg.icon) end +function HeroManager:getHeroSmallFrame(heroId) + local cfg = ConfigManager:getConfig("hero")[heroId] + return cfg and GConst.HERO_SMALL_FRAME_QLT[cfg.qlt] +end + function HeroManager:getMatchTypeIcon(matchType) return GConst.HeroConst.MATCH_ICON_NAME[matchType] end diff --git a/lua/app/ui/battle/cell/unit_result_report_cell.lua b/lua/app/ui/battle/cell/unit_result_report_cell.lua index 5d1e6029..0e7600c8 100644 --- a/lua/app/ui/battle/cell/unit_result_report_cell.lua +++ b/lua/app/ui/battle/cell/unit_result_report_cell.lua @@ -6,7 +6,10 @@ function UnitResultReportCell:refresh(info, maxValue) if icon then uiMap["unit_result_report_cell.icon"]:setSprite(GConst.ATLAS_PATH.ICON_HERO, icon) end - + local smallFrame = ModuleManager.HeroManager:getHeroSmallFrame(info.heroId) + if smallFrame then + uiMap["unit_result_report_cell.frame"]:setSprite(GConst.ATLAS_PATH.ICON_HERO, smallFrame) + end uiMap["unit_result_report_cell.slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = info.dmg / maxValue uiMap["unit_result_report_cell.value"]:setText(GFunc.num2Str(info.dmg)) end