idle
This commit is contained in:
parent
b1fa6a4444
commit
3a6557f043
@ -255,7 +255,7 @@ function IdleDropUI:refreshBtns()
|
||||
self.getBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_1")
|
||||
self.getBtn:setTouchEnable(false)
|
||||
end
|
||||
local quickTimes = DataManager.IdleData:getQuickIdleRemainTimes()
|
||||
local quickTimes = DataManager.IdleData:getQuickIdleVitRemainTimes()
|
||||
if quickTimes > 0 then
|
||||
self.quickBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_1")
|
||||
self.quickBtn:setTouchEnable(true)
|
||||
|
||||
@ -167,8 +167,13 @@ function MainComp:init()
|
||||
self.chapterScenes = {}
|
||||
end
|
||||
|
||||
function MainComp:refreshTime()
|
||||
self:refreshRedPoint()
|
||||
end
|
||||
|
||||
function MainComp:refresh()
|
||||
self:refreshChapter()
|
||||
self:refreshRedPoint()
|
||||
end
|
||||
|
||||
function MainComp:refreshChapter(force)
|
||||
@ -273,6 +278,22 @@ function MainComp:refreshChapterInfo()
|
||||
end
|
||||
end
|
||||
|
||||
function MainComp:refreshRedPoint()
|
||||
local time = Time:getServerTime() - DataManager.IdleData:getLastDropTime()
|
||||
local idleMaxTime = DataManager.IdleData:getIdleMaxTime()
|
||||
if time >= idleMaxTime or DataManager.IdleData:getQuickIdleRemainTimes() > 0 then
|
||||
self.leftBtn:addRedPoint(70, 20, 0.5)
|
||||
else
|
||||
self.leftBtn:removeRedPoint()
|
||||
end
|
||||
|
||||
if DataManager.SummonData:hasSummonCostRedPoint() then
|
||||
self.rightBtn:addRedPoint(-70, 20, 0.5)
|
||||
else
|
||||
self.rightBtn:removeRedPoint()
|
||||
end
|
||||
end
|
||||
|
||||
function MainComp:getArenaBtnPosition()
|
||||
return self.arenaBtn:getPosition()
|
||||
end
|
||||
|
||||
@ -249,7 +249,7 @@ function MainCityUI:_bind()
|
||||
self:refreshBottomRp()
|
||||
end)
|
||||
|
||||
self:bind(DataManager.DailyTaskData, "redPointFlag", function()
|
||||
self:bind(DataManager.DailyTaskData, "isDirty", function()
|
||||
self:refreshTask()
|
||||
end)
|
||||
|
||||
@ -824,7 +824,7 @@ function MainCityUI:refreshTask()
|
||||
self.taskBtn:setVisible(true)
|
||||
local showRedPoint = DataManager.DailyTaskData:showRedPoint()
|
||||
if showRedPoint then
|
||||
self.taskBtn:addRedPoint(38, 34, 0.7)
|
||||
self.taskBtn:addRedPoint(32, 28, 0.5)
|
||||
else
|
||||
self.taskBtn:removeRedPoint()
|
||||
end
|
||||
|
||||
@ -189,39 +189,8 @@ end
|
||||
--@endregion
|
||||
|
||||
--@region 红点
|
||||
function SummonData:hasSummonCostRedPoint(count)
|
||||
-- if count then
|
||||
-- local itemCost = self:getSummonItemCost()
|
||||
-- local costId = GFunc.getRewardId(itemCost)
|
||||
-- local costNum = GFunc.getRewardNum(itemCost)
|
||||
-- if GFunc.checkCost(costId, costNum * count, false) then
|
||||
-- return true
|
||||
-- end
|
||||
-- local actId = self:getSummonOpenActivityId()
|
||||
-- if actId then
|
||||
-- local itemCost = self:getSummonItemCost(actId)
|
||||
-- if itemCost then
|
||||
-- local costId = GFunc.getRewardId(itemCost)
|
||||
-- local costNum = GFunc.getRewardNum(itemCost)
|
||||
-- if GFunc.checkCost(costId, costNum * count, false) then
|
||||
-- return true
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- return false
|
||||
-- else
|
||||
-- if self:hasSummonCostRedPoint(1) then
|
||||
-- return true
|
||||
-- end
|
||||
-- if self:hasSummonCostRedPoint(10) then
|
||||
-- return true
|
||||
-- end
|
||||
-- if self:hasSummonFree() then
|
||||
-- return true
|
||||
-- end
|
||||
-- end
|
||||
-- return false
|
||||
return self:hasSummonFree()
|
||||
function SummonData:hasSummonCostRedPoint()
|
||||
return self:hasSummonFree(1) or self:hasSummonFree(2)
|
||||
end
|
||||
--@endregion
|
||||
|
||||
|
||||
@ -81,6 +81,8 @@ function DailyTaskData:initDaily(daily)
|
||||
table.insert(self.dailyStageIds, id)
|
||||
end
|
||||
table.sort(self.dailyStageIds)
|
||||
self.dailyRedState = nil
|
||||
self:showRedPoint()
|
||||
end
|
||||
|
||||
function DailyTaskData:initAchievement(achievement)
|
||||
@ -89,6 +91,8 @@ function DailyTaskData:initAchievement(achievement)
|
||||
-- 成就任务
|
||||
self.achievementData = achievement.tasks or {}
|
||||
self.achievementRewardData = achievement.task_claimed_stages or {}
|
||||
self.achievementRedState = nil
|
||||
self:showRedPoint()
|
||||
end
|
||||
|
||||
function DailyTaskData:getIsOpen(showToast)
|
||||
@ -107,6 +111,9 @@ function DailyTaskData:showRedPoint()
|
||||
end
|
||||
|
||||
function DailyTaskData:showDailyRedPoint()
|
||||
if not self.dailyTaskData then
|
||||
return
|
||||
end
|
||||
if self.dailyRedState ~= nil then
|
||||
return self.dailyRedState
|
||||
end
|
||||
@ -129,6 +136,9 @@ function DailyTaskData:showDailyRedPoint()
|
||||
end
|
||||
|
||||
function DailyTaskData:showAchievementRedPoint()
|
||||
if not self.achievementRewardData then
|
||||
return
|
||||
end
|
||||
if self.achievementRedState ~= nil then
|
||||
return self.achievementRedState
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user