源战役客户端
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

68 lines
2.1 KiB

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