From a887f8d4c78ff630d9052826742c725cb106f077 Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Mon, 20 Oct 2025 21:20:31 +0800 Subject: [PATCH] fix bug --- lua/app/ui/battle/battle_base_ui.lua | 2 +- lua/app/ui/fund/cell/fund_chapter_cell.lua | 2 +- lua/app/ui/fund/cell/fund_level_cell.lua | 148 ++++++++++----------- lua/app/ui/fund/fund_chapter_comp.lua | 2 +- lua/app/ui/fund/fund_level_comp.lua | 2 +- 5 files changed, 78 insertions(+), 78 deletions(-) diff --git a/lua/app/ui/battle/battle_base_ui.lua b/lua/app/ui/battle/battle_base_ui.lua index 199f0dd9..7ebb0404 100644 --- a/lua/app/ui/battle/battle_base_ui.lua +++ b/lua/app/ui/battle/battle_base_ui.lua @@ -326,7 +326,7 @@ function BattleBaseUI:initSpeedBtn() params.boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL params.okText = I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_21) params.okFunc = function() - ModuleManager.MonthlyCardManager:showMainUI() + ModuleManager.PrivilegeCardManager:showPrivilegeUI() end GFunc.showMessageBox(params) return diff --git a/lua/app/ui/fund/cell/fund_chapter_cell.lua b/lua/app/ui/fund/cell/fund_chapter_cell.lua index be9e4928..cd3b730e 100755 --- a/lua/app/ui/fund/cell/fund_chapter_cell.lua +++ b/lua/app/ui/fund/cell/fund_chapter_cell.lua @@ -21,7 +21,7 @@ end function FundChapterCell:refresh(id, isLast) -- 刷新进度 - local helf = self:getBaseObject():getSizeDeltaY() / 2 + 10 + local helf = self:getBaseObject():getSizeDeltaY() / 2 if self:getIndex() == 1 then self.progNode:setAnchoredPositionY(-helf / 2) self.progNode:setSizeDeltaY(helf) diff --git a/lua/app/ui/fund/cell/fund_level_cell.lua b/lua/app/ui/fund/cell/fund_level_cell.lua index e7f3e7fb..6df499ee 100755 --- a/lua/app/ui/fund/cell/fund_level_cell.lua +++ b/lua/app/ui/fund/cell/fund_level_cell.lua @@ -1,91 +1,91 @@ local FundLevelCell = class("FundLevelCell", BaseCell) function FundLevelCell:init() - local uiMap = self:getUIMap() - self.progNode = uiMap["fund_level_cell.prog"] - self.imgProg = uiMap["fund_level_cell.prog.img_prog"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER) - self.lvNode = uiMap["fund_level_cell.level"] - self.txLv = uiMap["fund_level_cell.level.tx_lv"] - self.freeRewardCells = {} - for i = 1, 2 do - table.insert(self.freeRewardCells, uiMap["fund_level_cell.rewards_free.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)) - end - self.proRewardCells = {} - for i = 1, 2 do - table.insert(self.proRewardCells, uiMap["fund_level_cell.rewards_pro.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)) - end + local uiMap = self:getUIMap() + self.progNode = uiMap["fund_level_cell.prog"] + self.imgProg = uiMap["fund_level_cell.prog.img_prog"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER) + self.lvNode = uiMap["fund_level_cell.level"] + self.txLv = uiMap["fund_level_cell.level.tx_lv"] + self.freeRewardCells = {} + for i = 1, 2 do + table.insert(self.freeRewardCells, uiMap["fund_level_cell.rewards_free.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)) + end + self.proRewardCells = {} + for i = 1, 2 do + table.insert(self.proRewardCells, uiMap["fund_level_cell.rewards_pro.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)) + end - self.colorLight = BF.Color(0.6235294, 0.3137255, 0.1764706, 1) - self.colorGray = BF.Color(0.3568628, 0.3568628, 0.3568628, 1) + -- self.colorLight = BF.Color(0.6235294, 0.3137255, 0.1764706, 1) + -- self.colorGray = BF.Color(0.3568628, 0.3568628, 0.3568628, 1) end function FundLevelCell:refresh(id, isLast) -- 刷新进度 local helf = self:getBaseObject():getSizeDeltaY() / 2 - if self:getIndex() == 1 then - self.progNode:setAnchoredPositionY(-helf / 2) - self.progNode:setSizeDeltaY(helf) - elseif isLast then - self.progNode:setAnchoredPositionY(helf / 2) - self.progNode:setSizeDeltaY(helf) - else - self.progNode:setAnchoredPositionY(0) - self.progNode:setSizeDeltaY(self:getBaseObject():getSizeDeltaY()) - end - - local needLevel = DataManager.FundLevelData:getNeedLevel(id) - local stage = DataManager.FundLevelData:getStageById(id) - local value = DataManager.PlayerData:getLv() >= needLevel and 1 or 0 + if self:getIndex() == 1 then + self.progNode:setAnchoredPositionY(-helf / 2) + self.progNode:setSizeDeltaY(helf) + elseif isLast then + self.progNode:setAnchoredPositionY(helf / 2) + self.progNode:setSizeDeltaY(helf) + else + self.progNode:setAnchoredPositionY(0) + self.progNode:setSizeDeltaY(self:getBaseObject():getSizeDeltaY()) + end + + local needLevel = DataManager.FundLevelData:getNeedLevel(id) + local stage = DataManager.FundLevelData:getStageById(id) + local value = DataManager.PlayerData:getLv() >= needLevel and 1 or 0 - self.imgProg.value = value - self.txLv:setText(needLevel) - if value == 1 then - self.txLv:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).color = self.colorLight - else - self.txLv:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).color = self.colorGray - end + self.imgProg.value = value + self.txLv:setText(needLevel) + -- if value == 1 then + -- self.txLv:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).color = self.colorLight + -- else + -- self.txLv:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).color = self.colorGray + -- end - local freeRewards = DataManager.FundLevelData:getFreeRewards(id) - local freeReceived = DataManager.FundLevelData:getFreeGot(id) - local canGet = DataManager.FundLevelData:getFreeCanGet(id) - for i, cell in ipairs(self.freeRewardCells) do - if freeRewards and freeRewards[i] then - cell:setActive(true) - cell:refreshByConfig(freeRewards[i], freeReceived, freeReceived) - if canGet then - cell:addClickListener(function() + local freeRewards = DataManager.FundLevelData:getFreeRewards(id) + local freeReceived = DataManager.FundLevelData:getFreeGot(id) + local canGet = DataManager.FundLevelData:getFreeCanGet(id) + for i, cell in ipairs(self.freeRewardCells) do + if freeRewards and freeRewards[i] then + cell:setActive(true) + cell:refreshByConfig(freeRewards[i], freeReceived, freeReceived) + if canGet then + cell:addClickListener(function() ModuleManager.FundLevelManager:getReward(stage) - end) - cell:showFrameAnimation() - else - cell:hideFrameAnimation() - end - else - cell:setActive(false) - end - end + end) + cell:showFrameAnimation() + else + cell:hideFrameAnimation() + end + else + cell:setActive(false) + end + end - local proRewards = DataManager.FundLevelData:getProRewards(id) - local proReceived = DataManager.FundLevelData:getProGot(id) - local locked = not DataManager.FundLevelData:getProBought(stage) - local canGet = DataManager.FundLevelData:getProCanGet(id) - for i, cell in ipairs(self.proRewardCells) do - if proRewards and proRewards[i] then - cell:setActive(true) - cell:refreshByConfig(proRewards[i], proReceived, proReceived) - cell:showLock(locked) - if canGet then - cell:addClickListener(function() + local proRewards = DataManager.FundLevelData:getProRewards(id) + local proReceived = DataManager.FundLevelData:getProGot(id) + local locked = not DataManager.FundLevelData:getProBought(stage) + local canGet = DataManager.FundLevelData:getProCanGet(id) + for i, cell in ipairs(self.proRewardCells) do + if proRewards and proRewards[i] then + cell:setActive(true) + cell:refreshByConfig(proRewards[i], proReceived, proReceived) + cell:showLock(locked) + if canGet then + cell:addClickListener(function() ModuleManager.FundLevelManager:getReward(stage) - end) - cell:showFrameAnimation() - else - cell:hideFrameAnimation() - end - else - cell:setActive(false) - end - end + end) + cell:showFrameAnimation() + else + cell:hideFrameAnimation() + end + else + cell:setActive(false) + end + end end return FundLevelCell \ No newline at end of file diff --git a/lua/app/ui/fund/fund_chapter_comp.lua b/lua/app/ui/fund/fund_chapter_comp.lua index cbd6ecad..1276a444 100755 --- a/lua/app/ui/fund/fund_chapter_comp.lua +++ b/lua/app/ui/fund/fund_chapter_comp.lua @@ -173,7 +173,7 @@ function FundChapterComp:refreshStageTags() if stage then tag:setActive(true) local isSelect = self.curStage == stage - self.tagImgs[i]:setSprite(GConst.ATLAS_PATH.COMMON, isSelect and "common_menu_4" or "common_menu_5") + self.tagImgs[i]:setSprite(GConst.ATLAS_PATH.COMMON, isSelect and "common_menu_3" or "common_menu_4") self.tagImgs[i]:setAnchoredPositionY(isSelect and 5 or 0) self.tagDescs[i]:setText(I18N:getGlobalText(I18N.GlobalConst["FUND_CHAPTER_TAG_DESC_" .. stage])) diff --git a/lua/app/ui/fund/fund_level_comp.lua b/lua/app/ui/fund/fund_level_comp.lua index da4ac077..e5f3f414 100755 --- a/lua/app/ui/fund/fund_level_comp.lua +++ b/lua/app/ui/fund/fund_level_comp.lua @@ -194,7 +194,7 @@ function FundLevelComp:refreshStageTags() if stage then tag:setActive(true) local isSelect = self.curStage == stage - self.tagImgs[i]:setSprite(GConst.ATLAS_PATH.COMMON, isSelect and "common_menu_4" or "common_menu_5") + self.tagImgs[i]:setSprite(GConst.ATLAS_PATH.COMMON, isSelect and "common_menu_3" or "common_menu_4") self.tagImgs[i]:setAnchoredPositionY(isSelect and 5 or 0) self.tagDescs[i]:setText(I18N:getGlobalText(I18N.GlobalConst["FUND_TAG_DESC_" .. stage]))