2440 lines
58 KiB
Lua
2440 lines
58 KiB
Lua
local f0_local0 = module
|
|
local f0_local1, f0_local2 = ...
|
|
f0_local0( f0_local1, package.seeall )
|
|
CoD.PrintModuleLoad( _NAME )
|
|
FFAGameType = "dm"
|
|
TDMGameType = "war"
|
|
SDGameType = "sd"
|
|
DomGameType = "dom"
|
|
ConfGameType = "conf"
|
|
MuggerGameType = "mugger"
|
|
AliensGameType = "aliens"
|
|
SRGameType = "sr"
|
|
InfectGameType = "infect"
|
|
BlitzGameType = "blitz"
|
|
GrindGameType = "grind"
|
|
CrankedGameType = "cranked"
|
|
SOTFGameType = "sotf"
|
|
SOTF_FFA_GameType = "sotf_ffa"
|
|
SafeguardGameType = "horde"
|
|
GunGameType = "gun"
|
|
GrndGameType = "grnd"
|
|
SiegeGameType = "siege"
|
|
function count( f1_arg0 )
|
|
if f1_arg0 == nil then
|
|
return 0
|
|
end
|
|
local f1_local0 = 0
|
|
for f1_local4, f1_local5 in pairs( f1_arg0 ) do
|
|
f1_local0 = f1_local0 + 1
|
|
end
|
|
return f1_local0
|
|
end
|
|
|
|
GameTypeRefCol = 0
|
|
GameTypeNameCol = 1
|
|
GameTypeDescCol = 2
|
|
GameTypeImageCol = 3
|
|
function GetCurrentGameTypeLocalizedInfo( f2_arg0 )
|
|
local f2_local0 = Engine.TableLookup( "mp/gameTypesTable.csv", GameTypeRefCol, GetCurrentGameType(), f2_arg0 )
|
|
local f2_local1 = "@"
|
|
local f2_local2
|
|
if f2_arg0 == GameTypeNameCol then
|
|
f2_local2 = "_CAPS"
|
|
if not f2_local2 then
|
|
|
|
else
|
|
local f2_local3
|
|
if f2_local0 then
|
|
f2_local3 = Engine.Localize( f2_local1 .. f2_local0 .. f2_local2 )
|
|
if not f2_local3 then
|
|
|
|
else
|
|
return f2_local3
|
|
end
|
|
end
|
|
f2_local3 = "GAMETYPE NOT FOUND"
|
|
end
|
|
end
|
|
f2_local2 = ""
|
|
end
|
|
|
|
function GetGameTypeIcon()
|
|
local f3_local0 = GetCurrentGameType()
|
|
assert( f3_local0, "GAMETYPE NOT FOUND" )
|
|
local f3_local1 = Engine.TableLookup( "mp/gameTypesTable.csv", GameTypeRefCol, f3_local0, GameTypeImageCol )
|
|
local f3_local2
|
|
if f3_local1 then
|
|
f3_local2 = RegisterMaterial( f3_local1 )
|
|
if not f3_local2 then
|
|
|
|
else
|
|
return f3_local2
|
|
end
|
|
end
|
|
f3_local2 = RegisterMaterial( "icon_playlist_generic" )
|
|
end
|
|
|
|
function CreateDefaultClassesAction( f4_arg0, f4_arg1 )
|
|
LUI.FlowManager.RequestAddMenu( f4_arg0, "cac_edit_main", true, f4_arg1.controller, false, {
|
|
open_char_list = true,
|
|
classLocation = "defaultClassesTeam2"
|
|
} )
|
|
end
|
|
|
|
function RestrictCustomClassesAction( f5_arg0, f5_arg1 )
|
|
LUI.FlowManager.RequestAddMenu( f5_arg0, "menu_custom_class_restrictions", true, f5_arg1.controller )
|
|
end
|
|
|
|
function LeaveGameSetupOptionsMenu( f6_arg0, f6_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f6_arg0 )
|
|
end
|
|
|
|
function GetLeaveOptionsWindowFunctionForButton( f7_arg0 )
|
|
return function ( f8_arg0, f8_arg1 )
|
|
local f8_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "settings_recipe_rules_base" )
|
|
f8_local0.currentBackButtonAction = LeaveGameSetupOptionsMenu
|
|
Engine.PlaySound( CoD.SFX.SelectBack )
|
|
f8_arg0:dispatchEventToRoot( {
|
|
name = "button_unlock",
|
|
immediate = true
|
|
} )
|
|
f8_arg0:dispatchEventToRoot( {
|
|
name = "options_window_unfocus",
|
|
immediate = true
|
|
} )
|
|
f8_arg0:dispatchEventToRoot( {
|
|
name = "options_categories_window_focus",
|
|
immediate = true
|
|
} )
|
|
if f7_arg0 then
|
|
f7_arg0:processEvent( {
|
|
name = "gain_focus",
|
|
immediate = true
|
|
} )
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
function BackButtonAction( f9_arg0, f9_arg1 )
|
|
local f9_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f9_arg0 )
|
|
f9_local0.currentBackButtonAction( f9_arg0, f9_arg1 )
|
|
end
|
|
|
|
function SaveRecipeToMyModes( f10_arg0, f10_arg1 )
|
|
MatchRules.OpenSelectionMenu( f10_arg1.controller, {
|
|
savedMode = "save",
|
|
menuAction = "save",
|
|
menu_title = Engine.Localize( "@LUA_MENU_MY_MODES" ),
|
|
return_menu = "settings_recipe_rules_base"
|
|
} )
|
|
end
|
|
|
|
function IsHardcoreModeFunc()
|
|
return MatchRules.GetData( "commonOption", "hardcoreModeOn" )
|
|
end
|
|
|
|
function OptionFactory( f12_arg0, f12_arg1, f12_arg2, f12_arg3, f12_arg4, f12_arg5 )
|
|
local f12_local0 = function ()
|
|
local f13_local0 = MatchRules.GetData( f12_arg0, f12_arg1 )
|
|
for f13_local4, f13_local5 in pairs( f12_arg3 ) do
|
|
if f13_local5.value == f13_local0 then
|
|
return f13_local4
|
|
end
|
|
end
|
|
return 1
|
|
end
|
|
|
|
local f12_local1 = function ( f14_arg0, f14_arg1 )
|
|
MatchRules.SetData( f12_arg0, f12_arg1, f12_arg3[f14_arg1.currentIndex].value )
|
|
f14_arg0:dispatchEventToRoot( {
|
|
name = "rule_changed_" .. f12_arg0 .. "_" .. f12_arg1,
|
|
immediate = true
|
|
} )
|
|
end
|
|
|
|
if not f12_arg5 then
|
|
f12_arg5 = {}
|
|
end
|
|
f12_arg5.element_refresh = MBh.EmitEvent( "content_refresh" )
|
|
return {
|
|
type = "UIGenericButton",
|
|
id = "option_" .. f12_arg0 .. "_" .. f12_arg1,
|
|
disabledFunc = function ( f15_arg0, f15_arg1 )
|
|
if MLG.AreMLGRulesEnabled() then
|
|
return true
|
|
elseif f12_arg4 then
|
|
return f12_arg4( f15_arg0, f15_arg1 )
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
,
|
|
audio = {
|
|
button_over = CoD.SFX.SubMenuMouseOver
|
|
},
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.GlassButton,
|
|
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.SubMenu,
|
|
variant = GenericButtonSettings.Variants.Select,
|
|
button_text = Engine.Localize( f12_arg2 ),
|
|
text_padding_with_content = 10,
|
|
text_align_with_content = LUI.Alignment.Left,
|
|
button_display_func = function ( f16_arg0, f16_arg1 )
|
|
local f16_local0 = f12_local0()
|
|
return Engine.Localize( f12_arg3[f12_local0()].text )
|
|
end
|
|
,
|
|
button_left_func = function ( f17_arg0, f17_arg1 )
|
|
f17_arg1.currentIndex = 1 + (#f12_arg3 + f12_local0() - 1 - 1) % #f12_arg3
|
|
f12_local1( f17_arg0, f17_arg1 )
|
|
end
|
|
,
|
|
button_right_func = function ( f18_arg0, f18_arg1 )
|
|
f18_arg1.currentIndex = 1 + (f12_local0() - 1 + 1) % #f12_arg3
|
|
f12_local1( f18_arg0, f18_arg1 )
|
|
end
|
|
|
|
},
|
|
handlers = f12_arg5 or {}
|
|
}
|
|
end
|
|
|
|
function OptionFactoryDvarInt( f19_arg0, f19_arg1, f19_arg2, f19_arg3, f19_arg4 )
|
|
local f19_local0 = 1
|
|
local f19_local1 = Engine.GetDvarInt( f19_arg0 )
|
|
for f19_local5, f19_local6 in pairs( f19_arg2 ) do
|
|
if f19_local6.value == f19_local1 then
|
|
f19_local0 = f19_local5
|
|
break
|
|
end
|
|
end
|
|
return {
|
|
type = "UIGenericButton",
|
|
id = "option_" .. f19_arg0,
|
|
audio = {
|
|
button_over = CoD.SFX.SubMenuMouseOver
|
|
},
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.GlassButton,
|
|
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.SubMenu,
|
|
variant = GenericButtonSettings.Variants.Select,
|
|
button_text = Engine.Localize( f19_arg1 ),
|
|
text_padding_with_content = 10,
|
|
text_align_with_content = LUI.Alignment.Left,
|
|
button_display_func = function ( f20_arg0, f20_arg1 )
|
|
return Engine.Localize( f19_arg2[f19_local0].text )
|
|
end
|
|
,
|
|
button_left_func = function ( f21_arg0, f21_arg1 )
|
|
f19_local0 = 1 + (#f19_arg2 + f19_local0 - 1 - 1) % #f19_arg2
|
|
Engine.SetDvarInt( f19_arg0, f19_arg2[f19_local0].value )
|
|
end
|
|
,
|
|
button_right_func = function ( f22_arg0, f22_arg1 )
|
|
f19_local0 = 1 + (f19_local0 - 1 + 1) % #f19_arg2
|
|
Engine.SetDvarInt( f19_arg0, f19_arg2[f19_local0].value )
|
|
end
|
|
|
|
},
|
|
handlers = f19_arg4 or {}
|
|
}
|
|
end
|
|
|
|
function OptionFactoryUserString( f23_arg0, f23_arg1, f23_arg2, f23_arg3, f23_arg4 )
|
|
local f23_local0 = function ()
|
|
local f24_local0 = MatchRules.GetData( f23_arg0, f23_arg1 )
|
|
if f24_local0 and f24_local0 ~= "" then
|
|
return f24_local0
|
|
else
|
|
return Engine.Localize( f23_arg3 )
|
|
end
|
|
end
|
|
|
|
return {
|
|
type = "UIGenericButton",
|
|
id = "option_" .. f23_arg0 .. "_" .. f23_arg1,
|
|
disabledFunc = function ( f25_arg0, f25_arg1 )
|
|
return false
|
|
end
|
|
,
|
|
audio = {
|
|
button_over = CoD.SFX.SubMenuMouseOver
|
|
},
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.GlassButton,
|
|
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.SubMenu,
|
|
variant = GenericButtonSettings.Variants.Info,
|
|
button_text = Engine.Localize( f23_arg2 ),
|
|
text_padding_with_content = 10,
|
|
text_align_with_content = LUI.Alignment.Left,
|
|
button_display_func = function ( f26_arg0, f26_arg1 )
|
|
return Engine.Localize( f23_local0() )
|
|
end
|
|
,
|
|
button_action_func = function ( f27_arg0, f27_arg1 )
|
|
local f27_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f27_arg0 )
|
|
f27_local0.OnscreenKeyboardListener = f27_arg0
|
|
Engine.OpenScreenKeyboard( f27_arg1.controller, Engine.Localize( "@LUA_MENU_ENTER_NAME" ), f23_local0() or "", f23_arg4, true, false )
|
|
end
|
|
|
|
},
|
|
handlers = {
|
|
element_refresh = MBh.EmitEvent( "content_refresh" ),
|
|
set_string_option_value = function ( f28_arg0, f28_arg1 )
|
|
assert( f28_arg1.text ~= nil )
|
|
MatchRules.SetData( f23_arg0, f23_arg1, f28_arg1.text )
|
|
f28_arg0:processEvent( {
|
|
name = "content_refresh",
|
|
immediate = true
|
|
} )
|
|
end
|
|
|
|
}
|
|
}
|
|
end
|
|
|
|
function GameOptionsFeeder()
|
|
local f29_local0 = {}
|
|
local f29_local1 = GetCurrentGameType()
|
|
local f29_local2 = function ()
|
|
return true
|
|
end
|
|
|
|
if f29_local1 == FFAGameType or f29_local1 == TDMGameType or f29_local1 == DomGameType or f29_local1 == ConfGameType or f29_local1 == AliensGameType or f29_local1 == BlitzGameType or f29_local1 == GrindGameType or f29_local1 == CrankedGameType or f29_local1 == SOTFGameType or f29_local1 == SOTF_FFA_GameType or f29_local1 == GunGameType or f29_local1 == GrndGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "timeLimit", "@LUA_MENU_RULES_TIME_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_5MINUTES",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_10MINUTES",
|
|
value = 10
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_20MINUTES",
|
|
value = 20
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_30MINUTES",
|
|
value = 30
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == FFAGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "scoreLimit", "@LUA_MENU_RULES_SCORE_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_10POINTS",
|
|
value = 10
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_15POINTS",
|
|
value = 15
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_30POINTS",
|
|
value = 30
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_50POINTS",
|
|
value = 50
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_75POINTS",
|
|
value = 75
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SOTFGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "scoreLimit", "@LUA_MENU_RULES_SCORE_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_20POINTS",
|
|
value = 20
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_50POINTS",
|
|
value = 50
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_65POINTS",
|
|
value = 65
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_75POINTS",
|
|
value = 75
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_100POINTS",
|
|
value = 100
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SOTF_FFA_GameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "scoreLimit", "@LUA_MENU_RULES_SCORE_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_10POINTS",
|
|
value = 10
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_15POINTS",
|
|
value = 15
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_25POINTS",
|
|
value = 25
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_30POINTS",
|
|
value = 30
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_50POINTS",
|
|
value = 50
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_65POINTS",
|
|
value = 65
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == TDMGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "scoreLimit", "@LUA_MENU_RULES_SCORE_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_20POINTS",
|
|
value = 20
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_50POINTS",
|
|
value = 50
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_75POINTS",
|
|
value = 75
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_100POINTS",
|
|
value = 100
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_150POINTS",
|
|
value = 150
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == CrankedGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "scoreLimit", "@LUA_MENU_RULES_SCORE_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_40POINTS",
|
|
value = 40
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_100POINTS",
|
|
value = 100
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_150POINTS",
|
|
value = 150
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_200POINTS",
|
|
value = 200
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_300POINTS",
|
|
value = 300
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == GrndGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "scoreLimit", "@LUA_MENU_RULES_SCORE_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@DLC_MENU_RULES_1000",
|
|
value = 1000
|
|
},
|
|
{
|
|
text = "@DLC_MENU_RULES_4000",
|
|
value = 4000
|
|
},
|
|
{
|
|
text = "@DLC_MENU_RULES_7500",
|
|
value = 7500
|
|
},
|
|
{
|
|
text = "@DLC_MENU_RULES_9000",
|
|
value = 9000
|
|
},
|
|
{
|
|
text = "@DLC_MENU_RULES_12000",
|
|
value = 12000
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == GrndGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "grndData", "dropTime", "@DLC_MENU_RULES_DROP_TIME", {
|
|
{
|
|
text = "@LUA_MENU_RULES_NEVER",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_5SECONDS",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_15SECONDS",
|
|
value = 15
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_30SECONDS",
|
|
value = 30
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_45SECONDS",
|
|
value = 45
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_1MINUTE",
|
|
value = 60
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == GrndGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "grndData", "zoneSwitchTime", "@DLC_MENU_RULES_ZONE_TIME", {
|
|
{
|
|
text = "@DLC_MENU_RULES_1_MINUTES",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@DLC_MENU_RULES_2_MINUTES",
|
|
value = 2
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_3MINUTES",
|
|
value = 3
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_5MINUTES",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_8MINUTES",
|
|
value = 8
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SDGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "sdData", "roundLength", "@LUA_MENU_RULES_ROUND_LENGTH", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_1_5MINUTES",
|
|
value = 1.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_2_5MINUTES",
|
|
value = 2.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_3MINUTES",
|
|
value = 3
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_5MINUTES",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_8MINUTES",
|
|
value = 8
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SRGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "srData", "roundLength", "@LUA_MENU_RULES_ROUND_LENGTH", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_1_5MINUTES",
|
|
value = 1.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_2_5MINUTES",
|
|
value = 2.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_3MINUTES",
|
|
value = 3
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_5MINUTES",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_8MINUTES",
|
|
value = 8
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SDGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "sdData", "bombTimer", "@LUA_MENU_RULES_BOMB_TIMER", {
|
|
{
|
|
text = "@LUA_MENU_RULES_5SECONDS",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_15SECONDS",
|
|
value = 15
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_30SECONDS",
|
|
value = 30
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_45SECONDS",
|
|
value = 45
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_1MINUTE",
|
|
value = 60
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SRGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "srData", "bombTimer", "@LUA_MENU_RULES_BOMB_TIMER", {
|
|
{
|
|
text = "@LUA_MENU_RULES_5SECONDS",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_15SECONDS",
|
|
value = 15
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_30SECONDS",
|
|
value = 30
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_45SECONDS",
|
|
value = 45
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_1MINUTE",
|
|
value = 60
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SDGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "sdData", "plantTime", "@LUA_MENU_RULES_PLANT_TIME", {
|
|
{
|
|
text = "@LUA_MENU_RULES_1SECOND",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_2_5SECONDS",
|
|
value = 2.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_5SECONDS",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_7_5SECONDS",
|
|
value = 7.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_10SECONDS",
|
|
value = 10
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SRGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "srData", "plantTime", "@LUA_MENU_RULES_PLANT_TIME", {
|
|
{
|
|
text = "@LUA_MENU_RULES_1SECOND",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_2_5SECONDS",
|
|
value = 2.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_5SECONDS",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_7_5SECONDS",
|
|
value = 7.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_10SECONDS",
|
|
value = 10
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SDGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "sdData", "defuseTime", "@LUA_MENU_RULES_DEFUSE_TIME", {
|
|
{
|
|
text = "@LUA_MENU_RULES_1SECOND",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_2_5SECONDS",
|
|
value = 2.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_5SECONDS",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_7_5SECONDS",
|
|
value = 7.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_10SECONDS",
|
|
value = 10
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SRGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "srData", "defuseTime", "@LUA_MENU_RULES_DEFUSE_TIME", {
|
|
{
|
|
text = "@LUA_MENU_RULES_1SECOND",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_2_5SECONDS",
|
|
value = 2.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_5SECONDS",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_7_5SECONDS",
|
|
value = 7.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_10SECONDS",
|
|
value = 10
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SOTFGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "sotfData", "crateAmount", "@LUA_MENU_RULES_SOTF_CRATE_AMOUNT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_1CRATE",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_2CRATE",
|
|
value = 2
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_3CRATE",
|
|
value = 3
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_4CRATE",
|
|
value = 4
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_5CRATE",
|
|
value = 5
|
|
}
|
|
} )
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "sotfData", "crateGunAmount", "@LUA_MENU_RULES_SOTF_CRATE_GUN", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_1GUN",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_3GUN",
|
|
value = 3
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_6GUN",
|
|
value = 6
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_9GUN",
|
|
value = 9
|
|
}
|
|
} )
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "sotfData", "crateDropTimer", "@LUA_MENU_RULES_SOTF_CRATE_TIMER", {
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_5SECOND",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_15SECOND",
|
|
value = 15
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_30SECOND",
|
|
value = 30
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_45SECOND",
|
|
value = 45
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_60SECOND",
|
|
value = 60
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SOTF_FFA_GameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "sotfFFAData", "crateAmount", "@LUA_MENU_RULES_SOTF_CRATE_AMOUNT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_1CRATE",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_2CRATE",
|
|
value = 2
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_3CRATE",
|
|
value = 3
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_4CRATE",
|
|
value = 4
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_5CRATE",
|
|
value = 5
|
|
}
|
|
} )
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "sotfFFAData", "crateGunAmount", "@LUA_MENU_RULES_SOTF_CRATE_GUN", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_1GUN",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_3GUN",
|
|
value = 3
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_6GUN",
|
|
value = 6
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_9GUN",
|
|
value = 9
|
|
}
|
|
} )
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "sotfFFAData", "crateDropTimer", "@LUA_MENU_RULES_SOTF_CRATE_TIMER", {
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_5SECOND",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_15SECOND",
|
|
value = 15
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_30SECOND",
|
|
value = 30
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_45SECOND",
|
|
value = 45
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SOTF_CRATE_60SECOND",
|
|
value = 60
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SDGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "sdData", "multiBomb", "@LUA_MENU_RULES_MULTI_BOMB", {
|
|
{
|
|
text = "@LUA_MENU_DISABLED",
|
|
value = false
|
|
},
|
|
{
|
|
text = "@LUA_MENU_ENABLED",
|
|
value = true
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SRGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "srData", "multiBomb", "@LUA_MENU_RULES_MULTI_BOMB", {
|
|
{
|
|
text = "@LUA_MENU_DISABLED",
|
|
value = false
|
|
},
|
|
{
|
|
text = "@LUA_MENU_ENABLED",
|
|
value = true
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SDGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "scoreLimit", "@LUA_MENU_RULES_SCORE_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_1POINT",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_2POINTS",
|
|
value = 2
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_4POINTS",
|
|
value = 4
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_6POINTS",
|
|
value = 6
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_8POINTS",
|
|
value = 8
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_12POINTS",
|
|
value = 12
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SRGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "scoreLimit", "@LUA_MENU_RULES_SCORE_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_1POINT",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_2POINTS",
|
|
value = 2
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_4POINTS",
|
|
value = 4
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_6POINTS",
|
|
value = 6
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_8POINTS",
|
|
value = 8
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_12POINTS",
|
|
value = 12
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SDGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "sdData", "roundSwitch", "@LUA_MENU_RULES_ROUND_SWITCH", {
|
|
{
|
|
text = "@LUA_MENU_RULES_NEVER",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_EVERY_ROUND",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_EVERY_2ROUNDS",
|
|
value = 2
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_EVERY_3ROUNDS",
|
|
value = 3
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_EVERY_4ROUNDS",
|
|
value = 4
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SRGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "srData", "roundSwitch", "@LUA_MENU_RULES_ROUND_SWITCH", {
|
|
{
|
|
text = "@LUA_MENU_RULES_NEVER",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_EVERY_ROUND",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_EVERY_2ROUNDS",
|
|
value = 2
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_EVERY_3ROUNDS",
|
|
value = 3
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_EVERY_4ROUNDS",
|
|
value = 4
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == DomGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "scoreLimit", "@LUA_MENU_RULES_SCORE_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_50POINTS",
|
|
value = 50
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_100POINTS",
|
|
value = 100
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_200POINTS",
|
|
value = 200
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_500POINTS",
|
|
value = 500
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_750POINTS",
|
|
value = 750
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == ConfGameType or f29_local1 == GrindGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "scoreLimit", "@LUA_MENU_RULES_SCORE_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_10POINTS",
|
|
value = 10
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_30POINTS",
|
|
value = 30
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_65POINTS",
|
|
value = 65
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_80POINTS",
|
|
value = 80
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_100POINTS",
|
|
value = 100
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == MuggerGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "timeLimit", "@LUA_MENU_RULES_TIME_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_3MINUTES",
|
|
value = 3
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_7MINUTES",
|
|
value = 7
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_10MINUTES",
|
|
value = 10
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_20MINUTES",
|
|
value = 20
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == MuggerGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "scoreLimit", "@LUA_MENU_RULES_SCORE_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_1500POINTS",
|
|
value = 1500
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_2500POINTS",
|
|
value = 2500
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_5000POINTS",
|
|
value = 5000
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_7500POINTS",
|
|
value = 7500
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_10000POINTS",
|
|
value = 10000
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == MuggerGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "muggerData", "bankLimit", "@LUA_MENU_RULES_MUGGER_BANK_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_1",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_5",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_10",
|
|
value = 10
|
|
},
|
|
{
|
|
text = "@LUA_MENU_20",
|
|
value = 20
|
|
}
|
|
}, IsHardcoreModeFunc )
|
|
end
|
|
if f29_local1 == MuggerGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "muggerData", "jackpotLimit", "@LUA_MENU_RULES_MUGGER_JACKPOT_LIMIT", {
|
|
{
|
|
text = "LUA_MENU_RULES_NONE",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "LUA_MENU_RULES_HALF",
|
|
value = 100
|
|
},
|
|
{
|
|
text = "LUA_MENU_RULES_NORMAL",
|
|
value = 50
|
|
},
|
|
{
|
|
text = "LUA_MENU_RULES_DOUBLE",
|
|
value = 25
|
|
}
|
|
}, IsHardcoreModeFunc )
|
|
end
|
|
if f29_local1 == MuggerGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "muggerData", "throwKnifeFrac", "@LUA_MENU_RULES_MUGGER_THROW_KNIFE_FRAC", {
|
|
{
|
|
text = "LUA_MENU_RULES_NO_TAGS",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "LUA_MENU_RULES_HALF_TAGS",
|
|
value = 0.5
|
|
},
|
|
{
|
|
text = "LUA_MENU_RULES_ALL_TAGS",
|
|
value = 1
|
|
}
|
|
}, IsHardcoreModeFunc )
|
|
end
|
|
if f29_local1 == InfectGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "scoreLimit", "@LUA_MENU_RULES_SCORE_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
}
|
|
}, f29_local2 )
|
|
end
|
|
if f29_local1 == BlitzGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "scoreLimit", "@LUA_MENU_RULES_SCORE_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_4POINTS",
|
|
value = 4
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_6POINTS",
|
|
value = 6
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_10POINTS",
|
|
value = 10
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_16POINTS",
|
|
value = 16
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_20POINTS",
|
|
value = 20
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_30POINTS",
|
|
value = 30
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == AliensGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "scoreLimit", "@LUA_MENU_RULES_SCORE_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_1000POINTS",
|
|
value = 1000
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_1500POINTS",
|
|
value = 1500
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_3000POINTS",
|
|
value = 3000
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_5000POINTS",
|
|
value = 5000
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_7000POINTS",
|
|
value = 7000
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SafeguardGameType then
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "hordeData", "difficulty", "@LUA_MENU_SAFEGUARD_MODE_TYPE", {
|
|
{
|
|
text = "@LUA_MENU_SAFEGUARD_DIFFICULTY_EASY",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_SAFEGUARD_DIFFICULTY_HARD",
|
|
value = 2
|
|
},
|
|
{
|
|
text = "@LUA_MENU_SAFEGUARD_DIFFICULTY_INFINITE",
|
|
value = 3
|
|
}
|
|
} )
|
|
end
|
|
if f29_local1 == SiegeGameType then
|
|
local f29_local3 = function ()
|
|
return not MatchRules.GetData( "siegeData", "rushTimer" )
|
|
end
|
|
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "commonOption", "scoreLimit", "@LUA_MENU_RULES_SCORE_LIMIT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_1POINT",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_2POINTS",
|
|
value = 2
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_4POINTS",
|
|
value = 4
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_6POINTS",
|
|
value = 6
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_8POINTS",
|
|
value = 8
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_12POINTS",
|
|
value = 12
|
|
}
|
|
} )
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "siegeData", "roundSwitch", "@LUA_MENU_RULES_ROUND_SWITCH", {
|
|
{
|
|
text = "@LUA_MENU_RULES_NEVER",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_EVERY_ROUND",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_EVERY_2ROUNDS",
|
|
value = 2
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_EVERY_3ROUNDS",
|
|
value = 3
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_EVERY_4ROUNDS",
|
|
value = 4
|
|
}
|
|
} )
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "siegeData", "roundLength", "@LUA_MENU_RULES_ROUND_LENGTH", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_1_5MINUTES",
|
|
value = 1.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_2_5MINUTES",
|
|
value = 2.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_3MINUTES",
|
|
value = 3
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_5MINUTES",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_8MINUTES",
|
|
value = 8
|
|
}
|
|
} )
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "siegeData", "capRate", "@LUA_MENU_MP_RULES_CAP_RATE", {
|
|
{
|
|
text = "@LUA_MENU_RULES_1SECOND",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_2_5SECONDS",
|
|
value = 2.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_5SECONDS",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_7_5SECONDS",
|
|
value = 7.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_10SECONDS",
|
|
value = 10
|
|
}
|
|
} )
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "siegeData", "rushTimer", "@LUA_MENU_MP_RULES_RUSH_TIMER", {
|
|
{
|
|
text = "@LUA_MENU_DISABLED",
|
|
value = false
|
|
},
|
|
{
|
|
text = "@LUA_MENU_ENABLED",
|
|
value = true
|
|
}
|
|
} )
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "siegeData", "rushTimerAmount", "@LUA_MENU_MP_RULES_RUSH_TIMER_AMOUNT", {
|
|
{
|
|
text = "@LUA_MENU_RULES_30SECONDS",
|
|
value = 30
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_45SECONDS",
|
|
value = 45
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_1MINUTE",
|
|
value = 60
|
|
}
|
|
}, f29_local3, {
|
|
rule_changed_siegeData_rushTimer = function ( f32_arg0, f32_arg1 )
|
|
if f29_local3() then
|
|
f32_arg0:disable()
|
|
else
|
|
f32_arg0:enable()
|
|
end
|
|
end
|
|
} )
|
|
f29_local0[#f29_local0 + 1] = OptionFactory( "siegeData", "preCapPoints", "@LUA_MENU_MP_RULES_PRE_CAP", {
|
|
{
|
|
text = "@LUA_MENU_DISABLED",
|
|
value = false
|
|
},
|
|
{
|
|
text = "@LUA_MENU_ENABLED",
|
|
value = true
|
|
}
|
|
} )
|
|
end
|
|
if Engine.GetDvarBool( "xblive_competitionmatch" ) and (Engine.GetDvarBool( "systemlink" ) or IsPrivateMatch()) then
|
|
if not Engine.GetDvarInt( "scr_game_graceperiod_comp" ) then
|
|
Engine.Exec( "set scr_game_graceperiod_comp 60" )
|
|
end
|
|
f29_local0[#f29_local0 + 1] = OptionFactoryDvarInt( "scr_game_graceperiod_comp", "@LUA_MENU_PREMATCH_COUNTDOWN", {
|
|
{
|
|
text = "@LUA_MENU_RULES_1MINUTE",
|
|
value = 60
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_15SECONDS",
|
|
value = 15
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_30SECONDS",
|
|
value = 30
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_45SECONDS",
|
|
value = 45
|
|
}
|
|
} )
|
|
end
|
|
return f29_local0
|
|
end
|
|
|
|
function PlayerOptionsFeeder()
|
|
local f33_local0 = {}
|
|
local f33_local1 = GetCurrentGameType()
|
|
if f33_local1 ~= SafeguardGameType and f33_local1 ~= InfectGameType then
|
|
f33_local0[#f33_local0 + 1] = OptionFactory( "commonOption", "numLives", "@LUA_MENU_RULES_NUMBER_OF_LIVES", {
|
|
{
|
|
text = "@LUA_MENU_RULES_UNLIMITED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_ITEM_LIFE",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_ITEM_2LIVES",
|
|
value = 2
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_ITEM_3LIVES",
|
|
value = 3
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_ITEM_5LIVES",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_ITEM_9LIVES",
|
|
value = 9
|
|
}
|
|
} )
|
|
end
|
|
f33_local0[#f33_local0 + 1] = OptionFactory( "commonOption", "maxHealth", "@LUA_MENU_RULES_MAX_HEALTH", {
|
|
{
|
|
text = "@LUA_MENU_RULES_MINISCULE",
|
|
value = 30
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_HALF",
|
|
value = 50
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_NORMAL",
|
|
value = 100
|
|
},
|
|
{
|
|
text = "@LUA_MENU_MP_RULES_1_3_HEALTH",
|
|
value = 130
|
|
},
|
|
{
|
|
text = "@LUA_MENU_MP_RULES_1_5_HEALTH",
|
|
value = 150
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_DOUBLE",
|
|
value = 200
|
|
}
|
|
}, IsHardcoreModeFunc )
|
|
f33_local0[#f33_local0 + 1] = OptionFactory( "commonOption", "healthRegen", "@LUA_MENU_RULES_HEALTH_REGEN", {
|
|
{
|
|
text = "@LUA_MENU_RULES_NONE",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_SLOW",
|
|
value = 10
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_NORMAL",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_FAST",
|
|
value = 2
|
|
}
|
|
}, IsHardcoreModeFunc )
|
|
if f33_local1 ~= SafeguardGameType and f33_local1 ~= SOTFGameType and f33_local1 ~= SOTF_FFA_GameType and f33_local1 ~= GunGameType then
|
|
f33_local0[#f33_local0 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "create_default_classes",
|
|
disabledFunc = MLG.AreMLGRulesEnabled,
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.GlassButton,
|
|
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.SubMenu,
|
|
variant = GenericButtonSettings.Variants.Info,
|
|
button_display_func = function ( f34_arg0, f34_arg1 )
|
|
local f34_local0 = Cac.HasCustomClasses( 0, "privateMatchSquadMembers", 0, "defaultClassesTeam1" )
|
|
if not f34_local0 then
|
|
f34_local0 = Cac.HasCustomClasses( 0, "privateMatchSquadMembers", 0, "defaultClassesTeam2" )
|
|
end
|
|
local f34_local1
|
|
if f34_local0 then
|
|
f34_local1 = Engine.Localize( "MENU_CUSTOM" )
|
|
if not f34_local1 then
|
|
|
|
else
|
|
return f34_local1
|
|
end
|
|
end
|
|
f34_local1 = Engine.Localize( "MENU_NONE" )
|
|
end,
|
|
button_text = Engine.Localize( "@LUA_MENU_RULES_EDIT_DEF_CLASSES" ),
|
|
button_action_func = CreateDefaultClassesAction,
|
|
text_padding_with_content = 10,
|
|
text_align_with_content = LUI.Alignment.Left
|
|
},
|
|
handlers = {
|
|
element_refresh = MBh.EmitEvent( "content_refresh" )
|
|
}
|
|
}
|
|
end
|
|
return f33_local0
|
|
end
|
|
|
|
function TeamOptionsFeeder()
|
|
local f35_local0 = {}
|
|
local f35_local1 = GetCurrentGameType()
|
|
f35_local0[#f35_local0 + 1] = OptionFactory( "commonOption", "spectateModeAllowed", "@LUA_MENU_RULES_SPECTATING", {
|
|
{
|
|
text = "@LUA_MENU_DISABLED",
|
|
value = 0
|
|
},
|
|
{
|
|
text = IsCurrentGameTypeteamBased() and "@LUA_MENU_RULES_TEAM_ONLY" or "@LUA_MENU_RULES_PLAYERS_ONLY",
|
|
value = 1
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_FREE",
|
|
value = 2
|
|
}
|
|
} )
|
|
f35_local0[#f35_local0 + 1] = OptionFactory( "commonOption", "showKillcam", "@LUA_MENU_RULES_KILLCAM", {
|
|
{
|
|
text = "@LUA_MENU_DISABLED",
|
|
value = false
|
|
},
|
|
{
|
|
text = "@LUA_MENU_ENABLED",
|
|
value = true
|
|
}
|
|
}, IsHardcoreModeFunc )
|
|
f35_local0[#f35_local0 + 1] = OptionFactory( "commonOption", "radarAlwaysOn", "@LUA_MENU_RULES_RADAR_ALWAYS_ON", {
|
|
{
|
|
text = "@LUA_MENU_NO",
|
|
value = false
|
|
},
|
|
{
|
|
text = "@LUA_MENU_YES",
|
|
value = true
|
|
}
|
|
}, IsHardcoreModeFunc )
|
|
if f35_local1 ~= InfectGameType and f35_local1 ~= GunGameType then
|
|
f35_local0[#f35_local0 + 1] = OptionFactory( "commonOption", "respawnDelay", "@LUA_MENU_RULES_RESPAWN_DELAY", {
|
|
{
|
|
text = "@LUA_MENU_RULES_NONE",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_5SECONDS",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_7_5SECONDS",
|
|
value = 7.5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_10SECONDS",
|
|
value = 10
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_15SECONDS",
|
|
value = 15
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_30SECONDS",
|
|
value = 30
|
|
}
|
|
} )
|
|
f35_local0[#f35_local0 + 1] = OptionFactory( "commonOption", "waveRespawnDelay", "@LUA_MENU_RULES_WAVE_DELAY", {
|
|
{
|
|
text = "@LUA_MENU_RULES_NONE",
|
|
value = 0
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_5SECONDS",
|
|
value = 5
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_10SECONDS",
|
|
value = 10
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_15SECONDS",
|
|
value = 15
|
|
},
|
|
{
|
|
text = "@LUA_MENU_RULES_30SECONDS",
|
|
value = 30
|
|
}
|
|
} )
|
|
f35_local0[#f35_local0 + 1] = OptionFactory( "commonOption", "forceRespawn", "@LUA_MENU_RULES_FORCE_RESPAWN", {
|
|
{
|
|
text = "@LUA_MENU_DISABLED",
|
|
value = false
|
|
},
|
|
{
|
|
text = "@LUA_MENU_ENABLED",
|
|
value = true
|
|
}
|
|
} )
|
|
if IsCurrentGameTypeteamBased() then
|
|
f35_local0[#f35_local0 + 1] = OptionFactory( "commonOption", "friendlyFire", "@LUA_MENU_RULES_FRIENDLY_FIRE", {
|
|
{
|
|
text = "@LUA_MENU_DISABLED",
|
|
value = false
|
|
},
|
|
{
|
|
text = "@LUA_MENU_ENABLED",
|
|
value = true
|
|
}
|
|
}, IsHardcoreModeFunc )
|
|
end
|
|
end
|
|
if MLG.AreMLGRulesEnabled() then
|
|
f35_local0[#f35_local0 + 1] = OptionFactoryUserString( "commonOption", "ghostsTeamName", "@LUA_MENU_MP_GHOSTS_TEAM_NAME_OVERRIDE", "@LUA_MENU_ALLIES_CAPS", 12 )
|
|
f35_local0[#f35_local0 + 1] = OptionFactoryUserString( "commonOption", "fedTeamName", "@LUA_MENU_MP_FEDERATION_TEAM_NAME_OVERRIDE", "@LUA_MENU_AXIS_CAPS", 12 )
|
|
end
|
|
return f35_local0
|
|
end
|
|
|
|
function GameplayOptionsFeeder( f36_arg0 )
|
|
local f36_local0 = {}
|
|
local f36_local1 = GetCurrentGameType()
|
|
local f36_local2 = function ()
|
|
local f37_local0
|
|
if not SvS.IsSvS() then
|
|
f37_local0 = MatchRules.GetData( "commonOption", "allowCustomClasses" )
|
|
else
|
|
f37_local0 = false
|
|
end
|
|
return f37_local0
|
|
end
|
|
|
|
if f36_local1 ~= InfectGameType and f36_local1 ~= GunGameType then
|
|
f36_local0[#f36_local0 + 1] = OptionFactory( "commonOption", "allowPerks", "@LUA_MENU_RULES_PERKS", {
|
|
{
|
|
text = "@LUA_MENU_DISABLED",
|
|
value = false
|
|
},
|
|
{
|
|
text = "@LUA_MENU_ENABLED",
|
|
value = true
|
|
}
|
|
} )
|
|
end
|
|
f36_local0[#f36_local0 + 1] = OptionFactory( "commonOption", "hardcoreModeOn", "@LUA_MENU_RULES_HARDCORE", {
|
|
{
|
|
text = "@LUA_MENU_DISABLED",
|
|
value = false
|
|
},
|
|
{
|
|
text = "@LUA_MENU_ENABLED",
|
|
value = true
|
|
}
|
|
}, nil, {
|
|
rule_changed_commonOption_hardcoreModeOn = function ()
|
|
if IsHardcoreModeFunc() then
|
|
if f36_local1 == MuggerGameType then
|
|
MatchRules.SetData( "muggerData", "bankLimit", 10 )
|
|
MatchRules.SetData( "muggerData", "jackpotLimit", 0 )
|
|
MatchRules.SetData( "muggerData", "throwKnifeFrac", 1 )
|
|
end
|
|
MatchRules.SetData( "commonOption", "friendlyFire", true )
|
|
MatchRules.SetData( "commonOption", "maxHealth", 30 )
|
|
MatchRules.SetData( "commonOption", "respawnDelay", 10 )
|
|
MatchRules.SetData( "commonOption", "showKillcam", false )
|
|
MatchRules.SetData( "commonOption", "radarAlwaysOn", false )
|
|
MatchRules.SetData( "commonOption", "healthRegen", 0 )
|
|
end
|
|
end
|
|
} )
|
|
f36_local0[#f36_local0 + 1] = OptionFactory( "commonOption", "headshotsOnly", "@LUA_MENU_RULES_HEADSHOTS_ONLY", {
|
|
{
|
|
text = "@LUA_MENU_DISABLED",
|
|
value = false
|
|
},
|
|
{
|
|
text = "@LUA_MENU_ENABLED",
|
|
value = true
|
|
}
|
|
} )
|
|
if f36_local1 ~= SOTFGameType and f36_local1 ~= SOTF_FFA_GameType and f36_local1 ~= InfectGameType and f36_local1 ~= GunGameType then
|
|
f36_local0[#f36_local0 + 1] = OptionFactory( "commonOption", "allowKillstreaks", "@LUA_MENU_RULES_KILLSTREAKS", {
|
|
{
|
|
text = "@LUA_MENU_DISABLED",
|
|
value = false
|
|
},
|
|
{
|
|
text = "@LUA_MENU_ENABLED",
|
|
value = true
|
|
}
|
|
} )
|
|
f36_local0[#f36_local0 + 1] = OptionFactory( "commonOption", "allowIntel", "@LUA_MENU_RULES_INTEL", {
|
|
{
|
|
text = "@LUA_MENU_DISABLED",
|
|
value = false
|
|
},
|
|
{
|
|
text = "@LUA_MENU_ENABLED",
|
|
value = true
|
|
}
|
|
} )
|
|
if not SvS.IsSvS() and f36_local1 ~= SOTFGameType and f36_local1 ~= SOTF_FFA_GameType and f36_local1 ~= InfectGameType then
|
|
f36_local0[#f36_local0 + 1] = OptionFactory( "commonOption", "allowCustomClasses", "@LUA_MENU_RULES_CUSTOM_CLASSES", {
|
|
{
|
|
text = "@LUA_MENU_DISABLED",
|
|
value = false
|
|
},
|
|
{
|
|
text = "@LUA_MENU_ENABLED",
|
|
value = true
|
|
}
|
|
} )
|
|
f36_local0[#f36_local0 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "restrict_classes",
|
|
disabledFunc = function ()
|
|
return not f36_local2()
|
|
end,
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.GlassButton,
|
|
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.SubMenu,
|
|
variant = GenericButtonSettings.Variants.Info,
|
|
button_display_func = function ( f40_arg0, f40_arg1 )
|
|
local f40_local0 = MatchRules.AllowCustomClasses()
|
|
if f40_local0 then
|
|
f40_local0 = Cac.CheckWeaponRestrictions( "Primary", f36_arg0 )
|
|
if not f40_local0 then
|
|
f40_local0 = Cac.CheckWeaponRestrictions( "Secondary", f36_arg0 )
|
|
if not f40_local0 then
|
|
f40_local0 = Cac.CheckAttachmentRestrictionsHelper()
|
|
if not f40_local0 then
|
|
f40_local0 = Cac.CheckGrenadeRestrictions( 0 )
|
|
if not f40_local0 then
|
|
f40_local0 = Cac.CheckGrenadeRestrictions( 1 )
|
|
if not f40_local0 then
|
|
f40_local0 = Cac.CheckKillstreakRestrictions()
|
|
if not f40_local0 then
|
|
f40_local0 = Cac.CheckPerkRestrictions()
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
local f40_local1
|
|
if f40_local0 then
|
|
f40_local1 = Engine.Localize( "MENU_CUSTOM" )
|
|
if not f40_local1 then
|
|
|
|
else
|
|
return f40_local1
|
|
end
|
|
end
|
|
f40_local1 = Engine.Localize( "MENU_NONE" )
|
|
end,
|
|
button_text = Engine.Localize( "@LUA_MENU_RULES_CLASS_RESTRICT" ),
|
|
button_action_func = RestrictCustomClassesAction,
|
|
text_padding_with_content = 10,
|
|
text_align_with_content = LUI.Alignment.Left
|
|
},
|
|
handlers = {
|
|
rule_changed_commonOption_allowCustomClasses = function ( f41_arg0, f41_arg1 )
|
|
if f36_local2() then
|
|
f41_arg0:enable()
|
|
else
|
|
f41_arg0:disable()
|
|
end
|
|
end,
|
|
element_refresh = MBh.EmitEvent( "content_refresh" )
|
|
}
|
|
}
|
|
end
|
|
end
|
|
return f36_local0
|
|
end
|
|
|
|
function OptionsFeeder()
|
|
local f42_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "settings_recipe_rules_base" )
|
|
local f42_local1 = f42_local0.currentOptionsCategory
|
|
if f42_local1 == "gameplay_options" then
|
|
return GameplayOptionsFeeder( f42_local0.exclusiveController )
|
|
elseif f42_local1 == "team_options" then
|
|
return TeamOptionsFeeder()
|
|
elseif f42_local1 == "player_options" then
|
|
return PlayerOptionsFeeder()
|
|
else
|
|
return GameOptionsFeeder()
|
|
end
|
|
end
|
|
|
|
function OptionCategoryButtonOver( f43_arg0, f43_arg1 )
|
|
local f43_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f43_arg0 )
|
|
f43_local0.currentBackButtonAction = LeaveGameSetupOptionsMenu
|
|
OptionsWindowTriggerRefresh( f43_arg0, f43_arg1 )
|
|
end
|
|
|
|
function OptionsWindowTriggerRefresh( f44_arg0, f44_arg1 )
|
|
f44_arg0:dispatchEventToRoot( {
|
|
name = "options_window_refresh",
|
|
source_input = f44_arg1.name,
|
|
options_category = f44_arg0.properties.options_category,
|
|
focusType = f44_arg1.focusType,
|
|
source_button = f44_arg0,
|
|
immediate = true
|
|
} )
|
|
end
|
|
|
|
function OptionCategoryButtonAction( f45_arg0, f45_arg1 )
|
|
local f45_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f45_arg0 )
|
|
OptionsWindowTriggerRefresh( f45_arg0, f45_arg1 )
|
|
local f45_local1 = f45_arg0:getParent()
|
|
f45_local1:dispatchEventToChildren( {
|
|
name = "button_unlock",
|
|
immediate = true
|
|
} )
|
|
if not f45_arg1.mouse then
|
|
f45_local1 = LUI.FlowManager.GetMenuScopedDataFromElement( f45_arg0 )
|
|
f45_local1.currentBackButtonAction = GetLeaveOptionsWindowFunctionForButton( f45_arg0 )
|
|
f45_arg0:dispatchEventToRoot( {
|
|
name = "options_window_focus",
|
|
immediate = true
|
|
} )
|
|
f45_arg0:dispatchEventToRoot( {
|
|
name = "options_categories_window_unfocus",
|
|
immediate = true
|
|
} )
|
|
end
|
|
f45_arg0:processEvent( {
|
|
name = "button_lock"
|
|
} )
|
|
f45_local0.unlocked = false
|
|
end
|
|
|
|
function OptionsWindowRefresh( f46_arg0, f46_arg1 )
|
|
if not (not Engine.IsConsoleGame() or f46_arg1.source_input ~= "button_over") or not (Engine.IsConsoleGame() or f46_arg1.source_input ~= "button_action") or not Engine.IsConsoleGame() and f46_arg1.source_input == "button_over" and f46_arg1.focusType ~= FocusType.MouseOver then
|
|
local f46_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f46_arg0 )
|
|
f46_arg0:processEvent( {
|
|
name = "pre_menu_refresh",
|
|
options_category = f46_arg1.options_category
|
|
} )
|
|
f46_arg0:processEvent( {
|
|
name = "menu_refresh"
|
|
} )
|
|
f46_arg0:processEvent( {
|
|
name = "refresh_content"
|
|
} )
|
|
OptionsWindowResize( f46_arg0, f46_arg1 )
|
|
OptionsWindowTitleUpdate( f46_arg0, f46_arg1 )
|
|
if not f46_local0.unlocked then
|
|
f46_local0.unlocked = true
|
|
f46_arg0:dispatchEventToRoot( {
|
|
name = "button_unlock",
|
|
immediate = true
|
|
} )
|
|
f46_arg1.source_button:processEvent( {
|
|
name = "gain_focus",
|
|
immediate = true
|
|
} )
|
|
end
|
|
end
|
|
end
|
|
|
|
function OptionsWindowTitleUpdate( f47_arg0, f47_arg1 )
|
|
local f47_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f47_arg0 )
|
|
local f47_local1 = f47_local0.currentOptionsCategory
|
|
local f47_local2 = ""
|
|
if f47_local1 == "gameplay_options" then
|
|
f47_local2 = Engine.Localize( "@LUA_MENU_RULES_GAMEPLAY_OPTIONS" )
|
|
elseif f47_local1 == "team_options" then
|
|
f47_local2 = Engine.Localize( "@LUA_MENU_RULES_TEAM_OPTIONS" )
|
|
elseif f47_local1 == "player_options" then
|
|
f47_local2 = Engine.Localize( "@LUA_MENU_RULES_PLAYER_OPTIONS" )
|
|
else
|
|
f47_local2 = Engine.Localize( "@LUA_MENU_GAME_RULES" )
|
|
end
|
|
f47_arg0:processEvent( {
|
|
name = "update_title",
|
|
title_text = f47_local2
|
|
} )
|
|
end
|
|
|
|
function PrepareMenuRefresh( f48_arg0, f48_arg1 )
|
|
f48_arg0:closeChildren()
|
|
f48_arg0:clearSavedState()
|
|
local f48_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f48_arg0 )
|
|
if f48_arg1.options_category then
|
|
f48_local0.currentOptionsCategory = f48_arg1.options_category
|
|
end
|
|
end
|
|
|
|
function OptionsWindowResize( f49_arg0, f49_arg1 )
|
|
local f49_local0 = f49_arg0
|
|
local f49_local1 = f49_arg0.processEvent
|
|
local f49_local2 = {
|
|
name = "window_resize"
|
|
}
|
|
local f49_local3 = f49_arg0:getChildById( "gamesetup_options_window_content" )
|
|
f49_local2.options = f49_local3.childRecord
|
|
f49_local1( f49_local0, f49_local2 )
|
|
end
|
|
|
|
function OptionsWindowBGResize( f50_arg0, f50_arg1 )
|
|
f50_arg0:registerAnimationState( "current", {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = GenericTitleBarDims.TitleBarHeight,
|
|
bottom = GenericTitleBarDims.TitleBarHeight + count( f50_arg1.options ) * (GenericButtonSettings.Styles.GlassButton.SubStyles.Default.height + GAMESETUP_OPTIONS_WINDOW_SPACING) + 2 * GAMESETUP_OPTIONS_WINDOW_PADDING,
|
|
left = 0,
|
|
right = 0
|
|
} )
|
|
f50_arg0:animateToState( "current", 0 )
|
|
end
|
|
|
|
function OptionsWindowShadowResize( f51_arg0, f51_arg1 )
|
|
f51_arg0:registerAnimationState( "current", {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
left = 0,
|
|
right = 0,
|
|
bottom = GenericTitleBarDims.TitleBarHeight + count( f51_arg1.options ) * (GenericButtonSettings.Styles.GlassButton.SubStyles.Default.height + GAMESETUP_OPTIONS_WINDOW_SPACING) + 2 * GAMESETUP_OPTIONS_WINDOW_PADDING
|
|
} )
|
|
f51_arg0:animateToState( "current", 0 )
|
|
end
|
|
|
|
function LockCurrentButton( f52_arg0, f52_arg1 )
|
|
local f52_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f52_arg0 )
|
|
local f52_local1 = f52_arg0:getChildById( f52_local0.currentOptionsCategory )
|
|
if f52_local1 then
|
|
f52_local1:processEvent( {
|
|
name = "button_lock"
|
|
} )
|
|
f52_local0.unlocked = false
|
|
end
|
|
end
|
|
|
|
function CategoriesFeeder( f53_arg0 )
|
|
local f53_local0 = {}
|
|
local f53_local1 = GetCurrentGameType()
|
|
f53_local0[#f53_local0 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "game_options",
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.FlatButton,
|
|
substyle = GenericButtonSettings.Styles.FlatButton.SubStyles.SubMenu,
|
|
button_text = Engine.Localize( "@LUA_MENU_GAME_RULES" ),
|
|
options_category = "game_options"
|
|
},
|
|
handlers = {
|
|
button_over = OptionCategoryButtonOver,
|
|
button_action = OptionCategoryButtonAction
|
|
}
|
|
}
|
|
f53_local0[#f53_local0 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "player_options",
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.FlatButton,
|
|
substyle = GenericButtonSettings.Styles.FlatButton.SubStyles.SubMenu,
|
|
button_text = Engine.Localize( "@LUA_MENU_RULES_PLAYER_OPTIONS" ),
|
|
options_category = "player_options"
|
|
},
|
|
handlers = {
|
|
button_over = OptionCategoryButtonOver,
|
|
button_action = OptionCategoryButtonAction
|
|
}
|
|
}
|
|
if f53_local1 ~= SafeguardGameType then
|
|
f53_local0[#f53_local0 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "team_options",
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.FlatButton,
|
|
substyle = GenericButtonSettings.Styles.FlatButton.SubStyles.SubMenu,
|
|
button_text = Engine.Localize( "@LUA_MENU_RULES_TEAM_OPTIONS" ),
|
|
options_category = "team_options"
|
|
},
|
|
handlers = {
|
|
button_over = OptionCategoryButtonOver,
|
|
button_action = OptionCategoryButtonAction
|
|
}
|
|
}
|
|
end
|
|
if f53_local1 ~= SafeguardGameType then
|
|
f53_local0[#f53_local0 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "gameplay_options",
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.FlatButton,
|
|
substyle = GenericButtonSettings.Styles.FlatButton.SubStyles.SubMenu,
|
|
button_text = Engine.Localize( "@LUA_MENU_RULES_GAMEPLAY_OPTIONS" ),
|
|
options_category = "gameplay_options"
|
|
},
|
|
handlers = {
|
|
button_over = OptionCategoryButtonOver,
|
|
button_action = OptionCategoryButtonAction
|
|
}
|
|
}
|
|
end
|
|
f53_local0[#f53_local0 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "reset_options",
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.FlatButton,
|
|
substyle = GenericButtonSettings.Styles.FlatButton.SubStyles.SubMenu,
|
|
button_text = Engine.Localize( "LUA_MENU_SET_DEFAULT_CONTROLS" )
|
|
},
|
|
handlers = {
|
|
button_over = OptionCategoryButtonOver,
|
|
button_action = function ( f54_arg0, f54_arg1 )
|
|
LUI.FlowManager.RequestPopupMenu( f54_arg0, "popup_reset_game_options", true, f54_arg1.controller )
|
|
end
|
|
}
|
|
}
|
|
return f53_local0
|
|
end
|
|
|
|
function gamesetup_options_categories()
|
|
return {
|
|
type = "UIElement",
|
|
id = "gamesetup_options_categories_id",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
top = 120,
|
|
height = 500,
|
|
left = 134,
|
|
width = 270
|
|
}
|
|
},
|
|
handlers = {
|
|
options_categories_window_focus = MBh.EmitEvent( "gain_focus" ),
|
|
options_categories_window_unfocus = MBh.EmitEvent( "lose_focus" )
|
|
},
|
|
children = {
|
|
{
|
|
type = "generic_menu_background_withfade",
|
|
properties = {
|
|
top_offset = 0
|
|
}
|
|
},
|
|
{
|
|
type = "UIElement",
|
|
id = "padding",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0
|
|
}
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIVerticalList",
|
|
id = "options_categories_vlist",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 1,
|
|
right = -1,
|
|
top = 1,
|
|
bottom = 0,
|
|
spacing = 0
|
|
}
|
|
},
|
|
handlers = {
|
|
menu_create = LockCurrentButton
|
|
},
|
|
childrenFeeder = CategoriesFeeder
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
id = "game_mode_icon",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = false,
|
|
rightAnchor = false,
|
|
top = 173,
|
|
width = 256,
|
|
height = 256,
|
|
material = GetGameTypeIcon()
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "game_mode_description",
|
|
properties = {
|
|
text = GetCurrentGameTypeLocalizedInfo( GameTypeDescCol )
|
|
},
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 393,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
left = 20,
|
|
right = -20,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
red = Colors.primary_text_color.r,
|
|
green = Colors.primary_text_color.g,
|
|
blue = Colors.primary_text_color.b
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
GAMESETUP_OPTIONS_WINDOW_PADDING = 1
|
|
GAMESETUP_OPTIONS_WINDOW_SPACING = 2
|
|
function gamesetup_options_window()
|
|
return {
|
|
type = "UIElement",
|
|
id = "gamesetup_options_window_id",
|
|
properties = {
|
|
options_category = "game_options"
|
|
},
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
top = 120,
|
|
bottom = 219,
|
|
left = 460,
|
|
right = 1040
|
|
}
|
|
},
|
|
handlers = {
|
|
options_window_force_resize = OptionsWindowResize,
|
|
menu_create = OptionsWindowResize,
|
|
options_window_title_update = OptionsWindowTitleUpdate,
|
|
options_window_refresh = OptionsWindowRefresh,
|
|
options_window_focus = MBh.EmitEvent( "gain_focus" ),
|
|
options_window_unfocus = MBh.EmitEvent( "lose_focus" ),
|
|
mlg_enabled = function ( f57_arg0, f57_arg1 )
|
|
f57_arg0:processEvent( {
|
|
name = "menu_refresh"
|
|
} )
|
|
end
|
|
,
|
|
mlg_disabled = function ( f58_arg0, f58_arg1 )
|
|
f58_arg0:processEvent( {
|
|
name = "menu_refresh"
|
|
} )
|
|
end
|
|
,
|
|
text_input_complete = function ( f59_arg0, f59_arg1 )
|
|
local f59_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f59_arg0 )
|
|
if not f59_arg1.text then
|
|
f59_local0.OnscreenKeyboardListener = nil
|
|
return
|
|
end
|
|
assert( f59_local0.OnscreenKeyboardListener )
|
|
if f59_local0.OnscreenKeyboardListener then
|
|
f59_local0.OnscreenKeyboardListener:processEvent( {
|
|
name = "set_string_option_value",
|
|
text = f59_arg1.text,
|
|
controller = f59_arg1.controller
|
|
} )
|
|
f59_local0.OnscreenKeyboardListener = nil
|
|
end
|
|
end
|
|
|
|
},
|
|
children = {
|
|
{
|
|
type = "generic_drop_shadow",
|
|
id = "gamesetup_options_window_shadow",
|
|
properties = {
|
|
offset_shadow = 0
|
|
},
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
alpha = 0.75
|
|
}
|
|
},
|
|
handlers = {
|
|
window_resize = OptionsWindowShadowResize
|
|
}
|
|
},
|
|
{
|
|
type = "generic_menu_titlebar",
|
|
id = "gamesetup_options_window_title",
|
|
properties = {
|
|
font = CoD.TextSettings.BoldFont,
|
|
title_bar_text = "",
|
|
title_bar_text_indent = GenericTitleBarDims.TitleBarLCapWidth,
|
|
title_bar_alignment = LUI.Alignment.Left
|
|
},
|
|
handlers = {
|
|
menu_create = MBh.EmitEventToParent( "options_window_title_update" )
|
|
}
|
|
},
|
|
{
|
|
type = "generic_menu_background",
|
|
id = "gamesetup_options_window_background",
|
|
handlers = {
|
|
window_resize = OptionsWindowBGResize
|
|
}
|
|
},
|
|
{
|
|
type = "UIVerticalList",
|
|
id = "gamesetup_options_window_content",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = GenericTitleBarDims.TitleBarHeight + GAMESETUP_OPTIONS_WINDOW_PADDING,
|
|
bottom = 600,
|
|
left = GAMESETUP_OPTIONS_WINDOW_PADDING,
|
|
right = -GAMESETUP_OPTIONS_WINDOW_PADDING,
|
|
spacing = GAMESETUP_OPTIONS_WINDOW_SPACING
|
|
}
|
|
},
|
|
handlers = {
|
|
pre_menu_refresh = PrepareMenuRefresh
|
|
},
|
|
childrenFeeder = OptionsFeeder
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function gamesetup_options()
|
|
return {
|
|
type = "UIElement",
|
|
id = "gamesetup_options_id",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0
|
|
}
|
|
},
|
|
handlers = {
|
|
menu_create = GameSetupOptionsMainCreate,
|
|
update_timer = MLG.Refresh,
|
|
popup_inactive = function ( f61_arg0, f61_arg1 )
|
|
f61_arg0.properties = f61_arg0.properties or {}
|
|
f61_arg0.properties.cacheMLGenabled = nil
|
|
MLG.Refresh( f61_arg0, f61_arg1 )
|
|
end
|
|
|
|
},
|
|
children = {
|
|
{
|
|
type = "UITimer",
|
|
id = "update_timer",
|
|
properties = {
|
|
event = "update_timer",
|
|
disposable = false,
|
|
interval = 200
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = CoD.ColorizeState( Swatches.Overlay.Color, {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0,
|
|
material = RegisterMaterial( "white" ),
|
|
alpha = Swatches.Overlay.Alpha
|
|
} )
|
|
}
|
|
},
|
|
{
|
|
type = "generic_menu_title",
|
|
properties = {
|
|
menu_title = GetCurrentGameTypeLocalizedInfo( GameTypeNameCol )
|
|
}
|
|
},
|
|
{
|
|
type = "gamesetup_options_window",
|
|
id = "gamesetup_options_window_id"
|
|
},
|
|
{
|
|
type = "gamesetup_options_categories",
|
|
id = "gamesetup_options_categories_id"
|
|
},
|
|
{
|
|
type = "button_helper_text_main",
|
|
id = "button_helper_text_id"
|
|
},
|
|
{
|
|
type = "online_friends_widget",
|
|
id = "online_friends_widget_id"
|
|
},
|
|
{
|
|
type = "UIBindButton",
|
|
id = "back_button",
|
|
handlers = {
|
|
button_secondary = BackButtonAction,
|
|
button_alt1 = SaveRecipeToMyModes,
|
|
button_start = function ( f62_arg0, f62_arg1 )
|
|
local f62_local0 = f62_arg0:getParent()
|
|
MLG.Toggle( f62_local0, f62_arg1 )
|
|
f62_local0:processEvent( {
|
|
name = "options_window_force_resize"
|
|
} )
|
|
end
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function GameSetupOptionsMainCreate( f63_arg0, f63_arg1 )
|
|
local f63_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f63_arg0 )
|
|
if not f63_local0.currentBackButtonAction then
|
|
f63_local0.currentBackButtonAction = LeaveGameSetupOptionsMenu
|
|
end
|
|
if Engine.IsGamepadEnabled() == 1 and not Engine.IsConsoleGame() then
|
|
f63_local0.currentBackButtonAction = GetLeaveOptionsWindowFunctionForButton( f63_arg0:getChildById( "game_options" ) )
|
|
end
|
|
f63_arg0:processEvent( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_secondary",
|
|
helper_text = Engine.Localize( "@LUA_MENU_BACK" ),
|
|
side = "left",
|
|
clickable = true
|
|
} )
|
|
f63_arg0:processEvent( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_alt1",
|
|
helper_text = Engine.Localize( "@LUA_MENU_RECIPE_SAVE_CUSTOM" ) or "",
|
|
side = "left",
|
|
clickable = true
|
|
} )
|
|
MLG.Refresh( f63_arg0 )
|
|
end
|
|
|
|
LUI.MenuBuilder.registerDef( "gamesetup_options_categories", gamesetup_options_categories )
|
|
LUI.MenuBuilder.registerDef( "gamesetup_options_window", gamesetup_options_window )
|
|
LUI.MenuBuilder.registerDef( "settings_recipe_rules_base", gamesetup_options )
|
|
LockTable( _M )
|