Instantly share code, notes, and snippets.
Created
November 3, 2015 23:06
-
Save farmboy0/1c4af0638e52829c9375 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CMainMenuPanel = makeClass(CLuaPanel) | |
g_cAuroraSettings.m_bEnableLiveContentPanels = true | |
CMainMenuPanel.new = function(self) | |
local self = CMainMenuPanel:create() | |
CDefineGUIPanel:ReinitializeReposition() | |
defineGUIPanel(g_aGuiDefinitions.MainMenuPanel, self) | |
defineGUIPanel(g_aGuiDefinitions.DifficultyPanel, self, nil, "lm_pDifficulty") | |
defineGUIPanel(g_aGuiDefinitions.ControlsPanel, self, nil, "lm_pControls") | |
defineGUIPanel(g_aGuiDefinitions.GamePanel, self, nil, "lm_pGame") | |
defineGUIPanel(g_aGuiDefinitions.LivePanel, self, nil, "lm_pLive") | |
defineGUIPanel(g_aGuiDefinitions.ActPanel, self, nil, "lm_pAct") | |
defineGUIPanel(g_aGuiDefinitions.ModDescriptionContentPanel, self, nil, "lm_pLiveContent") | |
g_cAuroraSettings.m_bIsLiveModLoaded = false | |
self.lm_nGameDifficulty = 0 | |
g_pClientExoApp:SetMainMenuPanelActive(true) | |
g_pGuiMan.lm_pInGameNewSystemPanel = CGuiNewSystemPanel:new() | |
g_pGuiMan.lm_pInGameNewSystemPanel:ToggleOff() | |
self.lm_tPanels = {} | |
self.lm_tPanels[1] = {Panel = self.lm_pGame, Active = g_cAuroraSettings.m_bEnableLiveContentPanels} | |
self.lm_tPanels[2] = {Panel = self.lm_pLive, Active = false} | |
self.lm_tPanels[3] = {Panel = self.lm_pDifficulty, Active = true} | |
self.lm_tPanels[4] = {Panel = self.lm_pControls, Active = true} | |
self.lm_tPanels[5] = {Panel = self.lm_pAct, Active = self:isDebugMode()} | |
self.lm_nMaxPanels = 5 | |
g_pModFileManager = nil | |
self.lm_funcRunGame = function() | |
end | |
self.lm_pLive.lm_sLastModImage = "ui_main_livewlf" | |
self.lm_pLiveDescViewport = self.lm_pLive.m_Controls.ModDescriptionViewport | |
self.lm_pLiveDescViewport:SetContentPanel(self.lm_pLiveContent, 1) | |
self.lm_pLiveDescViewport:DetachContentPanel() | |
self.lm_pLiveContent.lm_pLabel = self.lm_pLiveContent.m_Controls.Label | |
self.lm_pLiveModListData = {} | |
self.lm_nSelectedModID = nil | |
self:OnPostAttachmentInitialize() | |
self.lm_nActivePanel = 0 | |
print("CMainMenuPanel constructor called") | |
print(self) | |
return self | |
end | |
CMainMenuPanel.isDebugMode = function(self) | |
return g_cAuroraSettings.m_nDebugMode ~= 0 | |
end | |
CMainMenuPanel.setIsLive = function(self, bIsLive) | |
self.lm_tPanels[2].Active = not bIsLive | |
self.lm_tPanels[5].Active = false | |
do break end | |
self.lm_tPanels[2].Active = false | |
self.lm_tPanels[5].Active = self:isDebugMode() | |
end | |
CMainMenuPanel.delete = function(self) | |
self.lm_nActivePanel = 0 | |
self.lm_tPanels = nil | |
g_pGuiMan.lm_pInGameNewSystemPanel:delete() | |
g_pGuiMan.lm_pInGameNewSystemPanel = nil | |
if g_pModFileManager then | |
g_pModFileManager:delete() | |
g_pModFileManager = nil | |
end | |
self.lm_pLive.CustomToggleOff = nil | |
self.lm_pLive.CustomUnToggleOff = nil | |
CLuaPanel.delete(self) | |
g_pMainMenuPanel = nil | |
self.lm_pPanel = nil | |
self.lm_pDifficulty = nil | |
self.lm_pControls = nil | |
self.lm_pAct = nil | |
self.lm_pGame = nil | |
self.lm_pLive = nil | |
g_pClientExoApp:SetMainMenuPanelActive(false) | |
end | |
getNewVersionInfo = function() | |
local _, _, a, b, c, d = string.find(g_pClientExoApp:GetBuildNumber(), ".+(%d)%.(%d)%.(%d)%.(%d).+") | |
if not a or not b or not c or not d then | |
return "~" | |
end | |
local myVer = a .. "." .. b .. "." .. c .. "." .. d | |
local sFile = "\\\\wiedzmin\\wiedzmin.devtools\\currentbuild.txt" | |
local f = io.open(sFile) | |
if f == nil then | |
return "" | |
end | |
local l = f:read("*l") | |
--[[ DECOMPILER ERROR 618: overwrote pending register! ]] | |
end | |
StopMenuEnvironmentSound = function(bDelete) | |
if g_pClientExoApp and GetExoSound() then | |
if g_pClientExoApp.lm_pMenuEnvironmentSound then | |
g_pClientExoApp.lm_pMenuEnvironmentSound:Stop() | |
if bDelete then | |
g_pClientExoApp.lm_pMenuEnvironmentSound:delete() | |
end | |
end | |
if bDelete then | |
g_pClientExoApp.lm_pMenuEnvironmentSound = nil | |
end | |
end | |
end | |
StartMenuEnvironmentSound = function() | |
if g_pClientExoApp then | |
g_pClientExoApp.lm_pMenuEnvironmentSound = CExoSoundSource:new("menu-ambient-l", SST_SOUND) | |
do | |
local nSoundVolume = g_pClientExoApp:GetSoundVolume() | |
g_pClientExoApp.lm_pMenuEnvironmentSound:SetVolume(nSoundVolume) | |
g_pClientExoApp.lm_pMenuEnvironmentSound:SetLooping() | |
local ret = g_pClientExoApp.lm_pMenuEnvironmentSound:Play() | |
end | |
if ret > 0 then | |
end | |
end | |
end | |
CMainMenuPanel.OnPostAttachmentInitialize = function(self) | |
CDefineGUIPanel:DoResizeGui() | |
self.lm_bInitialized = self.lm_bInitialized | |
if g_pClientExoApp.lm_pMenuEnvironmentSound then | |
g_pClientExoApp.lm_pMenuEnvironmentSound:delete() | |
end | |
StartMenuEnvironmentSound() | |
self.lm_pPanel.m_Controls.NewGame.OnClick = function() | |
self:SwitchToNextPanel() | |
end | |
self.lm_pPanel.m_Controls.Options.OnClick = function() | |
g_pGuiMan.lm_pInGameNewSystemPanel:TogglePanel() | |
g_pGuiMan.lm_pInGameNewSystemPanel:SwitchContentPanel("OptionsPanel") | |
g_pGuiMan.lm_pInGameNewSystemPanel.lm_pSettingsPanel:ToggleButtonSelect("SettingsGameplayButton") | |
g_pGuiMan.lm_pInGameNewSystemPanel.lm_pSettingsPanel:SetType("Gameplay") | |
end | |
self.lm_pPanel.m_Controls.LoadGame.OnClick = function() | |
g_pGuiMan.lm_pInGameNewSystemPanel:TogglePanel() | |
g_pGuiMan.lm_pInGameNewSystemPanel:SwitchContentPanel("LoadSavePanel") | |
g_pGuiMan.lm_pInGameNewSystemPanel.lm_pInGameNewSystemLoadPanel:SetType("LOAD") | |
g_GuiLayoutManager:PerformButtonAction("LoadButton") | |
end | |
self.lm_pPanel.m_Controls.Credits.OnClick = function() | |
PlayCredits() | |
end | |
self.lm_pPanel.m_Controls.Exit.OnClick = function() | |
_ExitProgram() | |
end | |
self.lm_pDifficulty:ToggleOff() | |
self.lm_pDifficulty.m_Controls.Exit.OnClick = function() | |
self:SwitchToPrevPanel() | |
end | |
self.lm_pDifficulty.m_Controls.EaseLabel.OnClick = function() | |
self.lm_nGameDifficulty = 0 | |
self:SwitchToNextPanel() | |
end | |
self.lm_pDifficulty.m_Controls.MediumLabel.OnClick = function() | |
self.lm_nGameDifficulty = 1 | |
self:SwitchToNextPanel() | |
end | |
self.lm_pDifficulty.m_Controls.HardLabel.OnClick = function() | |
self.lm_nGameDifficulty = 2 | |
self:SwitchToNextPanel() | |
end | |
self.lm_pDifficulty.m_Controls.Easy.OnHilight = function() | |
self.lm_pDifficulty.m_Controls.EaseLabel:OnMouseEnter() | |
end | |
self.lm_pDifficulty.m_Controls.Medium.OnHilight = function() | |
self.lm_pDifficulty.m_Controls.MediumLabel:OnMouseEnter() | |
end | |
self.lm_pDifficulty.m_Controls.Hard.OnHilight = function() | |
self.lm_pDifficulty.m_Controls.HardLabel:OnMouseEnter() | |
end | |
self.lm_pDifficulty.m_Controls.Easy.OnUnhilight = function() | |
self.lm_pDifficulty.m_Controls.EaseLabel:OnMouseLeave() | |
end | |
self.lm_pDifficulty.m_Controls.Medium.OnUnhilight = function() | |
self.lm_pDifficulty.m_Controls.MediumLabel:OnMouseLeave() | |
end | |
self.lm_pDifficulty.m_Controls.Hard.OnUnhilight = function() | |
self.lm_pDifficulty.m_Controls.HardLabel:OnMouseLeave() | |
end | |
self.lm_pDifficulty.m_Controls.Easy:SetHighliteOverrideObject(self.lm_pDifficulty.m_Controls.EaseLabel) | |
self.lm_pDifficulty.m_Controls.Easy.OnLMouseDown = function() | |
self.lm_pDifficulty.m_Controls.EaseLabel:OnLMouseDown() | |
end | |
self.lm_pDifficulty.m_Controls.Easy.OnLMouseUp = function() | |
self.lm_pDifficulty.m_Controls.EaseLabel:OnLMouseUp() | |
end | |
self.lm_pDifficulty.m_Controls.Medium:SetHighliteOverrideObject(self.lm_pDifficulty.m_Controls.MediumLabel) | |
self.lm_pDifficulty.m_Controls.Medium.OnLMouseDown = function() | |
self.lm_pDifficulty.m_Controls.MediumLabel:OnLMouseDown() | |
end | |
self.lm_pDifficulty.m_Controls.Medium.OnLMouseUp = function() | |
self.lm_pDifficulty.m_Controls.MediumLabel:OnLMouseUp() | |
end | |
self.lm_pDifficulty.m_Controls.Hard:SetHighliteOverrideObject(self.lm_pDifficulty.m_Controls.HardLabel) | |
self.lm_pDifficulty.m_Controls.Hard.OnLMouseDown = function() | |
self.lm_pDifficulty.m_Controls.HardLabel:OnLMouseDown() | |
end | |
self.lm_pDifficulty.m_Controls.Hard.OnLMouseUp = function() | |
self.lm_pDifficulty.m_Controls.HardLabel:OnLMouseUp() | |
end | |
self.lm_pControls:ToggleOff() | |
self.lm_pControls.m_Controls.Exit.OnClick = function() | |
self:SwitchToPrevPanel() | |
end | |
self.lm_pControls.m_Controls.MouseLabel.OnClick = function() | |
g_cAuroraSettings.m_nCameraMode = 0 | |
self:SwitchToNextPanel() | |
end | |
self.lm_pControls.m_Controls.KeyLabel.OnClick = function() | |
g_cAuroraSettings.m_nCameraMode = 2 | |
self:SwitchToNextPanel() | |
end | |
self.lm_pControls.m_Controls.Mouse.OnHilight = function() | |
self.lm_pControls.m_Controls.MouseLabel:OnMouseEnter() | |
end | |
self.lm_pControls.m_Controls.Key.OnHilight = function() | |
self.lm_pControls.m_Controls.KeyLabel:OnMouseEnter() | |
end | |
self.lm_pControls.m_Controls.Mouse.OnUnhilight = function() | |
self.lm_pControls.m_Controls.MouseLabel:OnMouseLeave() | |
end | |
self.lm_pControls.m_Controls.Key.OnUnhilight = function() | |
self.lm_pControls.m_Controls.KeyLabel:OnMouseLeave() | |
end | |
self.lm_pControls.m_Controls.Mouse:SetHighliteOverrideObject(self.lm_pControls.m_Controls.MouseLabel) | |
self.lm_pControls.m_Controls.Mouse.OnLMouseDown = function() | |
self.lm_pControls.m_Controls.MouseLabel:OnLMouseDown() | |
end | |
self.lm_pControls.m_Controls.Mouse.OnLMouseUp = function() | |
self.lm_pControls.m_Controls.MouseLabel:OnLMouseUp() | |
end | |
self.lm_pControls.m_Controls.Key:SetHighliteOverrideObject(self.lm_pControls.m_Controls.KeyLabel) | |
self.lm_pControls.m_Controls.Key.OnLMouseDown = function() | |
self.lm_pControls.m_Controls.KeyLabel:OnLMouseDown() | |
end | |
self.lm_pControls.m_Controls.Key.OnLMouseUp = function() | |
self.lm_pControls.m_Controls.KeyLabel:OnLMouseUp() | |
end | |
self.lm_pGame:ToggleOff() | |
self.lm_pGame.m_Controls.Exit.OnClick = function() | |
self:SwitchToPrevPanel() | |
end | |
self.lm_pGame.m_Controls.WitcherLabel.OnClick = function() | |
self:setIsLive(false) | |
self:SwitchToNextPanel() | |
if not self:isDebugMode() then | |
self.lm_funcRunGame = function() | |
g_pClientExoApp:LaunchGame("thewitcher", "Prolog", "kaer_morhen") | |
end | |
end | |
end | |
self.lm_pGame.m_Controls.LiveLabel.OnClick = function() | |
self:setIsLive(true) | |
self:SwitchToNextPanel() | |
if not g_pModFileManager then | |
g_pModFileManager = CGameModFileManager:new() | |
g_pModFileManager:SendAllModInfosToLua() | |
end | |
end | |
self.lm_pGame.m_Controls.Witcher.OnHilight = function() | |
self.lm_pGame.m_Controls.WitcherLabel:OnMouseEnter() | |
end | |
self.lm_pGame.m_Controls.Live.OnHilight = function() | |
self.lm_pGame.m_Controls.LiveLabel:OnMouseEnter() | |
end | |
self.lm_pGame.m_Controls.Witcher.OnUnhilight = function() | |
self.lm_pGame.m_Controls.WitcherLabel:OnMouseLeave() | |
end | |
self.lm_pGame.m_Controls.Live.OnUnhilight = function() | |
self.lm_pGame.m_Controls.LiveLabel:OnMouseLeave() | |
end | |
self.lm_pGame.m_Controls.Witcher:SetHighliteOverrideObject(self.lm_pGame.m_Controls.WitcherLabel) | |
self.lm_pGame.m_Controls.Witcher.OnLMouseDown = function() | |
self.lm_pGame.m_Controls.WitcherLabel:OnLMouseDown() | |
end | |
self.lm_pGame.m_Controls.Witcher.OnLMouseUp = function() | |
self.lm_pGame.m_Controls.WitcherLabel:OnLMouseUp() | |
end | |
self.lm_pGame.m_Controls.Live:SetHighliteOverrideObject(self.lm_pGame.m_Controls.LiveLabel) | |
self.lm_pGame.m_Controls.Live.OnLMouseDown = function() | |
self.lm_pGame.m_Controls.LiveLabel:OnLMouseDown() | |
end | |
self.lm_pGame.m_Controls.Live.OnLMouseUp = function() | |
self.lm_pGame.m_Controls.LiveLabel:OnLMouseUp() | |
end | |
self.lm_pLive:ToggleOff() | |
self.lm_pLive.m_Controls.Exit.OnClick = function() | |
self.lm_pLive.m_Controls.ModList:ToggleOff() | |
self:SwitchToPrevPanel() | |
self:setIsLive(false) | |
end | |
self.lm_pLive.m_Controls.BeginLabel:DisableButton() | |
self.lm_pLive.m_Controls.BeginLabel.OnClick = function() | |
self:OnLoadAdventure() | |
end | |
self.lm_pLive.CustomToggleOff = function() | |
self.lm_pLive.m_Controls.ModImage:SwitchTexture("Image", g_pMainMenuPanel.lm_pLive.lm_sLastModImage, "ui_main_livewlf") | |
self.lm_pLive.lm_sLastModImage = "ui_main_livewlf" | |
self.lm_pLiveContent.lm_pLabel:ChangeText("") | |
self.lm_pLiveDescViewport:DetachContentPanel() | |
self.lm_pLive:ToggleOff() | |
self.lm_pLive.m_Controls.ModList:OnItemClicked(self.lm_pLive.m_Controls.ModList) | |
self.lm_pLive.m_Controls.ModList:ToggleOff() | |
end | |
self.lm_pLive.CustomUnToggleOff = function() | |
self.lm_pLive:UnToggleOff() | |
self.lm_pLive.m_Controls.ModList:UnToggleOff() | |
end | |
self.lm_pLive.m_Controls.ModList:SetItemClickHandler(self.OnLiveContentListItemClick) | |
self.lm_pLive.m_Controls.ModList:ToggleOff() | |
self.lm_pLive.m_Controls.ModList:Clear() | |
self.lm_pAct:ToggleOff() | |
self.lm_pAct.m_Controls.Exit.OnClick = function() | |
self:SwitchToPrevPanel() | |
end | |
self.lm_pAct.m_Controls.Prolog.OnClick = function() | |
self.lm_funcRunGame = function() | |
g_pClientExoApp:LaunchGame("thewitcher", "Prolog", "kaer_morhen") | |
end | |
self:SwitchToNextPanel() | |
end | |
self.lm_pAct.m_Controls.Akt1.OnClick = function() | |
self.lm_funcRunGame = function() | |
g_pClientExoApp:LaunchGame("thewitcher", "Act_1", "outskirts_1") | |
end | |
self:SwitchToNextPanel() | |
end | |
self.lm_pAct.m_Controls.Akt2.OnClick = function() | |
self.lm_funcRunGame = function() | |
g_pClientExoApp:LaunchGame("thewitcher", "Act_2", "wyzimpoor_1") | |
end | |
self:SwitchToNextPanel() | |
end | |
self.lm_pAct.m_Controls.Akt3.OnClick = function() | |
self.lm_funcRunGame = function() | |
g_pClientExoApp:LaunchGame("thewitcher", "Act_3", "wyzimrich_3") | |
end | |
self:SwitchToNextPanel() | |
end | |
self.lm_pAct.m_Controls.Akt4.OnClick = function() | |
self.lm_funcRunGame = function() | |
g_pClientExoApp:LaunchGame("thewitcher", "Act_4", "village_4") | |
end | |
self:SwitchToNextPanel() | |
end | |
self.lm_pAct.m_Controls.Akt5.OnClick = function() | |
self.lm_funcRunGame = function() | |
g_pClientExoApp:LaunchGame("thewitcher", "Act_5", "wyzimold_5") | |
end | |
self:SwitchToNextPanel() | |
end | |
self.lm_pAct.m_Controls.Epilog.OnClick = function() | |
self.lm_funcRunGame = function() | |
g_pClientExoApp:LaunchGame("thewitcher", "Epilog", "wyzimburn") | |
end | |
self:SwitchToNextPanel() | |
end | |
self.lm_pPanel.m_Controls.Kruki:TriggerEffect() | |
end | |
CMainMenuPanel.AddModToLiveContentPanel = function(self, nID, tModData) | |
local sText = "" | |
if tModData.m_szModName and tModData.m_szModName ~= "EMPTY" then | |
sText = tModData.m_szModName | |
else | |
sText = tModData.m_szModFileName | |
end | |
table.insert(self.lm_pLiveModListData, tModData) | |
self.lm_pLive.m_Controls.ModList:AddListItem(nID + 1, sText) | |
end | |
CMainMenuPanel.OnLoadAdventure = function(self) | |
self:OnLiveContentListItemClick(self.lm_nSelectedModID, 1) | |
end | |
CMainMenuPanel.OnLiveContentListItemClick = function(self, nItem, bDoubleClick) | |
g_pMainMenuPanel.lm_nSelectedModID = nItem | |
if not nItem then | |
g_pMainMenuPanel.lm_pLive.m_Controls.BeginLabel:DisableButton() | |
return | |
else | |
g_pMainMenuPanel.lm_pLive.m_Controls.BeginLabel:EnableButton() | |
end | |
local nID = nItem - 1 | |
if bDoubleClick == 1 then | |
g_pMainMenuPanel.lm_funcRunGame = function() | |
g_pModFileManager:LaunchMod(nID) | |
end | |
g_pMainMenuPanel:SwitchToNextPanel() | |
else | |
local tModData = g_pMainMenuPanel.lm_pLiveModListData[nItem] | |
local tModName = "" | |
local tModDesc = "" | |
if tModData.m_szModName and tModData.m_szModName ~= "EMPTY" then | |
tModName = tModData.m_szModName | |
else | |
tModName = tModData.m_szModFileName | |
end | |
if tModData.m_szModDescription and tModData.m_szModDescription ~= "EMPTY" then | |
tModDesc = tModData.m_szModDescription | |
else | |
tModDesc = "[TEMP] No Description" | |
end | |
if g_pModFileManager:RequestModPicture(nID, g_pMainMenuPanel.lm_pLive.m_Controls.ModImage, g_pMainMenuPanel.lm_pLive.lm_sLastModImage) then | |
g_pMainMenuPanel.lm_pLive.lm_sLastModImage = "MODULE_IMAGE" | |
else | |
g_pMainMenuPanel.lm_pLive.m_Controls.ModImage:SwitchTexture("Image", g_pMainMenuPanel.lm_pLive.lm_sLastModImage, "ui_main_livedef") | |
g_pMainMenuPanel.lm_pLive.lm_sLastModImage = "ui_main_livedef" | |
end | |
g_pMainMenuPanel.lm_pLiveDescViewport:DetachContentPanel() | |
g_pMainMenuPanel.lm_pLiveContent.lm_pLabel:ChangeText(tModDesc) | |
local fTextHeight = g_pMainMenuPanel.lm_pLiveContent.lm_pLabel:GetTextDimensions().y + 10 | |
g_pMainMenuPanel.lm_pLiveDescViewport:SetContentPanel(g_pMainMenuPanel.lm_pLiveContent, fTextHeight) | |
end | |
end | |
CMainMenuPanel.SwitchToNextPanel = function(self) | |
if self.lm_nActivePanel ~= 0 then | |
if self.lm_tPanels[self.lm_nActivePanel].Panel.CustomToggleOff then | |
self.lm_tPanels[self.lm_nActivePanel].Panel:CustomToggleOff() | |
else | |
self.lm_tPanels[self.lm_nActivePanel].Panel:ToggleOff() | |
end | |
end | |
self.lm_nActivePanel = self.lm_nActivePanel + 1 | |
while self.lm_tPanels[self.lm_nActivePanel].Active == not self.lm_tPanels[self.lm_nActivePanel] do | |
self.lm_nActivePanel = self.lm_nActivePanel + 1 | |
end | |
print(self.lm_nActivePanel) | |
if self.lm_tPanels[self.lm_nActivePanel] then | |
if self.lm_tPanels[self.lm_nActivePanel].Panel.CustomUnToggleOff then | |
self.lm_tPanels[self.lm_nActivePanel].Panel:CustomUnToggleOff() | |
else | |
self.lm_tPanels[self.lm_nActivePanel].Panel:UnToggleOff() | |
end | |
end | |
if self.lm_nMaxPanels < self.lm_nActivePanel then | |
self:SetUpNewGame() | |
end | |
end | |
CMainMenuPanel.SwitchToPrevPanel = function(self) | |
if self.lm_tPanels[self.lm_nActivePanel].Panel.CustomToggleOff then | |
self.lm_tPanels[self.lm_nActivePanel].Panel:CustomToggleOff() | |
else | |
self.lm_tPanels[self.lm_nActivePanel].Panel:ToggleOff() | |
end | |
self.lm_nActivePanel = self.lm_nActivePanel - 1 | |
if self.lm_nActivePanel ~= 0 then | |
while self.lm_tPanels[self.lm_nActivePanel].Active == false do | |
self.lm_nActivePanel = self.lm_nActivePanel - 1 | |
if self.lm_nActivePanel == 0 then | |
return | |
end | |
end | |
if self.lm_tPanels[self.lm_nActivePanel].Panel.CustomUnToggleOff then | |
self.lm_tPanels[self.lm_nActivePanel].Panel:CustomUnToggleOff() | |
else | |
self.lm_tPanels[self.lm_nActivePanel].Panel:UnToggleOff() | |
end | |
end | |
end | |
CMainMenuPanel.OnEscapeKey = function(self) | |
self:SwitchToPrevPanel() | |
end | |
CMainMenuPanel.SetUpNewGame = function(self) | |
CHardwareDependantSettingsManager:Instance():GetSetting("CGameDifficultySetting"):SetValue(self.lm_nGameDifficulty, nil) | |
CHardwareDependantSettingsManager:Instance():GetSetting("CGameDifficultySetting"):ApplyChanges() | |
CHardwareDependantSettingsManager:Instance():GetSetting("CDefaultCameraModeSetting"):SetValue(g_cAuroraSettings.m_nCameraMode, nil) | |
CHardwareDependantSettingsManager:Instance():GetSetting("CDefaultCameraModeSetting"):ApplyChanges() | |
CHardwareDependantSettingsManager:Instance():WriteSettings() | |
self:lm_funcRunGame() | |
end | |
_ExitProgram = function() | |
PlayGuiSound("gui_quit", 0) | |
if g_pMainMenuPanel then | |
print("Deleting...") | |
g_pMainMenuPanel.lm_pPanel:Deactivate() | |
g_pMainMenuPanel:delete() | |
g_pMainMenuPanel = nil | |
end | |
StopMenuEnvironmentSound(not g_pClientExoApp) | |
getDjinni():SetGameFullscreen(not runUnderDjinni() or not getDjinni() or not getDjinni():GetGameFullscreen()) | |
g_pClientExoApp:ExitProgram(0) | |
end | |
CMainMenuPanel.OnHilite = function(self, pObjecT) | |
PlayGuiSound("gui_light-on", 0) | |
end | |
CMainMenuPanel.OnUpdate = function(self, fTimeDelta) | |
self.lm_bOnUpdateResult = true | |
end | |
reloadMM = function() | |
unloadMM() | |
createMainManuPanel() | |
end | |
unloadMM = function() | |
print("UnloadMM") | |
if g_pMainMenuPanel then | |
g_pMainMenuPanel.lm_pPanel:Deactivate() | |
g_pMainMenuPanel:delete() | |
g_pMainMenuPanel = nil | |
end | |
g_bMainMenuActive = false | |
end | |
createMainMenuPanel = function() | |
print("CreateMM") | |
g_bMainMenuActive = true | |
if not g_pMainMenuPanel then | |
g_pMainMenuPanel = CMainMenuPanel:new() | |
end | |
end | |
IsMainMenuActive = function() | |
return g_bMainMenuActive | |
end | |
_SetPitch = function(fPitch) | |
g_pMainMenuPanel.lm_SceneViewer.lm_fPitch = fPitch | |
end | |
_SetYaw = function(fYaw) | |
g_pMainMenuPanel.lm_SceneViewer.lm_fYaw = fYaw | |
end | |
_SetCamPos = function(PosX, PosY, PosZ) | |
local newX, newY, newZ = nil, nil, nil | |
if PosX == -1 then | |
newX = g_pMainMenuPanel.lm_SceneViewer.lm_vCameraPos.x | |
else | |
newX = PosX | |
end | |
if PosY == -1 then | |
newY = g_pMainMenuPanel.lm_SceneViewer.lm_vCameraPos.y | |
else | |
newY = PosY | |
end | |
if PosZ == -1 then | |
newZ = g_pMainMenuPanel.lm_SceneViewer.lm_vCameraPos.z | |
else | |
newZ = PosZ | |
end | |
g_pMainMenuPanel.lm_SceneViewer.lm_vCameraPos:Set(newX, newY, newZ) | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment