From 340ac9a38d7c8aecbc7acdacb609b9fe3c7732e2 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Thu, 29 Jun 2023 14:42:27 +0800 Subject: [PATCH 1/6] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/controller/battle_controller.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index a2651514..9d7cd2cb 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -145,12 +145,12 @@ end -- 怪物攻击力加成 function BattleController:getMonsterAtkAddition() - return BattleConst.DEFAULT_FACTOR + return 0 end -- 怪物血量加成 function BattleController:getMonsterHpAddition() - return BattleConst.DEFAULT_FACTOR + return 0 end -- 需要额外加载的资源 @@ -177,7 +177,7 @@ end function BattleController:initDefUnits(callback) local config = self:getChapterConfig()[self.chapterId] self.battleUI:loadBg(config.scene) - local unitEntity = DataManager.BattleData:addMonster(config.monster[1]) + local unitEntity = DataManager.BattleData:addMonster(config.monster[1], nil, self) local modelId = unitEntity:getModelId() BattleHelper:loadBattleHeroModel(modelId, self.battleUI:getBattleNode(), function(spineObject) local monsterComp = spineObject:addLuaComponent(GConst.BattleConst.TYPEOF_LUA_COMP.BATTLE_MONSTER_COMPONENT) @@ -195,7 +195,7 @@ function BattleController:generateNextMonster() return self:enterNextWave() end local isBoss = self.defTeam:getIsBoss() - local unitEntity = DataManager.BattleData:addMonster(monsterId, true) + local unitEntity = DataManager.BattleData:addMonster(monsterId, true, self) local modelId = unitEntity:getModelId() BattleHelper:loadBattleHeroModel(modelId, self.battleUI:getBattleNode(), function(spineObject) self.defTeam:removeAllUnits() @@ -2655,7 +2655,7 @@ function BattleController:findLinkLine(posId, posIdMap, hadSkill, mainElementTyp end function BattleController:generateMonsterById(monsterId, callback) - local unitEntity = DataManager.BattleData:addMonster(monsterId, true) + local unitEntity = DataManager.BattleData:addMonster(monsterId, true, self) local modelId = unitEntity:getModelId() BattleHelper:loadBattleHeroModel(modelId, self.battleUI:getBattleNode(), function(spineObject) self.defTeam:removeAllUnits() From dc669243e0ae2e9c37c1fdef562edd1191d5f117 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 3 Jul 2023 10:06:09 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=8B=B1=E9=9B=84=E7=BA=A2=E7=82=B9?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/userdata/hero/hero_data.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/app/userdata/hero/hero_data.lua b/lua/app/userdata/hero/hero_data.lua index e3d91c24..172f838a 100644 --- a/lua/app/userdata/hero/hero_data.lua +++ b/lua/app/userdata/hero/hero_data.lua @@ -157,8 +157,10 @@ function HeroData:getRp() end for id, entity in pairs(self.heroes) do - if entity:canLvUp() and not heroMap[id] then - return true + if entity:canLvUp() then + if heroMap[id] or not entity:isActived() then + return true + end end end From 1cd1d31d980e44ae86a623bfe96d3ce874a6ef93 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 3 Jul 2023 11:33:17 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E8=AF=84=E4=BB=B7=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../localization_global_const.lua | 2 + lua/app/config/strings/cn/global.lua | 2 + lua/app/module/chapter/chapter_manager.lua | 9 ++ lua/app/ui/game_setting/rate_ui.lua | 137 ++++++++++++++++++ lua/app/ui/game_setting/rate_ui.lua.meta | 10 ++ 5 files changed, 160 insertions(+) create mode 100644 lua/app/ui/game_setting/rate_ui.lua create mode 100644 lua/app/ui/game_setting/rate_ui.lua.meta diff --git a/lua/app/config/localization/localization_global_const.lua b/lua/app/config/localization/localization_global_const.lua index 72321066..ac631410 100644 --- a/lua/app/config/localization/localization_global_const.lua +++ b/lua/app/config/localization/localization_global_const.lua @@ -1,5 +1,7 @@ local LocalizationGlobalConst = { + ["RATE_DESC_1"] = "RATE_DESC_1", + ["RATE_DESC_2"] = "RATE_DESC_2", MAIN_BTN_1 = "MAIN_BTN_1", QLT_DESC_1 = "QLT_DESC_1", QLT_DESC_2 = "QLT_DESC_2", diff --git a/lua/app/config/strings/cn/global.lua b/lua/app/config/strings/cn/global.lua index a592ca08..c349dc2d 100644 --- a/lua/app/config/strings/cn/global.lua +++ b/lua/app/config/strings/cn/global.lua @@ -258,6 +258,8 @@ local localization_global = ["NOTICE_TITLE"] = "公告", ["MAINTENANCE_NOTICE_DEFAULT"] = "服务器正在加紧链接中,目前元素较多,请稍后重试进入。", ["CANNOT_RENAME_DESC_5"] = "与当前昵称一致,无需更改", + ["RATE_DESC_1"] = "您喜欢我们的游戏吗?", + ["RATE_DESC_2"] = "稍后再说", } return localization_global \ No newline at end of file diff --git a/lua/app/module/chapter/chapter_manager.lua b/lua/app/module/chapter/chapter_manager.lua index 0010b04d..94822ec6 100644 --- a/lua/app/module/chapter/chapter_manager.lua +++ b/lua/app/module/chapter/chapter_manager.lua @@ -125,10 +125,19 @@ function ChapterManager:endFightFinish(result) DataManager.HeroData:checkIfCanShowHeroUnlock(maxChapter) -- 章节通关 检查是否要弹出功能解锁界面 DataManager.PlayerData:checkIfCanShowModuleUnlock(maxChapter) + -- 评价弹窗 + self:tryShowEvaluationPopup(maxChapter) end ModuleManager.TaskManager:addFightTaskProgress(reqData.task_stat) end end +function ChapterManager:tryShowEvaluationPopup(chapter) + if chapter ~= 2 then + return + end + UIManager:showUI("app/ui/game_setting/rate_ui") +end + return ChapterManager \ No newline at end of file diff --git a/lua/app/ui/game_setting/rate_ui.lua b/lua/app/ui/game_setting/rate_ui.lua new file mode 100644 index 00000000..0b16934c --- /dev/null +++ b/lua/app/ui/game_setting/rate_ui.lua @@ -0,0 +1,137 @@ +local RateUI = class("RateUI", BaseUI) + +local COLOR = BF.Color(1, 1, 1, 1) + +local BTN_ICON = { + "common_btn_blue_1", + "common_btn_grey_1" +} + +function RateUI:isFullScreen() + return false +end + +function RateUI:showCommonBG() + return false +end + +function RateUI:getPrefabPath() + return "assets/prefabs/ui/setting/rate_ui.prefab" +end + +function RateUI:ctor() + self.curStar = 0 +end + +function RateUI:onLoadRootComplete() + self:_display() + self:_addListeners() +end + +function RateUI:_display() + local uiMap = self.root:genAllChildren() + + uiMap["rate_ui.bg.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.RATE_DESC_1)) + uiMap["rate_ui.later_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.RATE_DESC_2)) + + if not self.stars then + self.stars = {} + for i = 1, 5 do + self.stars[i] = { + touchNode = uiMap["rate_ui.bg.bg_" .. i], + star = uiMap["rate_ui.bg.bg_" .. i .. ".star"] + } + self.stars[i].star:setVisible(true) + end + end + + self:onClickStar(0) +end + +function RateUI:_addListeners() + local uiMap = self.root:genAllChildren() + + uiMap["rate_ui.bg.bg_1"]:addClickListener(function() + self:onClickStar(1) + end) + + uiMap["rate_ui.bg.bg_2"]:addClickListener(function() + self:onClickStar(2) + end) + + uiMap["rate_ui.bg.bg_3"]:addClickListener(function() + self:onClickStar(3) + end) + + uiMap["rate_ui.bg.bg_4"]:addClickListener(function() + self:onClickStar(4) + end) + + uiMap["rate_ui.bg.bg_5"]:addClickListener(function() + self:onClickStar(5) + end) + + uiMap["rate_ui.bg.btn"]:addClickListener(function() + if self.curStar <= 0 then + return + end + + -- BIReport:postRateClose(self.curStar) + self:closeUI() + + if self.curStar > 3 then + local url = "https://play.google.com/store/apps/details?id=com.combo.heroes.puzzle.rpg" + if Platform:isIosPlatform() then + url = "https://itunes.apple.com/app/6450101181" + end + GFunc.openUrl(url) + end + end) + + uiMap["rate_ui.later_tx"]:addClickListener(function() + self:closeUI() + end) + -- BIReport:postRateOpen() +end + +function RateUI:onClickStar(star) + self.curStar = star + for index, starInfo in ipairs(self.stars) do + starInfo.star:setVisible(index <= star) + end + + local uiMap = self.root:genAllChildren() + local icon = BTN_ICON[1] + + local btnTx = uiMap["rate_ui.bg.btn.ok_tx"] + local btnTxGray = uiMap["rate_ui.bg.btn.ok_tx_gray"] + if self.curStar <= 0 then + icon = BTN_ICON[2] + btnTx:setText(GConst.EMPTY_STRING) + btnTxGray:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK)) + else + btnTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK)) + btnTxGray:setText(GConst.EMPTY_STRING) + end + local btn = uiMap["rate_ui.bg.btn"] + btn:setSprite(GConst.ATLAS_PATH.COMMON, icon) + btn:setTouchEnable(self.curStar > 0) + + if self.starSeq then + self.starSeq:Kill() + self.starSeq = nil + end + + self.stars[1].star:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE).color = COLOR + if self.curStar > 0 then + return + else + self.starSeq = self.root:createBindTweenSequence() + self.stars[1].star:setVisible(true) + self.starSeq:Append(self.stars[1].star:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):DOFade(0, 1)) + self.starSeq:Append(self.stars[1].star:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):DOFade(1, 1)) + self.starSeq:SetLoops(-1) + end +end + +return RateUI \ No newline at end of file diff --git a/lua/app/ui/game_setting/rate_ui.lua.meta b/lua/app/ui/game_setting/rate_ui.lua.meta new file mode 100644 index 00000000..71657e8e --- /dev/null +++ b/lua/app/ui/game_setting/rate_ui.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 5559edab930e7aa479e17c2ed272a89c +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} From ecddb99390d8ba18339d2061f63c54ba98be036c Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 3 Jul 2023 14:24:57 +0800 Subject: [PATCH 4/6] =?UTF-8?q?google=E6=94=AF=E4=BB=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/common/sdk_pay_google_manager.lua | 90 ++++++++++++----------- 1 file changed, 48 insertions(+), 42 deletions(-) diff --git a/lua/app/common/sdk_pay_google_manager.lua b/lua/app/common/sdk_pay_google_manager.lua index 7ba33046..14c6114d 100644 --- a/lua/app/common/sdk_pay_google_manager.lua +++ b/lua/app/common/sdk_pay_google_manager.lua @@ -66,6 +66,7 @@ function SDKPayGoogleManager:queryProducts(callback) if #subsList > 0 then self:queryProductInfo(PAY_TYPE_SUBS, json.encode(subsList), function(code, msg) if code == 0 then + self.queryProductsOver = true if msg and msg ~= "" then -- 更新products local jData = json.decode(msg) if jData and #jData > 0 then @@ -80,6 +81,7 @@ function SDKPayGoogleManager:queryProducts(callback) end end) else + self.queryProductsOver = true if callback then callback() end @@ -262,51 +264,55 @@ end -- 检查是否可以支付 function SDKPayGoogleManager:checkPay(productId, callback) if self:_getIsGoogleStoreConnected() then -- google商店是否初始化 - self:doUncompleteOrder(function(code) -- 先处理未完成的订单 - if code == 0 then - callback(0) - elseif code == 1 then -- 指定的productId存在支付状态中的订单 - local params = { - content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23), - boxType = GConst.MESSAGE_BOX_TYPE.MB_OK, - okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK), - } - GFunc.showMessageBox(params) - elseif code == 2 then -- 指定的productId存在未完成的订单消耗失败的情况 - local params = { - content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23), - boxType = GConst.MESSAGE_BOX_TYPE.MB_OK, - okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK), - } - GFunc.showMessageBox(params) - else -- 存在未完成的订单消耗失败的情况,但是因为不是当前productId,所以允许继续支付 - callback(0) - end - end, productId) + self:queryProducts(function() + self:doUncompleteOrder(function(code) -- 先处理未完成的订单 + if code == 0 then + callback(0) + elseif code == 1 then -- 指定的productId存在支付状态中的订单 + local params = { + content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23), + boxType = GConst.MESSAGE_BOX_TYPE.MB_OK, + okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK), + } + GFunc.showMessageBox(params) + elseif code == 2 then -- 指定的productId存在未完成的订单消耗失败的情况 + local params = { + content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23), + boxType = GConst.MESSAGE_BOX_TYPE.MB_OK, + okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK), + } + GFunc.showMessageBox(params) + else -- 存在未完成的订单消耗失败的情况,但是因为不是当前productId,所以允许继续支付 + callback(0) + end + end, productId) + end) else self:connectGoogleStore(function(code) if code == 0 then - self:doUncompleteOrder(function(consumeSucc) - if code == 0 then - callback(0) - elseif code == 1 then -- 指定的productId存在支付状态中的订单 - local params = { - content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23), - boxType = GConst.MESSAGE_BOX_TYPE.MB_OK, - okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK), - } - GFunc.showMessageBox(params) - elseif code == 2 then -- 指定的productId存在未完成的订单消耗失败的情况 - local params = { - content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23), - boxType = GConst.MESSAGE_BOX_TYPE.MB_OK, - okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK), - } - GFunc.showMessageBox(params) - else -- 存在未完成的订单消耗失败的情况,但是因为不是当前productId,所以允许继续支付 - callback(0) - end - end, productId) + self:queryProducts(function() + self:doUncompleteOrder(function(consumeSucc) + if code == 0 then + callback(0) + elseif code == 1 then -- 指定的productId存在支付状态中的订单 + local params = { + content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23), + boxType = GConst.MESSAGE_BOX_TYPE.MB_OK, + okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK), + } + GFunc.showMessageBox(params) + elseif code == 2 then -- 指定的productId存在未完成的订单消耗失败的情况 + local params = { + content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23), + boxType = GConst.MESSAGE_BOX_TYPE.MB_OK, + okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK), + } + GFunc.showMessageBox(params) + else -- 存在未完成的订单消耗失败的情况,但是因为不是当前productId,所以允许继续支付 + callback(0) + end + end, productId) + end) else local params = { content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_22), From f228e845855aeaa8651776a4f47c369e91e1492d Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 3 Jul 2023 15:55:05 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=AF=84=E4=BB=B7=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/common/bi_report.lua | 21 +++++++++++++++++++++ lua/app/ui/game_setting/rate_ui.lua | 15 +++++++++++---- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index 3c71f1a9..e6f697e1 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -196,6 +196,11 @@ BIReport.DIALY_CHALLENGE_OPT_TYPE = { TASK_STATE = "TaskState", } +BIReport.MISCELLANEOUS_OPT_TYPE = { + EVALUATE_OPEN = "EvaluateOpen", + EVALUATE_CLOSE = "EvaluateClose", +} + -- b6 local EVENT_NAME_EXIT = "client_exit" local EVENT_NAME_FIGHT = "client_fight" @@ -222,6 +227,7 @@ local EVENT_NAME_BOUNTY_OPT = "client_bounty_opt" -- 战令事件 local EVENT_NAME_NETWORK_OPT = "client_network_opt" -- 网络操作 local EVENT_NAME_APPLOVIN_AD_REVENUE = "client_applovin_ad_revenue" -- applovin广告收入 local EVENT_NAME_DAILY_CHALLENGE_OPT = "client_daily_challenge_opt" +local EVENT_NAME_MISCELLANEOUS_OPT = "event_name_miscellaneous_opt" -- 一些杂项 function BIReport:setIsNewPlayer(isNewPlayer) self.isNewPlayer = isNewPlayer @@ -1017,4 +1023,19 @@ function BIReport:postPbDecodefailed(pbName, reqData) self:report(EVENT_NAME_NETWORK_OPT, args) end +function BIReport:postRateClose(rateStar) + local args = { + event_type = BIReport.MISCELLANEOUS_OPT_TYPE.EVALUATE_CLOSE, + rate_star = rateStar, + } + self:report(EVENT_NAME_MISCELLANEOUS_OPT, args) +end + +function BIReport:postRateOpen() + local args = { + event_type = BIReport.MISCELLANEOUS_OPT_TYPE.EVALUATE_OPEN, + } + self:report(EVENT_NAME_MISCELLANEOUS_OPT, args) +end + return BIReport \ No newline at end of file diff --git a/lua/app/ui/game_setting/rate_ui.lua b/lua/app/ui/game_setting/rate_ui.lua index 0b16934c..a11baebc 100644 --- a/lua/app/ui/game_setting/rate_ui.lua +++ b/lua/app/ui/game_setting/rate_ui.lua @@ -3,8 +3,8 @@ local RateUI = class("RateUI", BaseUI) local COLOR = BF.Color(1, 1, 1, 1) local BTN_ICON = { - "common_btn_blue_1", - "common_btn_grey_1" + "common_btn_green_2", + "common_btn_grey_2" } function RateUI:isFullScreen() @@ -23,6 +23,13 @@ function RateUI:ctor() self.curStar = 0 end +function RateUI:onClose() + if self.starSeq then + self.starSeq:Kill() + self.starSeq = nil + end +end + function RateUI:onLoadRootComplete() self:_display() self:_addListeners() @@ -76,7 +83,7 @@ function RateUI:_addListeners() return end - -- BIReport:postRateClose(self.curStar) + BIReport:postRateClose(self.curStar) self:closeUI() if self.curStar > 3 then @@ -91,7 +98,7 @@ function RateUI:_addListeners() uiMap["rate_ui.later_tx"]:addClickListener(function() self:closeUI() end) - -- BIReport:postRateOpen() + BIReport:postRateOpen() end function RateUI:onClickStar(star) From b445b12dffb1c018a4c4063aea9f3733c8601d09 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Tue, 4 Jul 2023 10:41:10 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=AE=A2=E6=9C=8D=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=BA=A2=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/common/data_manager.lua | 3 + .../game_setting/game_setting_manager.lua | 10 ++ lua/app/proto/proto_msg_type.lua | 93 +++++++++++++++++++ lua/app/ui/game_setting/game_setting_ui.lua | 13 +++ .../ui/game_setting/select_other_btn_ui.lua | 10 +- lua/app/ui/main_city/main_city_ui.lua | 10 +- .../userdata/game_setting/ai_helper_data.lua | 52 +++++++++++ .../game_setting/ai_helper_data.lua.meta | 10 ++ 8 files changed, 198 insertions(+), 3 deletions(-) create mode 100644 lua/app/userdata/game_setting/ai_helper_data.lua create mode 100644 lua/app/userdata/game_setting/ai_helper_data.lua.meta diff --git a/lua/app/common/data_manager.lua b/lua/app/common/data_manager.lua index 51f82c91..6eb6bc98 100644 --- a/lua/app/common/data_manager.lua +++ b/lua/app/common/data_manager.lua @@ -26,6 +26,7 @@ function DataManager:init() self:initManager("SevenDayData", "app/userdata/activity/seven_day/seven_day_data") self:initManager("ShopData", "app/userdata/shop/shop_data") self:initManager("SummonData", "app/userdata/summon/summon_data") + self:initManager("AIHelperData", "app/userdata/game_setting/ai_helper_data") end function DataManager:initManager(name, path) @@ -102,6 +103,7 @@ function DataManager:clear() self.SummonData:clear() -- 任务数据最后清理 self.TaskData:clear() + self.AIHelperData:clear() ModuleManager.TaskManager:clear() self:clearTryOpenFunc() end @@ -143,6 +145,7 @@ function DataManager:initWithServerData(data) -- 商店礼包都初始化完了后检查一下每日红点 self.ShopData:checkShopDiscountRedPoint() self.SummonData:init(data.summon, true) + self.AIHelperData:init(nil, true) -- 成长基金要在ShopData和PlayerDataBagData还有之后初始化,依赖这些数据 if data.fund then self.GrowthFundData:init(data.fund.funds) diff --git a/lua/app/module/game_setting/game_setting_manager.lua b/lua/app/module/game_setting/game_setting_manager.lua index 0a496aa9..57d96844 100644 --- a/lua/app/module/game_setting/game_setting_manager.lua +++ b/lua/app/module/game_setting/game_setting_manager.lua @@ -82,4 +82,14 @@ function GameSettingManager:showSupport(objectId) GFunc.openUrl(CS.System.Uri(url .. language .. userId .. tempStr .. customData).AbsoluteUri) end +function GameSettingManager:reqAiHelper() + self:sendMessage(ProtoMsgType.FromMsgEnum.AIHelpUnreadReq, {}, {}, self.rspAiHelper) +end + +function GameSettingManager:rspAiHelper(result) + if result.error_code == GConst.ERROR_STR.SUCCESS then + DataManager.AIHelperData:init(result) + end +end + return GameSettingManager \ No newline at end of file diff --git a/lua/app/proto/proto_msg_type.lua b/lua/app/proto/proto_msg_type.lua index 3306c8f7..301c5305 100644 --- a/lua/app/proto/proto_msg_type.lua +++ b/lua/app/proto/proto_msg_type.lua @@ -9,6 +9,8 @@ local ProtoMsgType = { [147149505] = "EnergyByADRsp", [236190053] = "ChapterShardsChallengeStartReq", [236191886] = "ChapterShardsChallengeStartRsp", + [252740891] = "PVPOverCDReq", + [252742724] = "PVPOverCDRsp", [295348381] = "ChangeAvatarReq", [295350214] = "ChangeAvatarRsp", [317272657] = "IdleQuickReq", @@ -27,10 +29,16 @@ local ProtoMsgType = { [613795629] = "WatchADRsp", [737107384] = "BuyMallIdleReq", [737109217] = "BuyMallIdleRsp", + [822916593] = "MatchReq", + [822918426] = "MatchRsp", [834139466] = "ChapterGoldChallengeStartReq", [834141299] = "ChapterGoldChallengeStartRsp", + [904222760] = "ArenaBountyLevelUnlockReq", + [904224593] = "ArenaBountyLevelUnlockRsp", [1008447203] = "DeleteReq", [1008449036] = "DeleteRsp", + [1067411524] = "BuyTicketReq", + [1067413357] = "BuyTicketRsp", [1068769299] = "ReconnectReq", [1068771132] = "ReconnectRsp", [1070841461] = "LoginReq", @@ -56,6 +64,8 @@ local ProtoMsgType = { [1690299770] = "SummonRsp", [1746317288] = "IdleInfoReq", [1746319121] = "IdleInfoRsp", + [1751460231] = "PVPHeroesArrayReq", + [1751462064] = "PVPHeroesArrayRsp", [1901321540] = "PipedReq", [2060508030] = "ChangeAvatarFrameReq", [2060509863] = "ChangeAvatarFrameRsp", @@ -69,23 +79,39 @@ local ProtoMsgType = { [2285873970] = "ChapterBoxRewardRsp", [2429586383] = "MailCycleReq", [2429588216] = "MailCycleRsp", + [2494225153] = "PVPSettlementADRewardReq", + [2494226986] = "PVPSettlementADRewardRsp", [2494731810] = "TriggerGoldGiftReq", [2494733643] = "TriggerGoldGiftRsp", + [2514397758] = "PVPInfoReq", + [2514399591] = "PVPInfoRsp", [2515553923] = "BuyMallDailyReq", [2515555756] = "BuyMallDailyRsp", + [2524879713] = "PVPRecordHistoryReq", + [2524881546] = "PVPRecordHistoryRsp", [2553351971] = "ChapterDailyChallengeStartReq", [2553353804] = "ChapterDailyChallengeStartRsp", [2581180989] = "MailListReq", [2581182822] = "MailListRsp", [2620369240] = "SevenDayRewardReq", [2620371073] = "SevenDayRewardRsp", + [2708281176] = "PVPChallengeSettlementReq", + [2708283009] = "PVPChallengeSettlementRsp", [2731281392] = "MailExtractReq", [2731283225] = "MailExtractRsp", [2849800229] = "MailReadReq", [2849802062] = "MailReadRsp", + [2909093054] = "AIHelpUnreadReq", + [2909094887] = "AIHelpUnreadRsp", [3003864530] = "ActTriggerGiftNtf", + [3013273736] = "PVPRankHeroesReq", + [3013275569] = "PVPRankHeroesRsp", + [3024278414] = "PVPSeasonRewardReq", + [3024280247] = "PVPSeasonRewardRsp", [3038151923] = "TaskDailyRefreshReq", [3038153756] = "TaskDailyRefreshRsp", + [3058879524] = "PVPRankReq", + [3058881357] = "PVPRankRsp", [3062745642] = "FundAwardReq", [3062747475] = "FundAwardRsp", [3087688987] = "IdleRewardReq", @@ -94,6 +120,7 @@ local ProtoMsgType = { [3137377372] = "ActPayReq", [3137379205] = "ActPayRsp", [3190730044] = "KickOutNtf", + [3197501935] = "ArenaBountyBoughtNtf", [3224230499] = "SevenDayTaskRewardReq", [3224232332] = "SevenDayTaskRewardRsp", [3309820798] = "HeroPutOnReq", @@ -114,6 +141,8 @@ local ProtoMsgType = { [3597634953] = "BattleSkillRefreshRsp", [3607879254] = "AuthReq", [3607881087] = "AuthRsp", + [3613497485] = "ArenaBountyRewardReq", + [3613499318] = "ArenaBountyRewardRsp", [3624439233] = "NewMailNtf", [3663247602] = "MallDailyResetNtf", [3663314292] = "MallDailyResetReq", @@ -132,6 +161,8 @@ local ProtoMsgType = { [4106157842] = "BountyLevelUnlockRsp", [4133057746] = "ChapterGoldChallengeFarmReq", [4133059579] = "ChapterGoldChallengeFarmRsp", + [4152754481] = "PVPChallengeStartReq", + [4152756314] = "PVPChallengeStartRsp", [4256333947] = "ExistReq", [4256335780] = "ExistRsp", }, @@ -145,6 +176,8 @@ local ProtoMsgType = { EnergyByADRsp = 147149505, ChapterShardsChallengeStartReq = 236190053, ChapterShardsChallengeStartRsp = 236191886, + PVPOverCDReq = 252740891, + PVPOverCDRsp = 252742724, ChangeAvatarReq = 295348381, ChangeAvatarRsp = 295350214, IdleQuickReq = 317272657, @@ -163,10 +196,16 @@ local ProtoMsgType = { WatchADRsp = 613795629, BuyMallIdleReq = 737107384, BuyMallIdleRsp = 737109217, + MatchReq = 822916593, + MatchRsp = 822918426, ChapterGoldChallengeStartReq = 834139466, ChapterGoldChallengeStartRsp = 834141299, + ArenaBountyLevelUnlockReq = 904222760, + ArenaBountyLevelUnlockRsp = 904224593, DeleteReq = 1008447203, DeleteRsp = 1008449036, + BuyTicketReq = 1067411524, + BuyTicketRsp = 1067413357, ReconnectReq = 1068769299, ReconnectRsp = 1068771132, LoginReq = 1070841461, @@ -192,6 +231,8 @@ local ProtoMsgType = { SummonRsp = 1690299770, IdleInfoReq = 1746317288, IdleInfoRsp = 1746319121, + PVPHeroesArrayReq = 1751460231, + PVPHeroesArrayRsp = 1751462064, PipedReq = 1901321540, ChangeAvatarFrameReq = 2060508030, ChangeAvatarFrameRsp = 2060509863, @@ -205,23 +246,39 @@ local ProtoMsgType = { ChapterBoxRewardRsp = 2285873970, MailCycleReq = 2429586383, MailCycleRsp = 2429588216, + PVPSettlementADRewardReq = 2494225153, + PVPSettlementADRewardRsp = 2494226986, TriggerGoldGiftReq = 2494731810, TriggerGoldGiftRsp = 2494733643, + PVPInfoReq = 2514397758, + PVPInfoRsp = 2514399591, BuyMallDailyReq = 2515553923, BuyMallDailyRsp = 2515555756, + PVPRecordHistoryReq = 2524879713, + PVPRecordHistoryRsp = 2524881546, ChapterDailyChallengeStartReq = 2553351971, ChapterDailyChallengeStartRsp = 2553353804, MailListReq = 2581180989, MailListRsp = 2581182822, SevenDayRewardReq = 2620369240, SevenDayRewardRsp = 2620371073, + PVPChallengeSettlementReq = 2708281176, + PVPChallengeSettlementRsp = 2708283009, MailExtractReq = 2731281392, MailExtractRsp = 2731283225, MailReadReq = 2849800229, MailReadRsp = 2849802062, + AIHelpUnreadReq = 2909093054, + AIHelpUnreadRsp = 2909094887, ActTriggerGiftNtf = 3003864530, + PVPRankHeroesReq = 3013273736, + PVPRankHeroesRsp = 3013275569, + PVPSeasonRewardReq = 3024278414, + PVPSeasonRewardRsp = 3024280247, TaskDailyRefreshReq = 3038151923, TaskDailyRefreshRsp = 3038153756, + PVPRankReq = 3058879524, + PVPRankRsp = 3058881357, FundAwardReq = 3062745642, FundAwardRsp = 3062747475, IdleRewardReq = 3087688987, @@ -230,6 +287,7 @@ local ProtoMsgType = { ActPayReq = 3137377372, ActPayRsp = 3137379205, KickOutNtf = 3190730044, + ArenaBountyBoughtNtf = 3197501935, SevenDayTaskRewardReq = 3224230499, SevenDayTaskRewardRsp = 3224232332, HeroPutOnReq = 3309820798, @@ -250,6 +308,8 @@ local ProtoMsgType = { BattleSkillRefreshRsp = 3597634953, AuthReq = 3607879254, AuthRsp = 3607881087, + ArenaBountyRewardReq = 3613497485, + ArenaBountyRewardRsp = 3613499318, NewMailNtf = 3624439233, MallDailyResetNtf = 3663247602, MallDailyResetReq = 3663314292, @@ -268,6 +328,8 @@ local ProtoMsgType = { BountyLevelUnlockRsp = 4106157842, ChapterGoldChallengeFarmReq = 4133057746, ChapterGoldChallengeFarmRsp = 4133059579, + PVPChallengeStartReq = 4152754481, + PVPChallengeStartRsp = 4152756314, ExistReq = 4256333947, ExistRsp = 4256335780, }, @@ -281,6 +343,8 @@ local ProtoMsgType = { EnergyByADRsp = "EnergyByADRsp", ChapterShardsChallengeStartReq = "ChapterShardsChallengeStartReq", ChapterShardsChallengeStartRsp = "ChapterShardsChallengeStartRsp", + PVPOverCDReq = "PVPOverCDReq", + PVPOverCDRsp = "PVPOverCDRsp", ChangeAvatarReq = "ChangeAvatarReq", ChangeAvatarRsp = "ChangeAvatarRsp", IdleQuickReq = "IdleQuickReq", @@ -299,10 +363,16 @@ local ProtoMsgType = { WatchADRsp = "WatchADRsp", BuyMallIdleReq = "BuyMallIdleReq", BuyMallIdleRsp = "BuyMallIdleRsp", + MatchReq = "MatchReq", + MatchRsp = "MatchRsp", ChapterGoldChallengeStartReq = "ChapterGoldChallengeStartReq", ChapterGoldChallengeStartRsp = "ChapterGoldChallengeStartRsp", + ArenaBountyLevelUnlockReq = "ArenaBountyLevelUnlockReq", + ArenaBountyLevelUnlockRsp = "ArenaBountyLevelUnlockRsp", DeleteReq = "DeleteReq", DeleteRsp = "DeleteRsp", + BuyTicketReq = "BuyTicketReq", + BuyTicketRsp = "BuyTicketRsp", ReconnectReq = "ReconnectReq", ReconnectRsp = "ReconnectRsp", LoginReq = "LoginReq", @@ -328,6 +398,8 @@ local ProtoMsgType = { SummonRsp = "SummonRsp", IdleInfoReq = "IdleInfoReq", IdleInfoRsp = "IdleInfoRsp", + PVPHeroesArrayReq = "PVPHeroesArrayReq", + PVPHeroesArrayRsp = "PVPHeroesArrayRsp", PipedReq = "PipedReq", ChangeAvatarFrameReq = "ChangeAvatarFrameReq", ChangeAvatarFrameRsp = "ChangeAvatarFrameRsp", @@ -341,23 +413,39 @@ local ProtoMsgType = { ChapterBoxRewardRsp = "ChapterBoxRewardRsp", MailCycleReq = "MailCycleReq", MailCycleRsp = "MailCycleRsp", + PVPSettlementADRewardReq = "PVPSettlementADRewardReq", + PVPSettlementADRewardRsp = "PVPSettlementADRewardRsp", TriggerGoldGiftReq = "TriggerGoldGiftReq", TriggerGoldGiftRsp = "TriggerGoldGiftRsp", + PVPInfoReq = "PVPInfoReq", + PVPInfoRsp = "PVPInfoRsp", BuyMallDailyReq = "BuyMallDailyReq", BuyMallDailyRsp = "BuyMallDailyRsp", + PVPRecordHistoryReq = "PVPRecordHistoryReq", + PVPRecordHistoryRsp = "PVPRecordHistoryRsp", ChapterDailyChallengeStartReq = "ChapterDailyChallengeStartReq", ChapterDailyChallengeStartRsp = "ChapterDailyChallengeStartRsp", MailListReq = "MailListReq", MailListRsp = "MailListRsp", SevenDayRewardReq = "SevenDayRewardReq", SevenDayRewardRsp = "SevenDayRewardRsp", + PVPChallengeSettlementReq = "PVPChallengeSettlementReq", + PVPChallengeSettlementRsp = "PVPChallengeSettlementRsp", MailExtractReq = "MailExtractReq", MailExtractRsp = "MailExtractRsp", MailReadReq = "MailReadReq", MailReadRsp = "MailReadRsp", + AIHelpUnreadReq = "AIHelpUnreadReq", + AIHelpUnreadRsp = "AIHelpUnreadRsp", ActTriggerGiftNtf = "ActTriggerGiftNtf", + PVPRankHeroesReq = "PVPRankHeroesReq", + PVPRankHeroesRsp = "PVPRankHeroesRsp", + PVPSeasonRewardReq = "PVPSeasonRewardReq", + PVPSeasonRewardRsp = "PVPSeasonRewardRsp", TaskDailyRefreshReq = "TaskDailyRefreshReq", TaskDailyRefreshRsp = "TaskDailyRefreshRsp", + PVPRankReq = "PVPRankReq", + PVPRankRsp = "PVPRankRsp", FundAwardReq = "FundAwardReq", FundAwardRsp = "FundAwardRsp", IdleRewardReq = "IdleRewardReq", @@ -366,6 +454,7 @@ local ProtoMsgType = { ActPayReq = "ActPayReq", ActPayRsp = "ActPayRsp", KickOutNtf = "KickOutNtf", + ArenaBountyBoughtNtf = "ArenaBountyBoughtNtf", SevenDayTaskRewardReq = "SevenDayTaskRewardReq", SevenDayTaskRewardRsp = "SevenDayTaskRewardRsp", HeroPutOnReq = "HeroPutOnReq", @@ -386,6 +475,8 @@ local ProtoMsgType = { BattleSkillRefreshRsp = "BattleSkillRefreshRsp", AuthReq = "AuthReq", AuthRsp = "AuthRsp", + ArenaBountyRewardReq = "ArenaBountyRewardReq", + ArenaBountyRewardRsp = "ArenaBountyRewardRsp", NewMailNtf = "NewMailNtf", MallDailyResetNtf = "MallDailyResetNtf", MallDailyResetReq = "MallDailyResetReq", @@ -404,6 +495,8 @@ local ProtoMsgType = { BountyLevelUnlockRsp = "BountyLevelUnlockRsp", ChapterGoldChallengeFarmReq = "ChapterGoldChallengeFarmReq", ChapterGoldChallengeFarmRsp = "ChapterGoldChallengeFarmRsp", + PVPChallengeStartReq = "PVPChallengeStartReq", + PVPChallengeStartRsp = "PVPChallengeStartRsp", ExistReq = "ExistReq", ExistRsp = "ExistRsp", }, diff --git a/lua/app/ui/game_setting/game_setting_ui.lua b/lua/app/ui/game_setting/game_setting_ui.lua index 148f1e05..4dcdbc26 100644 --- a/lua/app/ui/game_setting/game_setting_ui.lua +++ b/lua/app/ui/game_setting/game_setting_ui.lua @@ -18,6 +18,7 @@ function GameSettingUI:onLoadRootComplete() self.uiMap = self.root:genAllChildren() self:_display() self:_addListeners() + self:_bind() self:addEventListener(EventManager.CUSTOM_EVENT.BIND_ACCOUNT_SUCCESS, function() self:refreshAccountInfo() end) @@ -162,6 +163,7 @@ function GameSettingUI:initSupportBtn() self.uiMap["game_setting_ui.bg.support_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.SUPPORT_DESC_2)) self.uiMap["game_setting_ui.bg.support_btn"]:addClickListener(function() ModuleManager.GameSettingManager:showSupport() + DataManager.AIHelperData:clearRp() end) end @@ -216,6 +218,17 @@ function GameSettingUI:_addListeners() end) end +function GameSettingUI:_bind() + self:bind(DataManager.AIHelperData, "isDirty", function() + local supportBtn = self.uiMap["game_setting_ui.bg.support_btn"] + if DataManager.AIHelperData:getRp() then + supportBtn:addRedPoint(88, 24, 0.8) + else + supportBtn:removeRedPoint() + end + end, true) +end + function GameSettingUI:refreshMusic() local offIcon = self.uiMap["game_setting_ui.bg.music_bg.off"] local onIcon = self.uiMap["game_setting_ui.bg.music_bg.on"] diff --git a/lua/app/ui/game_setting/select_other_btn_ui.lua b/lua/app/ui/game_setting/select_other_btn_ui.lua index d568b7e1..4343e54b 100644 --- a/lua/app/ui/game_setting/select_other_btn_ui.lua +++ b/lua/app/ui/game_setting/select_other_btn_ui.lua @@ -51,8 +51,14 @@ function SelectOtherBtnUI:onLoadRootComplete() self.uiMap["select_other_btn_ui.bg.mail_btn"]:setVisible(false) end cellCount = cellCount + 1 - self.uiMap["select_other_btn_ui.bg.setting_btn"]:setAnchoredPositionY(y) - self.uiMap["select_other_btn_ui.bg.setting_btn"]:addClickListener(function() + local settingBtn = self.uiMap["select_other_btn_ui.bg.setting_btn"] + if DataManager.AIHelperData:getRp() then + settingBtn:addRedPoint(124, 35, 0.8, nil, nil, true) + else + settingBtn:removeRedPoint() + end + settingBtn:setAnchoredPositionY(y) + settingBtn:addClickListener(function() self:closeUI() ModuleManager.GameSettingManager:showSettingUI() end) diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index 79c51e0b..22be5dab 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -257,6 +257,10 @@ function MainCityUI:_bind() end end end) + + self:bind(DataManager.AIHelperData, "isDirty", function() + self:refreshSettingBtn() + end) end function MainCityUI:initBottomUI() @@ -779,6 +783,10 @@ function MainCityUI:updateTime() self:refreshRightBtns() self.waitRefreshSideBar = false end + + if DataManager.AIHelperData:getNeedReqTime() then + ModuleManager.GameSettingManager:reqAiHelper() + end end function MainCityUI:updateSideBarStatus() @@ -908,7 +916,7 @@ function MainCityUI:refreshBottomRp() end function MainCityUI:refreshSettingBtn() - if DataManager.MailData:getIsOpen() and DataManager.MailData:getRedPoint() then + if (DataManager.MailData:getIsOpen() and DataManager.MailData:getRedPoint()) or DataManager.AIHelperData:getRp() then self.settingbtn:addRedPoint(40, 40, 0.7) else self.settingbtn:removeRedPoint() diff --git a/lua/app/userdata/game_setting/ai_helper_data.lua b/lua/app/userdata/game_setting/ai_helper_data.lua new file mode 100644 index 00000000..4ab8a1cb --- /dev/null +++ b/lua/app/userdata/game_setting/ai_helper_data.lua @@ -0,0 +1,52 @@ +local AIHelperData = class("AIHelperData", BaseData) + +local INIT_DELAY_TIME = 10 +local REQ_INTERVAL = 1800 + +function AIHelperData:ctor() + self.data.isDirty = false + self.aiHelperRpCount = 0 +end + +function AIHelperData:init(data, isInit) + self.nextReqTime = Time:getServerTime() + REQ_INTERVAL + if isInit then -- 初始化没有数据,自己构建一份,并且延迟发送请求 + data = { + count = 0 + } + self.nextReqTime = Time:getServerTime() + INIT_DELAY_TIME + end + if not data then + return + end + self.aiHelperRpCount = data.count + self:setIsDirty() +end + +function AIHelperData:setIsDirty() + self.data.isDirty = not self.data.isDirty +end + +function AIHelperData:getNextReqTime() + return self.nextReqTime +end + +function AIHelperData:getNeedReqTime() + if self:getNextReqTime() <= Time:getServerTime() then + self.nextReqTime = Time:getServerTime() + REQ_INTERVAL + return true + end + + return false +end + +function AIHelperData:getRp() + return self.aiHelperRpCount > 0 +end + +function AIHelperData:clearRp() + self.aiHelperRpCount = 0 + self:setIsDirty() +end + +return AIHelperData \ No newline at end of file diff --git a/lua/app/userdata/game_setting/ai_helper_data.lua.meta b/lua/app/userdata/game_setting/ai_helper_data.lua.meta new file mode 100644 index 00000000..1951d950 --- /dev/null +++ b/lua/app/userdata/game_setting/ai_helper_data.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c61b7067b2b095246bcc2b80c0f7f55f +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}