From f8871a3109927158154c8708f44655d7482849a0 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 5 Jun 2023 16:13:05 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=8A=A0=E4=B8=80=E4=B8=AAGM=E5=BF=AB?= =?UTF-8?q?=E9=80=9F=E6=9F=A5=E7=9C=8B=E6=A3=8B=E7=9B=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/game.lua | 27 +++++++++++++++++++++++++++ lua/app/module/gm/gm_const.lua | 7 +++++++ lua/app/ui/gm/gm_tool_ui.lua | 6 ++++++ 3 files changed, 40 insertions(+) diff --git a/lua/app/game.lua b/lua/app/game.lua index 1a5838ad..a83b2604 100644 --- a/lua/app/game.lua +++ b/lua/app/game.lua @@ -399,6 +399,33 @@ if NOT_PUBLISH then Logger.printTable(map) end end + + if Input.GetKeyDown(KeyCode.RightArrow) and Input.GetKey(KeyCode.LeftControl) then + local configName = ModuleManager.DevToolManager.set_board_info.config + local idx = ModuleManager.DevToolManager.set_board_info.idx or 0 + if not configName then + return + end + local config = ConfigManager:getConfig(configName) + idx = idx + 1 + if not config[idx] then + Logger.logHighlight(configName .. " 没有id idx = " .. idx) + return + end + Logger.logHighlight(configName .. " 当前 idx = " .. idx) + ModuleManager.DevToolManager.set_board_info.idx = idx + + local board = config[idx].board + if not board then + board = config[idx].board_daily_challenge + end + + if ModuleManager.BattleManager:isInBattle() then + local battleController = ModuleManager.BattleManager.battleController + battleController.battleData:refreshBoard(board, battleController:getBlockIcon()) + battleController.battleUI:initGridCell() + end + end end Game._releaseOnApplicationFocus = Game.onApplicationFocus diff --git a/lua/app/module/gm/gm_const.lua b/lua/app/module/gm/gm_const.lua index 9817246d..24aa0bb4 100644 --- a/lua/app/module/gm/gm_const.lua +++ b/lua/app/module/gm/gm_const.lua @@ -111,5 +111,12 @@ args:技能id Example: add_monster_skill 10027]], type = "add_monster_skill" }, + { + title = "设置棋盘遍历信息", + desc = [[设置棋盘遍历信息type:set_board_info +args:棋盘配置表名 起始boardId +Example: set_board_info 10027]], + type = "set_board_info" + }, } return GMConst \ No newline at end of file diff --git a/lua/app/ui/gm/gm_tool_ui.lua b/lua/app/ui/gm/gm_tool_ui.lua index d0e72d68..8859b58a 100644 --- a/lua/app/ui/gm/gm_tool_ui.lua +++ b/lua/app/ui/gm/gm_tool_ui.lua @@ -107,6 +107,12 @@ function GMToolUI:sendMsg(gmCommand) return end self:addMonsterSkill(args.args) + elseif args.args[1] == "set_board_info" then -- 特殊处理 + ModuleManager.DevToolManager.set_board_info = { + config = args.args[2], + idx = tonumber(args.args[3]) or 0 + } + self:closeUI() elseif args.args[1] == "time" then -- 特殊处理 local args1 = {} args1.args = {} From 45ddce3dc37c3ad20c2daa25a6c59213ddbe8fc7 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 5 Jun 2023 16:17:46 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=90=91=E5=B7=A6=E9=81=8D=E5=8E=86?= =?UTF-8?q?=E6=A3=8B=E7=9B=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/game.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lua/app/game.lua b/lua/app/game.lua index a83b2604..c83a320a 100644 --- a/lua/app/game.lua +++ b/lua/app/game.lua @@ -426,6 +426,33 @@ if NOT_PUBLISH then battleController.battleUI:initGridCell() end end + + if Input.GetKeyDown(KeyCode.LeftArrow) and Input.GetKey(KeyCode.LeftControl) then + local configName = ModuleManager.DevToolManager.set_board_info.config + local idx = ModuleManager.DevToolManager.set_board_info.idx or 0 + if not configName then + return + end + local config = ConfigManager:getConfig(configName) + idx = idx - 1 + if not config[idx] then + Logger.logHighlight(configName .. " 没有id idx = " .. idx) + return + end + Logger.logHighlight(configName .. " 当前 idx = " .. idx) + ModuleManager.DevToolManager.set_board_info.idx = idx + + local board = config[idx].board + if not board then + board = config[idx].board_daily_challenge + end + + if ModuleManager.BattleManager:isInBattle() then + local battleController = ModuleManager.BattleManager.battleController + battleController.battleData:refreshBoard(board, battleController:getBlockIcon()) + battleController.battleUI:initGridCell() + end + end end Game._releaseOnApplicationFocus = Game.onApplicationFocus From 9f6fbf2903c49c5dcd7e31c8dc0677b1b5ea8cfc Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 5 Jun 2023 16:20:52 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/game.lua | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/lua/app/game.lua b/lua/app/game.lua index c83a320a..4a659c01 100644 --- a/lua/app/game.lua +++ b/lua/app/game.lua @@ -400,41 +400,18 @@ if NOT_PUBLISH then end end - if Input.GetKeyDown(KeyCode.RightArrow) and Input.GetKey(KeyCode.LeftControl) then + if (Input.GetKeyDown(KeyCode.RightArrow) or Input.GetKeyDown(KeyCode.LeftArrow)) and Input.GetKey(KeyCode.LeftControl) then local configName = ModuleManager.DevToolManager.set_board_info.config local idx = ModuleManager.DevToolManager.set_board_info.idx or 0 if not configName then return end local config = ConfigManager:getConfig(configName) - idx = idx + 1 - if not config[idx] then - Logger.logHighlight(configName .. " 没有id idx = " .. idx) - return + if Input.GetKeyDown(KeyCode.LeftArrow) then + idx = idx - 1 + else + idx = idx + 1 end - Logger.logHighlight(configName .. " 当前 idx = " .. idx) - ModuleManager.DevToolManager.set_board_info.idx = idx - - local board = config[idx].board - if not board then - board = config[idx].board_daily_challenge - end - - if ModuleManager.BattleManager:isInBattle() then - local battleController = ModuleManager.BattleManager.battleController - battleController.battleData:refreshBoard(board, battleController:getBlockIcon()) - battleController.battleUI:initGridCell() - end - end - - if Input.GetKeyDown(KeyCode.LeftArrow) and Input.GetKey(KeyCode.LeftControl) then - local configName = ModuleManager.DevToolManager.set_board_info.config - local idx = ModuleManager.DevToolManager.set_board_info.idx or 0 - if not configName then - return - end - local config = ConfigManager:getConfig(configName) - idx = idx - 1 if not config[idx] then Logger.logHighlight(configName .. " 没有id idx = " .. idx) return From 5216c8ff694dd1da8e80b58da701fcb3816cf486 Mon Sep 17 00:00:00 2001 From: chenxi Date: Mon, 5 Jun 2023 16:23:55 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/bf/unity/uiprefab_object.lua | 7 ++ lua/app/module/maincity/maincity_const.lua | 2 + lua/app/ui/main_city/main_city_ui.lua | 118 ++++++++++++++------- 3 files changed, 87 insertions(+), 40 deletions(-) diff --git a/lua/app/bf/unity/uiprefab_object.lua b/lua/app/bf/unity/uiprefab_object.lua index 83589047..996e5530 100644 --- a/lua/app/bf/unity/uiprefab_object.lua +++ b/lua/app/bf/unity/uiprefab_object.lua @@ -634,6 +634,13 @@ function UIPrefabObject:setClickAnimation(enable) end end +function UIPrefabObject:stopClickAnimation() + local eventListener = self:getComponent(BF_UI_TOUCH_EVENT) + if eventListener then + eventListener:StopTouchAnimation() + end +end + function UIPrefabObject:setTouchEnable(enable) local maskableGraphic = self:getComponent(UI_MASKABLE_GRAPHIC) if maskableGraphic then diff --git a/lua/app/module/maincity/maincity_const.lua b/lua/app/module/maincity/maincity_const.lua index 4e6fc491..1694a16c 100644 --- a/lua/app/module/maincity/maincity_const.lua +++ b/lua/app/module/maincity/maincity_const.lua @@ -1,5 +1,7 @@ local MainCityConst = {} +MainCityConst.SIDE_BAR_MIN_COUNT = 3 + MainCityConst.BOTTOM_PAGE = { MAIN = 1, HERO = 2, diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index 641f1f3e..b520f19c 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -440,20 +440,26 @@ function MainCityUI:refreshLeftBtns() table.insert(self.leftBarList, cell) end end - if #self.leftBarList <= 0 then + local sideBarShowCount = #self.leftBarList + if sideBarShowCount <= 0 then self.leftNode:setAnchoredPositionX(GConst.NOT_VISIBLE_POS) return end self.leftNode:setAnchoredPositionX(0) local y = -SIDE_BAR_BORDER_OFFSET - self.sideBarHeight/2 - if isClose then -- 只显示一个 - local first = self.leftBarList[1] - first:setAnchoredPositionY(y) - first:refresh() - first:setActive(true) - first:setVisible(true) - y = y - self.sideBarHeight - SIDE_BAR_INTERVAL - for i = 2, #self.leftBarList do + if isClose then -- 只显示3个 + local minCount = GConst.MainCityConst.SIDE_BAR_MIN_COUNT + for i = 1, minCount do + local sideBarBtn = self.leftBarList[i] + if i <= sideBarShowCount then + sideBarBtn:setAnchoredPositionY(y) + sideBarBtn:refresh() + sideBarBtn:setActive(true) + sideBarBtn:setVisible(true) + y = y - self.sideBarHeight - SIDE_BAR_INTERVAL + end + end + for i = minCount + 1, sideBarShowCount do self.leftBarList[i]:refresh() self.leftBarList[i]:setActive(true) self.leftBarList[i]:setVisible(false) @@ -467,11 +473,18 @@ function MainCityUI:refreshLeftBtns() y = y - self.sideBarHeight - SIDE_BAR_INTERVAL end end - local arrowHeight = self.leftArrowBtn:getRectHeight() - y = y + self.sideBarHeight/2 - SIDE_BAR_ARROW_INTERVAL - arrowHeight - self.leftSideBar:setSizeDeltaY(-y) - self.leftArrowImg:setLocalScale(1, isClose and -1 or 1, 1) - self.leftArrowBtn:setAnchoredPositionY(self.leftSideBar:fastGetAnchoredPositionY() + y + arrowHeight/2 + SIDE_BAR_BORDER_OFFSET) + if sideBarShowCount <= GConst.MainCityConst.SIDE_BAR_MIN_COUNT then -- 小于3个不显示箭头 + y = y + self.sideBarHeight / 2 + self.leftSideBar:setSizeDeltaY(-y) + self.leftArrowBtn:stopClickAnimation() + self.leftArrowBtn:setVisible(false) + else + local arrowHeight = self.leftArrowBtn:getRectHeight() + y = y + self.sideBarHeight/2 - SIDE_BAR_ARROW_INTERVAL - arrowHeight + self.leftSideBar:setSizeDeltaY(-y) + self.leftArrowImg:setLocalScale(1, isClose and -1 or 1, 1) + self.leftArrowBtn:setAnchoredPositionY(self.leftSideBar:fastGetAnchoredPositionY() + y + arrowHeight/2 + SIDE_BAR_BORDER_OFFSET) + end end function MainCityUI:openOrCloseRightSideBar() @@ -506,6 +519,7 @@ function MainCityUI:refreshRightBtns() table.insert(self.rightBarList, cell) end end + local sideBarShowCount = #self.rightBarList if #self.rightBarList <= 0 then self.rightNode:setAnchoredPositionX(GConst.NOT_VISIBLE_POS) return @@ -513,13 +527,18 @@ function MainCityUI:refreshRightBtns() self.rightNode:setAnchoredPositionX(0) local y = -SIDE_BAR_BORDER_OFFSET - self.sideBarHeight/2 if isClose then -- 只显示一个 - local first = self.rightBarList[1] - first:setAnchoredPositionY(y) - first:refresh() - first:setActive(true) - first:setVisible(true) - y = y - self.sideBarHeight - SIDE_BAR_INTERVAL - for i = 2, #self.rightBarList do + local minCount = GConst.MainCityConst.SIDE_BAR_MIN_COUNT + for i = 1, minCount do + local sideBarBtn = self.rightBarList[i] + if i <= sideBarShowCount then + sideBarBtn:setAnchoredPositionY(y) + sideBarBtn:refresh() + sideBarBtn:setActive(true) + sideBarBtn:setVisible(true) + y = y - self.sideBarHeight - SIDE_BAR_INTERVAL + end + end + for i = minCount + 1, sideBarShowCount do self.rightBarList[i]:refresh() self.rightBarList[i]:setActive(true) self.rightBarList[i]:setVisible(false) @@ -533,11 +552,18 @@ function MainCityUI:refreshRightBtns() y = y - self.sideBarHeight - SIDE_BAR_INTERVAL end end - local arrowHeight = self.rightArrowBtn:getRectHeight() - y = y + self.sideBarHeight / 2 - SIDE_BAR_ARROW_INTERVAL - arrowHeight - self.rightSideBar:setSizeDeltaY(-y) - self.rightArrowImg:setLocalScale(1, isClose and -1 or 1, 1) - self.rightArrowBtn:setAnchoredPositionY(self.rightSideBar:fastGetAnchoredPositionY() + y + arrowHeight/2 + SIDE_BAR_BORDER_OFFSET) + if sideBarShowCount <= GConst.MainCityConst.SIDE_BAR_MIN_COUNT then + y = y + self.sideBarHeight / 2 + self.rightSideBar:setSizeDeltaY(-y) + self.rightArrowBtn:stopClickAnimation() + self.rightArrowBtn:setVisible(false) + else + local arrowHeight = self.rightArrowBtn:getRectHeight() + y = y + self.sideBarHeight / 2 - SIDE_BAR_ARROW_INTERVAL - arrowHeight + self.rightSideBar:setSizeDeltaY(-y) + self.rightArrowImg:setLocalScale(1, isClose and -1 or 1, 1) + self.rightArrowBtn:setAnchoredPositionY(self.rightSideBar:fastGetAnchoredPositionY() + y + arrowHeight/2 + SIDE_BAR_BORDER_OFFSET) + end end function MainCityUI:clearSideBarList(sideBarList) @@ -712,15 +738,21 @@ end function MainCityUI:updateSideBarStatus() if self.leftBarList then - local first = self.leftBarList[1] - if first then - if first:getIsShowRedPoint() then - first:showRedPoint() - else - first:hideRedPoint() + local minCount = GConst.MainCityConst.SIDE_BAR_MIN_COUNT + for i = 1, minCount do + local sideBarBtn = self.leftBarList[i] + if sideBarBtn then + if sideBarBtn:getIsShowRedPoint() then + sideBarBtn:showRedPoint() + else + sideBarBtn:hideRedPoint() + end end + end + local sideBarCount = #self.leftBarList + if sideBarCount > minCount then local count = 0 - for i = 2, #self.leftBarList do + for i = minCount + 1, sideBarCount do if self.leftBarList[i]:getIsShowRedPoint() then self.leftBarList[i]:showRedPoint() count = count + 1 @@ -738,15 +770,21 @@ function MainCityUI:updateSideBarStatus() end end if self.rightBarList then - local first = self.rightBarList[1] - if first then - if first:getIsShowRedPoint() then - first:showRedPoint() - else - first:hideRedPoint() + local minCount = GConst.MainCityConst.SIDE_BAR_MIN_COUNT + for i = 1, minCount do + local sideBarBtn = self.rightBarList[i] + if sideBarBtn then + if sideBarBtn:getIsShowRedPoint() then + sideBarBtn:showRedPoint() + else + sideBarBtn:hideRedPoint() + end end + end + local sideBarCount = #self.rightBarList + if sideBarCount > minCount then local count = 0 - for i = 2, #self.rightBarList do + for i = minCount + 1, sideBarCount do if self.rightBarList[i]:getIsShowRedPoint() then self.rightBarList[i]:showRedPoint() count = count + 1 From 628da8aade1df1c27af79be4db21a7b651cf3b21 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 5 Jun 2023 16:24:06 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E9=9F=B3=E6=95=88=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/component/battle_unit_comp.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 9240e0b8..007c90f6 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -1411,7 +1411,9 @@ function BattleUnitComp:onSkillTakeEffect(skill, isFinalBlock, validEffectIdx) break end end - BattleHelper:playSkillSound(soundHit[soundIndex], 0) + if soundHit[soundIndex] and soundHit[soundIndex] > 0 then + BattleHelper:playSkillSound(soundHit[soundIndex], 0) + end end end end From 30d134ecc878fb3a81156a082ca3a6dce01b921e Mon Sep 17 00:00:00 2001 From: chenxi Date: Mon, 5 Jun 2023 16:25:41 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E7=9A=84=E6=8C=89=E9=92=AE=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/maincity/maincity_const.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/app/module/maincity/maincity_const.lua b/lua/app/module/maincity/maincity_const.lua index 1694a16c..6bf73be7 100644 --- a/lua/app/module/maincity/maincity_const.lua +++ b/lua/app/module/maincity/maincity_const.lua @@ -22,6 +22,7 @@ MainCityConst.MAIN_MODULE = { MainCityConst.LEFT_SIDE_BARS = { "app/ui/main_city/cell/side_bar_idle_cell", + "app/ui/main_city/cell/side_bar_growth_fund_cell", "app/ui/main_city/cell/side_bar_seven_days_cell", -- gm放最后一个 "app/ui/main_city/cell/side_bar_gm_cell" @@ -29,7 +30,6 @@ MainCityConst.LEFT_SIDE_BARS = { MainCityConst.RIGHT_SIDE_BARS = { "app/ui/main_city/cell/side_bar_gold_pig_cell", - "app/ui/main_city/cell/side_bar_growth_fund_cell", "app/ui/main_city/cell/side_bar_first_recharge_cell", "app/ui/main_city/cell/side_bar_beginner_gift_cell", "app/ui/main_city/cell/side_bar_grow_up_gift_1_cell",