39 lines
1.1 KiB
Lua
39 lines
1.1 KiB
Lua
local IdleManager = class("IdleManager", BaseModule)
|
|
|
|
function IdleManager:showIdleDropUI(params)
|
|
self:getIdleShowRewrad()
|
|
UIManager:showUI("app/ui/idle/idle_drop_ui", params)
|
|
end
|
|
|
|
function IdleManager:showIdleQuickDropUI(params)
|
|
UIManager:showUI("app/ui/idle/idle_quick_drop_ui", params)
|
|
end
|
|
|
|
function IdleManager:getIdleShowRewrad()
|
|
self:sendMessage(ProtoMsgType.FromMsgEnum.IdleInfoReq, {}, {}, self.onGetIdleShowRewrad, BIReport.ITEM_GET_TYPE.NONE)
|
|
end
|
|
|
|
function IdleManager:onGetIdleShowRewrad(result)
|
|
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
|
DataManager.IdleData:onGetIdleShowRewrad(result)
|
|
end
|
|
end
|
|
|
|
function IdleManager:getIdleRewrad()
|
|
self:sendMessage(ProtoMsgType.FromMsgEnum.IdleRewardReq, {}, {}, self.onGetIdleRewrad, BIReport.ITEM_GET_TYPE.IDLE_DROP)
|
|
end
|
|
|
|
function IdleManager:onGetIdleRewrad(result)
|
|
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
|
if result.rewards and next(result.rewards) then
|
|
GFunc.showRewardBox(result.rewards)
|
|
end
|
|
DataManager.IdleData:onGetIdleRewrad(result.claim_at)
|
|
end
|
|
end
|
|
|
|
function IdleManager:getHangUpQuickRewrad()
|
|
|
|
end
|
|
|
|
return IdleManager |