战令一键领取
This commit is contained in:
parent
e85055d67a
commit
254a27563a
@ -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
|
||||
@ -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
|
||||
@ -448,6 +448,7 @@ local localization_global =
|
||||
["ACT_DESC_12"] = "LV",
|
||||
["ARENA_DESC_35"] = "可能出<color=#ff8bf8>史诗</color>哦~",
|
||||
["ARENA_DESC_36"] = "试试手气",
|
||||
["ONE_KEY_GET_DESC"] = "一键领取",
|
||||
}
|
||||
|
||||
return localization_global
|
||||
@ -21,12 +21,16 @@ 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 rewardId
|
||||
if index == 0 then -- 一键领取
|
||||
isOneKeyGet = true
|
||||
else
|
||||
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
|
||||
@ -38,7 +42,9 @@ function ArenaBountyManager:onClaimReward(result)
|
||||
end
|
||||
end
|
||||
end
|
||||
if isSpecialBox then
|
||||
end
|
||||
|
||||
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,11 +54,16 @@ function ArenaBountyManager:onClaimReward(result)
|
||||
end
|
||||
if result.reqData.is_pro ~= nil then
|
||||
local BountyData = DataManager.ArenaBountyData
|
||||
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:onOneKeyClaimReward()
|
||||
end
|
||||
BIReport:postArenaBountyReward(BountyData:getBountyReportType(), BountyData:getLevel(), BountyData:getExp(), BountyData:getSeason(), result.reqData.level, result.reqData.is_pro)
|
||||
end
|
||||
end
|
||||
|
||||
@ -21,12 +21,16 @@ 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 rewardId
|
||||
if index == 0 then -- 一键领取
|
||||
isOneKeyGet = true
|
||||
else
|
||||
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
|
||||
@ -38,7 +42,9 @@ function BountyManager:onClaimReward(result)
|
||||
end
|
||||
end
|
||||
end
|
||||
if isSpecialBox then
|
||||
end
|
||||
|
||||
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
|
||||
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:onOneKeyClaimReward()
|
||||
end
|
||||
|
||||
BIReport:postBountyReward(BountyData:getBountyReportType(), BountyData:getLevel(), BountyData:getExp(), BountyData:getSeason(), result.reqData.level, result.reqData.is_pro)
|
||||
end
|
||||
end
|
||||
|
||||
@ -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
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
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
|
||||
|
||||
|
||||
@ -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
|
||||
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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user