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:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_1")
|
||||||
self.getBtn:setTouchEnable(false)
|
self.getBtn:setTouchEnable(false)
|
||||||
end
|
end
|
||||||
local quickTimes = DataManager.IdleData:getQuickIdleRemainTimes()
|
local quickTimes = DataManager.IdleData:getQuickIdleVitRemainTimes()
|
||||||
if quickTimes > 0 then
|
if quickTimes > 0 then
|
||||||
self.quickBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_1")
|
self.quickBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_1")
|
||||||
self.quickBtn:setTouchEnable(true)
|
self.quickBtn:setTouchEnable(true)
|
||||||
|
|||||||
@ -167,8 +167,13 @@ function MainComp:init()
|
|||||||
self.chapterScenes = {}
|
self.chapterScenes = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function MainComp:refreshTime()
|
||||||
|
self:refreshRedPoint()
|
||||||
|
end
|
||||||
|
|
||||||
function MainComp:refresh()
|
function MainComp:refresh()
|
||||||
self:refreshChapter()
|
self:refreshChapter()
|
||||||
|
self:refreshRedPoint()
|
||||||
end
|
end
|
||||||
|
|
||||||
function MainComp:refreshChapter(force)
|
function MainComp:refreshChapter(force)
|
||||||
@ -273,6 +278,22 @@ function MainComp:refreshChapterInfo()
|
|||||||
end
|
end
|
||||||
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()
|
function MainComp:getArenaBtnPosition()
|
||||||
return self.arenaBtn:getPosition()
|
return self.arenaBtn:getPosition()
|
||||||
end
|
end
|
||||||
|
|||||||
@ -249,7 +249,7 @@ function MainCityUI:_bind()
|
|||||||
self:refreshBottomRp()
|
self:refreshBottomRp()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self:bind(DataManager.DailyTaskData, "redPointFlag", function()
|
self:bind(DataManager.DailyTaskData, "isDirty", function()
|
||||||
self:refreshTask()
|
self:refreshTask()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@ -824,7 +824,7 @@ function MainCityUI:refreshTask()
|
|||||||
self.taskBtn:setVisible(true)
|
self.taskBtn:setVisible(true)
|
||||||
local showRedPoint = DataManager.DailyTaskData:showRedPoint()
|
local showRedPoint = DataManager.DailyTaskData:showRedPoint()
|
||||||
if showRedPoint then
|
if showRedPoint then
|
||||||
self.taskBtn:addRedPoint(38, 34, 0.7)
|
self.taskBtn:addRedPoint(32, 28, 0.5)
|
||||||
else
|
else
|
||||||
self.taskBtn:removeRedPoint()
|
self.taskBtn:removeRedPoint()
|
||||||
end
|
end
|
||||||
|
|||||||
@ -189,39 +189,8 @@ end
|
|||||||
--@endregion
|
--@endregion
|
||||||
|
|
||||||
--@region 红点
|
--@region 红点
|
||||||
function SummonData:hasSummonCostRedPoint(count)
|
function SummonData:hasSummonCostRedPoint()
|
||||||
-- if count then
|
return self:hasSummonFree(1) or self:hasSummonFree(2)
|
||||||
-- 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()
|
|
||||||
end
|
end
|
||||||
--@endregion
|
--@endregion
|
||||||
|
|
||||||
|
|||||||
@ -81,6 +81,8 @@ function DailyTaskData:initDaily(daily)
|
|||||||
table.insert(self.dailyStageIds, id)
|
table.insert(self.dailyStageIds, id)
|
||||||
end
|
end
|
||||||
table.sort(self.dailyStageIds)
|
table.sort(self.dailyStageIds)
|
||||||
|
self.dailyRedState = nil
|
||||||
|
self:showRedPoint()
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyTaskData:initAchievement(achievement)
|
function DailyTaskData:initAchievement(achievement)
|
||||||
@ -89,6 +91,8 @@ function DailyTaskData:initAchievement(achievement)
|
|||||||
-- 成就任务
|
-- 成就任务
|
||||||
self.achievementData = achievement.tasks or {}
|
self.achievementData = achievement.tasks or {}
|
||||||
self.achievementRewardData = achievement.task_claimed_stages or {}
|
self.achievementRewardData = achievement.task_claimed_stages or {}
|
||||||
|
self.achievementRedState = nil
|
||||||
|
self:showRedPoint()
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyTaskData:getIsOpen(showToast)
|
function DailyTaskData:getIsOpen(showToast)
|
||||||
@ -107,6 +111,9 @@ function DailyTaskData:showRedPoint()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function DailyTaskData:showDailyRedPoint()
|
function DailyTaskData:showDailyRedPoint()
|
||||||
|
if not self.dailyTaskData then
|
||||||
|
return
|
||||||
|
end
|
||||||
if self.dailyRedState ~= nil then
|
if self.dailyRedState ~= nil then
|
||||||
return self.dailyRedState
|
return self.dailyRedState
|
||||||
end
|
end
|
||||||
@ -129,6 +136,9 @@ function DailyTaskData:showDailyRedPoint()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function DailyTaskData:showAchievementRedPoint()
|
function DailyTaskData:showAchievementRedPoint()
|
||||||
|
if not self.achievementRewardData then
|
||||||
|
return
|
||||||
|
end
|
||||||
if self.achievementRedState ~= nil then
|
if self.achievementRedState ~= nil then
|
||||||
return self.achievementRedState
|
return self.achievementRedState
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user