|
require("game.strength.StrengthView")
|
|
require("game.strength.StrengthItem")
|
|
require("game.strength.StrengthModel")
|
|
-- require("game.strength.StrengthBaseView")
|
|
-- require("game.strength.StrengthMainView")
|
|
-- require("game.strength.StrengthMainItem")
|
|
|
|
StrengthController = StrengthController or BaseClass(BaseController)
|
|
|
|
function StrengthController:__init()
|
|
StrengthController.Instance = self
|
|
self.model = StrengthModel:getInstance()
|
|
self:InitEvent()
|
|
end
|
|
|
|
function StrengthController:InitEvent( )
|
|
local function onOpenStrengthView(show)
|
|
if show then
|
|
if self.StrengthView == nil then
|
|
self.StrengthView = StrengthView.New()
|
|
end
|
|
self.StrengthView:Open()
|
|
else
|
|
if self.StrengthView and self.StrengthView:HasOpen() then
|
|
self.StrengthView:Close()
|
|
end
|
|
end
|
|
end
|
|
GlobalEventSystem:Bind(EventName.OPEN_STRENGTH_VIEW, onOpenStrengthView)
|
|
|
|
-- local function onOpenStrengthMainView(index)
|
|
-- if RoleManager.Instance.mainRoleInfo.level >= Config.ConfigOpenLv.Other.strong then
|
|
-- if self.strengthBaseView == nil then
|
|
-- self.strengthBaseView = StrengthBaseView.New()
|
|
-- end
|
|
-- -- self.strengthBaseView:Open()
|
|
-- self.strengthBaseView:Open(index)
|
|
-- else
|
|
-- Message.show("未达到开放等级")
|
|
-- end
|
|
-- end
|
|
-- GlobalEventSystem:Bind(EventName.OPEN_STRENGTH_MAIN_VIEW, onOpenStrengthMainView)
|
|
-- -- GlobalEventSystem:Bind(EventName.OPEN_STRENGTH_VIEW, onOpenStrengthMainView)
|
|
|
|
-- local function onCloseStrengthView()
|
|
-- if self.strengthBaseView ~= nil and self.strengthBaseView:HasOpen() then
|
|
-- self.strengthBaseView:Close()
|
|
-- end
|
|
-- end
|
|
-- GlobalEventSystem:Bind(EventName.CLOSE_STRENGTH_MAIN_VIEW, onCloseStrengthView)
|
|
|
|
-- local func = function()
|
|
-- local data = {}
|
|
-- data = {
|
|
-- strength_flag_1 = self.model.strength_flag_1,
|
|
-- strength_flag_2 = self.model.strength_flag_2,
|
|
-- strength_flag_3 = self.model.strength_flag_3,
|
|
-- }
|
|
-- GlobalEventSystem:Fire(EventName.SENT_MODULE_DEBUG_DATA, "strength", data)
|
|
-- end
|
|
-- GlobalEventSystem:Bind(EventName.CHECK_MODULE_DEBUG_DATA,func)
|
|
|
|
|
|
local function onStartGame()
|
|
self.model:ResetInfo()
|
|
end
|
|
GlobalEventSystem:Bind(EventName.GAME_START, onStartGame)
|
|
end
|