init
This commit is contained in:
commit
b4b2350b88
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.luac
|
232
lui/actionscontrols.dec.lua
Normal file
232
lui/actionscontrols.dec.lua
Normal file
@ -0,0 +1,232 @@
|
||||
local f0_local0 = module
|
||||
local f0_local1, f0_local2 = ...
|
||||
f0_local0( f0_local1, package.seeall )
|
||||
CoD.PrintModuleLoad( _NAME )
|
||||
function GetDisplay( f1_arg0 )
|
||||
return Engine.GetBinding( f1_arg0 )
|
||||
end
|
||||
|
||||
function bindKey( f2_arg0 )
|
||||
Engine.BindKey( f2_arg0 )
|
||||
end
|
||||
|
||||
function OptionsWindowRefresh( f3_arg0, f3_arg1 )
|
||||
if f3_arg1.source_input == "button_action" or f3_arg1.source_input == "key_bound" then
|
||||
f3_arg0:processEvent( {
|
||||
name = "menu_refresh"
|
||||
} )
|
||||
f3_arg0:processEvent( {
|
||||
name = "refresh_content"
|
||||
} )
|
||||
end
|
||||
end
|
||||
|
||||
function OptionsWindowTriggerRefresh( f4_arg0, f4_arg1 )
|
||||
f4_arg0:dispatchEventToRoot( {
|
||||
name = "options_window_refresh",
|
||||
source_input = f4_arg1.name,
|
||||
immediate = true
|
||||
} )
|
||||
end
|
||||
|
||||
function SinglePlayerDisableFunction( f5_arg0, f5_arg1 )
|
||||
return not Engine.IsMultiplayer()
|
||||
end
|
||||
|
||||
function ControlBindFactory( f6_arg0, f6_arg1, f6_arg2 )
|
||||
return {
|
||||
type = "UIGenericButton",
|
||||
id = "bind_" .. f6_arg0,
|
||||
disabledFunc = f6_arg2 or function ()
|
||||
return false
|
||||
end
|
||||
,
|
||||
properties = {
|
||||
variant = GenericButtonSettings.Variants.Info,
|
||||
button_text = Engine.Localize( f6_arg0 ),
|
||||
button_display_func = function ( f8_arg0, f8_arg1 )
|
||||
return GetDisplay( f6_arg1 )
|
||||
end
|
||||
,
|
||||
button_action_func = function ( f9_arg0, f9_arg1 )
|
||||
Engine.BindKey( f6_arg1 )
|
||||
OptionsWindowTriggerRefresh( f9_arg0, f9_arg1 )
|
||||
end
|
||||
|
||||
},
|
||||
handlers = {
|
||||
element_refresh = MBh.EmitEvent( "content_refresh" ),
|
||||
key_bound = OptionsWindowTriggerRefresh
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function OptionFactoryProfileData( f10_arg0, f10_arg1, f10_arg2, f10_arg3, f10_arg4, f10_arg5 )
|
||||
local f10_local0 = Engine.GetProfileData( f10_arg0 )
|
||||
local f10_local1 = 1
|
||||
for f10_local5, f10_local6 in pairs( f10_arg3 ) do
|
||||
if f10_local6.value == f10_local0 then
|
||||
f10_local1 = f10_local5
|
||||
break
|
||||
end
|
||||
end
|
||||
f10_local2 = function ( f11_arg0, f11_arg1 )
|
||||
Engine.ExecNow( f10_arg1 )
|
||||
Engine.ExecNow( "profile_menuDvarsFinish" )
|
||||
OptionsWindowTriggerRefresh( f11_arg0, f11_arg1 )
|
||||
end
|
||||
|
||||
f10_local3 = {
|
||||
type = "UIGenericButton",
|
||||
id = "option_" .. f10_arg0,
|
||||
disabledFunc = f10_arg4 or function ()
|
||||
return false
|
||||
end
|
||||
|
||||
}
|
||||
f10_local4 = {
|
||||
variant = GenericButtonSettings.Variants.Select
|
||||
}
|
||||
if f10_arg5 then
|
||||
local f10_local7 = f10_arg2
|
||||
end
|
||||
f10_local4.button_text = f10_local7 or Engine.Localize( f10_arg2 )
|
||||
f10_local4.button_display_func = function ( f13_arg0, f13_arg1 )
|
||||
return Engine.Localize( f10_arg3[f10_local1].text )
|
||||
end
|
||||
|
||||
f10_local4.button_left_func = function ( f14_arg0, f14_arg1 )
|
||||
f10_local1 = 1 + (#f10_arg3 + f10_local1 - 1 - 1) % #f10_arg3
|
||||
f10_local2( f14_arg0, f14_arg1 )
|
||||
end
|
||||
|
||||
f10_local4.button_right_func = function ( f15_arg0, f15_arg1 )
|
||||
f10_local1 = 1 + (f10_local1 - 1 + 1) % #f10_arg3
|
||||
f10_local2( f15_arg0, f15_arg1 )
|
||||
end
|
||||
|
||||
f10_local3.properties = f10_local4
|
||||
f10_local3.handlers = {
|
||||
element_refresh = MBh.EmitEvent( "content_refresh" )
|
||||
}
|
||||
return f10_local3
|
||||
end
|
||||
|
||||
function OptionsFeeder( f16_arg0 )
|
||||
local f16_local0 = {}
|
||||
Engine.ExecNow( "profile_menuDvarsSetup" )
|
||||
f16_local0[#f16_local0 + 1] = OptionFactoryProfileData( "leanEnabled", "profile_toggleLean", "@LUA_MENU_LEAN_TOGGLE", {
|
||||
{
|
||||
text = "@LUA_MENU_ENABLED",
|
||||
value = true
|
||||
},
|
||||
{
|
||||
text = "@LUA_MENU_DISABLED",
|
||||
value = false
|
||||
}
|
||||
} )
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_FIRE_WEAPON", "+attack" )
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_AIM_DOWN_THE_SIGHT", "+toggleads_throw" )
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_HOLD_AIM_DOWN_SIGHT", "+speed_throw" )
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_RELOAD_WEAPON", "+reload" )
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_SWITCH_WEAPON", "weapnext" )
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@PLATFORM_MELEEZOOM", "+melee_zoom" )
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_USE", "+activate" )
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_FRAG_EQUIPMENT", "+frag" )
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_THROW_SPECIAL_GRENADE", "+smoke" )
|
||||
if SinglePlayerDisableFunction() then
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_WEAPON_ATTACHMENT", "+actionslot 3" )
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_INVENTORY_KILLSTREAK", "+actionslot 4" )
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_NVG_WATCH", "+actionslot 1" )
|
||||
else
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_KILLSTREAK_REWARD_SLOT_1", "+actionslot 4" )
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_KILLSTREAK_REWARD_SLOT_2", "+actionslot 5" )
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_KILLSTREAK_REWARD_SLOT_3", "+actionslot 6" )
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_KILLSTREAK_REWARD_SLOT_4", "+actionslot 7" )
|
||||
f16_local0[#f16_local0 + 1] = ControlBindFactory( Engine.IsAliensMode() and "ALIENS_UPGRADE_ABILITIES" or "@PLATFORM_UI_SHOW_SCORES", "togglescores" )
|
||||
end
|
||||
return f16_local0
|
||||
end
|
||||
|
||||
function OptionsMainCreate( f17_arg0, f17_arg1 )
|
||||
f17_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
|
||||
end
|
||||
|
||||
function actions_controls_vlist()
|
||||
return {
|
||||
type = "UIScrollingVerticalList",
|
||||
childrenFeeder = OptionsFeeder,
|
||||
properties = {
|
||||
use_arrows = true,
|
||||
sendScrollEvents = true,
|
||||
exclusiveController = MBh.Property( "exclusiveController" )
|
||||
},
|
||||
states = {
|
||||
default = {
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
top = OptionsListDims.menu_top,
|
||||
bottom = OptionsListDims.menu_bottom,
|
||||
left = OptionsListDims.menu_left,
|
||||
right = OptionsListDims.menu_right
|
||||
}
|
||||
},
|
||||
handlers = {
|
||||
options_window_refresh = OptionsWindowRefresh
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function actions_controls()
|
||||
return {
|
||||
type = "UIElement",
|
||||
id = "actions_controls_id",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0
|
||||
}
|
||||
},
|
||||
handlers = {
|
||||
menu_create = OptionsMainCreate,
|
||||
menu_close = function ( f20_arg0, f20_arg1 )
|
||||
Engine.Exec( "updategamerprofile" )
|
||||
end
|
||||
|
||||
},
|
||||
children = {
|
||||
{
|
||||
type = "generic_menu_title",
|
||||
properties = {
|
||||
menu_title = Engine.Localize( "@LUA_MENU_ACTIONS" )
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "actions_controls_vlist",
|
||||
id = "actions_cotnrols_vlist_id"
|
||||
},
|
||||
{
|
||||
type = "button_helper_text_main",
|
||||
id = "button_helper_text_id"
|
||||
},
|
||||
{
|
||||
type = "UIBindButton",
|
||||
handlers = {
|
||||
button_secondary = MBh.LeaveMenu()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
LUI.MenuBuilder.registerDef( "actions_controls_vlist", actions_controls_vlist )
|
||||
LUI.MenuBuilder.registerDef( "actions_controls", actions_controls )
|
||||
LockTable( _M )
|
685
lui/advancedvideo.dec.lua
Normal file
685
lui/advancedvideo.dec.lua
Normal file
@ -0,0 +1,685 @@
|
||||
local f0_local0 = module
|
||||
local f0_local1, f0_local2 = ...
|
||||
f0_local0( f0_local1, package.seeall )
|
||||
CoD.PrintModuleLoad( _NAME )
|
||||
function BackButtonAction( f1_arg0, f1_arg1 )
|
||||
local f1_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f1_arg0 )
|
||||
f1_arg0:dispatchEventToRoot( {
|
||||
name = "check_show_apply",
|
||||
immediate = true
|
||||
} )
|
||||
if f1_local0.showApplySettings then
|
||||
if Engine.ShowLowTextureResolutionWarning() then
|
||||
if f1_local0.vidRestart then
|
||||
LUI.FlowManager.RequestPopupMenu( f1_arg0, "show_low_texture_res_warning_restart_popmenu", false, f1_arg1.controller, false )
|
||||
else
|
||||
LUI.FlowManager.RequestPopupMenu( f1_arg0, "show_low_texture_res_warning_popmenu", false, f1_arg1.controller, false )
|
||||
end
|
||||
elseif f1_local0.vidRestart then
|
||||
LUI.FlowManager.RequestPopupMenu( f1_arg0, "apply_settings_restart_popmenu", false, f1_arg1.controller, false )
|
||||
else
|
||||
LUI.FlowManager.RequestPopupMenu( f1_arg0, "apply_settings_popmenu", false, f1_arg1.controller, false )
|
||||
end
|
||||
end
|
||||
LUI.FlowManager.RequestLeaveMenu( f1_arg0 )
|
||||
end
|
||||
|
||||
function PicmipDisabledFunc()
|
||||
return Engine.GetDvarInt( "ui_r_picmip_manual" ) == 0
|
||||
end
|
||||
|
||||
f0_local0 = nil
|
||||
function NVidiaButtonOver( f3_arg0, f3_arg1 )
|
||||
f0_local0 = f3_arg0.id
|
||||
f3_arg0:dispatchEventToRoot( {
|
||||
name = "show_nvidia_subtitle",
|
||||
immediate = true
|
||||
} )
|
||||
end
|
||||
|
||||
function NVidiaButtonUp( f4_arg0, f4_arg1 )
|
||||
if f0_local0 == f4_arg0.id then
|
||||
f0_local0 = nil
|
||||
f4_arg0:dispatchEventToRoot( {
|
||||
name = "hide_nvidia_subtitle",
|
||||
immediate = true
|
||||
} )
|
||||
end
|
||||
end
|
||||
|
||||
function OptionsWindowRefresh( f5_arg0, f5_arg1 )
|
||||
if f5_arg1.source_input == "button_action" or f5_arg1.source_input == "key_bound" or f5_arg1.source_input == "button_right" or f5_arg1.source_input == "button_left" then
|
||||
f5_arg0:processEvent( {
|
||||
name = "menu_refresh"
|
||||
} )
|
||||
f5_arg0:processEvent( {
|
||||
name = "refresh_content"
|
||||
} )
|
||||
end
|
||||
end
|
||||
|
||||
function OptionsWindowTriggerRefresh( f6_arg0, f6_arg1 )
|
||||
f6_arg0:dispatchEventToRoot( {
|
||||
name = "options_window_refresh",
|
||||
source_input = f6_arg1.name,
|
||||
immediate = true
|
||||
} )
|
||||
end
|
||||
|
||||
function GetFOV( f7_arg0 )
|
||||
return (Engine.GetDvarFloat( "ui_cg_fov" ) - f7_arg0.Min) / (f7_arg0.Max - f7_arg0.Min)
|
||||
end
|
||||
|
||||
function SliderChange( f8_arg0, f8_arg1, f8_arg2, f8_arg3 )
|
||||
Engine.SetDvarFloat( f8_arg3, math.min( f8_arg1, math.max( f8_arg0, Engine.GetDvarFloat( f8_arg3 ) + f8_arg2 ) ) )
|
||||
end
|
||||
|
||||
function OptionFactory( f9_arg0, f9_arg1, f9_arg2, f9_arg3, f9_arg4, f9_arg5, f9_arg6, f9_arg7, f9_arg8, f9_arg9, f9_arg10, f9_arg11 )
|
||||
local f9_local0 = nil
|
||||
local f9_local1 = 1
|
||||
local f9_local2 = Engine.GetDvarType( f9_arg0 )
|
||||
local f9_local3 = nil
|
||||
if f9_arg9 then
|
||||
f9_local3 = {
|
||||
variant = GenericButtonSettings.Variants.Slider,
|
||||
button_text = Engine.Localize( f9_arg1 ),
|
||||
button_display_func = function ( f10_arg0, f10_arg1 )
|
||||
return f9_arg11( f9_arg10 )
|
||||
end,
|
||||
button_left_func = function ( f11_arg0, f11_arg1 )
|
||||
SliderChange( f9_arg10.Min, f9_arg10.Max, -f9_arg10.Step, f9_arg0 )
|
||||
end,
|
||||
button_right_func = function ( f12_arg0, f12_arg1 )
|
||||
SliderChange( f9_arg10.Min, f9_arg10.Max, f9_arg10.Step, f9_arg0 )
|
||||
end
|
||||
}
|
||||
else
|
||||
if f9_local2 == DvarTypeTable.DvarString or f9_local2 == DvarTypeTable.DvarEnum then
|
||||
f9_local0 = Engine.GetDvarString( f9_arg0 )
|
||||
elseif f9_local2 == DvarTypeTable.DvarInt then
|
||||
f9_local0 = Engine.GetDvarInt( f9_arg0 )
|
||||
elseif f9_local2 == DvarTypeTable.DvarBool then
|
||||
f9_local0 = Engine.GetDvarBool( f9_arg0 )
|
||||
end
|
||||
for f9_local7, f9_local8 in pairs( f9_arg2 ) do
|
||||
if f9_local8.value == f9_local0 then
|
||||
f9_local1 = f9_local7
|
||||
break
|
||||
end
|
||||
end
|
||||
f9_local4 = function ( f13_arg0, f13_arg1 )
|
||||
if f9_local2 == DvarTypeTable.DvarString or f9_local2 == DvarTypeTable.DvarEnum then
|
||||
Engine.SetDvarString( f9_arg0, f9_arg2[f9_local1].value )
|
||||
elseif f9_local2 == DvarTypeTable.DvarInt then
|
||||
Engine.SetDvarInt( f9_arg0, f9_arg2[f9_local1].value )
|
||||
elseif f9_local2 == DvarTypeTable.DvarBool then
|
||||
Engine.SetDvarBool( f9_arg0, f9_arg2[f9_local1].value )
|
||||
end
|
||||
OptionsWindowTriggerRefresh( f13_arg0, f13_arg1 )
|
||||
end
|
||||
|
||||
f9_local3 = {
|
||||
variant = GenericButtonSettings.Variants.Select,
|
||||
button_text = Engine.Localize( f9_arg1 ),
|
||||
button_display_func = function ( f14_arg0, f14_arg1 )
|
||||
return f9_arg6 and f9_arg2[f9_local1].text or Engine.Localize( f9_arg2[f9_local1].text )
|
||||
end,
|
||||
button_left_func = function ( f15_arg0, f15_arg1 )
|
||||
f9_local1 = 1 + (#f9_arg2 + f9_local1 - 1 - 1) % #f9_arg2
|
||||
f9_local4( f15_arg0, f15_arg1 )
|
||||
end,
|
||||
button_right_func = function ( f16_arg0, f16_arg1 )
|
||||
f9_local1 = 1 + (f9_local1 - 1 + 1) % #f9_arg2
|
||||
f9_local4( f16_arg0, f16_arg1 )
|
||||
end,
|
||||
button_over_func = f9_arg7,
|
||||
button_up_func = f9_arg8
|
||||
}
|
||||
end
|
||||
return {
|
||||
type = "UIGenericButton",
|
||||
id = "option_" .. f9_arg0,
|
||||
disabledFunc = f9_arg4 or function ()
|
||||
return false
|
||||
end
|
||||
,
|
||||
states = {
|
||||
default = {
|
||||
alpha = 1
|
||||
},
|
||||
invisible = {
|
||||
alpha = 0
|
||||
}
|
||||
},
|
||||
properties = f9_local3,
|
||||
handlers = {
|
||||
check_show_apply = function ( f18_arg0, f18_arg1 )
|
||||
if f9_arg3 then
|
||||
if f9_arg9 then
|
||||
local f18_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f18_arg0 )
|
||||
if Engine.GetDvarFloat( f9_arg3 ) ~= Engine.GetDvarFloat( f9_arg0 ) then
|
||||
f18_local0.showApplySettings = true
|
||||
if f9_arg5 then
|
||||
f18_local0.vidRestart = true
|
||||
end
|
||||
end
|
||||
else
|
||||
local f18_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f18_arg0 )
|
||||
local f18_local1 = nil
|
||||
local f18_local2 = Engine.GetDvarType( f9_arg3 )
|
||||
if f18_local2 == DvarTypeTable.DvarString or f18_local2 == DvarTypeTable.DvarEnum then
|
||||
f18_local1 = Engine.GetDvarString( f9_arg3 )
|
||||
elseif f18_local2 == DvarTypeTable.DvarInt then
|
||||
f18_local1 = tostring( Engine.GetDvarInt( f9_arg3 ) )
|
||||
elseif f18_local2 == DvarTypeTable.DvarBool then
|
||||
if Engine.GetDvarBool( f9_arg3 ) then
|
||||
local f18_local3 = "1"
|
||||
end
|
||||
f18_local1 = f18_local3 or "0"
|
||||
elseif f18_local2 == DvarTypeTable.DvarFloat then
|
||||
f18_local1 = tostring( Engine.GetDvarFloat( f9_arg3 ) )
|
||||
end
|
||||
if f18_local1 ~= f9_arg2[f9_local1].value then
|
||||
f18_local0.showApplySettings = true
|
||||
if f9_arg5 then
|
||||
f18_local0.vidRestart = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function OptionsFeeder( f19_arg0 )
|
||||
local f19_local0 = {
|
||||
[#f19_local0 + 1] = OptionFactory( "ui_r_aspectratio", "@MENU_ASPECT_RATIO", {
|
||||
{
|
||||
text = "@MENU_AUTO",
|
||||
value = "auto"
|
||||
},
|
||||
{
|
||||
text = "@MENU_STANDARD_4_3",
|
||||
value = "standard"
|
||||
},
|
||||
{
|
||||
text = "@MENU_WIDE_16_10",
|
||||
value = "wide 16:10"
|
||||
},
|
||||
{
|
||||
text = "MENU_WIDE_16_9",
|
||||
value = "wide 16:9"
|
||||
}
|
||||
}, "r_aspectratio", nil, true )
|
||||
}
|
||||
local f19_local1 = {}
|
||||
for f19_local5, f19_local6 in pairs( Engine.GetDvarEnumList( "r_displayRefresh" ) ) do
|
||||
f19_local1[#f19_local1 + 1] = {
|
||||
text = f19_local6,
|
||||
value = f19_local6
|
||||
}
|
||||
end
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_displayRefresh", "@MENU_SCREEN_REFRESH_RATE", f19_local1, "r_displayRefresh", nil, true, true )
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_vsync", "@MENU_SYNC_EVERY_FRAME", {
|
||||
{
|
||||
text = "@LUA_MENU_YES",
|
||||
value = "1"
|
||||
},
|
||||
{
|
||||
text = "@LUA_MENU_NO",
|
||||
value = "0"
|
||||
}
|
||||
}, "r_vsync", nil, true )
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_imageQuality", "@PLATFORM_UI_IMAGE_QUALITY", {
|
||||
{
|
||||
text = "@MENU_VERY_LOW",
|
||||
value = "1"
|
||||
},
|
||||
{
|
||||
text = "@MENU_LOW",
|
||||
value = "2"
|
||||
},
|
||||
{
|
||||
text = "@MENU_NORMAL",
|
||||
value = "3"
|
||||
},
|
||||
{
|
||||
text = "@MENU_HIGH",
|
||||
value = "4"
|
||||
},
|
||||
{
|
||||
text = "@MENU_EXTRA",
|
||||
value = "0"
|
||||
}
|
||||
}, "r_imageQuality", nil, true )
|
||||
if Engine.IsMultiplayer() then
|
||||
f19_local2 = {}
|
||||
f19_local3 = SliderBounds.FOV.Max - SliderBounds.FOV.Min
|
||||
for f19_local4 = 0, f19_local3, 1 do
|
||||
local f19_local7 = tostring( SliderBounds.FOV.Min + f19_local4 )
|
||||
f19_local2[f19_local4 + 1] = {
|
||||
text = Engine.MarkLocalized( f19_local7 ),
|
||||
value = f19_local7
|
||||
}
|
||||
end
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_cg_fov", "@MENU_FOV", f19_local2, "cg_fov", nil, false, true, function ( f20_arg0, f20_arg1 )
|
||||
f20_arg0:dispatchEventToRoot( {
|
||||
name = "show_fov_subtitle",
|
||||
immediate = true
|
||||
} )
|
||||
end, function ( f21_arg0, f21_arg1 )
|
||||
f21_arg0:dispatchEventToRoot( {
|
||||
name = "hide_fov_subtitle",
|
||||
immediate = true
|
||||
} )
|
||||
end, false, false, false )
|
||||
end
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_dof_enable", "@MENU_DOF", {
|
||||
{
|
||||
text = "@LUA_MENU_YES",
|
||||
value = "1"
|
||||
},
|
||||
{
|
||||
text = "@LUA_MENU_NO",
|
||||
value = "0"
|
||||
}
|
||||
}, "r_dof_enable", nil, false )
|
||||
if Engine.HBAOAvailable() then
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_ssao", "@PLATFORM_SSAO", {
|
||||
{
|
||||
text = "@MENU_OFF",
|
||||
value = "0_Off"
|
||||
},
|
||||
{
|
||||
text = "@PLATFORM_LOW_QUALITY",
|
||||
value = "1_Low"
|
||||
},
|
||||
{
|
||||
text = "@PLATFORM_HIGH_QUALITY",
|
||||
value = "2_High"
|
||||
},
|
||||
{
|
||||
text = "@PLATFORM_HBAO",
|
||||
value = "3_HBAO"
|
||||
}
|
||||
}, "r_ssao", nil, true )
|
||||
else
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_ssao", "@PLATFORM_SSAO", {
|
||||
{
|
||||
text = "@MENU_OFF",
|
||||
value = "0_Off"
|
||||
},
|
||||
{
|
||||
text = "@PLATFORM_LOW_QUALITY",
|
||||
value = "1_Low"
|
||||
},
|
||||
{
|
||||
text = "@PLATFORM_HIGH_QUALITY",
|
||||
value = "2_High"
|
||||
}
|
||||
}, "r_ssao", nil, true )
|
||||
end
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_tessellation", "@MENU_TESSELLATION", {
|
||||
{
|
||||
text = "@MENU_OFF",
|
||||
value = "0_Off"
|
||||
},
|
||||
{
|
||||
text = "@MENU_NORMAL",
|
||||
value = "1_Near"
|
||||
},
|
||||
{
|
||||
text = "@MENU_EXTRA",
|
||||
value = "2_All"
|
||||
}
|
||||
}, "r_tessellation", nil, false )
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_texFilterAnisoMin", "@LUA_MENU_ANISOTROPIC_FILTERING", {
|
||||
{
|
||||
text = "@MENU_LOW",
|
||||
value = "1"
|
||||
},
|
||||
{
|
||||
text = "@MENU_NORMAL",
|
||||
value = "8"
|
||||
},
|
||||
{
|
||||
text = "@MENU_HIGH",
|
||||
value = "16"
|
||||
}
|
||||
}, "r_texFilterAnisoMin", nil, true )
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_mbEnableA", "@MENU_MOTION_BLUR", {
|
||||
{
|
||||
text = "@LUA_MENU_YES",
|
||||
value = "1"
|
||||
},
|
||||
{
|
||||
text = "@LUA_MENU_NO",
|
||||
value = "0"
|
||||
}
|
||||
}, "r_mbEnableA", nil, true )
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_distortion", "@MENU_DISTORTION", {
|
||||
{
|
||||
text = "@LUA_MENU_YES",
|
||||
value = "1"
|
||||
},
|
||||
{
|
||||
text = "@LUA_MENU_NO",
|
||||
value = "0"
|
||||
}
|
||||
}, "r_distortion", nil, false )
|
||||
if Engine.TXAAAvailable() then
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_aaMode", "@MENU_ANTIALIASING", {
|
||||
{
|
||||
text = "@MENU_OFF",
|
||||
value = "Off"
|
||||
},
|
||||
{
|
||||
text = "@MENU_FXAA",
|
||||
value = "FXAA"
|
||||
},
|
||||
{
|
||||
text = "@MENU_2X_MSAA",
|
||||
value = "2xMSAA"
|
||||
},
|
||||
{
|
||||
text = "@MENU_4X_MSAA",
|
||||
value = "4xMSAA"
|
||||
},
|
||||
{
|
||||
text = "@MENU_SMAA",
|
||||
value = "SMAA"
|
||||
},
|
||||
{
|
||||
text = "@MENU_2X_TXAA",
|
||||
value = "2xTXAA"
|
||||
},
|
||||
{
|
||||
text = "@MENU_4X_TXAA",
|
||||
value = "4xTXAA"
|
||||
}
|
||||
}, "r_aaMode", nil, true )
|
||||
else
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_aaMode", "@MENU_ANTIALIASING", {
|
||||
{
|
||||
text = "@MENU_OFF",
|
||||
value = "Off"
|
||||
},
|
||||
{
|
||||
text = "@MENU_FXAA",
|
||||
value = "FXAA"
|
||||
},
|
||||
{
|
||||
text = "@MENU_2X_MSAA",
|
||||
value = "2xMSAA"
|
||||
},
|
||||
{
|
||||
text = "@MENU_4X_MSAA",
|
||||
value = "4xMSAA"
|
||||
},
|
||||
{
|
||||
text = "@MENU_SMAA",
|
||||
value = "SMAA"
|
||||
}
|
||||
}, "r_aaMode", nil, true )
|
||||
end
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_sm_enable", "@MENU_SHADOWS", {
|
||||
{
|
||||
text = "@LUA_MENU_YES",
|
||||
value = "1"
|
||||
},
|
||||
{
|
||||
text = "@LUA_MENU_NO",
|
||||
value = "0"
|
||||
}
|
||||
}, "sm_enable", nil, true )
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_picmip_manual", "@MENU_TEXTURE_QUALITY", {
|
||||
{
|
||||
text = "@MENU_AUTOMATIC",
|
||||
value = "0"
|
||||
},
|
||||
{
|
||||
text = "@MENU_MANUAL",
|
||||
value = "1"
|
||||
}
|
||||
}, "r_picmip_manual", nil, true )
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_picmip", "@MENU_TEXTURE_RESOLUTION", {
|
||||
{
|
||||
text = "@MENU_LOW",
|
||||
value = "3"
|
||||
},
|
||||
{
|
||||
text = "@MENU_NORMAL",
|
||||
value = "2"
|
||||
},
|
||||
{
|
||||
text = "@MENU_HIGH",
|
||||
value = "1"
|
||||
},
|
||||
{
|
||||
text = "@MENU_EXTRA",
|
||||
value = "0"
|
||||
}
|
||||
}, "r_picmip", PicmipDisabledFunc, true )
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_picmip_bump", "@MENU_NORMAL_MAP_RESOLUTION", {
|
||||
{
|
||||
text = "@MENU_LOW",
|
||||
value = "3"
|
||||
},
|
||||
{
|
||||
text = "@MENU_NORMAL",
|
||||
value = "2"
|
||||
},
|
||||
{
|
||||
text = "@MENU_HIGH",
|
||||
value = "1"
|
||||
},
|
||||
{
|
||||
text = "@MENU_EXTRA",
|
||||
value = "0"
|
||||
}
|
||||
}, "r_picmip_bump", PicmipDisabledFunc, true )
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_picmip_spec", "@MENU_SPECULAR_MAP_RESOLUTION", {
|
||||
{
|
||||
text = "@MENU_LOW",
|
||||
value = "3"
|
||||
},
|
||||
{
|
||||
text = "@MENU_NORMAL",
|
||||
value = "2"
|
||||
},
|
||||
{
|
||||
text = "@MENU_HIGH",
|
||||
value = "1"
|
||||
},
|
||||
{
|
||||
text = "@MENU_EXTRA",
|
||||
value = "0"
|
||||
}
|
||||
}, "r_picmip_spec", PicmipDisabledFunc, true )
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_picmip_water", "@MENU_WATER_MAP_RESOLUTION", {
|
||||
{
|
||||
text = "@MENU_LOW",
|
||||
value = "1"
|
||||
},
|
||||
{
|
||||
text = "@MENU_HIGH",
|
||||
value = "0"
|
||||
}
|
||||
}, "r_picmip_water", PicmipDisabledFunc, true )
|
||||
if Engine.FurShaderAvailable() then
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_fur_shader", "@MENU_FUR_SHADER", {
|
||||
{
|
||||
text = "@MENU_OFF",
|
||||
value = "0"
|
||||
},
|
||||
{
|
||||
text = "@MENU_LOW",
|
||||
value = "1"
|
||||
},
|
||||
{
|
||||
text = "@MENU_HIGH",
|
||||
value = "2"
|
||||
}
|
||||
}, "r_fur_shader", nil, true, nil, NVidiaButtonOver, NVidiaButtonUp )
|
||||
end
|
||||
if Engine.APEXTurbulenceAvailable() then
|
||||
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_r_apex_turbulence", "@MENU_APEX_TURBULENCE", {
|
||||
{
|
||||
text = "@MENU_ON",
|
||||
value = "1"
|
||||
},
|
||||
{
|
||||
text = "@MENU_OFF",
|
||||
value = "0"
|
||||
}
|
||||
}, "r_apex_turbulence", nil, true, nil, NVidiaButtonOver, NVidiaButtonUp )
|
||||
end
|
||||
return f19_local0
|
||||
end
|
||||
|
||||
function OptionsMainCreate( f22_arg0, f22_arg1 )
|
||||
Engine.ExecNow( "profile_menuDvarsSetup" )
|
||||
f22_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
|
||||
end
|
||||
|
||||
function OptionsMainClose( f23_arg0, f23_arg1 )
|
||||
Engine.ExecNow( "profile_menuDvarsFinish" )
|
||||
if Engine.GetDvarString( "r_lodScaleRigid" ) == "2" then
|
||||
Engine.SetDvarString( "r_lodScaleSkinned", "4" )
|
||||
Engine.SetDvarString( "r_lodBiasSkinned", "-200" )
|
||||
Engine.SetDvarString( "r_lodBiasRigid", "-100" )
|
||||
end
|
||||
if Engine.GetDvarString( "r_lodScaleRigid" ) == "1" then
|
||||
Engine.SetDvarString( "r_lodScaleSkinned", "1" )
|
||||
Engine.SetDvarString( "r_lodBiasSkinned", "0" )
|
||||
Engine.SetDvarString( "r_lodBiasRigid", "0" )
|
||||
end
|
||||
end
|
||||
|
||||
function advanced_video_vlist()
|
||||
return {
|
||||
type = "UIScrollingVerticalList",
|
||||
childrenFeeder = OptionsFeeder,
|
||||
properties = {
|
||||
use_arrows = true,
|
||||
sendScrollEvents = true,
|
||||
exclusiveController = MBh.Property( "exclusiveController" )
|
||||
},
|
||||
states = {
|
||||
default = {
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
top = OptionsListDims.menu_top,
|
||||
bottom = OptionsListDims.menu_bottom,
|
||||
left = OptionsListDims.menu_left,
|
||||
right = OptionsListDims.menu_right
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function advanced_video()
|
||||
return {
|
||||
type = "UIElement",
|
||||
id = "advanced_video_id",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0
|
||||
}
|
||||
},
|
||||
handlers = {
|
||||
menu_create = OptionsMainCreate,
|
||||
menu_close = OptionsMainClose,
|
||||
options_window_refresh = OptionsWindowRefresh
|
||||
},
|
||||
children = {
|
||||
{
|
||||
type = "generic_menu_title",
|
||||
properties = {
|
||||
menu_title = Engine.Localize( "@LUA_MENU_ADVANCED_VIDEO" )
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "advanced_video_vlist",
|
||||
id = "advanced_video_vlist_id"
|
||||
},
|
||||
{
|
||||
type = "button_helper_text_main",
|
||||
id = "button_helper_text_id"
|
||||
},
|
||||
{
|
||||
type = "UIMarqueeText",
|
||||
id = "nvidia_option_subtitle",
|
||||
properties = {
|
||||
text = Engine.Localize( "@MENU_NVIDIA_OPTION_SUB" )
|
||||
},
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
top = OptionsListDims.menu_bottom - CoD.TextSettings.HudIW6NormalFont.Height,
|
||||
bottom = OptionsListDims.menu_bottom - CoD.TextSettings.HudIW6NormalFont.Height + CoD.TextSettings.TinyFont.Height,
|
||||
left = 10,
|
||||
right = OptionsListDims.menu_right - 110,
|
||||
font = CoD.TextSettings.TinyFont.Font,
|
||||
alignment = LUI.Alignment.Right,
|
||||
red = 0.7,
|
||||
green = 0.7,
|
||||
blue = 0.7,
|
||||
alpha = 0
|
||||
},
|
||||
show_me = {
|
||||
alpha = 1
|
||||
},
|
||||
hide_me = {
|
||||
alpha = 0
|
||||
}
|
||||
},
|
||||
handlers = {
|
||||
show_nvidia_subtitle = function ( f26_arg0, f26_arg1 )
|
||||
f26_arg0:setText( Engine.Localize( "@MENU_NVIDIA_OPTION_SUB" ) )
|
||||
f26_arg0:animateToState( "show_me", 0 )
|
||||
end
|
||||
,
|
||||
hide_nvidia_subtitle = function ( f27_arg0, f27_arg1 )
|
||||
f27_arg0:animateToState( "hide_me", 0 )
|
||||
end
|
||||
,
|
||||
show_fov_subtitle = function ( f28_arg0, f28_arg1 )
|
||||
f28_arg0:setText( Engine.Localize( "@LUA_MENU_MP_FOV_OPTION_SUB" ) )
|
||||
f28_arg0:animateToState( "show_me", 0 )
|
||||
end
|
||||
,
|
||||
hide_fov_subtitle = function ( f29_arg0, f29_arg1 )
|
||||
f29_arg0:animateToState( "hide_me", 0 )
|
||||
end
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIBindButton",
|
||||
id = "back_button",
|
||||
handlers = {
|
||||
button_secondary = BackButtonAction
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
LUI.MenuBuilder.registerDef( "advanced_video_vlist", advanced_video_vlist )
|
||||
LUI.MenuBuilder.registerDef( "advanced_video", advanced_video )
|
||||
LockTable( _M )
|
285
lui/bootscreenmargins.dec.lua
Normal file
285
lui/bootscreenmargins.dec.lua
Normal file
@ -0,0 +1,285 @@
|
||||
local f0_local0 = module
|
||||
local f0_local1, f0_local2 = ...
|
||||
f0_local0( f0_local1, package.seeall )
|
||||
DebugPrint( "Registering " .. _NAME )
|
||||
f0_local0 = function ( f1_arg0, f1_arg1 )
|
||||
local f1_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f1_arg0 )
|
||||
f1_local0.ContinueMessageVisible = false
|
||||
if f1_arg0.properties.linkTo == "controls" then
|
||||
f1_local0.ContinueMessageVisible = true
|
||||
f1_arg0:dispatchEventToRoot( {
|
||||
name = "continue_message_visible"
|
||||
} )
|
||||
end
|
||||
f1_local0.OriginalVertMargin = Engine.GetDvarFloat( "profileMenuOption_safeAreaVert" )
|
||||
f1_local0.OriginalHorzMargin = Engine.GetDvarFloat( "profileMenuOption_safeAreaHorz" )
|
||||
f1_local0.VertMarginMinAmount = SliderBounds.VertMargin.Min
|
||||
f1_local0.VertMarginMaxAmount = SliderBounds.VertMargin.Max
|
||||
f1_local0.VertMarginIncrement = SliderBounds.VertMargin.Step
|
||||
f1_local0.HorzMarginMinAmount = SliderBounds.HorzMargin.Min
|
||||
f1_local0.HorzMarginMaxAmount = SliderBounds.HorzMargin.Max
|
||||
f1_local0.HorzMarginIncrement = SliderBounds.HorzMargin.Step
|
||||
f1_arg0:dispatchEventToChildren( {
|
||||
name = "vertical_margin_over"
|
||||
} )
|
||||
f1_arg0:dispatchEventToChildren( {
|
||||
name = "horizontal_margin_over"
|
||||
} )
|
||||
end
|
||||
|
||||
f0_local1 = function ( f2_arg0, f2_arg1, f2_arg2, f2_arg3, f2_arg4, f2_arg5 )
|
||||
local f2_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f2_arg0 )
|
||||
local f2_local1 = math.min( f2_arg2, math.max( f2_arg1, Engine.GetDvarFloat( f2_arg4 ) + f2_arg3 ) )
|
||||
Engine.SetDvarFloat( f2_arg4, f2_local1 )
|
||||
Engine.ExecNow( "profile_menuDvarsFinish" )
|
||||
f2_arg0:dispatchEventToRoot( {
|
||||
name = "margin_updated"
|
||||
} )
|
||||
if f2_local1 <= f2_arg1 or f2_arg2 <= f2_local1 then
|
||||
Engine.PlaySound( CoD.SFX.DenyAdjustSafeArea )
|
||||
else
|
||||
Engine.PlaySound( CoD.SFX.AdjustSafeArea )
|
||||
end
|
||||
if f2_local0.ContinueMessageVisible == false and f2_local1 ~= f2_arg5 then
|
||||
f2_local0.ContinueMessageVisible = true
|
||||
f2_arg0:dispatchEventToRoot( {
|
||||
name = "continue_message_visible"
|
||||
} )
|
||||
end
|
||||
end
|
||||
|
||||
f0_local2 = function ( f3_arg0, f3_arg1 )
|
||||
local f3_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f3_arg0 )
|
||||
if f3_local0.ContinueMessageVisible then
|
||||
local f3_local1 = LUI.FlowManager.RequestAddMenu
|
||||
local f3_local2 = f3_arg0
|
||||
local f3_local3 = f3_arg0.properties.linkTo
|
||||
local f3_local4 = f3_arg0:getParent()
|
||||
f3_local1( f3_local2, f3_local3, f3_local4.properties.continueExclusive, f3_arg1.controller, true, {
|
||||
focusSafeArea = true
|
||||
} )
|
||||
end
|
||||
end
|
||||
|
||||
function boot_screen_margins()
|
||||
return {
|
||||
type = "UIElement",
|
||||
id = "boot_screen_margins_id",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0
|
||||
}
|
||||
},
|
||||
handlers = {
|
||||
menu_create = f0_local0
|
||||
},
|
||||
properties = {
|
||||
linkTo = "main_menu",
|
||||
continueExclusive = false
|
||||
},
|
||||
children = {
|
||||
{
|
||||
type = "margins_guide"
|
||||
},
|
||||
{
|
||||
type = "UIText",
|
||||
id = "boot_screen_margins_title_txt_id",
|
||||
properties = {
|
||||
text = Engine.Localize( "@MENU_HUD_MARGINS_CAPS" )
|
||||
},
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 60,
|
||||
bottom = 60 + CoD.TextSettings.ExtraBigFont.Height,
|
||||
left = 100,
|
||||
right = 0,
|
||||
font = CoD.TextSettings.ExtraBigFont.Font,
|
||||
alignment = LUI.Alignment.Left
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIText",
|
||||
id = "boot_screen_margins_instruction_txt1_id",
|
||||
properties = {
|
||||
text = Engine.Localize( "@MENU_ADJUST_SCREENMARGINS" )
|
||||
},
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 210,
|
||||
bottom = 210 + CoD.TextSettings.NormalFont.Height,
|
||||
left = 0,
|
||||
right = 0,
|
||||
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
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIText",
|
||||
id = "boot_screen_margins_instruction_txt2_id",
|
||||
properties = {
|
||||
text = Engine.Localize( "@MENU_ADJUST_SCREENMARGINS_DESC" )
|
||||
},
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 210 + CoD.TextSettings.NormalFont.Height,
|
||||
bottom = 210 + 2 * CoD.TextSettings.NormalFont.Height,
|
||||
left = 0,
|
||||
right = 0,
|
||||
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
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIText",
|
||||
id = "boot_screen_margins_instruction_txt3_id",
|
||||
properties = {
|
||||
text = Engine.Localize( "@MENU_ADJUST_SCREENMARGINS_INST1" )
|
||||
},
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = false,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = -1.2 * CoD.TextSettings.BoldFont.Height,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0,
|
||||
font = CoD.TextSettings.BoldFont.Font,
|
||||
alignment = LUI.Alignment.Center,
|
||||
red = Colors.primary_text_color.r,
|
||||
green = Colors.primary_text_color.g,
|
||||
blue = Colors.primary_text_color.b
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIText",
|
||||
id = "boot_screen_margins_instruction_txt4_id",
|
||||
properties = {
|
||||
text = Engine.Localize( "@MENU_ADJUST_SCREENMARGINS_INST2" )
|
||||
},
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = false,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 1.2 * CoD.TextSettings.BoldFont.Height,
|
||||
left = 0,
|
||||
right = 0,
|
||||
font = CoD.TextSettings.BoldFont.Font,
|
||||
alignment = LUI.Alignment.Center,
|
||||
red = Colors.primary_text_color.r,
|
||||
green = Colors.primary_text_color.g,
|
||||
blue = Colors.primary_text_color.b
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIButton",
|
||||
id = "boot_screen_margins_continue_btn_id",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = false,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = false,
|
||||
rightAnchor = false,
|
||||
top = -1 * (CoD.TextSettings.BoldFont.Height + 105),
|
||||
bottom = -100,
|
||||
left = -200,
|
||||
right = 200,
|
||||
alpha = 0
|
||||
},
|
||||
visible = {
|
||||
alpha = 1
|
||||
}
|
||||
},
|
||||
handlers = {
|
||||
button_action = f0_local2,
|
||||
continue_message_visible = MBh.AnimateToState( "visible", 0 )
|
||||
},
|
||||
children = {
|
||||
{
|
||||
type = "UIText",
|
||||
properties = {
|
||||
text = Engine.Localize( "@PLATFORM_UI_PRESS_TO_CONTINUE" )
|
||||
},
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0,
|
||||
font = CoD.TextSettings.NormalFont.Font,
|
||||
alignment = LUI.Alignment.Center
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIBindButton",
|
||||
id = "boot_screen_margins_bind_btn_id",
|
||||
handlers = {
|
||||
button_up = function ( f5_arg0, f5_arg1 )
|
||||
local f5_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f5_arg0 )
|
||||
f0_local1( f5_arg0, f5_local0.VertMarginMinAmount, f5_local0.VertMarginMaxAmount, f5_local0.VertMarginIncrement, "profileMenuOption_safeAreaVert", f5_local0.OriginalVertMargin )
|
||||
end
|
||||
,
|
||||
button_down = function ( f6_arg0, f6_arg1 )
|
||||
local f6_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f6_arg0 )
|
||||
f0_local1( f6_arg0, f6_local0.VertMarginMinAmount, f6_local0.VertMarginMaxAmount, -f6_local0.VertMarginIncrement, "profileMenuOption_safeAreaVert", f6_local0.OriginalVertMargin )
|
||||
end
|
||||
,
|
||||
button_left = function ( f7_arg0, f7_arg1 )
|
||||
local f7_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f7_arg0 )
|
||||
f0_local1( f7_arg0, f7_local0.HorzMarginMinAmount, f7_local0.HorzMarginMaxAmount, -f7_local0.HorzMarginIncrement, "profileMenuOption_safeAreaHorz", f7_local0.OriginalHorzMargin )
|
||||
end
|
||||
,
|
||||
button_right = function ( f8_arg0, f8_arg1 )
|
||||
local f8_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f8_arg0 )
|
||||
f0_local1( f8_arg0, f8_local0.HorzMarginMinAmount, f8_local0.HorzMarginMaxAmount, f8_local0.HorzMarginIncrement, "profileMenuOption_safeAreaHorz", f8_local0.OriginalHorzMargin )
|
||||
end
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
LUI.MenuBuilder.registerDef( "boot_screen_margins", boot_screen_margins )
|
||||
LockTable( _M )
|
75
lui/buttondesctext.dec.lua
Normal file
75
lui/buttondesctext.dec.lua
Normal file
@ -0,0 +1,75 @@
|
||||
local f0_local0 = module
|
||||
local f0_local1, f0_local2 = ...
|
||||
f0_local0( f0_local1, package.seeall )
|
||||
CoD.PrintModuleLoad( "Registering " .. _NAME )
|
||||
LUI.ButtonDescText = {}
|
||||
LUI.ButtonDescText.new = function ( f1_arg0, f1_arg1 )
|
||||
if not f1_arg1 then
|
||||
f1_arg1 = {}
|
||||
end
|
||||
local f1_local0 = f1_arg1.lines or 2
|
||||
local self = LUI.UIElement.new()
|
||||
self.id = "generic_button_desc_text_id"
|
||||
self:registerAnimationState( "default", {
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
left = 0,
|
||||
right = 0,
|
||||
top = 0,
|
||||
bottom = f1_local0 * CoD.TextSettings.SmallFont.Height
|
||||
} )
|
||||
self:animateToState( "default" )
|
||||
local f1_local2 = LUI.UIImage.new()
|
||||
f1_local2.id = "left_bullet_point"
|
||||
f1_local2:registerAnimationState( "default", {
|
||||
material = RegisterMaterial( "white" ),
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
top = 3,
|
||||
left = 100,
|
||||
height = 13,
|
||||
width = 5,
|
||||
alpha = 0.6
|
||||
} )
|
||||
f1_local2:animateToState( "default" )
|
||||
self:addElement( f1_local2 )
|
||||
local f1_local3 = LUI.UIMarqueeText.new()
|
||||
f1_local3.id = "desc_text"
|
||||
f1_local3:SetUseTextWrapping( true )
|
||||
f1_local3:SetTextHeight( CoD.TextSettings.SmallFont.Height )
|
||||
f1_local3:registerAnimationState( "default", {
|
||||
alignment = LUI.Alignment.Left,
|
||||
font = CoD.TextSettings.SmallFont.Font,
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = f1_local0 * CoD.TextSettings.SmallFont.Height,
|
||||
left = 111,
|
||||
right = -23,
|
||||
red = Colors.primary_text_color.r,
|
||||
green = Colors.primary_text_color.g,
|
||||
blue = Colors.primary_text_color.b,
|
||||
alpha = 1
|
||||
} )
|
||||
f1_local3:animateToState( "default" )
|
||||
f1_local3:registerEventHandler( "set_button_info_text", function ( element, event )
|
||||
if event.text then
|
||||
element:setText( event.text )
|
||||
end
|
||||
end )
|
||||
self:addElement( f1_local3 )
|
||||
return self
|
||||
end
|
||||
|
||||
LUI.ButtonDescText.build = function ( f3_arg0, f3_arg1, f3_arg2 )
|
||||
return LUI.ButtonDescText.new( f3_arg0, f3_arg1 )
|
||||
end
|
||||
|
||||
LUI.MenuBuilder.registerType( "button_desc_text", LUI.ButtonDescText.build )
|
||||
LockTable( _M )
|
686
lui/buttonhelpertext.dec.lua
Normal file
686
lui/buttonhelpertext.dec.lua
Normal file
@ -0,0 +1,686 @@
|
||||
local f0_local0 = module
|
||||
local f0_local1, f0_local2 = ...
|
||||
f0_local0( f0_local1, package.seeall )
|
||||
CoD.PrintModuleLoad( "Registering " .. _NAME )
|
||||
CommonEvents = {
|
||||
addBackButton = {
|
||||
name = "add_button_helper_text",
|
||||
button_ref = "button_secondary",
|
||||
helper_text = Engine.Localize( "@LUA_MENU_BACK" ),
|
||||
side = "left",
|
||||
clickable = true,
|
||||
priority = -1000
|
||||
},
|
||||
addActionButton = {
|
||||
name = "add_button_helper_text",
|
||||
button_ref = "button_action",
|
||||
helper_text = Engine.Localize( "@MENU_CONTINUE" ),
|
||||
side = "left",
|
||||
clickable = true,
|
||||
priority = -1000
|
||||
},
|
||||
addFriendsButton = {
|
||||
name = "add_button_helper_text",
|
||||
button_ref = "button_alt2",
|
||||
helper_text = Engine.Localize( "@LUA_MENU_FRIENDS" ),
|
||||
side = "right",
|
||||
clickable = true,
|
||||
width = 190,
|
||||
priority = -1000
|
||||
},
|
||||
removeFriendsButton = {
|
||||
name = "add_button_helper_text",
|
||||
button_ref = "button_alt2",
|
||||
helper_text = ""
|
||||
},
|
||||
addGameSummaryButton = {
|
||||
name = "add_button_helper_text",
|
||||
button_ref = "button_select",
|
||||
helper_text = Engine.Localize( "@LUA_MENU_MATCH_SUMMARY" ),
|
||||
side = "left",
|
||||
clickable = true
|
||||
},
|
||||
addAcceptButton = {
|
||||
name = "add_button_helper_text",
|
||||
button_ref = "button_alt1",
|
||||
helper_text = Engine.Localize( "@LUA_MENU_ACCEPT" ),
|
||||
side = "left",
|
||||
clickable = true,
|
||||
priority = -1000
|
||||
},
|
||||
addDeclineButton = {
|
||||
name = "add_button_helper_text",
|
||||
button_ref = "button_secondary",
|
||||
helper_text = Engine.Localize( "@LUA_MENU_DECLINE" ),
|
||||
side = "left",
|
||||
clickable = true,
|
||||
priority = -1000
|
||||
},
|
||||
addLeftButton = {
|
||||
name = "add_button_helper_text",
|
||||
button_ref = "button_shoulderl",
|
||||
helper_text = Engine.Localize( "@LUA_MENU_PREV_PAGE" ),
|
||||
side = "left",
|
||||
clickable = true,
|
||||
priority = -1000
|
||||
},
|
||||
addRightButton = {
|
||||
name = "add_button_helper_text",
|
||||
button_ref = "button_shoulderr",
|
||||
helper_text = Engine.Localize( "@LUA_MENU_NEXT_PAGE" ),
|
||||
side = "left",
|
||||
clickable = true,
|
||||
priority = -1000
|
||||
}
|
||||
}
|
||||
function AddHelperTextObject( f1_arg0, f1_arg1 )
|
||||
assert( f1_arg1.button_ref )
|
||||
assert( f1_arg1.helper_text )
|
||||
local f1_local0 = nil
|
||||
if f1_arg1.side and f1_arg1.side == "left" then
|
||||
f1_local0 = f1_arg0:getChildById( "left_button_helper_list_id" )
|
||||
else
|
||||
f1_local0 = f1_arg0:getChildById( "right_button_helper_list_id" )
|
||||
end
|
||||
assert( f1_local0 )
|
||||
local f1_local1 = f1_arg1.button_ref .. "_id"
|
||||
local f1_local2 = f1_local0:getChildById( f1_local1 )
|
||||
if f1_local2 and f1_arg1.helper_text ~= f1_local2.currentText then
|
||||
f1_local2:close()
|
||||
f1_local2 = nil
|
||||
end
|
||||
if not f1_local2 and f1_arg1.helper_text ~= "" then
|
||||
local f1_local3 = helper_text_item( ButtonMap[f1_arg1.button_ref], f1_arg1.helper_text, f1_arg1.button_ref2 and ButtonMap[f1_arg1.button_ref2] or nil, f1_arg1.width, f1_arg1.priority, f1_arg1.ignorePopups or false, f1_arg1.customEvent or nil, f1_arg1.customEventTarget or nil, f1_arg1.useAnimIntro or nil, f1_arg1.flash or nil )
|
||||
f1_local3.id = f1_local1
|
||||
if f1_arg1.clickable == true and ButtonMap[f1_arg1.button_ref] then
|
||||
f1_local3.triggers_event = f1_arg1.button_ref
|
||||
end
|
||||
if Engine.IsConsoleGame() then
|
||||
f1_local3:makeNotFocusable()
|
||||
end
|
||||
f1_local0:addElement( f1_local3 )
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function ClearHelperTextObjects( f2_arg0, f2_arg1 )
|
||||
if not f2_arg1.side then
|
||||
DebugPrint( "WARNING: clear_button_helper_text event sent without specifying the desired side. Ignoring..." )
|
||||
return
|
||||
end
|
||||
local f2_local0 = nil
|
||||
if f2_arg1.side == "left" then
|
||||
f2_local0 = f2_arg0:getChildById( "left_button_helper_list_id" )
|
||||
else
|
||||
f2_local0 = f2_arg0:getChildById( "right_button_helper_list_id" )
|
||||
end
|
||||
assert( f2_local0 )
|
||||
f2_local0:closeChildren()
|
||||
return true
|
||||
end
|
||||
|
||||
function sendButtonEvent( f3_arg0, f3_arg1 )
|
||||
if f3_arg0.triggers_event and f3_arg1.mouse == true then
|
||||
local f3_local0 = {
|
||||
name = "gamepad_button",
|
||||
immediate = true,
|
||||
down = true
|
||||
}
|
||||
assert( ButtonMap[f3_arg0.triggers_event].raw_button )
|
||||
f3_local0.button = ButtonMap[f3_arg0.triggers_event].raw_button
|
||||
f3_local0.controller = f3_arg1.controller
|
||||
f3_arg0:dispatchEventToRoot( f3_local0 )
|
||||
end
|
||||
end
|
||||
|
||||
function sendCustomEvent( f4_arg0, f4_arg1 )
|
||||
customEvent = f4_arg1.customEvent
|
||||
eventTarget = f4_arg1.eventTarget
|
||||
eventTarget:processEvent( customEvent )
|
||||
end
|
||||
|
||||
function getButtonPosition( f5_arg0, f5_arg1, f5_arg2 )
|
||||
local f5_local0 = Engine.IsConsoleGame()
|
||||
if not f5_local0 then
|
||||
f5_local0 = Engine.IsGamepadEnabled() == 1
|
||||
end
|
||||
local f5_local1
|
||||
if f5_local0 then
|
||||
f5_local1 = 32
|
||||
if not f5_local1 then
|
||||
|
||||
else
|
||||
local f5_local2, f5_local3 = nil
|
||||
if f5_arg0 then
|
||||
if f5_local0 and f5_arg0.string then
|
||||
f5_local2 = Engine.Localize( f5_arg0.string ) .. " "
|
||||
if f5_arg1 and f5_arg1.string then
|
||||
f5_local3 = " " .. Engine.Localize( f5_arg1.string )
|
||||
end
|
||||
elseif f5_arg0.keyboard_string then
|
||||
f5_local2 = Engine.Localize( f5_arg0.keyboard_string ) .. " "
|
||||
if f5_arg1 and f5_arg1.keyboard_string then
|
||||
f5_local3 = " " .. Engine.Localize( f5_arg1.keyboard_string )
|
||||
end
|
||||
end
|
||||
end
|
||||
return f5_local2, f5_local3, f5_local1
|
||||
end
|
||||
end
|
||||
f5_local1 = f5_arg2.Height
|
||||
end
|
||||
|
||||
function getButtonWidth( f6_arg0, f6_arg1, f6_arg2, f6_arg3, f6_arg4, f6_arg5, f6_arg6, f6_arg7 )
|
||||
local f6_local0 = f6_arg7
|
||||
local f6_local1 = 0
|
||||
local f6_local2 = 0
|
||||
local f6_local3 = 0
|
||||
local f6_local4, f6_local5, f6_local6, f6_local7 = nil
|
||||
if f6_arg0 then
|
||||
local f6_local8, f6_local9, f6_local10, f6_local11 = GetTextDimensions( f6_arg3, f6_arg6.Font, f6_arg5 )
|
||||
f6_local7 = f6_local11
|
||||
f6_local6 = f6_local10
|
||||
f6_local5 = f6_local9
|
||||
f6_local1 = f6_local6 - f6_local8
|
||||
end
|
||||
local f6_local8, f6_local9, f6_local10, f6_local11 = GetTextDimensions( f6_arg2, f6_arg6.Font, f6_arg6.Height )
|
||||
f6_local7 = f6_local11
|
||||
f6_local6 = f6_local10
|
||||
f6_local5 = f6_local9
|
||||
f6_local3 = f6_local6 - f6_local8
|
||||
if f6_arg1 then
|
||||
f6_local8, f6_local9, f6_local10, f6_local11 = GetTextDimensions( f6_arg4, f6_arg6.Font, f6_arg5 )
|
||||
f6_local7 = f6_local11
|
||||
f6_local6 = f6_local10
|
||||
f6_local5 = f6_local9
|
||||
f6_local2 = f6_local6 - f6_local8
|
||||
end
|
||||
if not f6_arg7 then
|
||||
f6_local0 = 20 + f6_local1 + f6_local3 + f6_local2
|
||||
end
|
||||
return f6_local0, f6_local1, f6_local2, f6_local3
|
||||
end
|
||||
|
||||
function helper_text_item( f7_arg0, f7_arg1, f7_arg2, f7_arg3, f7_arg4, f7_arg5, f7_arg6, f7_arg7, f7_arg8, f7_arg9 )
|
||||
local f7_local0 = CoD.TextSettings.SmallFont
|
||||
local f7_local1, f7_local2, f7_local3 = getButtonPosition( f7_arg0, f7_arg2, f7_local0 )
|
||||
local f7_local4, f7_local5, f7_local6, f7_local7 = getButtonWidth( f7_arg0, f7_arg2, f7_arg1, f7_local1, f7_local2, f7_local3, f7_local0, f7_arg3 )
|
||||
local self = LUI.UIButton.new()
|
||||
self.id = "helper_text_item"
|
||||
self:registerAnimationState( "default", {
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
left = 0,
|
||||
right = f7_local4,
|
||||
top = 0,
|
||||
bottom = 0
|
||||
} )
|
||||
self:animateToState( "default" )
|
||||