|
require("game.arena.ArenaModel")
|
|
require("game.arena.ArenaView")
|
|
require("game.arena.ArenaView")
|
|
require("game.arena.ArenaConst")
|
|
-- require("game.arena.BattleFieldDefine")
|
|
|
|
ArenaController = ArenaController or BaseClass(BaseController)
|
|
|
|
function ArenaController:__init()
|
|
ArenaController.Instance = self
|
|
self.model = ArenaModel:getInstance()
|
|
self:RegisterProtocals()
|
|
self:InitEvent()
|
|
end
|
|
|
|
function ArenaController:RegisterProtocals()
|
|
|
|
end
|
|
|
|
function ArenaController:InitEvent()
|
|
local function OPEN_ARENA_VIEW(index)
|
|
if type(index) == "table" then
|
|
index = index[1] or 1
|
|
end
|
|
if self.ArenaView == nil then
|
|
self.ArenaView = ArenaView.New()
|
|
end
|
|
|
|
if not self.ArenaView:HasOpen() then
|
|
self.ArenaView:Open(index)
|
|
else
|
|
self.ArenaView:ReOpen(index)
|
|
end
|
|
self.model:UpdateAllTabDot()
|
|
end
|
|
GlobalEventSystem:Bind(EventName.OPEN_ARENA_VIEW,OPEN_ARENA_VIEW)
|
|
|
|
local function CLOSE_ARENA_VIEW( ... )
|
|
if self.ArenaView then
|
|
self.ArenaView:Close()
|
|
end
|
|
end
|
|
GlobalEventSystem:Bind(EventName.CLOSE_ARENA_VIEW,CLOSE_ARENA_VIEW)
|
|
|
|
--竞技模块的外部红点全部丢到这里来处理,各个模块自己的红点事件更新后要调用ArenaConst.ANS_ARENA_UPDATE_RED_DOT来刷新外部红点
|
|
local function UPDATE_ALL_RED()
|
|
local red = false
|
|
local pk_red = PkRankModel:getInstance():PkRankModelCheckRedDot(false)
|
|
local endless_red = EndlessModel:getInstance():CheckEndlessRedDot()
|
|
local wasteland_red = WastelandModel:getInstance():CheckWastelandRedDot()
|
|
local clothing_red = ClothingVoteModel:getInstance():GetClothingVoteMainRed()
|
|
|
|
-- local csgwar_red_data = CSGWarModel:getInstance():GetCSGWarRedData()
|
|
-- local csgwar_red = csgwar_red_data.one_red or csgwar_red_data.support_red or csgwar_red_data.fight_red or csgwar_red_data.occupy_red
|
|
|
|
red = pk_red or endless_red or wasteland_red or clothing_red or csgwar_red
|
|
|
|
GlobalEventSystem:Fire(ActivityIconManager.UPDATE_ICON_TIPS, 4, red)
|
|
end
|
|
self.model:Bind(ArenaConst.ANS_ARENA_UPDATE_RED_DOT,UPDATE_ALL_RED)
|
|
|
|
local function ON_LEVEL_UP(level)
|
|
if level and level == 100 then
|
|
local pk_red = PkRankModel:getInstance():PkRankModelCheckRedDot(false)
|
|
GlobalEventSystem:Fire(ActivityIconManager.UPDATE_ICON_TIPS, 4, pk_red)
|
|
end
|
|
end
|
|
RoleManager.Instance.mainRoleInfo:Bind(EventName.CHANGE_LEVEL, ON_LEVEL_UP)
|
|
end
|