mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-07 13:49:33 -05:00
Settings: add option to disable fog
This commit is contained in:
parent
b2b40e3c60
commit
2302f416de
@ -16,6 +16,7 @@
|
||||
|
||||
## Table of Contents
|
||||
* [General](#general)
|
||||
* [Settings](#settings)
|
||||
* [HUD](#hud)
|
||||
* [Players](#players)
|
||||
* [Zombies](#zombies)
|
||||
@ -160,14 +161,16 @@
|
||||
* [Encounter Pro](#encounter-pro)
|
||||
|
||||
## General
|
||||
* Removed 5 second wait before match start
|
||||
* Removed fog
|
||||
* Removed round cap
|
||||
* Removed 5 second wait before match start
|
||||
* Disabled depth of field
|
||||
* Increased level of detail at longer distances
|
||||
* Announcer audio always plays
|
||||
* In-game menu no longer disabled instantly when the game ends
|
||||
|
||||
## Settings
|
||||
* Added option to disable fog
|
||||
|
||||
## HUD
|
||||
* Enemy counter displayed on top left of screen
|
||||
* Timer displayed on top right of screen
|
||||
|
@ -76,6 +76,15 @@ LANG_ENGLISH "Griefs"
|
||||
REFERENCE MPUI_KILLS_DENIED
|
||||
LANG_ENGLISH "Stuns"
|
||||
|
||||
REFERENCE MENU_MOD_CAPS
|
||||
LANG_ENGLISH "MOD"
|
||||
|
||||
REFERENCE MENU_FOG_CAPS
|
||||
LANG_ENGLISH "FOG"
|
||||
|
||||
REFERENCE MENU_FOG_DESC
|
||||
LANG_ENGLISH "Enable or disable fog."
|
||||
|
||||
REFERENCE MENU_MELEE_WEAPON_CAPS
|
||||
LANG_ENGLISH "MELEE WEAPON"
|
||||
|
||||
|
@ -184,10 +184,14 @@ init()
|
||||
|
||||
precache_strings()
|
||||
{
|
||||
precacheString(&"set_dvar_from_dvar");
|
||||
precacheString(&"hud_update_health");
|
||||
precacheString(&"hud_update_zone_fade_out");
|
||||
precacheString(&"hud_update_zone_fade_in");
|
||||
|
||||
precacheString(&"r_fog");
|
||||
precacheString(&"r_fog_settings");
|
||||
|
||||
foreach (zone_name in level.zone_keys)
|
||||
{
|
||||
precacheString(istring(toupper(level.script + "_" + zone_name)));
|
||||
@ -603,7 +607,7 @@ set_dvars()
|
||||
setDvar("riotshield_projectile_damage_scale", 1);
|
||||
setDvar("riotshield_deployed_health", 1500);
|
||||
|
||||
setDvar("r_fog", 0);
|
||||
setDvar("r_fog", getDvar("r_fog_settings"));
|
||||
|
||||
setDvar("sv_voice", 2);
|
||||
setDvar("sv_voiceQuality", 9);
|
||||
@ -622,6 +626,9 @@ set_dvars()
|
||||
|
||||
set_client_dvars()
|
||||
{
|
||||
// set client dvars in lua that can't be set in gsc/csc
|
||||
self luinotifyevent(&"set_dvar_from_dvar", 2, &"r_fog", &"r_fog_settings");
|
||||
|
||||
self setClientDvar("player_lastStandBleedoutTime", getDvarInt("player_lastStandBleedoutTime"));
|
||||
|
||||
self setClientDvar("dtp_post_move_pause", getDvarInt("dtp_post_move_pause"));
|
||||
@ -654,8 +661,6 @@ set_client_dvars()
|
||||
self setClientDvar("waypointPlayerOffsetStand", 30);
|
||||
self setClientDvar("waypointPlayerOffsetCrouch", 30);
|
||||
|
||||
self setClientDvar("r_fog", 0);
|
||||
|
||||
self setClientDvar("r_dof_enable", 0);
|
||||
self setClientDvar("r_lodBiasRigid", -1000);
|
||||
self setClientDvar("r_lodBiasSkinned", -1000);
|
||||
|
752
ui/t6/menus/optionssettings.lua
Normal file
752
ui/t6/menus/optionssettings.lua
Normal file
@ -0,0 +1,752 @@
|
||||
require("T6.menus.safeareamenu")
|
||||
|
||||
CoD.OptionsSettings = {}
|
||||
CoD.OptionsSettings.CurrentTabIndex = 1
|
||||
CoD.OptionsSettings.NeedVidRestart = false
|
||||
CoD.OptionsSettings.NeedPicmip = false
|
||||
CoD.OptionsSettings.NeedSndRestart = false
|
||||
CoD.OptionsSettings.ResetRestartFlags = function()
|
||||
CoD.OptionsSettings.NeedVidRestart = false
|
||||
CoD.OptionsSettings.NeedPicmip = false
|
||||
CoD.OptionsSettings.NeedSndRestart = false
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.LeaveApplyPopup_DeclineApply = function(f2_arg0, ClientInstance)
|
||||
f2_arg0:setPreviousMenu("OptionsMenu")
|
||||
CoD.OptionsSettings.ResetRestartFlags()
|
||||
f2_arg0:goBack(ClientInstance.controller)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.ApplyPopup_DeclineApply = function(f3_arg0, ClientInstance)
|
||||
CoD.OptionsSettings.ResetRestartFlags()
|
||||
f3_arg0:goBack(ClientInstance.controller)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.ApplyPopup_ApplyChanges = function(f4_arg0, ClientInstance)
|
||||
CoD.OptionsSettings.ApplyChanges()
|
||||
f4_arg0:goBack(ClientInstance.controller)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Back = function(f5_arg0, ClientInstance)
|
||||
if CoD.OptionsSettings.NeedVidRestart or CoD.OptionsSettings.NeedPicmip or CoD.OptionsSettings.NeedSndRestart then
|
||||
local f5_local0 = f5_arg0:openMenu("LeaveApplyConfirmPopup", ClientInstance.controller)
|
||||
f5_local0:registerEventHandler("confirm_action", CoD.OptionsSettings.ApplyPopup_ApplyChanges)
|
||||
f5_local0:registerEventHandler("decline_action", CoD.OptionsSettings.LeaveApplyPopup_DeclineApply)
|
||||
f5_arg0:close()
|
||||
else
|
||||
CoD.Options.UpdateWindowPosition()
|
||||
Engine.Exec(ClientInstance.controller, "updategamerprofile")
|
||||
Engine.SaveHardwareProfile()
|
||||
Engine.ApplyHardwareProfileSettings()
|
||||
f5_arg0:goBack(ClientInstance.controller)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.TabChanged = function(OptionsSettingsWidget, SettingsTab)
|
||||
OptionsSettingsWidget.buttonList = OptionsSettingsWidget.tabManager.buttonList
|
||||
local NextFocusableTab = OptionsSettingsWidget.buttonList:getFirstChild()
|
||||
while not NextFocusableTab.m_focusable do
|
||||
NextFocusableTab = NextFocusableTab:getNextSibling()
|
||||
end
|
||||
if NextFocusableTab ~= nil then
|
||||
NextFocusableTab:processEvent({
|
||||
name = "gain_focus",
|
||||
})
|
||||
end
|
||||
CoD.OptionsSettings.CurrentTabIndex = SettingsTab.tabIndex
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.SelectorChanged = function(OptionsMenuTab, SelectorChangedEventTable)
|
||||
if SelectorChangedEventTable.userRequested ~= true then
|
||||
return
|
||||
end
|
||||
local SelectorChoices = OptionsMenuTab.buttonList.m_selectors
|
||||
local SelectorChanged = SelectorChangedEventTable.selector
|
||||
local OptionChanged = SelectorChanged.m_profileVarName
|
||||
if OptionChanged == "r_fullscreen" and SelectorChoices.r_monitor ~= nil and SelectorChoices.r_mode ~= nil then
|
||||
local FullscreenMode = SelectorChanged:getCurrentValue()
|
||||
local MonitorChoices = SelectorChoices.r_monitor
|
||||
local DisplayResolutionChoices = SelectorChoices.r_mode
|
||||
if FullscreenMode == "0" then
|
||||
MonitorChoices:setChoice(0)
|
||||
MonitorChoices:disableSelector()
|
||||
DisplayResolutionChoices:enableSelector()
|
||||
elseif FullscreenMode == "2" then
|
||||
MonitorChoices:enableSelector()
|
||||
DisplayResolutionChoices:disableSelector()
|
||||
else
|
||||
MonitorChoices:enableSelector()
|
||||
DisplayResolutionChoices:enableSelector()
|
||||
end
|
||||
end
|
||||
if OptionChanged == "r_vsync" and SelectorChoices.com_maxfps ~= nil then
|
||||
local MaxFPSSelector = SelectorChoices.com_maxfps
|
||||
if SelectorChanged:getCurrentValue() == "1" then
|
||||
MaxFPSSelector:setChoice(0)
|
||||
MaxFPSSelector:disableSelector()
|
||||
else
|
||||
MaxFPSSelector:enableSelector()
|
||||
end
|
||||
end
|
||||
if OptionChanged == "r_monitor" and SelectorChoices.r_mode ~= nil then
|
||||
CoD.OptionsSettings.Button_AddChoices_Resolution(SelectorChoices.r_mode)
|
||||
end
|
||||
if OptionChanged == "r_fullscreen" or OptionChanged == "r_mode" or OptionChanged == "r_aaSamples" or OptionChanged == "r_monitor" or OptionChanged == "r_texFilterQuality" then
|
||||
CoD.OptionsSettings.NeedVidRestart = true
|
||||
OptionsMenuTab:addApplyPrompt()
|
||||
end
|
||||
if OptionChanged == "r_picmip" then
|
||||
CoD.OptionsSettings.NeedPicmip = true
|
||||
OptionsMenuTab:addApplyPrompt()
|
||||
end
|
||||
if OptionChanged == "sd_xa2_device_name" then
|
||||
CoD.OptionsSettings.NeedSndRestart = true
|
||||
OptionsMenuTab:addApplyPrompt()
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.ResolutionChanged = function(OptionsMenuTab, ClientInstance)
|
||||
CoD.OptionsSettings.RefreshMenu(OptionsMenuTab)
|
||||
CoD.Menu.ResolutionChanged(OptionsMenuTab, ClientInstance)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.OpenBrightness = function(f9_arg0, ClientInstance)
|
||||
f9_arg0:saveState()
|
||||
f9_arg0:openMenu("Brightness", ClientInstance.controller)
|
||||
f9_arg0:close()
|
||||
CoD.OptionsSettings.DoNotSyncProfile = true
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.OpenApplyPopup = function(f11_arg0, ClientInstance)
|
||||
local f11_local0 = f11_arg0:openMenu("ApplyChangesPopup", ClientInstance.controller)
|
||||
f11_local0:registerEventHandler("confirm_action", CoD.OptionsSettings.ApplyPopup_ApplyChanges)
|
||||
f11_local0:registerEventHandler("decline_action", CoD.OptionsSettings.ApplyPopup_DeclineApply)
|
||||
f11_arg0:close()
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.OpenDefaultPopup = function(f12_arg0, ClientInstance)
|
||||
local f12_local0 = f12_arg0:openMenu("SetDefaultPopup", ClientInstance.controller)
|
||||
f12_local0:registerEventHandler("confirm_action", CoD.OptionsSettings.DefaultPopup_RestoreDefaultSettings)
|
||||
f12_local0:registerEventHandler("decline_action", CoD.OptionsSettings.DefaultPopup_Decline)
|
||||
f12_arg0:close()
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.ApplyChanges = function()
|
||||
CoD.Options.UpdateWindowPosition()
|
||||
Engine.SaveHardwareProfile()
|
||||
Engine.ApplyHardwareProfileSettings()
|
||||
if CoD.OptionsSettings.NeedPicmip then
|
||||
Engine.Exec(nil, "r_applyPicmip")
|
||||
end
|
||||
if CoD.OptionsSettings.NeedVidRestart then
|
||||
Engine.Exec(nil, "vid_restart")
|
||||
end
|
||||
if CoD.OptionsSettings.NeedSndRestart then
|
||||
Engine.Exec(nil, "snd_restart")
|
||||
end
|
||||
CoD.OptionsSettings.ResetRestartFlags()
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.ResetSoundToDefault = function(LocalClientIndex)
|
||||
Engine.SetProfileVar(LocalClientIndex, "snd_menu_voice", 1)
|
||||
Engine.SetProfileVar(LocalClientIndex, "snd_menu_music", 1)
|
||||
Engine.SetProfileVar(LocalClientIndex, "snd_menu_sfx", 1)
|
||||
Engine.SetProfileVar(LocalClientIndex, "snd_menu_master", 1)
|
||||
Engine.SetProfileVar(LocalClientIndex, "snd_shoutcast_game", 0.25)
|
||||
Engine.SetProfileVar(LocalClientIndex, "snd_shoutcast_voip", 1)
|
||||
Engine.SetProfileVar(LocalClientIndex, "snd_menu_headphones", 0)
|
||||
Engine.SetProfileVar(LocalClientIndex, "snd_menu_hearing_impaired", 0)
|
||||
Engine.SetProfileVar(LocalClientIndex, "snd_menu_presets", CoD.AudioSettings.TREYARCH_MIX)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.ResetGameToDefault = function(LocalClientIndex)
|
||||
Engine.SetProfileVar(LocalClientIndex, "team_indicator", 0)
|
||||
Engine.SetProfileVar(LocalClientIndex, "colorblind_assist", 0)
|
||||
Engine.SetHardwareProfileValue("cg_drawLagometer", 0)
|
||||
Engine.SetProfileVar(LocalClientIndex, "safeAreaTweakable_vertical", 1)
|
||||
Engine.SetProfileVar(LocalClientIndex, "safeAreaTweakable_horizontal", 1)
|
||||
Engine.SetProfileVar(LocalClientIndex, "r_gamma", 0.9)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.ResetDvars = function(LocalClientIndex)
|
||||
Engine.Exec(LocalClientIndex, "reset r_fullscreen")
|
||||
Engine.Exec(LocalClientIndex, "reset r_vsync")
|
||||
Engine.Exec(LocalClientIndex, "reset r_picmip_manual")
|
||||
Engine.Exec(LocalClientIndex, "reset r_dofHDR")
|
||||
Engine.Exec(LocalClientIndex, "reset cg_chatHeight")
|
||||
Engine.Exec(LocalClientIndex, "reset cg_fov_default")
|
||||
Engine.Exec(LocalClientIndex, "reset cg_fovscale")
|
||||
Engine.Exec(LocalClientIndex, "reset com_maxfps")
|
||||
Engine.Exec(LocalClientIndex, "reset cg_drawFPS")
|
||||
Engine.SetDvar("sd_xa2_device_name", 0)
|
||||
Engine.SetDvar("sd_xa2_device_guid", 0)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.DefaultPopup_RestoreDefaultSettings = function(f17_arg0, ClientInstance)
|
||||
CoD.OptionsSettings.ResetDvars(ClientInstance.controller)
|
||||
Engine.ResetHardwareProfileSettings(ClientInstance.controller)
|
||||
Engine.Exec(ClientInstance.controller, "r_applyPicmip")
|
||||
Engine.Exec(ClientInstance.controller, "vid_restart")
|
||||
Engine.Exec(ClientInstance.controller, "snd_restart")
|
||||
CoD.OptionsSettings.ResetSoundToDefault(ClientInstance.controller)
|
||||
CoD.OptionsSettings.ResetGameToDefault(ClientInstance.controller)
|
||||
Engine.SaveHardwareProfile()
|
||||
f17_arg0:goBack(ClientInstance.controller)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_ApplyDvarChanged = function(Button)
|
||||
Engine.SetDvar(Button.parentSelectorButton.m_dvarName, Button.value)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.DefaultPopup_Decline = function(f18_arg0, ClientInstance)
|
||||
CoD.OptionsSettings.DoNotSyncProfile = true
|
||||
f18_arg0:goBack(ClientInstance.controller)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.RefreshMenu = function(OptionsMenuTab)
|
||||
Engine.SyncHardwareProfileWithDvars()
|
||||
OptionsMenuTab:dispatchEventToChildren({
|
||||
name = "refresh_choice",
|
||||
})
|
||||
local SelectorChoices = OptionsMenuTab.buttonList.m_selectors
|
||||
local SelectorChoicesTextureQuality = SelectorChoices.r_picmip
|
||||
if Engine.GetHardwareProfileValueAsString("r_picmip_manual") == "0" and SelectorChoicesTextureQuality ~= nil then
|
||||
SelectorChoicesTextureQuality:setChoice(-1)
|
||||
end
|
||||
local SelectorChoicesShadows = SelectorChoices.sm_spotQuality
|
||||
if Engine.GetHardwareProfileValueAsString("sm_enable") == "0" and SelectorChoicesShadows ~= nil then
|
||||
SelectorChoicesShadows:setChoice(-1)
|
||||
end
|
||||
local SelectorChoicesAntiAliasing = SelectorChoices.r_aaSamples
|
||||
if SelectorChoicesAntiAliasing ~= nil then
|
||||
CoD.OptionsSettings.AdjustAntiAliasingSettings(SelectorChoicesAntiAliasing)
|
||||
end
|
||||
local SelectorChoicesResolution = SelectorChoices.r_mode
|
||||
if SelectorChoicesResolution then
|
||||
CoD.OptionsSettings.Button_AddChoices_Resolution(SelectorChoicesResolution)
|
||||
end
|
||||
local FullscreenMode = Engine.GetHardwareProfileValueAsString("r_fullscreen")
|
||||
local SelectorChoicesMonitors = SelectorChoices.r_monitor
|
||||
local SelectorChoicesResolution = SelectorChoices.r_mode
|
||||
if SelectorChoicesMonitors and SelectorChoicesResolution then
|
||||
if FullscreenMode == "0" then
|
||||
SelectorChoicesMonitors:setChoice(0)
|
||||
SelectorChoicesMonitors:disableSelector()
|
||||
SelectorChoicesResolution:enableSelector()
|
||||
elseif FullscreenMode == "2" then
|
||||
SelectorChoicesMonitors:enableSelector()
|
||||
SelectorChoicesResolution:disableSelector()
|
||||
else
|
||||
SelectorChoicesMonitors:enableSelector()
|
||||
SelectorChoicesResolution:enableSelector()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.DisableOptionsInGame = function(Options)
|
||||
for Key, GraphicsSetting in ipairs({
|
||||
"r_mode",
|
||||
"r_fullscreen",
|
||||
"r_monitor",
|
||||
"r_aaSamples",
|
||||
"r_texFilterQuality",
|
||||
"r_picmip",
|
||||
}) do
|
||||
if Options[GraphicsSetting] then
|
||||
Options[GraphicsSetting]:disableSelector()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_Resolution = function(DisplayResolutionChoices)
|
||||
local ResolutionChoices = nil
|
||||
DisplayResolutionChoices:clearChoices()
|
||||
if Dvar.r_fullscreen:get() == 0 then
|
||||
for Key, DisplayResolutionChoice in ipairs(Dvar.r_mode:getDomainEnumStrings()) do
|
||||
DisplayResolutionChoices:addChoice(DisplayResolutionChoice, DisplayResolutionChoice)
|
||||
end
|
||||
else
|
||||
local MonitorIndex = Engine.GetHardwareProfileValueAsString("r_monitor")
|
||||
if tonumber(MonitorIndex) > Dvar.r_monitorCount:get() then
|
||||
MonitorIndex = "0"
|
||||
end
|
||||
if MonitorIndex == "0" then
|
||||
ResolutionChoices = Dvar.r_mode:getDomainEnumStrings()
|
||||
else
|
||||
ResolutionChoices = Dvar["r_mode" .. MonitorIndex]:getDomainEnumStrings()
|
||||
end
|
||||
for Key, DisplayResolutionChoice in ipairs(ResolutionChoices) do
|
||||
DisplayResolutionChoices:addChoice(DisplayResolutionChoice, DisplayResolutionChoice)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_DisplayMode = function(DisplayModeChoices)
|
||||
DisplayModeChoices:addChoice(Engine.Localize("PLATFORM_WINDOWED"), 0)
|
||||
DisplayModeChoices:addChoice(Engine.Localize("MENU_FULLSCREEN"), 1)
|
||||
DisplayModeChoices:addChoice(Engine.Localize("PLATFORM_WINDOWED_FULLSCREEN"), 2)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.AdjustAntiAliasingSettings = function(AntiAliasingChoices)
|
||||
local AASamples = Engine.GetHardwareProfileValueAsString("r_aaSamples")
|
||||
if Dvar.r_txaaSupported:get() == true and Engine.GetHardwareProfileValueAsString("r_txaa") == "1" then
|
||||
if AASamples == "2" then
|
||||
AntiAliasingChoices:setChoice(17)
|
||||
elseif AASamples == "4" then
|
||||
AntiAliasingChoices:setChoice(18)
|
||||
end
|
||||
else
|
||||
Engine.SetHardwareProfile("r_txaa", 0)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.AntiAliasingChangeCallback = function(AntiAliasingChosen, f24_arg1)
|
||||
if f24_arg1 ~= true then
|
||||
return
|
||||
elseif AntiAliasingChosen.value <= 16 then
|
||||
Engine.SetHardwareProfileValue("r_aaSamples", AntiAliasingChosen.value)
|
||||
Engine.SetHardwareProfileValue("r_txaa", 0)
|
||||
elseif AntiAliasingChosen.value == 17 then
|
||||
Engine.SetHardwareProfileValue("r_aaSamples", 2)
|
||||
Engine.SetHardwareProfileValue("r_txaa", 1)
|
||||
Engine.SetHardwareProfileValue("r_fxaa", 0)
|
||||
elseif AntiAliasingChosen.value == 18 then
|
||||
Engine.SetHardwareProfileValue("r_aaSamples", 4)
|
||||
Engine.SetHardwareProfileValue("r_txaa", 1)
|
||||
Engine.SetHardwareProfileValue("r_fxaa", 0)
|
||||
else
|
||||
Engine.SetHardwareProfileValue("r_aaSamples", 1)
|
||||
Engine.SetHardwareProfileValue("r_txaa", 0)
|
||||
Engine.SetHardwareProfileValue("r_fxaa", 0)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_AntiAliasing = function(AntiAliasingChoices)
|
||||
AntiAliasingChoices:addChoice(Engine.Localize("MENU_OFF_CAPS"), 1, nil, CoD.OptionsSettings.AntiAliasingChangeCallback)
|
||||
AntiAliasingChoices:addChoice(Engine.Localize("PLATFORM_2X_MSAA_CAPS"), 2, nil, CoD.OptionsSettings.AntiAliasingChangeCallback)
|
||||
AntiAliasingChoices:addChoice(Engine.Localize("PLATFORM_4X_MSAA_CAPS"), 4, nil, CoD.OptionsSettings.AntiAliasingChangeCallback)
|
||||
AntiAliasingChoices:addChoice(Engine.Localize("PLATFORM_8X_MSAA_CAPS"), 8, nil, CoD.OptionsSettings.AntiAliasingChangeCallback)
|
||||
if Dvar.r_txaaSupported:get() == true then
|
||||
AntiAliasingChoices:addChoice(Engine.Localize("PLATFORM_2X_TXAA_CAPS"), 17, nil, CoD.OptionsSettings.AntiAliasingChangeCallback)
|
||||
AntiAliasingChoices:addChoice(Engine.Localize("PLATFORM_4X_TXAA_CAPS"), 18, nil, CoD.OptionsSettings.AntiAliasingChangeCallback)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_TextureFiltering = function(TextureFilteringChoices)
|
||||
TextureFilteringChoices:addChoice(Engine.Localize("PLATFORM_LOW_CAPS"), 0)
|
||||
TextureFilteringChoices:addChoice(Engine.Localize("PLATFORM_MEDIUM_CAPS"), 1)
|
||||
TextureFilteringChoices:addChoice(Engine.Localize("PLATFORM_HIGH_CAPS"), 2)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.TextureQualitySelectionChangeCallback = function(TextureQualityChosen, f27_arg1)
|
||||
if f27_arg1 ~= true then
|
||||
return
|
||||
elseif TextureQualityChosen.value == -1 then
|
||||
Engine.SetHardwareProfileValue("r_picmip_manual", 0)
|
||||
else
|
||||
Engine.SetHardwareProfileValue("r_picmip_manual", 1)
|
||||
Engine.SetHardwareProfileValue("r_picmip", TextureQualityChosen.value)
|
||||
Engine.SetHardwareProfileValue("r_picmip_bump", TextureQualityChosen.value)
|
||||
Engine.SetHardwareProfileValue("r_picmip_spec", TextureQualityChosen.value)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_TextureQuality = function(TextureQualityChoices)
|
||||
TextureQualityChoices:addChoice(Engine.Localize("MENU_AUTOMATIC_CAPS"), -1, nil, CoD.OptionsSettings.TextureQualitySelectionChangeCallback)
|
||||
TextureQualityChoices:addChoice(Engine.Localize("PLATFORM_LOW_CAPS"), 3, nil, CoD.OptionsSettings.TextureQualitySelectionChangeCallback)
|
||||
TextureQualityChoices:addChoice(Engine.Localize("MENU_NORMAL_CAPS"), 2, nil, CoD.OptionsSettings.TextureQualitySelectionChangeCallback)
|
||||
TextureQualityChoices:addChoice(Engine.Localize("PLATFORM_HIGH_CAPS"), 1, nil, CoD.OptionsSettings.TextureQualitySelectionChangeCallback)
|
||||
TextureQualityChoices:addChoice(Engine.Localize("MENU_EXTRA_CAPS"), 0, nil, CoD.OptionsSettings.TextureQualitySelectionChangeCallback)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.ShadowsChangeCallback = function(ShadowSettingChosen, f29_arg1)
|
||||
if f29_arg1 ~= true then
|
||||
return
|
||||
elseif ShadowSettingChosen.value == -1 then
|
||||
Engine.SetHardwareProfileValue("sm_enable", 0)
|
||||
Engine.SetHardwareProfileValue("sm_spotQuality", 0)
|
||||
Engine.SetHardwareProfileValue("sm_sunQuality", 0)
|
||||
else
|
||||
Engine.SetHardwareProfileValue("sm_enable", 1)
|
||||
Engine.SetHardwareProfileValue("sm_spotQuality", ShadowSettingChosen.value)
|
||||
Engine.SetHardwareProfileValue("sm_sunQuality", ShadowSettingChosen.value)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_Shadows = function(ShadowChoices)
|
||||
ShadowChoices:addChoice(Engine.Localize("MENU_OFF_CAPS"), -1, nil, CoD.OptionsSettings.ShadowsChangeCallback)
|
||||
ShadowChoices:addChoice(Engine.Localize("PLATFORM_LOW_CAPS"), 0, nil, CoD.OptionsSettings.ShadowsChangeCallback)
|
||||
ShadowChoices:addChoice(Engine.Localize("PLATFORM_MEDIUM_CAPS"), 1, nil, CoD.OptionsSettings.ShadowsChangeCallback)
|
||||
ShadowChoices:addChoice(Engine.Localize("PLATFORM_HIGH_CAPS"), 2, nil, CoD.OptionsSettings.ShadowsChangeCallback)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_PlayerNameIndicator_SelectionChanged = function(PlayerNameIndicatorChoice)
|
||||
Engine.SetProfileVar(PlayerNameIndicatorChoice.parentSelectorButton.m_currentController, PlayerNameIndicatorChoice.parentSelectorButton.m_profileVarName, PlayerNameIndicatorChoice.value)
|
||||
PlayerNameIndicatorChoice.parentSelectorButton.hintText = PlayerNameIndicatorChoice.extraParams.associatedHintText
|
||||
local f31_local0 = PlayerNameIndicatorChoice.parentSelectorButton:getParent()
|
||||
if f31_local0 ~= nil and f31_local0.hintText ~= nil then
|
||||
f31_local0.hintText:updateText(PlayerNameIndicatorChoice.parentSelectorButton.hintText)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_PlayerNameIndicator = function(PlayerNameIndicatorChoices)
|
||||
PlayerNameIndicatorChoices:addChoice(Engine.Localize("PLATFORM_INDICATOR_FULL_CAPS"), 0, {
|
||||
associatedHintText = Engine.Localize("PLATFORM_INDICATOR_FULL_DESC"),
|
||||
}, CoD.OptionsSettings.Button_PlayerNameIndicator_SelectionChanged)
|
||||
PlayerNameIndicatorChoices:addChoice(Engine.Localize("MENU_INDICATOR_ABBREVIATED_CAPS"), 1, {
|
||||
associatedHintText = Engine.Localize("PLATFORM_INDICATOR_ABBREVIATED_DESC"),
|
||||
}, CoD.OptionsSettings.Button_PlayerNameIndicator_SelectionChanged)
|
||||
PlayerNameIndicatorChoices:addChoice(Engine.Localize("MENU_INDICATOR_ICON_CAPS"), 2, {
|
||||
associatedHintText = Engine.Localize("MENU_INDICATOR_ICON_DESC"),
|
||||
}, CoD.OptionsSettings.Button_PlayerNameIndicator_SelectionChanged)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_ChatHeight = function(ChatHeightChoices)
|
||||
ChatHeightChoices:addChoice(Engine.Localize("MENU_SHOW_CAPS"), 8)
|
||||
ChatHeightChoices:addChoice(Engine.Localize("MENU_HIDE_CAPS"), 0)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_SoundDevices = function(SoundDeviceChoices)
|
||||
for Key, SoundDeviceFullName in ipairs(Dvar.sd_xa2_device_name:getDomainEnumStrings()) do
|
||||
local SoundDeviceOption = SoundDeviceFullName
|
||||
if string.len(SoundDeviceFullName) > 32 then
|
||||
SoundDeviceOption = string.sub(SoundDeviceFullName, 1, 32) .. "..."
|
||||
end
|
||||
SoundDeviceChoices:addChoice(SoundDeviceOption, SoundDeviceFullName)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_Monitor = function(MonitorChoices)
|
||||
local MonitorCount = Dvar.r_monitorCount:get()
|
||||
for MonitorOption = 1, MonitorCount, 1 do
|
||||
MonitorChoices:addChoice(MonitorOption, MonitorOption)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_MaxCorpses = function(MaxCorpsesChoices)
|
||||
MaxCorpsesChoices:addChoice(Engine.Localize("MENU_TINY"), 3)
|
||||
MaxCorpsesChoices:addChoice(Engine.Localize("MENU_SMALL"), 5)
|
||||
MaxCorpsesChoices:addChoice(Engine.Localize("MENU_MEDIUM"), 10)
|
||||
MaxCorpsesChoices:addChoice(Engine.Localize("MENU_LARGE"), 16)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.DrawFPSCallback = function(FPSDisplayed, f37_arg1)
|
||||
if f37_arg1 ~= true then
|
||||
return
|
||||
else
|
||||
Engine.SetDvar("cg_drawFPS", FPSDisplayed.value)
|
||||
Engine.SetHardwareProfileValue("cg_drawFPS", FPSDisplayed.value)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_DrawFPS = function(DrawFPSToggle)
|
||||
DrawFPSToggle:addChoice(Engine.Localize("MENU_NO_CAPS"), "Off", nil, CoD.OptionsSettings.DrawFPSCallback)
|
||||
DrawFPSToggle:addChoice(Engine.Localize("MENU_YES_CAPS"), "Simple", nil, CoD.OptionsSettings.DrawFPSCallback)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.StreamerModeCallback = function(StreamerModeEnabled, client)
|
||||
if client then
|
||||
Engine.SetHardwareProfileValue(StreamerModeEnabled.parentSelectorButton.m_profileVarName, StreamerModeEnabled.value)
|
||||
if StreamerModeEnabled.value == 1 then
|
||||
Dvar.cl_enableStreamerMode:set(true)
|
||||
else
|
||||
Dvar.cl_enableStreamerMode:set(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_StreamerMode = function(StreamerModeToggle)
|
||||
if UIExpression.DvarBool(nil, "cl_enableStreamerMode") == 0 then
|
||||
StreamerModeToggle:addChoice(Engine.Localize("MENU_DISABLED_CAPS"), 0, nil, CoD.OptionsSettings.StreamerModeCallback)
|
||||
StreamerModeToggle:addChoice(Engine.Localize("MENU_ENABLED_CAPS"), 1, nil, CoD.OptionsSettings.StreamerModeCallback)
|
||||
else
|
||||
StreamerModeToggle:addChoice(Engine.Localize("MENU_ENABLED_CAPS"), 1, nil, CoD.OptionsSettings.StreamerModeCallback)
|
||||
StreamerModeToggle:addChoice(Engine.Localize("MENU_DISABLED_CAPS"), 0, nil, CoD.OptionsSettings.StreamerModeCallback)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.VoiceChatCallback = function(VoiceValue, f37_arg1)
|
||||
if f37_arg1 ~= true then
|
||||
return
|
||||
else
|
||||
Engine.SetDvar("cl_voice", VoiceValue.value)
|
||||
Engine.SetHardwareProfileValue("cl_voice", VoiceValue.value)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_VoiceChat = function(DrawFPSToggle)
|
||||
DrawFPSToggle:addChoice(Engine.Localize("MENU_NO_CAPS"), "0", nil, CoD.OptionsSettings.VoiceChatCallback)
|
||||
DrawFPSToggle:addChoice(Engine.Localize("MENU_YES_CAPS"), "1", nil, CoD.OptionsSettings.VoiceChatCallback)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_DepthOfField = function(DOFChoices)
|
||||
DOFChoices:addChoice(Engine.Localize("PLATFORM_LOW_CAPS"), 0)
|
||||
DOFChoices:addChoice(Engine.Localize("PLATFORM_MEDIUM_CAPS"), 1)
|
||||
DOFChoices:addChoice(Engine.Localize("PLATFORM_HIGH_CAPS"), 2)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_MaxFPS = function(MaxFPSChoices)
|
||||
MaxFPSChoices:addChoice(Engine.Localize("MENU_UNLIMITED"), 0)
|
||||
MaxFPSChoices:addChoice("30", 30)
|
||||
MaxFPSChoices:addChoice("45", 45)
|
||||
MaxFPSChoices:addChoice("60", 60)
|
||||
MaxFPSChoices:addChoice("90", 90)
|
||||
MaxFPSChoices:addChoice("120", 120)
|
||||
MaxFPSChoices:addChoice("200", 200)
|
||||
end
|
||||
|
||||
local SaveSliderChanges = function(f1_arg0, f1_arg1)
|
||||
Engine.SetDvar(f1_arg0.m_dvarName, f1_arg1)
|
||||
Engine.SetHardwareProfileValue(f1_arg0.m_dvarName, f1_arg1)
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.DvarLeftRightSlidernew = function(LocalClientIndex, f2_arg1, DvarName, f2_arg3, f2_arg4, f2_arg5, f2_arg6)
|
||||
local f2_local0 = tonumber(UIExpression.DvarString(nil, DvarName))
|
||||
local LeftRightSlider = CoD.LeftRightSlider.new(f2_arg1, f2_arg5, nil, f2_local0, f2_arg3, f2_arg4, f2_arg6)
|
||||
LeftRightSlider.m_dvarName = DvarName
|
||||
LeftRightSlider.m_currentValue = f2_local0
|
||||
LeftRightSlider.m_currentController = LocalClientIndex
|
||||
LeftRightSlider:setSliderCallback(SaveSliderChanges)
|
||||
return LeftRightSlider
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.AddDvarLeftRightSlider = function(ParentElement, LocalClientIndex, f19_arg2, DvarName, f19_arg4, f19_arg5, HintText, f19_arg7, f19_arg8)
|
||||
local CustomDvarLeftRightSlider = CoD.OptionsSettings.DvarLeftRightSlidernew(LocalClientIndex, f19_arg2, DvarName, f19_arg4, f19_arg5, f19_arg7, {
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
left = 0,
|
||||
right = 0,
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
top = 0,
|
||||
bottom = CoD.CoD9Button.Height,
|
||||
})
|
||||
CustomDvarLeftRightSlider.hintText = HintText
|
||||
CustomDvarLeftRightSlider:setPriority(f19_arg8)
|
||||
ParentElement:addElement(CustomDvarLeftRightSlider)
|
||||
CoD.ButtonList.AssociateHintTextListenerToButton(CustomDvarLeftRightSlider)
|
||||
if ParentElement.buttonBackingAnimationState then
|
||||
CustomDvarLeftRightSlider:addBackground(ParentElement.buttonBackingAnimationState)
|
||||
end
|
||||
return CustomDvarLeftRightSlider
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.CreateGraphicsTab = function(GraphicsTab, LocalClientIndex)
|
||||
local GraphicsTabContainer = LUI.UIContainer.new()
|
||||
local GraphicsTabButtonList = CoD.Options.CreateButtonList()
|
||||
GraphicsTab.buttonList = GraphicsTabButtonList
|
||||
GraphicsTabContainer:addElement(GraphicsTabButtonList)
|
||||
|
||||
local DisplayResolutionChoices = GraphicsTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("PLATFORM_VIDEO_MODE_CAPS"), "r_mode", Engine.Localize("PLATFORM_VIDEO_MODE_DESC"))
|
||||
CoD.OptionsSettings.Button_AddChoices_Resolution(DisplayResolutionChoices)
|
||||
|
||||
local DisplayModeChoices = GraphicsTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("PLATFORM_DISPLAY_MODE_CAPS"), "r_fullscreen", Engine.Localize("PLATFORM_DISPLAY_MODE_DESC"))
|
||||
CoD.OptionsSettings.Button_AddChoices_DisplayMode(DisplayModeChoices)
|
||||
if DisplayModeChoices:getCurrentValue() == "2" then
|
||||
DisplayResolutionChoices:disableSelector()
|
||||
end
|
||||
|
||||
local MonitorUsedChoices = GraphicsTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("PLATFORM_MONITOR_CAPS"), "r_monitor", Engine.Localize("PLATFORM_MONITOR_DESC"))
|
||||
CoD.OptionsSettings.Button_AddChoices_Monitor(MonitorUsedChoices)
|
||||
if DisplayModeChoices:getCurrentValue() == "0" then
|
||||
MonitorUsedChoices:setChoice(0)
|
||||
MonitorUsedChoices:disableSelector()
|
||||
end
|
||||
GraphicsTabButtonList:addSpacer(CoD.CoD9Button.Height / 2)
|
||||
|
||||
local BrightnessChoices = GraphicsTabButtonList:addButton(Engine.Localize("MENU_BRIGHTNESS_CAPS"), Engine.Localize("PLATFORM_BRIGHTNESS_DESC"))
|
||||
BrightnessChoices:setActionEventName("open_brightness")
|
||||
|
||||
local FOVSlider = CoD.OptionsSettings.AddDvarLeftRightSlider(GraphicsTabButtonList, LocalClientIndex, Engine.Localize("PLATFORM_FIELD_OF_VIEW_CAPS"), "cg_fov_default", 65, 120, Engine.Localize("PLATFORM_FOV_DESC"))
|
||||
FOVSlider:setNumericDisplayFormatString("%d")
|
||||
|
||||
local FOVScaleSlider = GraphicsTabButtonList:addDvarLeftRightSlider(LocalClientIndex, Engine.Localize("FOV SCALE"), "cg_fovscale", 0.5, 2, Engine.Localize("Scale applied to the field of view."))
|
||||
FOVScaleSlider:setNumericDisplayFormatString("%.2f")
|
||||
FOVScaleSlider:setRoundToFraction(0.05)
|
||||
FOVScaleSlider:setBarSpeed(0.01)
|
||||
|
||||
local FOVSensitivity = GraphicsTabButtonList:addDvarLeftRightSelector(LocalClientIndex, Engine.Localize("FOV SENSITIVITY"), "cg_usefovsensitivity", Engine.Localize("When enabled, your sensitivity is scaled based on your fovScale"))
|
||||
FOVSensitivity:addChoice(LocalClientIndex, Engine.Localize("MENU_DISABLED_CAPS"), 0, nil, CoD.OptionsSettings.Button_ApplyDvarChanged)
|
||||
FOVSensitivity:addChoice(LocalClientIndex, Engine.Localize("MENU_ENABLED_CAPS"), 1, nil, CoD.OptionsSettings.Button_ApplyDvarChanged)
|
||||
|
||||
GraphicsTabButtonList:addSpacer(CoD.CoD9Button.Height / 2)
|
||||
local ShadowChoices = GraphicsTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("MENU_SHADOWS_CAPS"), "sm_spotQuality", Engine.Localize("PLATFORM_SHADOWS_DESC"))
|
||||
CoD.OptionsSettings.Button_AddChoices_Shadows(ShadowChoices)
|
||||
if Engine.GetHardwareProfileValueAsString("sm_enable") == "0" then
|
||||
ShadowChoices:setChoice(-1)
|
||||
end
|
||||
|
||||
CoD.Options.Button_AddChoices_EnabledOrDisabled(GraphicsTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("PLATFORM_RAGDOLL_CAPS"), "ragdoll_enable", Engine.Localize("PLATFORM_RAGDOLL_DESC")))
|
||||
GraphicsTabButtonList:addSpacer(CoD.CoD9Button.Height / 2)
|
||||
CoD.OptionsSettings.Button_AddChoices_PlayerNameIndicator(GraphicsTabButtonList:addProfileLeftRightSelector(LocalClientIndex, Engine.Localize("MENU_TEAM_INDICATOR_CAPS"), "team_indicator", ""))
|
||||
CoD.Options.Button_AddChoices_OnOrOff(GraphicsTabButtonList:addProfileLeftRightSelector(LocalClientIndex, Engine.Localize("MENU_COLOR_BLIND_ASSIST_CAPS"), "colorblind_assist", Engine.Localize("MENU_COLOR_BLIND_ASSIST_DESC")))
|
||||
CoD.OptionsSettings.Button_AddChoices_ChatHeight(GraphicsTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("PLATFORM_CHATMESSAGES_CAPS"), "cg_chatHeight", Engine.Localize("PLATFORM_CHATMESSAGES_DESC")))
|
||||
return GraphicsTabContainer
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.CreateAdvancedTab = function(AdvancedTab, LocalClientIndex)
|
||||
local AdvancedTabContainer = LUI.UIContainer.new()
|
||||
local InGame = UIExpression.IsInGame() == 1
|
||||
local AdvancedTabButtonList = CoD.Options.CreateButtonList()
|
||||
AdvancedTab.buttonList = AdvancedTabButtonList
|
||||
AdvancedTabContainer.buttonList = AdvancedTabButtonList
|
||||
AdvancedTabContainer:addElement(AdvancedTabButtonList)
|
||||
local TextureQualityChoices = AdvancedTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("MENU_TEXTURE_QUALITY_CAPS"), "r_picmip", Engine.Localize("PLATFORM_TEXTURE_QUALITY_DESC"))
|
||||
CoD.OptionsSettings.Button_AddChoices_TextureQuality(TextureQualityChoices)
|
||||
if Engine.GetHardwareProfileValueAsString("r_picmip_manual") == "0" then
|
||||
TextureQualityChoices:setChoice(-1)
|
||||
end
|
||||
if InGame and CoD.isMultiplayer then
|
||||
TextureQualityChoices:disableSelector()
|
||||
end
|
||||
CoD.OptionsSettings.Button_AddChoices_TextureFiltering(AdvancedTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("MENU_TEXTURE_MIPMAPS_CAPS"), "r_texFilterQuality", Engine.Localize("PLATFORM_TEXTURE_FILTERING_DESC")))
|
||||
local AntiAliasingChoices = AdvancedTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("MENU_ANTIALIASING_CAPS"), "r_aaSamples", Engine.Localize("PLATFORM_ANTIALIASING_DESC"))
|
||||
CoD.OptionsSettings.Button_AddChoices_AntiAliasing(AntiAliasingChoices)
|
||||
CoD.OptionsSettings.AdjustAntiAliasingSettings(AntiAliasingChoices)
|
||||
CoD.Options.Button_AddChoices_YesOrNo(AdvancedTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("PLATFORM_FXAA_CAPS"), "r_fxaa", Engine.Localize("PLATFORM_FXAA_DESC")))
|
||||
CoD.Options.Button_AddChoices_OnOrOff(AdvancedTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("PLATFORM_AMBIENT_OCCLUSION_CAPS"), "r_ssao", Engine.Localize("PLATFORM_AMBIENT_OCCLUSION_DESC")))
|
||||
CoD.OptionsSettings.Button_AddChoices_DepthOfField(AdvancedTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("PLATFORM_DEPTH_OF_FIELD_CAPS"), "r_dofHDR", Engine.Localize("PLATFORM_DEPTH_OF_FIELD_DESC")))
|
||||
AdvancedTabButtonList:addSpacer(CoD.CoD9Button.Height / 2)
|
||||
AdvancedTabButtonList:addSpacer(CoD.CoD9Button.Height / 2)
|
||||
CoD.Options.Button_AddChoices_YesOrNo(AdvancedTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("MENU_SYNC_EVERY_FRAME_CAPS"), "r_vsync", Engine.Localize("PLATFORM_VSYNC_DESC")))
|
||||
local MaxFpsChoices = AdvancedTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("PLATFORM_MAX_FPS_CAPS"), "com_maxfps", Engine.Localize("PLATFORM_MAX_FPS_DESC"))
|
||||
CoD.OptionsSettings.Button_AddChoices_MaxFPS(MaxFpsChoices)
|
||||
if Engine.GetHardwareProfileValueAsString("r_vsync") == "1" then
|
||||
MaxFpsChoices:setChoice(0)
|
||||
MaxFpsChoices:disableSelector()
|
||||
end
|
||||
CoD.OptionsSettings.Button_AddChoices_DrawFPS(AdvancedTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("PLATFORM_DRAW_FPS_CAPS"), "cg_drawFPS", Engine.Localize("PLATFORM_DRAW_FPS_DESC")))
|
||||
AdvancedTabButtonList:addSpacer(CoD.CoD9Button.Height / 2)
|
||||
|
||||
CoD.OptionsSettings.Button_AddChoices_StreamerMode(AdvancedTabButtonList:addHardwareProfileLeftRightSelector("STREAMER MODE", "cl_enableStreamerMode", "Hides important networking and player information"))
|
||||
AdvancedTabButtonList:addSpacer(CoD.CoD9Button.Height / 2)
|
||||
|
||||
local SafeAreaButton = AdvancedTabButtonList:addButton(Engine.Localize("MENU_SAFE_AREA_ADJUSTMENT_CAPS"), Engine.Localize("Edit the HUD safearea."))
|
||||
SafeAreaButton:setActionEventName("open_safe_area")
|
||||
|
||||
return AdvancedTabContainer
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.CreateModTab = function(ModTab, LocalClientIndex)
|
||||
local ModTabContainer = LUI.UIContainer.new()
|
||||
local InGame = UIExpression.IsInGame() == 1
|
||||
local ModTabButtonList = CoD.Options.CreateButtonList()
|
||||
ModTab.buttonList = ModTabButtonList
|
||||
ModTabContainer.buttonList = ModTabButtonList
|
||||
ModTabContainer:addElement(ModTabButtonList)
|
||||
|
||||
local FogSelector = ModTabButtonList:addDvarLeftRightSelector(LocalClientIndex, Engine.Localize("MENU_FOG_CAPS"), "r_fog_settings", Engine.Localize("MENU_FOG_DESC"))
|
||||
FogSelector:addChoice(LocalClientIndex, Engine.Localize("MENU_DISABLED_CAPS"), 0, nil, CoD.OptionsSettings.Button_ApplyDvarChangedFog)
|
||||
FogSelector:addChoice(LocalClientIndex, Engine.Localize("MENU_ENABLED_CAPS"), 1, nil, CoD.OptionsSettings.Button_ApplyDvarChangedFog)
|
||||
|
||||
return ModTabContainer
|
||||
end
|
||||
|
||||
-- need separate dvar to have the value of r_fog persist between sessions
|
||||
CoD.OptionsSettings.Button_ApplyDvarChangedFog = function(Button)
|
||||
CoD.OptionsSettings.Button_ApplyDvarChanged(Button)
|
||||
Engine.SetDvar("r_fog", UIExpression.DvarBool(nil, "r_fog_settings"))
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.CreateSoundTab = function(SoundTab, LocalClientIndex)
|
||||
local SoundTabContainer = LUI.UIContainer.new()
|
||||
local InGame = UIExpression.IsInGame() == 1
|
||||
local SoundTabButtonList = CoD.Options.CreateButtonList()
|
||||
SoundTab.buttonList = SoundTabButtonList
|
||||
SoundTabContainer:addElement(SoundTabButtonList)
|
||||
local VoiceVolumeSlider = SoundTabButtonList:addProfileLeftRightSlider(LocalClientIndex, Engine.Localize("MENU_VOICE_VOLUME_CAPS"), "snd_menu_voice", 0, 1, Engine.Localize("MENU_VOICE_VOLUME_DESC"), nil, nil, CoD.Options.AdjustSFX)
|
||||
local MusicVolumeSlider = SoundTabButtonList:addProfileLeftRightSlider(LocalClientIndex, Engine.Localize("MENU_MUSIC_VOLUME_CAPS"), "snd_menu_music", 0, 1, Engine.Localize("MENU_MUSIC_VOLUME_DESC"), nil, nil, CoD.Options.AdjustSFX)
|
||||
local SFXVolumeSlider = SoundTabButtonList:addProfileLeftRightSlider(LocalClientIndex, Engine.Localize("MENU_SFX_VOLUME_CAPS"), "snd_menu_sfx", 0, 1, Engine.Localize("MENU_SFX_VOLUME_DESC"), nil, nil, CoD.Options.AdjustSFX)
|
||||
local MasterVolumeSlider = SoundTabButtonList:addProfileLeftRightSlider(LocalClientIndex, Engine.Localize("MENU_MASTER_VOLUME_CAPS"), "snd_menu_master", 0, 1, Engine.Localize("MENU_MASTER_VOLUME_DESC"), nil, nil, CoD.Options.AdjustSFX)
|
||||
local CodCasterVolumeSlider = SoundTabButtonList:addProfileLeftRightSlider(LocalClientIndex, Engine.Localize("MENU_SHOUTCAST_GAME_VOLUME_CAPS"), "snd_shoutcast_game", 0, 2, Engine.Localize("MENU_SHOUTCAST_GAME_VOLUME_DESC"), nil, nil, CoD.Options.AdjustSFX)
|
||||
local CodCasterVOIPVolumeSlider = SoundTabButtonList:addProfileLeftRightSlider(LocalClientIndex, Engine.Localize("MENU_SHOUTCAST_VOIP_VOLUME_CAPS"), "snd_shoutcast_voip", 0, 2, Engine.Localize("MENU_SHOUTCAST_VOIP_VOLUME_DESC"), nil, nil, CoD.Options.AdjustSFX)
|
||||
SoundTabButtonList:addSpacer(CoD.CoD9Button.Height / 2)
|
||||
CoD.Options.Button_AddChoices_OnOrOff(SoundTabButtonList:addProfileLeftRightSelector(LocalClientIndex, Engine.Localize("MENU_HEARING_IMPAIRED_CAPS"), "snd_menu_hearing_impaired", Engine.Localize("MENU_HEARING_IMPAIRED_DESC")))
|
||||
if UIExpression.DvarBool(nil, "sd_can_switch_device") == 0 then
|
||||
else
|
||||
local SoundDeviceChoices = SoundTabButtonList:addHardwareProfileLeftRightSelector(Engine.Localize("PLATFORM_SOUND_DEVICE_CAPS"), "sd_xa2_device_name")
|
||||
CoD.OptionsSettings.Button_AddChoices_SoundDevices(SoundDeviceChoices)
|
||||
if Dvar.sd_xa2_num_devices:get() <= 1 or InGame then
|
||||
SoundDeviceChoices:disableSelector()
|
||||
end
|
||||
end
|
||||
SoundTabButtonList:addSpacer(CoD.CoD9Button.Height / 2)
|
||||
CoD.AudioSettings.Button_AudioPresets_AddChoices(SoundTabButtonList:addProfileLeftRightSelector(LocalClientIndex, Engine.Localize("MENU_AUDIO_PRESETS_CAPS"), "snd_menu_presets", "", nil, nil, CoD.AudioSettings.CycleSFX))
|
||||
if UIExpression.IsInGame() == 0 and not (UIExpression.IsDemoPlaying(LocalClientIndex) ~= 0) then
|
||||
local SoundSystemTest = SoundTabButtonList:addButton(Engine.Localize("MENU_SYSTEM_TEST_CAPS"), Engine.Localize("MENU_SYSTEM_TEST_DESC"))
|
||||
SoundSystemTest:registerEventHandler("button_action", CoD.AudioSettings.Button_SystemTestButton)
|
||||
end
|
||||
return SoundTabContainer
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.CreateVoiceChatTab = function(f44_arg0, f44_arg1)
|
||||
local f44_local0 = LUI.UIContainer.new()
|
||||
local f44_local1 = CoD.Options.CreateButtonList()
|
||||
f44_arg0.buttonList = f44_local1
|
||||
f44_local0:addElement(f44_local1)
|
||||
CoD.OptionsSettings.Button_AddChoices_VoiceChat(f44_local1:addHardwareProfileLeftRightSelector(Engine.Localize("MENU_VOICECHAT_CAPS"), "cl_voice", Engine.Localize("PLATFORM_VOICECHAT_DESC")))
|
||||
f44_local1:addSpacer(CoD.CoD9Button.Height / 2)
|
||||
local f44_local2 = f44_local1:addProfileLeftRightSlider(f44_arg1, Engine.Localize("PLATFORM_VOICECHAT_VOLUME"), "snd_voicechat_volume", 0, 1, Engine.Localize("PLATFORM_VOICECHAT_VOLUME_DESC"), nil, nil, CoD.Options.AdjustSFX)
|
||||
local f44_local3 = f44_local1:addProfileLeftRightSlider(f44_arg1, Engine.Localize("PLATFORM_VOICECHAT_RECORD_LEVEL"), "snd_voicechat_record_level", 0, 1, Engine.Localize("PLATFORM_VOICECHAT_RECORD_LEVEL_DESC"), nil, nil, CoD.Options.AdjustSFX)
|
||||
f44_local1:addSpacer(CoD.CoD9Button.Height / 2)
|
||||
local f44_local4 = f44_local1:addVoiceMeter(Engine.Localize("MENU_VOICECHAT_LEVEL_INDICATOR_CAPS"), Engine.Localize("PLATFORM_VOICEMETER_DESC"))
|
||||
return f44_local0
|
||||
end
|
||||
|
||||
LUI.createMenu.OptionsSettingsMenu = function(LocalClientIndex)
|
||||
local OptionsSettingsWidget = nil
|
||||
local InGame = UIExpression.IsInGame() == 1
|
||||
if InGame then
|
||||
OptionsSettingsWidget = CoD.InGameMenu.New("OptionsSettingsMenu", LocalClientIndex, Engine.Localize("MENU_SETTINGS_CAPS"))
|
||||
else
|
||||
OptionsSettingsWidget = CoD.Menu.New("OptionsSettingsMenu")
|
||||
OptionsSettingsWidget:addTitle(Engine.Localize("MENU_SETTINGS_CAPS"), LUI.Alignment.Center)
|
||||
OptionsSettingsWidget:addLargePopupBackground()
|
||||
end
|
||||
OptionsSettingsWidget.addApplyPrompt = CoD.Options.AddApplyPrompt
|
||||
OptionsSettingsWidget.addResetPrompt = CoD.Options.AddResetPrompt
|
||||
OptionsSettingsWidget:setPreviousMenu("OptionsMenu")
|
||||
OptionsSettingsWidget:setOwner(LocalClientIndex)
|
||||
OptionsSettingsWidget:registerEventHandler("add_apply_prompt", CoD.Options.AddApplyPrompt)
|
||||
OptionsSettingsWidget:registerEventHandler("button_prompt_back", CoD.OptionsSettings.Back)
|
||||
OptionsSettingsWidget:registerEventHandler("tab_changed", CoD.OptionsSettings.TabChanged)
|
||||
OptionsSettingsWidget:registerEventHandler("selector_changed", CoD.OptionsSettings.SelectorChanged)
|
||||
OptionsSettingsWidget:registerEventHandler("resolution_changed", CoD.OptionsSettings.ResolutionChanged)
|
||||
OptionsSettingsWidget:registerEventHandler("apply_changes", CoD.OptionsSettings.ApplyChanges)
|
||||
OptionsSettingsWidget:registerEventHandler("restore_default_settings", CoD.OptionsSettings.RestoreDefaultSettings)
|
||||
OptionsSettingsWidget:registerEventHandler("open_brightness", CoD.OptionsSettings.OpenBrightness)
|
||||
OptionsSettingsWidget:registerEventHandler("open_speaker_setup", CoD.AudioSettings.OpenSpeakerSetup)
|
||||
OptionsSettingsWidget:registerEventHandler("open_apply_popup", CoD.OptionsSettings.OpenApplyPopup)
|
||||
OptionsSettingsWidget:registerEventHandler("open_default_popup", CoD.OptionsSettings.OpenDefaultPopup)
|
||||
OptionsSettingsWidget:registerEventHandler("open_safe_area", CoD.OptionsSettings.OpenSafeArea)
|
||||
OptionsSettingsWidget:addSelectButton()
|
||||
OptionsSettingsWidget:addBackButton()
|
||||
if not InGame then
|
||||
OptionsSettingsWidget:addResetPrompt()
|
||||
end
|
||||
if CoD.OptionsSettings.NeedVidRestart or CoD.OptionsSettings.NeedPicmip or CoD.OptionsSettings.NeedSndRestart then
|
||||
OptionsSettingsWidget:addApplyPrompt()
|
||||
end
|
||||
if not CoD.OptionsSettings.DoNotSyncProfile then
|
||||
Engine.SyncHardwareProfileWithDvars()
|
||||
end
|
||||
CoD.OptionsSettings.DoNotSyncProfile = nil
|
||||
local SettingsTabs = CoD.Options.SetupTabManager(OptionsSettingsWidget, 600)
|
||||
SettingsTabs:addTab(LocalClientIndex, "MENU_GRAPHICS_CAPS", CoD.OptionsSettings.CreateGraphicsTab)
|
||||
SettingsTabs:addTab(LocalClientIndex, "MENU_ADVANCED_CAPS", CoD.OptionsSettings.CreateAdvancedTab)
|
||||
SettingsTabs:addTab(LocalClientIndex, "MENU_MOD_CAPS", CoD.OptionsSettings.CreateModTab)
|
||||
SettingsTabs:addTab(LocalClientIndex, "MENU_SOUND_CAPS", CoD.OptionsSettings.CreateSoundTab)
|
||||
SettingsTabs:addTab(LocalClientIndex, "MENU_VOICECHAT_CAPS", CoD.OptionsSettings.CreateVoiceChatTab)
|
||||
if CoD.OptionsSettings.CurrentTabIndex then
|
||||
SettingsTabs:loadTab(LocalClientIndex, CoD.OptionsSettings.CurrentTabIndex)
|
||||
else
|
||||
SettingsTabs:refreshTab(LocalClientIndex)
|
||||
end
|
||||
return OptionsSettingsWidget
|
||||
end
|
||||
|
||||
CoD.OptionsSettings.OpenSafeArea = function(OptionsSettingsWidget, ClientInstance)
|
||||
OptionsSettingsWidget:saveState()
|
||||
OptionsSettingsWidget:openMenu("SafeArea", ClientInstance.controller)
|
||||
OptionsSettingsWidget:close()
|
||||
end
|
@ -211,6 +211,14 @@ function HUD_SetupEventHandlers_Zombie(HUDWidget)
|
||||
CoD.Zombie.IsSurvivalUsingCIAModel = false
|
||||
HUDWidget:registerEventHandler("hud_update_survival_team", HUD_UpdateSurvivalTeamZombie)
|
||||
HUDWidget:registerEventHandler("allow_round_animation", HUD_AllowRoundAnimation)
|
||||
HUDWidget:registerEventHandler("set_dvar_from_dvar", HUD_SetDvarFromDvar)
|
||||
end
|
||||
|
||||
function HUD_SetDvarFromDvar(HUDWidget, ClientInstance)
|
||||
local setDvarKey = Engine.GetIString(ClientInstance.data[1], "CS_LOCALIZED_STRINGS")
|
||||
local getDvarKey = Engine.GetIString(ClientInstance.data[2], "CS_LOCALIZED_STRINGS")
|
||||
|
||||
Engine.SetDvar(setDvarKey, UIExpression.DvarInt(nil, getDvarKey))
|
||||
end
|
||||
|
||||
function HUD_AllowRoundAnimation(HUDWidget, ClientInstance)
|
||||
|
796
ui_mp/t6/mainmenu.lua
Normal file
796
ui_mp/t6/mainmenu.lua
Normal file
@ -0,0 +1,796 @@
|
||||
require("T6.MainLobby")
|
||||
require("T6.Menus.MOTD")
|
||||
if CoD.isWIIU then
|
||||
require("T6.Menus.InvalidAccountPopup")
|
||||
require("T6.WiiUControllerSettings")
|
||||
end
|
||||
if CoD.isZombie == false then
|
||||
require("T6.Menus.EliteRegistrationPopup")
|
||||
require("T6.Menus.EliteWelcomePopup")
|
||||
require("T6.Menus.EliteMarketingOptInPopup")
|
||||
require("T6.Menus.DLCPopup")
|
||||
require("T6.Menus.VotingPopup")
|
||||
require("T6.Menus.SPReminderPopup")
|
||||
require("T6.Menus.DSPPromotionPopup")
|
||||
end
|
||||
CoD.MainMenu = {}
|
||||
CoD.MainMenu.SystemLinkLastUsedButton = 0
|
||||
CoD.MainMenu.ShowStoreButtonEvent = function(MainMenuWidget, ClientInstance)
|
||||
if CoD.MainMenu.ShowStoreButton(ClientInstance.controller) == true and MainMenuWidget.ingameStoreButton == nil then
|
||||
CoD.MainMenu.AddStoreButton(MainMenuWidget)
|
||||
end
|
||||
end
|
||||
CoD.MainMenu.AddStoreButton = function(MainMenuWidget)
|
||||
MainMenuWidget.ingameStoreButton = MainMenuWidget.buttonList:addButton(Engine.Localize("MENU_INGAMESTORE"), nil, 5)
|
||||
MainMenuWidget.ingameStoreButton:setActionEventName("open_store")
|
||||
end
|
||||
|
||||
CoD.MainMenu.ShowStoreButton = function(LocalClientIndex)
|
||||
if not CoD.isPC and not CoD.isWIIU and UIExpression.IsFFOTDFetched(LocalClientIndex) == 1 and Dvar.ui_inGameStoreVisible:get() == true and (CoD.isPS3 ~= true or CoD.isZombie ~= true) then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.InitCustomDvars = function(LocalClientIndex)
|
||||
if UIExpression.DvarString(nil, "r_fog_settings") == "" then
|
||||
Engine.Exec(LocalClientIndex, "seta r_fog_settings 1")
|
||||
end
|
||||
end
|
||||
|
||||
LUI.createMenu.MainMenu = function(LocalClientIndex)
|
||||
CoD.MainMenu.InitCustomDvars(LocalClientIndex)
|
||||
|
||||
local MainMenuWidget = CoD.Menu.New("MainMenu")
|
||||
MainMenuWidget.anyControllerAllowed = true
|
||||
MainMenuWidget:registerEventHandler("open_main_lobby_requested", CoD.MainMenu.OpenMainLobbyRequested)
|
||||
MainMenuWidget:registerEventHandler("open_system_link_flyout", CoD.MainMenu.OpenSystemLinkFlyout)
|
||||
MainMenuWidget:registerEventHandler("open_system_link_lobby", CoD.MainMenu.OpenSystemLinkLobby)
|
||||
MainMenuWidget:registerEventHandler("open_server_browser", CoD.MainMenu.OpenServerBrowser)
|
||||
MainMenuWidget:registerEventHandler("open_local_match_lobby", CoD.MainMenu.OpenLocalMatchLobby)
|
||||
if CoD.isWIIU then
|
||||
MainMenuWidget:registerEventHandler("open_controls_menu", CoD.MainMenu.OpenControlsMenu)
|
||||
end
|
||||
MainMenuWidget:registerEventHandler("open_options_menu", CoD.MainMenu.OpenOptionsMenu)
|
||||
MainMenuWidget:registerEventHandler("start_zombies", CoD.MainMenu.StartZombies)
|
||||
MainMenuWidget:registerEventHandler("start_mp", CoD.MainMenu.StartMP)
|
||||
MainMenuWidget:registerEventHandler("start_sp", CoD.MainMenu.StartSP)
|
||||
MainMenuWidget:registerEventHandler("button_prompt_back", CoD.MainMenu.Back)
|
||||
MainMenuWidget:registerEventHandler("first_signed_in", CoD.MainMenu.SignedIntoLive)
|
||||
MainMenuWidget:registerEventHandler("last_signed_out", CoD.MainMenu.SignedOut)
|
||||
MainMenuWidget:registerEventHandler("open_menu", CoD.Lobby.OpenMenu)
|
||||
MainMenuWidget:registerEventHandler("reopen_serverbrowser", CoD.MainMenu.ReopenServerBrowser)
|
||||
MainMenuWidget:registerEventHandler("invite_accepted", CoD.inviteAccepted)
|
||||
MainMenuWidget:registerEventHandler("button_prompt_friends", CoD.MainMenu.ButtonPromptFriendsMenu)
|
||||
MainMenuWidget:registerEventHandler("open_store", CoD.MainLobby.OpenStore)
|
||||
MainMenuWidget:registerEventHandler("showstorebutton", CoD.MainMenu.ShowStoreButtonEvent)
|
||||
if CoD.isPS3 then
|
||||
MainMenuWidget:registerEventHandler("corrupt_install", CoD.MainMenu.CorruptInstall)
|
||||
end
|
||||
if CoD.isPC then
|
||||
MainMenuWidget:registerEventHandler("open_quit_popup", CoD.MainMenu.OpenQuitPopup)
|
||||
MainMenuWidget:registerEventHandler("open_sp_switch_popup", CoD.MainMenu.OpenConfirmSwitchToSP)
|
||||
MainMenuWidget:registerEventHandler("open_mp_switch_popup", CoD.MainMenu.OpenConfirmSwitchToMP)
|
||||
MainMenuWidget:registerEventHandler("open_zm_switch_popup", CoD.MainMenu.OpenConfirmSwitchToZM)
|
||||
end
|
||||
if CoD.isZombie == false then
|
||||
MainMenuWidget:registerEventHandler("elite_registration_ended", CoD.MainMenu.elite_registration_ended)
|
||||
MainMenuWidget:registerEventHandler("elite_registration_email_popup_requested", CoD.EliteRegistrationEmailPopup.EliteRegistrationEmailPopupRequested)
|
||||
MainMenuWidget:registerEventHandler("AutoFillPopup_Closed", CoD.EliteRegistrationEmailPopup.AutoFillPopup_Closed)
|
||||
MainMenuWidget:registerEventHandler("motd_popup_closed", CoD.MainMenu.Popup_Closed)
|
||||
MainMenuWidget:registerEventHandler("dlcpopup_closed", CoD.MainMenu.Popup_Closed)
|
||||
MainMenuWidget:registerEventHandler("voting_popup_closed", CoD.MainMenu.Popup_Closed)
|
||||
MainMenuWidget:registerEventHandler("spreminder_popup_closed", CoD.MainMenu.Popup_Closed)
|
||||
MainMenuWidget:registerEventHandler("dsppromotion_popup_closed", CoD.MainMenu.Popup_Closed)
|
||||
end
|
||||
MainMenuWidget:addSelectButton()
|
||||
if not CoD.isPC then
|
||||
MainMenuWidget:addBackButton(Engine.Localize("MENU_MAIN_MENU"))
|
||||
end
|
||||
if UIExpression.AnySignedInToLive(LocalClientIndex) == 1 then
|
||||
MainMenuWidget:addFriendsButton()
|
||||
end
|
||||
if CoD.isZombie == false then
|
||||
local MainMenuBackgroundMP = LUI.UIImage.new()
|
||||
MainMenuBackgroundMP:setLeftRight(false, false, -640, 640)
|
||||
MainMenuBackgroundMP:setTopBottom(false, false, -360, 360)
|
||||
MainMenuBackgroundMP:setImage(RegisterMaterial("menu_mp_soldiers"))
|
||||
MainMenuBackgroundMP:setPriority(-1)
|
||||
MainMenuWidget:addElement(MainMenuBackgroundMP)
|
||||
local MainMenuBackgroundMP = LUI.UIImage.new()
|
||||
MainMenuBackgroundMP:setLeftRight(false, false, -640, 640)
|
||||
MainMenuBackgroundMP:setTopBottom(false, false, 180, 360)
|
||||
MainMenuBackgroundMP:setImage(RegisterMaterial("ui_smoke"))
|
||||
MainMenuBackgroundMP:setAlpha(0.1)
|
||||
MainMenuWidget:addElement(MainMenuBackgroundMP)
|
||||
end
|
||||
if CoD.isZombie then
|
||||
local f4_local1 = 192
|
||||
local f4_local2 = f4_local1 * 2
|
||||
local f4_local3 = 230
|
||||
local MainMenuBackgroundZM = LUI.UIImage.new()
|
||||
MainMenuBackgroundZM:setLeftRight(true, false, 0, f4_local2)
|
||||
MainMenuBackgroundZM:setTopBottom(true, false, f4_local3 - f4_local1 / 2, f4_local3 + f4_local1 / 2)
|
||||
MainMenuBackgroundZM:setImage(RegisterMaterial("menu_zm_title_screen"))
|
||||
MainMenuWidget:addElement(MainMenuBackgroundZM)
|
||||
CoD.GameGlobeZombie.gameGlobe.currentMenu = MainMenuWidget
|
||||
else
|
||||
local f4_local1 = 48
|
||||
local f4_local2 = f4_local1 * 8
|
||||
local f4_local3 = 210
|
||||
local f4_local4 = LUI.UIImage.new()
|
||||
f4_local4:setLeftRight(true, false, 0, f4_local2)
|
||||
f4_local4:setTopBottom(true, false, f4_local3, f4_local3 + f4_local1)
|
||||
f4_local4:setImage(RegisterMaterial("menu_mp_title_screen"))
|
||||
MainMenuWidget:addElement(f4_local4)
|
||||
local Language = Dvar.loc_language:get()
|
||||
if Language == CoD.LANGUAGE_ENGLISH or Language == CoD.LANGUAGE_BRITISH then
|
||||
local f4_local6 = 24
|
||||
local f4_local7 = f4_local6 * 16
|
||||
local f4_local8 = f4_local3 + f4_local1 + 2
|
||||
local f4_local9 = LUI.UIImage.new()
|
||||
f4_local9:setLeftRight(true, false, 0, f4_local7)
|
||||
f4_local9:setTopBottom(true, false, f4_local8, f4_local8 + f4_local6)
|
||||
f4_local9:setImage(RegisterMaterial("menu_mp_title_screen_mp"))
|
||||
MainMenuWidget:addElement(f4_local9)
|
||||
end
|
||||
end
|
||||
local f4_local1 = 8
|
||||
if CoD.isWIIU then
|
||||
f4_local1 = f4_local1 + 1
|
||||
end
|
||||
local HorizontalOffset = 6
|
||||
local f4_local3 = CoD.CoD9Button.Height * f4_local1
|
||||
local f4_local5 = -f4_local3 - CoD.ButtonPrompt.Height
|
||||
MainMenuWidget.buttonList = CoD.ButtonList.new({
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
left = HorizontalOffset,
|
||||
right = HorizontalOffset + CoD.ButtonList.DefaultWidth,
|
||||
topAnchor = false,
|
||||
bottomAnchor = true,
|
||||
top = f4_local5,
|
||||
bottom = -CoD.ButtonPrompt.Height,
|
||||
alpha = 1,
|
||||
})
|
||||
MainMenuWidget.buttonList:setPriority(10)
|
||||
MainMenuWidget.buttonList:registerAnimationState("disabled", {
|
||||
alpha = 0.5,
|
||||
})
|
||||
MainMenuWidget:addElement(MainMenuWidget.buttonList)
|
||||
MainMenuWidget.mainLobbyButton = MainMenuWidget.buttonList:addButton(Engine.Localize("PLATFORM_XBOXLIVE_INSTR"), nil, 1)
|
||||
MainMenuWidget.mainLobbyButton:setActionEventName("open_main_lobby_requested")
|
||||
local ShowServerBrowser
|
||||
if not CoD.isPC or Dvar.developer:get() > 0 then
|
||||
ShowServerBrowser = not Engine.IsBetaBuild()
|
||||
else
|
||||
ShowServerBrowser = false
|
||||
end
|
||||
local HorizontalOffset2 = 120
|
||||
if ShowServerBrowser then
|
||||
local SystemLinkTitle = Engine.Localize("PLATFORM_SYSTEM_LINK_CAPS")
|
||||
local f4_local10_1, f4_local10_2, SystemLinkTitleTextWidth, f4_local10_4 = GetTextDimensions(SystemLinkTitle, CoD.CoD9Button.Font, CoD.CoD9Button.TextHeight)
|
||||
MainMenuWidget.systemLinkButton = MainMenuWidget.buttonList:addButton(SystemLinkTitle, nil, 2)
|
||||
MainMenuWidget.systemLinkButton:setActionEventName("open_system_link_flyout")
|
||||
HorizontalOffset2 = SystemLinkTitleTextWidth + 15
|
||||
end
|
||||
if not CoD.isPC and not Engine.IsBetaBuild() then
|
||||
if CoD.isWIIU then
|
||||
MainMenuWidget.localButton = MainMenuWidget.buttonList:addButton(Engine.Localize(CoD.MPZM("MENU_LOCAL_CAPS", "PLATFORM_UI_LOCAL_CAPS")), nil, 3)
|
||||
else
|
||||
MainMenuWidget.localButton = MainMenuWidget.buttonList:addButton(Engine.Localize(CoD.MPZM("MENU_LOCAL_CAPS", "ZMUI_LOCAL_CAPS")), nil, 3)
|
||||
end
|
||||
MainMenuWidget.localButton:setActionEventName("open_local_match_lobby")
|
||||
end
|
||||
if CoD.isWIIU then
|
||||
MainMenuWidget.controlsButton = MainMenuWidget.buttonList:addButton(Engine.Localize("MENU_CONTROLLER_SETTINGS_CAPS"), nil, 4)
|
||||
MainMenuWidget.controlsButton:setActionEventName("open_controls_menu")
|
||||
end
|
||||
MainMenuWidget.optionsButton = MainMenuWidget.buttonList:addButton(Engine.Localize("MENU_OPTIONS_CAPS"), nil, 4)
|
||||
MainMenuWidget.optionsButton:setActionEventName("open_options_menu")
|
||||
if CoD.MainMenu.ShowStoreButton(LocalClientIndex) == true and MainMenuWidget.ingameStoreButton == nil then
|
||||
CoD.MainMenu.AddStoreButton(MainMenuWidget)
|
||||
end
|
||||
if CoD.isPC then
|
||||
MainMenuWidget.buttonList:addSpacer(CoD.CoD9Button.Height / 2, 5)
|
||||
MainMenuWidget.spButton = MainMenuWidget.buttonList:addButton(Engine.Localize("MENU_SINGLEPLAYER_CAPS"), nil, 6)
|
||||
MainMenuWidget.spButton:setActionEventName("open_sp_switch_popup")
|
||||
if CoD.isZombie then
|
||||
MainMenuWidget.mpButton = MainMenuWidget.buttonList:addButton(Engine.Localize("MENU_MULTIPLAYER_CAPS"), nil, 7)
|
||||
MainMenuWidget.mpButton:setActionEventName("open_mp_switch_popup")
|
||||
else
|
||||
MainMenuWidget.zombieButton = MainMenuWidget.buttonList:addButton(Engine.Localize("MENU_ZOMBIE_CAPS"), nil, 7)
|
||||
MainMenuWidget.zombieButton:setActionEventName("open_zm_switch_popup")
|
||||
end
|
||||
MainMenuWidget.buttonList:addSpacer(CoD.CoD9Button.Height / 2, 8)
|
||||
MainMenuWidget.quitButton = MainMenuWidget.buttonList:addButton(Engine.Localize("MENU_QUIT_CAPS"), nil, 9)
|
||||
MainMenuWidget.quitButton:setActionEventName("open_quit_popup")
|
||||
MainMenuWidget:addLeftButtonPrompt(CoD.ButtonPrompt.new("secondary", "", MainMenuWidget, "open_quit_popup", true))
|
||||
MainMenuWidget.buttonList:setLeftRight(true, false, HorizontalOffset, HorizontalOffset + 120)
|
||||
end
|
||||
if ShowServerBrowser then
|
||||
local VerticalOffset = f4_local5 + CoD.CoD9Button.Height + 2
|
||||
local f4_local10 = CoD.CoD9Button.Height * 2 + 2
|
||||
local MenuCreateGame = Engine.Localize("MENU_CREATE_GAME_CAPS")
|
||||
local f4_local12_1, f4_local12_2, CreateGameTextWidth, f4_local12_4 = GetTextDimensions(MenuCreateGame, CoD.CoD9Button.Font, CoD.CoD9Button.TextHeight)
|
||||
local MenuJoinGame = Engine.Localize("MENU_JOIN_GAME_CAPS")
|
||||
local f4_local14_1, f4_local14_2, JoinGameTextWidth, f4_local14_4 = GetTextDimensions(MenuJoinGame, CoD.CoD9Button.Font, CoD.CoD9Button.TextHeight)
|
||||
local HorizontalOffset3 = CreateGameTextWidth
|
||||
if HorizontalOffset3 < JoinGameTextWidth then
|
||||
HorizontalOffset3 = JoinGameTextWidth
|
||||
end
|
||||
MainMenuWidget.systemLinkFlyoutContainer = LUI.UIElement.new({
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
left = HorizontalOffset + HorizontalOffset2,
|
||||
right = HorizontalOffset + HorizontalOffset2 + HorizontalOffset3 + 12,
|
||||
topAnchor = false,
|
||||
bottomAnchor = true,
|
||||
top = VerticalOffset,
|
||||
bottom = VerticalOffset + f4_local10,
|
||||
alpha = 0,
|
||||
})
|
||||
MainMenuWidget.systemLinkFlyoutContainer:registerAnimationState("show", {
|
||||
alpha = 1,
|
||||
})
|
||||
MainMenuWidget:addElement(MainMenuWidget.systemLinkFlyoutContainer)
|
||||
MainMenuWidget.systemLinkFlyoutContainer:addElement(LUI.UIImage.new({
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
left = -HorizontalOffset2 - 4,
|
||||
right = 0,
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
top = 0,
|
||||
bottom = CoD.CoD9Button.Height,
|
||||
red = 0,
|
||||
green = 0,
|
||||
blue = 0,
|
||||
alpha = 0.8,
|
||||
}))
|
||||
MainMenuWidget.systemLinkFlyoutContainer:addElement(LUI.UIImage.new({
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
left = 0,
|
||||
right = 0,
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
red = 0,
|
||||
green = 0,
|
||||
blue = 0,
|
||||
alpha = 0.8,
|
||||
}))
|
||||
MainMenuWidget.systemLinkFlyoutContainer.buttonList = CoD.ButtonList.new({
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
left = 4,
|
||||
right = 0,
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
})
|
||||
CoD.ButtonList.DisableInput(MainMenuWidget.systemLinkFlyoutContainer.buttonList)
|
||||
MainMenuWidget.systemLinkFlyoutContainer:addElement(MainMenuWidget.systemLinkFlyoutContainer.buttonList)
|
||||
MainMenuWidget.systemLinkFlyoutContainer.buttonList.hintText:close()
|
||||
MainMenuWidget.systemLinkFlyoutContainer.buttonList.hintText = nil
|
||||
if CoD.useMouse then
|
||||
MainMenuWidget.systemLinkFlyoutContainer.buttonList:setHandleMouseButton(true)
|
||||
MainMenuWidget.systemLinkFlyoutContainer.buttonList:registerEventHandler("leftmouseup_outside", CoD.MainMenu.FlyoutBack)
|
||||
end
|
||||
MainMenuWidget.systemLinkFlyoutContainer.openSystemLinkButton = MainMenuWidget.systemLinkFlyoutContainer.buttonList:addButton(MenuCreateGame, nil, 1)
|
||||
MainMenuWidget.systemLinkFlyoutContainer.openSystemLinkButton:setActionEventName("open_system_link_lobby")
|
||||
MainMenuWidget.systemLinkFlyoutContainer.openServerBrowserButton = MainMenuWidget.systemLinkFlyoutContainer.buttonList:addButton(MenuJoinGame, nil, 1)
|
||||
MainMenuWidget.systemLinkFlyoutContainer.openServerBrowserButton:setActionEventName("open_server_browser")
|
||||
end
|
||||
if not MainMenuWidget.buttonList:restoreState() then
|
||||
MainMenuWidget.buttonList:processEvent({
|
||||
name = "gain_focus",
|
||||
})
|
||||
elseif ShowServerBrowser and MainMenuWidget.systemLinkButton:isInFocus() then
|
||||
local ClientInstance = {
|
||||
controller = LocalClientIndex,
|
||||
}
|
||||
if Engine.CheckNetConnection() == true and CoD.MainMenu.OfflinePlayAvailable(MainMenuWidget, ClientInstance, true) == 1 then
|
||||
CoD.MainMenu.OpenSystemLinkFlyout(MainMenuWidget, ClientInstance)
|
||||
if CoD.MainMenu.SystemLinkLastUsedButton == 1 then
|
||||
MainMenuWidget.systemLinkFlyoutContainer.openSystemLinkButton:processEvent({
|
||||
name = "lose_focus",
|
||||
})
|
||||
MainMenuWidget.systemLinkFlyoutContainer.openServerBrowserButton:processEvent({
|
||||
name = "gain_focus",
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
HideGlobe()
|
||||
if CoD.isWIIU then
|
||||
Engine.ExecNow(0, "setclientbeingused")
|
||||
end
|
||||
if CoD.isPS3 then
|
||||
Engine.ExecNow(LocalClientIndex, "onetimeinstallcorruptioncheck")
|
||||
end
|
||||
return MainMenuWidget
|
||||
end
|
||||
|
||||
CoD.MainMenu.CorruptInstall = function(MainMenuWidget, ClientInstance)
|
||||
local ErrorPopup = MainMenuWidget:openPopup("Error", ClientInstance.controller)
|
||||
ErrorPopup.anyControllerAllowed = true
|
||||
ErrorPopup:setMessage(Engine.Localize("MENU_PS3_INSTALL_INCOMPLETE"))
|
||||
end
|
||||
|
||||
CoD.MainMenu.OpenPopup_EliteRegistration = function(MainMenuWidget, ClientInstance)
|
||||
if Engine.IsCustomElementScrollLanguageOverrideActive() then
|
||||
local EliteRegistrationScrollingTOSPopup = MainMenuWidget:openPopup("EliteRegistrationScrollingTOS", ClientInstance.controller)
|
||||
else
|
||||
local EliteRegistrationPopup = MainMenuWidget:openPopup("EliteRegistrationPopup", ClientInstance.controller)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.OpenPopup_EliteWelcome = function(MainMenuWidget, ClientInstance)
|
||||
if Engine.IsPlayerEliteFounder(ClientInstance.controller) then
|
||||
local EliteWelcomePopup = MainMenuWidget:openPopup("EliteWelcomeFounderPopup", ClientInstance.controller)
|
||||
else
|
||||
local EliteWelcomePopup = MainMenuWidget:openPopup("EliteWelcomePopup", ClientInstance.controller)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.elite_registration_ended = function(MainMenuWidget, ClientInstance)
|
||||
CoD.MainMenu.OpenMainLobby(MainMenuWidget, ClientInstance)
|
||||
end
|
||||
|
||||
CoD.MainMenu.Popup_Closed = function(MainMenuWidget, ClientInstance)
|
||||
CoD.MainMenu.OpenMainLobbyRequested(MainMenuWidget, ClientInstance)
|
||||
end
|
||||
|
||||
CoD.MainMenu.IsGuestRestricted = function(MainMenuWidget, ClientInstance)
|
||||
if not (not CoD.isPS3 or ClientInstance.controller == 0) or CoD.isXBOX and UIExpression.IsGuest(ClientInstance.controller) == 1 then
|
||||
local PopupGuestRestricted = MainMenuWidget:openPopup("popup_guest_contentrestricted", ClientInstance.controller)
|
||||
PopupGuestRestricted.anyControllerAllowed = true
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.ShowDLC0Popup = function(LocalClientIndex)
|
||||
if CoD.isXBOX == true and Engine.IsContentAvailableByPakName("dlc0") == false and UIExpression.DvarBool(nil, "ui_isDLCPopupEnabled") == 1 and CoD.perController[LocalClientIndex].IsDLCPopupViewed == nil then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.AnyDLCMissing = function()
|
||||
local TotalDLCReleased = Dvar.ui_totalDLCReleased:get()
|
||||
for Index = 1, TotalDLCReleased, 1 do
|
||||
if not Engine.IsContentAvailableByPakName("dlc" .. Index) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
CoD.MainMenu.ShowSPReminderPopup = function(LocalClientIndex)
|
||||
if CoD.isPC then
|
||||
return false
|
||||
elseif Engine.ShouldShowSPReminder(LocalClientIndex) == true and Engine.OwnSeasonPass(LocalClientIndex) == true and CoD.MainMenu.AnyDLCMissing() == true then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.ShowDSPPromotionPopup = function(LocalClientIndex)
|
||||
if Engine.ShouldShowDSPPromotion(LocalClientIndex) == true and Engine.OwnSeasonPass(LocalClientIndex) == false and Engine.OwnDLC1Only(LocalClientIndex) == true then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.OpenMainLobbyRequested = function(MainMenuWidget, ClientInstance)
|
||||
if CoD.isZombie then
|
||||
if Engine.IsFeatureBanned(CoD.FEATURE_BAN_LIVE_ZOMBIE) then
|
||||
Engine.ExecNow(ClientInstance.controller, "banCheck " .. CoD.FEATURE_BAN_LIVE_ZOMBIE)
|
||||
return
|
||||
end
|
||||
elseif Engine.IsFeatureBanned(CoD.FEATURE_BAN_LIVE_MP) then
|
||||
Engine.ExecNow(ClientInstance.controller, "banCheck " .. CoD.FEATURE_BAN_LIVE_MP)
|
||||
return
|
||||
end
|
||||
if CoD.MainMenu.IsGuestRestricted(MainMenuWidget, ClientInstance) == true then
|
||||
return
|
||||
elseif Engine.CheckNetConnection() == false then
|
||||
local PopupNetConnection = MainMenuWidget:openPopup("popup_net_connection", ClientInstance.controller)
|
||||
PopupNetConnection.callingMenu = MainMenuWidget
|
||||
return
|
||||
elseif CoD.isZombie == false then
|
||||
if CoD.MainLobby.OnlinePlayAvailable(MainMenuWidget, ClientInstance) == 1 then
|
||||
Engine.Exec(ClientInstance.controller, "setclientbeingusedandprimary")
|
||||
if CoD.MainMenu.ShowDLC0Popup(ClientInstance.controller) == true then
|
||||
local f15_local0 = Engine.GetDLC0PublisherOfferId(ClientInstance.controller)
|
||||
if f15_local0 ~= nil then
|
||||
CoD.perController[ClientInstance.controller].ContentPublisherOfferID = f15_local0
|
||||
CoD.perController[ClientInstance.controller].ContentType = "0"
|
||||
local DLCPopup = MainMenuWidget:openPopup("DLCPopup", ClientInstance.controller)
|
||||
DLCPopup.callingMenu = MainMenuWidget
|
||||
end
|
||||
elseif Engine.ShouldShowMOTD(ClientInstance.controller) ~= nil and Engine.ShouldShowMOTD(ClientInstance.controller) == true then
|
||||
local MOTDPopup = MainMenuWidget:openPopup("MOTD", ClientInstance.controller)
|
||||
MOTDPopup.callingMenu = MainMenuWidget
|
||||
elseif CoD.MainMenu.ShowSPReminderPopup(ClientInstance.controller) then
|
||||
local SeasonPassReminder = MainMenuWidget:openPopup("SPReminderPopup", ClientInstance.controller)
|
||||
SeasonPassReminder.callingMenu = MainMenuWidget
|
||||
elseif CoD.MainMenu.ShowDSPPromotionPopup(ClientInstance.controller) then
|
||||
local DeluxeSeasonPassReminder = MainMenuWidget:openPopup("DSPPromotionPopup", ClientInstance.controller)
|
||||
DeluxeSeasonPassReminder.callingMenu = MainMenuWidget
|
||||
elseif Engine.ShouldShowVoting(ClientInstance.controller) == true then
|
||||
local VotingPopup = MainMenuWidget:openPopup("VotingPopup", ClientInstance.controller)
|
||||
VotingPopup.callingMenu = MainMenuWidget
|
||||
elseif Engine.ERegPopup_ShouldShow(ClientInstance.controller) == 1 then
|
||||
CoD.MainMenu.OpenPopup_EliteRegistration(MainMenuWidget, ClientInstance)
|
||||
elseif Engine.EWelcomePopup_ShouldShow(ClientInstance.controller) == 1 then
|
||||
CoD.MainMenu.OpenPopup_EliteWelcome(MainMenuWidget, ClientInstance)
|
||||
elseif Engine.EMarketingOptInPopup_ShouldShow(ClientInstance.controller) == true then
|
||||
MainMenuWidget:openPopup("EliteMarketingOptInPopup", ClientInstance.controller)
|
||||
elseif CoD.isPS3 and Engine.IsChatRestricted(ClientInstance.controller) then
|
||||
local PopupChatRestricted = MainMenuWidget:openPopup("popup_chatrestricted", ClientInstance.controller)
|
||||
PopupChatRestricted.callingMenu = MainMenuWidget
|
||||
else
|
||||
CoD.perController[ClientInstance.controller].IsDLCPopupViewed = nil
|
||||
CoD.MainMenu.OpenMainLobby(MainMenuWidget, ClientInstance)
|
||||
end
|
||||
end
|
||||
elseif CoD.MainLobby.OnlinePlayAvailable(MainMenuWidget, ClientInstance) == 1 then
|
||||
Engine.Exec(ClientInstance.controller, "setclientbeingusedandprimary")
|
||||
if Engine.ShouldShowMOTD(ClientInstance.controller) then
|
||||
local MOTDPopup = MainMenuWidget:openPopup("MOTD", ClientInstance.controller)
|
||||
MOTDPopup.callingMenu = MainMenuWidget
|
||||
elseif CoD.isPS3 and Engine.IsChatRestricted(ClientInstance.controller) then
|
||||
local PopupChatRestricted = MainMenuWidget:openPopup("popup_chatrestricted", ClientInstance.controller)
|
||||
PopupChatRestricted.callingMenu = MainMenuWidget
|
||||
else
|
||||
CoD.MainMenu.OpenMainLobby(MainMenuWidget, ClientInstance)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.OpenMainLobby = function(MainMenuWidget, ClientInstance)
|
||||
if CoD.MainLobby.OnlinePlayAvailable(MainMenuWidget, ClientInstance) == 1 then
|
||||
if CoD.isZombie then
|
||||
if Engine.IsFeatureBanned(CoD.FEATURE_BAN_LIVE_ZOMBIE) then
|
||||
Engine.ExecNow(ClientInstance.controller, "banCheck " .. CoD.FEATURE_BAN_LIVE_ZOMBIE)
|
||||
return
|
||||
end
|
||||
elseif Engine.IsFeatureBanned(CoD.FEATURE_BAN_LIVE_MP) then
|
||||
Engine.ExecNow(ClientInstance.controller, "banCheck " .. CoD.FEATURE_BAN_LIVE_MP)
|
||||
return
|
||||
end
|
||||
MainMenuWidget.buttonList:saveState()
|
||||
Engine.SessionModeSetOnlineGame(true)
|
||||
Engine.Exec(ClientInstance.controller, "xstartprivateparty")
|
||||
Engine.Exec(ClientInstance.controller, "party_statechanged")
|
||||
CoD.MainMenu.InitializeLocalPlayers(ClientInstance.controller)
|
||||
local MainLobbyMenu = MainMenuWidget:openMenu("MainLobby", ClientInstance.controller)
|
||||
Engine.Exec(ClientInstance.controller, "session_rejoinsession " .. CoD.SESSION_REJOIN_CHECK_FOR_SESSION)
|
||||
if CoD.isZombie then
|
||||
CoD.GameGlobeZombie.gameGlobe.currentMenu = MainLobbyMenu
|
||||
end
|
||||
MainMenuWidget:close()
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.OpenControlsMenu = function(MainMenuWidget, ClientInstance)
|
||||
if CoD.MainMenu.OfflinePlayAvailable(MainMenuWidget, ClientInstance) == 0 then
|
||||
return
|
||||
else
|
||||
CoD.MainMenu.InitializeLocalPlayers(ClientInstance.controller)
|
||||
MainMenuWidget:openPopup("WiiUControllerSettings", ClientInstance.controller, true)
|
||||
Engine.PlaySound("cac_screen_fade")
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.OpenOptionsMenu = function(MainMenuWidget, ClientInstance)
|
||||
if CoD.MainMenu.OfflinePlayAvailable(MainMenuWidget, ClientInstance) == 0 then
|
||||
return
|
||||
else
|
||||
CoD.MainMenu.InitializeLocalPlayers(ClientInstance.controller)
|
||||
MainMenuWidget:openPopup("OptionsMenu", ClientInstance.controller)
|
||||
Engine.PlaySound("cac_screen_fade")
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.OpenLocalMatchLobby = function(MainMenuWidget, ClientInstance)
|
||||
if CoD.MainMenu.IsGuestRestricted(MainMenuWidget, ClientInstance) == true then
|
||||
return
|
||||
elseif CoD.MainMenu.OfflinePlayAvailable(MainMenuWidget, ClientInstance) == 0 then
|
||||
return
|
||||
end
|
||||
MainMenuWidget.buttonList:saveState()
|
||||
CoD.MainMenu.InitializeLocalPlayers(ClientInstance.controller)
|
||||
CoD.SwitchToLocalLobby(ClientInstance.controller)
|
||||
if CoD.isZombie == true then
|
||||
MainMenuWidget:openMenu("SelectMapZM", ClientInstance.controller)
|
||||
ShowGlobe()
|
||||
else
|
||||
MainMenuWidget:openMenu("SplitscreenGameLobby", ClientInstance.controller)
|
||||
end
|
||||
MainMenuWidget:close()
|
||||
end
|
||||
|
||||
CoD.MainMenu.OfflinePlayAvailable = function(MainMenuWidget, ClientInstance, f20_arg2)
|
||||
if UIExpression.IsSignedIn(ClientInstance.controller) == 0 then
|
||||
if f20_arg2 ~= nil and f20_arg2 == true then
|
||||
return 0
|
||||
elseif CoD.isPS3 then
|
||||
if UIExpression.IsPrimaryLocalClient(ClientInstance.controller) == 1 then
|
||||
Engine.Exec(ClientInstance.controller, "xsigninlive")
|
||||
else
|
||||
Engine.Exec(ClientInstance.controller, "signclientin")
|
||||
end
|
||||
else
|
||||
Engine.Exec(ClientInstance.controller, "xsignin")
|
||||
if CoD.isPC then
|
||||
return 1
|
||||
end
|
||||
end
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.StartZombies = function(MainMenuWidget, ClientInstance)
|
||||
Engine.Exec(ClientInstance.controller, "startZombies")
|
||||
end
|
||||
|
||||
CoD.MainMenu.StartMP = function(MainMenuWidget, ClientInstance)
|
||||
Engine.Exec(ClientInstance.controller, "startMultiplayer")
|
||||
end
|
||||
|
||||
CoD.MainMenu.StartSP = function(MainMenuWidget, ClientInstance)
|
||||
Engine.Exec(ClientInstance.controller, "startSingleplayer")
|
||||
end
|
||||
|
||||
CoD.MainMenu.OpenQuitPopup = function(MainMenuWidget, ClientInstance)
|
||||
MainMenuWidget:openPopup("QuitPopup", ClientInstance.controller)
|
||||
end
|
||||
|
||||
CoD.MainMenu.OpenConfirmSwitchToSP = function(MainMenuWidget, ClientInstance)
|
||||
MainMenuWidget:openPopup("SwitchToSPPopup", ClientInstance.controller)
|
||||
end
|
||||
|
||||
CoD.MainMenu.OpenConfirmSwitchToMP = function(MainMenuWidget, ClientInstance)
|
||||
MainMenuWidget:openPopup("SwitchToMPPopup", ClientInstance.controller)
|
||||
end
|
||||
|
||||
CoD.MainMenu.OpenConfirmSwitchToZM = function(MainMenuWidget, ClientInstance)
|
||||
MainMenuWidget:openPopup("SwitchToZMPopup", ClientInstance.controller)
|
||||
end
|
||||
|
||||
CoD.MainMenu.OpenSystemLinkFlyout = function(MainMenuWidget, ClientInstance)
|
||||
if CoD.MainMenu.IsGuestRestricted(MainMenuWidget, ClientInstance) == true then
|
||||
return
|
||||
elseif Engine.CheckNetConnection() == false then
|
||||
local PopupNetConnection = MainMenuWidget:openPopup("popup_net_connection", ClientInstance.controller)
|
||||
PopupNetConnection.callingMenu = MainMenuWidget
|
||||
return
|
||||
elseif CoD.MainMenu.OfflinePlayAvailable(MainMenuWidget, ClientInstance) == 0 then
|
||||
return
|
||||
end
|
||||
MainMenuWidget.systemLinkFlyoutContainer:animateToState("show")
|
||||
CoD.ButtonList.DisableInput(MainMenuWidget.buttonList)
|
||||
MainMenuWidget.buttonList:animateToState("disabled")
|
||||
CoD.ButtonList.EnableInput(MainMenuWidget.systemLinkFlyoutContainer.buttonList)
|
||||
MainMenuWidget.systemLinkFlyoutContainer.openSystemLinkButton:processEvent({
|
||||
name = "gain_focus",
|
||||
})
|
||||
if MainMenuWidget.backButton ~= nil then
|
||||
MainMenuWidget.backButton:close()
|
||||
end
|
||||
MainMenuWidget:addBackButton()
|
||||
MainMenuWidget:registerEventHandler("button_prompt_back", CoD.MainMenu.CloseSystemLinkFlyout)
|
||||
end
|
||||
|
||||
CoD.MainMenu.CloseSystemLinkFlyout = function(MainMenuWidget, f29_arg1)
|
||||
MainMenuWidget.systemLinkFlyoutContainer:animateToState("default")
|
||||
CoD.ButtonList.EnableInput(MainMenuWidget.buttonList)
|
||||
MainMenuWidget.buttonList:animateToState("default")
|
||||
MainMenuWidget.systemLinkFlyoutContainer.openSystemLinkButton:processEvent({
|
||||
name = "lose_focus",
|
||||
})
|
||||
MainMenuWidget.systemLinkFlyoutContainer.openServerBrowserButton:processEvent({
|
||||
name = "lose_focus",
|
||||
})
|
||||
CoD.ButtonList.DisableInput(MainMenuWidget.systemLinkFlyoutContainer.buttonList)
|
||||
if MainMenuWidget.backButton ~= nil then
|
||||
MainMenuWidget.backButton:close()
|
||||
end
|
||||
Engine.PlaySound("cac_cmn_backout")
|
||||
MainMenuWidget:addBackButton(Engine.Localize("MENU_MAIN_MENU"))
|
||||
MainMenuWidget:registerEventHandler("button_prompt_back", CoD.MainMenu.Back)
|
||||
end
|
||||
|
||||
CoD.MainMenu.FlyoutBack = function(FlyoutButtonList, ClientInstance)
|
||||
if FlyoutButtonList.m_backReady then
|
||||
FlyoutButtonList:dispatchEventToParent({
|
||||
name = "button_prompt_back",
|
||||
controller = ClientInstance.controller,
|
||||
})
|
||||
FlyoutButtonList.m_backReady = nil
|
||||
else
|
||||
FlyoutButtonList.m_backReady = true
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.OpenSystemLinkLobby = function(MainMenuWidget, ClientInstance)
|
||||
if CoD.MainMenu.IsGuestRestricted(MainMenuWidget, ClientInstance) == true then
|
||||
return
|
||||
elseif Engine.CheckNetConnection() == false then
|
||||
local PopupNetConnection = MainMenuWidget:openPopup("popup_net_connection", ClientInstance.controller)
|
||||
PopupNetConnection.callingMenu = MainMenuWidget
|
||||
return
|
||||
elseif CoD.MainMenu.OfflinePlayAvailable(MainMenuWidget, ClientInstance) == 0 then
|
||||
return
|
||||
end
|
||||
MainMenuWidget.buttonList:saveState()
|
||||
CoD.MainMenu.SystemLinkLastUsedButton = 0
|
||||
CoD.MainMenu.InitializeLocalPlayers(ClientInstance.controller)
|
||||
CoD.SwitchToSystemLinkLobby(ClientInstance.controller)
|
||||
if CoD.isZombie == true then
|
||||
MainMenuWidget:openMenu("SelectMapZM", ClientInstance.controller)
|
||||
ShowGlobe()
|
||||
else
|
||||
MainMenuWidget:openMenu("PrivateLocalGameLobby", ClientInstance.controller)
|
||||
end
|
||||
MainMenuWidget:close()
|
||||
end
|
||||
|
||||
CoD.MainMenu.OpenServerBrowser = function(MainMenuWidget, ClientInstance)
|
||||
if CoD.MainMenu.IsGuestRestricted(MainMenuWidget, ClientInstance) == true then
|
||||
return
|
||||
else
|
||||
Engine.Exec(ClientInstance.controller, "loadcommonff")
|
||||
if Engine.CheckNetConnection() == false then
|
||||
local PopupNetConnection = MainMenuWidget:openPopup("popup_net_connection", ClientInstance.controller)
|
||||
PopupNetConnection.callingMenu = MainMenuWidget
|
||||
return
|
||||
elseif CoD.MainMenu.OfflinePlayAvailable(MainMenuWidget, ClientInstance) == 0 then
|
||||
return
|
||||
else
|
||||
MainMenuWidget.buttonList:saveState()
|
||||
CoD.MainMenu.SystemLinkLastUsedButton = 1
|
||||
CoD.MainMenu.InitializeLocalPlayers(ClientInstance.controller)
|
||||
Engine.ServerListUpdateFilter(ClientInstance.controller)
|
||||
MainMenuWidget:openPopup("ServerBrowser", ClientInstance.controller)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.ReopenServerBrowser = function(MainMenuWidget, ClientInstance)
|
||||
CoD.resetGameModes()
|
||||
if MainMenuWidget.systemLinkButton:isInFocus() then
|
||||
return
|
||||
else
|
||||
MainMenuWidget.buttonList:processEvent({
|
||||
name = "lose_focus",
|
||||
})
|
||||
MainMenuWidget.systemLinkButton:processEvent({
|
||||
name = "gain_focus",
|
||||
})
|
||||
CoD.MainMenu.OpenSystemLinkFlyout(MainMenuWidget, ClientInstance)
|
||||
MainMenuWidget.systemLinkFlyoutContainer.openSystemLinkButton:processEvent({
|
||||
name = "lose_focus",
|
||||
})
|
||||
MainMenuWidget.systemLinkFlyoutContainer.openServerBrowserButton:processEvent({
|
||||
name = "gain_focus",
|
||||
})
|
||||
CoD.MainMenu.OpenServerBrowser(MainMenuWidget, ClientInstance)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.Leave = function(f34_arg0, ClientInstance)
|
||||
Dvar.ui_changed_exe:set(1)
|
||||
Engine.Exec(ClientInstance.controller, "wait;wait;wait")
|
||||
Engine.Exec(ClientInstance.controller, "startSingleplayer")
|
||||
end
|
||||
|
||||
CoD.MainMenu.Back = function(MainMenuWidget, ClientInstance)
|
||||
local MainMenuQuit = {
|
||||
params = {},
|
||||
titleText = Engine.Localize("MENU_MAIN_MENU_CAPS"),
|
||||
}
|
||||
if not CoD.isZombie then
|
||||
table.insert(MainMenuQuit.params, {
|
||||
leaveHandler = CoD.MainMenu.StartSP,
|
||||
leaveEvent = "start_sp",
|
||||
leaveText = Engine.Localize("MENU_CAMPAIGN"),
|
||||
})
|
||||
table.insert(MainMenuQuit.params, {
|
||||
leaveHandler = CoD.MainMenu.StartZombies,
|
||||
leaveEvent = "start_zombies",
|
||||
leaveText = Engine.Localize("MENU_ZOMBIE"),
|
||||
})
|
||||
else
|
||||
table.insert(MainMenuQuit.params, {
|
||||
leaveHandler = CoD.MainMenu.StartSP,
|
||||
leaveEvent = "start_sp",
|
||||
leaveText = Engine.Localize("MENU_CAMPAIGN"),
|
||||
})
|
||||
table.insert(MainMenuQuit.params, {
|
||||
leaveHandler = CoD.MainMenu.StartMP,
|
||||
leaveEvent = "start_mp",
|
||||
leaveText = Engine.Localize("MENU_MULTIPLAYER"),
|
||||
})
|
||||
end
|
||||
local LeavePopup = MainMenuWidget:openPopup("ConfirmLeave", ClientInstance.controller, MainMenuQuit)
|
||||
LeavePopup.anyControllerAllowed = true
|
||||
end
|
||||
|
||||
CoD.MainMenu.ButtonPromptFriendsMenu = function(MainMenuWidget, ClientInstance)
|
||||
if UIExpression.IsGuest(ClientInstance.controller) == 1 then
|
||||
local FriendsMenuPopup = MainMenuWidget:openPopup("popup_guest_contentrestricted", ClientInstance.controller)
|
||||
FriendsMenuPopup.anyControllerAllowed = true
|
||||
FriendsMenuPopup:setOwner(ClientInstance.controller)
|
||||
return
|
||||
elseif UIExpression.IsSignedInToLive(ClientInstance.controller) == 0 then
|
||||
local FriendsMenuPopup = MainMenuWidget:openPopup("Error", ClientInstance.controller)
|
||||
FriendsMenuPopup:setMessage(Engine.Localize("XBOXLIVE_FRIENDS_UNAVAILABLE"))
|
||||
FriendsMenuPopup.anyControllerAllowed = true
|
||||
return
|
||||
elseif UIExpression.IsContentRatingAllowed(ClientInstance.controller) == 0 or UIExpression.IsAnyControllerMPRestricted() == 1 or not Engine.HasMPPrivileges(ClientInstance.controller) then
|
||||
local FriendsMenuPopup = MainMenuWidget:openPopup("Error", ClientInstance.controller)
|
||||
FriendsMenuPopup:setMessage(Engine.Localize("XBOXLIVE_MPNOTALLOWED"))
|
||||
FriendsMenuPopup.anyControllerAllowed = true
|
||||
return
|
||||
elseif UIExpression.AreStatsFetched(ClientInstance.controller) == 0 then
|
||||
return
|
||||
elseif not CoD.isPS3 or UIExpression.IsSubUser(ClientInstance.controller) ~= 1 then
|
||||
local FriendsMenuPopup = MainMenuWidget:openPopup("FriendsList", ClientInstance.controller)
|
||||
CoD.MainMenu.InitializeLocalPlayers(ClientInstance.controller)
|
||||
FriendsMenuPopup:setOwner(ClientInstance.controller)
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.SignedIntoLive = function(MainMenuWidget, f37_arg1)
|
||||
if MainMenuWidget.friendsButton == nil then
|
||||
MainMenuWidget:addFriendsButton()
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.SignedOut = function(MainMenuWidget, f38_arg1)
|
||||
if MainMenuWidget.friendsButton ~= nil then
|
||||
MainMenuWidget.friendsButton:close()
|
||||
MainMenuWidget.friendsButton = nil
|
||||
end
|
||||
end
|
||||
|
||||
CoD.MainMenu.InitializeLocalPlayers = function(LocalClientIndex)
|
||||
Engine.ExecNow(LocalClientIndex, "disableallclients")
|
||||
Engine.ExecNow(LocalClientIndex, "setclientbeingusedandprimary")
|
||||
end
|
||||
|
||||
LUI.createMenu.VCS = function(f40_arg0)
|
||||
local f40_local0 = CoD.Menu.New("VCS")
|
||||
f40_local0.anyControllerAllowed = true
|
||||
f40_local0:addElement(LUI.UIImage.new({
|
||||
left = 0,
|
||||
top = 0,
|
||||
right = 1080,
|
||||
bottom = 600,
|
||||
leftAnchor = true,
|
||||
topAnchor = true,
|
||||
rightAnchor = false,
|
||||
bottomAnchor = false,
|
||||
red = 1,
|
||||
green = 1,
|
||||
blue = 1,
|
||||
alpha = 1,
|
||||
material = RegisterMaterial("vcs_0"),
|
||||
}))
|
||||
return f40_local0
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user