diff --git a/lua/app/config/const.lua b/lua/app/config/const.lua index 5d273786..48f7be39 100644 --- a/lua/app/config/const.lua +++ b/lua/app/config/const.lua @@ -373,9 +373,12 @@ local const = { ["num"]=50, ["num_for_nothing"]="Uwg=" } + }, + ["bounty_click"]={ + ["value"]=4 } } local config = { -data=const,count=76 +data=const,count=77 } return config \ No newline at end of file diff --git a/lua/app/config/localization/localization_global_const.lua b/lua/app/config/localization/localization_global_const.lua index 14170d5c..c35187c2 100644 --- a/lua/app/config/localization/localization_global_const.lua +++ b/lua/app/config/localization/localization_global_const.lua @@ -448,6 +448,7 @@ local LocalizationGlobalConst = ACT_DESC_12 = "ACT_DESC_12", ARENA_DESC_35 = "ARENA_DESC_35", ARENA_DESC_36 = "ARENA_DESC_36", + ONE_KEY_GET_DESC = "ONE_KEY_GET_DESC", } 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 8451a022..7ed50c16 100644 --- a/lua/app/config/strings/cn/global.lua +++ b/lua/app/config/strings/cn/global.lua @@ -448,6 +448,7 @@ local localization_global = ["ACT_DESC_12"] = "LV", ["ARENA_DESC_35"] = "可能出史诗哦~", ["ARENA_DESC_36"] = "试试手气", + ["ONE_KEY_GET_DESC"] = "一键领取", } return localization_global \ No newline at end of file diff --git a/lua/app/module/arena/arena_bounty_manager.lua b/lua/app/module/arena/arena_bounty_manager.lua index 1d461760..066c36df 100644 --- a/lua/app/module/arena/arena_bounty_manager.lua +++ b/lua/app/module/arena/arena_bounty_manager.lua @@ -21,24 +21,30 @@ function ArenaBountyManager:onClaimReward(result) if result.err_code == GConst.ERROR_STR.SUCCESS then if result.rewards then -- 读表获取该层奖励 如果是箱子走单独奖励展示接口 + local isOneKeyGet = false local isSpecialBox = false local index = result.reqData.level - local isPro = result.reqData.is_pro - local info = DataManager.ArenaBountyData:getSeasonInfoByLevel(index) - local rewardType local rewardId - if info then - local reward = isPro and info.reward_pro or info.reward - rewardType = reward and reward.type - rewardId = reward and reward.id - if rewardType == GConst.REWARD_TYPE.ITEM then - local itemCfgInfo = ConfigManager:getConfig("item")[rewardId] - if itemCfgInfo and itemCfgInfo.type == GConst.ItemConst.ITEM_TYPE.BOX then - isSpecialBox = true + if index == 0 then -- 一键领取 + isOneKeyGet = true + else + local isPro = result.reqData.is_pro + local info = DataManager.ArenaBountyData:getSeasonInfoByLevel(index) + local rewardType + if info then + local reward = isPro and info.reward_pro or info.reward + rewardType = reward and reward.type + rewardId = reward and reward.id + if rewardType == GConst.REWARD_TYPE.ITEM then + local itemCfgInfo = ConfigManager:getConfig("item")[rewardId] + if itemCfgInfo and itemCfgInfo.type == GConst.ItemConst.ITEM_TYPE.BOX then + isSpecialBox = true + end end end end - if isSpecialBox then + + if isSpecialBox and not isOneKeyGet then ModuleManager.ShopManager:showBoxOpenUI({type = GConst.ShopConst.BOX_REWARD_TYPE.ARENA_BOUNTY, params = rewardId, rewards = result.rewards}) local openType = BIReport.BOX_OPEN_OPEN_TYPE.ARENA_BOUNTY BIReport:postBoxOpen(rewardId, BIReport.BOX_OPEN_BOX_TYPE.ACTIVITY, openType, 0, result.rewards) @@ -48,10 +54,15 @@ function ArenaBountyManager:onClaimReward(result) end if result.reqData.is_pro ~= nil then local BountyData = DataManager.ArenaBountyData - if result.reqData.is_pro then - BountyData:onClaimProReward(result.reqData.level) + local index = result.reqData.level + if index ~= 0 then + if result.reqData.is_pro then + BountyData:onClaimProReward(result.reqData.level) + else + BountyData:onClaimReward(result.reqData.level) + end else - BountyData:onClaimReward(result.reqData.level) + BountyData:onOneKeyClaimReward() end BIReport:postArenaBountyReward(BountyData:getBountyReportType(), BountyData:getLevel(), BountyData:getExp(), BountyData:getSeason(), result.reqData.level, result.reqData.is_pro) end diff --git a/lua/app/module/bounty/bounty_manager.lua b/lua/app/module/bounty/bounty_manager.lua index 3e633da8..7a1fb3df 100644 --- a/lua/app/module/bounty/bounty_manager.lua +++ b/lua/app/module/bounty/bounty_manager.lua @@ -21,24 +21,30 @@ function BountyManager:onClaimReward(result) if result.err_code == GConst.ERROR_STR.SUCCESS then if result.rewards then -- 读表获取该层奖励 如果是箱子走单独奖励展示接口 + local isOneKeyGet = false local isSpecialBox = false local index = result.reqData.level - local isPro = result.reqData.is_pro - local info = DataManager.BountyData:getSeasonInfoByLevel(index) - local rewardType local rewardId - if info then - local reward = isPro and info.reward_pro or info.reward - rewardType = reward and reward.type - rewardId = reward and reward.id - if rewardType == GConst.REWARD_TYPE.ITEM then - local itemCfgInfo = ConfigManager:getConfig("item")[rewardId] - if itemCfgInfo and itemCfgInfo.type == GConst.ItemConst.ITEM_TYPE.BOX then - isSpecialBox = true + if index == 0 then -- 一键领取 + isOneKeyGet = true + else + local isPro = result.reqData.is_pro + local info = DataManager.BountyData:getSeasonInfoByLevel(index) + local rewardType + if info then + local reward = isPro and info.reward_pro or info.reward + rewardType = reward and reward.type + rewardId = reward and reward.id + if rewardType == GConst.REWARD_TYPE.ITEM then + local itemCfgInfo = ConfigManager:getConfig("item")[rewardId] + if itemCfgInfo and itemCfgInfo.type == GConst.ItemConst.ITEM_TYPE.BOX then + isSpecialBox = true + end end end end - if isSpecialBox then + + if isSpecialBox and not isOneKeyGet then ModuleManager.ShopManager:showBoxOpenUI({type = GConst.ShopConst.BOX_REWARD_TYPE.BOUNTY, params = rewardId, rewards = result.rewards}) local openType = BIReport.BOX_OPEN_OPEN_TYPE.BOUNTY BIReport:postBoxOpen(rewardId, BIReport.BOX_OPEN_BOX_TYPE.ACTIVITY, openType, 0, result.rewards) @@ -48,11 +54,17 @@ function BountyManager:onClaimReward(result) end if result.reqData.is_pro ~= nil then local BountyData = DataManager.BountyData - if result.reqData.is_pro then - BountyData:onClaimProReward(result.reqData.level) + local index = result.reqData.level + if index ~= 0 then + if result.reqData.is_pro then + BountyData:onClaimProReward(result.reqData.level) + else + BountyData:onClaimReward(result.reqData.level) + end else - BountyData:onClaimReward(result.reqData.level) + BountyData:onOneKeyClaimReward() end + BIReport:postBountyReward(BountyData:getBountyReportType(), BountyData:getLevel(), BountyData:getExp(), BountyData:getSeason(), result.reqData.level, result.reqData.is_pro) end end diff --git a/lua/app/module/gm/dev_tool_manager.lua b/lua/app/module/gm/dev_tool_manager.lua index 4dce73a2..fc12618c 100644 --- a/lua/app/module/gm/dev_tool_manager.lua +++ b/lua/app/module/gm/dev_tool_manager.lua @@ -88,4 +88,12 @@ function DevToolManager:onDealGMFinish(parmas, code, result) ModuleManager.LoginManager:goToLoginScene() end +function DevToolManager:setSkip(skip) + self.isSkipTutorial = skip +end + +function DevToolManager:getSkip() + return self.isSkipTutorial +end + return DevToolManager \ No newline at end of file diff --git a/lua/app/module/tutorial/tutorial_manager.lua b/lua/app/module/tutorial/tutorial_manager.lua index a0857104..bb63c616 100644 --- a/lua/app/module/tutorial/tutorial_manager.lua +++ b/lua/app/module/tutorial/tutorial_manager.lua @@ -215,6 +215,11 @@ end function TutorialManager:showFuncTutorial(id) self:sendTutorialId(id, function(success) + if EDITOR_MODE or not Platform:getIsPublishChannel() then -- 跳过引导 + if ModuleManager.DevToolManager:getSkip() then + success = false + end + end if success then if not DataManager.TutorialData:getIsFuncTutorialFinished(id) then DataManager.TutorialData:markFuncTutorialFinish(id) diff --git a/lua/app/ui/arena/bounty_main_ui.lua b/lua/app/ui/arena/bounty_main_ui.lua index bd21990a..5082164d 100644 --- a/lua/app/ui/arena/bounty_main_ui.lua +++ b/lua/app/ui/arena/bounty_main_ui.lua @@ -45,6 +45,12 @@ function BountyMainUI:onLoadRootComplete() self:closeUI() end) + self.oneKeyBtn = uiMap["bounty_main_ui.bottom_node.one_key_btn"] + self.oneKeyBtn:addClickListener(function() + ModuleManager.ArenaBountyManager:claimReward(0, false) + end) + uiMap["bounty_main_ui.bottom_node.one_key_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ONE_KEY_GET_DESC)) + self:initTitle() self:initTime() self:initLevel() @@ -264,6 +270,7 @@ function BountyMainUI:refreshPreviewReward(idx) end function BountyMainUI:refreshRewards() + self.oneKeyBtn:setActive(DataManager.ArenaBountyData:canShowOneKeyGetBtn()) self.rewardsLeftTitleTx:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_BATTLEPASS_3)) self.rewardsRightTitleTx:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_BATTLEPASS_4)) if not self.adjustRewardsTitleUI then diff --git a/lua/app/ui/bounty/bounty_main_ui.lua b/lua/app/ui/bounty/bounty_main_ui.lua index 5cddd491..0877144e 100644 --- a/lua/app/ui/bounty/bounty_main_ui.lua +++ b/lua/app/ui/bounty/bounty_main_ui.lua @@ -45,6 +45,12 @@ function BountyMainUI:onLoadRootComplete() self:closeUI() end) + self.oneKeyBtn = uiMap["bounty_main_ui.bottom_node.one_key_btn"] + self.oneKeyBtn:addClickListener(function() + ModuleManager.BountyManager:claimReward(0, false) + end) + uiMap["bounty_main_ui.bottom_node.one_key_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ONE_KEY_GET_DESC)) + self:initTitle() self:initTime() self:initLevel() @@ -267,6 +273,7 @@ function BountyMainUI:refreshPreviewReward(idx) end function BountyMainUI:refreshRewards() + self.oneKeyBtn:setActive(DataManager.BountyData:canShowOneKeyGetBtn()) self.rewardsLeftTitleTx:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_FREE_NAME)) self.rewardsRightTitleTx:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_PURCHASE_NAME)) if not self.adjustRewardsTitleUI then diff --git a/lua/app/ui/gm/gm_tool_ui.lua b/lua/app/ui/gm/gm_tool_ui.lua index 444d47be..cc175801 100644 --- a/lua/app/ui/gm/gm_tool_ui.lua +++ b/lua/app/ui/gm/gm_tool_ui.lua @@ -25,6 +25,9 @@ function GMToolUI:onRefresh() local scrollView = self.uiMap['gm_tool_ui.ScrollView'] local textTip = self.uiMap['gm_tool_ui.text_tip'] local speedUpBtn = self.uiMap["gm_tool_ui.speed_up_btn"] + local skipTutorialTx = self.uiMap["gm_tool_ui.skip_tutoria.text"] + local skipTutorialBtn = self.uiMap["gm_tool_ui.skip_tutoria"] + local skipTutorialCheck = self.uiMap["gm_tool_ui.skip_tutoria.check"] self.uiMap['gm_tool_ui.close_btn']:addClickListener(function() self:closeUI() end) self.scrollRect = scrollView:getLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE) @@ -42,7 +45,7 @@ function GMToolUI:onRefresh() self.inputField = inputField titleTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT).text = "GM面板" okBtnText:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT).text = "确定" - + skipTutorialTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT).text = "跳过引导" okBtn:addClickListener(function() local gmCommand = self.inputField:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_INPUT_FIELD).text @@ -72,6 +75,12 @@ function GMToolUI:onRefresh() comp.enabled = not comp.enabled end end) + + skipTutorialCheck:setVisible(ModuleManager.DevToolManager:getSkip() == true) + skipTutorialBtn:addClickListener(function() + ModuleManager.DevToolManager:setSkip(not ModuleManager.DevToolManager:getSkip()) + skipTutorialCheck:setVisible(ModuleManager.DevToolManager:getSkip() == true) + end) end function GMToolUI:initScrollRectCell(index, cell) diff --git a/lua/app/userdata/arena/arena_bounty_data.lua b/lua/app/userdata/arena/arena_bounty_data.lua index ed963acc..af38a4af 100644 --- a/lua/app/userdata/arena/arena_bounty_data.lua +++ b/lua/app/userdata/arena/arena_bounty_data.lua @@ -268,6 +268,58 @@ function ArenaBountyData:getIfCanClaimReward() return false end +-- 展示一键领取按钮 +function ArenaBountyData:canShowOneKeyGetBtn() + local maxLevel = self:getMaxLevel() + local curLevel = math.min(maxLevel, self.level) + if curLevel <= 0 then + return false + end + + local count = self:getShowOneKeyLimit() + for i = 1, curLevel do + if not self.claimed[i] then + count = count - 1 + end + if self.bought and not self.proClaimed[i] then + count = count - 1 + end + if count <= 0 then + return true + end + end + + return false +end + +function ArenaBountyData:getShowOneKeyLimit() + if not self.showOneKeyLimit then + self.showOneKeyLimit = GFunc.getConstIntValue("bounty_click") + end + + return self.showOneKeyLimit +end + +function ArenaBountyData:onOneKeyClaimReward() + local maxLevel = self:getMaxLevel() + local curLevel = math.min(maxLevel, self.level) + if curLevel <= 0 then + return false + end + for i = 1, curLevel do + if not self.claimed[i] then + self.claimed[i] = true + self.claimedCount = self.claimedCount + 1 + end + if self.bought and not self.proClaimed[i] then + self.proClaimed[i] = true + self.proClaimedCount = self.proClaimedCount + 1 + end + end + + self:markDirty() +end + -- 是否可以领取重复奖励 function ArenaBountyData:getIfCanClaimRepeatReward() local maxLevel = self:getMaxLevel() @@ -284,8 +336,17 @@ function ArenaBountyData:onClaimReward(level) if self.claimed[level] then return end - self.claimed[level] = true - self.claimedCount = self.claimedCount + 1 + local maxLevel = self:getMaxLevel() + if level > maxLevel then + for i = maxLevel, level do + self.claimed[i] = true + self.claimedCount = self.claimedCount + 1 + end + else + self.claimed[level] = true + self.claimedCount = self.claimedCount + 1 + end + self:markDirty() end diff --git a/lua/app/userdata/bounty/bounty_data.lua b/lua/app/userdata/bounty/bounty_data.lua index 5c213684..80692b7f 100644 --- a/lua/app/userdata/bounty/bounty_data.lua +++ b/lua/app/userdata/bounty/bounty_data.lua @@ -272,6 +272,58 @@ function BountyData:getIfCanClaimReward() return false end +-- 展示一键领取按钮 +function BountyData:canShowOneKeyGetBtn() + local maxLevel = self:getMaxLevel() + local curLevel = math.min(maxLevel, self.level) + if curLevel <= 0 then + return false + end + + local count = self:getShowOneKeyLimit() + for i = 1, curLevel do + if not self.claimed[i] then + count = count - 1 + end + if self.bought and not self.proClaimed[i] then + count = count - 1 + end + if count <= 0 then + return true + end + end + + return false +end + +function BountyData:getShowOneKeyLimit() + if not self.showOneKeyLimit then + self.showOneKeyLimit = GFunc.getConstIntValue("bounty_click") + end + + return self.showOneKeyLimit +end + +function BountyData:onOneKeyClaimReward() + local maxLevel = self:getMaxLevel() + local curLevel = math.min(maxLevel, self.level) + if curLevel <= 0 then + return false + end + for i = 1, curLevel do + if not self.claimed[i] then + self.claimed[i] = true + self.claimedCount = self.claimedCount + 1 + end + if self.bought and not self.proClaimed[i] then + self.proClaimed[i] = true + self.proClaimedCount = self.proClaimedCount + 1 + end + end + + self:markDirty() +end + -- 是否可以领取重复奖励 function BountyData:getIfCanClaimRepeatReward() local maxLevel = self:getMaxLevel() @@ -288,8 +340,16 @@ function BountyData:onClaimReward(level) if self.claimed[level] then return end - self.claimed[level] = true - self.claimedCount = self.claimedCount + 1 + local maxLevel = self:getMaxLevel() + if level > maxLevel then + for i = maxLevel, level do + self.claimed[i] = true + self.claimedCount = self.claimedCount + 1 + end + else + self.claimed[level] = true + self.claimedCount = self.claimedCount + 1 + end self:markDirty() end