89 lines
1.7 KiB
Lua
89 lines
1.7 KiB
Lua
local LevelWorldUIBase = require_ex('UI/Widgets/LevelWorldUIBase')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SSStatusBarBase = HL.Class('SSStatusBarBase', LevelWorldUIBase)
|
|
|
|
|
|
SSStatusBarBase.m_stateHandleFuncLut = HL.Field(HL.Table)
|
|
|
|
|
|
SSStatusBarBase.m_roomId = HL.Field(HL.String) << ""
|
|
|
|
|
|
SSStatusBarBase.m_currentState = HL.Field(CS.Beyond.Gameplay.SpaceshipSystem.RoomState)
|
|
|
|
|
|
|
|
|
|
SSStatusBarBase._OnFirstTimeInit = HL.Override() << function(self)
|
|
self:SetupSwitchStateHandleFunctions()
|
|
end
|
|
|
|
|
|
|
|
|
|
SSStatusBarBase.InitLevelWorldUi = HL.Override(HL.Any) << function(self, args)
|
|
self:_FirstTimeInit()
|
|
self.m_roomId = args[CSIndex(1)]
|
|
self.m_currentState = CS.Beyond.Gameplay.SpaceshipSystem.RoomState.Locked
|
|
self:SetupView()
|
|
local args = {}
|
|
args.roomId = self.m_roomId
|
|
args.statusBar = self
|
|
Notify(MessageConst.SS_REGISTER_STATUS_BAR, args)
|
|
end
|
|
|
|
|
|
|
|
SSStatusBarBase.SetupSwitchStateHandleFunctions = HL.Virtual() << function(self)
|
|
|
|
end
|
|
|
|
|
|
|
|
SSStatusBarBase.SetupView = HL.Virtual() << function(self)
|
|
|
|
end
|
|
|
|
|
|
|
|
SSStatusBarBase.OnLevelWorldUiReleased = HL.Override() << function(self)
|
|
Notify(MessageConst.SS_UNREGISTER_STATUS_BAR, self.m_roomId)
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
SSStatusBarBase.SwitchRoomState = HL.Method(HL.String, CS.Beyond.Gameplay.SpaceshipSystem.RoomState) << function(self, roomId, roomState)
|
|
if self.m_stateHandleFuncLut and self.m_stateHandleFuncLut[roomState] then
|
|
|
|
self.m_stateHandleFuncLut[roomState](self, roomId)
|
|
else
|
|
self:DefaultStateHandle(roomId, roomState)
|
|
end
|
|
self.m_currentState = roomState
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
SSStatusBarBase.DefaultStateHandle = HL.Virtual(HL.String, CS.Beyond.Gameplay.SpaceshipSystem.RoomState) << function(self, roomId, roomState)
|
|
|
|
end
|
|
|
|
HL.Commit(SSStatusBarBase)
|
|
return SSStatusBarBase
|
|
|