七天乐

This commit is contained in:
chenxi 2023-05-30 22:22:46 +08:00
parent afc0b58e39
commit ad9f510a1e
6 changed files with 100 additions and 35 deletions

View File

@ -29,6 +29,15 @@ local chapter = {
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44

View File

@ -190,7 +190,7 @@ local const = {
["value"]=7
},
["model_daily_challenge"]={
["value"]=6000
["value"]=8000
},
["level_fund_hero_1"]={
["value"]=24001

View File

@ -1,11 +1,9 @@
local func_open = {
["act_gold_pig"]={
["stage"]=3,
["pop_ups"]=1
["stage"]=3
},
["bounty_open"]={
["stage"]=3,
["pop_ups"]=1
["stage"]=3
},
["task"]={
["stage"]=3,
@ -24,40 +22,33 @@ local func_open = {
["icon"]="main_act_sevenday"
},
["mall"]={
["stage"]=2,
["pop_ups"]=1
["stage"]=2
},
["mall_daily"]={
["stage"]=5,
["icon"]="main_mall_daily"
},
["store_box_open"]={
["stage"]=2,
["pop_ups"]=1
["stage"]=2
},
["store_box_3_open"]={
["stage"]=5,
["pop_ups"]=1
["stage"]=5
},
["daily_challenge"]={
["stage"]=8,
["icon"]="main_daily_challenge"
},
["act_gift_show_open"]={
["stage"]=3,
["pop_ups"]=1
["stage"]=3
},
["first_charge"]={
["stage"]=2,
["pop_ups"]=1
["stage"]=2
},
["new_player_gift"]={
["stage"]=2,
["pop_ups"]=1
["stage"]=2
},
["mail_open"]={
["stage"]=2,
["pop_ups"]=1
["stage"]=2
}
}
local config = {

View File

@ -1,6 +1,5 @@
local LocalizationGlobalConst =
{
BATTLE_DESC_11 = "BATTLE_DESC_11",
MAIN_BTN_1 = "MAIN_BTN_1",
QLT_DESC_1 = "QLT_DESC_1",
QLT_DESC_2 = "QLT_DESC_2",
@ -189,6 +188,7 @@ local LocalizationGlobalConst =
HERO_UNLOCK_DESC = "HERO_UNLOCK_DESC",
BOUNTY_TITLE = "BOUNTY_TITLE",
REMAIN_TIME = "REMAIN_TIME",
BATTLE_DESC_11 = "BATTLE_DESC_11",
}
return LocalizationGlobalConst

View File

@ -302,7 +302,7 @@ local monster_base = {
[20003]={
["model_id"]="m20003",
["body"]=1,
["model_ui"]=1.0
["model_ui"]=0.8
},
[20004]={
["model_id"]="m20004",
@ -312,7 +312,7 @@ local monster_base = {
[20005]={
["model_id"]="m20005",
["body"]=1,
["model_ui"]=1.0
["model_ui"]=0.8
},
[20006]={
["model_id"]="m20006",
@ -347,12 +347,12 @@ local monster_base = {
[20012]={
["model_id"]="m20012",
["body"]=1,
["model_ui"]=1.0
["model_ui"]=1.2
},
[20013]={
["model_id"]="m20013",
["body"]=1,
["model_ui"]=1.0
["model_ui"]=1.2
},
[20014]={
["model_id"]="m20014",
@ -367,7 +367,7 @@ local monster_base = {
[20016]={
["model_id"]="m20016",
["body"]=1,
["model_ui"]=1.0
["model_ui"]=1.2
},
[20017]={
["model_id"]="m20017",

View File

@ -20,6 +20,13 @@ function SevenDayUI:getCurrencyParams()
return self.currencyParams
end
function SevenDayUI:onClose()
if self.finalAutoRotateTween then
self.finalAutoRotateTween:Kill()
self.finalAutoRotateTween = nil
end
end
function SevenDayUI:ctor()
self.day = DataManager.SevenDayData:getActDay()
if self.day < 0 then
@ -70,22 +77,29 @@ function SevenDayUI:initTop()
end)
self.stepObjs[i] = {
icon = self.uiMap["seven_day_ui.slider_bg.icon_" .. i],
num = self.uiMap["seven_day_ui.slider_bg.num_" .. i],
btn = self.uiMap["seven_day_ui.slider_bg.btn_" .. i],
num = self.uiMap["seven_day_ui.slider_bg.btn_" .. i .. ".num"],
spine = self.uiMap["seven_day_ui.slider_bg.btn_" .. i .. ".ui_spine"],
}
self.stepObjs[i].icon:addClickListener(function()
self.stepObjs[i].btn:addClickListener(function()
local list = DataManager.SevenDayData:getStepRewardList()
local id = list[i]
if id then
if DataManager.SevenDayData:canClaimStepTask(id) then
ModuleManager.SevenDayManager:claimStepReward(id)
self:showBoxOpenAnimation(i, id)
else
local reward = DataManager.SevenDayData:getStepReward(id)
ModuleManager.TipsManager:showRewardsTips({reward}, nil, self.stepObjs[i].icon)
if id == 7 then
ModuleManager.TipsManager:showRewardTips(reward.id, reward.type, self.stepObjs[i].btn)
else
ModuleManager.TipsManager:showRewardsTips({reward}, nil, self.stepObjs[i].btn)
end
end
end
end)
end
self.finalBoxCell = self.uiMap["seven_day_ui.slider_bg.btn_7.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.finalBoxCell:setTouchEnable(false)
self.finalBoxLight = self.uiMap["seven_day_ui.slider_bg.light_7"]
self.sevenDayDesc = self.uiMap["seven_day_ui.slider_bg.desc"]
self.sevenDaySliderComp = self.uiMap["seven_day_ui.slider_bg.slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
@ -144,11 +158,17 @@ function SevenDayUI:refreshStepInfo()
local id = list[index]
if id then
objs.num:setText(DataManager.SevenDayData:getStepNum(id))
if not self.isInBoxAnimation then
if index ~= 7 then
if DataManager.SevenDayData:stepOver(id) then
objs.icon:setSprite(GConst.ATLAS_PATH.SEVEN_DAY, "sevenday_chest_1")
if DataManager.SevenDayData:getStepCollected(id) then -- 领过了
objs.spine:playAnim("idle02", true)
else
objs.icon:setSprite(GConst.ATLAS_PATH.SEVEN_DAY, "sevenday_chest_2")
if DataManager.SevenDayData:stepOver(id) then -- 可以领
objs.spine:playAnim("ready", true)
else
objs.spine:playAnim("idle01", true)
end
end
end
end
end
@ -158,6 +178,31 @@ function SevenDayUI:refreshStepInfo()
local totalCount = DataManager.SevenDayData:getTotalCount()
self.sevenDayDesc:setText(I18N:getGlobalText(I18N.GlobalConst.SEVEN_DAY_DESC_2, count, totalCount))
self.sevenDaySliderComp.value = count / DataManager.SevenDayData:getStepNum(#self.stepObjs)
local finalId = #list
local finalReward = DataManager.SevenDayData:getStepReward(finalId)
if finalReward then
if DataManager.SevenDayData:getStepCollected(finalId) then
self.finalBoxCell:refreshByConfig(finalReward, true, true)
self.finalBoxLight:setVisible(false)
self.stepObjs[finalId].spine:setVisible(false)
else
if DataManager.SevenDayData:stepOver(finalId) then -- 可以领
self.finalBoxLight:setVisible(true)
if self.finalAutoRotateTween == nil then
self.finalAutoRotateTween = self.finalBoxLight:getTransform():DOLocalRotate(BF.Vector3(0, 0, -360), 3, CS.DG.Tweening.RotateMode.FastBeyond360):SetEase(CS.DG.Tweening.Ease.Linear)
self.finalAutoRotateTween:SetLoops(-1)
end
self.stepObjs[finalId].spine:setVisible(true)
self.stepObjs[finalId].spine:playAnim("ready", true)
else
self.finalBoxLight:setVisible(false)
self.stepObjs[finalId].spine:setVisible(false)
end
self.finalBoxCell:refreshByConfig(finalReward)
end
self.finalBoxCell:setNumTx(GConst.EMPTY_STRING)
end
end
function SevenDayUI:refreshScrollRect()
@ -210,4 +255,24 @@ function SevenDayUI:updateTime()
end
end
function SevenDayUI:showBoxOpenAnimation(index, id)
if index == 7 then
ModuleManager.SevenDayManager:claimStepReward(id)
return
end
if self.isInBoxAnimation then
return
end
self.isInBoxAnimation = true
self:disableUITouch()
local spine = self.stepObjs[index].spine
local trackEntry = spine:playAnim("open", false)
local time = spine:getAnimation(trackEntry).Duration
self:performWithDelayGlobal(function()
self:enableUITouch()
self.isInBoxAnimation = false
ModuleManager.SevenDayManager:claimStepReward(id)
end, time)
end
return SevenDayUI