This commit is contained in:
2024-09-12 17:25:45 +02:00
commit b4b2350b88
224 changed files with 172565 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.luac

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# IW6 LUI
This repo contains the IW6 LUI dump.

232
lui/actionscontrols.dec.lua Normal file
View 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
View 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 )

View 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 )

View 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 )

View 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" )
self.m_disableNavigation = true
self.m_requireFocusType = FocusType.MouseOver
if f7_arg6 then
assert( f7_arg7 )
self:registerEventHandler( "button_action", function ( element, event )
f7_arg7:processEvent( f7_arg6 )
end )
else
self:registerEventHandler( "button_action", sendButtonEvent )
end
self:registerEventHandler( "rebind", function ( element, event )
if event.buttonLeft and event.buttonLeft == f7_arg0 then
element.m_ignoreMouseFocus = nil
end
end )
self:registerEventHandler( "refresh_button_helper", function ( element, event )
local f10_local0, f10_local1, f10_local2 = getButtonPosition( f7_arg0, f7_arg2, f7_local0 )
local f10_local3 = getButtonWidth( f7_arg0, f7_arg2, f7_arg1, f10_local0, f10_local1, f10_local2, f7_local0, f7_arg3 )
element:registerAnimationState( "refreshed", {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = f7_local4,
top = 0,
bottom = 0
} )
element:animateToState( "refreshed" )
end )
if f7_arg5 then
self:registerEventHandler( "popup_active", nil )
self:registerEventHandler( "popup_inactive", nil )
end
if f7_local1 then
local f7_local9 = LUI.UIText.new()
f7_local9.id = "left"
f7_local9:setText( f7_local1 )
f7_local9:registerAnimationState( "default", CoD.ColorizeState( Colors.frontend_hilite, {
font = f7_local0.Font,
alignment = LUI.Alignment.Left,
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
top = -f7_local3 / 2,
bottom = f7_local3 / 2
} ) )
f7_local9:animateToState( "default" )
f7_local9:registerEventHandler( "refresh_button_helper", function ( element, event )
local f11_local0, f11_local1, f11_local2 = getButtonPosition( f7_arg0, f7_arg2, f7_local0 )
element:setText( f11_local0 )
element:registerAnimationState( "default", CoD.ColorizeState( Colors.frontend_hilite, {
font = f7_local0.Font,
alignment = LUI.Alignment.Left,
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
top = -f11_local2 / 2,
bottom = f11_local2 / 2
} ) )
element:animateToState( "default" )
end )
self:addElement( f7_local9 )
end
local f7_local9 = LUI.UIText.new()
f7_local9.properties = {}
f7_local9.id = "helper_text_text"
f7_local9:setText( f7_arg1 )
f7_local9:registerAnimationState( "default", CoD.ColorizeState( Colors.cac_label_text, {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = f7_local5,
right = 0,
top = -f7_local0.Height / 2,
bottom = f7_local0.Height / 2,
font = f7_local0.Font,
alignment = LUI.Alignment.Left
} ) )
f7_local9:registerAnimationState( "anim_intro", CoD.ColorizeState( Colors.cac_label_text, {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = 0,
font = f7_local0.Font,
alignment = LUI.Alignment.Left
} ) )
f7_local9:registerAnimationState( "over", CoD.ColorizeState( Colors.white ) )
f7_local9.properties.animLoop = MBh.AnimateLoop( {
{
"default",
500
},
{
"flash",
500
}
} )
if f7_arg8 then
f7_local9:animateToState( "anim_intro" )
else
f7_local9:animateToState( "default" )
end
if f7_arg9 then
f7_local9:registerAnimationState( "flash", CoD.ColorizeState( Colors.frontend_hilite ) )
f7_local9.properties:animLoop()
end
local f7_local10 = f7_local9
local f7_local11 = f7_local9.registerEventHandler
local f7_local12 = "button_up"
local f7_local13
if f7_arg9 then
f7_local13 = f7_local9.properties.animLoop
if not f7_local13 then
else
f7_local11( f7_local10, f7_local12, f7_local13 )
f7_local9:registerEventHandler( "button_over", MBh.AnimateToState( "over" ) )
f7_local9:registerEventHandler( "refresh_button_helper", function ( element, event )
local f12_local0, f12_local1, f12_local2 = getButtonPosition( f7_arg0, f7_arg2, f7_local0 )
local f12_local3, f12_local4 = getButtonWidth( f7_arg0, f7_arg2, f7_arg1, f12_local0, f12_local1, f12_local2, f7_local0, f7_arg3 )
element:registerAnimationState( "default", CoD.ColorizeState( Colors.cac_label_text, {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = f12_local4,
right = 0,
top = -f7_local0.Height / 2,
bottom = f7_local0.Height / 2,
font = f7_local0.Font,
alignment = LUI.Alignment.Left
} ) )
element:animateToState( "default" )
end )
self.currentText = f7_arg1
self:addElement( f7_local9 )
if f7_local2 then
f7_local11 = LUI.UIText.new()
f7_local11.id = "right"
f7_local11:setText( f7_local2 )
f7_local11:registerAnimationState( "default", CoD.ColorizeState( Colors.frontend_hilite, {
font = f7_local0.Font,
alignment = LUI.Alignment.Left,
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = f7_local5 + f7_local7,
right = 0,
top = -f7_local3 / 2,
bottom = f7_local3 / 2
} ) )
f7_local11:registerEventHandler( "refresh_button_helper", function ( element, event )
local f13_local0, f13_local1, f13_local2 = getButtonPosition( f7_arg0, f7_arg2, f7_local0 )
local f13_local3, f13_local4 = getButtonWidth( f7_arg0, f7_arg2, f7_arg1, f13_local0, f13_local1, f13_local2, f7_local0, f7_arg3 )
element:registerAnimationState( "default", CoD.ColorizeState( Colors.frontend_hilite, {
font = f7_local0.Font,
alignment = LUI.Alignment.Left,
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = f13_local4 + f7_local7,
right = 0,
top = -f13_local2 / 2,
bottom = f13_local2 / 2
} ) )
element:animateToState( "default" )
end )
f7_local11:animateToState( "default" )
self:addElement( f7_local11 )
end
if f7_arg4 then
self:setPriority( f7_arg4 )
end
return self
end
end
f7_local13 = MBh.AnimateToState( "default" )
end
function button_helper_text_main()
return {
type = "UIElement",
id = "button_helper_text_main_id",
properties = {
left_inset = 100,
right_inset = -75,
top_margin = GenericFooterDims.TopMargin_WithBackground,
bottom_margin = -35,
height = GenericFooterDims.Height,
spacing = 12,
background_alpha = 1,
hideAlienBar = false
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = true,
left = 0,
right = 0,
top = MBh.Property( "top_margin" ),
bottom = 0,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
show_button_helper_text = MBh.AnimateToState( "default" ),
hide_button_helper_text = MBh.AnimateToState( "hidden" )
},
children = {
{
type = "UIImage",
id = "black_bar",
states = {
default = {
leftAnchor = true,
topAnchor = false,
rightAnchor = true,
bottomAnchor = true,
left = 0,
top = 0,
right = 0,
height = 300,
red = 0,
green = 0,
blue = 0,
alpha = MBh.Property( "background_alpha" ),
material = RegisterMaterial( "white" )
}
}
},
{
type = "UIImage",
id = "button_helper_background_id",
properties = {
background_alpha = MBh.Property( "background_alpha" )
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = -25,
height = 128,
left = 0,
right = 0,
material = RegisterMaterial( "bkgd_title_bar" ),
zRot = 180,
alpha = MBh.Property( "background_alpha" )
}
}
},
{
type = "UIImage",
id = "button_helper_background_alien_id",
properties = {
hideAlienBar = MBh.Property( "hideAlienBar" ),
background_alpha = MBh.Property( "background_alpha" )
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = -8,
bottom = 22,
left = 0,
right = 0,
material = Engine.IsAliensMode() and RegisterMaterial( "box_alien_header_footer" ) or RegisterMaterial( "white" ),
alpha = 0
},
show = {
alpha = MBh.Property( "background_alpha" )
}
},
handlers = {
menu_create = function ( f15_arg0, f15_arg1 )
if Engine.IsAliensMode() and not f15_arg0.properties.hideAlienBar then
f15_arg0:animateToState( "show", 0 )
end
end
}
},
{
type = "UIText",
id = "build_number_text",
properties = {
text = Engine.GetBuildNumber(),
background_alpha = MBh.Property( "background_alpha" )
},
states = {
default = CoD.ColorizeState( Colors.build_number, {
leftAnchor = false,
rightAnchor = true,
topAnchor = false,
bottomAnchor = true,
left = 0,
right = -70,
bottom = -22,
height = CoD.TextSettings.TinyFont.Height,
font = CoD.TextSettings.TinyFont.Font,
alignment = LUI.Alignment.Right,
alpha = 0
} ),
visible = {
alpha = MBh.Property( "background_alpha" )
}
},
handlers = {
menu_create = function ( f16_arg0, f16_arg1 )
if Engine.InFrontend() and Engine.IsMultiplayer() then
f16_arg0:animateToState( "visible" )
end
end
}
},
{
type = "UIText",
id = "ds_text",
properties = {
text = "",
background_alpha = MBh.Property( "background_alpha" )
},
states = {
default = CoD.ColorizeState( Colors.build_number, {
leftAnchor = false,
rightAnchor = true,
topAnchor = false,
bottomAnchor = true,
left = 0,
right = -70,
bottom = -10,
height = CoD.TextSettings.TinyFont.Height,
font = CoD.TextSettings.TinyFont.Font,
alignment = LUI.Alignment.Right,
alpha = 0
} ),
visible = {
alpha = MBh.Property( "background_alpha" )
}
},
handlers = {
menu_create = MBh.EmitEvent( "update_ds_text" ),
update_ds_text = function ( f17_arg0, f17_arg1 )
if Engine.GetDvarBool( "ds_info_enable" ) then
f17_arg0:animateToState( "visible" )
f17_arg0:setText( Engine.GetDvarString( "ds_info" ) or "" )
else
f17_arg0:animateToState( "default" )
end
end
},
children = {
{
type = "UITimer",
id = "ds_text_refresh_timer",
properties = {
event = {
name = "update_ds_text"
},
interval = 1000
}
}
}
},
{
type = "UIElement",
id = "container",
properties = {
height = MBh.Property( "height" ),
spacing = MBh.Property( "spacing" ),
left_inset = MBh.Property( "left_inset" ),
right_inset = MBh.Property( "right_inset" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 10,
height = MBh.Property( "height" )
}
},
children = {
{
type = "UIHorizontalList",
id = "left_button_helper_list_id",
properties = {
spacing = MBh.Property( "spacing" ),
left_inset = MBh.Property( "left_inset" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = MBh.Property( "left_inset" ),
right = 0,
top = 0,
bottom = 0,
alignment = LUI.Alignment.Left,
spacing = MBh.Property( "spacing" )
}
}
},
{
type = "UIHorizontalList",
id = "right_button_helper_list_id",
properties = {
spacing = MBh.Property( "spacing" ),
right_inset = MBh.Property( "right_inset" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = MBh.Property( "right_inset" ),
top = 0,
bottom = 0,
alignment = LUI.Alignment.Right,
spacing = MBh.Property( "spacing" )
}
}
}
},
handlers = {
add_button_helper_text = AddHelperTextObject,
clear_button_helper_text = ClearHelperTextObjects
}
}
}
}
end
LUI.MenuBuilder.registerDef( "button_helper_text_main", button_helper_text_main )
LockTable( _M )

159
lui/chatcontrols.dec.lua Normal file
View File

@ -0,0 +1,159 @@
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 ControlBindFactory( f5_arg0, f5_arg1 )
return {
type = "UIGenericButton",
id = "bind_" .. f5_arg1,
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( f5_arg0 ),
button_display_func = function ( f6_arg0, f6_arg1 )
return GetDisplay( f5_arg1 )
end
,
button_action_func = function ( f7_arg0, f7_arg1 )
Engine.BindKey( f5_arg1 )
OptionsWindowTriggerRefresh( f7_arg0, f7_arg1 )
end
},
handlers = {
element_refresh = MBh.EmitEvent( "content_refresh" ),
key_bound = OptionsWindowTriggerRefresh
}
}
end
function OptionsFeeder( f8_arg0 )
local f8_local0 = {}
Engine.ExecNow( "profile_menuDvarsSetup" )
f8_local0[#f8_local0 + 1] = ControlBindFactory( "@MENU_TEXT_CHAT", "chatmodepublic" )
f8_local0[#f8_local0 + 1] = ControlBindFactory( "@MENU_TEXT_TEAM_CHAT", "chatmodeteam" )
f8_local0[#f8_local0 + 1] = ControlBindFactory( "@MENU_VOICE_CHAT_BUTTON", "+talk" )
return f8_local0
end
function OptionsMainCreate( f9_arg0, f9_arg1 )
f9_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
function chat_controls_vlist()
return {
type = "UIStencil",
children = {
{
type = "UIVerticalList",
childrenFeeder = OptionsFeeder,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = -25,
top = 0,
bottom = 0
}
}
}
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right_wide,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
},
handlers = {
options_window_refresh = OptionsWindowRefresh
}
}
end
function chat_controls()
return {
type = "UIElement",
id = "chat_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 ( f12_arg0, f12_arg1 )
Engine.Exec( "updategamerprofile" )
end
},
children = {
{
type = "generic_menu_title",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_CHAT" )
}
},
{
type = "chat_controls_vlist",
id = "chat_controls_vlist_id"
},
{
type = "button_helper_text_main",
id = "button_helper_text_id"
},
{
type = "UIBindButton",
id = "back_button",
handlers = {
button_secondary = MBh.LeaveMenu()
}
}
}
}
end
LUI.MenuBuilder.registerDef( "chat_controls_vlist", chat_controls_vlist )
LUI.MenuBuilder.registerDef( "chat_controls", chat_controls )
LockTable( _M )

1558
lui/cod.dec.lua Normal file

File diff suppressed because it is too large Load Diff

587
lui/codedependence.dec.lua Normal file
View File

@ -0,0 +1,587 @@
function ModuleInaccessible( f1_arg0 )
assert( not _G[f1_arg0] )
_G[f1_arg0] = setmetatable( {}, {
__index = function ( f2_arg0, f2_arg1 )
return function ()
assert( false, "Functions from the " .. f1_arg0 .. " module are not allowed to be called from this scope." )
end
end
} )
end
if Engine then
Engine.UsingSplitscreenUpscaling = Engine.UsingSplitscreenUpscaling or function ()
return false
end
Engine.IsNetworkConnected = Engine.IsNetworkConnected or function ()
return true
end
Engine.HasAcceptedInvite = Engine.HasAcceptedInvite or function ()
return false
end
Engine.SetAndEnableCustomClanTag = Engine.SetAndEnableCustomClanTag or function ()
end
Engine.CanViewClanTags = Engine.CanViewClanTags or function ()
return true
end
Engine.AllowOnline = Engine.AllowOnline or function ()
return true
end
Engine.IsSpecialRegion = Engine.IsSpecialRegion or function ()
return false
end
Engine.HasSnapshot = Engine.HasSnapshot or function ()
return true
end
Engine.APEXTurbulenceAvailable = Engine.APEXTurbulenceAvailable or function ()
return false
end
Engine.FurShaderAvailable = Engine.FurShaderAvailable or function ()
return false
end
Engine.HBAOAvailable = Engine.HBAOAvailable or function ()
return false
end
Engine.NVidiaGPUAvailable = Engine.NVidiaGPUAvailable or function ()
return false
end
local f0_local0 = Engine
local f0_local1 = Engine.TXAAAvailable
if not f0_local1 then
f0_local1 = Engine.NVidiaGPUAvailable
end
f0_local0.TXAAAvailable = f0_local1
Engine.CanVidRestart = Engine.CanVidRestart or function ()
return false
end
Engine.FormatTimeHoursMinutesSeconds = Engine.FormatTimeHoursMinutesSeconds or function ()
return ""
end
Engine.UserIsGuest = Engine.UserIsGuest or function ()
return false
end
Engine.ClearCustomClanTag = Engine.ClearCustomClanTag or function ()
end
Engine.GetCurrentDayMonthYear = Engine.GetCurrentDayMonthYear or function ()
return 1, 1, 2100
end
Engine.GetCurrentYear = Engine.GetCurrentYear or function ()
return 2100
end
Engine.UserCanAccessFriendsList = Engine.UserCanAccessFriendsList or function ()
return false
end
Engine.AnyoneHasSeasonPass = Engine.AnyoneHasSeasonPass or function ()
return false
end
Engine.AnyoneHasAliensDLC = Engine.AnyoneHasAliensDLC or function ()
return false
end
Engine.AnyoneHasAliensDLC1 = Engine.AnyoneHasAliensDLC1 or function ()
return false
end
Engine.AnyoneHasAliensDLC2 = Engine.AnyoneHasAliensDLC2 or function ()
return false
end
Engine.AnyoneHasAliensDLC3 = Engine.AnyoneHasAliensDLC3 or function ()
return false
end
Engine.AnyoneHasAliensDLC4 = Engine.AnyoneHasAliensDLC4 or function ()
return false
end
Engine.IsXenonDevTitle = Engine.IsXenonDevTitle or function ()
return false
end
Engine.GetRawMonthDayYear = Engine.GetRawMonthDayYear or function ()
return nil
end
Engine.GetClanTag = Engine.GetClanTag or function ()
return ""
end
Engine.LocalClientProfileCanSave = Engine.LocalClientProfileCanSave or function ()
return true
end
Engine.IsProfanity = Engine.IsProfanity or function ()
return false
end
Engine.GetAspectRatio = Engine.GetAspectRatio or function ()
return 1.78
end
Engine.IsChatRestricted = Engine.IsChatRestricted or function ()
return false
end
Engine.UserCanAccessStore = Engine.UserCanAccessStore or function ()
return false
end
Engine.ShowXB3GoldUpsell = Engine.ShowXB3GoldUpsell or function ()
return false
end
Engine.ShowLowTextureResolutionWarning = Engine.ShowLowTextureResolutionWarning or function ()
return false
end
Engine.IsPC = Engine.IsPC or function ()
return false
end
Engine.ClearUnlockData = Engine.ClearUnlockData or function ()
return false
end
Engine.GetControllerForLocalClient = Engine.GetControllerForLocalClient or function ()
return 0
end
Engine.PartyEveryoneHasMap = Engine.PartyEveryoneHasMap or function ()
return true
end
Engine.IsActiveLocalClientPrimary = Engine.IsActiveLocalClientPrimary or function ()
return true
end
Engine.PLMRefreshData = Engine.PLMRefreshData or function ()
end
Engine.HasSaveDevice = Engine.HasSaveDevice or function ()
return true
end
Engine.AnyoneHasSpecificDLCPack = Engine.AnyoneHasSpecificDLCPack or function ()
return true
end
Engine.VoteForDLCItem = Engine.VoteForDLCItem or function ()
end
Engine.GetVoteItemText = Engine.GetVoteItemText or function ()
return ""
end
Engine.GetVoteItemFileID = Engine.GetVoteItemFileID or function ()
return -1
end
Engine.GetActiveVotes = Engine.GetActiveVotes or function ()
return 0
end
Engine.GetNumberOfImagesForVote = Engine.GetNumberOfImagesForVote or function ()
return 0
end
Engine.StartVoteImageDownload = Engine.StartVoteImageDownload or function ()
end
Engine.IsVoteImageDownloaded = Engine.IsVoteImageDownloaded or function ()
return false
end
Engine.GetVoteImageHandle = Engine.GetVoteImageHandle or function ()
return RegisterMaterial( "white" )
end
Engine.GetVotingID = Engine.GetVotingID or function ()
return -1
end
Engine.GetPlayerDataReservedShort = Engine.GetPlayerDataReservedShort or function ()
end
Engine.SetPlayerDataReservedShort = Engine.SetPlayerDataReservedShort or function ()
end
Engine.GetVotingHeader = Engine.GetVotingHeader or function ()
return ""
end
Engine.HasPlayerData = Engine.HasPlayerData or function ()
return true
end
Engine.IsAnnouncerReleased = Engine.IsAnnouncerReleased or function ()
return true
end
Engine.IsAnnouncerUnlocked = Engine.IsAnnouncerUnlocked or function ()
return true
end
Engine.AnyoneHasBadReputation = Engine.AnyoneHasBadReputation or function ()
return false
end
end
if Game then
if not Engine.IsConsoleGame() then
local f0_local0 = Game.GetNumPlayersOnTeam
Game.GetNumPlayersOnTeam = function ( f63_arg0 )
if Engine.GetDvarBool( "onlinegame" ) or Engine.GetDvarBool( "systemlink" ) then
return f0_local0( f63_arg0 )
else
return 0
end
end
end
Game.IsKillCamEntityActive = Game.IsKillCamEntityActive or function ()
return false
end
Game.IsSpectatorCameraActive = Game.IsSpectatorCameraActive or function ()
return false
end
Game.StartBlur = Game.StartBlur or function ()
end
Game.GetLastMLGSpectateTeam = Game.GetLastMLGSpectateTeam or function ()
return Teams.allies
end
else
ModuleInaccessible( "Game" )
end
if Store then
Store.RequestContentServerImages = Store.RequestContentServerImages or function ()
end
Store.GetCategoryForDLCName = Store.GetCategoryForDLCName or function ()
return 0
end
Store.ShowSystemOffer = Store.ShowSystemOffer or function ()
end
else
ModuleInaccessible( "Store" )
end
if Friends then
Friends.HasPartyGameInvite = Friends.HasPartyGameInvite or function ()
return false
end
Friends.AcceptLivePartyInvitation = Friends.AcceptLivePartyInvitation or function ()
end
Friends.CanShowFriendGamercard = Friends.CanShowFriendGamercard or function ()
return true
end
Friends.GetEliteClanFriendMemberStatus = Friends.GetEliteClanFriendMemberStatus or function ( f74_arg0, f74_arg1 )
return ""
end
else
ModuleInaccessible( "Friends" )
end
if Squad then
Squad.PostMatch = Squad.PostMatch or function ()
return ""
end
Squad.GetHostSquadName = Squad.GetHostSquadName or function ()
return ""
end
Squad.UpdateReportPlayerCardCache = Squad.UpdateReportPlayerCardCache or function ()
return ""
end
Squad.GetReportPlayercard = Squad.GetReportPlayercard or function ()
end
Squad.GetClanTagForReport = Squad.GetClanTagForReport or function ()
return ""
end
Squad.GetCompareInfoForLobby = Squad.GetCompareInfoForLobby or function ()
return {}
end
Squad.SetMinPlayersToHumanMax = Squad.SetMinPlayersToHumanMax or function ()
end
Squad.GetSquadModePlaylist = Squad.GetSquadModePlaylist or function ( f82_arg0, f82_arg1 )
if f82_arg1 == 1 then
return 5, 0
elseif f82_arg1 == 2 then
return 5, 4
elseif f82_arg1 == 3 then
return 5, 1
elseif f82_arg1 == 4 then
return 5, 2
elseif f82_arg1 == 5 then
return 5, 3
elseif f82_arg1 == 6 then
return 5, 5
else
return -1, -1
end
end
else
ModuleInaccessible( "Squad" )
end
if Leaderboards then
Leaderboards.GetPlayerValue = Leaderboards.GetPlayerValue or function ( f83_arg0, f83_arg1 )
return ""
end
Leaderboards.GetValue = Leaderboards.GetValue or function ( f84_arg0, f84_arg1, f84_arg2 )
return ""
end
Leaderboards.GetOffset = Leaderboards.GetOffset or function ( f85_arg0 )
return 0
end
Leaderboards.GetCurrentIndex = Leaderboards.GetCurrentIndex or function ( f86_arg0 )
return 0
end
Leaderboards.UpdateLeaderboard = Leaderboards.UpdateLeaderboard or function ( f87_arg0, f87_arg1 )
end
Leaderboards.UpdateCurrentIndex = Leaderboards.UpdateCurrentIndex or function ( f88_arg0, f88_arg1 )
end
Leaderboards.OnSelect = Leaderboards.OnSelect or function ( f89_arg0 )
end
else
ModuleInaccessible( "Leaderboards" )
end
if Lobby then
Lobby.ShowMemberInfo = Lobby.ShowMemberInfo or function ( f90_arg0, f90_arg1, f90_arg2 )
return true
end
Lobby.UnsetAllMLGSpectators = Lobby.UnsetAllMLGSpectators or function ()
end
Lobby.GetMemberWeaponSetup = Lobby.GetMemberWeaponSetup or function ()
return {}
end
Lobby.GetPartyPrivacy = Lobby.GetPartyPrivacy or function ()
return -1
end
Lobby.SetPartyPrivacy = Lobby.SetPartyPrivacy or function ()
end
Lobby.GetPlayerLimit = Lobby.GetPlayerLimit or function ()
return -1
end
Lobby.SetPlayerLimit = Lobby.SetPlayerLimit or function ()
end
Lobby.SetUsingMLGRules = Lobby.SetUsingMLGRules or function ()
end
Lobby.IsUsingMLGRules = Lobby.IsUsingMLGRules or function ()
return false
end
Lobby.EnteringLobby = Lobby.EnteringLobby or function ()
return false
end
Lobby.EnteredLobby = Lobby.EnteredLobby or function ()
end
Lobby.HowManyPlayersCanWeHost = Lobby.HowManyPlayersCanWeHost or function ()
return 12
end
Lobby.IsUsingSecondScreen = Lobby.IsUsingSecondScreen or function ()
return false
end
Lobby.IsAlone = Lobby.IsAlone or function ()
return false
end
Lobby.IsChaosEnabled = Lobby.IsChaosEnabled or function ()
return false
end
Lobby.SetChaosEnabled = Lobby.SetChaosEnabled or function ()
end
Lobby.SetExtinctionDifficulty = Lobby.SetExtinctionDifficulty or function ()
end
Lobby.GetExtinctionDifficulty = Lobby.GetExtinctionDifficulty or function ()
return 2
end
else
ModuleInaccessible( "Lobby" )
end
if LobbyMember then
LobbyMember.SelectedMember_SetLocalMemberMLGSpectator = LobbyMember.SelectedMember_SetLocalMemberMLGSpectator or function ()
end
end
Clan = Clan or {}
Clan.IsEnabled = Clan.IsEnabled or function ()
return false
end
Clan.IsDownloadingData = Clan.IsDownloadingData or function ()
return false
end
Clan.GetDCXPTime = Clan.GetDCXPTime or function ()
return 0
end
Clan.GetClanDivision = Clan.GetClanDivision or function ()
return 0
end
CoDAnywhere = CoDAnywhere or {}
CoDAnywhere.HasUCDSaveGame = CoDAnywhere.HasUCDSaveGame or function ()
return false
end
CoDAnywhere.ServiceAvailable = CoDAnywhere.ServiceAvailable or function ()
return true
end
if Playlist then
Playlist.GetCanShowItem = Playlist.GetCanShowItem or function ()
return true
end
Playlist.GetItemMaxParty = Playlist.GetItemMaxParty or function ()
return 12
end
Playlist.WillCXPBeAwarded = Playlist.WillCXPBeAwarded or function ()
return false
end
Playlist.GetItemVideo = Playlist.GetItemVideo or function ()
return ""
end
else
ModuleInaccessible( "Playlist" )
end
if CharacterScene then
else
ModuleInaccessible( "CharacterScene" )
end
MLG = MLG or {}
MLG.GetFollowedClientNum = MLG.GetFollowedClientNum or function ()
end
MLG.HighlightClientNum = MLG.HighlightClientNum or function ()
end
MLG.TogglePlayerOutlines = MLG.TogglePlayerOutlines or function ()
end
Customization = Customization or {}
Customization.GetCompleteHeadModelName = Customization.GetCompleteHeadModelName or function ( f122_arg0, f122_arg1 )
local f122_local0 = Engine.TableLookup( "mp/cac/heads.csv", 0, f122_arg0, 1 )
local f122_local1 = ""
if f122_arg1 then
f122_local1 = Engine.TableLookup( "mp/cac/helmets.csv", 0, f122_arg1, 1 )
end
return f122_local0 .. f122_local1
end
MatchRules = MatchRules or {}
MatchRules.SelectSaveDevice = MatchRules.SelectSaveDevice or function ()
end
MatchRules.HasSelectedSaveDevice = MatchRules.HasSaveDevice or function ()
return true
end
SocialFeed = SocialFeed or {}
SocialFeed.GetNewsItemID = SocialFeed.GetNewsItemID or function ()
return ""
end
SocialFeed.HasIOTD = SocialFeed.HasIOTD or function ()
return true
end
SocialFeed.DowloadIOTD = SocialFeed.DowloadIOTD or function ()
end
SocialFeed.SetNewsArticleImageJPEG = SocialFeed.SetNewsArticleImageJPEG or function ()
end

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,426 @@
Cac = {
Settings = {
DataLoc = {
squadMembers = {
maxClassSlots = 10
},
privateMatchSquadMembers = {
maxClassSlots = 6
},
coopSquadMembers = {
maxClassSlots = 1
},
loadouts = {
maxClassSlots = 10,
baseClassSlots = 6
},
defaultClassesTeam0 = {
maxClassSlots = 6,
teamName = "allies"
},
defaultClassesTeam1 = {
maxClassSlots = 6,
baseClassSlots = 6,
teamName = "axis",
infectedString = Engine.Localize( "LUA_MENU_INFECT_CAPS" ),
string = Engine.Localize( "@LUA_MENU_AXIS_CAPS" )
},
defaultClassesTeam2 = {
maxClassSlots = 6,
baseClassSlots = 6,
teamName = "allies",
infectedString = Engine.Localize( "LUA_MENU_MP_SURVIVORS_CAPS" ),
string = Engine.Localize( "@LUA_MENU_ALLIES_CAPS" )
},
defaultClassesTeam3 = {
teamName = "spectator"
}
},
minUsableSlots = 5
},
MemberCost = {
0,
3,
3,
3,
3,
3,
200,
300,
400,
500
}
}
if MatchRules then
MatchRules.AllowCustomClasses = function ( f1_arg0 )
if not MatchRules.IsUsingMatchRulesData() then
return false
else
local f1_local0
if f1_arg0 then
f1_local0 = Cac.IsDefaultClass( f1_arg0 )
if not f1_local0 then
elseif not f1_local0 then
return MatchRules.GetData( "commonOption", "allowCustomClasses" )
else
end
end
end
f1_local0 = false
end
end
Cac.GetCacConfig = function ( f2_arg0, f2_arg1, f2_arg2, ... )
local f2_local0 = {
...
}
for f2_local1 = 1, #f2_local0, 1 do
if type( f2_local0[f2_local1] ) == "string" and Cac.IsDefaultClass( f2_local0[f2_local1] ) then
local f2_local4 = Cac.Settings.DataLoc[f2_local0[f2_local1]].teamName
local f2_local5 = f2_local0[f2_local1 + 1]
table.remove( f2_local0, 1 )
table.remove( f2_local0, 1 )
return MatchRules.GetData( "defaultClasses", f2_local4, f2_local5, "class", unpack( f2_local0 ) )
end
end
local f2_local1 = CoD.GetStatsGroupForSquadLocation( f2_arg1 )
if f2_local0[1] == "loadouts" and type( f2_local0[2] ) == "number" then
local f2_local2 = f2_local0[1]
local f2_local3 = f2_local0[2]
if Cac.Settings.DataLoc[f2_local2].baseClassSlots <= f2_local3 then
table.remove( f2_local0, 1 )
table.remove( f2_local0, 1 )
return Engine.GetPlayerDataExtendedEx( f2_arg0, f2_local1, f2_arg1, f2_arg2, f2_local2, f2_local3 - Cac.Settings.DataLoc[f2_local2].baseClassSlots, unpack( f2_local0 ) )
end
end
return Engine.GetPlayerDataEx( f2_arg0, f2_local1, f2_arg1, f2_arg2, ... )
end
Cac.SetCacConfig = function ( f3_arg0, f3_arg1, f3_arg2, ... )
local f3_local0 = {
...
}
for f3_local1 = 1, #f3_local0, 1 do
if type( f3_local0[f3_local1] ) == "string" and Cac.IsDefaultClass( f3_local0[f3_local1] ) then
local f3_local4 = Cac.Settings.DataLoc[f3_local0[f3_local1]].teamName
local f3_local5 = f3_local0[f3_local1 + 1]
table.remove( f3_local0, 1 )
table.remove( f3_local0, 1 )
return MatchRules.SetData( "defaultClasses", f3_local4, f3_local5, "class", unpack( f3_local0 ) )
end
end
local f3_local1 = CoD.GetStatsGroupForSquadLocation( f3_arg1 )
if f3_local0[1] == "loadouts" and type( f3_local0[2] ) == "number" then
local f3_local2 = f3_local0[1]
local f3_local3 = f3_local0[2]
if Cac.Settings.DataLoc[f3_local2].baseClassSlots <= f3_local3 then
table.remove( f3_local0, 1 )
table.remove( f3_local0, 1 )
return Engine.SetPlayerDataExtendedEx( f3_arg0, f3_local1, f3_arg1, f3_arg2, f3_local2, f3_local3 - Cac.Settings.DataLoc[f3_local2].baseClassSlots, unpack( f3_local0 ) )
end
end
return Engine.SetPlayerDataEx( f3_arg0, f3_local1, f3_arg1, f3_arg2, ... )
end
Cac.GetNumCustomSlots = function ( f4_arg0, f4_arg1 )
if not f4_arg1 then
f4_arg1 = Cac.GetCustomClassLoc()
end
if Cac.IsDefaultClass( f4_arg1 ) or IsOnlineMatch() and (Engine.HasExtendedLoadouts( f4_arg0 ) or not IsPrivateMatch()) and Engine.GetDvarInt( "extendedLoadoutsEnable" ) == 1 then
return Cac.Settings.DataLoc[f4_arg1].maxClassSlots
else
return Cac.Settings.DataLoc[f4_arg1].baseClassSlots
end
end
Cac.IsClassInUse = function ( f5_arg0, f5_arg1, f5_arg2, f5_arg3, f5_arg4 )
local f5_local0 = nil
local f5_local1 = Cac.IsDefaultClass( f5_arg3 )
if f5_arg1 == "privateMatchSquadMembers" and not f5_local1 and f5_arg4 < Cac.Settings.DataLoc[f5_arg3].baseClassSlots then
f5_local0 = true
else
f5_local0 = Cac.GetCacConfig( f5_arg0, f5_arg1, f5_arg2, f5_arg3, f5_arg4, "inUse" )
if not f5_local1 and Engine.InFrontend() and f5_arg4 <= 2 and not f5_local0 then
Cac.SetClassInUse( f5_arg0, f5_arg1, f5_arg2, f5_arg3, f5_arg4, true )
end
end
return f5_local0
end
Cac.SetClassInUse = function ( f6_arg0, f6_arg1, f6_arg2, f6_arg3, f6_arg4, f6_arg5 )
if f6_arg5 == nil then
f6_arg5 = true
end
return Cac.SetCacConfig( f6_arg0, f6_arg1, f6_arg2, f6_arg3, f6_arg4, "inUse", f6_arg5 )
end
Cac.IsSquadMemberInUse = function ( f7_arg0, f7_arg1, f7_arg2 )
local f7_local0 = nil
if f7_arg1 == "privateMatchSquadMembers" then
f7_local0 = true
else
f7_local0 = Cac.GetCacConfig( f7_arg0, f7_arg1, f7_arg2, "inUse" )
end
return f7_local0
end
Cac.SetSquadMemberInUse = function ( f8_arg0, f8_arg1, f8_arg2 )
return Cac.SetCacConfig( f8_arg0, f8_arg1, f8_arg2, "inUse", true )
end
Cac.HasCustomClasses = function ( f9_arg0, f9_arg1, f9_arg2, f9_arg3 )
local f9_local0 = false
for f9_local1 = 0, Cac.GetNumCustomSlots( f9_arg0, f9_arg3 ) - 1, 1 do
if Cac.IsClassInUse( f9_arg0, f9_arg1, f9_arg2, f9_arg3, f9_local1 ) then
f9_local0 = true
break
end
end
return f9_local0
end
Cac.GetFirstCustomClass = function ( f10_arg0, f10_arg1, f10_arg2, f10_arg3 )
for f10_local0 = 0, Cac.GetNumCustomSlots( f10_arg0, f10_arg3 ) - 1, 1 do
if Cac.IsClassInUse( f10_arg0, f10_arg1, f10_arg2, f10_arg3, f10_local0 ) then
return f10_local0
end
end
assert( Cac.HasCustomClasses( f10_arg0, f10_arg1, f10_arg2, f10_arg3 ) )
return 0
end
Cac.IsCaCSlotRestricted = function ( f11_arg0, f11_arg1, f11_arg2, f11_arg3, f11_arg4 )
local f11_local0 = false
if MatchRules.AllowCustomClasses( f11_arg3 ) then
if not f11_arg3 then
f11_arg3 = Cac.GetCustomClassLoc()
end
if not Engine.InFrontend() and f11_arg3 == "loadouts" then
local f11_local1 = CoD.GetStatsGroupForGameMode()
if MatchRules.CustomClassIsRestricted( f11_arg0, CoD.GetStatsGroupForGameMode(), f11_arg1, f11_arg2, f11_arg3, f11_arg4 ) then
f11_local0 = true
end
end
end
return f11_local0
end
Cac.IsCaCSlotLocked = function ( f12_arg0, f12_arg1, f12_arg2, f12_arg3, f12_arg4 )
if not Cac.IsDefaultClass( f12_arg3 ) then
return not Cac.IsClassInUse( f12_arg0, f12_arg1, f12_arg2, f12_arg3, f12_arg4 )
else
end
end
Cac.GetSquadLoc = function ()
local f13_local0
if not Engine.GetDvarBool( "onlinegame" ) or Engine.GetDvarBool( "xblive_privatematch" ) then
f13_local0 = Engine.GetDvarBool( "force_ranking" )
else
f13_local0 = true
end
if Engine.IsAliensMode() then
return "coopSquadMembers"
elseif f13_local0 then
return "squadMembers"
else
return "privateMatchSquadMembers"
end
end
Cac.GetEditSquadMember = function ()
return Engine.GetDvarInt( "ui_editSquadMemberIndex" ) or 0
end
Cac.SetEditSquadMember = function ( f15_arg0 )
Engine.SetDvarInt( "ui_editSquadMemberIndex", f15_arg0 )
end
Cac.GetActiveSquadMember = function ( f16_arg0, f16_arg1 )
local f16_local0 = f16_arg1 or CoD.GetStatsGroupForGameMode()
if f16_local0 ~= CoD.StatsGroup.Ranked or not "activeSquadMember" then
local f16_local1 = "privateMatchActiveSquadMember"
end
if Engine.IsAliensMode() then
local f16_local1 = "coopActiveSquadMember"
end
return Engine.GetPlayerDataEx( f16_arg0, f16_local0, f16_local1 )
end
Cac.SetActiveSquadMember = function ( f17_arg0, f17_arg1 )
local f17_local0 = CoD.GetStatsGroupForGameMode()
local f17_local1
if f17_local0 == CoD.StatsGroup.Ranked then
f17_local1 = "activeSquadMember"
if not f17_local1 then
else
Engine.SetPlayerDataEx( f17_arg0, f17_local0, f17_local1, f17_arg1 )
if f17_local0 == CoD.StatsGroup.Ranked then
syncXP( f17_arg0, f17_arg1 )
end
Cac.SyncPrivateDataFromPlayercard( f17_arg0 )
end
end
f17_local1 = "privateMatchActiveSquadMember"
end
Cac.SyncPrivateDataFromPlayercard = function ( f18_arg0 )
local f18_local0 = Engine.GetPlayerDataEx( f18_arg0, CoD.StatsGroup.Ranked, "activeSquadMember" )
local f18_local1 = Engine.GetPlayerDataEx( f18_arg0, CoD.StatsGroup.Ranked, "squadMembers", f18_local0, "patch" )
local f18_local2 = Engine.GetPlayerDataEx( f18_arg0, CoD.StatsGroup.Ranked, "squadMembers", f18_local0, "patchbacking" )
local f18_local3 = Engine.GetPlayerDataEx( f18_arg0, CoD.StatsGroup.Ranked, "squadMembers", f18_local0, "background" )
for f18_local4 = 0, Cac.Settings.DataLoc.privateMatchSquadMembers.maxClassSlots - 1, 1 do
Engine.SetPlayerDataEx( f18_arg0, CoD.StatsGroup.Private, "privateMatchSquadMembers", f18_local4, "patch", f18_local1 )
Engine.SetPlayerDataEx( f18_arg0, CoD.StatsGroup.Private, "privateMatchSquadMembers", f18_local4, "patchbacking", f18_local2 )
Engine.SetPlayerDataEx( f18_arg0, CoD.StatsGroup.Private, "privateMatchSquadMembers", f18_local4, "background", f18_local3 )
end
end
Cac.GetCustomClassLoc = function ( f19_arg0 )
local f19_local0 = "loadouts"
if f19_arg0 ~= nil then
f19_local0 = f19_arg0
elseif not MatchRules.AllowCustomClasses( f19_arg0 ) then
if not Engine.InFrontend() then
f19_local0 = "defaultClassesTeam1"
else
f19_local0 = "defaultClassesTeam1"
end
end
return f19_local0
end
Cac.GetLoadoutName = function ( f20_arg0, f20_arg1, f20_arg2, f20_arg3, f20_arg4 )
local f20_local0 = Cac.GetCacConfig( f20_arg0, f20_arg1, f20_arg2, f20_arg3, f20_arg4, "name" )
if f20_local0 == "" then
f20_local0 = Engine.Localize( "@MP_LOADOUT_DEFAULT_NAME", f20_arg4 + 1 )
end
return f20_local0
end
Cac.MaxSquadMemberCount = function ( f21_arg0 )
return Cac.Settings.DataLoc[f21_arg0].maxClassSlots
end
Cac.ActiveSquadMemberCount = function ( f22_arg0, f22_arg1 )
local f22_local0 = 0
for f22_local1 = 0, Cac.MaxSquadMemberCount( f22_arg1 ) - 1, 1 do
if Cac.IsSquadMemberInUse( f22_arg0, f22_arg1, f22_local1 ) then
f22_local0 = f22_local0 + 1
end
end
return f22_local0
end
Cac.AddNewSquadMember = function ( f23_arg0, f23_arg1 )
local f23_local0 = Cac.ActiveSquadMemberCount( f23_arg0, f23_arg1 )
if f23_local0 + 1 <= Cac.MaxSquadMemberCount( f23_arg1 ) then
Cac.SetSquadMemberInUse( f23_arg0, f23_arg1, f23_local0 )
return f23_local0
else
DebugPrint( "WARNING: Attempting to add squad member when we are already at max. Ignoring..." )
end
end
Cac.UnlockSquadMember = function ( f24_arg0, f24_arg1, f24_arg2 )
if f24_arg2 < Cac.MaxSquadMemberCount( f24_arg1 ) then
Cac.SetSquadMemberInUse( f24_arg0, f24_arg1, f24_arg2 )
else
DebugPrint( "WARNING: Attempting to unlock squad member past the max index. Ignoring..." )
end
local f24_local0 = Cac.ActiveSquadMemberCount( f24_arg0, f24_arg1 )
for f24_local1 = 1, f24_local0, 1 do
Engine.SetPlayerDataEx( f24_arg0, CoD.GetStatsGroupForGameMode(), "challengeState", "ch_squad_member" .. f24_local1 .. "_purchase", 2 )
end
end
Cac.GetSquadMemberName = function ( f25_arg0, f25_arg1, f25_arg2 )
return Engine.GetPlayerDataEx( f25_arg0, CoD.GetStatsGroupForGameMode(), f25_arg1, f25_arg2, "name" )
end
Cac.SetSquadMemberName = function ( f26_arg0, f26_arg1, f26_arg2, f26_arg3 )
return Engine.SetPlayerDataEx( f26_arg0, CoD.GetStatsGroupForGameMode(), f26_arg1, f26_arg2, "name", f26_arg3 )
end
Cac.HasSquadMemberPrestiged = function ( f27_arg0, f27_arg1, f27_arg2 )
return Engine.GetPlayerDataEx( f27_arg0, CoD.GetStatsGroupForGameMode(), f27_arg1, f27_arg2, "squadMemXP" ) >= Rank.GetRankMaxXP( Rank.GetMaxRank() )
end
Cac.GetSquadMemberPrestigeLevel = function ( f28_arg0, f28_arg1, f28_arg2 )
if not Cac.HasSquadMemberPrestiged( f28_arg0, f28_arg1, f28_arg2 ) then
return 0
end
local f28_local0 = 1
local f28_local1 = Engine.GetPlayerDataEx( f28_arg0, CoD.GetStatsGroupForGameMode(), "characterXP", f28_arg2 )
for f28_local2 = 0, Cac.MaxSquadMemberCount( f28_arg1 ) - 1, 1 do
if f28_local2 ~= f28_arg2 and Cac.IsSquadMemberInUse( f28_arg0, f28_arg1, f28_local2 ) and Cac.HasSquadMemberPrestiged( f28_arg0, f28_arg1, f28_local2 ) and Engine.GetPlayerDataEx( f28_arg0, CoD.GetStatsGroupForGameMode(), "characterXP", f28_local2 ) < f28_local1 then
f28_local0 = f28_local0 + 1
end
end
return f28_local0
end
Cac.GetPrestigeLevel = function ( f29_arg0, f29_arg1 )
local f29_local0 = 0
for f29_local1 = 0, Cac.MaxSquadMemberCount( f29_arg1 ) - 1, 1 do
if Cac.IsSquadMemberInUse( f29_arg0, f29_arg1, f29_local1 ) and Cac.HasSquadMemberPrestiged( f29_arg0, f29_arg1, f29_local1 ) then
f29_local0 = f29_local0 + 1
end
end
return f29_local0
end
Cac.SyncPrestigeLevel = function ( f30_arg0 )
Engine.SetPlayerDataEx( f30_arg0, CoD.GetStatsGroupForGameMode(), "prestige", Cac.GetPrestigeLevel( f30_arg0, Cac.GetSquadLoc() ) )
end
Cac.GetSquadMemberLoadoutUnlockCost = function ( f31_arg0 )
if Cac.Settings.DataLoc.loadouts.baseClassSlots <= f31_arg0 then
return 0
else
return 20 + (f31_arg0 - 3) * 5
end
end
Cac.ValidateAllPlayersPrivateSquadMembers = function ()
for f32_local0 = 0, Engine.GetMaxControllerCount() - 1, 1 do
if Engine.HasActiveLocalClient( f32_local0 ) and Engine.HasPlayerData( f32_local0 ) then
if not Lobby.IsItemOfTypeUnlocked( f32_local0, "wolf", "DLC" ) then
DebugPrint( "You are not Entitled to the Wolf. So removing." )
Engine.SetPlayerDataReservedInt( f32_local0, CoD.StatsGroup.Common, "mp_dog_type", 0 )
end
for f32_local3 = 0, Cac.MaxSquadMemberCount( "privateMatchSquadMembers" ) - 1, 1 do
Cac.ValidateCustomizationItems( f32_local0, "privateMatchSquadMembers", f32_local3 )
if not Engine.IsAliensMode() then
Cac.ValidateLoadoutItems( f32_local0, "privateMatchSquadMembers", f32_local3, "loadouts" )
end
end
if not Engine.IsAliensMode() then
Cac.ValidateCustomizationItems( f32_local0, "squadMembers", Cac.GetActiveSquadMember( f32_local0, CoD.StatsGroup.Ranked ) )
end
end
end
end
Cac.ValidateAllPlayersPublicSquadMembers = function ()
local f33_local0 = Cac.GetSquadLoc()
assert( f33_local0 ~= "privateMatchSquadMembers", "Cac.GetSquadLoc() returned private match location in public lobby." )
for f33_local1 = 0, Engine.GetMaxControllerCount() - 1, 1 do
if Engine.HasActiveLocalClient( f33_local1 ) then
if not Lobby.IsItemOfTypeUnlocked( f33_local1, "wolf", "DLC" ) then
DebugPrint( "You are not Entitled to the Wolf. So removing." )
Engine.SetPlayerDataReservedInt( f33_local1, CoD.StatsGroup.Common, "mp_dog_type", 0 )
end
local f33_local4 = Cac.GetActiveSquadMember( f33_local1 )
Cac.ValidateCustomizationItems( f33_local1, f33_local0, f33_local4 )
if not Engine.IsAliensMode() then
Cac.ValidateLoadoutItems( f33_local1, "squadMembers", f33_local4, "loadouts" )
end
end
end
end

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,16 @@
if Friends then
Friends.Constants = {
scrollbarWidth = 14,
FriendButtonHeight = 90,
reportOffensiveLobbyPlayer = 4,
reportExploitingLobbyPlayer = 5,
reportCheatingLobbyPlayer = 6,
reportBoostingLobbyPlayer = 7
}
Friends.FacebookAllowedFlags = {
Active = 1,
FriendsActive = 2,
UploadPhotoActive = 4,
UploadVideoActive = 8
}
end

View File

@ -0,0 +1,150 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function CanSomeoneAccessFriendslist()
for f1_local0 = 0, Engine.GetMaxControllerCount() - 1, 1 do
if Engine.HasActiveLocalClient( f1_local0 ) and Engine.UserCanAccessFriendsList( f1_local0 ) then
return true
end
end
return false
end
function online_friends_widget( f2_arg0, f2_arg1 )
if not f2_arg1 then
f2_arg1 = {}
end
local self = LUI.UIElement.new( {
topAnchor = false,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = true,
bottom = -35,
right = -100,
width = 50,
height = 36,
alpha = 1
} )
self:registerAnimationState( "disabled", {
alpha = 0
} )
self.id = "online_friends_widget"
self:registerEventHandler( "show_widget", function ( element, event )
local f3_local0 = element:getParent()
if f3_local0 then
local f3_local1 = LUI.ButtonHelperText.CommonEvents.addFriendsButton
f3_local1.ignorePopups = f2_arg1.ignorePopups
f3_local0:processEvent( f3_local1 )
element:animateToState( "default", 100 )
if Engine.IsXB3() or not Engine.IsConsoleGame() then
Engine.ExecNow( "friends_widget_refresh" )
end
end
end )
self:registerEventHandler( "hide_widget", function ( element, event )
local f4_local0 = element:getParent()
if f4_local0 then
local f4_local1 = LUI.ButtonHelperText.CommonEvents.removeFriendsButton
f4_local1.dispatchChildren = true
f4_local0:processEvent( f4_local1 )
element:animateToState( "disabled", 0 )
end
end )
self:registerEventHandler( "live_connection", function ( element, event )
if event.signed_in == nil then
local f5_local0 = Engine.IsNetworkConnected()
if f5_local0 then
f5_local0 = Engine.IsUserSignedInToLive()
end
event.signed_in = f5_local0
end
if event.signed_in and CanSomeoneAccessFriendslist() then
element:processEvent( {
name = "show_widget"
} )
else
element:processEvent( {
name = "hide_widget"
} )
end
end )
self:registerEventHandler( "network_connection", function ( element, event )
if not event.plugged_in then
element:processEvent( {
name = "hide_widget"
} )
elseif Engine.IsUserSignedInToLive() then
element:processEvent( {
name = "show_widget"
} )
end
end )
self:registerEventHandler( "menu_create", function ( element, event )
element:processEvent( {
name = "live_connection"
} )
end )
local f2_local1 = LUI.UIBindButton.new()
f2_local1.id = "friends_bind_buttons_id"
f2_local1:registerEventHandler( "button_alt2", function ( element, event )
if Engine.IsNetworkConnected() and Engine.IsUserSignedInToLive( event.controller ) then
local f8_local0 = Engine.UserCanAccessFriendsList( event.controller )
local f8_local1 = Engine.IsUserAGuest( event.controller )
if f8_local0 and not f8_local1 then
if Engine.InFrontend() then
LUI.FlowManager.RequestPopupMenu( element, "popup_friends", true, event.controller, false, {} )
else
LUI.FlowManager.RequestAddMenu( element, "popup_friends", true, event.controller, false, {} )
end
elseif f8_local1 then
LUI.FlowManager.RequestPopupMenu( element, "mp_no_guest_popup", false, event.controller, false )
elseif Engine.IsPS3() and event.controller ~= 0 then
LUI.FlowManager.RequestPopupMenu( element, "mp_wrong_controller_popup", false, event.controller, false )
end
end
return true
end )
self:addElement( f2_local1 )
local f2_local2 = LUI.UIImage.new
local f2_local3 = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = -5,
bottom = 5,
left = 0,
right = 10,
material = RegisterMaterial( "widg_triangle" )
}
if not Engine.InFrontend() then
local f2_local4 = Engine.GetDvarBool( "dedicated_dhclient" )
local f2_local5 = 0.7
end
f2_local3.alpha = f2_local4 and f2_local5 or 0.25
f2_local3.zRot = -135
f2_local2 = f2_local2( f2_local3 )
f2_local2.id = "friends_triangle_id"
self:addElement( f2_local2 )
if Friends then
f2_local3 = LUI.UIText.new( CoD.ColorizeState( Colors.frontend_hilite, {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
left = 0,
right = 0,
height = CoD.TextSettings.BigFont.Height,
font = CoD.TextSettings.BigFont.Font,
alignment = LUI.Alignment.Right
} ) )
f2_local3.id = "friends_number_text"
f2_local3:setupUIBindText( "CountOnlineFriends" )
self:addElement( f2_local3 )
end
return self
end
LUI.MenuBuilder.registerType( "online_friends_widget", online_friends_widget )
LockTable( _M )

View File

@ -0,0 +1,423 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ()
local f1_local0 = nil
local f1_local1 = Languages[Engine.GetCurrentLanguage and Engine.GetCurrentLanguage() or 0]
assert( f1_local1 )
local f1_local2 = "bkgd_manual_"
if Engine.IsSpecialRegion() then
if f1_local1 == "LANGUAGE_FRENCH" then
f1_local2 = "bkgd_manual_alt_language_"
f1_local1 = "LANGUAGE_FRENCHCA"
elseif f1_local1 == "LANGUAGE_ENGLISH" then
f1_local2 = "bkgd_manual_alt_language_"
f1_local1 = "LANGUAGE_ENGLISHUK"
end
end
local f1_local3 = {
X360 = {
LANGUAGE_BRITISH = 4,
LANGUAGE_ENGLISH = 5,
LANGUAGE_FRENCH = 5,
LANGUAGE_GERMAN = 5,
LANGUAGE_ITALIAN = 5,
LANGUAGE_SPANISH = 5,
LANGUAGE_RUSSIAN = 5,
LANGUAGE_POLISH = 5,
LANGUAGE_KOREAN = 5,
LANGUAGE_TAIWANESE = 5,
LANGUAGE_JAPANESE = 4,
LANGUAGE_CHINESE = 5,
LANGUAGE_THAI = 5,
LANGUAGE_CZECH = 5,
LANGUAGE_SPANISHNA = 5,
LANGUAGE_PORTUGUESE = 5,
LANGUAGE_FRENCHCA = 1,
LANGUAGE_ENGLISHUK = 5
},
XB3 = {
LANGUAGE_BRITISH = 5,
LANGUAGE_ENGLISH = 4,
LANGUAGE_FRENCH = 4,
LANGUAGE_GERMAN = 4,
LANGUAGE_ITALIAN = 4,
LANGUAGE_SPANISH = 4,
LANGUAGE_RUSSIAN = 4,
LANGUAGE_POLISH = 4,
LANGUAGE_KOREAN = 4,
LANGUAGE_TAIWANESE = 4,
LANGUAGE_JAPANESE = 5,
LANGUAGE_CHINESE = 4,
LANGUAGE_THAI = 4,
LANGUAGE_CZECH = 4,
LANGUAGE_SPANISHNA = 4,
LANGUAGE_PORTUGUESE = 4,
LANGUAGE_FRENCHCA = 4,
LANGUAGE_ENGLISHUK = 4
},
PS3 = {
LANGUAGE_BRITISH = 4,
LANGUAGE_ENGLISH = 6,
LANGUAGE_FRENCH = 7,
LANGUAGE_GERMAN = 7,
LANGUAGE_ITALIAN = 7,
LANGUAGE_SPANISH = 7,
LANGUAGE_RUSSIAN = 7,
LANGUAGE_POLISH = 7,
LANGUAGE_KOREAN = 6,
LANGUAGE_TAIWANESE = 6,
LANGUAGE_JAPANESE = 4,
LANGUAGE_CHINESE = 6,
LANGUAGE_THAI = 6,
LANGUAGE_CZECH = 6,
LANGUAGE_SPANISHNA = 6,
LANGUAGE_PORTUGUESE = 6,
LANGUAGE_FRENCHCA = 6,
LANGUAGE_ENGLISHUK = 7
},
PS4 = {
LANGUAGE_BRITISH = 4,
LANGUAGE_ENGLISH = 5,
LANGUAGE_FRENCH = 7,
LANGUAGE_GERMAN = 7,
LANGUAGE_ITALIAN = 7,
LANGUAGE_SPANISH = 7,
LANGUAGE_RUSSIAN = 7,
LANGUAGE_POLISH = 7,
LANGUAGE_KOREAN = 6,
LANGUAGE_TAIWANESE = 6,
LANGUAGE_JAPANESE = 4,
LANGUAGE_CHINESE = 6,
LANGUAGE_THAI = 6,
LANGUAGE_CZECH = 6,
LANGUAGE_SPANISHNA = 5,
LANGUAGE_PORTUGUESE = 5,
LANGUAGE_FRENCHCA = 5,
LANGUAGE_ENGLISHUK = 7
},
PC = {
LANGUAGE_BRITISH = 3,
LANGUAGE_ENGLISH = 5,
LANGUAGE_FRENCH = 5,
LANGUAGE_GERMAN = 5,
LANGUAGE_ITALIAN = 5,
LANGUAGE_SPANISH = 5,
LANGUAGE_RUSSIAN = 5,
LANGUAGE_POLISH = 5,
LANGUAGE_KOREAN = 5,
LANGUAGE_TAIWANESE = 5,
LANGUAGE_JAPANESE = 3,
LANGUAGE_CHINESE = 5,
LANGUAGE_THAI = 5,
LANGUAGE_CZECH = 5,
LANGUAGE_SPANISHNA = 5,
LANGUAGE_PORTUGUESE = 5,
LANGUAGE_FRENCHCA = 5,
LANGUAGE_ENGLISHUK = 5
}
}
if Engine.IsXbox360() then
f1_local0 = f1_local3.X360[f1_local1]
elseif Engine.IsXB3() then
f1_local0 = f1_local3.XB3[f1_local1]
elseif Engine.IsPS3() then
f1_local0 = f1_local3.PS3[f1_local1]
elseif Engine.IsPS4() then
f1_local0 = f1_local3.PS4[f1_local1]
else
f1_local0 = f1_local3.PC[f1_local1]
end
assert( f1_local0 )
local f1_local4 = {}
for f1_local5 = 1, f1_local0, 1 do
table.insert( f1_local4, f1_local2 .. f1_local5 )
end
return f1_local4
end
function changePage( f2_arg0, f2_arg1 )
local f2_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f2_arg0 )
local f2_local1 = f2_local0.currentPage
f2_local0.currentPage = LUI.clamp( f2_local0.currentPage + f2_arg1, 1, #f2_local0.manualPages )
f2_arg0:dispatchEventToRoot( {
name = "change_page"
} )
if f2_local1 ~= f2_local0.currentPage then
if f2_arg1 > 0 then
f2_arg0:dispatchEventToRoot( {
name = "next_page"
} )
elseif f2_arg1 < 0 then
f2_arg0:dispatchEventToRoot( {
name = "previous_page"
} )
end
end
end
function game_manual()
local f3_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "game_manual" )
f3_local0.manualPages = f0_local0()
assert( #f3_local0.manualPages > 0 )
local self = LUI.UIElement.new()
self.id = "game_manual"
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
} )
self:animateToState( "default" )
local f3_local2 = LUI.UIImage.new()
f3_local2.id = "centerPage"
f3_local2:registerAnimationState( "default", {
material = RegisterMaterial( f3_local0.manualPages[1] ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
} )
f3_local2:animateToState( "default" )
f3_local2:registerEventHandler( "change_page", function ( element, event )
local f4_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
element:setImage( RegisterMaterial( f4_local0.manualPages[f4_local0.currentPage] ) )
end )
self:addElement( f3_local2 )
local f3_local3 = LUI.UIButton.new()
f3_local3.id = "leftArrow"
f3_local3:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = -330,
left = 100,
width = 40,
height = 80,
alpha = 1
} )
f3_local3:registerAnimationState( "disabled", {
alpha = 0.5
} )
f3_local3:registerAnimationState( "bump", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = -330,
left = 90,
width = 40,
height = 80
} )
f3_local3:registerEventHandler( "next_page", MBh.AnimateToState( "default", 0 ) )
f3_local3:registerEventHandler( "previous_page", function ( element, event )
local f5_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
local f5_local1 = {
{
"default",
0
},
{
"bump",
40,
true,
true
},
{
"default",
100,
true,
true
}
}
if f5_local0.currentPage <= 1 then
table.insert( f5_local1, {
"disabled",
80
} )
end
local f5_local2 = MBh.AnimateSequence( f5_local1 )
f5_local2( element, event )
end )
f3_local3:registerEventHandler( "button_action", function ( element, event )
changePage( element, -1 )
end )
f3_local3:registerEventHandler( "button_over", function ( element, event )
if event.focusType == FocusType.MouseOver then
element:processEvent( {
name = "arrow_image_over",
immediate = true
} )
end
end )
f3_local3:registerEventHandler( "button_up", function ( element, event )
local f8_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
if f8_local0.currentPage > 1 then
element:animateToState( "default" )
else
element:animateToState( "disabled" )
end
element:processEvent( {
name = "arrow_image_up",
immediate = true
} )
end )
f3_local3:animateToState( "default" )
f3_local3:animateToState( "disabled" )
local f3_local4 = LUI.UIImage.new()
f3_local4.id = "leftArrowImage"
f3_local4:registerAnimationState( "default", CoD.ColorizeState( Colors.white, {
material = RegisterMaterial( "widg_margin_arrow_lt" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
right = 0,
bottom = 0
} ) )
f3_local4:registerAnimationState( "over", CoD.ColorizeState( Colors.frontend_hilite, {} ) )
f3_local4:animateToState( "default" )
f3_local4:registerEventHandler( "arrow_image_over", MBh.AnimateToState( "over" ) )
f3_local4:registerEventHandler( "arrow_image_up", MBh.AnimateToState( "default" ) )
f3_local3:addElement( f3_local4 )
self:addElement( f3_local3 )
local f3_local5 = LUI.UIButton.new()
f3_local5.id = "rightArrow"
f3_local5:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
top = -330,
right = -100,
width = 40,
height = 80,
alpha = 1
} )
f3_local5:registerAnimationState( "disabled", {
alpha = 0.5
} )
f3_local5:registerAnimationState( "bump", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
top = -330,
right = -90,
width = 40,
height = 80
} )
f3_local5:registerEventHandler( "previous_page", MBh.AnimateToState( "default", 0 ) )
f3_local5:registerEventHandler( "next_page", function ( element, event )
local f9_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
local f9_local1 = {
{
"default",
0
},
{
"bump",
40,
true,
true
},
{
"default",
100,
true,
true
}
}
if #f9_local0.manualPages <= f9_local0.currentPage then
table.insert( f9_local1, {
"disabled",
80
} )
end
local f9_local2 = MBh.AnimateSequence( f9_local1 )
f9_local2( element, event )
end )
f3_local5:animateToState( "default" )
f3_local5:registerEventHandler( "button_action", function ( element, event )
changePage( element, 1 )
end )
f3_local5:registerEventHandler( "button_over", function ( element, event )
if event.focusType == FocusType.MouseOver then
element:processEvent( {
name = "arrow_image_over",
immediate = true
} )
end
end )
f3_local5:registerEventHandler( "button_up", function ( element, event )
local f12_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
if f12_local0.currentPage < #f12_local0.manualPages then
element:animateToState( "default" )
else
element:animateToState( "disabled" )
end
element:processEvent( {
name = "arrow_image_up",
immediate = true
} )
end )
local f3_local6 = LUI.UIImage.new()
f3_local6.id = "leftArrowImage"
f3_local6:registerAnimationState( "default", CoD.ColorizeState( Colors.white, {
material = RegisterMaterial( "widg_margin_arrow_rt" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
right = 0,
bottom = 0
} ) )
f3_local6:registerAnimationState( "over", CoD.ColorizeState( Colors.frontend_hilite, {} ) )
f3_local6:animateToState( "default" )
f3_local6:registerEventHandler( "arrow_image_over", MBh.AnimateToState( "over" ) )
f3_local6:registerEventHandler( "arrow_image_up", MBh.AnimateToState( "default" ) )
f3_local5:addElement( f3_local6 )
self:addElement( f3_local5 )
local f3_local7 = LUI.MenuBuilder.BuildAddChild( self, {
type = "button_helper_text_main",
properties = {
background_alpha = 1
}
} )
f3_local7:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
local f3_local8 = LUI.UIBindButton.new()
f3_local8.id = "bind"
f3_local8:registerEventHandler( "button_secondary", function ( element, event )
LUI.FlowManager.RequestLeaveMenu( element )
end )
f3_local8:registerEventHandler( "button_left", function ( element, event )
changePage( element, -1 )
end )
f3_local8:registerEventHandler( "button_right", function ( element, event )
changePage( element, 1 )
end )
self:addElement( f3_local8 )
self:registerEventHandler( "menu_create", function ( element, event )
local f16_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
f16_local0.currentPage = 1
changePage( element, 0 )
end )
return self
end
LUI.MenuBuilder.registerType( "game_manual", game_manual )
LockTable( _M )

View File

@ -0,0 +1,782 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function KinectGuideFeeder( f1_arg0 )
local f1_local0 = {}
Kinect.BuildShortcutArray()
if Kinect.ShortcutArray ~= nil then
for f1_local1 = 1, #Kinect.ShortcutArray, 1 do
local f1_local4 = f1_local1
table.insert( f1_local0, {
type = "UIButton",
id = "kinect_guide_grid_" .. f1_local4 .. "_id",
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
width = Kinect.Layout.CellWidth,
height = Kinect.Layout.CellHeight
}
},
handlers = {
button_action = function ( f2_arg0, f2_arg1 )
Kinect.ExecShortcut( f2_arg0, f2_arg1, f1_local4 )
end
},
children = {
{
type = "UIElement",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 1
},
dim = {
alpha = 0.8
}
},
handlers = {
button_over = MBh.AnimateLoop( {
{
"dim",
750,
true,
true
},
{
"default",
750
}
} ),
button_up = MBh.AnimateToState( "default", 0 )
},
children = {
{
type = "kinect_button_background",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0.05
},
focused = {
alpha = 0.4
}
},
handlers = {
button_over = MBh.AnimateToState( "focused" ),
button_up = MBh.AnimateToState( "default" )
}
}
}
},
{
type = "UIImage",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 16,
left = 0,
right = 16,
material = RegisterMaterial( "widg_triangle" ),
alpha = 0
},
focused = {
alpha = 1
}
},
handlers = {
button_over = MBh.AnimateToState( "focused" ),
button_up = MBh.AnimateToState( "default" )
}
},
{
type = "UIImage",
states = {
default = CoD.ColorizeState( Colors.white, {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = 0,
width = 128,
height = 128,
material = RegisterMaterial( "icon_kinect_number_0" .. f1_local4 ),
alpha = 0.1
} ),
focused = CoD.ColorizeState( Colors.black, {
scale = 0.1
} ),
unfocused = CoD.ColorizeState( Colors.black, {
scale = 0
} )
},
handlers = {
button_over = MBh.AnimateSequence( {
{
"unfocused",
0
},
{
"focused",
100
},
{
"unfocused",
100
}
} ),
button_up = MBh.AnimateToState( "default", 0 )
}
},
{
type = "UIElement",
states = {
default = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
bottom = 0,
left = 0,
right = 0,
height = 32
}
},
children = {
{
type = "kinect_btn_footer_bg",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0.5
}
}
},
{
type = "UIMarqueeText",
id = "kinect_guide_grid_desc_id",
properties = {
text = Engine.Localize( Kinect.ShortcutArray[f1_local4].TextLabel ),
textStyle = CoD.TextStyle.OutlinedMore
},
states = {
default = CoD.ColorizeState( Kinect.Swatch.DescColor, {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 3,
right = -3,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Center
} ),
focused = CoD.ColorizeState( Kinect.Swatch.DescColorInvert, {} ),
unfocused = CoD.ColorizeState( Kinect.Swatch.DescColor, {} )
}
}
}
}
}
} )
end
else
DebugPrint( "Kinect: Warning, Kinect.ShortcutArray is nil!" )
end
return f1_local0
end
function kinect_btn_footer_bg()
return {
type = "UIElement",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
children = {
{
type = "UIImage",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
right = 8,
material = RegisterMaterial( "box_kinect_name_lt" )
}
}
},
{
type = "UIImage",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 8,
right = -8,
material = RegisterMaterial( "box_kinect_name_mid" )
}
}
},
{
type = "UIImage",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = true,
top = 0,
bottom = 0,
left = -8,
right = 0,
material = RegisterMaterial( "box_kinect_name_rt" )
}
}
}
}
}
end
function HandleKinectGuideMenuAutoRefresh( f4_arg0, f4_arg1 )
if Kinect.DoWeNeedToRebuildShortcutArray() == true then
LUI.FlowManager.RequestLeaveMenu( f4_arg0 )
end
end
function kinect_guide_grid()
return {
type = "UIGrid",
id = "kinect_guide_grid_id",
handlers = {
autorefresh = HandleKinectGuideMenuAutoRefresh
},
properties = {
elementsPerRow = Kinect.Layout.NumRows,
rowHeight = 150,
hSpacing = 6,
vSpacing = 6,
vAlign = LUI.Alignment.Center,
hAlign = LUI.Alignment.Center
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
childrenFeeder = KinectGuideFeeder
}
end
function HandleKinectGuideMenuSpeechBack( f6_arg0, f6_arg1, f6_arg2 )
if not Kinect.IsWhatCanISayMenuUp() and Kinect.IsKinectGuideUp() then
LUI.FlowManager.RequestLeaveMenu( f6_arg0 )
LUI.Speech.PerformingSpeechAction()
end
end
function HandleKinectGuideMenuSpeechCancel( f7_arg0, f7_arg1, f7_arg2 )
LUI.FlowManager.RequestLeaveMenu( f7_arg0 )
LUI.Speech.PerformingSpeechAction()
end
function HandleKinectGuideMenuSpeechYes( f8_arg0, f8_arg1, f8_arg2 )
end
function HandleKinectGuideMenuSpeechNo( f9_arg0, f9_arg1, f9_arg2 )
end
function HandleKinectGuideMenuSpeechShortcut( f10_arg0, f10_arg1, f10_arg2 )
assert( f10_arg2, "HandleKinectGuideMenuSpeechShortcut: Missing extradata param!" )
assert( f10_arg2.shortcutNum, "HandleKinectGuideMenuSpeechShortcut: Missing extradata shortcutNum param!" )
Kinect.ExecShortcut( f10_arg0, f10_arg1, f10_arg2.shortcutNum )
end
function HandleKinectGuideMenuSpeechReplaceShortcut( f11_arg0, f11_arg1, f11_arg2 )
assert( f11_arg2, "HandleKinectGuideMenuSpeechReplaceShortcut: Missing extradata param!" )
assert( f11_arg2.shortcutNum, "HandleKinectGuideMenuSpeechReplaceShortcut: Missing extradata shortcutNum param!" )
end
if Engine.HasSpeechFeature() then
KinectGuideMenuSpeechGrammarHandlersArray = {
{
action = "back",
confidence = LUI.Speech.defaultConfidence,
handler = HandleKinectGuideMenuSpeechBack,
extradata = nil
},
{
action = "cancel",
confidence = LUI.Speech.defaultConfidence,
handler = HandleKinectGuideMenuSpeechCancel,
extradata = nil
},
{
action = "yes",
confidence = LUI.Speech.defaultConfidence,
handler = HandleKinectGuideMenuSpeechYes,
extradata = nil
},
{
action = "no",
confidence = LUI.Speech.defaultConfidence,
handler = HandleKinectGuideMenuSpeechNo,
extradata = nil
},
{
action = "Shortcut 1",
confidence = LUI.Speech.shortcutMenuConfidence,
handler = HandleKinectGuideMenuSpeechShortcut,
extradata = {
shortcutNum = 1
}
},
{
action = "Shortcut 2",
confidence = LUI.Speech.shortcutMenuConfidence,
handler = HandleKinectGuideMenuSpeechShortcut,
extradata = {
shortcutNum = 2
}
},
{
action = "Shortcut 3",
confidence = LUI.Speech.shortcutMenuConfidence,
handler = HandleKinectGuideMenuSpeechShortcut,
extradata = {
shortcutNum = 3
}
},
{
action = "Shortcut 4",
confidence = LUI.Speech.shortcutMenuConfidence,
handler = HandleKinectGuideMenuSpeechShortcut,
extradata = {
shortcutNum = 4
}
},
{
action = "Shortcut 5",
confidence = LUI.Speech.shortcutMenuConfidence,
handler = HandleKinectGuideMenuSpeechShortcut,
extradata = {
shortcutNum = 5
}
},
{
action = "Shortcut 6",
confidence = LUI.Speech.shortcutMenuConfidence,
handler = HandleKinectGuideMenuSpeechShortcut,
extradata = {
shortcutNum = 6
}
},
{
action = "Shortcut 7",
confidence = LUI.Speech.shortcutMenuConfidence,
handler = HandleKinectGuideMenuSpeechShortcut,
extradata = {
shortcutNum = 7
}
},
{
action = "Shortcut 8",
confidence = LUI.Speech.shortcutMenuConfidence,
handler = HandleKinectGuideMenuSpeechShortcut,
extradata = {
shortcutNum = 8
}
},
{
action = "Shortcut 9",
confidence = LUI.Speech.shortcutMenuConfidence,
handler = HandleKinectGuideMenuSpeechShortcut,
extradata = {
shortcutNum = 9
}
},
{
action = "Replace Shortcut 1",
confidence = LUI.Speech.defaultConfidence,
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
extradata = {
shortcutNum = 1
}
},
{
action = "Replace Shortcut 2",
confidence = LUI.Speech.defaultConfidence,
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
extradata = {
shortcutNum = 2
}
},
{
action = "Replace Shortcut 3",
confidence = LUI.Speech.defaultConfidence,
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
extradata = {
shortcutNum = 3
}
},
{
action = "Replace Shortcut 4",
confidence = LUI.Speech.defaultConfidence,
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
extradata = {
shortcutNum = 4
}
},
{
action = "Replace Shortcut 5",
confidence = LUI.Speech.defaultConfidence,
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
extradata = {
shortcutNum = 5
}
},
{
action = "Replace Shortcut 6",
confidence = LUI.Speech.defaultConfidence,
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
extradata = {
shortcutNum = 6
}
},
{
action = "Replace Shortcut 7",
confidence = LUI.Speech.defaultConfidence,
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
extradata = {
shortcutNum = 7
}
},
{
action = "Replace Shortcut 8",
confidence = LUI.Speech.defaultConfidence,
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
extradata = {
shortcutNum = 8
}
},
{
action = "Replace Shortcut 9",
confidence = LUI.Speech.defaultConfidence,
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
extradata = {
shortcutNum = 9
}
}
}
else
KinectGuideMenuSpeechGrammarHandlersArray = {}
end
function HandleKinectGuideMenuSpeechHandler( f12_arg0, f12_arg1 )
if Engine.HasSpeechFeature() then
LUI.Speech.ProcessActionEvent( f12_arg0, f12_arg1, KinectGuideMenuSpeechGrammarHandlersArray )
end
end
function HandleKinectGuideMenuCreate( f13_arg0, f13_arg1 )
f13_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_secondary",
helper_text = Engine.Localize( "@LUA_MENU_BACK" ),
side = "left",
clickable = true
} )
end
function kinect_guide()
return {
type = "UIElement",
id = "kinect_guide_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
handlers = {
menu_create = HandleKinectGuideMenuCreate,
speech_action = HandleKinectGuideMenuSpeechHandler
},
children = {
{
type = "UIImage",
id = "kinect_menu_overlay_id",
states = {
default = CoD.ColorizeState( Swatches.Overlay.Color, {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
material = RegisterMaterial( "white" ),
alpha = Swatches.Overlay.AlphaMore
} )
}
},
{
type = "UIElement",
id = "kinect_menu_container_id",
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
width = Kinect.Layout.Width,
height = Kinect.Layout.Height
}
},
children = {
{
type = "generic_drop_shadow",
properties = {
offset_shadow = 0
}
},
{
type = "generic_menu_titlebar",
id = "kinect_title_id",
properties = {
font = CoD.TextSettings.ExtraBigFont,
title_bar_text = Engine.Localize( "@SPEECH_SHORTCUTS_TITLE" ),
title_bar_alignment = LUI.Alignment.Center,
fill_alpha = 1
}
},
{
type = "generic_menu_background",
id = "kinect_background_id",
properties = {
fill_alpha = 1
}
},
{
type = "kinect_guide_grid",
id = "kinect_guide_grid_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = GenericTitleBarDims.TitleBarHeight + 10,
bottom = -1 * (GenericFooterDims.Height + 5),
left = 5,
right = -5
}
}
},
{
type = "UITimer",
id = "kinect_guid_grid_autorefresh_timer",
properties = {
event = "autorefresh",
interval = 1000,
disposable = false,
broadcastToRoot = false
}
},
{
type = "UIImage",
states = {
default = CoD.ColorizeState( Swatches.GenericMenu.Border, {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
bottom = -40,
left = 1,
right = -1,
height = 1,
material = RegisterMaterial( "white" ),
alpha = Swatches.GenericMenu.BorderAlpha
} )
}
},
{
type = "button_helper_text_main",
id = "kinect_helper_text_id",
properties = {
left_inset = 10,
left_margin = 1,
right_margin = -1,
top_margin = GenericFooterDims.TopMargin_WithoutBackground,
spacing = 65,
background_alpha = 0
}
},
{
type = "UIBindButton",
id = "kinect_bind_buttons_id",
handlers = {
button_secondary = MBh.LeaveMenu()
}
}
}
}
}
}
end
function kinect_button_background( f15_arg0, f15_arg1 )
local f15_local0 = f15_arg1.red or 1
local f15_local1 = f15_arg1.green or 1
local f15_local2 = f15_arg1.blue or 1
local f15_local3 = f15_arg1.alpha or 1
local f15_local4 = f15_arg1.colorLocked or false
local self = LUI.UIElement.new()
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = top,
bottom = 0,
left = 0,
right = 0
} )
self:animateToState( "default" )
local f15_local6 = LUI.UIImage.new()
f15_local6.id = "corner"
f15_local6:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 32,
left = 0,
right = 32,
material = RegisterMaterial( "btn_cas_item_topleft" )
} )
f15_local6:animateToState( "default" )
self:addElement( f15_local6 )
local f15_local7 = LUI.UIImage.new()
f15_local7.id = "top"
f15_local7:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 32,
left = 32,
right = 0,
material = RegisterMaterial( "white" )
} )
f15_local7:animateToState( "default" )
self:addElement( f15_local7 )
local f15_local8 = LUI.UIImage.new()
f15_local8.id = "bottom"
f15_local8:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 32,
bottom = 0,
left = 0,
right = 0,
material = RegisterMaterial( "white" )
} )
f15_local8:animateToState( "default" )
self:addElement( f15_local8 )
self.colorize = function ( f16_arg0, f16_arg1, f16_arg2, f16_arg3 )
for f16_local3, f16_local4 in ipairs( {
f15_local6,
f15_local7,
f15_local8
} ) do
f16_local4:registerAnimationState( "current", {
red = f16_arg0,
green = f16_arg1,
blue = f16_arg2,
alpha = f16_arg3
} )
f16_local4:animateToState( "current" )
end
end
self.colorize( f15_local0, f15_local1, f15_local2, f15_local3 )
if not f15_local4 then
self:registerEventHandler( "updateBackgroundColor", function ( element, event )
element.colorize( event.red, event.green, event.blue, event.alpha )
end )
end
return self
end
LUI.MenuBuilder.registerDef( "kinect_guide", kinect_guide )
LUI.FlowManager.RegisterStackPopBehaviour( "kinect_guide", function ()
Engine.ExecNow( "decnosplitscreencontrol kinect_guide_dec" )
end )
LUI.MenuBuilder.registerDef( "kinect_guide_grid", kinect_guide_grid )
LUI.MenuBuilder.registerDef( "kinect_btn_footer_bg", kinect_btn_footer_bg )
LUI.MenuBuilder.registerType( "kinect_button_background", kinect_button_background )
LockTable( _M )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,425 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
LUI.Playercard = {}
XP_BAR_WIDTH = 212
LUI.Playercard.new = function ( f1_arg0, f1_arg1, f1_arg2 )
local f1_local0 = 130
local self = LUI.UIElement.new()
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
height = 128,
width = 512,
alpha = 1
} )
self:registerAnimationState( "hidden", {
alpha = 0
} )
self:animateToState( "default" )
self.card = LUI.UIElement.new()
local f1_local2 = self.card
self:addElement( f1_local2 )
f1_local2.id = "playercard" .. (f1_arg1.gamertag and "_" .. f1_arg1.gamertag or "")
f1_local2:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = -18,
left = -12,
height = 128,
width = 512
} )
f1_local2:animateToState( "default" )
local f1_local3 = LUI.UIImage.new()
f1_local3.id = "mainBG"
f1_local3:registerAnimationState( "default", {
material = RegisterMaterial( "card_bg" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
} )
f1_local3:animateToState( "default" )
f1_local2:addElement( f1_local3 )
f1_local2.playerBG = LUI.UIImage.new()
f1_local2.playerBG.id = "playerBG"
f1_local2.playerBG:animateToState( "default" )
f1_local2:addElement( f1_local2.playerBG )
f1_local2.playerBGdarken = LUI.UIImage.new()
f1_local2.playerBGdarken.id = "playerBGdarken"
f1_local2.playerBGdarken:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
width = 399,
height = 64,
bottom = -24,
left = 53,
alpha = 0.85
} )
f1_local2.playerBGdarken:animateToState( "default" )
f1_local2.playerBGdarken:setImage( RegisterMaterial( "card_image_darken" ) )
f1_local2:addElement( f1_local2.playerBGdarken )
f1_local2.gamertag = LUI.UIMarqueeText.new()
f1_local2.gamertag.id = "gamertag"
f1_local2.gamertag:registerAnimationState( "default", {
alignment = LUI.Alignment.Left,
font = CoD.TextSettings.NormalFont.Font,
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = f1_local0,
right = -60,
top = 18,
height = CoD.TextSettings.NormalFont.Height
} )
f1_local2.gamertag:animateToState( "default" )
f1_local2:addElement( f1_local2.gamertag )
f1_local2.slogan = LUI.UIMarqueeText.new()
f1_local2.slogan.id = "slogan"
f1_local2.slogan:setTextStyle( CoD.TextStyle.OutlinedMore )
f1_local2.slogan:registerAnimationState( "default", {
alignment = LUI.Alignment.Left,
font = CoD.TextSettings.NormalFont.Font,
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = f1_local0,
right = -60,
top = 40,
height = CoD.TextSettings.NormalFont.Height,
red = 1,
green = 1,
blue = 1
} )
f1_local2.slogan:animateToState( "default" )
f1_local2:addElement( f1_local2.slogan )
f1_local2.clantag = LUI.UIText.new()
f1_local2.clantag.id = "clantag"
f1_local2.clantag.m_textStyle = CoD.TextStyle.OutlinedMore
f1_local2.clantag:registerAnimationState( "default", {
alignment = LUI.Alignment.Left,
font = CoD.TextSettings.NormalFont.Font,
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = f1_local0,
right = -60,
top = 80,
height = CoD.TextSettings.NormalFont.Height,
red = Colors.primary_text_color.r,
green = Colors.primary_text_color.g,
blue = Colors.primary_text_color.b
} )
f1_local2.clantag:animateToState( "default" )
f1_local2:addElement( f1_local2.clantag )
if not (not IsPublicMatch or not IsPublicMatch()) or Engine.IsAliensMode() or f1_arg1.force_show_rank then
f1_local2.rankIcon = LUI.UIImage.new()
f1_local2.rankIcon.id = "rankIcon"
f1_local2:addElement( f1_local2.rankIcon )
f1_local2.rankNum = LUI.UIText.new()
f1_local2.rankNum.id = "rankNum"
f1_local2.rankNum.m_textStyle = CoD.TextStyle.ShadowedMore
f1_local2.rankNum:registerAnimationState( "default", {
alignment = LUI.Alignment.Right,
font = CoD.TextSettings.BigFont.Font,
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
left = -165,
right = -65,
top = 58,
height = CoD.TextSettings.BigFont.MaxHeight
} )
f1_local2.rankNum:animateToState( "default" )
f1_local2:addElement( f1_local2.rankNum )
end
if f1_arg1.use_level_progress then
LUI.Playercard.AddLevelProgressBar( f1_local2 )
end
f1_local2.patchShape = LUI.UIImage.new()
f1_local2.patchShape.id = "patchShape"
f1_local2:addElement( f1_local2.patchShape )
f1_local2.patchEmblem = LUI.UIImage.new()
f1_local2.patchEmblem.id = "patchEmblem"
f1_local2.patchEmblem:animateToState( "default" )
f1_local2.patchEmblem.scale = f1_arg1.patchScale or 0
f1_local2:addElement( f1_local2.patchEmblem )
self.feedContent = LUI.Playercard.FeedContent
self:registerEventHandler( "update_playercard", function ( element, event )
element:feedContent( event )
end )
self:registerEventHandler( "hide_playercard", function ( element, event )
element:animateToState( "hidden", event.fade or 0 )
end )
self:registerEventHandler( "show_playercard", function ( element, event )
element:animateToState( "default", event.fade or 0 )
end )
self:feedContent( f1_arg1 )
return self
end
LUI.Playercard.AddLevelProgressBar = function ( f5_arg0 )
local f5_local0 = 0
local f5_local1 = 140
local f5_local2 = -50
local f5_local3 = 150
local f5_local4 = CoD.TextSettings.SmallFont.Height
local levelProgressContainer = LUI.UIElement.new( CoD.CreateState( 45, -22, -58, 0, CoD.AnchorTypes.BottomLeftRight ) )
levelProgressContainer.id = "playercard_level_bar_container_id"
local f5_local6 = CoD.CreateState( 0, 0, f5_local3, 0, CoD.AnchorTypes.TopBottomLeft )
CoD.ColorizeState( Colors.black, f5_local6 )
f5_local6.material = RegisterMaterial( "box_white_gradient_fade_rt" )
f5_arg0.bgFade = LUI.UIImage.new( f5_local6 )
levelProgressContainer:addElement( f5_arg0.bgFade )
f5_local6 = CoD.CreateState( f5_local3, 0, 0, 0, CoD.AnchorTypes.All )
CoD.ColorizeState( Colors.black, f5_local6 )
f5_local6.material = RegisterMaterial( "white" )
f5_arg0.bgFill = LUI.UIImage.new( f5_local6 )
levelProgressContainer:addElement( f5_arg0.bgFill )
f5_local6 = CoD.CreateState( f5_local1, 6, f5_local1 + XP_BAR_WIDTH, -6, CoD.AnchorTypes.TopBottomLeft )
CoD.ColorizeState( Colors.grey_2, f5_local6 )
f5_arg0.xpBar = LUI.UIImage.new( f5_local6 )
f5_arg0.xpBar.id = "playercard_level_bar_bg_id"
levelProgressContainer:addElement( f5_arg0.xpBar )
f5_local6 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.TopBottomLeft )
f5_local6.material = RegisterMaterial( "btn_cas_fill_f" )
f5_arg0.xpFillBar = LUI.UIImage.new( {
f5_local6
} )
f5_arg0.xpFillBar.id = "playercard_level_bar_id"
f5_arg0.xpBar:addElement( f5_arg0.xpFillBar )
f5_arg0.currentRankIcon = LUI.UIImage.new( CoD.CreateState( f5_local1 - 26, f5_local0, f5_local1 - 6, f5_local0 + f5_local4, CoD.AnchorTypes.TopLeft ) )
f5_arg0.currentRankIcon.id = "playercard_current_rank_icon_id"
f5_local6 = CoD.CreateState( 0, f5_local0, f5_local1 - 32, f5_local0 + f5_local4, CoD.AnchorTypes.TopLeft )
f5_local6.font = CoD.TextSettings.SmallFont.Font
f5_local6.alignment = LUI.Alignment.Right
CoD.ColorizeState( Colors.md_grey, f5_local6 )
f5_arg0.currentRankText = LUI.UIText.new( f5_local6 )
f5_arg0.currentRankText.id = "playercard_current_rank_id"
f5_arg0.nextRankIcon = LUI.UIImage.new( CoD.CreateState( f5_local2, f5_local0, f5_local2 + 20, f5_local0 + f5_local4, CoD.AnchorTypes.TopRight ) )
f5_arg0.nextRankIcon.id = "playercard_next_rank_icon_id"
f5_local6 = CoD.CreateState( f5_local2 + 25, f5_local0, 0, f5_local0 + f5_local4, CoD.AnchorTypes.TopRight )
f5_local6.font = CoD.TextSettings.SmallFont.Font
f5_local6.alignment = LUI.Alignment.Left
CoD.ColorizeState( Colors.md_grey, f5_local6 )
f5_arg0.nextRankText = LUI.UIText.new( f5_local6 )
f5_arg0.nextRankText.id = "playercard_next_rank_id"
levelProgressContainer:addElement( f5_arg0.currentRankIcon )
levelProgressContainer:addElement( f5_arg0.currentRankText )
levelProgressContainer:addElement( f5_arg0.nextRankIcon )
levelProgressContainer:addElement( f5_arg0.nextRankText )
f5_arg0:addElement( levelProgressContainer )
f5_arg0.levelProgressContainer = levelProgressContainer
end
LUI.Playercard.FeedContent = function ( f6_arg0, f6_arg1 )
local f6_local0 = f6_arg0.card
if f6_arg1.gamertag then
f6_local0.gamertag:setText( f6_arg1.gamertag )
end
if f6_arg1.clantag then
local f6_local1 = f6_arg1.clantag
if f6_arg1.clantag ~= "" then
if not string.find( f6_arg1.clantag, "[", nil, true ) then
f6_local1 = "[" .. f6_local1
end
if not string.find( f6_arg1.clantag, "]", nil, true ) then
f6_local1 = f6_local1 .. "]"
end
end
f6_local0.clantag:setText( f6_local1 )
end
if f6_arg1.background then
local f6_local1 = RegisterMaterial( Cac.Customization.Fields[Cac.Customization.FieldIndexes.Background].GetUIMaterial( f6_arg1.background ) )
if f6_local1 then
f6_local0.playerBG:setImage( f6_local1 )
f6_local0.playerBG:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
width = 399,
height = 64,
bottom = -24,
left = 53
} )
f6_local0.playerBG:animateToState( "default" )
end
end
if f6_local0.rankIcon and f6_local0.rankNum and f6_arg1.rank and f6_arg1.prestige then
local f6_local1 = Engine.IsAliensMode() and CoD.PlayMode.Aliens or CoD.PlayMode.Core
local f6_local2 = Rank.GetRankDisplay( f6_arg1.rank, f6_local1 )
f6_local0.rankNum:setText( f6_local2 )
local f6_local3 = RegisterMaterial( Rank.GetRankIcon( f6_arg1.rank, f6_arg1.prestige, f6_local1 ) )
if f6_local3 then
local f6_local4 = f6_arg1.prestige > 0
local f6_local5
if f6_local4 then
f6_local5 = 46
if not f6_local5 then
else
local f6_local6
if f6_local4 then
f6_local6 = 61
if not f6_local6 then
else
local f6_local7, f6_local8, f6_local9, f6_local10 = GetTextDimensions( f6_local2, CoD.TextSettings.BigFont.Font, CoD.TextSettings.BigFont.MaxHeight )
local f6_local11 = f6_local9 - f6_local7
f6_local0.rankIcon:setImage( f6_local3 )
f6_local0.rankIcon:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
top = f6_local6,
right = -70 - f6_local11,
width = f6_local5,
height = f6_local5
} )
f6_local0.rankIcon:animateToState( "default" )
end
end
f6_local6 = 63
end
end
f6_local5 = 40
end
end
if f6_arg1.patchShape then
local f6_local1 = RegisterMaterial( Cac.Customization.Fields[Cac.Customization.FieldIndexes.Patchbacking].GetUIMaterial( f6_arg1.patchShape ) )
if f6_local1 then
f6_local0.patchShape:setImage( f6_local1 )
f6_local0.patchShape:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
width = 128,
height = 128
} )
f6_local0.patchShape:animateToState( "default" )
end
end
if f6_arg1.patchEmblem then
local f6_local1 = RegisterMaterial( Cac.Customization.Fields[Cac.Customization.FieldIndexes.Patch].GetUIMaterial( f6_arg1.patchEmblem ) )
if f6_local1 then
f6_local0.patchEmblem:setImage( f6_local1 )
f6_local0.patchEmblem:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
width = 128,
height = 128,
red = 1,
green = 1,
blue = 1,
alpha = 1,
scale = f6_local0.patchEmblem.scale
} )
f6_local0.patchEmblem:animateToState( "default" )
end
local f6_local2 = Cac.Customization.Fields[Cac.Customization.FieldIndexes.Patch]
if f6_local2 and f6_local2.GetQuip then
local f6_local3 = f6_local2.GetQuip( f6_arg1.patchEmblem )
if f6_local3 then
f6_local0.slogan:setText( Engine.Localize( f6_local3 ) )
end
end
end
if f6_arg1.experience and f6_arg1.prestige and f6_local0.levelProgressContainer then
local f6_local1 = Engine.GetCurrentCoDPlayMode()
local f6_local2 = Rank.GetMaxRank( f6_local1 )
local f6_local3 = Engine.IsAliensMode() and Lobby.GetAlienRankForXP( f6_arg1.experience ) or Lobby.GetRankForXP( f6_arg1.experience )
local f6_local4
if f6_local3 < f6_local2 then
f6_local4 = f6_local3 + 1
if not f6_local4 then
else
local f6_local5 = Engine.IsAliensMode() and LUI.mp_menus.Aliens.AlienRanks.MaxPrestige or Lobby.GetMaxPrestigeLevel()
local f6_local6 = Rank.GetRankMaxXP( f6_local2 ) <= f6_arg1.experience
f6_local0.currentRankText:setText( Rank.GetRankDisplay( f6_local3 ) )
local f6_local7 = RegisterMaterial( Rank.GetRankIcon( f6_local3, f6_arg1.prestige, f6_local1 ) )
if f6_local7 then
f6_local0.currentRankIcon:setImage( f6_local7 )
end
local f6_local8 = false
if not Engine.IsAliensMode() and f6_local3 == f6_local4 and not f6_local6 and f6_arg1.prestige < f6_local5 then
f6_local8 = true
end
if Engine.IsAliensMode() and f6_local3 == LUI.mp_menus.Aliens.AlienRanks.MaxLevel and f6_arg1.prestige < f6_local5 then
f6_local8 = true
f6_local4 = 0
end
f6_local0.nextRankText:setText( Rank.GetRankDisplay( f6_local4, f6_local1 ) )
local f6_local9 = RegisterMaterial
local f6_local10 = Rank.GetRankIcon
local f6_local11 = f6_local4
local f6_local12
if f6_local8 then
f6_local12 = f6_arg1.prestige + 1
if not f6_local12 then
else
f6_local7 = f6_local9( f6_local10( f6_local11, f6_local12, f6_local1 ) )
if f6_local7 then
f6_local0.nextRankIcon:setImage( f6_local7 )
end
f6_local9 = Rank.GetRankMinXP( f6_local3, f6_local1 )
f6_local10 = Rank.GetRankMinXP( f6_local4, f6_local1 )
f6_local11 = Rank.GetRankXPToNext( f6_local3, f6_local1 )
if f6_local11 == nil or f6_local11 == 0 then
f6_local11 = 1
end
f6_local12 = math.min( (f6_arg1.experience - f6_local9) / f6_local11, 1 )
if Engine.IsAliensMode() and f6_local3 == LUI.mp_menus.Aliens.AlienRanks.SuperMaxLevel then
f6_local12 = 1
end
f6_local0.xpFillBar:registerAnimationState( "default", {
top = 0,
bottom = 0,
left = 0,
right = f6_local12 * XP_BAR_WIDTH,
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false
} )
f6_local0.xpFillBar:animateToState( "default", 0 )
end
end
f6_local12 = f6_arg1.prestige
end
end
f6_local4 = f6_local3
end
end
LUI.MenuBuilder.registerType( "playercard", LUI.Playercard.new )
LockTable( _M )

View File

@ -0,0 +1,122 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function profileMenuOptionsFeeder( f1_arg0 )
return {
{
type = "UIGenericButton",
id = "offile_profile_create_btn",
properties = {
style = GenericButtonSettings.Styles.GlassButton,
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
text = Engine.Localize( "@MENU_CREATE_NEW_OFFLINE_PROFILE" ),
button_action_func = function ( f2_arg0, f2_arg1 )
DebugPrint( "button offile_profile_create_btn press" )
Engine.Exec( "newOfflineProfile", f2_arg1.controller )
LUI.FlowManager.RequestLeaveMenu( f2_arg0 )
end
}
},
{
type = "UIGenericButton",
id = "offile_profile_load_btn",
properties = {
style = GenericButtonSettings.Styles.GlassButton,
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
text = Engine.Localize( "@MENU_LOAD_EXISTING_OFFLINE_PROFILE" ),
button_action_func = function ( f3_arg0, f3_arg1 )
DebugPrint( "button offile_profile_load_btn press" )
Engine.Exec( "loadOfflineProfile", f3_arg1.controller )
LUI.FlowManager.RequestLeaveMenu( f3_arg0 )
end
}
},
{
type = "UIGenericButton",
id = "offile_profile_delete_btn",
properties = {
style = GenericButtonSettings.Styles.GlassButton,
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
text = Engine.Localize( "@MENU_DELETE_OFFLINE_PROFILE" ),
button_action_func = function ( f4_arg0, f4_arg1 )
DebugPrint( "button offile_profile_delete_btn press" )
Engine.Exec( "deleteOfflineProfile", f4_arg1.controller )
LUI.FlowManager.RequestLeaveMenu( f4_arg0 )
end
}
}
}
end
function OnCreatePS3ProfileMenu( f5_arg0, f5_arg1 )
DebugPrint( "On Create PS3 profile menu" )
Engine.ExecNow( "incnosplitscreencontrol menu_ps3_profile" )
end
function OnClosePS3ProfileMenu( f6_arg0, f6_arg1 )
DebugPrint( "On Close PS3 profile menu" )
Engine.ExecNow( "decnosplitscreencontrol menu_ps3_profile" )
local f6_local0 = Engine.GetLuiRoot()
if f6_local0:IsMenuOpenAndVisible( "menu_splitscreensignin" ) and not f6_local0:IsMenuOpenAndVisible( "menu_resetstats_warning" ) and not f6_local0:IsMenuOpenAndVisible( "menu_ps3_savegame_warning" ) then
Engine.Exec( "startsplitscreensignin" )
end
end
function menu_ps3_profile()
return {
type = "generic_selectionList_popup",
id = "offline_profile_management_popup",
properties = {
popup_title = Engine.Localize( "@MENU_LOAD_OFFLINE_PROFILE" ),
popup_childfeeder = profileMenuOptionsFeeder
},
handlers = {
menu_create = OnCreatePS3ProfileMenu,
menu_close = OnClosePS3ProfileMenu
}
}
end
function SaveErrorContinue( f8_arg0, f8_arg1 )
DebugPrint( "Save Error Continue" )
if Engine.GetDvarBool( "splitscreen" ) then
Engine.Exec( "endsplitscreensignin" )
LUI.FlowManager.RequestAddMenu( f8_arg0, "menu_gamesetup_splitscreen", false, f8_arg1.controller, false, {} )
else
assert( f8_arg0.properties.callback_params.continue_to_menu )
LUI.FlowManager.RequestOldMenu( f8_arg0, f8_arg0.properties.callback_params.continue_to_menu, false )
end
end
function SaveErrorReturn( f9_arg0, f9_arg1 )
DebugPrint( "Save Error Cancel" )
if Engine.GetDvarBool( "splitscreen" ) then
Engine.Exec( "startsplitscreensignin" )
end
end
function GetSomeText()
return "my cool text"
end
function menu_ps3_savegame_error()
return {
type = "generic_yesno_popup",
properties = {
message_text = Engine.UserWithoutOfflineProfile(),
popup_title = Engine.Localize( "@MENU_SAVE_ERROR_MP" ),
yes_text = Engine.Localize( "@MENU_RESUMEGAME_NOSAVE_MP" ),
no_text = Engine.Localize( "@MENU_RETURN_SIGNIN_MP" ),
yes_action = SaveErrorContinue,
no_action = SaveErrorReturn
}
}
end
LUI.MenuBuilder.registerDef( "menu_ps3_profile", menu_ps3_profile )
LUI.MenuBuilder.registerDef( "menu_ps3_savegame_error", menu_ps3_savegame_error )
LockTable( _M )

View File

@ -0,0 +1,123 @@
Rank = {}
RankTable = {
File = "mp/rankTable.csv",
AlienFile = "mp/alien/rankTable.csv",
Cols = {
RankId = 0,
Rank = 1,
MinXp = 2,
XpToNextLevel = 3,
ShortRankName = 4,
FullRankName = 5,
RankIcon = 6,
MaxXp = 7,
Level = 13,
DisplayLevel = 14,
InGameRank = 16,
UnlockString = 17
}
}
RankIconTable = {
File = "mp/rankIconTable.csv",
AlienFile = "mp/alien/rankIconTable.csv",
Cols = {
RankId = 0,
Standard = 1,
Prestige1 = 2
}
}
Rank.GetMaxRank = function ( f1_arg0 )
local f1_local0 = nil
if not f1_arg0 or f1_arg0 == CoD.PlayMode.Core or f1_arg0 == CoD.PlayMode.SquadVsSquad then
f1_local0 = tonumber( Engine.TableLookup( RankTable.File, 0, "maxrank", 1 ) )
assert( f1_local0 ~= nil, "Rank.GetMaxRank() : Could not read max rank (MP)" )
elseif f1_arg0 == CoD.PlayMode.Aliens then
f1_local0 = tonumber( Engine.TableLookup( RankTable.AlienFile, 0, "maxrank", 1 ) )
assert( f1_local0 ~= nil, "Rank.GetMaxRank() : Could not read max rank (ALIENS)" )
else
DebugPrint( "[WARNING] Rank.GetMaxRank() : Unsupported CodPlayMode [" .. f1_arg0 .. "]!" )
f1_local0 = 0
end
return f1_local0
end
Rank.GetRankDisplay = function ( f2_arg0, f2_arg1 )
local f2_local0 = nil
if not f2_arg1 or f2_arg1 == CoD.PlayMode.Core or f2_arg1 == CoD.PlayMode.SquadVsSquad then
f2_local0 = Engine.TableLookup( RankTable.File, RankTable.Cols.RankId, f2_arg0, RankTable.Cols.DisplayLevel )
elseif f2_arg1 == CoD.PlayMode.Aliens then
f2_local0 = Engine.TableLookup( RankTable.AlienFile, RankTable.Cols.RankId, f2_arg0, RankTable.Cols.DisplayLevel )
else
DebugPrint( "[WARNING] Rank.GetRankDisplay() : Unsupported CodPlayMode [" .. f2_arg1 .. "]!" )
f2_local0 = ""
end
return f2_local0
end
Rank.GetRankMinXP = function ( f3_arg0, f3_arg1 )
local f3_local0 = nil
if not f3_arg1 or f3_arg1 == CoD.PlayMode.Core or f3_arg1 == CoD.PlayMode.SquadVsSquad then
f3_local0 = tonumber( Engine.TableLookup( RankTable.File, RankTable.Cols.RankId, f3_arg0, RankTable.Cols.MinXp ) )
elseif f3_arg1 == CoD.PlayMode.Aliens then
f3_local0 = tonumber( Engine.TableLookup( RankTable.AlienFile, RankTable.Cols.RankId, f3_arg0, RankTable.Cols.MinXp ) )
else
DebugPrint( "[WARNING] Rank.GetRankMinXP() : Unsupported CodPlayMode [" .. f3_arg1 .. "]!" )
f3_local0 = 0
end
return f3_local0
end
Rank.GetRankMaxXP = function ( f4_arg0, f4_arg1 )
local f4_local0 = nil
if not f4_arg1 or f4_arg1 == CoD.PlayMode.Core or f4_arg1 == CoD.PlayMode.SquadVsSquad then
f4_local0 = tonumber( Engine.TableLookup( RankTable.File, RankTable.Cols.RankId, f4_arg0, RankTable.Cols.MaxXp ) )
assert( f4_local0 ~= nil, "Rank.GetRankMaxXP() : Could not read max XP for rank (MP)" )
elseif f4_arg1 == CoD.PlayMode.Aliens then
f4_local0 = tonumber( Engine.TableLookup( RankTable.AlienFile, RankTable.Cols.RankId, f4_arg0, RankTable.Cols.MaxXp ) )
assert( f4_local0 ~= nil, "Rank.GetRankMaxXP() : Could not read max XP for rank (ALIENS)" )
else
DebugPrint( "[WARNING] Rank.GetRankMaxXP() : Unsupported CodPlayMode [" .. f4_arg1 .. "]!" )
f4_local0 = 0
end
return f4_local0
end
Rank.GetRankXPToNext = function ( f5_arg0, f5_arg1 )
local f5_local0 = nil
if not f5_arg1 or f5_arg1 == CoD.PlayMode.Core or f5_arg1 == CoD.PlayMode.SquadVsSquad then
f5_local0 = tonumber( Engine.TableLookup( RankTable.File, RankTable.Cols.RankId, f5_arg0, RankTable.Cols.XpToNextLevel ) )
elseif f5_arg1 == CoD.PlayMode.Aliens then
f5_local0 = tonumber( Engine.TableLookup( RankTable.AlienFile, RankTable.Cols.RankId, f5_arg0, RankTable.Cols.XpToNextLevel ) )
else
DebugPrint( "[WARNING] Rank.GetRankXPToNext() : Unsupported CodPlayMode [" .. f5_arg1 .. "]!" )
f5_local0 = 0
end
return f5_local0
end
Rank.GetRankIcon = function ( f6_arg0, f6_arg1, f6_arg2 )
local f6_local0 = nil
if not f6_arg2 or f6_arg2 == CoD.PlayMode.Core or f6_arg2 == CoD.PlayMode.SquadVsSquad then
f6_local0 = Engine.TableLookup( RankIconTable.File, RankIconTable.Cols.RankId, f6_arg0, RankIconTable.Cols.Standard + f6_arg1 )
elseif f6_arg2 == CoD.PlayMode.Aliens then
f6_local0 = Engine.TableLookup( RankIconTable.AlienFile, RankIconTable.Cols.RankId, f6_arg0, RankIconTable.Cols.Standard + f6_arg1 )
else
DebugPrint( "[WARNING] Rank.GetRankIcon() : Unsupported CodPlayMode [" .. f6_arg2 .. "]!" )
f6_local0 = ""
end
return f6_local0
end
Rank.GetFullRank = function ( f7_arg0, f7_arg1 )
local f7_local0 = nil
if not f7_arg1 or f7_arg1 == CoD.PlayMode.Core or f7_arg1 == CoD.PlayMode.SquadVsSquad then
f7_local0 = Engine.Localize( "@" .. Engine.TableLookup( RankTable.File, RankTable.Cols.RankId, f7_arg0, RankTable.Cols.FullRankName ) )
elseif f7_arg1 == CoD.PlayMode.Aliens then
f7_local0 = Engine.Localize( "@" .. Engine.TableLookup( RankTable.AlienFile, RankTable.Cols.RankId, f7_arg0, RankTable.Cols.FullRankName ) )
else
DebugPrint( "[WARNING] Rank.GetFullRank() : Unsupported CodPlayMode [" .. f7_arg1 .. "]!" )
f7_local0 = ""
end
return f7_local0
end

View File

@ -0,0 +1,129 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function ExitVirtualKeyboard( f1_arg0, f1_arg1, f1_arg2 )
local f1_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f1_arg0 )
if f1_local0.exiting then
return
end
f1_local0.exiting = true
f1_arg0:dispatchEventToRoot( {
name = "exit_virtual_keyboard",
immediate = true
} )
if Engine.TriggerVirtualKeyboardCallback then
local f1_local1 = Engine.TriggerVirtualKeyboardCallback
local f1_local2 = f1_arg1.controller
local f1_local3 = f1_arg2
local f1_local4
if not f1_arg2 then
f1_local4 = f1_local0.input
if not f1_local4 then
else
f1_local1( f1_local2, f1_local3, f1_local4, f1_local0.verifyString or false )
end
end
f1_local4 = ""
end
end
function input_popup( f2_arg0, f2_arg1 )
local f2_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "virtual_keyboard" )
local f2_local1 = f2_arg1.keyboardType
if not f2_local1 then
f2_local1 = CoD.KeyboardInputTypes.Normal
end
local f2_local2
if f2_local1 == CoD.KeyboardInputTypes.Email then
f2_local2 = 1000
if not f2_local2 then
else
local f2_local3 = f2_local1 == CoD.KeyboardInputTypes.Password
local f2_local4 = f2_arg1.use_auto_align or false
local f2_local5 = LUI.MenuGenerics.generic_selectionList_popup( {}, {
popup_title = f2_arg1.title,
popup_width = f2_local2,
popup_childfeeder = function ()
return {
{
type = "generic_input_field",
id = "not_so_virtual_input",
requireFocusType = FocusType.MouseOver,
properties = {
keyboard_type = f2_local1,
password_field = f2_local3,
use_auto_align = f2_local4,
max_length = f2_local0.maxLength,
help_value = f2_local0.input,
field_edited_func = function ( f4_arg0, f4_arg1 )
local f4_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f4_arg0 )
f4_local0.input = f4_arg1.text or ""
if f4_local0.exiting then
return
else
f4_arg1.controller = f4_local0.exclusiveController
ExitVirtualKeyboard( f4_arg0, f4_arg1, f4_arg1.cancelled )
LUI.FlowManager.RequestLeaveMenu( f4_arg0 )
end
end
,
additional_handlers = {
menu_create = MBh.EmitEvent( {
name = "button_action",
mouse = true
} ),
exit_virtual_keyboard = function ( f5_arg0, f5_arg1 )
f5_arg0:processEvent( {
name = "finish_editing"
} )
end
}
}
},
{
type = "UIGenericButton",
id = "input_ok",
audio = {
button_over = CoD.SFX.SubMenuMouseOver
},
properties = {
style = GenericButtonSettings.Styles.GlassButton,
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
text = Engine.Localize( "MENU_OK" ),
button_action_func = function ( f6_arg0, f6_arg1 )
ExitVirtualKeyboard( f6_arg0, f6_arg1, false )
LUI.FlowManager.RequestLeaveMenu( f6_arg0 )
end
}
}
}
end
} )
f2_local5:registerEventHandler( "popup_back", function ( element, event )
ExitVirtualKeyboard( element, event, true )
end )
f2_local5:dispatchEventToRoot( {
name = "virtual_keyboard_popup_active",
immediate = true
} )
return f2_local5
end
end
f2_local2 = nil
end
function virtual_keyboard( f8_arg0, f8_arg1 )
local f8_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "virtual_keyboard" )
f8_local0.input = f8_arg1.defaultText or ""
f8_local0.maxLength = f8_arg1.maxLength or 12
f8_local0.verifyString = f8_arg1.verifyString or false
return input_popup( f8_arg0, f8_arg1 )
end
LUI.MenuBuilder.registerType( "virtual_keyboard", virtual_keyboard )
LockTable( _M )

View File

@ -0,0 +1,372 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ( f1_arg0, f1_arg1 )
Kinect.CloseWhatCanISayMenu( f1_arg0, f1_arg1 )
end
function TitleFactory( f2_arg0, f2_arg1 )
return {
type = "UIText",
id = "text_whatcanisay_" .. tostring( f2_arg0 ),
properties = {
text = Engine.Localize( f2_arg1 )
},
states = {
default = {
height = CoD.TextSettings.ExtraBigFont.Height,
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Left,
width = 600,
r = 1,
g = 1,
b = 1
}
}
}
end
function BlankFactory( f3_arg0 )
return {
type = "UIText",
id = "text_whatcanisay_" .. tostring( f3_arg0 ),
properties = {
text = ""
},
states = {
default = {
height = 20,
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Left,
width = 600,
r = 1,
g = 1,
b = 1
}
}
}
end
function TextFactory( f4_arg0, f4_arg1, f4_arg2 )
local f4_local0
if f4_arg2 then
f4_local0 = 200
if not f4_local0 then
else
return {
type = "UIText",
id = "text_whatcanisay_" .. tostring( f4_arg0 ),
properties = {
text = Engine.Localize( f4_arg1 )
},
states = {
default = {
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
width = f4_local0
}
}
}
end
end
f4_local0 = 370
end
function BigTextFactory( f5_arg0, f5_arg1 )
return {
type = "UIText",
id = "text_whatcanisay_" .. tostring( f5_arg0 ),
properties = {
text = Engine.Localize( f5_arg1 )
},
states = {
default = {
height = CoD.TextSettings.BigFont.Height,
font = CoD.TextSettings.BigFont.Font,
alignment = LUI.Alignment.Left,
width = 600
}
}
}
end
function DescFactory( f6_arg0, f6_arg1 )
return {
type = "UIText",
id = "text_whatcanisay_" .. tostring( f6_arg0 ),
properties = {
text = Engine.Localize( f6_arg1 )
},
states = {
default = {
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
width = 600,
red = 0.75,
green = 0.75,
blue = 0.75
}
}
}
end
function GrammarFeeder( f7_arg0 )
local f7_local0 = {}
if Engine.InFrontend() then
local f7_local1 = false
if Kinect.menu_under_what_can_i_say then
if string.lower( Kinect.menu_under_what_can_i_say ) == string.lower( "main_lockout" ) then
f7_local1 = true
elseif string.lower( Kinect.menu_under_what_can_i_say ) == string.lower( "boot_brightness" ) then
f7_local1 = true
elseif string.lower( Kinect.menu_under_what_can_i_say ) == string.lower( "boot_screen_margins" ) then
f7_local1 = true
elseif string.lower( Kinect.menu_under_what_can_i_say ) == string.lower( "no_profile_warning_popmenu" ) then
f7_local1 = true
end
end
if f7_local1 == true then
elseif Kinect.IsKinectGuideUp() then
f7_local0[#f7_local0 + 1] = TitleFactory( #f7_local0, "@SPEECH_SAY_GHOSTS_AND_ONE_OF_THE_FOLLOWING" )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = TitleFactory( #f7_local0, "@SPEECH_KINECT_GUIDE_COMMANDS_CAPS" )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_SHORTCUT_1_TO_9", true )
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_SHORTCUT_1_TO_9_COMMAND" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_CANCEL_BACK", true )
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_CANCEL_BACK_COMMAND" )
else
f7_local0[#f7_local0 + 1] = TitleFactory( #f7_local0, "@SPEECH_SAY_GHOSTS_AND_ONE_OF_THE_FOLLOWING" )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = TitleFactory( #f7_local0, "@SPEECH_GENERAL_COMMANDS_CAPS" )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_SHORTCUTS_1", true )
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_SHORTCUTS_COMMAND" )
local f7_local2 = false
if Kinect.menu_under_what_can_i_say then
if string.lower( Kinect.menu_under_what_can_i_say ) == string.lower( "menu_xboxlive_lobby" ) then
f7_local2 = true
elseif string.lower( Kinect.menu_under_what_can_i_say ) == string.lower( "menu_xboxlive_privatelobby" ) then
f7_local2 = true
elseif string.lower( Kinect.menu_under_what_can_i_say ) == string.lower( "menu_xboxlive" ) then
f7_local2 = true
end
end
if f7_local2 == true then
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = TitleFactory( #f7_local0, "@SPEECH_LOBBY_COMMANDS_CAPS" )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
if Kinect.DISABLE_CERTAIN_LOBBY_MUTE_AND_COMPARE_OPERATIONS == true then
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_MUTE_ALL_UNMUTE_ALL", true )
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_MUTE_ALL_UNMUTE_ALL_COMMAND" )
else
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_MUTE_UNMUTE", true )
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_MUTE_UNMUTE_COMMAND" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_MUTE_ALL_UNMUTE_ALL", true )
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_MUTE_ALL_UNMUTE_ALL_COMMAND" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_MUTE_NON_FRIENDS", true )
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_MUTE_NON_FRIENDS_COMMAND" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_MUTE_NON_PARTY", true )
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_MUTE_NON_PARTY_COMMAND" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_COMPARE", true )
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_COMPARE_COMMAND" )
end
end
end
elseif not Engine.IsMultiplayer() then
f7_local0[#f7_local0 + 1] = TitleFactory( #f7_local0, "@SPEECH_GENERAL_COMMANDS_CAPS" )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_GHOST_PAUSE_GHOST_PLAY", true )
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_PAUSE_PLAY_COMMAND" )
local f7_local1 = Engine.GetDvarString( "mapname" )
if f7_local1 == "enemyhq" or f7_local1 == "nml" then
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_ATTACK_1", true )
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_ATTACK_COMMAND" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_CANCEL_1", true )
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_CANCEL_COMMAND" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_BARK_1", true )
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_BARK_COMMAND" )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = TitleFactory( #f7_local0, "@SPEECH_SPECIFIC_COMMMAND_CAPS" )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_LOCATION_COMMAND" )
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_DOOR" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_WINDOW" )
if f7_local1 == "enemyhq" then
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_COUNTER" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_STAIRS" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_STATUE" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_WALKWAY" )
elseif f7_local1 == "nml" then
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_BALCONY" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_BRIDGE" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_BUILDING" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_CAR" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_GARAGE" )
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_TRAILER" )
end
end
end
if #f7_local0 == 0 then
if Engine.InFrontend() then
f7_local0[#f7_local0 + 1] = BigTextFactory( #f7_local0, "@SPEECH_NO_VOICE_COMMANDS_FRONT_END" )
else
f7_local0[#f7_local0 + 1] = BigTextFactory( #f7_local0, "@SPEECH_NO_VOICE_COMMANDS_IN_GAME" )
end
end
return f7_local0
end
function OptionsMainCreate( f8_arg0, f8_arg1 )
f8_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
function what_can_i_say_vlist()
return {
type = "UIGrid",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 120,
right = -120,
top = 110,
bottom = -60
}
},
properties = {
elementsPerRow = 2,
hSpacing = 10,
rowHeight = 33,
hAlign = LUI.Alignment.Left,
vAlign = LUI.Alignment.Top
},
childrenFeeder = GrammarFeeder
}
end
function WhatCanISayHandleSpeechActionBack( f10_arg0, f10_arg1, f10_arg2 )
if Kinect.IsWhatCanISayMenuUp() then
f0_local0( f10_arg0, f10_arg1 )
LUI.Speech.PerformingSpeechAction()
end
end
if Engine.HasSpeechFeature() then
WhatCanISaySpeechGrammarHandlersArray = {
{
action = "back",
confidence = LUI.Speech.defaultConfidence,
handler = WhatCanISayHandleSpeechActionBack,
extradata = nil
},
{
action = "cancel",
confidence = LUI.Speech.defaultConfidence,
handler = WhatCanISayHandleSpeechActionBack,
extradata = nil
}
}
else
WhatCanISaySpeechGrammarHandlersArray = {}
end
function WhatCanISayHandleSpeechAction( f11_arg0, f11_arg1 )
if Engine.HasSpeechFeature() then
LUI.Speech.ProcessActionEvent( f11_arg0, f11_arg1, WhatCanISaySpeechGrammarHandlersArray )
end
end
function what_can_i_say()
return {
type = "UIElement",
id = "what_can_i_say_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = OptionsMainCreate,
speech_action = WhatCanISayHandleSpeechAction
},
children = {
{
type = "UIWorldBlur",
id = "world_blur_id",
states = {
default = {
worldBlur = 5
}
}
},
{
type = "UIImage",
id = "options_background",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0.95,
material = RegisterMaterial( "black" )
}
}
},
{
type = "generic_menu_title",
properties = {
menu_title = Engine.Localize( "@SPEECH_WHATCANISAY_CAPS" )
}
},
{
type = "what_can_i_say_vlist",
id = "what_can_i_say_vlist_id"
},
{
type = "button_helper_text_main",
id = "button_helper_text_id"
},
{
type = "UIBindButton",
id = "back_button",
handlers = {
button_start = f0_local0,
button_select = f0_local0,
button_secondary = f0_local0
}
}
}
}
end
LUI.MenuBuilder.registerDef( "what_can_i_say_vlist", what_can_i_say_vlist )
LUI.MenuBuilder.registerDef( "what_can_i_say", what_can_i_say )
LockTable( _M )

1
lui/default.dec.lua Normal file
View File

@ -0,0 +1 @@

124
lui/eventcatcher.dec.lua Normal file
View File

@ -0,0 +1,124 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
require( "LUI.CoD" )
f0_local0 = hashset( {
"keybind",
"action_slot_pressed",
"game_message",
"hide_host_migration",
"obituary",
"show_host_migration_triggered",
"toggle_pause",
"weapon_change",
"show_hud_menu",
"hide_hud_menu",
"playerstate_client_changed",
"close_rival_info",
"open_rival_info",
"camera_client_changed",
"refresh_options_button",
"update_mlg_prev_next",
"spectate_team_change"
} )
function isDirectDispatchEventType( f1_arg0 )
return f0_local0[f1_arg0]
end
function new()
local f2_local0 = {}
setmetatable( f2_local0, {
__index = _M
} )
f2_local0.direct_dispatch = {}
f2_local0.omnvar_update = {}
f2_local0.dvar_update = {}
return f2_local0
end
function setupRoot( f3_arg0, f3_arg1 )
f3_arg1:registerEventHandler( "omnvar_update", omnvarUpdateDispatcher )
f3_arg1:registerEventHandler( "dvar_update", dvarUpdateDispatcher )
for f3_local3, f3_local4 in pairs( f0_local0 ) do
f3_arg1:registerEventHandler( f3_local3, directDispatcher )
end
end
function registerOmnvarHandler( f4_arg0, f4_arg1, f4_arg2, f4_arg3 )
assert( type( f4_arg1 ) == "userdata" )
assert( type( f4_arg2 ) == "string" )
assert( type( f4_arg3 ) == "function" )
local f4_local0 = f4_arg0.omnvar_update
local f4_local1 = f4_arg0.omnvar_update[f4_arg2]
if not f4_local1 then
f4_local1 = setmetatable( {}, {
__mode = "k"
} )
end
f4_local0[f4_arg2] = f4_local1
f4_arg0.omnvar_update[f4_arg2][f4_arg1] = f4_arg3
end
function omnvarUpdateDispatcher( f5_arg0, f5_arg1 )
local f5_local0 = f5_arg0.eventCatcher.omnvar_update[f5_arg1.omnvar]
if f5_local0 then
for f5_local4, f5_local5 in pairs( f5_local0 ) do
if not f5_local4:isClosed() then
f5_local5( f5_local4, f5_arg1 )
end
end
end
end
function registerDvarHandler( f6_arg0, f6_arg1, f6_arg2, f6_arg3 )
assert( type( f6_arg1 ) == "userdata" )
assert( type( f6_arg2 ) == "string" )
assert( type( f6_arg3 ) == "function" )
if not f6_arg0.dvar_update[f6_arg2] then
assert( Engine.WatchDvar( f6_arg2 ), "failed to watch dvar" )
f6_arg0.dvar_update[f6_arg2] = setmetatable( {}, {
__mode = "k"
} )
end
f6_arg0.dvar_update[f6_arg2][f6_arg1] = f6_arg3
end
function dvarUpdateDispatcher( f7_arg0, f7_arg1 )
local f7_local0 = f7_arg0.eventCatcher.dvar_update[f7_arg1.dvar]
if f7_local0 then
for f7_local4, f7_local5 in pairs( f7_local0 ) do
if not f7_local4:isClosed() then
f7_local5( f7_local4, f7_arg1 )
end
end
end
end
function registerDirectDispatchHandler( f8_arg0, f8_arg1, f8_arg2, f8_arg3 )
assert( type( f8_arg1 ) == "userdata" )
assert( type( f8_arg2 ) == "string" )
assert( type( f8_arg3 ) == "function" )
local f8_local0 = f8_arg0.direct_dispatch
local f8_local1 = f8_arg0.direct_dispatch[f8_arg2]
if not f8_local1 then
f8_local1 = setmetatable( {}, {
__mode = "k"
} )
end
f8_local0[f8_arg2] = f8_local1
f8_arg0.direct_dispatch[f8_arg2][f8_arg1] = f8_arg3
end
function directDispatcher( f9_arg0, f9_arg1 )
local f9_local0 = f9_arg0.eventCatcher.direct_dispatch[f9_arg1.name]
if f9_local0 then
for f9_local4, f9_local5 in pairs( f9_local0 ) do
if not f9_local4:isClosed() then
assert( f9_local4.m_eventHandlers[f9_arg1.name] == f9_local5 )
f9_local5( f9_local4, f9_arg1 )
end
end
end
end
LockTable( _M )

1068
lui/flowmanager.dec.lua Normal file

File diff suppressed because it is too large Load Diff

405
lui/gamepadcontrols.dec.lua Normal file
View File

@ -0,0 +1,405 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function GamepadDisabledFunc( f1_arg0, f1_arg1 )
return not Engine.GetProfileData( "gpadEnabled" )
end
function OptionsWindowRefresh( f2_arg0, f2_arg1 )
if f2_arg1.source_input == "button_action" or f2_arg1.source_input == "key_bound" or f2_arg1.source_input == "button_right" or f2_arg1.source_input == "button_left" then
f2_arg0:processEvent( {
name = "menu_refresh"
} )
f2_arg0:processEvent( {
name = "refresh_content"
} )
end
end
function SinglePlayerDisableFunction( f3_arg0, f3_arg1 )
return not Engine.IsMultiplayer()
end
function OptionsWindowTriggerRefresh( f4_arg0, f4_arg1 )
f4_arg0:dispatchEventToRoot( {
name = "options_window_refresh",
source_input = f4_arg1.name,
immediate = true
} )
end
function OptionFactoryProfileData( f5_arg0, f5_arg1, f5_arg2, f5_arg3, f5_arg4, f5_arg5, f5_arg6 )
local f5_local0 = Engine.GetProfileData( f5_arg0 )
local f5_local1 = 1
for f5_local5, f5_local6 in pairs( f5_arg3 ) do
if f5_local6.value == f5_local0 then
f5_local1 = f5_local5
break
end
end
f5_local2 = function ( f6_arg0, f6_arg1 )
Engine.ExecNow( f5_arg1 )
Engine.ExecNow( "profile_menuDvarsFinish" )
OptionsWindowTriggerRefresh( f6_arg0, f6_arg1 )
if f5_arg6 and type( f5_arg6 ) == "function" then
f5_arg6( f6_arg0 )
end
end
f5_local3 = {
type = "UIGenericButton",
id = "option_" .. f5_arg0,
disabledFunc = f5_arg4 or function ()
return false
end
}
f5_local4 = {
variant = GenericButtonSettings.Variants.Select
}
if f5_arg5 then
local f5_local7 = f5_arg2
end
f5_local4.button_text = f5_local7 or Engine.Localize( f5_arg2 )
f5_local4.button_display_func = function ( f8_arg0, f8_arg1 )
return Engine.Localize( f5_arg3[f5_local1].text )
end
f5_local4.button_left_func = function ( f9_arg0, f9_arg1 )
f5_local1 = 1 + (#f5_arg3 + f5_local1 - 1 - 1) % #f5_arg3
f5_local2( f9_arg0, f9_arg1 )
end
f5_local4.button_right_func = function ( f10_arg0, f10_arg1 )
f5_local1 = 1 + (f5_local1 - 1 + 1) % #f5_arg3
f5_local2( f10_arg0, f10_arg1 )
end
f5_local3.properties = f5_local4
f5_local3.handlers = {
element_refresh = MBh.EmitEvent( "content_refresh" )
}
return f5_local3
end
function SliderOptionFactory( f11_arg0, f11_arg1, f11_arg2, f11_arg3, f11_arg4, f11_arg5 )
local f11_local0 = function ( f12_arg0, f12_arg1, f12_arg2, f12_arg3, f12_arg4 )
Engine.SetDvarFloat( f11_arg0, math.min( f12_arg1, math.max( f12_arg0, Engine.GetDvarFloat( f11_arg0 ) + f12_arg2 ) ) )
Engine.ExecNow( "profile_menuDvarsFinish" )
OptionsWindowTriggerRefresh( f12_arg3, f12_arg4 )
end
return {
type = "UIGenericButton",
id = "options_" .. f11_arg0,
disabledFunc = f11_arg5 or function ()
return false
end
,
properties = {
button_text = Engine.Localize( f11_arg1 ),
variant = GenericButtonSettings.Variants.Slider,
button_display_func = function ( f14_arg0, f14_arg1 )
return (Engine.GetDvarFloat( f11_arg0 ) - f11_arg2) / (f11_arg3 - f11_arg2)
end
,
button_left_func = function ( f15_arg0, f15_arg1 )
f11_local0( f11_arg2, f11_arg3, -f11_arg4, f15_arg0, f15_arg1 )
end
,
button_right_func = function ( f16_arg0, f16_arg1 )
f11_local0( f11_arg2, f11_arg3, f11_arg4, f16_arg0, f16_arg1 )
end
},
handlers = {
element_refresh = MBh.EmitEvent( "content_refresh" )
}
}
end
function GetButtonsLayoutName()
local f17_local0 = Engine.GetProfileData( "gpadButtonsConfig" )
if f17_local0 == "buttons_default" then
return Engine.Localize( "@MENU_DEFAULT" )
elseif f17_local0 == "buttons_tactical" then
return Engine.Localize( "@MENU_TACTICAL" )
elseif f17_local0 == "buttons_lefty" then
return Engine.Localize( "@MENU_LEFTY" )
elseif f17_local0 == "buttons_nomad" then
return Engine.Localize( "@MENU_NOMAD" )
elseif f17_local0 == "buttons_nomad_tactical" then
return Engine.Localize( "@MENU_NOMAD_TACTICAL" )
elseif f17_local0 == "buttons_default_alt" then
return Engine.Localize( "@MENU_DEFAULT_ALT" )
elseif f17_local0 == "buttons_tactical_alt" then
return Engine.Localize( "@MENU_TACTICAL_ALT" )
elseif f17_local0 == "buttons_lefty_alt" then
return Engine.Localize( "@MENU_LEFTY_ALT" )
elseif f17_local0 == "buttons_nomad_alt" then
return Engine.Localize( "@MENU_NOMAD_ALT" )
else
return Engine.Localize( "@MENU_NOMAD_TACTICAL_ALT" )
end
end
function ButtonsLayoutAction( f18_arg0, f18_arg1 )
LUI.FlowManager.RequestAddMenu( f18_arg0, "buttons", true, f18_arg1.controller, false )
end
function GetSticksLayoutName()
local f19_local0 = Engine.GetProfileData( "gpadSticksConfig" )
if f19_local0 == "thumbstick_default" then
return Engine.Localize( "@MENU_DEFAULT" )
elseif f19_local0 == "thumbstick_southpaw" then
return Engine.Localize( "@MENU_SOUTHPAW" )
elseif f19_local0 == "thumbstick_legacy" then
return Engine.Localize( "@MENU_LEGACY" )
elseif f19_local0 == "thumbstick_southpaw_ns" then
return Engine.Localize( "@MENU_SOUTHPAW_NS" )
elseif f19_local0 == "thumbstick_legacysouthpaw_ns" then
return Engine.Localize( "@MENU_LEGACY_SOUTHPAW_NS" )
else
return Engine.Localize( "@MENU_LEGACY_SOUTHPAW" )
end
end
function SticksLayoutAction( f20_arg0, f20_arg1 )
LUI.FlowManager.RequestAddMenu( f20_arg0, "thumbstick", true, f20_arg1.controller, false )
end
function GetSensitivityText()
local f21_local0 = Engine.GetDvarFloat( "profileMenuOption_sensitivity" )
if f21_local0 == 1 then
return Engine.Localize( "@MENU_LOW" ) .. " " .. f21_local0
elseif f21_local0 == 3 then
return Engine.Localize( "@MENU_MEDIUM" ) .. " " .. f21_local0
elseif f21_local0 == 7 then
return Engine.Localize( "@MENU_HIGH" ) .. " " .. f21_local0
elseif f21_local0 == 13 then
return Engine.Localize( "@MENU_VERY_HIGH" ) .. " " .. f21_local0
elseif f21_local0 == 20 then
return Engine.Localize( "@MENU_INSANE" ) .. " " .. f21_local0
else
return f21_local0 .. ""
end
end
function SensitivityChange( f22_arg0, f22_arg1 )
Engine.SetDvarFloat( "profileMenuOption_sensitivity", math.min( 20, math.max( 1, Engine.GetDvarFloat( "profileMenuOption_sensitivity" ) + f22_arg1 ) ) )
Engine.MenuDvarsFinish( f22_arg0 )
end
function OnToggleGPadEnabled( f23_arg0 )
LUI.FlowManager.tryAddMouseCursor( Engine.GetLuiRoot() )
Engine.Exec( "updategamerprofile" )
f23_arg0:dispatchEventToRoot( {
name = "refresh_button_helper",
dispatchChildren = true
} )
end
function OptionsFeeder( f24_arg0 )
local f24_local0 = {}
Engine.ExecNow( "profile_menuDvarsSetup" )
f24_local0[#f24_local0 + 1] = OptionFactoryProfileData( "gpadEnabled", "profile_toggleEnableGamepad", "LUA_MENU_GAMEPAD", {
{
text = "@LUA_MENU_DISABLED",
value = false
},
{
text = "@LUA_MENU_ENABLED",
value = true
}
}, nil, nil, OnToggleGPadEnabled )
f24_local0[#f24_local0 + 1] = {
type = "UIGenericButton",
id = "stick_layout_button_id",
disabledFunc = GamepadDisabledFunc,
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( "MENU_THUMBSTICK_LAYOUT" ),
button_display_func = GetSticksLayoutName,
button_action_func = SticksLayoutAction
}
}
f24_local0[#f24_local0 + 1] = {
type = "UIGenericButton",
id = "buttons_layout_button_id",
disabledFunc = GamepadDisabledFunc,
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( "MENU_BUTTON_LAYOUT" ),
button_display_func = GetButtonsLayoutName,
button_action_func = ButtonsLayoutAction
}
}
f24_local0[#f24_local0 + 1] = OptionFactoryProfileData( "invertedPitch", "profile_toggleInvertedPitch", "MENU_LOOK_INVERSION", {
{
text = "@LUA_MENU_DISABLED",
value = false
},
{
text = "@LUA_MENU_ENABLED",
value = true
}
}, GamepadDisabledFunc )
f24_local0[#f24_local0 + 1] = {
type = "UIGenericButton",
id = "sensitivity_button_id",
disabledFunc = GamepadDisabledFunc,
properties = {
variant = GenericButtonSettings.Variants.Select,
button_text = Engine.Localize( "MENU_LOOK_SENSITIVITY" ),
button_display_func = GetSensitivityText,
button_left_func = function ( f25_arg0, f25_arg1 )
return SensitivityChange( f24_arg0.exclusiveController, -1 )
end,
button_right_func = function ( f26_arg0, f26_arg1 )
return SensitivityChange( f24_arg0.exclusiveController, 1 )
end
}
}
f24_local0[#f24_local0 + 1] = OptionFactoryProfileData( "rumble", "profile_toggleRumble", "MENU_CONTROLLER_VIBRATION", {
{
text = "@LUA_MENU_DISABLED",
value = false
},
{
text = "@LUA_MENU_ENABLED",
value = true
}
}, GamepadDisabledFunc )
if SinglePlayerDisableFunction() then
f24_local0[#f24_local0 + 1] = OptionFactoryProfileData( "autoAim", "profile_toggleAutoAim", "MENU_AIM_ASSIST", {
{
text = "@LUA_MENU_DISABLED",
value = false
},
{
text = "@LUA_MENU_ENABLED",
value = true
}
}, GamepadDisabledFunc )
end
f24_local0[#f24_local0 + 1] = OptionFactoryProfileData( "leanEnabled", "profile_toggleLean", "LUA_MENU_LEAN_TOGGLE", {
{
text = "@LUA_MENU_ENABLED",
value = true
},
{
text = "@LUA_MENU_DISABLED",
value = false
}
}, GamepadDisabledFunc )
if Engine.IsDevelopmentBuild() then
f24_local0[#f24_local0 + 1] = OptionFactoryProfileData( "useDevKeyboard", "profile_toggleDevKeyboard", "DEBUG_KEYBOARD", {
{
text = "@LUA_MENU_DISABLED",
value = false
},
{
text = "@LUA_MENU_ENABLED",
value = true
}
}, GamepadDisabledFunc, true )
end
return f24_local0
end
function OptionsMainCreate( f27_arg0, f27_arg1 )
f27_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
function OptionsMainClose( f28_arg0, f28_arg1 )
Engine.Exec( "updategamerprofile" )
end
function gamepad_controls_vlist()
return {
type = "UIStencil",
children = {
{
type = "UIVerticalList",
childrenFeeder = OptionsFeeder,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = -25,
top = 0,
bottom = 0
}
}
}
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right_wide,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
},
handlers = {}
}
end
function gamepad_controls()
return {
type = "UIElement",
id = "gamepad_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 = OptionsMainClose,
options_window_refresh = OptionsWindowRefresh
},
children = {
{
type = "generic_menu_title",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_GAMEPAD" )
}
},
{
type = "gamepad_controls_vlist",
id = "gamepad_controls_vlist_id"
},
{
type = "button_helper_text_main",
id = "button_helper_text_id"
},
{
type = "UIBindButton",
id = "back_button",
handlers = {
button_secondary = MBh.LeaveMenu()
}
}
}
}
end
LUI.MenuBuilder.registerDef( "gamepad_controls_vlist", gamepad_controls_vlist )
LUI.MenuBuilder.registerDef( "gamepad_controls", gamepad_controls )
LockTable( _M )

288
lui/gamex.dec.lua Normal file
View File

@ -0,0 +1,288 @@
if not GameX then
GameX = {}
end
GameX.GetPlayerOpposingTeam = function ( f1_arg0 )
local f1_local0 = f1_arg0
if not f1_local0 then
f1_local0 = Game.GetPlayerTeam()
if GameX.IsSpectatingNotOnTeam( f1_local0 ) then
f1_local0 = spectatorFakeTeam
end
end
local f1_local1 = otherTeamLookup[f1_local0]
if not f1_local1 then
f1_local1 = 0
end
return f1_local1
end
GameX.gameModeIsFFA = function ( f2_arg0 )
local f2_local0 = f2_arg0 or Engine.GetDvarString( "ui_gametype" )
if f2_local0 == "dm" or f2_local0 == "sotf_ffa" or f2_local0 == "gun" or f2_local0 == "mugger" or f2_local0 == "adrn" or f2_local0 == "assn" or f2_local0 == "fo" or f2_local0 == "sna" then
return true
elseif f2_local0 == "cranked" then
return Engine.GetDvarInt( "scr_cranked_teambased" ) == 0
else
return false
end
end
GameX.GetTeamName = function ( f3_arg0 )
local f3_local0 = {
"free",
"axis",
"allies"
}
return f3_local0[f3_arg0 + 1]
end
GameX.GetFactionName = function ( f4_arg0 )
local f4_local0 = {
"free",
"federation",
"ghosts"
}
return f4_local0[f4_arg0 + 1]
end
GameX.IsSpectatingNotOnTeam = function ( f5_arg0 )
local f5_local0
if not (Game.IsSpectating() or Game.GetOmnvar( "ui_session_state" ) == "spectator") or (f5_arg0 or Game.GetPlayerTeam()) ~= Teams.spectator then
f5_local0 = false
else
f5_local0 = true
end
return f5_local0
end
GameX.IsHardcoreMode = function ()
return Engine.GetDvarBool( "g_hardcore" )
end
GameX.IsRankedMatch = function ()
return Engine.GetDvarBool( "onlinegame" ) and not Engine.GetDvarBool( "xblive_privatematch" )
end
GameX.IsOnlineMatch = function ()
local f8_local0 = Engine.GetDvarBool( "onlinegame" )
if not f8_local0 then
f8_local0 = Engine.GetDvarBool( "xblive_privatematch" )
end
return f8_local0
end
GameX.GetGameMode = function ()
return Engine.GetDvarString( "ui_gametype" )
end
GameX.GetNumPlayerSlotsForFinalScoreboard = function ( f10_arg0, f10_arg1 )
local f10_local0 = GameX.IsRankedMatch() and Engine.GetDvarInt( "party_maxplayers" ) or 0
local f10_local1 = Game.GetNumPlayersOnTeam( f10_arg0 )
if GameX.gameModeIsFFA( f10_arg1 ) then
assert( f10_arg0 == Teams.free )
return math.max( 1, math.max( f10_local1, f10_local0 ) )
elseif f10_arg1 == "infect" then
if f10_arg0 == Teams.allies then
return math.max( 0, f10_local1 )
else
local f10_local2 = Game.GetNumPlayersOnTeam( GameX.GetPlayerOpposingTeam( f10_arg0 ) )
local f10_local3 = f10_local0 - f10_local2
if f10_local1 + f10_local2 == 0 then
return 1
else
return math.max( 0, math.max( f10_local1, f10_local3 ) )
end
end
elseif f10_arg1 == "horde" then
if f10_arg0 == Teams.allies then
return math.max( 4, math.max( f10_local1, f10_local0 ) )
else
return math.max( 0, f10_local1 )
end
end
local f10_local2 = assert
local f10_local3
if f10_arg0 ~= Teams.axis and f10_arg0 ~= Teams.allies then
f10_local3 = false
else
f10_local3 = true
end
f10_local2( f10_local3 )
return math.max( 1, math.max( f10_local1, f10_local0 / 2 ) )
end
GameX.GetPlayerScoreInfoAtRankForGameMode = function ( f11_arg0, f11_arg1, f11_arg2, f11_arg3 )
local f11_local0 = Game.GetPlayerScoreInfoAtRank( f11_arg0, f11_arg1 )
if not f11_local0 then
return nil
end
local f11_local1 = 99
local f11_local2 = 99
if f11_arg2 == "horde" then
f11_local1 = 999
f11_local2 = 999
end
f11_local0.score = math.min( 9999, f11_local0.score )
f11_local0.kills = math.min( f11_local1, f11_local0.kills )
f11_local0.deaths = math.min( 99, f11_local0.deaths )
f11_local0.assists = math.min( f11_local2, f11_local0.assists )
f11_local0.prestige = f11_local0.prestige or 0
if not (f11_arg2 ~= "dm" and (f11_arg2 ~= "cranked" or not GameX.gameModeIsFFA( f11_arg2 ))) or f11_arg2 == "sotf_ffa" then
local f11_local3 = Game.GetOmnvar( "ui_game_type_kill_value" )
if not f11_local3 then
f11_local0.extrascore0 = 0
else
f11_local0.extrascore0 = math.min( 9999, f11_local0.score * f11_local3 )
end
elseif f11_arg2 == "horde" then
f11_local0.extrascore0 = math.min( 999, f11_local0.extrascore0 )
elseif f11_arg2 == "infect" then
f11_local0.time = CoD.FormatInfectedTime( f11_local0.extrascore0, f11_arg3 )
else
f11_local0.extrascore0 = math.min( 99, f11_local0.extrascore0 )
end
return f11_local0
end
GameX.GetScreenDims = function ()
local f12_local0 = {}
local f12_local1 = Engine.GetLuiRoot()
f12_local0 = f12_local1:getCurrentGlobalRect()
return f12_local0[3], f12_local0[4]
end
GameX.GetScreenWidth = function ()
local f13_local0 = {}
local f13_local1 = Engine.GetLuiRoot()
f13_local0 = f13_local1:getCurrentGlobalRect()
return f13_local0[3]
end
GameX.GetScreenHeight = function ()
local f14_local0 = {}
local f14_local1 = Engine.GetLuiRoot()
f14_local0 = f14_local1:getCurrentGlobalRect()
return f14_local0[4]
end
GameX.GetSafeZoneSize = function ( f15_arg0, f15_arg1 )
local f15_local0 = f15_arg0 or SliderBounds.HorzMargin.Min
local f15_local1 = f15_arg1 or SliderBounds.VertMargin.Min
local f15_local2, f15_local3 = GameX.GetScreenDims()
local f15_local4 = f15_local2 * (1 - f15_local0) / 2
local f15_local5 = f15_local3 * (1 - f15_local1) / 2
local f15_local6 = Engine.SplitscreenPlayerCount()
assert( f15_local6 <= MaxLocalClients )
local f15_local7 = assert
local f15_local8
if f15_local6 ~= 1 and f15_local6 ~= 2 then
f15_local8 = false
else
f15_local8 = true
end
f15_local7( f15_local8 )
if f15_local6 == 2 then
f15_local5 = f15_local5 * 2
f15_local7 = Engine.GetCurrentLocalClient()
assert( f15_local7 and f15_local7 < MaxLocalClients )
if f15_local7 == 0 then
return f15_local4, f15_local5, -f15_local4, 0
else
return f15_local4, 0, -f15_local4, -f15_local5
end
else
return f15_local4, f15_local5, -f15_local4, -f15_local5
end
end
GameX.GetAdjustedSafeZoneSize = function ()
return GameX.GetSafeZoneSize( Engine.GetDvarFloat( "safeArea_adjusted_horizontal" ), Engine.GetDvarFloat( "safeArea_adjusted_vertical" ) )
end
GameX.IsSplitscreen = function ()
local f17_local0 = Engine.SplitscreenPlayerCount()
local f17_local1 = assert
local f17_local2
if f17_local0 and f17_local0 > MaxLocalClients then
f17_local2 = false
else
f17_local2 = true
end
f17_local1( f17_local2 )
return f17_local0 > 1
end
OptionState = {
Locked = false
}
GameX.IsOptionStateLocked = function ()
return OptionState.Locked
end
GameX.SetOptionState = function ( f19_arg0 )
OptionState.Locked = f19_arg0
end
GameX.GetTeamNameOverride = function ( f20_arg0 )
if not MLG.IsMLGSpectator() then
return nil
elseif MatchRules.IsUsingMatchRulesData() then
local f20_local0 = nil
if f20_arg0 == Teams.allies then
f20_local0 = "ghostsTeamName"
elseif f20_arg0 == Teams.axis then
f20_local0 = "fedTeamName"
end
local f20_local1 = MatchRules.GetData( "commonOption", f20_local0 )
if f20_local1 and f20_local1 ~= "" then
return f20_local1
end
end
return nil
end
GameX.GetLocalizedTeamName = function ( f21_arg0 )
if f21_arg0 ~= Teams.allies and f21_arg0 ~= Teams.axis then
return nil
else
local f21_local0 = GameX.GetTeamNameOverride( f21_arg0 )
if f21_local0 and f21_local0 ~= "" then
return f21_local0
elseif f21_arg0 == Teams.allies then
return Engine.Localize( "LUA_MENU_ALLIES_CAPS" )
elseif f21_arg0 == Teams.axis then
return Engine.Localize( "LUA_MENU_AXIS_CAPS" )
else
end
end
end
GameX.GetLocalizedTeamNameMixedCase = function ( f22_arg0 )
if f22_arg0 ~= Teams.allies and f22_arg0 ~= Teams.axis then
return nil
else
local f22_local0 = GameX.GetTeamNameOverride( f22_arg0 )
if f22_local0 and f22_local0 ~= "" then
return f22_local0
elseif f22_arg0 == Teams.allies then
return Engine.Localize( "MP_GHOSTS_NAME" )
elseif f22_arg0 == Teams.axis then
return Engine.Localize( "MP_FEDERATION_NAME" )
else
end
end
end
GameX.UsesFakeLoadout = function ()
local f23_local0 = GameX.GetGameMode()
local f23_local1
if f23_local0 ~= "sotf" and f23_local0 ~= "sotf_ffa" and f23_local0 ~= "infect" and f23_local0 ~= "gun" and f23_local0 ~= "horde" then
f23_local1 = false
else
f23_local1 = true
end
return f23_local1
end

215
lui/hudmanager.dec.lua Normal file
View File

@ -0,0 +1,215 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
require( "LUI.CoD" )
if Engine.HasSpeechFeature() then
require( "LUI.Speech" )
end
f0_local0 = nil
function new()
local f1_local0 = {}
setmetatable( f1_local0, {
__index = _M
} )
return f1_local0
end
function setupRoot( f2_arg0, f2_arg1 )
f2_arg1:registerEventHandler( "init_hud", hudRootEventHandler( initHud ) )
f2_arg1:registerEventHandler( "close_hud", closeHudHandler )
f2_arg1:registerEventHandler( "intermission_began", hudRootEventHandler( beginIntermission ) )
f2_arg1:registerEventHandler( "post_game_begin", hudRootEventHandler( openRoundEndScreen ) )
f2_arg1:registerEventHandler( "round_end_show", hudRootEventHandler( openRoundEndScreen ) )
f2_arg1:registerEventHandler( "show_host_migration", showHostMigrationHandler )
end
function registerHud( f3_arg0 )
f0_local0 = f3_arg0
end
function initHud( f4_arg0, f4_arg1, f4_arg2 )
if not f0_local0 then
return
elseif not f4_arg0.hudContainer then
f4_arg0.hudContainer = LUI.UIElement.new( {
left = 0,
right = 0,
top = 0,
bottom = 0,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true
} )
f4_arg0.hudContainer.id = "hudContainer"
local f4_local0 = function ()
end
f4_arg0.hudContainer:registerEventHandler( "mousemove", f4_local0 )
f4_arg0.hudContainer:registerEventHandler( "mousedown", f4_local0 )
f4_arg0.hudContainer:registerEventHandler( "mouseup", f4_local0 )
f4_arg0.hudContainer:registerEventHandler( "gamepad_button", f4_local0 )
f4_arg0.hudContainer:registerEventHandler( "gamepad_sticks", f4_local0 )
f4_arg0.hudContainer:registerEventHandler( "keybind", f4_local0 )
f4_arg0.hudContainer:setPriority( LUI.UIRoot.childPriorities.hudContainer )
f4_arg2:addElement( f4_arg0.hudContainer )
if not f4_arg2.m_hudElemLayer then
local f4_local1 = LUI.UIElement.new( {
left = 0,
right = 0,
top = 0,
bottom = 0,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true
} )
f4_local1:setHudElemLayer()
f4_local1:setPriority( LUI.UIRoot.childPriorities.hudElems )
f4_arg2:addElement( f4_local1 )
f4_arg2.m_hudElemLayer = f4_local1
end
end
if not GameX.GetScreenWidth() then
LUI.UIRoot.ProcessEvent( f4_arg2, {
name = "init_hud"
} )
return
end
if Engine.IsMultiplayer() and not Engine.HasSnapshot() then
LUI.UIRoot.ProcessEvent( f4_arg2, {
name = "init_hud"
} )
return
elseif not f4_arg0.hud then
run_gc()
profile.beginuserevent( "hud_create" )
local f4_local1 = LUI.MenuBuilder.buildMenu( f0_local0 )
profile.enduserevent( "hud_create" )
run_gc()
f4_arg0.hud = f4_local1
f4_arg0.hudContainer.hud = f4_local1
f4_arg0.hudContainer:addElement( f4_local1 )
f4_local1:processEvent( {
name = "menu_create",
dispatchChildren = true
} )
if Engine.HasSpeechFeature() then
Kinect.EnableGlobalGrammars()
end
collectgarbage( "collect" )
end
local f4_local1 = Engine.IsMultiplayer()
if f4_local1 then
f4_local1 = MLG.IsMLGSpectator()
end
if f4_local1 then
if not f4_arg0.MLGHud then
f4_arg0.MLGHud = LUI.mp_hud.MLGHud.MLGHud( f4_arg0.hudContainer )
f4_arg0.MLGHud:setPriority( LUI.UIRoot.childPriorities.MLGHud )
f4_arg2:addElement( f4_arg0.MLGHud )
f4_arg0.MLGHud:processEvent( {
name = "menu_create",
dispatchChildren = true
} )
f4_arg0.hudContainer:registerEventHandler( "gamepad_button", LUI.UIElement.GamepadButton )
end
MLG.SetMLGActiveMenu()
f4_arg0.MLGHud:processEvent( {
name = "init_hud",
dispatchChildren = true
} )
end
end
function closeHud( f6_arg0, f6_arg1, f6_arg2 )
if f6_arg0.hud then
f6_arg0.hud:processEvent( {
name = "menu_close",
dispatchChildren = true
} )
f6_arg0.hud:close()
f6_arg0.hud = nil
if f6_arg0.hudContainer then
f6_arg0.hudContainer.hud = nil
end
end
if f6_arg0.MLGHud then
f6_arg0.MLGHud:processEvent( {
name = "menu_close",
dispatchChildren = true
} )
f6_arg0.MLGHud:close()
f6_arg0.MLGHud = nil
end
end
function closeRoundEndScreen( f7_arg0, f7_arg1, f7_arg2 )
if f7_arg0.roundEndScreen then
f7_arg0.roundEndScreen:processEvent( {
name = "menu_close"
} )
f7_arg0.roundEndScreen:close()
f7_arg0.roundEndScreen = nil
end
end
function endIntermission( f8_arg0, f8_arg1, f8_arg2 )
if f8_arg0.finalScoresScreen then
f8_arg0.finalScoresScreen:processEvent( {
name = "menu_close"
} )
f8_arg0.finalScoresScreen:close()
f8_arg0.finalScoresScreen = nil
end
end
function beginIntermission( f9_arg0, f9_arg1, f9_arg2 )
f9_arg0:closeHud( f9_arg1, f9_arg2 )
f9_arg0:closeRoundEndScreen( f9_arg1, f9_arg2 )
if Engine.GetDvarBool( "squad_match" ) then
Engine.SetDvarBool( "squad_find_match", true )
Engine.SetDvarBool( "squad_send_results", true )
Squad.PostMatch( Engine.GetClientMatchData( "alliesScore" ), Engine.GetClientMatchData( "axisScore" ), Engine.GetClientMatchData( "alliesKills" ), Engine.GetClientMatchData( "alliesDeaths" ), false )
end
if not f9_arg0.finalScoresScreen then
f9_arg0.finalScoresScreen = LUI.MenuBuilder.BuildAddChild( f9_arg2, {
type = "scoreboard"
} )
f9_arg0.finalScoresScreen:setPriority( LUI.UIRoot.childPriorities.finalScoresScreen )
end
end
function openRoundEndScreen( f10_arg0, f10_arg1, f10_arg2 )
if not f10_arg0.roundEndScreen then
f10_arg0.roundEndScreen = LUI.MenuBuilder.BuildAddChild( f10_arg2, {
type = "roundEndHudDef"
} )
f10_arg0.roundEndScreen:setPriority( LUI.UIRoot.childPriorities.roundEndHud )
end
end
function hudRootEventHandler( f11_arg0 )
return function ( f12_arg0, f12_arg1 )
f11_arg0( f12_arg0.hudManager, f12_arg1, f12_arg0 )
end
end
function closeHudHandler( f13_arg0, f13_arg1 )
local f13_local0 = f13_arg0.hudManager
if f13_local0 then
f13_local0:closeHud( f13_arg1, f13_arg0 )
f13_local0:endIntermission( f13_arg1, f13_arg0 )
end
end
function showHostMigrationHandler( f14_arg0, f14_arg1 )
LUI.FlowManager.RequestAddMenu( nil, "host_migration_main" )
f14_arg0:dispatchEventToRoot( {
name = "show_host_migration_triggered"
} )
end
LockTable( _M )

300
lui/lookcontrols.dec.lua Normal file
View File

@ -0,0 +1,300 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function SinglePlayerDisableFunction( f1_arg0, f1_arg1 )
return not Engine.IsMultiplayer()
end
function GetDisplay( f2_arg0 )
return Engine.GetBinding( f2_arg0 )
end
function bindKey( f3_arg0 )
Engine.BindKey( f3_arg0 )
end
function OptionsWindowRefresh( f4_arg0, f4_arg1 )
if f4_arg1.source_input == "button_action" or f4_arg1.source_input == "key_bound" then
f4_arg0:processEvent( {
name = "menu_refresh"
} )
f4_arg0:processEvent( {
name = "refresh_content"
} )
end
end
function OptionsWindowTriggerRefresh( f5_arg0, f5_arg1 )
f5_arg0:dispatchEventToRoot( {
name = "options_window_refresh",
source_input = f5_arg1.name,
immediate = true
} )
end
function ControlBindFactory( f6_arg0, f6_arg1 )
return {
type = "UIGenericButton",
id = "bind_" .. f6_arg1,
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( f6_arg0 ),
button_display_func = function ( f7_arg0, f7_arg1 )
return GetDisplay( f6_arg1 )
end
,
button_action_func = function ( f8_arg0, f8_arg1 )
Engine.BindKey( f6_arg1 )
OptionsWindowTriggerRefresh( f8_arg0, f8_arg1 )
end
},
handlers = {
element_refresh = MBh.EmitEvent( "content_refresh" ),
key_bound = OptionsWindowTriggerRefresh
}
}
end
function OptionFactory( f9_arg0, f9_arg1, f9_arg2 )
local f9_local0 = nil
local f9_local1 = 1
local f9_local2 = Engine.GetDvarType( f9_arg0 )
if f9_local2 == DvarTypeTable.DvarString 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_local6, f9_local7 in pairs( f9_arg2 ) do
if f9_local7.value == f9_local0 then
f9_local1 = f9_local6
break
end
end
f9_local3 = function ( f10_arg0, f10_arg1 )
if f9_arg0 == "ui_mousePitch" then
if Engine.GetDvarBool( f9_arg0 ) then
Engine.SetDvarFloat( "m_pitch", MousePitchTable.PitchFloat )
else
Engine.SetDvarFloat( "m_pitch", -MousePitchTable.PitchFloat )
end
end
if f9_local2 == DvarTypeTable.DvarString 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
end
return {
type = "UIGenericButton",
id = "option_" .. f9_arg0,
properties = {
variant = GenericButtonSettings.Variants.Select,
button_text = Engine.Localize( f9_arg1 ),
button_display_func = function ( f11_arg0, f11_arg1 )
return Engine.Localize( f9_arg2[f9_local1].text )
end
,
button_left_func = function ( f12_arg0, f12_arg1 )
f9_local1 = 1 + (#f9_arg2 + f9_local1 - 1 - 1) % #f9_arg2
f9_local3( f12_arg0, f12_arg1 )
end
,
button_right_func = function ( f13_arg0, f13_arg1 )
f9_local1 = 1 + (f9_local1 - 1 + 1) % #f9_arg2
f9_local3( f13_arg0, f13_arg1 )
end
}
}
end
function SliderOptionFactory( f14_arg0, f14_arg1, f14_arg2, f14_arg3, f14_arg4, f14_arg5, f14_arg6 )
local f14_local0 = function ( f15_arg0, f15_arg1, f15_arg2 )
Engine.SetDvarFloat( f14_arg0, math.min( f15_arg1, math.max( f15_arg0, Engine.GetDvarFloat( f14_arg0 ) + f15_arg2 ) ) )
Engine.ExecNow( "profile_menuDvarsFinish" )
end
return {
type = "UIGenericButton",
id = "options_" .. f14_arg0,
properties = {
button_text = Engine.Localize( f14_arg1 ),
variant = GenericButtonSettings.Variants.Slider,
button_display_func = function ( f16_arg0, f16_arg1 )
return (Engine.GetDvarFloat( f14_arg0 ) - f14_arg2) / (f14_arg3 - f14_arg2)
end
,
button_left_func = function ( f17_arg0, f17_arg1 )
f14_local0( f14_arg2, f14_arg3, -f14_arg4 )
end
,
button_right_func = function ( f18_arg0, f18_arg1 )
f14_local0( f14_arg2, f14_arg3, f14_arg4 )
end
,
button_over_func = MBh.EmitEventToRoot( "brightness_over" ),
button_up_func = MBh.EmitEventToRoot( "brightness_up" )
}
}
end
function OptionsFeeder( f19_arg0 )
local f19_local0 = {}
local f19_local1 = {}
Engine.ExecNow( "profile_menuDvarsSetup" )
f19_local0[#f19_local0 + 1] = SliderOptionFactory( "sensitivity", "@MENU_MOUSE_SENSITIVITY", SliderBounds.MouseSensitivity.Min, SliderBounds.MouseSensitivity.Max, SliderBounds.MouseSensitivity.Step )
if SinglePlayerDisableFunction() then
f19_local1 = {
{
text = "@LUA_MENU_YES",
value = true
},
{
text = "@LUA_MENU_NO",
value = false
}
}
else
f19_local1 = {
{
text = "@LUA_MENU_YES",
value = "1"
},
{
text = "@LUA_MENU_NO",
value = "0"
}
}
end
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_mousePitch", "@MENU_INVERT_MOUSE", f19_local1 )
f19_local0[#f19_local0 + 1] = OptionFactory( "m_filter", "@MENU_SMOOTH_MOUSE", {
{
text = "@LUA_MENU_YES",
value = true
},
{
text = "@LUA_MENU_NO",
value = false
}
} )
f19_local0[#f19_local0 + 1] = OptionFactory( "cl_freelook", "@MENU_FREE_LOOK", {
{
text = "@LUA_MENU_YES",
value = true
},
{
text = "@LUA_MENU_NO",
value = false
}
} )
f19_local0[#f19_local0 + 1] = ControlBindFactory( "@MENU_LOOK_UP", "+lookup" )
f19_local0[#f19_local0 + 1] = ControlBindFactory( "@MENU_LOOK_DOWN", "+lookdown" )
f19_local0[#f19_local0 + 1] = ControlBindFactory( "@MENU_HOLD_MOUSE_LOOK", "+mlook" )
f19_local0[#f19_local0 + 1] = ControlBindFactory( "@MENU_CENTER_VIEW", "centerview" )
return f19_local0
end
function OptionsMainCreate( f20_arg0, f20_arg1 )
f20_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
function OptionsMainClose( f21_arg0, f21_arg1 )
Engine.ExecNow( "profile_menuDvarsFinish" )
Engine.Exec( "updategamerprofile" )
end
function look_controls_vlist()
return {
type = "UIStencil",
children = {
{
type = "UIVerticalList",
childrenFeeder = OptionsFeeder,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = -25,
top = 0,
bottom = 0
}
}
}
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right_wide,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
},
handlers = {
options_window_refresh = OptionsWindowRefresh
}
}
end
function look_controls()
return {
type = "UIElement",
id = "look_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 = OptionsMainClose
},
children = {
{
type = "generic_menu_title",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_LOOK" )
}
},
{
type = "look_controls_vlist",
id = "look_controls_vlist_id"
},
{
type = "button_helper_text_main",
id = "button_helper_text_id"
},
{
type = "UIBindButton",
id = "back_button",
handlers = {
button_secondary = MBh.LeaveMenu()
}
}
}
}
end
LUI.MenuBuilder.registerDef( "look_controls_vlist", look_controls_vlist )
LUI.MenuBuilder.registerDef( "look_controls", look_controls )
LockTable( _M )

289
lui/lui.dec.lua Normal file
View File

@ -0,0 +1,289 @@
LUI = {
roots = {},
Alignment = {
None = 0,
Left = 1,
Center = 2,
Right = 3,
Top = 4,
Middle = 5,
Bottom = 6
},
savedMenuStates = {},
ActiveScoped = nil
}
if not Engine.IsDevelopmentBuild() then
function print()
end
function printf()
end
end
LUI.CachedEvents = {
process_events = {
name = "process_events",
immediate = true
},
transition_complete = {
name = "transistion_complete_default",
lateness = 0
},
gamepad_button = {
name = "gamepad_button",
controller = 0,
button = "primary",
down = true,
immediate = true
}
}
function DisableGlobals()
local f3_local0 = getmetatable( _G )
if not f3_local0 then
f3_local0 = {}
setmetatable( _G, f3_local0 )
end
f3_local0.__newindex = function ( f4_arg0, f4_arg1, f4_arg2 )
error( "LUI Error: Tried to create global variable " .. f4_arg1, 2 )
end
end
function LockTable( f5_arg0 )
local f5_local0 = getmetatable( f5_arg0 )
if not f5_local0 then
f5_local0 = {}
setmetatable( f5_arg0, f5_local0 )
end
f5_local0.__newindex = function ( f6_arg0, f6_arg1, f6_arg2 )
error( "LUI Error: Tried to create module variable " .. f6_arg1, 2 )
end
end
function InheritFrom( f7_arg0 )
if not f7_arg0 then
error( "LUI Error: Did not specify base class in InheritFrom!" )
end
local f7_local0 = {}
setmetatable( f7_local0, {
__index = f7_arg0
} )
f7_local0.m_eventHandlers = {}
setmetatable( f7_local0.m_eventHandlers, {
__index = f7_arg0.m_eventHandlers
} )
return f7_local0
end
if nil ~= hpairs then
pairs = hpairs
end
LUI.ShallowCopy = function ( f8_arg0 )
local f8_local0 = {}
for f8_local4, f8_local5 in pairs( f8_arg0 ) do
f8_local0[f8_local4] = f8_local5
end
return f8_local0
end
LUI.ConcatenateToTable = function ( f9_arg0, f9_arg1 )
if f9_arg1 == nil then
return
end
for f9_local3, f9_local4 in ipairs( f9_arg1 ) do
table.insert( f9_arg0, f9_local4 )
end
end
LUI.RemoveSingleItemFromArray = function ( f10_arg0, f10_arg1 )
for f10_local0 = 1, #f10_arg0, 1 do
if f10_arg0[f10_local0] == f10_arg1 then
table.remove( f10_arg0, f10_local0 )
break
end
end
end
LUI.IsItemInArray = function ( f11_arg0, f11_arg1 )
for f11_local0 = 1, #f11_arg0, 1 do
if f11_arg0[f11_local0] == f11_arg1 then
return true
end
end
return false
end
LUI.ReverseTable = function ( f12_arg0 )
local f12_local0 = #f12_arg0
local f12_local1 = {}
for f12_local5, f12_local6 in ipairs( f12_arg0 ) do
f12_local1[f12_local0 - f12_local5 + 1] = f12_local6
end
return f12_local1
end
LUI.clamp = function ( f13_arg0, f13_arg1, f13_arg2 )
if f13_arg0 < f13_arg1 then
return f13_arg1
elseif f13_arg2 < f13_arg0 then
return f13_arg2
else
return f13_arg0
end
end
LUI.FormatAnimStateFinishEvent = function ( f14_arg0 )
return "transition_complete_" .. f14_arg0
end
LUI.MakeFlyOverAnimationState = function ( f15_arg0, f15_arg1 )
assert( f15_arg0 )
assert( f15_arg1 )
local f15_local0, f15_local1, f15_local2, f15_local3 = f15_arg0:getCurrentGlobalRect()
local f15_local4, f15_local5, f15_local6, f15_local7 = f15_arg1:getCurrentGlobalRect()
local f15_local8 = f15_local4 - f15_local0
local f15_local9 = f15_local6 - f15_local2
local f15_local10 = f15_local5 - f15_local1
local f15_local11 = f15_local7 - f15_local3
local f15_local12, f15_local13, f15_local14, f15_local15 = f15_arg0:getLocalRect()
local f15_local16, f15_local17, f15_local18, f15_local19 = f15_arg0:GetAnchorData()
return {
topAnchor = f15_local17,
bottomAnchor = f15_local19,
leftAnchor = f15_local16,
rightAnchor = f15_local18,
top = f15_local13 + f15_local10,
bottom = f15_local15 + f15_local11,
left = f15_local12 + f15_local8,
right = f15_local14 + f15_local9
}
end
LUI.Debug = {}
LargestElements = {}
LargestElementsSize = {}
LargestElementsCount = {}
if debug then
debug.postdeploymentfunction = function ()
for f16_local3, f16_local4 in pairs( LUI.roots ) do
f16_local4.debugReload = true
end
end
end
function LUITestFunction()
DebugPrint( "Running LUITestFunction()" )
end
function CountFieldsHelper( f18_arg0, f18_arg1 )
if f18_arg1[f18_arg0] then
return
end
f18_arg1[f18_arg0] = true
local f18_local0 = 0
for f18_local4, f18_local5 in pairs( f18_arg0 ) do
if type( f18_local4 ) == "table" then
f18_local0 = f18_local0 + CountFieldsHelper( f18_local4, f18_arg1 )
end
f18_local0 = f18_local0 + 1
end
return f18_local0
end
function CountFields( f19_arg0 )
return CountFieldsHelper( f19_arg0, {} )
end
function CountReferencesHelper( f20_arg0, f20_arg1 )
if f20_arg1[f20_arg0] then
return
end
f20_arg1[f20_arg0] = true
if type( f20_arg0 ) == "userdata" then
local f20_local0 = getmetatable( f20_arg0 )
if not f20_local0 then
return
end
f20_arg0 = f20_local0.__index
if not f20_arg0 then
return
elseif type( f20_arg0 ) == "table" and f20_arg0.id then
local f20_local1 = CountFields( f20_arg0 )
if not LargestElementsSize[f20_arg0.id] or LargestElementsSize[f20_arg0.id] < f20_local1 then
LargestElements[f20_arg0.id] = f20_arg0
LargestElementsSize[f20_arg0.id] = f20_local1
end
if not LargestElementsCount[f20_arg0.id] then
LargestElementsCount[f20_arg0.id] = 0
end
LargestElementsCount[f20_arg0.id] = LargestElementsCount[f20_arg0.id] + 1
end
end
if type( f20_arg0 ) ~= "table" then
return
end
for f20_local3, f20_local4 in pairs( f20_arg0 ) do
CountReferencesHelper( f20_local4, f20_arg1 )
end
end
function CountReferences( f21_arg0 )
local f21_local0 = {
[f21_arg0] = true
}
if type( f21_arg0 ) == "userdata" then
local f21_local1 = getmetatable( f21_arg0 )
if not f21_local1 then
return 0
end
f21_arg0 = f21_local1.__index
if not f21_arg0 then
return 0
end
end
if type( f21_arg0 ) ~= "table" then
return 0
end
for f21_local4, f21_local5 in pairs( f21_arg0 ) do
CountReferencesHelper( f21_local5, f21_local0 )
end
f21_local1 = 0
for f21_local5, f21_local6 in pairs( f21_local0 ) do
f21_local1 = f21_local1 + 1
end
return f21_local1
end
require( "LUI.LUIElement" )
require( "LUI.LUIRoot" )
require( "LUI.LUITimer" )
require( "LUI.LUIButtonRepeater" )
require( "LUI.LUIImage" )
require( "LUI.LUILitImage" )
require( "LUI.LUIText" )
require( "LUI.LUIAnimNumber" )
require( "LUI.LUITightText" )
require( "LUI.LUIButton" )
require( "LUI.LUIBindButton" )
require( "LUI.LUIMouseCursor" )
require( "LUI.LUIVerticalList" )
require( "LUI.LUIScrollingVerticalList" )
require( "LUI.LUIHorizontalList" )
require( "LUI.LUIBarrelList" )
require( "LUI.LUIGrid" )
require( "LUI.LUIScrollable" )
require( "LUI.LUIVerticalScrollbar" )
require( "LUI.LUISafeAreaOverlay" )
require( "LUI.LUICountdown" )
require( "LUI.LUILongCountdown" )
require( "LUI.LUITechyDigits" )
require( "LUI.LUIPrettyNumber" )
require( "LUI.LUICharacterWindow" )
require( "LUI.FlowManager" )
require( "LUI.HudManager" )
require( "LUI.MenuBuilder" )
require( "LUI.LUIMarqueeText" )
MBh = LUI.MenuBuilder.helpers

56
lui/luianimnumber.dec.lua Normal file
View File

@ -0,0 +1,56 @@
LUI.UIAnimNumber = {}
LUI.UIAnimNumber.new = function ( f1_arg0 )
local self = LUI.UIText.new( f1_arg0 )
self.setNumber = LUI.UIAnimNumber.SetNumber
self.setLocalizedString = LUI.UIAnimNumber.SetLocalizedString
self.layout = LUI.UIAnimNumber.Layout
return self
end
LUI.UIAnimNumber.SetNumber = function ( f2_arg0, f2_arg1, f2_arg2 )
if f2_arg2 == nil or f2_arg0.currentNumber == nil then
f2_arg0.currentNumber = f2_arg1
f2_arg0:setText( f2_arg1 )
return
else
f2_arg0.startingNumber = f2_arg0.currentNumber
f2_arg0.numberChange = f2_arg1 - f2_arg0.startingNumber
f2_arg0.timeLeft = f2_arg2
f2_arg0.duration = f2_arg2
f2_arg0:setLayoutCached( false )
end
end
LUI.UIAnimNumber.SetLocalizedString = function ( f3_arg0, f3_arg1 )
f3_arg0.localizedString = f3_arg1
end
LUI.UIAnimNumber.Layout = function ( f4_arg0, f4_arg1 )
local f4_local0 = true
if f4_arg0.timeLeft ~= nil then
local f4_local1 = f4_arg0.timeLeft - f4_arg1.deltaTime
local f4_local2 = nil
if f4_local1 < 0 then
f4_local2 = f4_arg0.startingNumber + f4_arg0.numberChange
f4_arg0.startingNumber = nil
f4_arg0.numberChange = nil
f4_arg0.timeLeft = nil
f4_arg0.duration = nil
else
f4_arg0.timeLeft = f4_local1
f4_local2 = math.floor( f4_arg0.startingNumber + f4_arg0.numberChange * (1 - f4_local1 / f4_arg0.duration) + 0.5 )
end
local f4_local3 = f4_arg0.localizedString
if f4_local3 ~= nil then
f4_arg0:setText( Engine.Localize( f4_local3, f4_local2 ) )
else
f4_arg0:setText( f4_local2 )
end
f4_arg0.currentNumber = f4_local2
f4_local0 = false
end
f4_local0 = f4_arg0:updateElementLayout( f4_arg1 ) and f4_local0
f4_arg0:layoutChildren( f4_arg1 )
f4_arg0:setLayoutCached( f4_local0 )
end

295
lui/luibarrellist.dec.lua Normal file
View File

@ -0,0 +1,295 @@
LUI.UIBarrelList = {}
LUI.UIBarrelList.build = function ( f1_arg0, f1_arg1 )
return LUI.UIBarrelList.new( nil, f1_arg1 )
end
LUI.UIBarrelList.new = function ( menu, controller )
local self = LUI.UIElement.new( menu )
self.id = "UIBarrelList"
if not controller then
controller = {}
end
self.animSpeed = controller.anim_speed or 60
self.listOffset = controller.list_offset or 0
self.onUpdateFunc = controller.on_update_func
self.onScrollFunc = controller.on_scroll_func
local hList = LUI.UIHorizontalList.new( menu )
hList:registerAnimationState( "default", {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = self.listOffset,
spacing = controller.spacing or 0
} )
hList:animateToState( "default" )
self:addElement( hList )
self.hList = hList
self:registerEventHandler( "gain_focus", LUI.UIBarrelList.gainFocus )
self.addElement = LUI.UIBarrelList.AddElement
self.removeElement = LUI.UIBarrelList.RemoveElement
self.increment = LUI.UIBarrelList.IncrementIndex
self.decrement = LUI.UIBarrelList.DecrementIndex
self.getCurrentIndex = LUI.UIBarrelList.GetCurrentIndex
self.handleGamepadButton = LUI.UIBarrelList.handleGamepadButton
self.setupForAnimation = LUI.UIBarrelList.SetupForAnimation
self.manualUpdate = LUI.UIBarrelList.UpdateList
self:makeFocusable()
self.currentIndex = 0
return self
end
LUI.UIBarrelList.AddElement = function ( f3_arg0, f3_arg1 )
if f3_arg0.usingAnimation then
DebugPrint( "WARNING: Adding an element after the BarrelList has been setup for animation! Cap positions will be wrong and animation will look broken!" )
end
f3_arg0.hList:addElement( f3_arg1 )
LUI.UIBarrelList.UpdateList( f3_arg0 )
end
LUI.UIBarrelList.RemoveElement = function ( f4_arg0, f4_arg1 )
if f4_arg0.usingAnimation then
DebugPrint( "WARNING: Removing an element after the BarrelList has been setup for animation! Cap positions will be wrong and animation will look broken!" )
end
f4_arg0.hList:removeElement( f4_arg1 )
LUI.UIBarrelList.UpdateList( f4_arg0 )
end
LUI.UIBarrelList.UpdateList = function ( f5_arg0 )
local f5_local0 = f5_arg0.hList:getNumChildren()
local f5_local1 = f5_arg0.hList:getFirstChild()
local f5_local2 = math.floor( f5_local0 / 2 )
for f5_local3 = 0, f5_local0 - 1, 1 do
f5_local1:processEvent( {
name = "barrel_index_update",
index = f5_arg0.currentIndex - f5_local2 - f5_local3
} )
f5_local1 = f5_local1:getNextSibling()
end
if f5_arg0.onUpdateFunc then
f5_arg0:onUpdateFunc( f5_arg0.currentIndex )
end
return false
end
LUI.UIBarrelList.gainFocus = function ( f6_arg0 )
f6_arg0:setFocus( true )
local f6_local0 = f6_arg0.hList:getNumChildren()
local f6_local1 = f6_arg0.hList:getFirstChild()
local f6_local2 = math.floor( f6_local0 / 2 )
for f6_local3 = 1, f6_local2, 1 do
local f6_local6 = f6_local3
f6_local1 = f6_local1:getNextSibling()
end
f6_arg0.focusedChild = f6_local1
f6_local1:processEvent( {
name = "barrel_list_focus"
} )
return true
end
LUI.UIBarrelList.handleGamepadButton = function ( f7_arg0, f7_arg1 )
if not f7_arg0:isInFocus() or not f7_arg1.down then
return false
end
local f7_local0 = false
if f7_arg1.button == "primary" then
if not f7_arg0.isAnimating then
f7_arg0.focusedChild:processEvent( {
name = "barrel_list_action",
index = f7_arg0.currentIndex,
controller = f7_arg1.controller
} )
end
f7_local0 = true
elseif f7_arg1.button == "left" then
if not f7_arg0.isAnimating then
LUI.UIBarrelList.DecrementIndex( f7_arg0 )
end
f7_local0 = true
elseif f7_arg1.button == "right" then
if not f7_arg0.isAnimating then
LUI.UIBarrelList.IncrementIndex( f7_arg0 )
end
f7_local0 = true
elseif f7_arg1.button == "alt1" then
if not f7_arg0.isAnimating then
f7_arg0.focusedChild:processEvent( {
name = "barrel_list_button_alt1",
index = f7_arg0.currentIndex,
controller = f7_arg1.controller
} )
end
f7_local0 = true
end
return f7_local0
end
LUI.UIBarrelList.IncrementIndex = function ( f8_arg0 )
f8_arg0.currentIndex = f8_arg0.currentIndex + 1
if f8_arg0.usingAnimation then
f8_arg0:animateToState( "shift_left", f8_arg0.animSpeed, true, true )
f8_arg0.rightCap:processEvent( {
name = "barrel_index_update",
index = f8_arg0.currentIndex + math.floor( f8_arg0.hList:getNumChildren() / 2 ),
barrelList = f8_arg0
} )
f8_arg0:dispatchEventToChildren( {
name = "barrel_anim_start",
barrelList = f8_arg0,
movingLeft = true
} )
if f8_arg0.onScrollFunc then
f8_arg0:onScrollFunc()
end
f8_arg0:dispatchEventToChildren( {
name = "barrel_list_unfocus"
} )
f8_arg0.isAnimating = true
else
LUI.UIBarrelList.UpdateList( f8_arg0 )
end
end
LUI.UIBarrelList.DecrementIndex = function ( f9_arg0 )
f9_arg0.currentIndex = f9_arg0.currentIndex - 1
if f9_arg0.usingAnimation then
f9_arg0:animateToState( "shift_right", f9_arg0.animSpeed, true, true )
f9_arg0.leftCap:processEvent( {
name = "barrel_index_update",
index = f9_arg0.currentIndex - math.floor( f9_arg0.hList:getNumChildren() / 2 ),
barrelList = f9_arg0
} )
f9_arg0:dispatchEventToChildren( {
name = "barrel_anim_start",
barrelList = f9_arg0,
movingRight = true
} )
if f9_arg0.onScrollFunc then
f9_arg0:onScrollFunc()
end
f9_arg0:dispatchEventToChildren( {
name = "barrel_list_unfocus"
} )
f9_arg0.isAnimating = true
else
LUI.UIBarrelList.UpdateList( f9_arg0 )
end
end
LUI.UIBarrelList.GetCurrentIndex = function ( f10_arg0 )
return f10_arg0.currentIndex
end
LUI.UIBarrelList.ScrollFinished = function ( f11_arg0, f11_arg1 )
f11_arg0:animateToState( "default", 0 )
f11_arg0.isAnimating = false
end
LUI.UIBarrelList.OnDefaultState = function ( f12_arg0, f12_arg1 )
local f12_local0 = f12_arg0.hList:getNumChildren()
local f12_local1 = f12_arg0.hList:getFirstChild()
local f12_local2 = math.floor( f12_local0 / 2 )
for f12_local3 = 0, f12_local0 - 1, 1 do
if f12_local3 == f12_local2 then
f12_local1:processEvent( {
name = "barrel_list_focus"
} )
end
f12_local1 = f12_local1:getNextSibling()
end
LUI.UIBarrelList.UpdateList( f12_arg0 )
f12_arg0:dispatchEventToChildren( {
name = "barrel_default_state"
} )
end
LUI.UIBarrelList.CreateCap = function ( f13_arg0, f13_arg1, f13_arg2, f13_arg3, f13_arg4, f13_arg5, f13_arg6, f13_arg7, f13_arg8 )
local f13_local0 = f13_arg0( f13_arg2 )
f13_local0.id = f13_arg1
f13_local0:registerAnimationState( "default", {
topAnchor = f13_arg7.topAnchor,
bottomAnchor = f13_arg7.bottomAnchor,
leftAnchor = f13_arg7.leftAnchor,
rightAnchor = f13_arg7.rightAnchor,
top = f13_arg3,
bottom = f13_arg4,
left = f13_arg5,
right = f13_arg6
} )
f13_local0:animateToState( "default", 0 )
for f13_local4, f13_local5 in pairs( f13_arg8 ) do
f13_local0:registerEventHandler( f13_local4, f13_local5 )
end
return f13_local0
end
LUI.UIBarrelList.SetupForAnimation = function ( f14_arg0, f14_arg1, f14_arg2, f14_arg3 )
local f14_local0 = f14_arg0.hList:getNumChildren()
local f14_local1 = f14_arg0.hList:getFirstChild()
local f14_local2 = f14_local1.properties
if f14_arg3 then
f14_arg0:setUseStencil( false )
else
f14_arg0:setUseStencil( true )
end
if f14_arg2 then
for f14_local6, f14_local7 in pairs( f14_arg2 ) do
f14_local2[f14_local6] = f14_local7
end
end
local f14_local3, f14_local4, f14_local5, f14_local6 = f14_local1:getLocalRect()
local f14_local7, f14_local8, f14_local9, f14_local10 = f14_local1:GetAnchorData()
local f14_local11 = {
leftAnchor = f14_local7,
topAnchor = f14_local8,
rightAnchor = f14_local9,
bottomAnchor = f14_local10
}
local f14_local12 = f14_local5 - f14_local3
local f14_local13 = -(f14_local12 + f14_arg0.properties.spacing + f14_arg0.listOffset)
f14_arg0.leftCap = LUI.UIBarrelList.CreateCap( f14_arg1, "barrel_left_cap_id", f14_local2, f14_local4, f14_local6, f14_local13, f14_local13 + f14_local12, f14_local11, f14_local1.m_eventHandlers )
f14_local13 = (f14_local12 + f14_arg0.properties.spacing) * f14_local0 + f14_arg0.listOffset
f14_arg0.rightCap = LUI.UIBarrelList.CreateCap( f14_arg1, "barrel_right_cap_id", f14_local2, f14_local4, f14_local6, f14_local13, f14_local13 + f14_local12, f14_local11, f14_local1.m_eventHandlers )
LUI.UIElement.addElement( f14_arg0, f14_arg0.leftCap )
LUI.UIElement.addElement( f14_arg0, f14_arg0.rightCap )
f14_local3, f14_local4, f14_local5, f14_local6 = f14_arg0:getLocalRect()
f14_local7, f14_local8, f14_local9, f14_local10 = f14_arg0:GetAnchorData()
local f14_local14 = f14_arg0
local f14_local15 = f14_arg0.registerAnimationState
local f14_local16 = "shift_right"
local f14_local17 = {
topAnchor = f14_local8,
bottomAnchor = f14_local10,
leftAnchor = f14_local7
}
local f14_local18 = f14_local9
f14_local17.top = f14_local4
f14_local17.bottom = f14_local6
f14_local17.left = f14_local3 + f14_local12 + f14_arg0.properties.spacing
f14_local17.right = 0
f14_local17[1] = f14_local18
f14_local15( f14_local14, f14_local16, f14_local17 )
f14_local14 = f14_arg0
f14_local15 = f14_arg0.registerAnimationState
f14_local16 = "shift_left"
f14_local17 = {
topAnchor = f14_local8,
bottomAnchor = f14_local10,
leftAnchor = f14_local7
}
f14_local18 = f14_local9
f14_local17.top = f14_local4
f14_local17.bottom = f14_local6
f14_local17.left = f14_local3 - f14_local12 - f14_arg0.properties.spacing
f14_local17.right = 0
f14_local17[1] = f14_local18
f14_local15( f14_local14, f14_local16, f14_local17 )
f14_arg0:registerEventHandler( "transition_complete_shift_left", LUI.UIBarrelList.ScrollFinished )
f14_arg0:registerEventHandler( "transition_complete_shift_right", LUI.UIBarrelList.ScrollFinished )
f14_arg0:registerEventHandler( "transition_complete_default", LUI.UIBarrelList.OnDefaultState )
f14_arg0.usingAnimation = true
end

105
lui/luibindbutton.dec.lua Normal file
View File

@ -0,0 +1,105 @@
LUI.UIBindButton = {}
LUI.UIBindButton.GamepadButton = function ( f1_arg0, f1_arg1 )
if f1_arg0:handleGamepadButton( f1_arg1 ) then
return true
elseif f1_arg0.m_ownerController ~= nil and f1_arg0.m_ownerController ~= f1_arg1.controller then
DebugPrint( "Item Exclusive to controller " .. f1_arg1.controller )
return false
elseif f1_arg1.down == true then
local f1_local0 = false
local f1_local1 = {
controller = f1_arg1.controller,
qualifier = f1_arg1.qualifier
}
if not f1_arg0.disabled then
f1_local0 = true
if f1_arg1.button == "secondary" then
f1_local1.name = "button_secondary"
elseif f1_arg1.button == "alt1" then
f1_local1.name = "button_alt1"
elseif f1_arg1.button == "alt2" then
f1_local1.name = "button_alt2"
elseif f1_arg1.button == "right_trigger" then
f1_local1.name = "button_right_trigger"
elseif f1_arg1.button == "left_trigger" then
f1_local1.name = "button_left_trigger"
elseif f1_arg1.button == "shoulderr" then
f1_local1.name = "button_shoulderr"
elseif f1_arg1.button == "shoulderl" then
f1_local1.name = "button_shoulderl"
elseif f1_arg1.button == "right_stick" then
f1_local1.name = "button_right_stick"
elseif f1_arg1.button == "left_stick" then
f1_local1.name = "button_left_stick"
elseif f1_arg1.button == "left" then
f1_local1.name = "button_left"
elseif f1_arg1.button == "right" then
f1_local1.name = "button_right"
elseif f1_arg1.button == "up" then
f1_local1.name = "button_up"
elseif f1_arg1.button == "down" then
f1_local1.name = "button_down"
elseif f1_arg1.button == "start" then
f1_local1.name = "button_start"
elseif f1_arg1.button == "select" then
f1_local1.name = "button_select"
elseif f1_arg1.button == "options" then
f1_local1.name = "button_options"
else
f1_local0 = false
end
end
if f1_local0 and f1_arg0:processEvent( f1_local1 ) then
if f1_arg0.actionSFX then
Engine.PlaySound( f1_arg0.actionSFX )
end
return true
end
end
return f1_arg0:dispatchEventToChildren( f1_arg1 )
end
LUI.UIBindButton.ElementEnable = function ( f2_arg0, f2_arg1 )
f2_arg0.disabled = nil
end
LUI.UIBindButton.ElementDisable = function ( f3_arg0, f3_arg1 )
f3_arg0.disabled = true
end
LUI.UIBindButton.Enable = function ( f4_arg0 )
f4_arg0:processEvent( {
name = "enable",
dispatchChildren = true
} )
end
LUI.UIBindButton.Disable = function ( f5_arg0 )
f5_arg0:processEvent( {
name = "disable",
dispatchChildren = true
} )
end
LUI.UIBindButton.SetActionSFX = function ( f6_arg0, f6_arg1 )
f6_arg0.actionSFX = f6_arg1
end
LUI.UIBindButton.build = function ( f7_arg0, f7_arg1 )
return LUI.UIBindButton.new()
end
LUI.UIBindButton.new = function ( menu, controller )
local self = LUI.UIElement.new( menu )
self.id = "LUIBindButton"
self.enable = LUI.UIBindButton.Enable
self.disable = LUI.UIBindButton.Disable
self.setActionSFX = LUI.UIBindButton.SetActionSFX
self:registerEventHandlerIfFree( "enable", LUI.UIBindButton.ElementEnable )
self:registerEventHandlerIfFree( "disable", LUI.UIBindButton.ElementDisable )
self:registerEventHandlerIfFree( "popup_active", LUI.UIBindButton.ElementDisable )
self:registerEventHandlerIfFree( "popup_inactive", LUI.UIBindButton.ElementEnable )
self:registerEventHandler( "gamepad_button", LUI.UIBindButton.GamepadButton )
return self
end

415
lui/luibutton.dec.lua Normal file
View File

@ -0,0 +1,415 @@
LUI.UIButton = {}
LUI.UIButton.popupActive = function ( f1_arg0, f1_arg1 )
f1_arg0.m_ignoreMouseFocus = true
end
LUI.UIButton.popupInactive = function ( f2_arg0, f2_arg1 )
f2_arg0.m_ignoreMouseFocus = nil
end
LUI.UIButton.MouseEnter = function ( f3_arg0, f3_arg1 )
if f3_arg0.m_leftMouseDown == nil then
if f3_arg0:canFocus( FocusType.MouseOver ) and not f3_arg0:isInFocus() then
if f3_arg0.disabled then
f3_arg0:processEvent( {
name = "button_over_disable"
} )
else
f3_arg0:processEvent( {
name = "button_over",
controller = f3_arg1.controller
} )
end
end
elseif f3_arg0.m_leftMouseDown ~= nil then
f3_arg0:processEvent( {
name = "button_over_down"
} )
end
end
LUI.UIButton.MouseLeave = function ( f4_arg0, f4_arg1 )
if f4_arg0.m_leftMouseDown == nil then
if f4_arg0.m_focusable and not f4_arg0:isInFocus() then
if f4_arg0.disabled then
f4_arg0:processEvent( {
name = "button_disable"
} )
else
f4_arg0:processEvent( {
name = "button_up"
} )
end
end
else
f4_arg0:processEvent( {
name = "button_down"
} )
end
end
LUI.UIButton.LeftMouseDown = function ( f5_arg0, f5_arg1 )
f5_arg0:processEvent( {
name = "button_over_down"
} )
end
LUI.UIButton.RightMouseDown = function ( f6_arg0, f6_arg1 )
f6_arg0:processEvent( {
name = "button_over_down"
} )
end
LUI.UIButton.LeftMouseUp = function ( f7_arg0, f7_arg1 )
if f7_arg1.inside then
if f7_arg0.disabled then
f7_arg0:processEvent( {
name = "button_over_disable"
} )
else
f7_arg0:processEvent( {
name = "button_over",
controller = f7_arg1.controller,
focusType = FocusType.MouseOver
} )
end
if not f7_arg0.disabled then
if not f7_arg0.properties or not f7_arg0.properties.muteAction then
Engine.PlaySound( f7_arg0.actionSFX )
end
local f7_local0 = f7_arg0:processEvent( {
name = "button_action",
controller = f7_arg1.controller,
mouse = true
} )
f7_arg0:processEvent( {
name = "button_down",
controller = f7_arg1.controller,
mouse = true
} )
if f7_local0 then
return f7_local0
end
elseif f7_arg0.properties and f7_arg0.properties.disableSound then
Engine.PlaySound( f7_arg0.properties.disableSound )
end
if f7_arg0.properties and f7_arg0.properties.allowDisabledAction then
f7_arg0:processEvent( {
name = "button_action_disable",
controller = f7_arg1.controller
} )
end
elseif not f7_arg0.disabled then
f7_arg0:processEvent( {
name = "button_up"
} )
end
end
LUI.UIButton.RightMouseUp = function ( f8_arg0, f8_arg1 )
if f8_arg1.inside then
if f8_arg0.disabled then
f8_arg0:processEvent( {
name = "button_over_disable",
controller = f8_arg1.controller
} )
else
f8_arg0:processEvent( {
name = "button_over",
controller = f8_arg1.controller
} )
end
if not f8_arg0.disabled then
local f8_local0 = f8_arg0:processEvent( {
name = "button_actionsecondary",
controller = f8_arg1.controller,
mouse = true
} )
if f8_local0 then
return f8_local0
end
end
else
f8_arg0:processEvent( {
name = "button_up"
} )
end
end
LUI.UIButton.excludeButtons = {
secondary = true,
alt1 = true,
alt2 = true,
right_trigger = true,
left_trigger = true,
shoulderl = true,
shoulderr = true,
start = true
}
LUI.UIButton.GamepadButton = function ( f9_arg0, f9_arg1 )
if f9_arg0:handleGamepadButton( f9_arg1 ) then
return true
elseif f9_arg0:isInFocus() and f9_arg1.down == true then
if f9_arg1.button == "primary" then
if not f9_arg0.properties or not f9_arg0.properties.muteAction then
Engine.PlaySound( f9_arg0.actionSFX )
end
if not f9_arg0.disabled then
local f9_local0
if not f9_arg1.qualifier or f9_arg1.qualifier ~= ButtonQualifiers.Keyboard then
f9_local0 = false
else
f9_local0 = true
end
f9_arg0:processEvent( {
name = "button_action",
controller = f9_arg1.controller,
keyboard = f9_local0
} )
f9_arg0:processEvent( {
name = "button_down",
controller = f9_arg1.controller,
keyboard = f9_local0
} )
else
if f9_arg0.properties and f9_arg0.properties.disableSound then
Engine.PlaySound( f9_arg0.properties.disableSound )
end
if f9_arg0.properties and f9_arg0.properties.allowDisabledAction then
f9_arg0:processEvent( {
name = "button_action_disable",
controller = f9_arg1.controller
} )
end
end
if f9_arg0.m_eventHandlers.button_action ~= nil then
return true
end
elseif f9_arg1.button == "left" then
if not f9_arg0.disabled then
f9_arg0:processEvent( {
name = "button_left",
controller = f9_arg1.controller
} )
end
if f9_arg0.m_eventHandlers.button_left ~= nil then
return true
end
elseif f9_arg1.button == "right" then
if not f9_arg0.disabled then
f9_arg0:processEvent( {
name = "button_right",
controller = f9_arg1.controller
} )
end
if f9_arg0.m_eventHandlers.button_right ~= nil then
return true
end
elseif LUI.UIButton.excludeButtons[f9_arg1.button] and f9_arg0.m_eventHandlers["button_" .. f9_arg1.button] ~= nil then
DebugPrint( "Warning: event handler specified for button_" .. f9_arg1.button .. " on a UIButton id = " .. f9_arg0.id .. ", this won't work anymore, use a UIBindButton" )
end
end
return f9_arg0:dispatchEventToChildren( f9_arg1 )
end
LUI.UIButton.gainFocus = function ( f10_arg0, f10_arg1 )
local f10_local0 = f10_arg0:isInFocus()
LUI.UIElement.gainFocus( f10_arg0, f10_arg1 )
if not f10_local0 and f10_arg0:isInFocus() and f10_arg0.gainFocusSFX ~= nil and f10_arg1.focusType ~= FocusType.MenuFlow then
Engine.PlaySound( f10_arg0.gainFocusSFX )
end
if f10_arg0.disabled then
f10_arg0:processEvent( {
name = "button_over_disable",
dispatchChildren = true,
focusType = f10_arg1.focusType
} )
else
f10_arg0:processEvent( {
name = "button_over",
controller = f10_arg1.controller,
dispatchChildren = true,
focusType = f10_arg1.focusType
} )
end
end
LUI.UIButton.loseFocus = function ( f11_arg0, f11_arg1 )
LUI.UIElement.loseFocus( f11_arg0, f11_arg1 )
if f11_arg0.disabled then
f11_arg0:processEvent( {
name = "button_disable",
dispatchChildren = true
} )
else
f11_arg0:processEvent( {
name = "button_up",
dispatchChildren = true
} )
end
end
LUI.UIButton.Up = function ( f12_arg0, f12_arg1 )
f12_arg0:dispatchEventToChildren( f12_arg1 )
if f12_arg0:isInFocus() then
f12_arg0:processEvent( {
name = "gain_focus"
} )
end
end
LUI.UIButton.Over = function ( f13_arg0, f13_arg1 )
if f13_arg0.disabled and f13_arg0:hasAnimationState( "button_over_disabled" ) then
f13_arg0:animateToState( "button_over_disabled", f13_arg0.disableDuration )
elseif f13_arg0:hasAnimationState( "button_over" ) then
f13_arg0:animateToState( "button_over", f13_arg0.overDuration, f13_arg0.overEaseIn, f13_arg0.overEaseOut )
end
end
LUI.UIButton.ElementUp = function ( f14_arg0, f14_arg1 )
end
LUI.UIButton.ElementDown = function ( f15_arg0, f15_arg1 )
if f15_arg0:hasAnimationState( "button_down" ) then
f15_arg0:animateToState( "button_down", f15_arg0.downDuration )
else
LUI.UIButton.ElementUp( f15_arg0, f15_arg1 )
end
f15_arg0:dispatchEventToChildren( f15_arg1 )
end
LUI.UIButton.ElementOverDown = function ( f16_arg0, f16_arg1 )
if f16_arg0:hasAnimationState( "button_over_down" ) then
f16_arg0:animateToState( "button_over_down", f16_arg0.overDownDuration )
else
LUI.UIButton.Over( f16_arg0, f16_arg1 )
end
f16_arg0:dispatchEventToChildren( f16_arg1 )
end
LUI.UIButton.ElementEnable = function ( f17_arg0, f17_arg1 )
f17_arg0.disabled = nil
f17_arg0:dispatchEventToChildren( f17_arg1 )
if f17_arg0:isInFocus() then
f17_arg0:processEvent( {
name = "button_over",
dispatchChildren = true,
controller = f17_arg1.controller
} )
else
f17_arg0:processEvent( {
name = "button_up",
dispatchChildren = true
} )
end
end
LUI.UIButton.ElementDisable = function ( f18_arg0, f18_arg1 )
f18_arg0.disabled = true
f18_arg0:dispatchEventToChildren( f18_arg1 )
if f18_arg0:isInFocus() then
f18_arg0:processEvent( {
name = "button_over_disable",
dispatchChildren = true
} )
else
f18_arg0:processEvent( {
name = "button_disable",
dispatchChildren = true
} )
end
end
LUI.UIButton.UpdateOutsideList = function ( f19_arg0, f19_arg1 )
f19_arg0.m_outsideParentList = f19_arg1.outside_list
end
LUI.UIButton.Enable = function ( f20_arg0, f20_arg1 )
f20_arg0:processEvent( {
name = "enable",
dispatchChildren = true
} )
if f20_arg0:isInFocus() then
f20_arg0:processEvent( {
name = "button_over",
dispatchChildren = true,
controller = f20_arg1.controller
} )
else
f20_arg0:processEvent( {
name = "button_up",
dispatchChildren = true
} )
end
end
LUI.UIButton.Disable = function ( f21_arg0 )
f21_arg0:processEvent( {
name = "disable",
dispatchChildren = true
} )
if f21_arg0:isInFocus() then
f21_arg0:processEvent( {
name = "button_over_disable",
dispatchChildren = true
} )
else
f21_arg0:processEvent( {
name = "button_disable",
dispatchChildren = true
} )
end
end
LUI.UIButton.SetupElement = function ( f22_arg0 )
f22_arg0:registerEventHandlerIfFree( "enable", LUI.UIButton.ElementEnable )
f22_arg0:registerEventHandlerIfFree( "disable", LUI.UIButton.ElementDisable )
f22_arg0:registerEventHandlerIfFree( "button_up", LUI.UIButton.Up )
f22_arg0:registerEventHandlerIfFree( "button_over", LUI.UIButton.Over )
f22_arg0:registerEventHandlerIfFree( "button_down", LUI.UIButton.ElementDown )
f22_arg0:registerEventHandlerIfFree( "button_over_down", LUI.UIButton.ElementOverDown )
end
LUI.UIButton.SetGainFocusSFX = function ( f23_arg0, f23_arg1 )
f23_arg0.gainFocusSFX = f23_arg1
end
LUI.UIButton.SetActionSFX = function ( f24_arg0, f24_arg1 )
f24_arg0.actionSFX = f24_arg1
end
LUI.UIButton.build = function ( f25_arg0, f25_arg1 )
return LUI.UIButton.new()
end
LUI.UIButton.new = function ( menu, controller )
local self = LUI.UIElement.new( menu )
self.id = "LUIButton"
self:makeFocusable()
self:setHandleMouse( true )
self.enable = LUI.UIButton.Enable
self.disable = LUI.UIButton.Disable
self.lock = LUI.UIButton.Disable
self.actionEventName = controller
self.setActionEventName = LUI.UIButton.setActionEventName
self.setGainFocusSFX = LUI.UIButton.SetGainFocusSFX
self.setActionSFX = LUI.UIButton.SetActionSFX
self.gainFocusSFX = CoD.SFX.MouseOver
self.actionSFX = CoD.SFX.MouseClick
self:registerEventHandler( "mouseenter", LUI.UIButton.MouseEnter )
self:registerEventHandler( "mouseleave", LUI.UIButton.MouseLeave )
self:registerEventHandler( "leftmousedown", LUI.UIButton.LeftMouseDown )
self:registerEventHandler( "leftmouseup", LUI.UIButton.LeftMouseUp )
self:registerEventHandler( "rightmousedown", LUI.UIButton.RightMouseDown )
self:registerEventHandler( "rightmouseup", LUI.UIButton.RightMouseUp )
self:registerEventHandler( "gamepad_button", LUI.UIButton.GamepadButton )
self:registerEventHandler( "gain_focus", LUI.UIButton.gainFocus )
self:registerEventHandler( "lose_focus", LUI.UIButton.loseFocus )
self:registerEventHandler( "popup_active", LUI.UIButton.popupActive )
self:registerEventHandler( "popup_inactive", LUI.UIButton.popupInactive )
self:registerEventHandler( "update_outside_list", LUI.UIButton.UpdateOutsideList )
LUI.UIButton.SetupElement( self )
return self
end

View File

@ -0,0 +1,165 @@
require( "LUI.LUITimer" )
LUI.UIButtonRepeater = {}
LUI.UIButtonRepeater.FirstDelay = 420
LUI.UIButtonRepeater.Delay = 210
LUI.UIButtonRepeater.DelayReduction = 25
LUI.UIButtonRepeater.AccelInterval = 100
LUI.UIButtonRepeater.MinDelay = 33
LUI.UIButtonRepeater.new = function ( f1_arg0, f1_arg1, f1_arg2 )
local self = LUI.UIElement.new()
self.id = "LUIButtonRepeater"
self:setPriority( -1000 )
self:registerAnimationState( "default", {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
} )
self:animateToState( "default" )
self.buttonName = f1_arg0
if type( f1_arg1 ) == "string" then
self.event = {
name = f1_arg1,
buttonRepeat = true
}
else
f1_arg1.buttonRepeat = true
self.event = f1_arg1
end
self.eventTarget = f1_arg2
self.firstDelay = LUI.UIButtonRepeater.FirstDelay
self.delay = LUI.UIButtonRepeater.Delay
self.delayReduction = LUI.UIButtonRepeater.DelayReduction
self.accelInterval = LUI.UIButtonRepeater.AccelInterval
self.minDelay = LUI.UIButtonRepeater.MinDelay
self.handleGamepadButton = LUI.UIButtonRepeater.HandleGamepadButton
self.cancelRepetition = LUI.UIButtonRepeater.CancelRepetition
self.sendButtonRepeat = LUI.UIButtonRepeater.SendButtonRepeat
self.setMinDelay = LUI.UIButtonRepeater.SetMinDelay
self.enable = LUI.UIButtonRepeater.Enable
self.disable = LUI.UIButtonRepeater.Disable
if not Engine.IsConsoleGame() then
self:addEventHandler( "leftmousedown", LUI.UIButtonRepeater.LeftMouseDown )
self:addEventHandler( "leftmouseup", LUI.UIButtonRepeater.LeftMouseUp )
self:setHandleMouseButton( true )
end
self:registerEventHandler( "repeat", LUI.UIButtonRepeater.Repeat )
self:registerEventHandler( "accelerate", LUI.UIButtonRepeater.Accelerate )
return self
end
LUI.UIButtonRepeater.Enable = function ( f2_arg0 )
f2_arg0.m_disabled = false
end
LUI.UIButtonRepeater.Disable = function ( f3_arg0 )
f3_arg0.m_disabled = true
f3_arg0:cancelRepetition()
end
LUI.UIButtonRepeater.SetMinDelay = function ( f4_arg0, f4_arg1 )
f4_arg0.minDelay = math.max( 1, f4_arg1 )
end
LUI.UIButtonRepeater.LeftMouseDown = function ( f5_arg0, f5_arg1 )
if "leftmouse" == f5_arg0.buttonName and not f5_arg1.buttonRepeat then
f5_arg0:cancelRepetition()
if f5_arg0.m_disabled then
return false
end
f5_arg0.controller = f5_arg1.controller
local self = LUI.UITimer.new( f5_arg0.firstDelay, {
name = "repeat",
numRepeats = 1
} )
f5_arg0:addElement( self )
f5_arg0.repeatTimer = self
end
end
LUI.UIButtonRepeater.LeftMouseUp = function ( f6_arg0, f6_arg1 )
if "leftmouse" == f6_arg0.buttonName and not f6_arg1.buttonRepeat then
f6_arg0:cancelRepetition()
end
end
LUI.UIButtonRepeater.HandleGamepadButton = function ( f7_arg0, f7_arg1 )
if LUI.UIElement.handleGamepadButton( f7_arg0, f7_arg1 ) then
return true
elseif f7_arg1.button == f7_arg0.buttonName and not f7_arg1.buttonRepeat then
f7_arg0:cancelRepetition()
if f7_arg0.m_disabled then
return false
elseif f7_arg1.down == true then
f7_arg0.controller = f7_arg1.controller
local self = LUI.UITimer.new( f7_arg0.firstDelay, {
name = "repeat",
numRepeats = 1
} )
f7_arg0:addElement( self )
f7_arg0.repeatTimer = self
end
end
end
LUI.UIButtonRepeater.CancelRepetition = function ( f8_arg0 )
local f8_local0 = f8_arg0.repeatTimer
if f8_local0 ~= nil then
f8_local0:close()
f8_arg0.repeatTimer = nil
end
local f8_local1 = f8_arg0.accelTimer
if f8_local1 ~= nil then
f8_local1:close()
f8_arg0.accelTimer = nil
end
f8_arg0.currentDelay = nil
end
LUI.UIButtonRepeater.SendButtonRepeat = function ( f9_arg0 )
local f9_local0 = f9_arg0.eventTarget
if f9_local0 == nil then
f9_local0 = f9_arg0:getParent()
end
local f9_local1 = f9_arg0.event
f9_local1.controller = f9_arg0.controller
return f9_local0:processEvent( f9_local1 )
end
LUI.UIButtonRepeater.Repeat = function ( f10_arg0, f10_arg1 )
local f10_local0 = f10_arg0.repeatTimer
local f10_local1 = f10_arg1.numRepeats
if f10_arg0.currentDelay == nil then
f10_local0.interval = f10_arg0.delay
if f10_arg0.accelTimer == nil then
local accelTimer = LUI.UITimer.new( f10_arg0.accelInterval, "accelerate" )
accelTimer.id = "accelTimer"
f10_arg0:addElement( accelTimer )
f10_arg0.accelTimer = accelTimer
end
else
f10_local0.interval = f10_arg0.currentDelay
end
f10_arg0:sendButtonRepeat()
f10_arg1.numRepeats = f10_local1 + 1
end
LUI.UIButtonRepeater.Accelerate = function ( f11_arg0, f11_arg1 )
local f11_local0 = f11_arg0.currentDelay
if f11_local0 == nil then
f11_local0 = f11_arg0.delay
else
f11_local0 = f11_local0 - f11_arg0.delayReduction
if f11_local0 < f11_arg0.minDelay then
f11_local0 = f11_arg0.minDelay
end
end
f11_arg0.currentDelay = f11_local0
end

View File

@ -0,0 +1,19 @@
LUI.UICharacterWindow = InheritFrom( LUI.UIElement )
LUI.UICharacterWindow.build = function ( f1_arg0, f1_arg1 )
return LUI.UICharacterWindow.new( f1_arg1 )
end
LUI.UICharacterWindow.new = function ( f2_arg0 )
local self = LUI.UIElement.new()
self:setupCharacterWindow()
self:setClass( LUI.UICharacterWindow )
return self
end
LUI.UICharacterWindow.setCharacterHandle = function ( f3_arg0, f3_arg1 )
if LUI.UIElement.setCharacterHandleInC ~= nil then
f3_arg0:setCharacterHandleInC( f3_arg1 )
end
end
LUI.UICharacterWindow.id = "LUICharacterWindow"

40
lui/luicountdown.dec.lua Normal file
View File

@ -0,0 +1,40 @@
LUI.UICountdown = InheritFrom( LUI.UIElement )
LUI.UICountdown.build = function ( f1_arg0, f1_arg1 )
return LUI.UICountdown.new( f1_arg1 )
end
LUI.UICountdown.new = function ( f2_arg0 )
local self = LUI.UIElement.new()
if not f2_arg0 then
f2_arg0 = {}
end
if LUI.UIElement.setupUICountdown ~= nil then
if f2_arg0.endTime == "round_end" then
self:setupUICountdown()
else
self:setupUICountdown( f2_arg0.endTime or 0 )
end
end
self:setClass( LUI.UICountdown )
return self
end
LUI.UICountdown.freeze = function ( f3_arg0 )
f3_arg0.m_frozen = true
end
LUI.UICountdown.unfreeze = function ( f4_arg0 )
f4_arg0.m_frozen = false
end
LUI.UICountdown.setEndTime = function ( f5_arg0, f5_arg1 )
if LUI.UIElement.setEndTimeInC ~= nil then
f5_arg0:setEndTimeInC( f5_arg1 )
end
end
LUI.UICountdown.setTextStyle = function ( f6_arg0, f6_arg1 )
f6_arg0.m_textStyle = f6_arg1
end
LUI.UICountdown.id = "LUICountdown"

730
lui/luielement.dec.lua Normal file
View File

@ -0,0 +1,730 @@
LUI.UIElement = {
id = "LUIElement",
m_defaultAnimationState = {
left = 0,
top = 0,
right = 0,
bottom = 0,
leftAnchor = false,
topAnchor = false,
bottomAnchor = false,
rightAnchor = false,
red = 1,
green = 1,
blue = 1,
alpha = 1,
alphaMultiplier = 1
}
}
LUI.UIElement.addChildRecord = function ( f1_arg0, f1_arg1 )
local f1_local0 = rawget
local f1_local1 = getmetatable( f1_arg1 )
f1_local0 = f1_local0( f1_local1.__newindex, "id" )
if f1_local0 ~= nil then
if not f1_arg0.childRecord then
f1_arg0.childRecord = {}
end
if f1_arg0.childRecord[f1_local0] ~= nil then
DebugPrint( "LUI Warning: Element has duplicate raw id \"" .. f1_local0 .. "\" id .. \"" .. f1_arg1.id .. "\", closing it" )
f1_arg0.childRecord[f1_local0]:close()
end
f1_arg0.childRecord[f1_local0] = f1_arg1
end
end
LUI.UIElement.removeChildRecord = function ( f2_arg0, f2_arg1 )
local f2_local0 = rawget
local f2_local1 = getmetatable( f2_arg1 )
f2_local0 = f2_local0( f2_local1.__newindex, "id" )
if f2_local0 ~= nil then
if f2_arg0.childRecord and f2_arg0.childRecord[f2_local0] then
f2_arg0.childRecord[f2_local0] = nil
else
DebugPrint( "LUI Warning: Removing element from an element which does not contain it: \"" .. f2_local0 .. "\"" )
end
end
end
LUI.UIElement.addElement = function ( f3_arg0, f3_arg1 )
if f3_arg0:canAddElement( f3_arg1 ) then
f3_arg0:addElementToC( f3_arg1 )
f3_arg0:addChildRecord( f3_arg1 )
end
end
LUI.UIElement.addElementBefore = function ( f4_arg0, f4_arg1 )
local f4_local0 = f4_arg1:getParent()
if not f4_local0 then
error( "LUI Error: Element has no parent!" )
return
elseif f4_local0:canAddElement( f4_arg0 ) then
f4_arg0:addElementBeforeInC( f4_arg1 )
f4_local0:addChildRecord( f4_arg0 )
end
end
LUI.UIElement.addElementAfter = function ( f5_arg0, f5_arg1 )
local f5_local0 = f5_arg1:getParent()
if not f5_local0 then
error( "LUI Error: Element has no parent!" )
return
elseif f5_local0:canAddElement( f5_arg0 ) then
f5_arg0:addElementAfterInC( f5_arg1 )
f5_local0:addChildRecord( f5_arg0 )
end
end
LUI.UIElement.removeElement = function ( f6_arg0, f6_arg1 )
if f6_arg0.removeElementInC then
f6_arg0:removeElementInC( f6_arg1 )
f6_arg0:removeChildRecord( f6_arg1 )
end
end
LUI.UIElement.canAddElement = function ( f7_arg0, f7_arg1 )
if f7_arg1 == nil then
error( "LUI Error: Tried to add nil element!" )
return false
elseif f7_arg1:getParent() == f7_arg0 then
return false
else
return true
end
end
LUI.UIElement.isClosed = function ( f8_arg0 )
return f8_arg0:getParent() == nil
end
LUI.UIElement.close = function ( f9_arg0 )
local f9_local0 = f9_arg0:getParent()
if f9_local0 ~= nil then
f9_local0:removeElement( f9_arg0 )
end
end
LUI.UIElement.closeChildren = function ( f10_arg0 )
local f10_local0 = f10_arg0:getFirstChild()
if not f10_local0 then
return
end
while f10_local0 do
local f10_local1 = f10_local0:getNextSibling()
f10_local0:close()
f10_local0 = f10_local1
end
end
LUI.UIElement.closeTree = function ( f11_arg0 )
local f11_local0 = f11_arg0:getFirstChild()
while f11_local0 do
local f11_local1 = f11_local0:getNextSibling()
f11_local0:closeTree()
f11_local0 = f11_local1
end
local f11_local1 = f11_arg0:getParent()
if f11_local1 ~= nil then
f11_local1:removeElementInC( f11_arg0 )
f11_local1:removeChildRecord( f11_arg0 )
end
end
LUI.UIElement.getFullID = function ( f12_arg0 )
local f12_local0 = f12_arg0.id
local f12_local1 = f12_arg0:getParent()
while f12_local1 do
f12_local0 = f12_local1.id .. "/" .. f12_local0
f12_local1 = f12_local1:getParent()
end
return f12_local0
end
LUI.UIElement.getChildById = function ( f13_arg0, f13_arg1 )
return f13_arg0.childRecord and f13_arg0.childRecord[f13_arg1]
end
LUI.UIElement.getFirstDescendentById = function ( f14_arg0, f14_arg1 )
local f14_local0 = f14_arg0.childRecord
if f14_local0 then
f14_local0 = f14_arg0.childRecord[f14_arg1]
end
if f14_local0 ~= nil then
return f14_local0
end
f14_local0 = f14_arg0:getFirstChild()
while f14_local0 ~= nil do
local f14_local1 = f14_local0:getFirstDescendentById( f14_arg1 )
if f14_local1 ~= nil then
return f14_local1
end
f14_local0 = f14_local0:getNextSibling()
end
return nil
end
LUI.UIElement.setHandleMouse = function ( f15_arg0, f15_arg1 )
f15_arg0.handleMouseMove = f15_arg1
f15_arg0.handleMouseButton = f15_arg1
end
LUI.UIElement.setHandleMouseMove = function ( f16_arg0, f16_arg1 )
f16_arg0.handleMouseMove = f16_arg1
end
LUI.UIElement.setHandleMouseButton = function ( f17_arg0, f17_arg1 )
f17_arg0.handleMouseButton = f17_arg1
end
LUI.UIElement.MouseMoveEvent = function ( f18_arg0, f18_arg1 )
if f18_arg0.m_ignoreMouseFocus or f18_arg0.m_outsideParentList or f18_arg0.m_focusLockedByScrolling then
return
elseif not Engine.UsesMouseCursor() then
return
elseif not Engine.InFrontend() and not LUI.UIRoot.mouseInitialized then
LUI.UIRoot.mouseInitialized = true
return true
end
local f18_local0 = false
f18_arg0:applyElementTransform()
if f18_arg0.handleMouseMove and not f18_arg1.waitingForKeyBind then
local f18_local1, f18_local2 = ProjectRootCoordinate( f18_arg1.rootName, f18_arg1.x, f18_arg1.y )
if f18_local1 == nil or f18_local2 == nil then
f18_arg0:undoElementTransform()
return
end
local f18_local3 = false
local f18_local4, f18_local5, f18_local6, f18_local7 = f18_arg0:getRect()
if f18_arg1.mouse_outside == nil and f18_local4 ~= nil and f18_local5 <= f18_local2 and f18_local2 <= f18_local7 and f18_local4 <= f18_local1 and f18_local1 <= f18_local6 then
f18_local3 = true
end
if f18_local3 then
if f18_arg0:canFocus( FocusType.MouseOver ) and not f18_arg0:isInFocus() then
f18_arg0:processEvent( {
name = "gain_focus",
focusType = FocusType.MouseOver
} )
local f18_local8 = f18_arg0:getParent()
if f18_local8:isIDNamed() then
f18_local8.shouldSaveState = true
end
end
if f18_arg0.m_mouseOver == nil then
f18_arg0.m_mouseOver = true
if f18_arg0.m_eventHandlers.mouseenter ~= nil then
f18_arg0.m_eventHandlers:mouseenter( {
name = "mouseenter",
controller = f18_arg1.controller,
root = f18_arg1.root,
x = f18_local1,
y = f18_local2
} )
end
end
if f18_arg0.m_eventHandlers.mouseover ~= nil then
f18_arg0.m_eventHandlers:mouseover( {
name = "mouseover",
controller = f18_arg1.controller,
root = f18_arg1.root,
x = f18_local1,
y = f18_local2
} )
end
else
if f18_arg0:isInFocus() then
f18_arg0:processEvent( {
name = "lose_focus"
} )
end
if f18_arg0.m_mouseOver ~= nil then
f18_arg0.m_mouseOver = nil
if f18_arg0.m_eventHandlers.mouseleave ~= nil then
f18_arg0.m_eventHandlers:mouseleave( {
name = "mouseleave",
controller = f18_arg1.controller,
root = f18_arg1.root
} )
end
end
end
if not f18_local3 and f18_arg1.mouse_outside == nil then
f18_arg1.mouse_outside = true
f18_local0 = true
end
end
f18_arg0:dispatchEventToChildren( f18_arg1 )
if f18_arg0.shouldSaveState then
f18_arg0:saveState()
f18_arg0.shouldSaveState = nil
end
if f18_local0 then
f18_arg1.mouse_outside = nil
end
f18_arg0:undoElementTransform()
end
LUI.UIElement.MouseButtonEvent = function ( f19_arg0, f19_arg1 )
if f19_arg0.m_ignoreMouseFocus or f19_arg0.m_outsideParentList or f19_arg0.m_focusLockedByScrolling then
return
end
f19_arg0:applyElementTransform()
if f19_arg0.handleMouseButton then
local f19_local0, f19_local1 = ProjectRootCoordinate( f19_arg1.rootName, f19_arg1.x, f19_arg1.y )
if f19_local0 == nil or f19_local1 == nil then
f19_arg0:undoElementTransform()
return
end
local f19_local2 = false
local f19_local3, f19_local4, f19_local5, f19_local6 = f19_arg0:getRect()
if f19_arg1.mouse_outside == nil and f19_local3 ~= nil and f19_local4 <= f19_local1 and f19_local1 <= f19_local6 and f19_local3 <= f19_local0 and f19_local0 <= f19_local5 then
f19_local2 = true
end
if f19_arg1.name == "mouseup" then
if f19_arg1.button == "left" and f19_arg0.m_leftMouseDown ~= nil then
f19_arg0.m_leftMouseDown = nil
if f19_arg0.m_eventHandlers.leftmouseup ~= nil then
local f19_local7 = f19_arg0.m_eventHandlers:leftmouseup( {
name = "leftmouseup",
controller = f19_arg1.controller,
root = f19_arg1.root,
x = f19_local0,
y = f19_local1,
inside = f19_local2
} )
if f19_local7 then
f19_arg0:undoElementTransform()
return f19_local7
end
end
end
if f19_arg1.button == "right" and f19_arg0.m_rightMouseDown ~= nil then
f19_arg0.m_rightMouseDown = nil
if f19_arg0.m_eventHandlers.rightmouseup ~= nil then
local f19_local7 = f19_arg0.m_eventHandlers:rightmouseup( {
name = "rightmouseup",
controller = f19_arg1.controller,
root = f19_arg1.root,
x = f19_local0,
y = f19_local1,
inside = f19_local2
} )
if f19_local7 then
f19_arg0:undoElementTransform()
return f19_local7
end
end
end
end
if f19_local2 and f19_arg1.name == "mousedown" then
if f19_arg1.button == "left" and f19_arg0.m_eventHandlers.leftmousedown ~= nil and f19_arg0.m_leftMouseDown == nil then
f19_arg0.m_leftMouseDown = true
f19_arg0.m_eventHandlers:leftmousedown( {
name = "leftmousedown",
controller = f19_arg1.controller,
root = f19_arg1.root,
x = f19_local0,
y = f19_local1,
inside = f19_local2
} )
end
if f19_arg1.button == "right" and f19_arg0.m_eventHandlers.rightmousedown ~= nil and f19_arg0.m_rightMouseDown == nil then
f19_arg0.m_rightMouseDown = true
f19_arg0.m_eventHandlers:rightmousedown( {
name = "rightmousedown",
controller = f19_arg1.controller,
root = f19_arg1.root,
x = f19_local0,
y = f19_local1,
inside = f19_local2
} )
end
end
if f19_arg0.m_eventHandlers.mousedrag ~= nil and f19_arg0.m_leftMouseDown ~= nil then
f19_arg0.m_eventHandlers:mousedrag( {
name = "mousedrag",
controller = f19_arg1.controller,
root = f19_arg1.root,
x = f19_local0,
y = f19_local1
} )
end
end
f19_arg0:dispatchEventToChildren( f19_arg1 )
f19_arg0:undoElementTransform()
end
LUI.UIElement.GamepadButton = function ( f20_arg0, f20_arg1 )
if not f20_arg0:handleGamepadButton( f20_arg1 ) then
if f20_arg0.m_ownerController == nil or f20_arg0.m_ownerController == f20_arg1.controller then
return f20_arg0:dispatchEventToChildren( f20_arg1 )
else
DebugPrint( "Item Exclusive to controller " .. f20_arg1.controller )
end
else
return true
end
end
LUI.UIElement.handleGamepadButton = function ( f21_arg0, f21_arg1 )
if f21_arg0:isInFocus() and f21_arg1.down == true and f21_arg0.m_disableNavigation ~= true and f21_arg0.navigation[f21_arg1.button] and f21_arg0.navigation[f21_arg1.button]:canFocus( FocusType.Gamepad ) then
local f21_local0 = f21_arg0:getParent()
if f21_local0:isIDNamed() then
f21_local0:saveState()
end
f21_arg0:processEvent( {
name = "lose_focus",
controller = f21_arg1.controller
} )
f21_arg0.navigation[f21_arg1.button]:processEvent( {
name = "gain_focus",
controller = f21_arg1.controller
} )
if f21_local0:isIDNamed() and f21_local0 == f21_arg0.navigation[f21_arg1.button]:getParent() then
f21_local0:saveState()
end
return true
else
end
end
LUI.UIElement.disableTreeFocus = function ( f22_arg0, f22_arg1 )
f22_arg0.m_disableTreeFocus = true
end
LUI.UIElement.enableTreeFocus = function ( f23_arg0, f23_arg1 )
f23_arg0.m_disableTreeFocus = nil
end
LUI.UIElement.canFocus = function ( f24_arg0, f24_arg1 )
local f24_local0 = f24_arg0.m_focusable
if f24_local0 and f24_arg0.m_requireFocusType then
f24_local0 = f24_arg1 == f24_arg0.m_requireFocusType
end
return f24_local0
end
LUI.UIElement.gainFocus = function ( f25_arg0, f25_arg1 )
if f25_arg0:canFocus( f25_arg1.focusType ) then
f25_arg0:setFocus( true )
end
if not f25_arg0.m_disableTreeFocus then
f25_arg0:dispatchEventToChildren( f25_arg1 )
end
end
LUI.UIElement.loseFocus = function ( f26_arg0, f26_arg1 )
if f26_arg0.m_focusable and f26_arg0:isInFocus() then
f26_arg0:setFocus( false )
end
f26_arg0:dispatchEventToChildren( f26_arg1 )
end
LUI.UIElement.processEvent = function ( f27_arg0, f27_arg1 )
local f27_local0 = f27_arg0.m_eventHandlers[f27_arg1.name]
if f27_local0 ~= nil then
if f27_arg1.dispatchChildren then
f27_arg0:dispatchEventToChildren( f27_arg1 )
end
return f27_local0( f27_arg0, f27_arg1 )
else
return f27_arg0:dispatchEventToChildren( f27_arg1 )
end
end
LUI.UIElement.dispatchEventToParent = function ( f28_arg0, f28_arg1 )
local f28_local0 = f28_arg0:getParent()
while f28_local0 do
local f28_local1 = f28_local0.m_eventHandlers[f28_arg1.name]
if f28_local1 then
if f28_arg1.dispatchChildren then
f28_local0:dispatchEventToChildren( f28_arg1 )
end
return f28_local1( f28_local0, f28_arg1 )
end
f28_local0 = f28_local0:getParent()
end
end
LUI.UIElement.dispatchEventToMenuRoot = function ( f29_arg0, f29_arg1 )
local f29_local0 = f29_arg0
local f29_local1 = f29_arg0:getParent()
local f29_local2 = f29_arg0:getRootParent()
if f29_local2.flowManager and f29_local2.flowManager.menuRoot then
local f29_local3 = f29_local2.flowManager.menuRoot
while f29_local1 do
if f29_local1 == f29_local3 then
return f29_local0:processEvent( f29_arg1 )
end
f29_local0 = f29_local1
f29_local1 = f29_local1:getParent()
end
end
DebugPrint( "LUI Warning: Could not find the Menu Root for " .. f29_arg1.name .. " called on elemment id " .. (f29_arg0.id or "anonymous element") )
end
LUI.UIElement.dispatchEventToChildren = function ( f30_arg0, f30_arg1 )
local f30_local0 = f30_arg0:getFirstChild()
while f30_local0 do
local f30_local1 = f30_local0:getNextSibling()
local f30_local2 = f30_local0:processEvent( f30_arg1 )
if f30_local2 then
return f30_local2
end
f30_local0 = f30_local1
end
end
LUI.UIElement.getRootParent = function ( f31_arg0 )
return Engine.GetLuiRoot()
end
LUI.UIElement.dispatchEventToRoot = function ( f32_arg0, f32_arg1 )
LUI.UIRoot.ProcessEvent( f32_arg0:getRootParent(), f32_arg1 )
end
LUI.UIElement.dispatchEventToAllOtherRoots = function ( f33_arg0, f33_arg1 )
local f33_local0 = f33_arg0:getRootParent()
for f33_local4, f33_local5 in pairs( LUI.roots ) do
if f33_local0 ~= f33_local5 and f33_local5 ~= LUI.primaryRoot then
f33_local5:processEvent( f33_arg1 )
end
end
end
LUI.UIElement.getRootController = function ( f34_arg0 )
local f34_local0 = f34_arg0:getRootParent()
return f34_local0.m_controllerIndex
end
LUI.UIElement.registerEventHandler = function ( f35_arg0, f35_arg1, f35_arg2 )
f35_arg0.m_eventHandlers[f35_arg1] = f35_arg2
if not f35_arg0.isaroot and LUI.EventCatcher.isDirectDispatchEventType( f35_arg1 ) then
local f35_local0 = f35_arg0:getRootParent()
f35_local0.eventCatcher:registerDirectDispatchHandler( f35_arg0, f35_arg1, f35_arg2 )
end
end
LUI.UIElement.registerOmnvarHandler = function ( f36_arg0, f36_arg1, f36_arg2 )
assert( not f36_arg0.isaroot )
local f36_local0 = f36_arg0:getRootParent()
f36_local0.eventCatcher:registerOmnvarHandler( f36_arg0, f36_arg1, f36_arg2 )
end
LUI.UIElement.registerDvarHandler = function ( f37_arg0, f37_arg1, f37_arg2 )
assert( not f37_arg0.isaroot )
local f37_local0 = f37_arg0:getRootParent()
f37_local0.eventCatcher:registerDvarHandler( f37_arg0, f37_arg1, f37_arg2 )
end
LUI.UIElement.registerEventHandlerIfFree = function ( f38_arg0, f38_arg1, f38_arg2 )
if f38_arg0.m_eventHandlers[f38_arg1] == nil then
f38_arg0:registerEventHandler( f38_arg1, f38_arg2 )
end
end
local f0_local0 = function ( f39_arg0, f39_arg1 )
local f39_local0 = f39_arg0
local f39_local1 = f39_arg1
return function ( f40_arg0, f40_arg1 )
local f40_local0, f40_local1 = nil
return f39_local0( f40_arg0, f40_arg1 ) or f39_local1( f40_arg0, f40_arg1 )
end
end
LUI.UIElement.addEventHandler = function ( f41_arg0, f41_arg1, f41_arg2 )
if f41_arg0.m_eventHandlers[f41_arg1] then
f41_arg0:registerEventHandler( f41_arg1, f0_local0( f41_arg2, f41_arg0.m_eventHandlers[f41_arg1] ) )
else
f41_arg0:registerEventHandler( f41_arg1, f41_arg2 )
end
end
LUI.UIElement.makeFocusable = function ( f42_arg0 )
f42_arg0.m_focusable = true
f42_arg0.navigation = {}
end
LUI.UIElement.makeNotFocusable = function ( f43_arg0 )
f43_arg0.m_focusable = false
end
LUI.UIElement.isIDNamed = function ( f44_arg0 )
local f44_local0
if type( f44_arg0.id ) ~= "string" or f44_arg0.id == "" then
f44_local0 = false
else
f44_local0 = true
end
return f44_local0
end
LUI.UIElement.getFirstInFocus = function ( f45_arg0 )
if f45_arg0:isInFocus() then
return f45_arg0
end
local f45_local0 = f45_arg0:getFirstChild()
while f45_local0 do
local f45_local1 = f45_local0:getFirstInFocus()
if f45_local1 then
return f45_local1
end
f45_local0 = f45_local0:getNextSibling()
end
end
LUI.UIElement.getAllFocusedChildren = function ( f46_arg0, f46_arg1 )
if not f46_arg1 then
f46_arg1 = {}
end
local f46_local0 = f46_arg0:getFirstChild()
while f46_local0 do
local f46_local1 = f46_local0:getNextSibling()
if f46_local0:isInFocus() then
f46_arg1[#f46_arg1 + 1] = f46_local0
else
f46_arg1 = f46_local0:getAllFocusedChildren( f46_arg1 )
end
f46_local0 = f46_local1
end
return f46_arg1
end
LUI.UIElement.isParentInFocus = function ( f47_arg0 )
local f47_local0 = f47_arg0:getParent()
if f47_local0 and f47_local0:isInFocus() then
return true
else
return false
end
end
LUI.UIElement.saveState = function ( f48_arg0 )
if not f48_arg0:isIDNamed() then
error( "LUI Error: Tried to save menu state, but element has no name: " .. f48_arg0:getFullID() )
return
end
LUI.savedMenuStates[f48_arg0.id] = {}
for f48_local3, f48_local4 in ipairs( f48_arg0:getAllFocusedChildren() ) do
if not f48_local4:isIDNamed() then
error( "LUI Error: Tried to save menu state, but focused element has no name: " .. f48_local4:getFullID() )
return
end
LUI.savedMenuStates[f48_arg0.id][#LUI.savedMenuStates[f48_arg0.id] + 1] = {
id = f48_local4.id,
data = f48_local4.saveData
}
end
end
LUI.UIElement.clearSavedState = function ( f49_arg0 )
if not f49_arg0:isIDNamed() then
error( "LUI Error: Tried to save menu state, but element has no name: " .. f49_arg0:getFullID() )
return
end
local f49_local0 = f49_arg0:getFirstChild()
while f49_local0 do
local f49_local1 = f49_local0:getNextSibling()
f49_local0:clearSavedState()
f49_local0 = f49_local1
end
LUI.savedMenuStates[f49_arg0.id] = nil
end
LUI.UIElement.restoreState = function ( f50_arg0, f50_arg1 )
if not f50_arg0:isIDNamed() then
error( "LUI Error: Tried to restore menu state, but element has no name: " .. f50_arg0:getFullID() )
return
end
local f50_local0 = false
local f50_local1 = 0
if LUI.savedMenuStates[f50_arg0.id] ~= nil then
f50_local0 = true
for f50_local5, f50_local6 in ipairs( LUI.savedMenuStates[f50_arg0.id] ) do
if f50_local6.id and f50_arg0:processEvent( {
name = "restore_focus",
id = f50_local6.id,
data = f50_local6.data,
isRefresh = f50_arg1
} ) then
f50_local1 = f50_local1 + 1
end
end
end
return f50_local0, f50_local1
end
LUI.UIElement.restoreFocus = function ( f51_arg0, f51_arg1 )
if f51_arg0.id == f51_arg1.id and f51_arg0:canFocus( FocusType.MenuFlow ) then
if not f51_arg1.isRefresh or f51_arg1.isRefresh and not f51_arg0._isRefresh then
f51_arg0:processEvent( {
name = "gain_focus",
focusType = FocusType.MenuFlow
} )
end
return true
else
return f51_arg0:dispatchEventToChildren( f51_arg1 )
end
end
if not LUI.UIElement.hasAnimationState then
LUI.UIElement.hasAnimationState = function ( f52_arg0, f52_arg1 )
if not f52_arg0.hasAnimationStateInC then
return f52_arg0.m_animationStates[f52_arg1]
else
return f52_arg0:hasAnimationStateInC( f52_arg1 )
end
end
end
LUI.UIElement.setClass = function ( f53_arg0, f53_arg1 )
local f53_local0 = getmetatable( f53_arg0 )
local f53_local1 = f53_local0.__newindex
local f53_local2 = getmetatable( f53_local1 )
if not f53_local2 then
setmetatable( f53_local1, {
__index = f53_arg1
} )
else
f53_local2.__index = f53_arg1
end
local f53_local3 = getmetatable( f53_local1.m_eventHandlers )
if not f53_local3 then
setmetatable( f53_local1.m_eventHandlers, {
__index = f53_arg1.m_eventHandlers
} )
else
f53_local3.__index = f53_arg1.m_eventHandlers
end
end
LUI.UIElement.m_eventHandlers = {
mousemove = LUI.UIElement.MouseMoveEvent,
mousedown = LUI.UIElement.MouseButtonEvent,
mouseup = LUI.UIElement.MouseButtonEvent,
gamepad_button = LUI.UIElement.GamepadButton,
gain_focus = LUI.UIElement.gainFocus,
lose_focus = LUI.UIElement.loseFocus,
restore_focus = LUI.UIElement.restoreFocus,
close = LUI.UIElement.close
}
LUI.UIElement.build = function ( f54_arg0, f54_arg1 )
return LUI.UIElement.new()
end
LUI.UIElement.new = function ( f55_arg0 )
local f55_local0 = ConstructLUIElement()
LUI.UIElement.setClass( f55_local0, LUI.UIElement )
f55_local0._scoped = LUI.ActiveScoped
f55_local0:setLayoutCached( false )
if not f55_arg0 then
f55_local0:registerAnimationState( "default", LUI.UIElement.m_defaultAnimationState )
else
f55_local0:registerAnimationState( "default", f55_arg0 )
end
f55_local0:animateToState( "default" )
return f55_local0
end

289
lui/luigrid.dec.lua Normal file
View File

@ -0,0 +1,289 @@
LUI.UIGrid = {}
LUI.UIGrid.build = function ( f1_arg0, f1_arg1 )
return LUI.UIGrid.new( nil, f1_arg1 )
end
LUI.UIGrid.new = function ( menu, controller )
local self = LUI.UIElement.new( menu )
self.id = "LUIGrid"
if not controller then
controller = {}
end
self.width = math.max( 1, controller.elementsPerRow or 5 )
self.rowHeight = controller.rowHeight or 80
self.disableHWrap = controller.disableHWrap or false
self.hSpacing = controller.hSpacing or 0
local f2_local1 = controller.hAlign
if not f2_local1 then
f2_local1 = LUI.Alignment.Left
end
self.hAlign = f2_local1
self.vlist = LUI.UIVerticalList.new( nil, controller.scrollByChildHeight, nil, controller.sendScrollEvents )
LUI.UIVerticalList.SetNoWrap( self.vlist, controller.disableVWrap )
f2_local1 = self.vlist
local f2_local2 = f2_local1
f2_local1 = f2_local1.registerAnimationState
local f2_local3 = "default"
local f2_local4 = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
spacing = controller.vSpacing or 0
}
local f2_local5 = controller.vAlign
if not f2_local5 then
f2_local5 = LUI.Alignment.Top
end
f2_local4.alignment = f2_local5
f2_local1( f2_local2, f2_local3, f2_local4 )
self.vlist:animateToState( "default" )
self:addElement( self.vlist )
if controller.sendScrollEvents then
self:registerEventHandler( "list_scroll", function ( element, event )
if not event.repeatCatch then
event.repeatCatch = true
local f3_local0 = element:getParent()
f3_local0:processEvent( event )
end
end )
end
self.addRow = LUI.UIGrid.AddRow
self.addElement = LUI.UIGrid.AddElement
self.removeElement = LUI.UIGrid.RemoveElement
self.shiftFirstElementFromNextRow = LUI.UIGrid.ShiftFirstElementFromNextRow
self.rowEmptinessCheck = LUI.UIGrid.RowEmptinessCheck
self.updateNavigation = LUI.UIGrid.UpdateNavigation
self.updateRowFocusability = LUI.UIGrid.UpdateRowFocusability
self.getChildById = LUI.UIGrid.GetChildById
self.getAllFocusedChildren = LUI.UIGrid.GetAllFocusedChildren
self.clearSavedState = LUI.UIGrid.ClearSavedState
self:registerEventHandler( "update_navigation", self.updateNavigation )
return self
end
LUI.UIGrid.GetAllFocusedChildren = function ( f4_arg0 )
local f4_local0 = {}
local f4_local1 = f4_arg0.vlist:getFirstChild()
while f4_local1 do
for f4_local5, f4_local6 in ipairs( f4_local1:getAllFocusedChildren() ) do
table.insert( f4_local0, f4_local6 )
end
f4_local1 = f4_local1:getNextSibling()
end
return f4_local0
end
LUI.UIGrid.ClearSavedState = function ( f5_arg0 )
LUI.UIElement.clearSavedState( f5_arg0 )
local f5_local0 = f5_arg0.vlist:getFirstChild()
while f5_local0 do
f5_local0.listDefaultFocus = nil
local f5_local1 = f5_local0:getFirstChild()
while f5_local1 do
f5_local1.listDefaultFocus = nil
f5_local1 = f5_local1:getNextSibling()
end
f5_local0 = f5_local0:getNextSibling()
end
end
LUI.UIGrid.GetChildById = function ( f6_arg0, f6_arg1 )
local f6_local0 = f6_arg0.vlist:getFirstChild()
while f6_local0 do
local f6_local1 = f6_local0:getChildById( f6_arg1 )
if f6_local1 then
return f6_local1
end
f6_local0 = f6_local0:getNextSibling()
end
end
LUI.UIGrid.AddRow = function ( f7_arg0 )
local f7_local0 = f7_arg0.vlist:getLastChild()
local f7_local1 = f7_arg0
local self = LUI.UIHorizontalList.new()
LUI.UIHorizontalList.SetNoWrap( self, f7_local1.disableHWrap )
self.id = "row_" .. f7_arg0.vlist:getNumChildren()
self.removeElement = function ( f8_arg0, f8_arg1 )
f7_local1:removeElement( f8_arg1 )
end
self:makeNotFocusable()
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = f7_arg0.rowHeight,
left = 0,
right = 0,
spacing = f7_arg0.hSpacing,
alignment = f7_arg0.hAlign
} )
self:registerEventHandler( "menu_refresh", function ( element, event )
f7_local1:processEvent( event )
end )
self:animateToState( "default" )
f7_arg0.vlist:addElement( self )
if f7_local0 then
LUI.UIHorizontalList.UpdateNavigation( f7_local0 )
end
local f7_local3 = f7_arg0.vlist:getFirstChild()
if f7_local3 then
LUI.UIHorizontalList.UpdateNavigation( f7_local3 )
end
end
LUI.UIGrid.AddElement = function ( f10_arg0, f10_arg1 )
local f10_local0 = f10_arg0
local f10_local1 = f10_local0.vlist:getLastChild()
local f10_local2
if f10_local1 ~= nil and f10_arg0.width > f10_local1:getNumChildren() then
f10_local2 = false
else
f10_local2 = true
end
if f10_local2 then
f10_arg0:addRow()
end
f10_local1 = f10_local0.vlist:getLastChild()
f10_local1:addElement( f10_arg1 )
if f10_arg1.listDefaultFocus then
f10_local1.listDefaultFocus = true
end
f10_arg0:updateNavigation()
local f10_local3 = function ( f11_arg0, f11_arg1 )
local f11_local0 = 1
local f11_local1 = f11_arg0:getParent()
f11_local1 = f11_local1:getFirstChild()
while f11_local1 do
if f11_local1 == f11_arg0 then
break
end
f11_local0 = f11_local0 + 1
f11_local1 = f11_local1:getNextSibling()
end
local f11_local2 = {
name = "grid_navigation_update",
column = f11_local0
}
f10_local0:clearSavedState()
f10_local0:processEvent( f11_local2 )
local f11_local3 = f11_arg0:getParent()
f11_local3:setFocus( true )
end
if not f10_arg1.hasGridHandlers then
f10_arg1.hasGridHandlers = true
f10_arg1:addEventHandler( "element_refresh", function ( f12_arg0, f12_arg1 )
if f12_arg0:isInFocus() then
f10_local3( f12_arg0, f12_arg1 )
end
end )
f10_arg1:addEventHandler( "button_over", f10_local3 )
f10_arg1:addEventHandler( "button_over_disable", f10_local3 )
end
f10_arg1:registerEventHandler( "grid_navigation_update", function ( element, event )
local f13_local0 = 1
local f13_local1 = element:getParent()
local f13_local2 = f13_local1:getFirstChild()
while f13_local2 do
if f13_local2 == element then
break
end
f13_local0 = f13_local0 + 1
f13_local2 = f13_local2:getNextSibling()
end
f13_local1:setFocus( false )
local f13_local3 = event.column == f13_local0
local f13_local4 = false
local f13_local5 = true
local f13_local6 = 0
local f13_local7 = f13_local1:getFirstChild()
while f13_local7 do
if f13_local7.m_focusable then
f13_local6 = f13_local6 + 1
f13_local5 = f13_local7 == element
f13_local4 = f13_local6 < event.column
end
f13_local7 = f13_local7:getNextSibling()
end
element.listDefaultFocus = f13_local4 and (f13_local3 or f13_local5)
end )
end
LUI.UIGrid.RemoveElement = function ( f14_arg0, f14_arg1 )
local f14_local0 = nil
local f14_local1 = f14_arg0.vlist:getFirstChild()
while f14_local1 do
if f14_arg1:getParent() == f14_local1 then
LUI.UIHorizontalList.RemoveElement( f14_local1, f14_arg1 )
f14_arg0:shiftFirstElementFromNextRow( f14_local1 )
f14_arg0:rowEmptinessCheck( f14_local1, f14_local0 )
break
end
f14_local0 = f14_local1
f14_local1 = f14_local1:getNextSibling()
end
f14_arg0:updateNavigation()
end
LUI.UIGrid.UpdateNavigation = function ( f15_arg0, f15_arg1 )
local f15_local0 = f15_arg0.vlist:getFirstChild()
while f15_local0 do
f15_arg0:updateRowFocusability( f15_local0 )
f15_local0 = f15_local0:getNextSibling()
end
LUI.UIVerticalList.UpdateNavigation( f15_arg0.vlist )
f15_local0 = f15_arg0.vlist:getFirstChild()
while f15_local0 do
LUI.UIHorizontalList.UpdateNavigation( f15_local0 )
f15_local0 = f15_local0:getNextSibling()
end
end
LUI.UIGrid.UpdateRowFocusability = function ( f16_arg0, f16_arg1 )
local f16_local0 = f16_arg1:canFocus()
local f16_local1 = false
local f16_local2 = f16_arg1:getFirstChild()
while f16_local2 do
if f16_local2:canFocus() then
f16_local1 = true
break
end
f16_local2 = f16_local2:getNextSibling()
end
if f16_local1 ~= f16_local0 then
if f16_local1 then
f16_arg1:makeFocusable()
else
f16_arg1:makeNotFocusable()
end
end
end
LUI.UIGrid.RowEmptinessCheck = function ( f17_arg0, f17_arg1, f17_arg2 )
if f17_arg1:getNumChildren() == 0 then
f17_arg0.vlist:removeElement( f17_arg1 )
end
end
LUI.UIGrid.ShiftFirstElementFromNextRow = function ( f18_arg0, f18_arg1 )
local f18_local0 = f18_arg1:getNextSibling()
if f18_local0 then
local f18_local1 = f18_local0:getFirstChild()
if f18_local1 then
LUI.UIHorizontalList.RemoveElement( f18_local0, f18_local1 )
f18_arg0:rowEmptinessCheck( f18_local0, f18_arg1 )
f18_arg1:addElement( f18_local1 )
f18_arg0:shiftFirstElementFromNextRow( f18_local0 )
end
end
end

View File

@ -0,0 +1,144 @@
LUI.UIHorizontalList = {}
LUI.UIHorizontalNavigator = {}
local f0_local0 = function ( f1_arg0, f1_arg1, f1_arg2 )
local self = LUI.UIElement.new( {
leftAnchor = true,
rightAnchor = false,
left = 0,
right = f1_arg1,
topAnchor = true,
bottomAnchor = true,
top = 0,
bottom = 0
} )
self:setPriority( f1_arg2 )
f1_arg0:addElement( self )
return self
end
LUI.UIHorizontalList.build = function ( menu, controller )
local self = LUI.UIHorizontalList.new( {} )
LUI.UIHorizontalList.SetNoWrap( self, controller.noWrap )
return self
end
LUI.UIHorizontalList.new = function ( f3_arg0 )
local self = LUI.UIElement.new( f3_arg0 )
self.id = "LUIHorizontalList"
self:setupUIHorizontalList()
self.addSpacer = f0_local0
self.addElement = LUI.UIHorizontalList.AddElement
self.removeElement = LUI.UIHorizontalList.RemoveElement
self.updateNavigation = LUI.UIHorizontalList.UpdateNavigation
self:registerEventHandler( "gain_focus", LUI.UIHorizontalList.gainFocus )
self:registerEventHandler( "update_navigation", function ( element, event )
element:updateNavigation()
end )
return self
end
LUI.UIHorizontalNavigator.build = function ( menu, controller )
local self = LUI.UIHorizontalNavigator.new( {}, controller.noWrap )
LUI.UIHorizontalList.SetNoWrap( self, controller.noWrap )
return self
end
LUI.UIHorizontalNavigator.new = function ( f6_arg0 )
local self = LUI.UIElement.new( f6_arg0 )
self.id = "LUIHorizontalList"
self.addSpacer = f0_local0
self.addElement = LUI.UIHorizontalList.AddElement
self.removeElement = LUI.UIHorizontalList.RemoveElement
self.updateNavigation = LUI.UIHorizontalList.UpdateNavigation
self:registerEventHandler( "gain_focus", LUI.UIHorizontalList.gainFocus )
self:registerEventHandler( "update_navigation", function ( element, event )
element:updateNavigation()
end )
return self
end
LUI.UIHorizontalList.SetNoWrap = function ( f8_arg0, f8_arg1 )
f8_arg0.noWrap = f8_arg1
end
LUI.UIHorizontalList.AddElement = function ( f9_arg0, f9_arg1 )
LUI.UIElement.addElement( f9_arg0, f9_arg1 )
f9_arg1.navigation = {}
f9_arg0:setLayoutCached( false )
f9_arg0:updateNavigation()
end
LUI.UIHorizontalList.RemoveElement = function ( f10_arg0, f10_arg1 )
LUI.UIElement.removeElement( f10_arg0, f10_arg1 )
f10_arg0:setLayoutCached( false )
f10_arg0:updateNavigation()
end
LUI.UIHorizontalList.UpdateNavigation = function ( f11_arg0 )
local f11_local0, f11_local1 = nil
local f11_local2 = f11_arg0:getFirstChild()
while f11_local2 ~= nil do
if f11_local2:canFocus( FocusType.ListSelection ) then
if f11_local0 == nil then
f11_local0 = f11_local2
end
if f11_local1 ~= nil then
f11_local1.navigation.right = f11_local2
f11_local2.navigation.left = f11_local1
else
f11_local2.navigation.left = nil
end
if f11_local2.navigation ~= nil and f11_arg0.navigation ~= nil then
f11_local2.navigation.down = f11_arg0.navigation.down
f11_local2.navigation.up = f11_arg0.navigation.up
end
f11_local1 = f11_local2
end
f11_local2 = f11_local2:getNextSibling()
end
if f11_local1 ~= nil then
if f11_arg0.navigation ~= nil and f11_arg0.navigation.right ~= nil and f11_arg0.navigation.right:canFocus( FocusType.ListSelection ) == true then
f11_local1.navigation.right = f11_arg0.navigation.right
f11_arg0.navigation.right.navigation.left = f11_local1
elseif f11_local1 ~= f11_local0 and not f11_arg0.noWrap then
f11_local1.navigation.right = f11_local0
else
f11_local1.navigation.right = nil
end
if f11_arg0.navigation ~= nil and f11_arg0.navigation.left ~= nil and f11_arg0.navigation.left:canFocus( FocusType.ListSelection ) == true then
f11_local0.navigation.left = f11_arg0.navigation.left
f11_arg0.navigation.left.navigation.right = f11_local0
elseif f11_local1 ~= f11_local0 and not f11_arg0.noWrap then
f11_local0.navigation.left = f11_local1
else
f11_local0.navigation.left = nil
end
end
end
LUI.UIHorizontalList.gainFocus = function ( f12_arg0, f12_arg1 )
local f12_local0, f12_local1 = f12_arg0:restoreState()
if f12_local1 == 0 then
local f12_local2, f12_local3 = nil
local f12_local4 = f12_arg0:getFirstChild()
while f12_local4 ~= nil do
if f12_local4:canFocus( FocusType.ListSelection ) then
if f12_local2 == nil then
f12_local2 = f12_local4
end
if f12_local3 == nil and f12_local4.listDefaultFocus then
f12_local3 = f12_local4
end
end
end
if f12_local3 ~= nil then
f12_local3:processEvent( f12_arg1 )
elseif f12_local2 ~= nil then
f12_local2:processEvent( f12_arg1 )
else
end
f12_local4 = f12_local4:getNextSibling()
end
end

13
lui/luiimage.dec.lua Normal file
View File

@ -0,0 +1,13 @@
LUI.UIImage = InheritFrom( LUI.UIElement )
LUI.UIImage.build = function ( f1_arg0, f1_arg1 )
return LUI.UIImage.new()
end
LUI.UIImage.new = function ( f2_arg0 )
local self = LUI.UIElement.new( f2_arg0 )
self:setClass( LUI.UIImage )
self:setupUIImage()
return self
end
LUI.UIImage.id = "LUIImage"

13
lui/luilitimage.dec.lua Normal file
View File

@ -0,0 +1,13 @@
LUI.UILitImage = InheritFrom( LUI.UIElement )
LUI.UILitImage.build = function ( f1_arg0, f1_arg1 )
return LUI.UILitImage.new()
end
LUI.UILitImage.new = function ( f2_arg0 )
local self = LUI.UIElement.new( f2_arg0 )
self:setClass( LUI.UILitImage )
self:setupUILitImage()
return self
end
LUI.UILitImage.id = "LUILitImage"

View File

@ -0,0 +1,25 @@
LUI.UILongCountdown = InheritFrom( LUI.UIElement )
LUI.UILongCountdown.build = function ( f1_arg0, f1_arg1 )
return LUI.UILongCountdown.new( f1_arg1.end_time )
end
LUI.UILongCountdown.new = function ( f2_arg0 )
local self = LUI.UIElement.new()
if LUI.UIElement.setupUILongCountdown ~= nil then
self:setupUILongCountdown( f2_arg0 )
end
self:setClass( LUI.UILongCountdown )
self.setEndTime = LUI.UILongCountdown.setEndTime
if f2_arg0 then
self:setEndTime( f2_arg0 )
end
return self
end
LUI.UILongCountdown.setEndTime = function ( f3_arg0, f3_arg1 )
if LUI.UIElement.setEndTimeInC ~= nil then
f3_arg0:setEndTimeInC( f3_arg1 )
end
end
LUI.UILongCountdown.id = "LUICountdown"

284
lui/luimarqueetext.dec.lua Normal file
View File

@ -0,0 +1,284 @@
LUI.UIMarqueeText = InheritFrom( LUI.UIElement )
LUI.UIMarqueeText.build = function ( f1_arg0, f1_arg1 )
if not f1_arg1 then
f1_arg1 = {}
end
local self = LUI.UIMarqueeText.new( f1_arg1.defaultAnimationState )
if f1_arg1.textHeight then
LUI.UIMarqueeText.SetTextHeight( self, f1_arg1.textHeight )
end
if f1_arg1.useTextWrapping then
LUI.UIMarqueeText.SetUseTextWrapping( self, f1_arg1.useTextWrapping )
end
if f1_arg1.scrollSpeed then
LUI.UIMarqueeText.SetSpeed( self, f1_arg1.scrollSpeed )
end
return self
end
LUI.UIMarqueeText.SetColor = function ( f2_arg0, f2_arg1, f2_arg2, f2_arg3 )
f2_arg0:registerAnimationState( "default", {
red = f2_arg1,
green = f2_arg2,
blue = f2_arg3,
alpha = 1
} )
f2_arg0:animateToState( "default" )
LUI.UIMarqueeText.RestartScroll( f2_arg0 )
end
LUI.UIMarqueeText.new = function ( f3_arg0 )
local self = LUI.UIElement.new( f3_arg0 )
self:setClass( LUI.UIMarqueeText )
self:setUseStencil( true )
local f3_local1 = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
local f3_local2
if f3_arg0 then
f3_local2 = f3_arg0.font
if not f3_local2 then
else
f3_local1.font = f3_local2
f3_local1.red = 1
f3_local1.green = 1
f3_local1.blue = 1
f3_local1.alpha = 1
f3_local2 = LUI.UIText.new( f3_local1 )
self.text = f3_local2
self:addElement( f3_local2 )
self.text:registerAnimationState( "default", f3_local1 )
self.text:animateToState( "default" )
self.text:registerAnimationState( "start", f3_local1 )
self.text:registerAnimationState( "alphaOut", {
alpha = 0
} )
self.text:registerEventHandler( "transition_complete_start", LUI.UIMarqueeText.HandleStartScroll )
self.text:animateToState( "start", 1 )
self.text.scrollSpeed = 90
return self
end
end
f3_local2 = CoD.TextSettings.NormalFont.Font
end
LUI.UIMarqueeText.RestartScroll = function ( f4_arg0 )
f4_arg0.text:animateToState( "start", 1 )
end
LUI.UIMarqueeText.SetUseTextWrapping = function ( f5_arg0, f5_arg1 )
f5_arg0.text.useTextWrapping = f5_arg1
LUI.UIMarqueeText.RestartScroll( f5_arg0 )
end
LUI.UIMarqueeText.SetTextHeight = function ( f6_arg0, f6_arg1 )
local f6_local0 = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = f6_arg1,
left = 0,
right = 0
}
f6_arg0.text.textHeight = f6_arg1
f6_arg0.text:registerAnimationState( "default", f6_local0 )
f6_arg0.text:registerAnimationState( "start", f6_local0 )
LUI.UIMarqueeText.RestartScroll( f6_arg0 )
end
LUI.UIMarqueeText.SetSpeed = function ( f7_arg0, f7_arg1 )
f7_arg0.text.scrollSpeed = f7_arg1
end
LUI.UIMarqueeText.HandleStartScroll = function ( f8_arg0 )
local f8_local0 = f8_arg0:getParent()
local f8_local1, f8_local2, f8_local3, f8_local4 = f8_local0:getCurrentGlobalRect()
local f8_local5 = f8_arg0:getCurrentGlobalRect()
local f8_local6 = f8_local0:getCurrentAlignment()
local f8_local7 = LUI.Alignment.None
if f8_arg0.useTextWrapping then
if f8_local6 == LUI.Alignment.None then
local f8_local8 = LUI.Alignment.Left
end
f8_local7 = f8_local8 or f8_local6
end
f8_arg0:registerAnimationState( "setup", {
alignment = f8_local7
} )
f8_arg0:animateToState( "setup" )
if f8_local1 and f8_local5 then
local f8_local9, f8_local10 = f8_arg0:getElementTextDims()
local f8_local11 = f8_local0:getCurrentFont()
local f8_local12, f8_local13, f8_local14, f8_local15 = f8_local0:getCurrentRGBA()
local f8_local16 = nil
local f8_local17 = false
local f8_local18 = {
red = f8_local12,
green = f8_local13,
blue = f8_local14,
alpha = f8_local15
}
local f8_local19 = 0.01
if f8_local3 - f8_local1 + f8_local19 < f8_local9 and not f8_arg0.textHeight then
f8_local16 = (f8_local9 - f8_local3 - f8_local1) / f8_arg0.scrollSpeed * 1000
f8_local17 = true
f8_local18.alignment = LUI.Alignment.None
f8_arg0:registerAnimationState( "alphaIn", f8_local18 )
f8_arg0:registerAnimationState( "one", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = f8_local10,
left = 0,
right = f8_local9,
font = f8_local11
} )
f8_arg0:registerAnimationState( "two", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
top = 0,
bottom = f8_local10,
left = -f8_local9,
right = 0,
font = f8_local11
} )
local f8_local20 = MBh.AnimateLoop( {
{
"alphaIn",
0
},
{
"one",
0
},
{
"one",
500
},
{
"two",
f8_local16
},
{
"two",
500
},
{
"alphaOut",
250
},
{
"one",
0
},
{
"alphaIn",
250
}
} )
f8_local20( f8_arg0 )
elseif f8_local4 - f8_local2 + f8_local19 < f8_local10 and f8_arg0.textHeight then
local f8_local21 = f8_local10 - f8_local4 - f8_local2
local f8_local22 = f8_local10 / f8_arg0.textHeight
f8_local16 = f8_local21 / f8_arg0.scrollSpeed * 1000
f8_local17 = true
local f8_local20
if f8_local6 == LUI.Alignment.None then
f8_local20 = LUI.Alignment.Center
if not f8_local20 then
else
f8_local18.alignment = f8_local20
f8_arg0:registerAnimationState( "alphaIn", f8_local18 )
f8_local20 = {
{
"alphaOut",
0
},
{
"line_0",
0
},
{
"alphaIn",
250
}
}
for f8_local23 = 0, f8_local22 - math.floor( (f8_local4 - f8_local2) / f8_arg0.textHeight ), 1 do
local f8_local26 = "line_" .. f8_local23
f8_arg0:registerAnimationState( f8_local26, {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = -f8_local23 * f8_arg0.textHeight,
bottom = (1 - f8_local23) * f8_arg0.textHeight,
left = 0,
right = 0,
font = f8_local11
} )
table.insert( f8_local20, {
f8_local26,
f8_arg0.textHeight / f8_arg0.scrollSpeed * 1000,
true,
true
} )
table.insert( f8_local20, {
f8_local26,
2000
} )
end
table.insert( f8_local20, {
"alphaOut",
250
} )
table.insert( f8_local20, {
"line_0",
0
} )
local f8_local23 = MBh.AnimateLoop( f8_local20 )
f8_local23( f8_arg0 )
end
end
f8_local20 = f8_local6
end
if not f8_local17 then
f8_local18.alignment = f8_local6
f8_arg0:registerEventHandler( LUI.FormatAnimStateFinishEvent( "alphaIn" ), nil )
f8_arg0:registerAnimationState( "alphaIn", f8_local18 )
f8_arg0:animateToState( "alphaIn", 0 )
end
else
f8_arg0:animateToState( "alphaOut" )
f8_arg0:animateToState( "start", 1 )
end
end
LUI.UIMarqueeText.setText = function ( f9_arg0, f9_arg1 )
f9_arg0.text:setTextInC( f9_arg1 )
if f9_arg0.text.currText ~= f9_arg1 then
LUI.UIMarqueeText.RestartScroll( f9_arg0 )
end
f9_arg0.text.currText = f9_arg1
end
LUI.UIMarqueeText.setTextStyle = function ( f10_arg0, f10_arg1 )
f10_arg0.text.m_textStyle = f10_arg1
end
LUI.UIMarqueeText.id = "LUIMarqueeText"
LUI.MenuBuilder.registerType( "UIMarqueeText", LUI.UIMarqueeText.build )

View File

@ -0,0 +1,59 @@
LUI.UIMouseCursor = {}
LUI.UIMouseCursor.priority = 1000
LUI.UIMouseCursor.mouseTimeout = 3000
LUI.UIMouseCursor.MouseActivity = function ( f1_arg0, f1_arg1 )
f1_arg0:applyElementTransform()
f1_arg0.id = "mouse_cursor"
local f1_local0, f1_local1 = ProjectRootCoordinate( f1_arg1.rootName, f1_arg1.x, f1_arg1.y )
if f1_local0 ~= nil and f1_local1 ~= nil then
f1_local0, f1_local1 = f1_arg1.root:pixelsToUnits( f1_local0, f1_local1 )
if f1_local0 ~= nil and f1_local1 ~= nil then
f1_arg0:registerAnimationState( "default", {
left = f1_local0 - 32,
right = f1_local0 + 32,
top = f1_local1 - 32,
bottom = f1_local1 + 32,
leftAnchor = true,
topAnchor = true,
rightAnchor = false,
bottomAnchor = false,
alpha = 1
} )
f1_arg0:animateToState( "default" )
end
end
f1_arg0:dispatchEventToChildren( f1_arg1 )
f1_arg0:undoElementTransform()
f1_arg0.lastMoveTime = Engine.GetMilliseconds()
end
LUI.UIMouseCursor.Hide = function ( f2_arg0, f2_arg1 )
f2_arg0:animateToState( "hidden", 400 )
end
LUI.UIMouseCursor.new = function ( f3_arg0 )
local self = LUI.UIImage.new( f3_arg0 )
self:registerAnimationState( "hidden", {
alpha = 0
} )
self:setPriority( LUI.UIMouseCursor.priority )
self.lastMoveTime = Engine.GetMilliseconds()
self.id = "mouse_cursor"
self.hide = LUI.UIMouseCursor.Hide
self:registerEventHandler( "mousemove", LUI.UIMouseCursor.MouseActivity )
self:registerEventHandler( "mousedown", LUI.UIMouseCursor.MouseActivity )
local f3_local1 = LUI.UITimer.new( 1000, {
name = "update_mouse"
}, nil, false, element, false )
f3_local1.id = "mouse_update_timer"
self:addElement( f3_local1 )
self:registerEventHandler( "update_mouse", function ( element, event )
if not CoD.UsingController() then
return
elseif Engine.GetMilliseconds() - element.lastMoveTime > LUI.UIMouseCursor.mouseTimeout then
element:hide()
end
end )
return self
end

View File

@ -0,0 +1,22 @@
LUI.UIPrettyNumber = {}
LUI.UIPrettyNumber.new = function ( f1_arg0, f1_arg1 )
assert( f1_arg1 )
assert( type( f1_arg1.speed ) == "number" )
assert( type( f1_arg1.initialValue ) == "number" )
local self = assert
local f1_local1
if f1_arg1.precision and type( f1_arg1.precision ) ~= "number" then
f1_local1 = false
else
f1_local1 = true
end
self( f1_local1 )
f1_arg1.precision = f1_arg1.precision or 1
self = LUI.UIText.new( f1_arg0 )
self.id = "UIPrettyNumber"
if self.setupPrettyNumber then
self:setupPrettyNumber( f1_arg1.speed, f1_arg1.initialValue, f1_arg1.precision )
end
return self
end

478
lui/luiroot.dec.lua Normal file
View File

@ -0,0 +1,478 @@
require( "LUI.CodeDependence" )
if not Engine.InFrontend() then
require( "LUI.GameX" )
end
require( "LUI.FlowManager" )
require( "LUI.HudManager" )
require( "LUI.EventCatcher" )
if Engine.HasSpeechFeature() then
require( "LUI.MenuAutoNav" )
require( "LUI.Speech" )
require( "LUI.common_menus.KinectUtils" )
end
LUI.UIRoot = {}
LUI.UIRoot.childPriorities = {
menuRoot = 10,
default = 0,
MLGHud = -4,
hudElems = -5,
roundEndScreen = -7,
finalScoresScreen = -7,
hudContainer = -10
}
function LUI_UIRoot_HandleSpeechWhatCanISay( f1_arg0, f1_arg1, f1_arg2 )
if Engine.HasSpeechFeature() and Kinect.CanOpenWhatCanISayMenu() == true then
Kinect.OpenWhatCanISayMenu( f1_arg1.controler )
LUI.Speech.PerformingSpeechAction()
end
end
function LUI_UIRoot_HandleSpeechPause( f2_arg0, f2_arg1, f2_arg2 )
if Engine.HasSpeechFeature() then
local f2_local0 = false
if not Engine.InFrontend() and not Engine.IsMultiplayer() and Engine.GetDvarInt( "cl_paused" ) == 0 then
local f2_local1 = Engine.GetLuiRoot()
if f2_local1 then
Engine.TogglePause()
f2_local1.is_paused = true
f2_local1:processEvent( {
name = "hud_refresh"
} )
f2_local1:dispatchEventToRoot( {
name = "toggle_pause"
} )
f2_local0 = true
end
end
if f2_local0 == false then
LUI.Speech.SquelchSpeechAction()
else
LUI.Speech.PerformingSpeechAction()
end
end
end
function LUI_UIRoot_HandleSpeechChangeView( f3_arg0, f3_arg1, f3_arg2 )
if Engine.HasSpeechFeature() and Engine.SpeechEmitKeyPressAndRelease then
DebugPrint( "Kinect: Issuing a GPAD_BACK button press in response to VIEW voice command." )
Engine.SpeechEmitKeyPressAndRelease( "GPAD_BACK", f3_arg1.controller )
end
end
function LUI_UIRoot_HandleSpeechShowMenu( f4_arg0, f4_arg1, f4_arg2 )
if Engine.HasSpeechFeature() and Engine.SpeechEmitKeyPressAndRelease then
DebugPrint( "Kinect: Issuing a GPAD_START button press in response to MENU voice command." )
Engine.SpeechEmitKeyPressAndRelease( "GPAD_START", f4_arg1.controller )
end
end
function LUI_UIRoot_HandleSpeechBack( f5_arg0, f5_arg1, f5_arg2 )
if Engine.HasSpeechFeature() and Engine.GetLuiInUse() and Engine.SpeechEmitKeyPressAndRelease then
DebugPrint( "Kinect: Issuing a GPAD_B button press in response to XBOX GO BACK voice command." )
Engine.SpeechEmitKeyPressAndRelease( "GPAD_B", f5_arg1.controller )
end
end
function LUI_UIRoot_HandleSpeechShortcuts( f6_arg0, f6_arg1, f6_arg2 )
if Engine.HasSpeechFeature() and Kinect.CanOpenKinectGuide() == true then
Kinect.OpenKinectGuide( f6_arg1.controler )
LUI.Speech.PerformingSpeechAction()
end
end
if Engine.HasSpeechFeature() then
luiRootSpeechGrammarFrontEndHandlersArray = {
{
action = "what can i say",
confidence = LUI.Speech.whatCanISayConfidence,
handler = LUI_UIRoot_HandleSpeechWhatCanISay,
extradata = nil
},
{
action = "pause",
confidence = LUI.Speech.pauseConfidence,
handler = LUI_UIRoot_HandleSpeechPause,
extradata = nil
},
{
action = "show view",
confidence = LUI.Speech.changeViewConfidence,
handler = LUI_UIRoot_HandleSpeechChangeView,
extradata = nil
},
{
action = "view",
confidence = LUI.Speech.changeViewConfidence,
handler = LUI_UIRoot_HandleSpeechChangeView,
extradata = nil
},
{
action = "show menu",
confidence = LUI.Speech.showMenuConfidence,
handler = LUI_UIRoot_HandleSpeechShowMenu,
extradata = nil
},
{
action = "menu",
confidence = LUI.Speech.showMenuConfidence,
handler = LUI_UIRoot_HandleSpeechShowMenu,
extradata = nil
},
{
action = "shortcuts",
confidence = LUI.Speech.defaultConfidence,
handler = LUI_UIRoot_HandleSpeechShortcuts,
extradata = nil
},
{
action = "xbox pause",
confidence = LUI.Speech.pauseConfidence,
handler = LUI_UIRoot_HandleSpeechPause,
extradata = nil
},
{
action = "xbox view",
confidence = LUI.Speech.changeViewConfidence,
handler = LUI_UIRoot_HandleSpeechChangeView,
extradata = nil
},
{
action = "xbox menu",
confidence = LUI.Speech.showMenuConfidence,
handler = LUI_UIRoot_HandleSpeechShowMenu,
extradata = nil
},
{
action = "xbox back",
confidence = LUI.Speech.goBackConfidence,
handler = LUI_UIRoot_HandleSpeechBack,
extradata = nil
}
}
luiRootSpeechGrammarInGameHandlersArray = {
{
action = "what can i say",
confidence = LUI.Speech.whatCanISayConfidence,
handler = LUI_UIRoot_HandleSpeechWhatCanISay,
extradata = nil
},
{
action = "pause",
confidence = LUI.Speech.pauseConfidence,
handler = LUI_UIRoot_HandleSpeechPause,
extradata = nil
},
{
action = "show view",
confidence = LUI.Speech.changeViewConfidence,
handler = LUI_UIRoot_HandleSpeechChangeView,
extradata = nil
},
{
action = "view",
confidence = LUI.Speech.changeViewConfidence,
handler = LUI_UIRoot_HandleSpeechChangeView,
extradata = nil
},
{
action = "show menu",
confidence = LUI.Speech.showMenuConfidence,
handler = LUI_UIRoot_HandleSpeechShowMenu,
extradata = nil
},
{
action = "menu",
confidence = LUI.Speech.showMenuConfidence,
handler = LUI_UIRoot_HandleSpeechShowMenu,
extradata = nil
},
{
action = "xbox pause",
confidence = LUI.Speech.pauseConfidence,
handler = LUI_UIRoot_HandleSpeechPause,
extradata = nil
},
{
action = "xbox view",
confidence = LUI.Speech.changeViewConfidence,
handler = LUI_UIRoot_HandleSpeechChangeView,
extradata = nil
},
{
action = "xbox menu",
confidence = LUI.Speech.showMenuConfidence,
handler = LUI_UIRoot_HandleSpeechShowMenu,
extradata = nil
},
{
action = "xbox back",
confidence = LUI.Speech.goBackConfidence,
handler = LUI_UIRoot_HandleSpeechBack,
extradata = nil
}
}
else
luiRootSpeechGrammarFrontEndHandlersArray = {}
luiRootSpeechGrammarInGameHandlersArray = {}
end
function LUI_UIRoot_SpeechRestart( f7_arg0, f7_arg1 )
if Engine.HasSpeechFeature() then
LUI.Speech.CancelSpeechFailTimer()
Kinect.RestartGlobalGrammars()
end
end
function LUI_UIRoot_SpeechHandler( f8_arg0, f8_arg1 )
if Engine.HasSpeechFeature() then
LUI.Speech.LaunchSpeechFailTimer()
if Engine.InFrontend() then
LUI.Speech.ProcessActionEvent( f8_arg0, f8_arg1, luiRootSpeechGrammarFrontEndHandlersArray )
else
LUI.Speech.ProcessActionEvent( f8_arg0, f8_arg1, luiRootSpeechGrammarInGameHandlersArray )
end
end
end
function LUI_UIRoot_SpeechFailTimerHandler( f9_arg0, f9_arg1 )
if Engine.HasSpeechFeature() then
if LUI.Speech.waitingForOutstandingCommandConfirmation == true then
LUI.Speech.waitingForOutstandingCommandConfirmation = false
LUI.Speech.PlayBadSound()
end
LUI.Speech.CancelSpeechFailTimer()
end
end
local f0_local0 = function ( f10_arg0, f10_arg1 )
f10_arg0:registerAnimationState( "default", {
left = -f10_arg1.width / 2,
top = -f10_arg1.height / 2,
right = f10_arg1.width / 2,
bottom = f10_arg1.height / 2,
leftAnchor = false,
topAnchor = false,
rightAnchor = false,
bottomAnchor = false
} )
f10_arg0:animateToState( "default" )
end
local f0_local1 = function ( f11_arg0, f11_arg1 )
f11_arg1.root = f11_arg0
f11_arg0:dispatchEventToChildren( f11_arg1 )
end
local f0_local2 = function ( f12_arg0, f12_arg1 )
local f12_local0 = f12_arg0.m_currentAnimationState
local f12_local1 = f12_local0.unitsToPixels
return f12_local0.left + f12_arg1.left * f12_local1, f12_local0.top + f12_arg1.top * f12_local1, f12_local0.left + f12_arg1.right * f12_local1, f12_local0.top + f12_arg1.bottom * f12_local1
end
local f0_local3 = function ( f13_arg0, f13_arg1, f13_arg2 )
local f13_local0 = f13_arg0.m_currentAnimationState
local f13_local1 = f13_local0.unitsToPixels
local f13_local2 = f13_local0.left
local f13_local3 = f13_local0.top
f13_arg2:setRectInC( f13_local2 + f13_arg1.left * f13_local1, f13_local3 + f13_arg1.top * f13_local1, f13_local2 + f13_arg1.right * f13_local1, f13_local3 + f13_arg1.bottom * f13_local1 )
end
local f0_local4 = function ( f14_arg0, f14_arg1 )
return f14_arg1 * f14_arg0.m_currentAnimationState.unitsToPixels
end
local f0_local5 = function ( f15_arg0, f15_arg1, f15_arg2 )
return f15_arg0:RootPixelsToUnits( f15_arg1, f15_arg2 )
end
LUI.UIRoot.DebugPrint_IgnoreEventsSetup = function ( f16_arg0 )
f16_arg0.debugPrintIgnoreEvents = {
process_events = true,
gamepad_sticks = true,
mousemove = true
}
end
local f0_local6 = function ( f17_arg0, f17_arg1 )
InitPlayerData( f17_arg0, f17_arg1 )
end
local f0_local7 = function ( f18_arg0, f18_arg1 )
InitPlayerDataExtended( f18_arg0, f18_arg1 )
end
local f0_local8 = function ( f19_arg0, f19_arg1 )
end
function LUI_UIRoot_TryOpenMOTD( f20_arg0, f20_arg1 )
TryForceOpenMOTD()
end
function LUI_UIRoot_OnValidatePlayerData( f21_arg0, f21_arg1 )
local f21_local0 = f21_arg1.controller
if f21_local0 then
ValidateOperations( f21_local0 )
end
end
LUI.UIRoot.new = function ( f22_arg0 )
local self = LUI.UIElement.new( {
left = 0,
top = 0,
right = 0,
bottom = 0,
leftAnchor = false,
topAnchor = false,
rightAnchor = false,
bottomAnchor = false
} )
self.id = "LUIRoot"
self.isaroot = true
self.unitsToPixelsRect = f0_local2
self.pixelsToUnits = f0_local5
self.unitsToPixels = f0_local4
self.setDimensionsForElement = f0_local3
self:registerEventHandler( "resize", f0_local0 )
self:registerEventHandler( "mousemove", f0_local1 )
self:registerEventHandler( "mousedown", f0_local1 )
self:registerEventHandler( "mouseup", f0_local1 )
self:registerEventHandler( "process_events", LUI.UIRoot.ProcessEvents )
if Engine.HasSpeechFeature() then
self:registerEventHandler( "menu_auto_nav_timer", LUI.MenuAutoNav.HandleTimerEvent )
self:registerEventHandler( "speech_grammar_changed", LUI_UIRoot_SpeechRestart )
self:registerEventHandler( "speech_action", LUI_UIRoot_SpeechHandler )
self:registerEventHandler( "speech_fail_timer", LUI_UIRoot_SpeechFailTimerHandler )
end
if Engine.IsMultiplayer() then
self:registerEventHandler( "init_player_data", f0_local6 )
self:registerEventHandler( "init_player_data_extended", f0_local7 )
self:registerEventHandler( "get_next_round_of_operations", f0_local8 )
self:registerEventHandler( "open_motd", LUI_UIRoot_TryOpenMOTD )
self:registerEventHandler( "validate_player_data", LUI_UIRoot_OnValidatePlayerData )
end
LUI.roots[f22_arg0] = self
if LUI.primaryRoot == nil then
LUI.primaryRoot = self
end
self.flowManager = LUI.FlowManager.new()
self.flowManager:setupRoot( self )
if not Engine.InFrontend() then
self.hudManager = LUI.HudManager.new()
self.hudManager:setupRoot( self )
end
self.eventCatcher = LUI.EventCatcher.new()
self.eventCatcher:setupRoot( self )
self.timerGroupQueues = {}
self.name = f22_arg0
self.eventQueue = {}
self.debugEvents = true
LUI.UIRoot.DebugPrint_IgnoreEventsSetup( self )
self.processEvent = LUI.UIRoot.ProcessEvent
self.SaveMenuStack = self.flowManager.SaveMenuStack
self.RestoreMenuStack = self.flowManager.RestoreMenuStack
self.AnyActiveMenusInStack = self.flowManager.AnyActiveMenusInStack
self.IsMenuOpenAndVisible = self.flowManager.IsMenuOpenAndVisible
self.IsMenuInStack = self.flowManager.IsMenuInStack
self.IsMenuTopmost = self.flowManager.IsMenuTopmost
self.IsTopSignInMenu = self.flowManager.IsTopSignInMenu
self.GetFirstButtonActionInFocusId = LUI.UIRoot.GetFirstButtonActionInFocusId
if Engine.HasSpeechFeature() then
Kinect.EnableGlobalGrammars()
end
return self
end
LUI.UIRoot.GetFirstButtonActionInFocus = function ( f23_arg0 )
if f23_arg0:isInFocus() and f23_arg0.m_eventHandlers.button_action then
return f23_arg0
end
local f23_local0 = f23_arg0:getFirstChild()
while f23_local0 do
local f23_local1 = LUI.UIRoot.GetFirstButtonActionInFocus( f23_local0 )
if f23_local1 then
return f23_local1
end
f23_local0 = f23_local0:getNextSibling()
end
end
LUI.UIRoot.GetFirstButtonActionInFocusId = function ( f24_arg0 )
local f24_local0 = LUI.UIRoot.GetFirstButtonActionInFocus( f24_arg0 )
return f24_local0.id
end
LUI.UIRoot.BlockButtonInput = function ( f25_arg0, f25_arg1, f25_arg2 )
if f25_arg1 then
f25_arg0.m_blockButtonInput = true
else
f25_arg0.m_blockButtonInput = false
end
end
LUI.UIRoot.IsButtonInputBlocked = function ( f26_arg0 )
return f26_arg0.m_blockButtonInput
end
LUI.UIRoot.ProcessEvent = function ( f27_arg0, f27_arg1 )
if f27_arg1.immediate == true then
local f27_local0 = profile.beginuserevent( "IE_" .. f27_arg1.name )
LUI.UIRoot.ProcessEventNow( f27_arg0, f27_arg1 )
profile.enduserevent( f27_local0 )
else
local f27_local0 = f27_arg0.eventQueue
table.insert( f27_local0, f27_arg1 )
if #f27_local0 > 20 then
DebugPrint( "LUI WARNING: Event queue exceeded 20 events! " .. f27_arg1.name )
if f27_arg1.name == "omnvar_update" then
DebugPrint( "LUI WARNING: omnvar = " .. f27_arg1.omnvar )
end
end
end
end
LUI.UIRoot.ProcessEvents = function ( f28_arg0, f28_arg1 )
LUI.UITimer.DispatchEventsFromQueue( f28_arg0 )
local f28_local0 = f28_arg0.eventQueue
local f28_local1 = f28_local0[1]
if f28_local1 ~= nil then
table.remove( f28_local0, 1 )
local f28_local2 = profile.beginuserevent( "RE_" .. f28_local1.name )
LUI.UIRoot.ProcessEventNow( f28_arg0, f28_local1 )
profile.enduserevent( f28_local2 )
end
end
LUI.UIRoot.IsNavigationEvent = function ( f29_arg0 )
if not handled and f29_arg0.name == "gamepad_button" and f29_arg0.down and (f29_arg0.button == "up" or f29_arg0.button == "down" or f29_arg0.button == "left" or f29_arg0.button == "right") then
return true
else
return false
end
end
LUI.UIRoot.ProcessEventNow = function ( f30_arg0, f30_arg1 )
if not f30_arg0.debugPrintIgnoreEvents[f30_arg1.name] and Engine.GetDvarBool( "lui_print_events" ) then
DebugPrint( "Processed Event " .. f30_arg1.name )
if f30_arg1.name == "gamepad_button" then
DebugPrint( "button " .. f30_arg1.button )
end
if f30_arg1.name == "keybind" then
DebugPrint( "keybind " .. f30_arg1.command )
end
end
if f30_arg0.m_blockButtonInput and (f30_arg1.name == "gamepad_button" or f30_arg1.name == "mouseup") then
DebugPrint( "Blocking Button input for " .. f30_arg1.button .. " because m_ignoreButtonInput is true" )
return false
end
local f30_local0 = f30_arg0
if f30_arg1.target then
f30_local0 = f30_arg1.target
end
local f30_local1 = LUI.UIElement.processEvent( f30_local0, f30_arg1 )
if not f30_local1 and LUI.UIRoot.IsNavigationEvent( f30_arg1 ) then
f30_arg0.flowManager:CheckRestoreFocus()
end
return f30_local1
end

View File

@ -0,0 +1,75 @@
LUI.UISafeAreaOverlay = {}
LUI.UISafeAreaOverlay.new = function ()
local self = LUI.UIElement.new( {
left = 0,
top = 0,
right = 0,
bottom = 0,
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true
} )
self.leftBorder = LUI.UIImage.new( {
left = 0,
top = 36,
right = 48,
bottom = -36,
topAnchor = true,
leftAnchor = true,
rightAnchor = false,
bottomAnchor = true,
red = 0,
green = 0,
blue = 1,
alpha = 0.5
} )
self:addElement( self.leftBorder )
self.rightBorder = LUI.UIImage.new( {
left = -48,
top = 36,
right = 0,
bottom = -36,
topAnchor = true,
leftAnchor = false,
rightAnchor = true,
bottomAnchor = true,
red = 0,
green = 0,
blue = 1,
alpha = 0.5
} )
self:addElement( self.rightBorder )
self.topBorder = LUI.UIImage.new( {
left = 0,
top = 0,
right = 0,
bottom = 36,
topAnchor = true,
leftAnchor = true,
rightAnchor = true,
bottomAnchor = false,
red = 0,
green = 0,
blue = 1,
alpha = 0.5
} )
self:addElement( self.topBorder )
self.bottomBorder = LUI.UIImage.new( {
left = 0,
top = -36,
right = 0,
bottom = 0,
topAnchor = false,
leftAnchor = true,
rightAnchor = true,
bottomAnchor = true,
red = 0,
green = 0,
blue = 1,
alpha = 0.5
} )
self:addElement( self.bottomBorder )
return self
end

74
lui/luiscrollable.dec.lua Normal file
View File

@ -0,0 +1,74 @@
LUI.UIScrollable = {}
local f0_local0 = function ( f1_arg0, f1_arg1 )
f1_arg0.container:addElement( f1_arg1 )
end
local f0_local1 = function ( f2_arg0, f2_arg1, f2_arg2, f2_arg3, f2_arg4 )
f2_arg0.container:registerAnimationState( "scroll_target", {
left = f2_arg1,
right = f2_arg1 + f2_arg0.containerWidth,
leftAnchor = true
} )
f2_arg0.container:animateToState( "scroll_target", f2_arg2, f2_arg3, f2_arg4 )
end
local f0_local2 = function ( f3_arg0, f3_arg1, f3_arg2, f3_arg3, f3_arg4 )
local f3_local0 = f3_arg0:getHeight()
if f3_arg1 > 0 then
f3_arg1 = 0
elseif f3_arg1 < -f3_arg0.containerHeight + f3_local0 then
f3_arg1 = -f3_arg0.containerHeight + f3_local0
end
f3_arg0.container:registerAnimationState( "scroll_target", {
top = f3_arg1,
bottom = f3_arg1 + f3_arg0.containerHeight,
topAnchor = true,
bottomAnchor = false
} )
f3_arg0.container:animateToState( "scroll_target", f3_arg2, f3_arg3, f3_arg4 )
end
LUI.UIScrollable.new = function ( f4_arg0, f4_arg1, f4_arg2, f4_arg3 )
if f4_arg1 == nil or f4_arg2 == nil then
error( "Cannot create scrollable component without valid dimensions!" )
return
end
local self = LUI.UIElement.new( f4_arg0 )
self.id = "LUIScrollable"
self:setHandleMouse( true )
if f4_arg3 == true then
self.container = LUI.UIElement.new( {
left = -f4_arg1 / 2,
top = -f4_arg2 / 2,
right = f4_arg1 / 2,
bottom = f4_arg2 / 2,
leftAnchor = false,
topAnchor = false,
rightAnchor = false,
bottomAnchor = false,
zoom = 0
} )
else
self.container = LUI.UIElement.new( {
left = 0,
top = 0,
right = f4_arg1,
bottom = f4_arg2,
leftAnchor = true,
topAnchor = true,
rightAnchor = false,
bottomAnchor = false,
zoom = 0
} )
end
self.container.id = "LUIScrollable_Container"
self:setUseStencil( true )
self.containerWidth = f4_arg1
self.containerHeight = f4_arg2
self:addElement( self.container )
self.addElement = f0_local0
self.scrollX = f0_local1
self.scrollY = f0_local2
return self
end

View File

@ -0,0 +1,178 @@
LUI.UIScrollingVerticalList = {}
function RefreshScrollList( f1_arg0, f1_arg1 )
f1_arg0:closeChildren()
f1_arg0:clearSavedState()
f1_arg0:processEvent( {
name = "menu_refresh"
} )
end
function CreateArrowButton( f2_arg0, f2_arg1, f2_arg2, f2_arg3, f2_arg4, f2_arg5, f2_arg6, f2_arg7, f2_arg8 )
local self = LUI.UIButton.new( {
leftAnchor = false,
rightAnchor = true,
topAnchor = f2_arg3,
bottomAnchor = f2_arg5,
left = -90,
right = -75,
top = f2_arg2,
bottom = f2_arg4,
alpha = 1,
zRot = f2_arg6
} )
self.id = f2_arg0
self.m_requireFocusType = FocusType.MouseOver
self:registerAnimationState( "hidden", {
alpha = 0
} )
self:animateToState( "hidden" )
self:addEventHandler( "button_action", function ( f3_arg0, f3_arg1 )
f3_arg0:dispatchEventToRoot( {
name = f2_arg7,
dispatchChildren = true
} )
end )
self:addEventHandler( "list_scroll", f2_arg8 )
local f2_local1 = LUI.UIImage.new()
f2_local1.id = f2_arg0 .. "_image"
f2_local1:registerAnimationState( "default", {
material = RegisterMaterial( "widg_lobby_arrow" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = Engine.IsAliensMode() and Colors.alien_frontend_hilite.r or Colors.frontend_hilite.r,
green = Engine.IsAliensMode() and Colors.alien_frontend_hilite.g or Colors.frontend_hilite.g,
blue = Engine.IsAliensMode() and Colors.alien_frontend_hilite.b or Colors.frontend_hilite.b
} )
f2_local1:animateToState( "default" )
self:addElement( f2_local1 )
return self
end
function CreateListDef( f4_arg0, f4_arg1, f4_arg2, f4_arg3 )
f4_arg0.scrollByChildHeight = true
f4_arg0.disableOutsideChildren = true
f4_arg0.sendScrollEvents = true
return {
type = "UIVerticalList",
id = "scroll_list_vlist",
focusable = true,
properties = f4_arg0,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = f4_arg2,
bottom = -f4_arg3
}
},
handlers = {
refresh_scroll_list = RefreshScrollList,
scroll_up = function ( f5_arg0, f5_arg1 )
f5_arg0:SetVerticalListScrollUp()
end
,
scroll_down = function ( f6_arg0, f6_arg1 )
f6_arg0:SetVerticalListScrollDown()
end
},
childrenFeeder = f4_arg1
}
end
function SetChildrenIgnoreMouse( f7_arg0, f7_arg1 )
local f7_local0 = f7_arg0:getNumChildren()
local f7_local1 = f7_arg0:getFirstChild()
for f7_local2 = 1, f7_local0, 1 do
local f7_local5 = f7_local2
f7_local1.m_focusLockedByScrolling = f7_arg1.ignore
f7_local1 = f7_local1:getNextSibling()
end
end
LUI.UIScrollingVerticalList.build = function ( f8_arg0, f8_arg1 )
return LUI.UIScrollingVerticalList.new( f8_arg0, f8_arg1 )
end
LUI.UIScrollingVerticalList.new = function ( menu, controller )
local self = LUI.UIElement.new()
if not controller then
controller = {}
end
self.id = "UIScrollingVList"
local f9_local1 = menu.childrenFeeder
if menu.childrenFeeder then
menu.childrenFeeder = nil
end
local f9_local2 = 0
local f9_local3 = 0
if controller.use_arrows then
local f9_local4 = function ( f10_arg0, f10_arg1 )
if f10_arg1.show_up_arrow then
f10_arg0:animateToState( "default", 0 )
f10_arg0:processEvent( {
name = "enable"
} )
else
f10_arg0:animateToState( "hidden", 0 )
f10_arg0:processEvent( {
name = "disable"
} )
end
end
f9_local2 = 30
self:addElement( CreateArrowButton( "scroll_list_up_arrow", self, 0, true, 30, false, 90, "scroll_up", f9_local4 ) )
local f9_local5 = function ( f11_arg0, f11_arg1 )
if f11_arg1.show_down_arrow then
f11_arg0:animateToState( "default", 0 )
f11_arg0:processEvent( {
name = "enable"
} )
else
f11_arg0:animateToState( "hidden", 0 )
f11_arg0:processEvent( {
name = "disable"
} )
end
end
f9_local3 = 30
self:addElement( CreateArrowButton( "scroll_list_down_arrow", self, -30, false, 0, true, -90, "scroll_down", f9_local5 ) )
end
local f9_local6 = LUI.MenuBuilder.buildItems( CreateListDef( controller, f9_local1, f9_local2, f9_local3 ), controller, stencil )
f9_local6:setUseStencil( true )
self:addElement( f9_local6 )
f9_local6:registerEventHandler( "set_children_ignore_mouse", SetChildrenIgnoreMouse )
if controller.use_scrollbar then
self:addElement( LUI.UIVerticalScrollbar.new( f9_local6, controller.bar_width, 1, 1, controller.scrollbar_move_func, controller.bar_color, controller.bar_bg_color, controller.bar_material, controller.bar_bg_material ) )
end
self.vlist = f9_local6
self.addElement = LUI.UIScrollingVerticalList.AddElement
self.removeElement = LUI.UIScrollingVerticalList.RemoveElement
self.closeChildren = LUI.UIScrollingVerticalList.CloseChildren
return self
end
LUI.UIScrollingVerticalList.AddElement = function ( f12_arg0, f12_arg1 )
f12_arg0.vlist:addElement( f12_arg1 )
end
LUI.UIScrollingVerticalList.RemoveElement = function ( f13_arg0, f13_arg1 )
f13_arg0.vlist:removeElement( f13_arg1 )
end
LUI.UIScrollingVerticalList.CloseChildren = function ( f14_arg0 )
f14_arg0.vlist:closeChildren()
end

View File

@ -0,0 +1,21 @@
LUI.UITechyDigits = InheritFrom( LUI.UIText )
LUI.UITechyDigits.build = function ( f1_arg0, f1_arg1 )
return LUI.UITechyDigits.new()
end
LUI.UITechyDigits.new = function ( f2_arg0, f2_arg1, f2_arg2, f2_arg3, f2_arg4, f2_arg5 )
local self = LUI.UIText.new()
if LUI.UIElement.setupTechyDigits then
self:setupTechyDigits()
end
self.digits = f2_arg0 or 10
self.longWait = f2_arg1 or 340
self.shortWaitMin = f2_arg2 or 20
self.shortWaitMax = f2_arg3 or 60
self.pulsesMin = f2_arg4 or 3
self.pulsesMax = f2_arg5 or 7
self:setClass( LUI.UITechyDigits )
return self
end
LUI.UITechyDigits.id = "LUITechyDigits"

369
lui/luitest.dec.lua Normal file
View File

@ -0,0 +1,369 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
DebugPrint( "Registering luitest menu" )
f0_local0 = function ( f1_arg0, f1_arg1 )
DebugPrint( "Got event " .. f1_arg1.name )
end
f0_local1 = function ( f2_arg0 )
DebugPrint( "push func!" )
end
f0_local2 = function ( f3_arg0 )
DebugPrint( "pop func!" )
end
local f0_local3 = function ()
return {
table1 = {
key = "value",
key2 = 2
},
item = 5
}
end
local f0_local4 = function ()
DebugPrint( "test function!!!!!!!!!!!!!!!!!!!!" )
local f5_local0 = f0_local3()
f5_local0.item = 6
f5_local0.table1.key2 = 5
local f5_local1 = f0_local3()
DebugPrint( f5_local1.item )
DebugPrint( f5_local1.table1.key2 )
end
local f0_local5 = function ()
return {
type = "UIText",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = 25,
alignment = LUI.Alignment.Left
}
}
}
end
local f0_local6 = function ()
return {
type = "debugText"
}
end
debugFocus = true
local f0_local7 = function ( f8_arg0 )
debugFocus = not debugFocus
return debugFocus
end
local f0_local8 = function ( f9_arg0 )
return {
{
type = "debugButton",
id = "button1",
properties = {
text = "Open This Menu",
additional_handlers = {
button_action = MBh.OpenMenu( "luitest", true )
}
}
},
{
type = "debugButton",
id = "button2",
properties = {
text = "Open Popup",
defaultDuration = 3000,
additional_handlers = {
button_action = MBh.PopupMenu( "testPopup", true )
}
}
},
{
type = "debugButton",
id = "button3",
properties = {
text = "Handles Alt 1 As Well",
additional_handlers = {
button_action = function ()
crash = me
end
,
button_alt1 = MBh.HandlePrint( "Button 3 Alt 1" )
}
},
disabledFunc = f0_local7
},
{
type = "derivedDebugText",
properties = {
text = "Hello"
}
},
{
type = "derivedDebugText",
properties = {
text = "world"
}
}
}
end
function debugList()
return {
type = "UIVerticalList",
id = "testMenu",
focusable = true,
states = {
default = {
left = 0,
top = 0,
right = 0,
bottom = 0,
leftAnchor = true,
topAnchor = true,
rightAnchor = true,
bottomAnchor = true
}
}
}
end
function debugButton()
return {
type = "UIButton",
id = "debugButtonDefaultId",
properties = {
text = "button",
width = 400,
height = 35,
defaultDuration = 500
},
focusable = true,
children = {
{
type = "UIImage",
id = "image",
properties = {
defaultDuration = MBh.Property( "defaultDuration" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
material = RegisterMaterial( "white" ),
scale = 1
},
button_over = MBh.BaseState( "default", {
scale = 0.8
} ),
pulse_1 = MBh.BaseState( "default" ),
pulse_2 = MBh.BaseState( "default", {
scale = 0.8
} )
},
handlers = {
button_over = MBh.AnimateLoop( {
{
"pulse_1",
200,
true,
true
},
{
"pulse_2",
200,
true,
true
}
} ),
button_up = MBh.AnimateToState( "default", 1000, true, true ),
button_disable = MBh.AnimateToState( "default", 1000, true, true )
}
},
{
type = "derivedDebugText",
id = "theText",
properties = {
text = MBh.Property( "text" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = 25,
alignment = LUI.Alignment.Left
}
}
}
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = MBh.Property( "width" ),
top = 0,
bottom = 35,
scale = 1,
alpha = 1
},
disabled = {
alpha = 0.5,
scale = 1
},
button_over = MBh.BaseState( "default", {
scale = 1.2
} )
},
handlers = {
button_over = MBh.DoMultiple( {
MBh.AnimateToState( "button_over", MBh.Property( "defaultDuration" ), true, true ),
f0_local0
} ),
button_up = MBh.AnimateToState( "default", 1000, true, true ),
button_disable = MBh.AnimateToState( "disabled", 1000, true, true )
}
}
end
local f0_local9 = function ()
return {
type = "UIElement",
id = "testDef",
focusable = true,
pushFunc = f0_local1,
popFunc = f0_local2,
properties = {
menu_feeder = MBh.Function( f0_local8 )
},
children = {
{
type = "debugList",
id = "debugList",
properties = {
menu_feeder = MBh.Property( "menu_feeder" )
},
childrenFeeder = MBh.Property( "menu_feeder" )
},
{
type = "backButton",
id = "backButton"
},
{
type = "UITimer",
properties = {
event = "menu_refresh",
interval = 3000,
disposable = false,
broadcastToRoot = true
}
}
},
states = {
default = {
left = 100,
top = 100,
right = 0,
bottom = 0,
leftAnchor = true,
topAnchor = true,
rightAnchor = true,
bottomAnchor = true
}
},
handlers = {
menu_create = f0_local4,
menu_close = function ()
DebugPrint( "menu closed!" )
end
}
}
end
local f0_local10 = function ()
return {
type = "UIBindButton",
handlers = {
button_secondary = MBh.LeaveMenu()
}
}
end
LUI.MenuBuilder.registerDef( "testPopup", function ()
return {
type = "UIElement",
focusable = true,
id = "testPopup",
properties = {
text = "Popup text"
},
children = {
{
type = "derivedDebugText",
properties = {
text = MBh.Property( "text" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
alignment = LUI.Alignment.Left
}
}
},
{
type = "backButton",
id = "popupBackButton"
}
},
states = {
default = {
leftAnchor = false,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
left = -100,
right = 100,
top = -20,
bottom = 20
}
}
}
end )
LUI.MenuBuilder.registerDef( "backButton", f0_local10 )
LUI.MenuBuilder.registerDef( "debugText", f0_local5 )
LUI.MenuBuilder.registerDef( "derivedDebugText", f0_local6 )
LUI.MenuBuilder.registerDef( "debugList", debugList )
LUI.MenuBuilder.registerDef( "debugButton", debugButton )
LUI.MenuBuilder.registerDef( "luitest", f0_local9 )
LockTable( _M )

44
lui/luitext.dec.lua Normal file
View File

@ -0,0 +1,44 @@
LUI.UIText = InheritFrom( LUI.UIElement )
LUI.UIText.build = function ( f1_arg0, f1_arg1 )
return LUI.UIText.new()
end
LUI.UIText.new = function ( f2_arg0 )
local self = LUI.UIElement.new( f2_arg0 )
self:setClass( LUI.UIText )
self:setupUIText()
return self
end
LUI.UIText.TransitionComplete_OutState = function ( f3_arg0, f3_arg1 )
f3_arg0:setText( f3_arg0.replaceContentData.text )
f3_arg0:registerEventHandler( "transition_complete_" .. f3_arg0.replaceContentData.outState, nil )
f3_arg0:animateToState( f3_arg0.replaceContentData.inState, f3_arg0.replaceContentData.inDuration )
f3_arg0.replaceContentData = nil
end
LUI.UIText.setText = function ( f4_arg0, f4_arg1, f4_arg2, f4_arg3, f4_arg4, f4_arg5 )
if f4_arg2 ~= nil and f4_arg3 ~= nil then
f4_arg0.replaceContentData = {}
f4_arg0.replaceContentData.outState = f4_arg2
f4_arg0.replaceContentData.inState = f4_arg3
f4_arg0.replaceContentData.outDuration = f4_arg4
f4_arg0.replaceContentData.inDuration = f4_arg5
f4_arg0.replaceContentData.text = f4_arg1
f4_arg0:registerEventHandler( "transition_complete_" .. f4_arg2, LUI.UIText.TransitionComplete_OutState )
f4_arg0:animateToState( f4_arg2, f4_arg4 )
return
else
f4_arg0:setTextInC( f4_arg1 )
end
end
LUI.UIText.setTextStyle = function ( f5_arg0, f5_arg1 )
f5_arg0.m_textStyle = f5_arg1
end
LUI.UIText.setForceLineBreaks = function ( f6_arg0, f6_arg1 )
f6_arg0.m_forceLineBreaks = f6_arg1
end
LUI.UIText.id = "LUIText"

7
lui/luitighttext.dec.lua Normal file
View File

@ -0,0 +1,7 @@
LUI.UITightText = {}
LUI.UITightText.new = function ( f1_arg0 )
local self = LUI.UIText.new( f1_arg0 )
self:setupUITightText()
return self
end

134
lui/luitimer.dec.lua Normal file
View File

@ -0,0 +1,134 @@
LUI.UITimer = {}
local f0_local0 = {}
LUI.UITimer.priority = 10000
Queue = {
new = function ()
local f1_local0 = {
first = 0,
last = -1
}
setmetatable( f1_local0, Queue )
Queue.__index = Queue
return f1_local0
end,
push = function ( f2_arg0, f2_arg1 )
local f2_local0 = f2_arg0.last + 1
f2_arg0.last = f2_local0
f2_arg0[f2_local0] = f2_arg1
end,
pop = function ( f3_arg0, f3_arg1 )
local f3_local0 = f3_arg0.first
if f3_arg0.last < f3_local0 then
return nil
else
local f3_local1 = f3_arg0[f3_local0]
f3_arg0[f3_local0] = nil
f3_arg0.first = f3_local0 + 1
return f3_local1
end
end
}
LUI.UITimer.build = function ( f4_arg0, f4_arg1 )
assert( f4_arg1.interval, "No property for interval set for timer" )
assert( f4_arg1.event, "No property for event set for timer" )
return LUI.UITimer.new( f4_arg1.interval, f4_arg1.event, f4_arg1.group, f4_arg1.disposable, f4_arg1.eventTarget, f4_arg1.broadcastToRoot, f4_arg1.stopped )
end
LUI.UITimer.new = function ( f5_arg0, f5_arg1, f5_arg2, f5_arg3, f5_arg4, f5_arg5, f5_arg6 )
local self = LUI.UIElement.new( {
left = 0,
top = 0,
right = 1,
bottom = 1,
leftAnchor = true,
topAnchor = true,
rightAnchor = false,
bottomAnchor = false
} )
self.id = "LUITimer"
self:setPriority( LUI.UITimer.priority )
self.reset = LUI.UITimer.Reset
self.interval = math.max( 1, f5_arg0 )
self.disposable = f5_arg3
self.deferNextFrame = f5_arg5
if type( f5_arg1 ) == "string" then
self.timerEvent = {
name = f5_arg1,
timer = self
}
else
f5_arg1.timer = self
self.timerEvent = f5_arg1
end
self.timerEventTarget = f5_arg4
self.timerGroup = f5_arg2
local f5_local1 = "TE_" .. (self.timerGroup and self.timerGroup .. "_" or "") .. self.timerEvent.name
self.profileID = profile.lookupusereventid( f5_local1 ) or profile.createuserevent( f5_local1, "duration" )
if not f5_arg6 then
self:reset()
end
return self
end
LUI.UITimer.Reset = function ( f6_arg0 )
f6_arg0:registerEventHandler( "transition_complete_default", nil )
f6_arg0:animateToState( "default", f6_arg0.interval )
f6_arg0:registerEventHandler( "transition_complete_default", LUI.UITimer.Tick )
end
LUI.UITimer.Stop = function ( f7_arg0 )
f7_arg0:registerEventHandler( "transition_complete_default", nil )
f7_arg0:animateToState( "default", 0 )
end
LUI.UITimer.Tick = function ( f8_arg0, f8_arg1 )
local f8_local0 = nil
if f8_arg0.timerEventTarget ~= nil then
f8_local0 = f8_arg0.timerEventTarget
else
f8_local0 = f8_arg0:getParent()
end
local f8_local1 = f8_arg0.timerEvent
f8_local1.timeElapsed = f8_arg0.interval + f8_arg1.lateness
if f8_arg0.timerGroup then
f8_local1.target = f8_local0
local f8_local2 = f8_arg0:getRootParent()
local f8_local3 = f8_arg0.timerGroup
if not f8_local2.timerGroupQueues[f8_local3] then
f8_local2.timerGroupQueues[f8_local3] = Queue.new()
end
f8_local2.timerGroupQueues[f8_local3]:push( f8_local1 )
else
if not f8_arg0.deferNextFrame then
profile.beginuserevent( f8_arg0.profileID )
f8_local0:processEvent( f8_local1 )
profile.enduserevent( f8_arg0.profileID )
else
f8_local1.target = f8_local0
f8_arg0:dispatchEventToRoot( f8_local1 )
end
if f8_arg0.disposable then
f8_arg0:close()
else
f8_arg0:reset()
end
end
end
LUI.UITimer.DispatchEventsFromQueue = function ( f9_arg0 )
for f9_local4, f9_local5 in pairs( f9_arg0.timerGroupQueues ) do
local f9_local6 = f9_local5:pop()
if f9_local6 then
profile.beginuserevent( f9_local6.timer.profileID )
f9_local6.target:processEvent( f9_local6 )
profile.enduserevent( f9_local6.timer.profileID )
local f9_local3 = f9_local6.timer
if f9_local3.disposable then
f9_local3:close()
else
f9_local3:reset()
end
end
end
end

185
lui/luiverticallist.dec.lua Normal file
View File

@ -0,0 +1,185 @@
LUI.UIVerticalList = {}
LUI.UIVerticalNavigator = {}
LUI.UIVerticalList.AddSpacer = function ( f1_arg0, f1_arg1, f1_arg2 )
local self = LUI.UIElement.new( {
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
topAnchor = true,
bottomAnchor = false,
top = 0,
bottom = f1_arg1
} )
self:setPriority( f1_arg2 )
f1_arg0:addElement( self )
return self
end
LUI.UIVerticalList.build = function ( menu, controller )
local self = LUI.UIVerticalList.new( nil, controller.scrollByChildHeight, controller.disableOutsideChildren, controller.sendScrollEvents )
LUI.UIVerticalList.SetNoWrap( self, controller.noWrap )
return self
end
LUI.UIVerticalList.new = function ( f3_arg0, f3_arg1, f3_arg2, f3_arg3 )
local self = LUI.UIElement.new( f3_arg0 )
self.id = "LUIVerticalList"
self:setupUIVerticalList( f3_arg1, f3_arg2, f3_arg3 )
self.addSpacer = LUI.UIVerticalList.AddSpacer
self.addElement = LUI.UIVerticalList.AddElement
self.removeElement = LUI.UIVerticalList.RemoveElement
self.updateNavigation = LUI.UIVerticalList.UpdateNavigation
self:registerEventHandler( "gain_focus", LUI.UIVerticalList.gainFocus )
self:registerEventHandler( "update_navigation", function ( element, event )
element:updateNavigation()
end )
return self
end
LUI.UIVerticalList.SetNoWrap = function ( f5_arg0, f5_arg1 )
f5_arg0.noWrap = f5_arg1
end
LUI.UIVerticalNavigator.build = function ( f6_arg0, f6_arg1 )
return LUI.UIVerticalNavigator.new()
end
LUI.UIVerticalNavigator.new = function ( f7_arg0 )
local self = LUI.UIElement.new( f7_arg0 )
self.id = "LUIVerticalNavigator"
self.addSpacer = LUI.UIVerticalList.AddSpacer
self.addElement = LUI.UIVerticalList.AddElement
self.removeElement = LUI.UIVerticalList.RemoveElement
self.updateNavigation = LUI.UIVerticalList.UpdateNavigation
self:registerEventHandler( "gain_focus", LUI.UIVerticalList.gainFocus )
self:registerEventHandler( "update_navigation", function ( element, event )
element:updateNavigation()
end )
return self
end
LUI.UIVerticalList.AddElement = function ( f9_arg0, f9_arg1 )
LUI.UIElement.addElement( f9_arg0, f9_arg1 )
f9_arg1.navigation = {}
f9_arg0:setLayoutCached( false )
f9_arg0:updateNavigation()
end
LUI.UIVerticalList.RemoveElement = function ( f10_arg0, f10_arg1 )
LUI.UIElement.removeElement( f10_arg0, f10_arg1 )
f10_arg0:setLayoutCached( false )
f10_arg0:updateNavigation()
end
LUI.UIVerticalList.UpdateNavigation = function ( f11_arg0 )
local f11_local0, f11_local1 = nil
local f11_local2 = f11_arg0:getFirstChild()
while f11_local2 ~= nil do
if f11_local2:canFocus( FocusType.ListSelection ) then
if f11_local0 == nil then
f11_local0 = f11_local2
end
if f11_local1 ~= nil then
f11_local1.navigation.down = f11_local2
f11_local2.navigation.up = f11_local1
else
f11_local2.navigation.up = nil
end
if f11_local2.navigation ~= nil and f11_arg0.navigation ~= nil then
f11_local2.navigation.left = f11_arg0.navigation.left
f11_local2.navigation.right = f11_arg0.navigation.right
end
f11_local1 = f11_local2
end
f11_local2 = f11_local2:getNextSibling()
end
if f11_local1 ~= nil then
if f11_arg0.navigation ~= nil and f11_arg0.navigation.down ~= nil and f11_arg0.navigation.down:canFocus( FocusType.ListSelection ) == true then
f11_local1.navigation.down = f11_arg0.navigation.down
f11_arg0.navigation.down.navigation.up = f11_local1
elseif f11_local1 ~= f11_local0 and not f11_arg0.noWrap then
f11_local1.navigation.down = f11_local0
else
f11_local1.navigation.down = nil
end
if f11_arg0.navigation ~= nil and f11_arg0.navigation.up ~= nil and f11_arg0.navigation.up:canFocus( FocusType.ListSelection ) == true then
f11_local0.navigation.up = f11_arg0.navigation.up
f11_arg0.navigation.up.navigation.down = f11_local0
elseif f11_local1 ~= f11_local0 and not f11_arg0.noWrap then
f11_local0.navigation.up = f11_local1
else
f11_local0.navigation.up = nil
end
end
end
LUI.UIVerticalList.gainFocus = function ( f12_arg0, f12_arg1 )
local f12_local0, f12_local1 = f12_arg0:restoreState()
if f12_local1 == 0 then
local f12_local2, f12_local3 = nil
local f12_local4 = f12_arg0:getFirstChild()
while f12_local4 ~= nil do
if f12_local4:canFocus( FocusType.ListSelection ) then
if f12_local2 == nil then
f12_local2 = f12_local4
end
if f12_local3 == nil and f12_local4.listDefaultFocus then
f12_local3 = f12_local4
end
end
end
if f12_local3 ~= nil then
f12_local3:processEvent( f12_arg1 )
elseif f12_local2 ~= nil then
f12_local2:processEvent( f12_arg1 )
else
end
f12_local4 = f12_local4:getNextSibling()
end
end
LUI.UIVerticalList.getHeightOfChildren = function ( f13_arg0, f13_arg1 )
local f13_local0 = f13_arg0:getRect()
local f13_local1 = f13_arg1 or 0
if f13_local0 then
local f13_local2 = f13_arg0:getFirstChild()
local f13_local3
if f13_local2 then
f13_local3 = -f13_local1
if not f13_local3 then
f13_local3 = 0
while f13_local2 do
local f13_local4 = nil
if f13_local2.getText and f13_local2:getText() then
local f13_local5 = nil
f13_local5, f13_local4 = f13_local2:getElementTextDims()
else
f13_local4 = f13_local2:getHeight()
end
f13_local3 = f13_local3 + f13_local1 + f13_local4
f13_local2 = f13_local2:getNextSibling()
end
return f13_local3
end
else
f13_local3 = 0
while f13_local2 do
local f13_local4 = nil
if f13_local2.getText and f13_local2:getText() then
local f13_local5 = nil
f13_local5, f13_local4 = f13_local2:getElementTextDims()
else
f13_local4 = f13_local2:getHeight()
end
f13_local3 = f13_local3 + f13_local1 + f13_local4
f13_local2 = f13_local2:getNextSibling()
end
return f13_local3
end
else
end
end

View File

@ -0,0 +1,261 @@
LUI.UIVerticalScrollbar = {}
LUI.UIVerticalScrollbar.InactiveDelay = 500
LUI.UIVerticalScrollbar.InactiveDuration = 250
function OnMouseMove( f1_arg0, f1_arg1 )
if f1_arg0.scrolling then
local f1_local0 = f1_arg0:getParent()
local f1_local1 = f1_local0:getHeight()
local f1_local2, f1_local3, f1_local4, f1_local5 = f1_local0:getRect()
local f1_local6, f1_local7 = f1_arg1.root:pixelsToUnits( f1_arg1.x, f1_arg1.y )
f1_local2, f1_local3 = f1_arg1.root:pixelsToUnits( f1_local2, f1_local3 )
local f1_local8 = (f1_local7 - f1_local3) / f1_local1
if f1_local8 < 0 then
f1_local8 = 0
elseif f1_local8 > 1 then
f1_local8 = 1
end
if f1_arg0.onMoveFunc then
f1_arg0.onMoveFunc( f1_local0, f1_local0.verticalList, f1_local8, f1_local0.properties )
end
end
end
function MouseMoveEvent( f2_arg0, f2_arg1 )
f2_arg0:applyElementTransform()
local f2_local0, f2_local1 = ProjectRootCoordinate( f2_arg1.rootName, f2_arg1.x, f2_arg1.y )
OnMouseMove( f2_arg0, {
controller = f2_arg1.controller,
root = f2_arg1.root,
x = f2_local0,
y = f2_local1
} )
f2_arg0:undoElementTransform()
end
function ScrollbarMoved( f3_arg0, f3_arg1, f3_arg2 )
if not f3_arg1 then
DebugPrint( "Warning: Tried to scroll a scrollbar without a vertical list. Make sure the vertical list was manually added. E.G. scrollBar:setList( <vList> )." )
return
elseif not f3_arg2 then
DebugPrint( "Warning: Tried to scroll a scrollbar without a scroll percentage. This is very bad." )
return
end
local f3_local0 = f3_arg1:getNumChildren()
local f3_local1 = math.min( math.floor( f3_arg2 * f3_local0 ), f3_local0 - 1 )
if f3_local1 == f3_arg1.lastFocusIndex then
return
end
f3_arg1.lastFocusIndex = f3_local1
local f3_local2 = f3_arg1:getFirstChild()
local f3_local3 = nil
for f3_local4 = 0, f3_local0 - 1, 1 do
if f3_local4 == f3_local1 then
f3_local3 = f3_local2
end
f3_local2:processEvent( {
name = "lose_focus",
immediate = true
} )
f3_local2 = f3_local2:getNextSibling()
end
if f3_local3 then
f3_local3:processEvent( {
name = "gain_focus",
immediate = true
} )
end
end
function OnMouseDown( f4_arg0, f4_arg1 )
f4_arg0.scrolling = true
local f4_local0 = Engine.SetUsingScrollbar
local f4_local1 = f4_arg1.controller
if not f4_local1 then
f4_local1 = Engine.GetFirstActiveController()
end
f4_local0( f4_local1, true )
OnMouseMove( f4_arg0, f4_arg1 )
f4_local0 = f4_arg0:getParent()
if f4_local0.verticalList then
f4_local0.verticalList:processEvent( {
name = "set_children_ignore_mouse",
ignore = true,
immediate = true
} )
end
end
function StopScrolling( f5_arg0, f5_arg1 )
f5_arg0.scrolling = false
local f5_local0 = Engine.SetUsingScrollbar
local f5_local1 = f5_arg1.controller
if not f5_local1 then
f5_local1 = Engine.GetFirstActiveController()
end
f5_local0( f5_local1, false )
f5_local0 = f5_arg0:getParent()
if f5_local0.verticalList then
f5_local0.verticalList:processEvent( {
name = "set_children_ignore_mouse",
ignore = false,
immediate = true
} )
end
end
LUI.UIVerticalScrollbar.build = function ( f6_arg0, f6_arg1 )
return LUI.UIVerticalScrollbar.new( f6_arg1.vlist, f6_arg1.bar_width, f6_arg1.active_alpha, f6_arg1.inactive_alpha, f6_arg1.on_move_func, f6_arg1.bar_color, f6_arg1.bg_color, f6_arg1.bar_material, f6_arg1.bg_material )
end
LUI.UIVerticalScrollbar.new = function ( f7_arg0, f7_arg1, f7_arg2, f7_arg3, f7_arg4, f7_arg5, f7_arg6, f7_arg7, f7_arg8 )
if not f7_arg1 then
f7_arg1 = 20
end
if not f7_arg2 then
f7_arg2 = 1
end
if not f7_arg3 then
f7_arg3 = 1
end
if not f7_arg4 then
f7_arg4 = ScrollbarMoved
end
if not f7_arg5 then
f7_arg5 = {
red = 0.3,
green = 0.3,
blue = 0.3,
alpha = 1
}
end
if not f7_arg6 then
f7_arg6 = {
red = 0.05,
green = 0.05,
blue = 0.05,
alpha = 0.6
}
end
if not f7_arg7 then
f7_arg7 = "white"
end
if not f7_arg8 then
f7_arg8 = "white"
end
local self = LUI.UIElement.new( {
left = 0,
top = 0,
right = f7_arg1,
bottom = 0,
leftAnchor = false,
topAnchor = true,
rightAnchor = true,
bottomAnchor = true,
alpha = f7_arg2
} )
self.id = "LUIVerticalScrollbar"
self:registerAnimationState( "inactive", {
left = 0,
right = f7_arg1,
leftAnchor = false,
rightAnchor = true,
alpha = f7_arg3
} )
self:registerEventHandler( "list_scroll", LUI.UIVerticalScrollbar.UpdateScrollbar )
self:registerEventHandler( "focus_changed", LUI.UIVerticalScrollbar.FocusChanged )
self:registerEventHandler( "inactive", LUI.UIVerticalScrollbar.Inactive )
self.bgImage = LUI.UIImage.new( {
leftAnchor = true,
topAnchor = true,
rightAnchor = true,
bottomAnchor = true,
red = f7_arg6.red,
green = f7_arg6.green,
blue = f7_arg6.blue,
alpha = f7_arg6.alpha,
material = RegisterMaterial( f7_arg8 )
} )
self.bgImage:animateToState( "default" )
self:addElement( self.bgImage )
self.scrollButton = LUI.UIButton.new( {
leftAnchor = true,
topAnchor = true,
rightAnchor = true,
bottomAnchor = true
} )
self.buttonImage = LUI.UIImage.new( {
leftAnchor = true,
topAnchor = true,
rightAnchor = true,
bottomAnchor = false,
red = f7_arg5.red,
green = f7_arg5.green,
blue = f7_arg5.blue,
alpha = f7_arg5.alpha,
material = RegisterMaterial( f7_arg7 )
} )
self.scrollButton.onMoveFunc = f7_arg4
self.scrollButton:registerEventHandler( "leftmousedown", OnMouseDown )
self.scrollButton:registerEventHandler( "leftmouseup", StopScrolling )
self.scrollButton:addEventHandler( "popup_active", StopScrolling )
self.scrollButton:addEventHandler( "mousemove", MouseMoveEvent )
self.scrollButton:addElement( self.buttonImage )
self:addElement( self.scrollButton )
self.setList = LUI.UIVerticalScrollbar.SetVerticalList
self.manualUpdate = LUI.UIVerticalScrollbar.ManualUpdate
self:setList( f7_arg0 )
return self
end
LUI.UIVerticalScrollbar.UpdateScrollbar = function ( f8_arg0, f8_arg1 )
if f8_arg0.verticalList and f8_arg1.list == f8_arg0.verticalList then
f8_arg0.buttonImage:registerAnimationState( "default", {
top = f8_arg1.scrollHandlePosition,
bottom = f8_arg1.scrollHandlePosition + f8_arg1.scrollHandleSize,
topAnchor = true,
bottomAnchor = false
} )
f8_arg0.buttonImage:animateToState( "default" )
end
f8_arg0:dispatchEventToChildren( f8_arg1 )
end
LUI.UIVerticalScrollbar.FocusChanged = function ( f9_arg0, f9_arg1 )
f9_arg0:animateToState( "default" )
if f9_arg0.inactiveTimer then
f9_arg0.inactiveTimer:close()
f9_arg0.inactiveTimer:reset()
f9_arg0:addElement( f9_arg0.inactiveTimer )
else
f9_arg0.inactiveTimer = LUI.UITimer.new( LUI.UIVerticalScrollbar.InactiveDelay, "inactive", true )
f9_arg0:addElement( f9_arg0.inactiveTimer )
end
end
LUI.UIVerticalScrollbar.Inactive = function ( f10_arg0, f10_arg1 )
f10_arg0:animateToState( "inactive", LUI.UIVerticalScrollbar.InactiveDuration )
end
LUI.UIVerticalScrollbar.SetVerticalList = function ( f11_arg0, f11_arg1 )
f11_arg0.verticalList = f11_arg1
end
LUI.UIVerticalScrollbar.ManualUpdate = function ( f12_arg0, f12_arg1, f12_arg2, f12_arg3, f12_arg4 )
local f12_local0 = f12_arg0:getHeight()
local f12_local1 = f12_local0
local f12_local2 = 0
if f12_arg3 ~= 0 then
f12_local1 = math.min( f12_local0, f12_local0 * f12_arg2 / f12_arg3 )
if f12_arg3 ~= f12_arg2 then
f12_local2 = LUI.clamp( f12_arg1 / (f12_arg3 - f12_arg2) * (f12_local0 - f12_local1), 0, f12_local0 - f12_local1 )
end
end
f12_arg0.buttonImage:registerAnimationState( "default", {
top = f12_local2,
bottom = f12_local2 + f12_local1,
topAnchor = true,
bottomAnchor = false
} )
f12_arg0.buttonImage:animateToState( "default" )
end

780
lui/menuautonav.dec.lua Normal file
View File

@ -0,0 +1,780 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
INTERVAL_MS = 25
MAX_COUNTER = 200
MAX_COUNTER_GOBACK = 20
MAX_DURATION_COUNTER = 400
DISABLE_NAVIGATING_OVERLAY = 0
STATE = {
IDLE = 0,
WORKING_DROPBACK = 1,
WORKING_MOVEFORWARD = 2
}
LUI.MenuAutoNav.m_menuAutoNav = 0
s_navTableSP = {
{
destScreen = "resume_campaign",
route = {
{
topScreen = "main_menu",
action = "sp_button"
},
{
topScreen = "main_campaign",
action = "btn_resume_id"
},
{
topScreen = "resume_game_menu",
action = ""
}
}
},
{
destScreen = "mission_select",
route = {
{
topScreen = "main_menu",
action = "sp_button"
},
{
topScreen = "main_campaign",
action = "btn_mission_select_id"
},
{
topScreen = "level_select_iw6",
action = ""
}
}
},
{
destScreen = "mp",
route = {
{
topScreen = "main_menu",
action = "mp_button"
}
},
routeOverlayDelay = 5000
},
{
destScreen = "aliens",
route = {
{
topScreen = "main_menu",
action = "extinction_button"
}
},
routeOverlayDelay = 5000
},
{
destScreen = "squads",
route = {
{
topScreen = "main_menu",
action = "squadvssquad_button"
}
},
routeOverlayDelay = 5000
}
}
s_navTableMP = {
{
destScreen = "sp",
route = {
{
topScreen = "mp_main_menu",
action = "button_secondary"
},
{
topScreen = "main_choose_exe_popup_menu",
action = "main_choose_sp_button"
}
},
routeOverlayDelay = 5000
},
{
destScreen = "mp",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_7"
}
}
},
{
destScreen = "aliens",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_9"
}
}
},
{
destScreen = "squads",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_8"
}
}
},
{
destScreen = "xboxlive",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_0"
},
{
topScreen = "menu_xboxlive",
action = ""
}
}
},
{
destScreen = "splitscreen",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_1"
},
{
topScreen = "menu_splitscreensignin",
action = ""
}
}
},
{
destScreen = "systemlink",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_2"
},
{
topScreen = "menu_systemlink",
action = ""
}
}
},
{
destScreen = "options",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_6"
}
}
},
{
destScreen = "xboxlive_findmatch",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_0"
},
{
topScreen = "menu_xboxlive",
action = "find_match_button_id"
},
{
topScreen = "playlist_main",
action = ""
}
}
},
{
destScreen = "xboxlive_privatematch",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_0"
},
{
topScreen = "menu_xboxlive",
action = "private_match_button_id"
},
{
topScreen = "menu_xboxlive_privatelobby",
action = ""
}
}
},
{
destScreen = "xboxlive_privatematch_gamesetup",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_0"
},
{
topScreen = "menu_xboxlive",
action = "private_match_button_id"
},
{
topScreen = "menu_xboxlive_privatelobby",
action = "setup_match_button_id"
},
{
topScreen = "menu_systemlink_gamesetup_root",
action = ""
}
}
},
{
destScreen = "xboxlive_create_squad",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_0"
},
{
topScreen = "menu_xboxlive",
action = "create_squad_button_id"
},
{
topScreen = "cac_edit_main",
action = ""
}
}
},
{
destScreen = "xboxlive_barracks_leaderboards",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_0"
},
{
topScreen = "menu_xboxlive",
action = "barracks_button_id"
},
{
topScreen = "menu_barracks",
action = "leaderboard_button_id"
},
{
topScreen = "leaderboards",
action = ""
}
}
},
{
destScreen = "xboxlive_aliens_loadout",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_0"
},
{
topScreen = "menu_xboxlive",
action = "aliens_loadout_btn_id"
},
{
topScreen = "aliens_cac_menu",
action = ""
}
}
},
{
destScreen = "xboxlive_aliens_leaderboards",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_0"
},
{
topScreen = "menu_xboxlive",
action = "leaderboards_button_id"
},
{
topScreen = "mp_leaderboard_main",
action = ""
}
}
},
{
destScreen = "squadvssquad_squad_assault",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_0"
},
{
topScreen = "menu_xboxlive*",
action = "squads_mode_button_squad_assault"
}
}
},
{
destScreen = "squadvssquad_squad_vs_squad",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_0"
},
{
topScreen = "menu_xboxlive*",
action = "squads_mode_button_squad_vs_squad"
}
}
},
{
destScreen = "squadvssquad_safeguard",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_0"
},
{
topScreen = "menu_xboxlive*",
action = "squads_mode_button_safeguard"
}
}
},
{
destScreen = "squadvssquad_wargame",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_0"
},
{
topScreen = "menu_xboxlive*",
action = "squads_mode_button_wargame"
}
}
},
{
destScreen = "squadvssquad_squad_reports",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_0"
},
{
topScreen = "menu_xboxlive*",
action = "squads_mode_button_squad_reports"
},
{
topScreen = "squads_hq_menu*",
action = "squads_mode_button_squad_reports"
}
}
},
{
destScreen = "squadvssquad_local_play",
route = {
{
topScreen = "mp_main_menu",
action = "btn_MPMain_1"
},
{
topScreen = "menu_splitscreensignin",
action = ""
}
}
}
}
function new()
local f1_local0 = {}
setmetatable( f1_local0, {
__index = _M
} )
f1_local0.m_state = STATE.IDLE
f1_local0.m_controller = -1
f1_local0.m_counter = 0
f1_local0.m_durationCounter = 0
f1_local0.m_currentRoute = {}
f1_local0.m_root = 0
f1_local0.m_timerElement = 0
return f1_local0
end
function Reset()
if LUI.MenuAutoNav.ShouldCloseOverlay() then
LUI.MenuAutoNav.CloseOverlay()
end
local f2_local0 = LUI.MenuAutoNav.GetInstance()
if f2_local0.m_timerElement and f2_local0.m_timerElement ~= 0 and f2_local0.m_root and f2_local0.m_root ~= 0 then
f2_local0.m_root:removeElement( f2_local0.m_timerElement )
f2_local0.m_timerElement:close()
end
f2_local0.m_state = STATE.IDLE
f2_local0.m_controller = -1
f2_local0.m_counter = 0
f2_local0.m_durationCounter = 0
f2_local0.m_currentRoute = {}
f2_local0.m_root = 0
f2_local0.m_timerElement = 0
end
function GetInstance()
if LUI.MenuAutoNav.m_menuAutoNav == 0 then
LUI.MenuAutoNav.m_menuAutoNav = LUI.MenuAutoNav.new()
end
return LUI.MenuAutoNav.m_menuAutoNav
end
function IsRunning()
local f4_local0 = LUI.MenuAutoNav.GetInstance()
if f4_local0.m_state ~= STATE.IDLE then
return true
else
return false
end
end
function Stop()
if IsRunning() then
Reset()
end
end
function SendButtonPress( f6_arg0, f6_arg1, f6_arg2 )
local f6_local0 = {
name = "gamepad_button",
immediate = true,
down = true,
button = f6_arg0,
qualifier = f6_arg1,
controller = f6_arg2
}
local f6_local1 = Engine.GetLuiRoot()
if not f6_local1 then
return false
else
f6_local1:dispatchEventToRoot( f6_local0 )
return true
end
end
function FindRouteEntry( f7_arg0 )
local f7_local0 = LUI.MenuAutoNav.GetInstance()
assert( f7_arg0 )
local f7_local1 = nil
if Engine.IsMultiplayer() then
f7_local1 = s_navTableMP
else
f7_local1 = s_navTableSP
end
if f7_local1 then
for f7_local5, f7_local6 in ipairs( f7_local1 ) do
if f7_local6.route and string.lower( f7_arg0 ) == string.lower( f7_local6.destScreen ) then
return f7_local6
end
end
end
return nil
end
function Yield()
local f8_local0 = LUI.MenuAutoNav.GetInstance()
f8_local0.m_counter = f8_local0.m_counter + 1
if f8_local0.m_counter > MAX_COUNTER then
DebugPrint( "MenuAutoNav: Timeout!" )
LUI.MenuAutoNav.Stop()
return
else
end
end
function IsMenuInCurrentRoute( f9_arg0 )
local f9_local0 = LUI.MenuAutoNav.GetInstance()
assert( f9_arg0 )
local f9_local1 = LUI.MenuAutoNav.GetInstance()
if f9_local1.m_currentRoute then
for f9_local5, f9_local6 in ipairs( f9_local1.m_currentRoute ) do
if string.lower( f9_local6.topScreen ) == string.lower( f9_arg0 ) then
return true, f9_local5
end
end
end
return false, -1
end
function HandleMenuAutoNavOverlayRefresh( f10_arg0, f10_arg1 )
if LUI.MenuAutoNav.ShouldCloseOverlay() then
LUI.MenuAutoNav.CloseOverlay()
end
end
function menu_auto_nav_overlay()
return {
type = "UIElement",
id = "menu_auto_nav_overlay_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
handlers = {
menu_auto_nav_overlay_refresh = HandleMenuAutoNavOverlayRefresh
},
children = {
{
type = "UIImage",
id = "menu_auto_nav_background_id",
states = {
default = CoD.ColorizeState( Swatches.Overlay.Color, {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
material = RegisterMaterial( "white" ),
alpha = 1
} )
},
children = {
{
type = "generic_loading_widget",
properties = {
message = Engine.Localize( "@SPEECH_NAVIGATING" )
}
}
}
},
{
type = "UITimer",
id = "menu_auto_nav_overlay_timer",
properties = {
event = "menu_auto_nav_overlay_refresh",
interval = 25,
disposable = false,
broadcastToRoot = false
}
}
}
}
end
function OpenOverlay( f12_arg0 )
if DISABLE_NAVIGATING_OVERLAY ~= 0 then
return
end
local f12_local0 = Engine.GetLuiRoot()
if not f12_local0 then
DebugPrint( "MenuAutoNavOverlay: Error, no root found. Cannot open overlay." )
return
elseif f12_local0.m_menuAutoNavOverlay then
DebugPrint( "MenuAutoNavOverlay: Ignoring open request because we are already open." )
return
end
local m_menuAutoNavOverlay = LUI.MenuBuilder.buildItems( menu_auto_nav_overlay(), {}, f12_local0 )
m_menuAutoNavOverlay:animateToState( "default" )
m_menuAutoNavOverlay:setPriority( 400 )
f12_local0:addElement( m_menuAutoNavOverlay )
f12_local0.m_menuAutoNavOverlay = m_menuAutoNavOverlay
if f12_arg0 and f12_arg0 > 0 then
f12_local0.m_menuAutoNavOverlayDelay = f12_arg0
f12_local0.m_menuAutoNavOverlayTimeStamp = 0
else
f12_local0.m_menuAutoNavOverlayDelay = 0
f12_local0.m_menuAutoNavOverlayTimeStamp = 0
end
end
function CloseOverlay()
local f13_local0 = Engine.GetLuiRoot()
if not f13_local0 then
DebugPrint( "MenuAutoNavOverlay: Error, no root found, therefore we cannot close overlay." )
return
elseif not f13_local0.m_menuAutoNavOverlay then
DebugPrint( "MenuAutoNavOverlay: Warning, ignoring attempt to close overlay because it is already closed." )
return
else
f13_local0:removeElement( f13_local0.m_menuAutoNavOverlay )
f13_local0.m_menuAutoNavOverlay = nil
f13_local0.m_menuAutoNavOverlayDelay = nil
f13_local0.m_menuAutoNavOverlayTimeStamp = nil
end
end
function ShouldCloseOverlay()
if LUI.MenuAutoNav.IsRunning() then
return false
end
local f14_local0 = Engine.GetLuiRoot()
if not f14_local0 then
return false
elseif not f14_local0.m_menuAutoNavOverlay then
return false
elseif f14_local0.m_menuAutoNavOverlayDelay and f14_local0.m_menuAutoNavOverlayTimeStamp and f14_local0.m_menuAutoNavOverlayDelay > 0 then
local f14_local1 = Engine.GetMilliseconds()
if f14_local0.m_menuAutoNavOverlayTimeStamp == 0 then
f14_local0.m_menuAutoNavOverlayTimeStamp = f14_local1 + f14_local0.m_menuAutoNavOverlayDelay
return false
elseif f14_local1 < f14_local0.m_menuAutoNavOverlayTimeStamp then
return false
end
end
return true
end
function HandleTimerEvent( f15_arg0, f15_arg1 )
local f15_local0 = LUI.MenuAutoNav.GetInstance()
if not f15_local0.m_currentRoute then
DebugPrint( "MenuAutoNav: Current route is empty. Bailing" )
Stop()
return
elseif #f15_local0.m_currentRoute < 1 then
DebugPrint( "MenuAutoNav: Current route is empty. Bailing" )
Stop()
return
end
f15_local0.m_durationCounter = f15_local0.m_durationCounter + 1
if f15_local0.m_durationCounter > MAX_DURATION_COUNTER then
DebugPrint( "MenuAutoNav: Max duration counter exceeded. Bailing" )
Stop()
return
elseif f15_local0.m_state == STATE.WORKING_DROPBACK then
if LUI.FlowManager.IsTopMenuModal() then
DebugPrint( "MenuAutoNav: A modal menu popped up while attempting to find a starting point. We are stopping here." )
LUI.MenuAutoNav.Stop()
return
end
local f15_local1 = LUI.FlowManager.GetTopOpenAndVisibleMenuName()
if not f15_local1 then
Yield()
return
end
local f15_local2, f15_local3 = nil
f15_local2, f15_local3 = IsMenuInCurrentRoute( f15_local1 )
if not f15_local2 or f15_local2 ~= true then
f15_local0.m_counter = f15_local0.m_counter + 1
if f15_local0.m_counter <= MAX_COUNTER_GOBACK then
return
elseif string.lower( f15_local1 ) == string.lower( "main_menu" ) or string.lower( f15_local1 ) == string.lower( "mp_main_menu" ) then
DebugPrint( "MenuAutoNav: Menu we are looking for not found, and we cannot move back any more. Stopping!" )
LUI.MenuAutoNav.Stop()
return
elseif string.lower( f15_local1 ) == string.lower( "menu_splitscreensignin" ) then
LUI.FlowManager.RequestLeaveMenuByName( "menu_splitscreensignin" )
f15_local0.m_counter = 0
elseif LUI.MenuAutoNav.SendButtonPress( "secondary", nil, f15_local0.m_controller ) == true then
f15_local0.m_counter = 0
end
return
elseif f15_local3 > 1 then
else
f15_local0.m_state = STATE.WORKING_MOVEFORWARD
f15_local0.m_counter = 0
end
while f15_local3 > 1 do
table.remove( f15_local0.m_currentRoute, 1 )
f15_local3 = f15_local3 - 1
end
f15_local0.m_state = STATE.WORKING_MOVEFORWARD
f15_local0.m_counter = 0
end
if f15_local0.m_state == STATE.WORKING_MOVEFORWARD then
local f15_local1 = Engine.GetLuiRoot()
if f15_local1 == nil then
DebugPrint( "MenuAutoNav: Error, we have no root! Stopping" )
Stop()
return
end
local f15_local2 = f15_local0.m_currentRoute[1]
if string.lower( f15_local2.action ) == string.lower( "" ) then
DebugPrint( "MenuAutoNav: Our current route action is empty, therefore we should be at our destination. Done." )
Stop()
return
elseif string.lower( f15_local2.action ) == string.lower( "button_secondary" ) then
if LUI.MenuAutoNav.SendButtonPress( "secondary", nil, f15_local0.m_controller ) ~= true then
Yield()
return
end
else
local f15_local3 = f15_local1:getFirstDescendentById( f15_local2.action )
if not f15_local3 then
Yield()
return
elseif f15_local3.disabled and not f15_local3.locked then
Yield()
return
end
f15_local3:processEvent( {
name = "button_action",
controller = f15_local0.m_controller
} )
f15_local3:processEvent( {
name = "button_down",
controller = f15_local0.m_controller
} )
end
table.remove( f15_local0.m_currentRoute, 1 )
if #f15_local0.m_currentRoute >= 1 then
f15_local0.m_counter = 0
return
end
DebugPrint( "MenuAutoNav: Done!" )
end
Stop()
end
function DebugDumpRoute( f16_arg0 )
local f16_local0 = LUI.MenuAutoNav.GetInstance()
DebugPrint( "----------------------------------------------------------------" )
DebugPrint( "MenuAutoNav: Route:" )
for f16_local4, f16_local5 in ipairs( f16_arg0 ) do
DebugPrint( " #" .. tostring( f16_local4 ) .. " : topScreen=\"" .. tostring( f16_local5.topScreen ) .. "\", action=\"" .. tostring( f16_local5.action ) .. "\"" )
end
DebugPrint( "----------------------------------------------------------------" )
end
function Goto( f17_arg0, f17_arg1 )
assert( f17_arg0 )
local f17_local0 = LUI.MenuAutoNav.GetInstance()
if IsRunning() then
DebugPrint( "MenuAutoNav: Error, an outstanding auto navigation is still working. Unable to navigate to \"" .. f17_arg0 .. "\"!" )
return false
end
local f17_local1 = FindRouteEntry( f17_arg0 )
if not f17_local1 then
DebugPrint( "MenuAutoNav: Error, unable to find a route to \"" .. f17_arg0 .. "\"!" )
return false
end
local f17_local2 = f17_local1.route
local f17_local3 = f17_local1.routeOverlayDelay or 0
local f17_local4 = Engine.GetLuiRoot()
if f17_local4 == nil then
DebugPrint( "MenuAutoNav: Error, we do not appear to have a root! Unable to create timer for autonav process!" )
return false
end
f17_local0.m_controller = f17_arg1
f17_local0.m_counter = 0
f17_local0.m_currentRoute = {}
for f17_local8, f17_local9 in ipairs( f17_local2 ) do
table.insert( f17_local0.m_currentRoute, f17_local9 )
end
f17_local0.m_state = STATE.WORKING_DROPBACK
self = LUI.UITimer.new( INTERVAL_MS, {
name = "menu_auto_nav_timer"
} )
self.id = "MenuAutoNavTimer"
f17_local4:addElement( self )
f17_local0.m_root = f17_local4
f17_local0.m_timerElement = self
DebugPrint( "MenuAutoNav: Goto( \"" .. f17_arg0 .. "\") started" )
LUI.MenuAutoNav.OpenOverlay( f17_local3 )
return true
end
LockTable( _M )

1182
lui/menubuilder.dec.lua Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2341
lui/menugenerics.dec.lua Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,164 @@
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 ControlBindFactory( f5_arg0, f5_arg1 )
return {
type = "UIGenericButton",
id = "bind_" .. f5_arg1,
disabledFunc = shouldBeDisabledFunc or function ()
return false
end
,
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( f5_arg0 ),
button_display_func = function ( f7_arg0, f7_arg1 )
return GetDisplay( f5_arg1 )
end
,
button_action_func = function ( f8_arg0, f8_arg1 )
Engine.BindKey( f5_arg1 )
OptionsWindowTriggerRefresh( f8_arg0, f8_arg1 )
end
},
handlers = {
element_refresh = MBh.EmitEvent( "content_refresh" ),
key_bound = OptionsWindowTriggerRefresh
}
}
end
function OptionsFeeder( f9_arg0 )
local f9_local0 = {}
Engine.ExecNow( "profile_menuDvarsSetup" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_FORWARD", "+forward" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_MOVE_BACK", "+back" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_MOVE_LEFT", "+moveleft" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_MOVE_RIGHT", "+moveright" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_STANDJUMP", "+gostand" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_CROUCH", "+togglecrouch" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_PRONE", "toggleprone" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_SPRINT_HOLD_BREATH", "+breath_sprint" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_HOLD_DOWN_CROUCH", "+movedown" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_HOLD_DOWN_PRONE", "+prone" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_CHANGE_STANCE", "+stance" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_SPRINT", "+sprint" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_HOLD_BREATH", "+holdbreath" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_TURN_LEFT", "+left" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_TURN_RIGHT", "+right" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_STRAFE", "+strafe" )
return f9_local0
end
function OptionsMainCreate( f10_arg0, f10_arg1 )
f10_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
function movement_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 movement_controls()
return {
type = "UIElement",
id = "movement_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 ( f13_arg0, f13_arg1 )
Engine.Exec( "updategamerprofile" )
end
},
children = {
{
type = "generic_menu_title",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_MOVEMENT" )
}
},
{
type = "movement_vlist",
id = "movement_vlist_id"
},
{
type = "button_helper_text_main",
id = "button_helper_text_id"
},
{
type = "UIBindButton",
id = "back_button",
handlers = {
button_secondary = MBh.LeaveMenu()
}
}
}
}
end
LUI.MenuBuilder.registerDef( "movement_vlist", movement_vlist )
LUI.MenuBuilder.registerDef( "movement_controls", movement_controls )
LockTable( _M )

View File

@ -0,0 +1,801 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = Engine.Localize( "@LUA_MENU_A10_ALT_LABEL" )
f0_local1 = Engine.Localize( "@LUA_MENU_A10_CANNON_LABEL" )
f0_local2 = Engine.Localize( "@LUA_MENU_A10_ROCKET_LABEL" )
local f0_local3 = "@PLATFORM_A10_CANNON_FIRE"
local f0_local4 = "@PLATFORM_A10_ROCKET_FIRE"
local f0_local5 = function ( f1_arg0, f1_arg1 )
if f1_arg1.value then
f1_arg0:animateToState( "active", 0 )
local f1_local0 = f1_arg0:getChildById( "reticleImageId" )
local f1_local1 = f1_arg0:getChildById( "altitudeBackID" )
local f1_local2 = f1_arg0:getChildById( "speedBackID" )
local f1_local3 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
150
},
{
"active",
0
}
} )
f1_local3( f1_local0 )
f1_local3( f1_local1 )
f1_local3( f1_local2 )
else
f1_arg0:animateToState( "default", 0 )
end
end
local f0_local6 = function ( f2_arg0, f2_arg1, f2_arg2 )
if f2_arg2 then
if f2_arg0.current_state ~= "flashing" then
f2_arg0.current_state = "flashing"
f2_arg0:processEvent( {
name = "flashing"
} )
end
elseif f2_arg0.current_state ~= nil then
f2_arg0.current_state = nil
f2_arg0:animateToState( "default", 0 )
end
end
local f0_local7 = function ( f3_arg0, f3_arg1 )
f3_arg0:setText( f3_arg1.value )
f0_local6( f3_arg0, f3_arg1, f3_arg1.value <= 0 )
end
local f0_local8 = function ( f4_arg0, f4_arg1 )
f4_arg0:setText( f4_arg1.value )
end
local f0_local9 = function ( f5_arg0, f5_arg1 )
f0_local6( f5_arg0, f5_arg1, f5_arg1.value )
end
local f0_local10 = function ( f6_arg0, f6_arg1 )
if f6_arg1.value then
f6_arg0:animateToState( "locked", 0 )
else
f6_arg0:animateToState( "active", 0 )
end
end
local f0_local11 = function ()
return {
type = "UIElement",
id = "a10OverlayContainer",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
alpha = 0
},
active = {
alpha = 1
}
},
handlers = {
init_overlay = f0_local5,
omnvar_update = {
ui_a10 = f0_local5
}
},
children = {
{
type = "reticleImageDef"
},
{
type = "a10CannonAmmoDef"
},
{
type = "a10RocketAmmoDef"
},
{
type = "a10AltimeterDef"
},
{
type = "altitudeBackDef"
},
{
type = "speedBackDef"
},
{
type = "a10MissileHintDef"
},
{
type = "a10CannonHintDef"
}
}
}
end
local f0_local12 = function ()
local f8_local0 = RegisterMaterial( "ca_a10_altitude_back_mp" )
local f8_local1 = 512
local f8_local2 = 128
local f8_local3 = -320
local f8_local4 = -448
return {
type = "UIImage",
id = "altitudeBackID",
states = {
default = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f8_local3 * 0.25,
left = f8_local4 * 0.25,
bottom = (f8_local3 + f8_local1) * 0.25,
right = (f8_local4 + f8_local2) * 0.25,
material = f8_local0,
alpha = 0
},
opening = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f8_local3 * 0.5,
left = f8_local4 * 0.5,
bottom = (f8_local3 + f8_local1) * 0.5,
right = (f8_local4 + f8_local2) * 0.5,
alpha = 0.5
},
active = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f8_local3,
left = f8_local4,
bottom = f8_local3 + f8_local1,
right = f8_local4 + f8_local2,
red = 0,
green = 1,
blue = 0,
alpha = 1
}
},
handlers = {}
}
end
local f0_local13 = function ()
local f9_local0 = RegisterMaterial( "ca_a10_speed_back_mp" )
local f9_local1 = 512
local f9_local2 = 128
local f9_local3 = -320
local f9_local4 = 448
return {
type = "UIImage",
id = "speedBackID",
states = {
default = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f9_local3 * 0.25,
left = (f9_local4 - f9_local2) * 0.25,
bottom = (f9_local3 + f9_local1) * 0.25,
right = f9_local4 * 0.25,
material = f9_local0,
alpha = 0
},
opening = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f9_local3 * 0.5,
left = (f9_local4 - f9_local2) * 0.5,
bottom = (f9_local3 + f9_local1) * 0.5,
right = f9_local4 * 0.5,
alpha = 0.5
},
active = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f9_local3,
left = f9_local4 - f9_local2,
bottom = f9_local3 + f9_local1,
right = f9_local4,
red = 0,
green = 1,
blue = 0,
alpha = 1
}
},
handlers = {}
}
end
local f0_local14 = function ()
local f10_local0 = RegisterMaterial( "ca_a10_left_strip_mp" )
local f10_local1 = 256
local f10_local2 = 64
local f10_local3 = -128
local f10_local4 = -128
return {
type = "UIImage",
id = "leftHashMarksID",
states = {
default = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f10_local3 * 0.25,
left = f10_local4 * 0.25,
bottom = (f10_local3 + f10_local1) * 0.25,
right = (f10_local4 + f10_local2) * 0.25,
material = f10_local0,
alpha = 0
},
opening = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f10_local3 * 0.5,
left = f10_local4 * 0.5,
bottom = (f10_local3 + f10_local1) * 0.5,
right = (f10_local4 + f10_local2) * 0.5,
alpha = 0.5
},
active = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f10_local3,
left = f10_local4,
bottom = f10_local3 + f10_local1,
right = f10_local4 + f10_local2,
red = 0,
green = 1,
blue = 0,
alpha = 1
}
},
handlers = {}
}
end
local f0_local15 = function ()
local f11_local0 = RegisterMaterial( "ca_a10_right_strip_mp" )
local f11_local1 = 256
local f11_local2 = 64
local f11_local3 = -128
local f11_local4 = 128
return {
type = "UIImage",
id = "rightHashMarksID",
states = {
default = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f11_local3 * 0.25,
left = (f11_local4 - f11_local2) * 0.25,
bottom = (f11_local3 + f11_local1) * 0.25,
right = f11_local4 * 0.25,
material = f11_local0,
alpha = 0
},
opening = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f11_local3 * 0.5,
left = (f11_local4 - f11_local2) * 0.5,
bottom = (f11_local3 + f11_local1) * 0.5,
right = f11_local4 * 0.5,
alpha = 0.5
},
active = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f11_local3,
left = f11_local4 - f11_local2,
bottom = f11_local3 + f11_local1,
right = f11_local4,
red = 0,
green = 1,
blue = 0,
alpha = 1
}
},
handlers = {}
}
end
local f0_local16 = function ()
local f12_local0 = RegisterMaterial( "ca_a10_reticle_mp" )
local f12_local1 = 64
local f12_local2 = 64
local f12_local3 = -64
local f12_local4 = -32
return {
type = "UIImage",
id = "reticleImageId",
states = {
default = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f12_local3 + f12_local1 * 0.5,
left = f12_local4 + f12_local2 * 0.5,
bottom = f12_local4 + f12_local2 * 0.5,
right = f12_local3 + f12_local1 * 0.5,
material = f12_local0,
alpha = 0
},
opening = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f12_local3 + f12_local1 * 0.5 - 20,
left = f12_local4 + f12_local2 * 0.5 - 20,
bottom = f12_local3 + f12_local1 * 0.5 + 20,
right = f12_local4 + f12_local2 * 0.5 + 20,
alpha = 0.5
},
active = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f12_local3,
left = f12_local4,
bottom = f12_local3 + f12_local1,
right = f12_local4 + f12_local2,
red = 0,
green = 1,
blue = 0,
alpha = 1
},
locked = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f12_local3,
left = f12_local4,
bottom = f12_local3 + f12_local1,
right = f12_local4 + f12_local2,
red = 1,
green = 0,
blue = 0,
alpha = 1
}
},
handlers = {
omnvar_update = {
ui_a10_rocket_lock = f0_local10
}
}
}
end
local f0_local17 = function ()
return {
type = "UIVerticalList",
id = "a10CannonAmmoId",
states = {
default = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 64,
right = 488,
height = 128,
width = 128,
spacing = 0,
alignment = LUI.Alignment.Left
}
},
children = {
{
type = "UIText",
id = "a10CannonLabelId",
properties = {
text = f0_local1,
textStyle = CoD.TextSettings.Shadowed
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
left = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = 0.5,
green = 1,
blue = 0.5,
alpha = 1,
alignment = LUI.Alignment.Left
}
}
},
{
type = "UIText",
id = "a10CannonCounterId",
properties = {
text = "",
textStyle = CoD.TextSettings.Shadowed
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
left = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = 0.5,
green = 1,
blue = 0.5,
alpha = 1,
alignment = LUI.Alignment.Left
},
flash1 = {
red = 1,
green = 0,
blue = 0,
alpha = 1
},
flash2 = {
red = 1,
green = 0,
blue = 0,
alpha = 0.25
}
},
handlers = {
omnvar_update = {
ui_a10_cannon = f0_local7
},
flashing = MBh.AnimateLoop( {
{
"flash1",
250
},
{
"flash2",
250
}
} )
}
}
}
}
end
local f0_local18 = function ()
local f14_local0 = 0
local f14_local1 = 100
return {
type = "UIText",
id = "a10CannonHelpTextId",
properties = {
text = Engine.Localize( f0_local3 ),
textStyle = CoD.TextSettings.Shadowed
},
states = {
default = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f14_local0,
left = f14_local1,
bottom = f14_local0 + CoD.TextSettings.HudEuroMedSmallFont.Height,
right = f14_local1 + 200,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alpha = 1,
alignment = LUI.Alignment.Left
}
}
}
end
local f0_local19 = function ()
local f15_local0 = 0
local f15_local1 = -100
return {
type = "UIText",
id = "a10RocketHelpTextId",
properties = {
text = Engine.Localize( f0_local4 ),
textStyle = CoD.TextSettings.Shadowed
},
states = {
default = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f15_local0,
left = f15_local1 - 200,
bottom = f15_local0 + CoD.TextSettings.HudEuroMedSmallFont.Height,
right = f15_local1,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alpha = 1,
alignment = LUI.Alignment.Right
}
}
}
end
local f0_local20 = function ()
return {
type = "UIVerticalList",
id = "a10RocketAmmoId",
states = {
default = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 64,
left = -488,
height = 128,
width = 128,
spacing = 0,
alignment = LUI.Alignment.Right
}
},
children = {
{
type = "UIText",
id = "a10RocketLabelId",
properties = {
text = f0_local2,
textStyle = CoD.TextSettings.Shadowed
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
left = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = 0.5,
green = 1,
blue = 0.5,
alpha = 1,
alignment = LUI.Alignment.Right
}
}
},
{
type = "UIText",
id = "a10RocketCounterId",
properties = {
text = "",
textStyle = CoD.TextSettings.Shadowed
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
left = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = 0.5,
green = 1,
blue = 0.5,
alpha = 1,
alignment = LUI.Alignment.Right
},
flash1 = {
red = 1,
green = 0,
blue = 0,
alpha = 1
},
flash2 = {
red = 1,
green = 0,
blue = 0,
alpha = 0.25
}
},
handlers = {
omnvar_update = {
ui_a10_rocket = f0_local7
},
flashing = MBh.AnimateLoop( {
{
"flash1",
250
},
{
"flash2",
250
}
} )
}
}
}
}
end
local f0_local21 = function ()
return {
type = "UIVerticalList",
id = "a10AltimeterId",
states = {
default = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -128,
right = 488,
height = 128,
width = 128,
spacing = 0,
alignment = LUI.Alignment.Left
}
},
children = {
{
type = "UIText",
id = "a10AltimeterLabelId",
properties = {
text = f0_local0,
textStyle = CoD.TextSettings.Shadowed
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
left = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = 0.5,
green = 1,
blue = 0.5,
alpha = 1,
alignment = LUI.Alignment.Left
},
flash1 = {
red = 1,
green = 0,
blue = 0,
alpha = 1
},
flash2 = {
red = 1,
green = 0,
blue = 0,
alpha = 0.25
}
},
handlers = {
omnvar_update = {
ui_a10_alt_warn = f0_local9
},
flashing = MBh.AnimateLoop( {
{
"flash1",
250
},
{
"flash2",
250
}
} )
}
},
{
type = "UIText",
id = "a10AltimeterCounterId",
properties = {
text = "",
textStyle = CoD.TextSettings.Shadowed
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
left = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = 0.5,
green = 1,
blue = 0.5,
alpha = 1,
alignment = LUI.Alignment.Left
},
flash1 = {
red = 1,
green = 0,
blue = 0,
alpha = 1
},
flash2 = {
red = 1,
green = 0,
blue = 0,
alpha = 0.25
}
},
handlers = {
omnvar_update = {
ui_a10_alt = f0_local8,
ui_a10_alt_warn = f0_local9
},
flashing = MBh.AnimateLoop( {
{
"flash1",
250
},
{
"flash2",
250
}
} )
}
}
}
}
end
LUI.MenuBuilder.registerDef( "a10OverlayDef", f0_local11 )
LUI.MenuBuilder.registerDef( "reticleImageDef", f0_local16 )
LUI.MenuBuilder.registerDef( "altitudeBackDef", f0_local12 )
LUI.MenuBuilder.registerDef( "speedBackDef", f0_local13 )
LUI.MenuBuilder.registerDef( "leftHashMarksDef", f0_local14 )
LUI.MenuBuilder.registerDef( "rightHashMarksDef", f0_local15 )
LUI.MenuBuilder.registerDef( "a10CannonAmmoDef", f0_local17 )
LUI.MenuBuilder.registerDef( "a10RocketAmmoDef", f0_local20 )
LUI.MenuBuilder.registerDef( "a10AltimeterDef", f0_local21 )
LUI.MenuBuilder.registerDef( "a10CannonHintDef", f0_local18 )
LUI.MenuBuilder.registerDef( "a10MissileHintDef", f0_local19 )
LockTable( _M )

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,449 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 1
f0_local1 = 64 * f0_local0
f0_local2 = 256 * f0_local0
local f0_local3 = 16 * f0_local0
local f0_local4 = 210 * f0_local0
local f0_local5 = 256 * f0_local0
local f0_local6 = 16 * f0_local0
local f0_local7 = 16 * f0_local0
local f0_local8 = false
local f0_local9 = function ( f1_arg0, f1_arg1 )
local f1_local0 = f1_arg0
local f1_local1 = f1_arg0:getFirstDescendentById( "capturing_bar" )
local f1_local2 = f1_arg0:getFirstDescendentById( "capturing_refresh_timer" )
local f1_local3 = f1_arg0:getFirstDescendentById( "capturing_text" )
local f1_local4 = f1_arg0:getFirstDescendentById( "capturing_bar_bg" )
local f1_local5 = f1_arg0:getFirstDescendentById( "capturing_bar_hl" )
local f1_local6 = f1_local5:getFirstDescendentById( "start_cap" )
local f1_local7 = f1_local5:getFirstDescendentById( "middle" )
local f1_local8 = f1_local5:getFirstDescendentById( "end_cap" )
f0_local8 = false
if Game.GetOmnvar( "ui_securing_progress" ) > 0.9 and not f0_local8 then
f0_local8 = true
end
if f1_local4.current_state ~= "default" then
f1_local4:animateToState( "default", 0 )
f1_local4.current_state = "default"
end
if f0_local8 then
if f1_local1.current_state ~= "secured" then
local f1_local9 = MBh.AnimateSequence( {
{
"active",
500
},
{
"blink_off",
150
}
} )
f1_local9( f1_local1 )
f1_local1.current_state = "secured"
end
if f1_local3.current_state ~= "secured" then
local f1_local9 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
250
},
{
"secured",
0
}
} )
f1_local9( f1_local3 )
f1_local3.current_state = "secured"
end
if f1_local6.current_state ~= "secured" then
f1_local6:animateToState( "secured" )
f1_local6.current_state = "secured"
end
if f1_local7.current_state ~= "secured" then
f1_local7:animateToState( "secured" )
f1_local7.current_state = "secured"
end
if f1_local8.current_state ~= "secured" then
f1_local8:animateToState( "secured" )
f1_local8.current_state = "secured"
end
else
if f1_local1.current_state ~= "default" then
f1_local1:animateToState( "default", 0 )
f1_local1.current_state = "default"
end
if f1_local5.current_state ~= "default" then
f1_local5:animateToState( "default", 0 )
f1_local5.current_state = "default"
end
if f1_local3.current_state ~= "default" then
f1_local3:animateToState( "default", 0 )
f1_local3.current_state = "default"
end
if f1_local7.current_state ~= "default" then
f1_local7:animateToState( "default", 0 )
f1_local7.current_state = "default"
end
end
end
local f0_local10 = function ( f2_arg0, f2_arg1 )
local f2_local0 = f2_arg0
local f2_local1 = f2_arg0:getFirstDescendentById( "capturing_refresh_timer" )
local f2_local2 = f2_arg0:getFirstDescendentById( "capturing_text" )
local f2_local3 = f2_arg0:getFirstDescendentById( "capturing_bar_bg" )
local f2_local4 = f2_arg0:getFirstDescendentById( "capturing_bar_hl" )
local f2_local5 = f2_local4:getFirstDescendentById( "start_cap" )
local f2_local6 = f2_local4:getFirstDescendentById( "middle" )
local f2_local7 = f2_local4:getFirstDescendentById( "end_cap" )
local f2_local8 = f2_local1.value
local f2_local9 = ""
if f2_local8 == 0 then
LUI.UITimer.Stop( f2_local1 )
return
elseif f2_local8 == 1 then
f2_local9 = Engine.Localize( "@ALIEN_COLLECTIBLES_SEARCHING" )
elseif f2_local8 == 2 then
f2_local9 = Engine.Localize( "@ALIEN_COLLECTIBLES_REPAIR_DRILL" )
elseif f2_local8 == 3 then
f2_local9 = Engine.Localize( "@MPUI_REVIVING" )
elseif f2_local8 == 4 then
f2_local9 = Engine.Localize( "@MPUI_BEING_REVIVED" )
elseif f2_local8 == 5 then
f2_local9 = Engine.Localize( "@MP_ALIEN_DESCENT_REPAIR_TERMINAL" )
elseif f2_local8 == 6 then
f2_local9 = Engine.Localize( "@MP_ALIEN_DESCENT_ACTIVATE_CORTEX" )
elseif f2_local8 == 7 then
f2_local9 = Engine.Localize( "@MP_ALIEN_LAST_CONDUIT_REPAIR" )
end
if f2_local0.current_state ~= "active" then
f2_local0:animateToState( "active", 250 )
f2_local0.current_state = "active"
end
if f2_local3.current_state ~= "active" then
f2_local3:animateToState( "active", 250 )
f2_local3.current_state = "active"
end
if f2_local4.current_state ~= "active" then
f2_local4:animateToState( "active", 250 )
f2_local4.current_state = "active"
end
if f2_local5.current_state ~= "default" then
f2_local5:animateToState( "default" )
f2_local5.current_state = "default"
end
if f2_local6.current_state ~= "default" then
f2_local6:animateToState( "default" )
f2_local6.current_state = "default"
end
if f2_local7.current_state ~= "default" then
f2_local7:animateToState( "default" )
f2_local7.current_state = "default"
end
if f2_local2.current_state ~= "securing" then
f2_local2:setText( f2_local9 )
local f2_local10 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
250
},
{
"active",
0
}
} )
f2_local10( f2_local2 )
f2_local2.current_state = "securing"
end
f2_local6:registerAnimationState( "move_bar", {
right = f2_local6.m_maxWidth * Game.GetOmnvar( "ui_securing_progress" )
} )
f2_local6:animateToState( "move_bar", 150 )
end
local f0_local11 = function ( f3_arg0, f3_arg1 )
local f3_local0 = f3_arg0:getFirstDescendentById( "capturing_refresh_timer" )
if f3_arg1.value > 0 then
LUI.UITimer.Reset( f3_local0 )
else
LUI.UITimer.Stop( f3_local0 )
f0_local9( f3_arg0, f3_arg1 )
end
f3_local0.value = f3_arg1.value
end
local f0_local12 = function ( f4_arg0 )
local f4_local0 = RegisterMaterial( "capturing_bg_mp" )
local f4_local1 = RegisterMaterial( "capturing_bar_end_mp" )
local f4_local2 = RegisterMaterial( "capturing_bar_mp" )
local f4_local3 = RegisterMaterial( "capturing_bar_start_mp" )
local self = LUI.UIElement.new()
self.id = "capturing_bar"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -(f0_local1 / 2),
left = -(f0_local2 / 2),
height = f0_local1,
width = f0_local2,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
alpha = 1
} )
self:registerAnimationState( "blink_on", {
alpha = 1
} )
self:registerAnimationState( "blink_off", {
alpha = 0
} )
self:registerEventHandler( "capture_refresh", f4_arg0 )
local f4_local5 = LUI.UITimer.new( 100, "capture_refresh", nil, false, false, false, true )
f4_local5.id = "capturing_refresh_timer"
f4_local5.value = 0
local f4_local6 = LUI.UIImage.new()
f4_local6.id = "capturing_bar_bg"
f4_local6:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f4_local0
} )
f4_local6:animateToState( "default", 0 )
local f4_local7 = LUI.UIHorizontalList.new()
f4_local7.id = "capturing_bar_hl"
f4_local7:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -33,
left = 27,
height = f0_local3,
width = f0_local4,
alignment = LUI.Alignment.Left,
spacing = 0,
alpha = 0
} )
f4_local7:animateToState( "default", 0 )
f4_local7:registerAnimationState( "active", {
alpha = 1
} )
local f4_local8 = LUI.UIImage.new()
f4_local8.id = "start_cap"
f4_local8:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
height = f0_local3,
width = f0_local7,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
material = f4_local3
} )
f4_local8:animateToState( "default", 0 )
f4_local8:registerAnimationState( "secured", {
red = Colors.cyan.r,
green = Colors.cyan.g,
blue = Colors.cyan.b
} )
f4_local8:registerAnimationState( "contested", {
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b
} )
local f4_local9 = LUI.UIImage.new()
f4_local9.id = "middle"
f4_local9.m_maxWidth = f0_local4 - f0_local7 - f0_local7
f4_local9:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
height = f0_local3,
width = 0,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
material = f4_local2
} )
f4_local9:animateToState( "default", 0 )
f4_local9:registerAnimationState( "secured", {
red = Colors.cyan.r,
green = Colors.cyan.g,
blue = Colors.cyan.b
} )
f4_local9:registerAnimationState( "contested", {
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b
} )
local f4_local10 = LUI.UIImage.new()
f4_local10.id = "end_cap"
f4_local10:registerAnimationState( "default", {
topAnchor = true,
rightAnchor = true,
top = 0,
right = 0,
height = f0_local3,
width = f0_local7,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
material = f4_local1
} )
f4_local10:animateToState( "default", 0 )
f4_local10:registerAnimationState( "secured", {
red = Colors.cyan.r,
green = Colors.cyan.g,
blue = Colors.cyan.b
} )
f4_local10:registerAnimationState( "contested", {
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b
} )
f4_local7:addElement( f4_local8 )
f4_local7:addElement( f4_local9 )
f4_local7:addElement( f4_local10 )
local f4_local11 = LUI.UIText.new()
f4_local11.id = "capturing_text"
f4_local11:setText( "" )
f4_local11:setTextStyle( CoD.TextStyle.Shadowed )
f4_local11:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = -400,
height = CoD.TextSettings.HudEuroMedTinyFont.Height,
width = f0_local5,
font = CoD.TextSettings.HudEuroMedTinyFont.Font,
alignment = LUI.Alignment.Right,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 0
} )
f4_local11:animateToState( "default", 0 )
local f4_local12 = -50
f4_local11:registerAnimationState( "opening", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = f4_local12,
height = CoD.TextSettings.HudEuroMedTinyFont.Height,
width = f0_local5,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f4_local11:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = f4_local12,
height = CoD.TextSettings.HudEuroMedTinyFont.Height,
width = f0_local5,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f4_local11:registerAnimationState( "secured", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = f4_local12,
height = CoD.TextSettings.HudEuroMedTinyFont.Height,
width = f0_local5,
red = Colors.cyan.r,
green = Colors.cyan.g,
blue = Colors.cyan.b,
alpha = 1
} )
f4_local11:registerAnimationState( "contested", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = f4_local12,
height = CoD.TextSettings.HudEuroMedTinyFont.Height,
width = f0_local5,
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b,
alpha = 1
} )
f4_local11:registerAnimationState( "contested_off_for_loop", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = f4_local12,
height = CoD.TextSettings.HudEuroMedTinyFont.Height,
width = f0_local5,
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b,
alpha = 0
} )
f4_local6:addElement( f4_local7 )
f4_local6:addElement( f4_local11 )
self:addElement( f4_local5 )
self:addElement( f4_local6 )
return self
end
function captureHudDef()
local self = LUI.UIElement.new()
self.id = "capture_hud"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
bottom = 250,
left = -(f0_local2 / 2),
height = f0_local1,
width = f0_local2
} )
self:animateToState( "default", 0 )
self:registerOmnvarHandler( "ui_securing", f0_local11 )
self:addElement( f0_local12( f0_local10 ) )
return self
end
LUI.MenuBuilder.registerType( "captureHudDef", captureHudDef )
LockTable( _M )

File diff suppressed because it is too large Load Diff

6534
lui/mp_hud/alienhud.dec.lua Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,624 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ( f1_arg0, f1_arg1 )
if f1_arg1.value == 1 then
local f1_local0 = f1_arg0:getChildById( "vanguardWarning" )
f1_local0:animateToState( "default", 0 )
f1_local0.isBlinking = nil
f1_arg0:animateToState( "active", 100 )
local f1_local1 = f1_arg0:getChildById( "vanguardReticleImageId" )
f1_local1:animateToState( "active", 100 )
local f1_local2 = f1_arg0:getChildById( "vanguardStaticId" )
f1_local2:animateToState( "default", 100 )
local f1_local3 = f1_arg0:getChildById( "bar1" )
if not f1_local3.spinning then
local f1_local4 = MBh.AnimateLoop( {
{
"blink_on",
1000
},
{
"blink_off",
500
},
{
"blink_off",
500
}
} )
f1_local4( f1_local3 )
f1_local3.spinning = true
end
elseif f1_arg1.value >= 2 then
local f1_local0 = f1_arg0:getChildById( "vanguardStaticId" )
local f1_local1 = f1_arg0:getChildById( "vanguardReticleImageId" )
local f1_local2 = f1_arg0:getChildById( "vanguardWarning" )
if f1_arg1.value >= 10 then
f1_local0:animateToState( "active10", 200 )
f1_local1:animateToState( "default", 0 )
elseif f1_arg1.value >= 9 then
f1_local0:animateToState( "active9", 200 )
f1_local1:animateToState( "default", 0 )
elseif f1_arg1.value >= 8 then
f1_local0:animateToState( "active8", 200 )
f1_local1:animateToState( "default", 0 )
elseif f1_arg1.value >= 7 then
f1_local0:animateToState( "active7", 200 )
f1_local1:animateToState( "default", 0 )
elseif f1_arg1.value >= 6 then
f1_local0:animateToState( "active6", 200 )
f1_local1:animateToState( "active", 0 )
elseif f1_arg1.value >= 5 then
f1_local0:animateToState( "active5", 200 )
f1_local1:animateToState( "active", 0 )
elseif f1_arg1.value >= 4 then
f1_local0:animateToState( "active4", 200 )
f1_local1:animateToState( "active", 0 )
elseif f1_arg1.value >= 3 then
f1_local0:animateToState( "active3", 200 )
f1_local1:animateToState( "active", 0 )
else
f1_local0:animateToState( "active2", 200 )
f1_local1:animateToState( "active", 0 )
if not f1_local2.isBlinking then
f1_local2.isBlinking = true
local f1_local3 = MBh.AnimateLoop( {
{
"showing",
500
},
{
"blink",
500
}
} )
f1_local3( f1_local2 )
end
end
else
f1_arg0:animateToState( "default", 0 )
local f1_local0 = f1_arg0:getChildById( "vanguardStaticId" )
f1_local0:animateToState( "default", 0 )
end
end
f0_local1 = function ( f2_arg0, f2_arg1 )
local f2_local0 = f2_arg0:getChildById( "vanguardHeadingId" )
f2_local0:setText( Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_HEADING_LABEL", Game.GetOmnvar( "ui_vanguard_heading" ) ) )
local f2_local1 = f2_arg0:getChildById( "vanguardAltitudeId" )
f2_local1:setText( Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_ALT_LABEL", Game.GetOmnvar( "ui_vanguard_altitude" ) ) )
local f2_local2 = f2_arg0:getChildById( "vanguardRangeId" )
f2_local2:setText( Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_RANGE", Game.GetOmnvar( "ui_vanguard_range" ) ) )
end
f0_local2 = function ( f3_arg0, f3_arg1 )
local f3_local0 = f3_arg0:getChildById( "vanguardWeaponId" )
local f3_local1 = "@MP_ALIEN_DESCENT_VANGUARD_WEAPON_STATUS_READY"
if f3_arg1.value < 0 then
f3_local1 = "@MP_ALIEN_DESCENT_VANGUARD_WEAPON_STATUS_RELOAD"
local f3_local2 = f3_arg0:getChildById( "vanguardOverlayImageId" )
local f3_local3 = MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
100
},
{
"default",
500
}
} )
f3_local3( f3_local2 )
f3_local0:animateToState( "reload", 0 )
else
f3_local0:animateToState( "default", 0 )
end
f3_local0:setText( Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_WEAPON_STATUS_LABEL", Engine.Localize( f3_local1 ) ) )
end
local f0_local3 = function ( f4_arg0, f4_arg1 )
local f4_local0 = f4_arg0:getChildById( "vanguardHealthId" )
f4_local0:setText( Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_HEALTH", f4_arg1.value ) )
if f4_arg1.value < 25 then
f4_local0:animateToState( "near_death", 0 )
elseif f4_arg1.value < 50 then
f4_local0:animateToState( "damaged", 0 )
else
f4_local0:animateToState( "default", 0 )
end
end
local f0_local4 = function ( f5_arg0, f5_arg1 )
local f5_local0 = f5_arg0:getChildById( "vanguardControlsVLId" )
local f5_local1 = f5_local0:getChildById( "steeringTextId" )
local f5_local2 = f5_local0:getChildById( "steeringText2Id" )
local f5_local3 = f5_local0:getChildById( "fireTextId" )
if CoD.UsingController() then
f5_local1:setText( Engine.Localize( "@MP_ALIEN_DESCENT_REMOTE_UAV_ASCEND" ) )
f5_local2:setText( Engine.Localize( "@MP_ALIEN_DESCENT_REMOTE_UAV_DESCEND" ) )
else
f5_local1:setText( Engine.Localize( "@PLATFORM_REMOTE_UAV_ASCEND" ) )
f5_local2:setText( Engine.Localize( "@PLATFORM_REMOTE_UAV_DESCEND" ) )
end
f5_local3:setText( Engine.Localize( "@PLATFORM_PREDATOR_MISSILE_FIRE" ) )
end
function alienVanguardOverlayDef()
local f6_local0 = RegisterMaterial( "ac130_overlay_grain" )
local f6_local1 = RegisterMaterial( "gryphon_hud_mp_alien" )
local f6_local2 = RegisterMaterial( "white" )
local f6_local3, f6_local4 = GameX.GetScreenDims()
local f6_local5, f6_local6 = nil
local self = LUI.UIElement.new()
self.id = "vanguardOverlayContainerId"
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
right = 0,
bottom = 0
} )
self:animateToState( "default" )
local f6_local8 = LUI.UIElement.new()
f6_local8.id = "vanguardOverlayMainElemId"
f6_local8:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
alpha = 0
} )
f6_local8:animateToState( "default", 0 )
f6_local8:registerAnimationState( "active", {
alpha = 1
} )
f6_local8:registerOmnvarHandler( "ui_vanguard", f0_local0 )
f6_local8:registerEventHandler( "init_overlay", f0_local0 )
f6_local8:registerEventHandler( "refresh_controls", f0_local4 )
f6_local8:registerOmnvarHandler( "ui_vanguard_heading", f0_local1 )
f6_local8:registerOmnvarHandler( "ui_vanguard_ammo", f0_local2 )
f6_local8:registerOmnvarHandler( "ui_vanguard_health", f0_local3 )
local f6_local9 = LUI.UIImage.new()
f6_local9.id = "vanguardOverlayImageId"
f6_local9:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f6_local0,
red = 0.9,
green = 1,
blue = 1,
alpha = 0.45
} )
f6_local9:animateToState( "default", 0 )
f6_local9:registerAnimationState( "active", {
alpha = 1
} )
f6_local8:addElement( f6_local9 )
local f6_local10 = LUI.UIImage.new()
f6_local10.id = "vanguardReticleImageId"
f6_local10:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f6_local1,
alpha = 0
} )
f6_local10:animateToState( "default", 0 )
f6_local10:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f6_local1,
alpha = 1
} )
f6_local8:addElement( f6_local10 )
local f6_local11 = LUI.UIText.new()
f6_local11.id = "vanguardWarning"
f6_local11:setText( Engine.Localize( "@MP_ALIEN_DESCENT_REMOTE_UAV_OUT_OF_RANGE" ) )
f6_local11:setTextStyle( CoD.TextStyle.None )
f6_local11:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 256,
height = CoD.TextSettings.HudEuroBigFont.Height,
font = CoD.TextSettings.HudEuroBigFont.Font,
alignment = LUI.Alignment.Center,
red = Colors.red.r,
green = Colors.red.g,
blue = Colors.red.b,
alpha = 0
} )
f6_local11:animateToState( "default", 0 )
f6_local11:registerAnimationState( "showing", {
red = Colors.red.r,
alpha = 1
} )
f6_local11:registerAnimationState( "blink", {
red = 0.5,
alpha = 0.5
} )
if not MLG.IsMLGSpectator() then
f6_local6 = LUI.UIHorizontalList.new()
f6_local6.id = "vanguardControlsVLId"
f6_local6:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = -66,
left = -384,
right = 384,
height = 64,
alpha = 1,
spacing = 0
} )
f6_local6:animateToState( "default", 0 )
local f6_local12 = LUI.UIText.new()
f6_local12.id = "steeringTextId"
local f6_local13 = nil
if CoD.UsingController() then
f6_local13 = "@MP_ALIEN_DESCENT_REMOTE_UAV_ASCEND"
else
f6_local13 = "@PLATFORM_REMOTE_UAV_ASCEND"
end
f6_local12:setText( Engine.Localize( f6_local13 ) )
f6_local12:setTextStyle( CoD.TextStyle.Shadowed )
f6_local12:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = 0,
width = 192,
height = CoD.TextSettings.HudEuroNormalFont.Height,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alignment = LUI.Alignment.Center
} )
f6_local12:animateToState( "default", 0 )
local f6_local14 = LUI.UIText.new()
f6_local14.id = "steeringText2Id"
if CoD.UsingController() then
f6_local13 = "@MP_ALIEN_DESCENT_REMOTE_UAV_DESCEND"
else
f6_local13 = "@PLATFORM_REMOTE_UAV_DESCEND"
end
f6_local14:setText( Engine.Localize( f6_local13 ) )
f6_local14:setTextStyle( CoD.TextStyle.Shadowed )
f6_local14:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = 0,
width = 192,
height = CoD.TextSettings.HudEuroNormalFont.Height,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alignment = LUI.Alignment.Center
} )
f6_local14:animateToState( "default", 0 )
local f6_local15 = LUI.UIText.new()
f6_local15.id = "fireTextId"
if Engine.IsConsoleGame() then
f6_local15:setText( Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_ALT_FIRE" ) )
else
f6_local15:setText( Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_ALT_FIRE_PC" ) )
end
f6_local15:setTextStyle( CoD.TextStyle.Shadowed )
f6_local15:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = 0,
width = 192,
height = CoD.TextSettings.HudEuroNormalFont.Height,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alignment = LUI.Alignment.Center
} )
f6_local15:animateToState( "default", 0 )
local f6_local16 = LUI.UIText.new()
f6_local16.id = "missileTextId"
f6_local16:setText( Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_LAUNCH_MISSILE" ) )
f6_local16:setTextStyle( CoD.TextStyle.Shadowed )
f6_local16:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = 0,
width = 192,
height = CoD.TextSettings.HudEuroNormalFont.Height,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alignment = LUI.Alignment.Center
} )
f6_local16:animateToState( "default", 0 )
f6_local6:addElement( f6_local14 )
f6_local6:addElement( f6_local15 )
f6_local6:addElement( f6_local16 )
f6_local6:addElement( f6_local12 )
end
if not MLG.IsMLGSpectator() then
f6_local5 = LUI.UIText.new()
f6_local5.id = "vanguardTitleId"
f6_local5:setText( Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_TITLE" ) )
f6_local5:setTextStyle( CoD.TextStyle.None )
f6_local5:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 72,
left = 130,
height = CoD.TextSettings.HudEuroConRegSmallFont.Height,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Left
} )
f6_local5:animateToState( "default", 0 )
f6_local8:addElement( f6_local5 )
end
local f6_local12 = RegisterMaterial( "apache_ammo_mp" )
local f6_local13 = LUI.UIImage.new()
f6_local13.id = "bar1"
f6_local13:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 72,
right = 128,
height = 16,
width = 16,
material = f6_local12,
alpha = 1,
zRot = 90
} )
f6_local13:animateToState( "default", 0 )
f6_local13:registerAnimationState( "blink_on", {
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f6_local13:registerAnimationState( "blink_off", {
red = Colors.grey_2.r,
green = Colors.grey_2.g,
blue = Colors.grey_2.b,
alpha = 0.25
} )
f6_local8:addElement( f6_local13 )
f6_local5 = LUI.UIText.new()
f6_local5.id = "vanguardFlightModeId"
f6_local5:setText( Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_FLIGHT_MODE" ) )
f6_local5:setTextStyle( CoD.TextStyle.None )
f6_local5:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -144,
left = 160,
height = CoD.TextSettings.HudEuroConRegSmallFont.Height,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Left
} )
f6_local5:animateToState( "default", 0 )
f6_local8:addElement( f6_local5 )
f6_local5 = LUI.UIText.new()
f6_local5.id = "vanguardHeadingId"
f6_local5:setText( Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_HEADING_LABEL" ) )
f6_local5:setTextStyle( CoD.TextStyle.None )
f6_local5:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -122,
left = 160,
height = CoD.TextSettings.HudEuroConRegSmallFont.Height,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Left
} )
f6_local5:animateToState( "default", 0 )
f6_local8:addElement( f6_local5 )
f6_local5 = LUI.UIText.new()
f6_local5.id = "vanguardAltitudeId"
f6_local5:setText( Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_ALT_LABEL" ) )
f6_local5:setTextStyle( CoD.TextStyle.None )
f6_local5:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -100,
left = 160,
height = CoD.TextSettings.HudEuroConRegSmallFont.Height,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Left
} )
f6_local5:animateToState( "default", 0 )
f6_local8:addElement( f6_local5 )
f6_local5 = LUI.UIText.new()
f6_local5.id = "vanguardWeaponId"
f6_local5:setText( Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_WEAPON_STATUS_LABEL", Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_WEAPON_STATUS_READY" ) ) )
f6_local5:setTextStyle( CoD.TextStyle.None )
f6_local5:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -144,
right = -165,
height = CoD.TextSettings.HudEuroConRegSmallFont.Height,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Right,
red = 0,
green = 1,
blue = 0,
alpha = 1
} )
f6_local5:animateToState( "default", 0 )
f6_local5:registerAnimationState( "reload", {
red = 1,
green = 0,
blue = 0
} )
f6_local8:addElement( f6_local5 )
f6_local5 = LUI.UIText.new()
f6_local5.id = "vanguardRangeId"
f6_local5:setText( Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_RANGE", 0 ) )
f6_local5:setTextStyle( CoD.TextStyle.None )
f6_local5:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -122,
right = -165,
height = CoD.TextSettings.HudEuroConRegSmallFont.Height,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Right,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f6_local5:animateToState( "default", 0 )
f6_local8:addElement( f6_local5 )
f6_local5 = LUI.UIText.new()
f6_local5.id = "vanguardHealthId"
f6_local5:setText( Engine.Localize( "@MP_ALIEN_DESCENT_VANGUARD_HEALTH", 100 ) )
f6_local5:setTextStyle( CoD.TextStyle.None )
f6_local5:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -100,
right = -165,
height = CoD.TextSettings.HudEuroConRegSmallFont.Height,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Right,
red = 0,
green = 1,
blue = 0,
alpha = 1
} )
f6_local5:animateToState( "default", 0 )
f6_local5:registerAnimationState( "damaged", {
red = 1,
green = 1,
blue = 0
} )
f6_local5:registerAnimationState( "near_death", {
red = 1,
green = 0,
blue = 0
} )
f6_local8:addElement( f6_local5 )
local f6_local14 = LUI.UIElement.new()
f6_local14.id = "vanguardStaticId"
f6_local14:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
alpha = 0
} )
f6_local14:animateToState( "default", 0 )
f6_local14:registerAnimationState( "active", {
alpha = 0.1
} )
f6_local14:registerAnimationState( "active2", {
alpha = 0.2
} )
f6_local14:registerAnimationState( "active3", {
alpha = 0.3
} )
f6_local14:registerAnimationState( "active4", {
alpha = 0.4
} )
f6_local14:registerAnimationState( "active5", {
alpha = 0.5
} )
f6_local14:registerAnimationState( "active6", {
alpha = 0.6
} )
f6_local14:registerAnimationState( "active7", {
alpha = 0.7
} )
f6_local14:registerAnimationState( "active8", {
alpha = 0.8
} )
f6_local14:registerAnimationState( "active9", {
alpha = 0.9
} )
f6_local14:registerAnimationState( "active10", {
alpha = 1
} )
local f6_local15 = LUI.UIImage.new()
f6_local15.id = "vanguardWhiteImageId"
f6_local15:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f6_local2
} )
f6_local15:animateToState( "default", 0 )
local f6_local16 = LUI.UIImage.new()
f6_local16.id = "vanguardStaticImageId"
f6_local16:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f6_local0
} )
f6_local16:animateToState( "default", 0 )
f6_local14:addElement( f6_local15 )
f6_local14:addElement( f6_local16 )
if not MLG.IsMLGSpectator() then
f6_local8:addElement( f6_local6 )
end
f6_local8:addElement( f6_local14 )
f6_local8:addElement( f6_local11 )
self:addElement( f6_local8 )
return self
end
LUI.MenuBuilder.registerType( "alienVanguardOverlayDef", alienVanguardOverlayDef )
LockTable( _M )

View File

@ -0,0 +1,983 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 1
f0_local1 = 64 * f0_local0
f0_local2 = 256 * f0_local0
local f0_local3 = 16 * f0_local0
local f0_local4 = 210 * f0_local0
local f0_local5 = 256 * f0_local0
local f0_local6 = 16 * f0_local0
local f0_local7 = 16 * f0_local0
local f0_local8 = false
local f0_local9 = function ( f1_arg0, f1_arg1 )
local f1_local0 = f1_arg0
local f1_local1 = f1_arg0:getFirstDescendentById( "capturing_bar" )
local f1_local2 = f1_arg0:getFirstDescendentById( "capturing_refresh_timer" )
local f1_local3 = f1_arg0:getFirstDescendentById( "capturing_text" )
local f1_local4 = f1_arg0:getFirstDescendentById( "capturing_bar_bg" )
local f1_local5 = f1_arg0:getFirstDescendentById( "capturing_bar_hl" )
local f1_local6 = f1_local5:getFirstDescendentById( "start_cap" )
local f1_local7 = f1_local5:getFirstDescendentById( "middle" )
local f1_local8 = f1_local5:getFirstDescendentById( "end_cap" )
f0_local8 = false
if Game.GetOmnvar( "ui_securing_progress" ) >= 1 and not f0_local8 then
f0_local8 = true
end
if f1_local4.current_state ~= "default" then
f1_local4:animateToState( "default", 0 )
f1_local4.current_state = "default"
end
if f0_local8 then
if f1_local1.current_state ~= "secured" then
local f1_local9 = MBh.AnimateSequence( {
{
"active",
500
},
{
"blink_off",
50
},
{
"blink_off",
50
},
{
"blink_on",
0
},
{
"blink_on",
50
},
{
"blink_off",
50
},
{
"blink_off",
50
},
{
"blink_on",
0
},
{
"blink_on",
50
},
{
"blink_off",
150
}
} )
f1_local9( f1_local1 )
f1_local1.current_state = "secured"
end
if f1_local3.current_state ~= "secured" then
local f1_local9 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
250
},
{
"secured",
0
}
} )
f1_local9( f1_local3 )
f1_local3.current_state = "secured"
end
if f1_local6.current_state ~= "secured" then
f1_local6:animateToState( "secured" )
f1_local6.current_state = "secured"
end
if f1_local7.current_state ~= "secured" then
f1_local7:animateToState( "secured" )
f1_local7.current_state = "secured"
end
if f1_local8.current_state ~= "secured" then
f1_local8:animateToState( "secured" )
f1_local8.current_state = "secured"
end
else
if f1_local1.current_state ~= "default" then
f1_local1:animateToState( "default", 0 )
f1_local1.current_state = "default"
end
if f1_local5.current_state ~= "default" then
f1_local5:animateToState( "default", 0 )
f1_local5.current_state = "default"
end
if f1_local3.current_state ~= "default" then
f1_local3:animateToState( "default", 0 )
f1_local3.current_state = "default"
end
if f1_local7.current_state ~= "default" then
f1_local7:animateToState( "default", 0 )
f1_local7.current_state = "default"
end
end
end
local f0_local10 = function ( f2_arg0, f2_arg1 )
local f2_local0 = f2_arg0
local f2_local1 = f2_arg0:getFirstDescendentById( "capturing_refresh_timer" )
local f2_local2 = f2_arg0:getFirstDescendentById( "capturing_text" )
local f2_local3 = f2_arg0:getFirstDescendentById( "capturing_bar_bg" )
local f2_local4 = f2_arg0:getFirstDescendentById( "capturing_bar_hl" )
local f2_local5 = f2_local4:getFirstDescendentById( "start_cap" )
local f2_local6 = f2_local4:getFirstDescendentById( "middle" )
local f2_local7 = f2_local4:getFirstDescendentById( "end_cap" )
local f2_local8 = f2_local1.value
local f2_local9 = ""
if f2_local8 == 0 then
LUI.UITimer.Stop( f2_local1 )
return
elseif f2_local8 == 1 then
f2_local9 = Engine.Localize( "@KILLSTREAKS_CAPTURING_CRATE" )
elseif f2_local8 == 2 then
f2_local9 = Engine.Localize( "@LUA_MENU_ACQUIRING_INTEL" )
elseif f2_local8 == 3 then
f2_local9 = Engine.Localize( "@KILLSTREAKS_BOX_GETTING_VEST" )
elseif f2_local8 == 4 then
f2_local9 = Engine.Localize( "@KILLSTREAKS_DEPLOYABLE_AMMO_TAKING" )
elseif f2_local8 == 5 then
f2_local9 = Engine.Localize( "@MPUI_REVIVING" )
elseif f2_local8 == 6 then
f2_local9 = Engine.Localize( "@MPUI_BEING_REVIVED" )
elseif f2_local8 == 7 then
f2_local9 = Engine.Localize( "@MP_BREACHING" )
elseif f2_local8 == 8 then
f2_local9 = Engine.Localize( "@MP_PATCH_USING" )
end
if f2_local0.current_state ~= "active" then
f2_local0:animateToState( "active", 250 )
f2_local0.current_state = "active"
end
if f2_local3.current_state ~= "active" then
f2_local3:animateToState( "active", 250 )
f2_local3.current_state = "active"
end
if f2_local4.current_state ~= "active" then
f2_local4:animateToState( "active", 250 )
f2_local4.current_state = "active"
end
if f2_local5.current_state ~= "default" then
f2_local5:animateToState( "default" )
f2_local5.current_state = "default"
end
if f2_local6.current_state ~= "default" then
f2_local6:animateToState( "default" )
f2_local6.current_state = "default"
end
if f2_local7.current_state ~= "default" then
f2_local7:animateToState( "default" )
f2_local7.current_state = "default"
end
if f2_local2.current_state ~= "securing" then
f2_local2:setText( f2_local9 )
local f2_local10 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
250
},
{
"active",
0
}
} )
f2_local10( f2_local2 )
f2_local2.current_state = "securing"
end
f2_local6:registerAnimationState( "move_bar", {
right = f2_local6.m_maxWidth * Game.GetOmnvar( "ui_securing_progress" )
} )
f2_local6:animateToState( "move_bar", 150 )
end
local f0_local11 = function ( f3_arg0, f3_arg1 )
local f3_local0 = f3_arg0:getFirstDescendentById( "capturing_refresh_timer" )
if f3_arg1.value > 0 then
LUI.UITimer.Reset( f3_local0 )
else
LUI.UITimer.Stop( f3_local0 )
f0_local9( f3_arg0, f3_arg1 )
end
f3_local0.value = f3_arg1.value
end
local f0_local12 = function ( f4_arg0, f4_arg1 )
local f4_local0 = f4_arg0
local f4_local1 = f4_arg0:getFirstDescendentById( "capturing_bar" )
local f4_local2 = f4_arg0:getFirstDescendentById( "capturing_refresh_timer" )
local f4_local3 = f4_arg0:getFirstDescendentById( "capturing_text" )
local f4_local4 = f4_arg0:getFirstDescendentById( "capturing_bar_bg" )
local f4_local5 = f4_arg0:getFirstDescendentById( "capturing_bar_hl" )
local f4_local6 = f4_local5:getFirstDescendentById( "start_cap" )
local f4_local7 = f4_local5:getFirstDescendentById( "middle" )
local f4_local8 = f4_local5:getFirstDescendentById( "end_cap" )
local f4_local9 = f4_local2.value
local f4_local10 = ""
if f4_local9 == 1 then
f4_local10 = Engine.Localize( "@LUA_MENU_SECURED_A" )
elseif f4_local9 == 2 then
f4_local10 = Engine.Localize( "@LUA_MENU_SECURED_B" )
elseif f4_local9 == 3 then
f4_local10 = Engine.Localize( "@LUA_MENU_SECURED_C" )
end
f0_local8 = false
if 1 <= Game.GetOmnvar( "ui_dom_progress" ) and not f0_local8 then
f0_local8 = true
end
if f4_local4.current_state ~= "default" then
f4_local4:animateToState( "default", 0 )
f4_local4.current_state = "default"
end
if f0_local8 and f4_arg1.name ~= "playerstate_client_changed" then
if f4_local1.current_state ~= "secured" then
local f4_local11 = MBh.AnimateSequence( {
{
"active",
500
},
{
"blink_off",
50
},
{
"blink_off",
50
},
{
"blink_on",
0
},
{
"blink_on",
50
},
{
"blink_off",
50
},
{
"blink_off",
50
},
{
"blink_on",
0
},
{
"blink_on",
50
},
{
"blink_off",
150
}
} )
f4_local11( f4_local1 )
f4_local1.current_state = "secured"
end
if f4_local3.current_text ~= f4_local10 and f4_local10 ~= "" then
f4_local3:setText( f4_local10 )
f4_local3.current_text = f4_local10
end
if f4_local3.current_state ~= "secured" then
local f4_local11 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
250
},
{
"secured",
0
}
} )
f4_local11( f4_local3 )
f4_local3.current_state = "secured"
end
if f4_local6.current_state ~= "secured" then
f4_local6:animateToState( "secured" )
f4_local6.current_state = "secured"
end
if f4_local7.current_state ~= "secured" then
f4_local7:animateToState( "secured" )
f4_local7.current_state = "secured"
end
if f4_local8.current_state ~= "secured" then
f4_local8:animateToState( "secured" )
f4_local8.current_state = "secured"
end
else
if f4_local1.current_state ~= "default" then
f4_local1:animateToState( "default", 0 )
f4_local1.current_state = "default"
end
if f4_local5.current_state ~= "default" then
f4_local5:animateToState( "default", 0 )
f4_local5.current_state = "default"
end
if f4_local3.current_state ~= "default" then
f4_local3:animateToState( "default", 0 )
f4_local3.current_state = "default"
end
if f4_local7.current_state ~= "default" then
f4_local7:animateToState( "default", 0 )
f4_local7.current_state = "default"
end
end
end
local f0_local13 = function ( f5_arg0, f5_arg1 )
local f5_local0 = f5_arg0
local f5_local1 = f5_arg0:getFirstDescendentById( "capturing_refresh_timer" )
local f5_local2 = f5_arg0:getFirstDescendentById( "capturing_text" )
local f5_local3 = f5_arg0:getFirstDescendentById( "capturing_bar_bg" )
local f5_local4 = f5_arg0:getFirstDescendentById( "capturing_bar_hl" )
local f5_local5 = f5_local4:getFirstDescendentById( "start_cap" )
local f5_local6 = f5_local4:getFirstDescendentById( "middle" )
local f5_local7 = f5_local4:getFirstDescendentById( "end_cap" )
local f5_local8 = f5_local1.value
local f5_local9 = ""
if f5_local8 == 0 then
LUI.UITimer.Stop( f5_local1 )
return
elseif f5_local8 == 1 then
f5_local9 = Engine.Localize( "@LUA_MENU_SECURING_A" )
elseif f5_local8 == 2 then
f5_local9 = Engine.Localize( "@LUA_MENU_SECURING_B" )
elseif f5_local8 == 3 then
f5_local9 = Engine.Localize( "@LUA_MENU_SECURING_C" )
end
if 0 < Game.GetOmnvar( "ui_dom_stalemate" ) then
if f5_local0.current_state ~= "active" then
f5_local0:animateToState( "active", 0 )
f5_local0.current_state = "active"
end
if f5_local2.current_state ~= "contested" then
local f5_local10 = Engine.Localize( "@LUA_MENU_CONTESTED" )
f5_local2:setText( f5_local10 )
local f5_local11 = MBh.AnimateLoop( {
{
"contested",
0
},
{
"contested_off_for_loop",
500
}
} )
f5_local11( f5_local2 )
f5_local2.current_state = "contested"
f5_local2.current_text = f5_local10
end
if f5_local5.current_state ~= "contested" then
f5_local5:animateToState( "contested" )
f5_local5.current_state = "contested"
end
if f5_local6.current_state ~= "contested" then
f5_local6:animateToState( "contested" )
f5_local6.current_state = "contested"
end
if f5_local7.current_state ~= "contested" then
f5_local7:animateToState( "contested" )
f5_local7.current_state = "contested"
end
else
if f5_local0.current_state ~= "active" then
f5_local0:animateToState( "active", 250 )
f5_local0.current_state = "active"
end
if f5_local3.current_state ~= "active" then
f5_local3:animateToState( "active", 250 )
f5_local3.current_state = "active"
end
if f5_local4.current_state ~= "active" then
f5_local4:animateToState( "active", 250 )
f5_local4.current_state = "active"
end
if f5_local5.current_state ~= "default" then
f5_local5:animateToState( "default" )
f5_local5.current_state = "default"
end
if f5_local6.current_state ~= "default" then
f5_local6:animateToState( "default" )
f5_local6.current_state = "default"
end
if f5_local7.current_state ~= "default" then
f5_local7:animateToState( "default" )
f5_local7.current_state = "default"
end
if f5_local2.current_text ~= f5_local9 then
f5_local2:setText( f5_local9 )
f5_local2.current_text = f5_local9
end
if f5_local2.current_state ~= "securing" then
local f5_local10 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
250
},
{
"active",
0
}
} )
f5_local10( f5_local2 )
f5_local2.current_state = "securing"
end
f5_local6:registerAnimationState( "move_bar", {
right = f5_local6.m_maxWidth * Game.GetOmnvar( "ui_dom_progress" )
} )
f5_local6:animateToState( "move_bar", 150 )
end
end
local f0_local14 = function ( f6_arg0, f6_arg1 )
local f6_local0 = f6_arg0:getFirstDescendentById( "capturing_refresh_timer" )
if f6_arg1.value > 0 then
LUI.UITimer.Reset( f6_local0 )
else
LUI.UITimer.Stop( f6_local0 )
f0_local12( f6_arg0, f6_arg1 )
end
f6_local0.value = f6_arg1.value
end
local f0_local15 = function ( f7_arg0, f7_arg1 )
local f7_local0 = f7_arg0
local f7_local1 = f7_arg0:getFirstDescendentById( "capturing_bar" )
local f7_local2 = f7_arg0:getFirstDescendentById( "capturing_refresh_timer" )
local f7_local3 = f7_arg0:getFirstDescendentById( "capturing_text" )
local f7_local4 = f7_arg0:getFirstDescendentById( "capturing_bar_bg" )
local f7_local5 = f7_arg0:getFirstDescendentById( "capturing_bar_hl" )
local f7_local6 = f7_local5:getFirstDescendentById( "start_cap" )
local f7_local7 = f7_local5:getFirstDescendentById( "middle" )
local f7_local8 = f7_local5:getFirstDescendentById( "end_cap" )
local f7_local9 = f7_local2.value
local f7_local10 = ""
if f7_local9 == 1 then
f7_local10 = Engine.Localize( "@SPLASHES_PLANT" )
elseif f7_local9 == 2 then
f7_local10 = Engine.Localize( "@SPLASHES_DEFUSE" )
end
f0_local8 = false
if 1 <= Game.GetOmnvar( "ui_planting_defusing_progress" ) and not f0_local8 then
f0_local8 = true
end
if f7_local4.current_state ~= "default" then
f7_local4:animateToState( "default", 0 )
f7_local4.current_state = "default"
end
if f0_local8 and f7_arg1.name ~= "playerstate_client_changed" then
if f7_local1.current_state ~= "secured" then
local f7_local11 = MBh.AnimateSequence( {
{
"active",
500
},
{
"blink_off",
50
},
{
"blink_off",
50
},
{
"blink_on",
0
},
{
"blink_on",
50
},
{
"blink_off",
50
},
{
"blink_off",
50
},
{
"blink_on",
0
},
{
"blink_on",
50
},
{
"blink_off",
150
}
} )
f7_local11( f7_local1 )
f7_local1.current_state = "secured"
end
if f7_local3.current_state ~= "secured" then
f7_local3:setText( f7_local10 )
local f7_local11 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
250
},
{
"secured",
0
}
} )
f7_local11( f7_local3 )
f7_local3.current_state = "secured"
end
if f7_local6.current_state ~= "secured" then
f7_local6:animateToState( "secured" )
f7_local6.current_state = "secured"
end
if f7_local7.current_state ~= "secured" then
f7_local7:animateToState( "secured" )
f7_local7.current_state = "secured"
end
if f7_local8.current_state ~= "secured" then
f7_local8:animateToState( "secured" )
f7_local8.current_state = "secured"
end
else
if f7_local1.current_state ~= "default" then
f7_local1:animateToState( "default", 0 )
f7_local1.current_state = "default"
end
if f7_local5.current_state ~= "default" then
f7_local5:animateToState( "default", 0 )
f7_local5.current_state = "default"
end
if f7_local3.current_state ~= "default" then
f7_local3:animateToState( "default", 0 )
f7_local3.current_state = "default"
end
f7_local7:animateToState( "default", 0 )
f7_local7.current_state = "default"
end
end
local f0_local16 = function ( f8_arg0, f8_arg1 )
local f8_local0 = f8_arg0
local f8_local1 = f8_arg0:getFirstDescendentById( "capturing_refresh_timer" )
local f8_local2 = f8_arg0:getFirstDescendentById( "capturing_text" )
local f8_local3 = f8_arg0:getFirstDescendentById( "capturing_bar_bg" )
local f8_local4 = f8_arg0:getFirstDescendentById( "capturing_bar_hl" )
local f8_local5 = f8_local4:getFirstDescendentById( "start_cap" )
local f8_local6 = f8_local4:getFirstDescendentById( "middle" )
local f8_local7 = f8_local4:getFirstDescendentById( "end_cap" )
local f8_local8 = f8_local1.value
local f8_local9 = ""
if isSecuring == 0 then
LUI.UITimer.Stop( f8_local1 )
return
elseif f8_local8 == 1 then
f8_local9 = Engine.Localize( "@MP_PLANTING_EXPLOSIVE" )
elseif f8_local8 == 2 then
f8_local9 = Engine.Localize( "@MP_DEFUSING_EXPLOSIVE" )
end
if f8_local0.current_state ~= "active" then
f8_local0:animateToState( "active", 250 )
f8_local0.current_state = "active"
end
if f8_local3.current_state ~= "active" then
f8_local3:animateToState( "active", 250 )
f8_local3.current_state = "active"
end
if f8_local4.current_state ~= "active" then
f8_local4:animateToState( "active", 250 )
f8_local4.current_state = "active"
end
if f8_local5.current_state ~= "default" then
f8_local5:animateToState( "default" )
f8_local5.current_state = "default"
end
if f8_local6.current_state ~= "default" then
f8_local6:animateToState( "default" )
f8_local6.current_state = "default"
end
if f8_local7.current_state ~= "default" then
f8_local7:animateToState( "default" )
f8_local7.current_state = "default"
end
if f8_local2.current_state ~= "securing" then
f8_local2:setText( f8_local9 )
local f8_local10 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
250
},
{
"active",
0
}
} )
f8_local10( f8_local2 )
f8_local2.current_state = "securing"
end
f8_local6:registerAnimationState( "move_bar", {
width = f8_local6.m_maxWidth * Game.GetOmnvar( "ui_planting_defusing_progress" )
} )
f8_local6:animateToState( "move_bar", 150 )
end
local f0_local17 = function ( f9_arg0, f9_arg1 )
local f9_local0 = f9_arg0:getFirstDescendentById( "capturing_refresh_timer" )
if f9_arg1.value > 0 then
LUI.UITimer.Reset( f9_local0 )
else
LUI.UITimer.Stop( f9_local0 )
f0_local15( f9_arg0, f9_arg1 )
end
f9_local0.value = f9_arg1.value
end
local f0_local18 = function ( f10_arg0 )
local f10_local0 = RegisterMaterial( "capturing_bg_mp" )
local f10_local1 = RegisterMaterial( "capturing_bar_end_mp" )
local f10_local2 = RegisterMaterial( "capturing_bar_mp" )
local f10_local3 = RegisterMaterial( "capturing_bar_start_mp" )
local self = LUI.UIElement.new()
self.id = "capturing_bar"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -(f0_local1 / 2),
left = -(f0_local2 / 2),
height = f0_local1,
width = f0_local2,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
alpha = 1
} )
self:registerAnimationState( "blink_on", {
alpha = 1
} )
self:registerAnimationState( "blink_off", {
alpha = 0
} )
self:registerEventHandler( "capture_refresh", f10_arg0 )
local f10_local5 = LUI.UITimer.new( 100, "capture_refresh", nil, false, false, false, true )
f10_local5.id = "capturing_refresh_timer"
f10_local5.value = 0
local f10_local6 = LUI.UIImage.new()
f10_local6.id = "capturing_bar_bg"
f10_local6:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f10_local0
} )
f10_local6:animateToState( "default", 0 )
local f10_local7 = LUI.UIHorizontalList.new()
f10_local7.id = "capturing_bar_hl"
f10_local7:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -33,
left = 27,
height = f0_local3,
width = f0_local4,
alignment = LUI.Alignment.Left,
spacing = 0,
alpha = 0
} )
f10_local7:animateToState( "default", 0 )
f10_local7:registerAnimationState( "active", {
alpha = 1
} )
local f10_local8 = LUI.UIImage.new()
f10_local8.id = "start_cap"
f10_local8:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
height = f0_local3,
width = f0_local7,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
material = f10_local3
} )
f10_local8:animateToState( "default", 0 )
f10_local8:registerAnimationState( "secured", {
red = Colors.cyan.r,
green = Colors.cyan.g,
blue = Colors.cyan.b
} )
f10_local8:registerAnimationState( "contested", {
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b
} )
local f10_local9 = LUI.UIImage.new()
f10_local9.id = "middle"
f10_local9.m_maxWidth = f0_local4 - f0_local7 - f0_local7
f10_local9:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
height = f0_local3,
width = 0,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
material = f10_local2
} )
f10_local9:animateToState( "default", 0 )
f10_local9:registerAnimationState( "secured", {
red = Colors.cyan.r,
green = Colors.cyan.g,
blue = Colors.cyan.b
} )
f10_local9:registerAnimationState( "contested", {
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b
} )
local f10_local10 = LUI.UIImage.new()
f10_local10.id = "end_cap"
f10_local10:registerAnimationState( "default", {
topAnchor = true,
rightAnchor = true,
top = 0,
right = 0,
height = f0_local3,
width = f0_local7,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
material = f10_local1
} )
f10_local10:animateToState( "default", 0 )
f10_local10:registerAnimationState( "secured", {
red = Colors.cyan.r,
green = Colors.cyan.g,
blue = Colors.cyan.b
} )
f10_local10:registerAnimationState( "contested", {
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b
} )
f10_local7:addElement( f10_local8 )
f10_local7:addElement( f10_local9 )
f10_local7:addElement( f10_local10 )
local f10_local11 = LUI.UIText.new()
f10_local11.id = "capturing_text"
f10_local11:setText( "" )
f10_local11:setTextStyle( CoD.TextStyle.Shadowed )
f10_local11:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = -400,
height = CoD.TextSettings.HudEuroMedTinyFont.Height,
width = f0_local5,
font = CoD.TextSettings.HudEuroMedTinyFont.Font,
alignment = LUI.Alignment.Right,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 0
} )
f10_local11:animateToState( "default", 0 )
local f10_local12 = -50
f10_local11:registerAnimationState( "opening", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = f10_local12,
height = CoD.TextSettings.HudEuroMedTinyFont.Height,
width = f0_local5,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f10_local11:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = f10_local12,
height = CoD.TextSettings.HudEuroMedTinyFont.Height,
width = f0_local5,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f10_local11:registerAnimationState( "secured", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = f10_local12,
height = CoD.TextSettings.HudEuroMedTinyFont.Height,
width = f0_local5,
red = Colors.cyan.r,
green = Colors.cyan.g,
blue = Colors.cyan.b,
alpha = 1
} )
f10_local11:registerAnimationState( "contested", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = f10_local12,
height = CoD.TextSettings.HudEuroMedTinyFont.Height,
width = f0_local5,
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b,
alpha = 1
} )
f10_local11:registerAnimationState( "contested_off_for_loop", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = f10_local12,
height = CoD.TextSettings.HudEuroMedTinyFont.Height,
width = f0_local5,
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b,
alpha = 0
} )
f10_local6:addElement( f10_local7 )
f10_local6:addElement( f10_local11 )
self:addElement( f10_local5 )
self:addElement( f10_local6 )
return self
end
local f0_local19 = function ()
local self = LUI.UIElement.new()
self.id = "capture_hud"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 250,
left = -(f0_local2 / 2),
height = f0_local1,
width = f0_local2
} )
self:animateToState( "default", 0 )
self:registerOmnvarHandler( "ui_securing", f0_local11 )
self:addElement( f0_local18( f0_local10 ) )
return self
end
local f0_local20 = function ()
local self = LUI.UIElement.new()
self.id = "capture_dom_hud"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = GameX.IsSplitscreen() and 100 or 200,
left = -(f0_local2 / 2),
height = f0_local1,
width = f0_local2
} )
self:animateToState( "default", 0 )
self:registerEventHandler( "playerstate_client_changed", function ( element, event )
f0_local14( element, {
name = event.name,
value = Game.GetOmnvar( "ui_dom_securing" )
} )
end )
self:registerOmnvarHandler( "ui_dom_securing", f0_local14 )
self:addElement( f0_local18( f0_local13 ) )
return self
end
local f0_local21 = function ()
local self = LUI.UIElement.new()
self.id = "bomb_plant_defuse_hud"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 200,
left = -(f0_local2 / 2),
height = f0_local1,
width = f0_local2
} )
self:animateToState( "default", 0 )
self:registerEventHandler( "playerstate_client_changed", function ( element, event )
f0_local17( element, {
name = event.name,
value = Game.GetOmnvar( "ui_bomb_planting_defusing" )
} )
end )
self:registerOmnvarHandler( "ui_bomb_planting_defusing", f0_local17 )
self:addElement( f0_local18( f0_local16 ) )
return self
end
LUI.MenuBuilder.registerType( "captureHudDef", f0_local19 )
LUI.MenuBuilder.registerType( "captureDomHudDef", f0_local20 )
LUI.MenuBuilder.registerType( "bombPlantDefuseHudDef", f0_local21 )
LockTable( _M )

View File

@ -0,0 +1,561 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ( f1_arg0, f1_arg1 )
f1_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
f0_local1 = function ( f2_arg0, f2_arg1, f2_arg2 )
Engine.NotifyServer( "class_select", f2_arg2 )
LUI.FlowManager.RequestLeaveMenu( f2_arg0 )
end
f0_local2 = function ( f3_arg0, f3_arg1 )
local f3_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f3_arg0 )
if f3_local0.defaultLoadouts then
f3_arg0:dispatchEventToMenuRoot( {
name = "refresh_char_select_list",
defaultLoadouts = false
} )
else
LUI.FlowManager.RequestLeaveMenu( f3_arg0 )
end
end
local f0_local3 = function ( f4_arg0, f4_arg1, f4_arg2 )
local f4_local0 = GameX.GetGameMode()
if f4_local0 == "infect" and not Cac.IsClassInUse( f4_arg0, f4_arg1, f4_arg2, "defaultClassesTeam" .. Game.GetPlayerTeam(), 0 ) then
return true
elseif f4_local0 ~= "infect" and GameX.UsesFakeLoadout() then
return true
else
return false
end
end
local f0_local4 = function ( f5_arg0 )
if f5_arg0 == "infect" then
return true
else
end
end
local f0_local5 = function ( f6_arg0 )
local f6_local0 = ""
if GameX.GetGameMode() == "infect" then
if f6_arg0 == Teams.allies then
f6_local0 = Engine.Localize( Engine.Localize( "LUA_MENU_MP_SURVIVOR_LOADOUT" ) )
elseif f6_arg0 == Teams.axis then
f6_local0 = Engine.Localize( Engine.Localize( "LUA_MENU_MP_INFECTED_LOADOUT" ) )
end
else
f6_local0 = Engine.Localize( "@LUA_MENU_DEFAULT_LOADOUT" )
end
return f6_local0
end
local f0_local6 = function ( f7_arg0, f7_arg1 )
if f7_arg1.value > -1 then
return
else
f7_arg0:dispatchEventToRoot( {
name = "toggle_pause_off"
} )
LUI.FlowManager.RequestCloseAllMenus( f7_arg0 )
end
end
local f0_local7 = function ( f8_arg0, f8_arg1 )
f8_arg0:dispatchEventToMenuRoot( {
name = "cac_set_slot",
slot = f8_arg0.properties.slot,
controller = f8_arg0.properties.controller,
classLocation = f8_arg0.properties.classLocation,
immediate = true
} )
f8_arg0:processEvent( {
name = "hide_restrictions_icon"
} )
f8_arg0:dispatchEventToMenuRoot( {
name = "refresh_specialist_abilities_recap",
controller = f8_arg0.properties.controller,
specialistType = Cac.GetPerk( f8_arg0.properties.controller, f8_arg0.properties.squadLocation, f8_arg0.properties.squadMemberIndex, f8_arg0.properties.classLocation, f8_arg0.properties.slot, Cac.Indices.StreakType ) == "streaktype_specialist",
selected = false,
immediate = true
} )
end
local f0_local8 = function ( f9_arg0, f9_arg1, f9_arg2, f9_arg3 )
if GameX.GetGameMode() == "sd" or GameX.GetGameMode() == "sr" then
for f9_local0 = 0, Cac.GetNumCustomSlots( f9_arg0, f9_arg3 ) - 1, 1 do
if f9_local0 ~= 5 and Cac.IsClassInUse( f9_arg0, f9_arg1, f9_arg2, f9_arg3, f9_local0 ) then
return false
end
end
return true
else
end
end
function UpdateRestrictionsIcon( f10_arg0, f10_arg1 )
local f10_local0 = f10_arg0:getParent()
if MatchRules.AllowCustomClasses( f10_arg0.properties.classLocation ) and MatchRules.CustomClassIsRestricted( f10_arg0.properties.controller, CoD.GetStatsGroupForGameMode(), f10_arg0.properties.squadLocation, f10_arg0.properties.squadMemberIndex, f10_arg0.properties.classLocation, f10_arg0.properties.slot ) then
f10_arg0:animateToState( "visible" )
else
f10_arg0:animateToState( "default" )
end
end
function HideRestrictionsIcon( f11_arg0, f11_arg1 )
if MatchRules.AllowCustomClasses( f11_arg0.properties.classLocation ) and MatchRules.CustomClassIsRestricted( f11_arg0.properties.controller, CoD.GetStatsGroupForGameMode(), f11_arg0.properties.squadLocation, f11_arg0.properties.squadMemberIndex, f11_arg0.properties.classLocation, f11_arg0.properties.slot ) then
f11_arg0:dispatchEventToMenuRoot( {
name = "show_class_restrictions_warning"
} )
else
f11_arg0:dispatchEventToMenuRoot( {
name = "hide_class_restrictions_warning"
} )
end
f11_arg0:animateToState( "default" )
end
local f0_local9 = function ( f12_arg0, f12_arg1, f12_arg2, f12_arg3, f12_arg4, f12_arg5, f12_arg6, f12_arg7 )
local f12_local0 = Game.GetPlayerTeam()
if f12_local0 == Teams.free then
f12_local0 = Teams.allies
end
if Cac.IsDefaultClass( f12_arg3 ) then
f12_arg6 = f12_arg6 - Cac.Settings.DataLoc[f12_arg7].maxClassSlots + Cac.Settings.DataLoc[f12_arg3].maxClassSlots * (f12_local0 - 1)
end
local f12_local1 = {
type = "UIGenericButton",
id = "btn_MPLoadout_" .. f12_arg3 .. f12_arg4,
disabledFunc = function ( f13_arg0, f13_arg1 )
local f13_local0 = Cac.IsCaCSlotLocked( f12_arg0, f12_arg1, f12_arg2, f12_arg3, f12_arg4 )
if not f13_local0 then
f13_local0 = Cac.IsCaCSlotRestricted( f12_arg0, f12_arg1, f12_arg2, f12_arg3, f12_arg4 )
end
return f13_local0
end
}
local f12_local2 = {
childNum = f12_arg4 + 1,
squadLocation = f12_arg1,
squadMemberIndex = f12_arg2,
classLocation = f12_arg3,
slot = f12_arg4,
controller = f12_arg0,
button_text = f12_arg5,
button_action_func = function ( f14_arg0, f14_arg1 )
local f14_local0 = f12_arg4
if Cac.IsDefaultClass( f14_arg0.properties.classLocation ) and f12_arg7 then
f14_local0 = f14_local0 + Cac.Settings.DataLoc[f12_arg7].maxClassSlots + Cac.Settings.DataLoc[f12_arg3].maxClassSlots * (f12_local0 - 1)
end
Engine.ExecNow( "set current_class_location " .. f12_arg3 )
Engine.NotifyServer( "class_select", f14_local0 )
local f14_local1 = MBh.EmitEventToRoot( "toggle_pause_off" )
f14_local1( f14_arg0 )
LUI.FlowManager.RequestCloseAllMenus( f14_arg0 )
end,
button_over_func = f0_local7,
button_over_disable_func = f0_local7,
button_up_func = MBh.EmitEvent( {
name = "show_restrictions_icon"
} )
}
if f12_arg6 == f12_arg4 then
local f12_local3 = Engine.GetDvarString( "current_class_location" )
local f12_local4 = Colors.yellow
end
f12_local2.text_default_color = f12_local3 and f12_local4 or Colors.generic_button_text_default_color
f12_local1.properties = f12_local2
f12_local1.handlers = {
menu_create = function ( f15_arg0, f15_arg1 )
f15_arg0.listDefaultFocus = f12_arg6 == f12_arg4
end,
button_disable = MBh.EmitEvent( {
name = "show_restrictions_icon"
} )
}
f12_local1.children = {
{
type = "UIImage",
id = "weapon_restriction_icon",
states = {
default = {
rightAnchor = true,
leftAnchor = false,
topAnchor = false,
bottomAnchor = true,
right = 32,
bottom = -7,
width = 32,
height = 32,
material = RegisterMaterial( "icon_new_3" ),
alpha = 0
},
visible = {
alpha = 1
}
},
properties = {
controller = MBh.Property( "controller" ),
squadLocation = MBh.Property( "squadLocation" ),
squadMemberIndex = MBh.Property( "squadMemberIndex" ),
classLocation = MBh.Property( "classLocation" ),
slot = MBh.Property( "slot" )
},
handlers = {
hide_restrictions_icon = HideRestrictionsIcon,
show_restrictions_icon = UpdateRestrictionsIcon,
menu_create = UpdateRestrictionsIcon
}
}
}
return f12_local1
end
local f0_local10 = function ( f16_arg0, f16_arg1 )
local f16_local0 = f16_arg0.exclusiveController
if not f16_local0 then
DebugPrint( "[WARNING] CAC: using controller index 0, this is only ok if you are editing a menu" )
f16_local0 = 0
end
local f16_local1 = Cac.Settings.DataLoc.privateMatchSquadMembers.maxClassSlots
if Engine.UsingSplitscreenUpscaling() then
local f16_local2 = f16_local1
end
local self = LUI.UIElement.new( {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = GenericMenuDims.menu_top,
left = GenericMenuDims.menu_left,
height = GenericButtonSettings.Styles.GradientButton.height * (f16_local2 or f16_local1 * 2 + 1),
right = GenericMenuDims.menu_right,
alignment = LUI.Alignment.Top
} )
self:setUseStencil( true )
local f16_local4 = LUI.UIVerticalList.new( {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
alignment = LUI.Alignment.Top
}, true )
f16_local4.id = "change_loadout_selections_id"
f16_local4:makeFocusable()
local f16_local5 = Cac.GetCustomClassLoc( "loadouts" )
local f16_local6 = Cac.GetSquadLoc()
local f16_local7 = Cac.GetActiveSquadMember( f16_local0 )
local f16_local8 = Game.GetOmnvar( "ui_loadout_selected" )
local f16_local9 = Game.GetPlayerTeam()
local f16_local10 = f0_local5( f16_local9 )
if f0_local3( f16_local0, f16_local6, f16_local7 ) then
LUI.MenuBuilder.BuildAddChild( f16_local4, {
type = "UIGenericButton",
id = "btn_fakeLoadout",
properties = {
childNum = 1,
button_text = f16_local10,
button_action_func = function ( f17_arg0, f17_arg1 )
Engine.NotifyServer( "class_select", 0 )
local f17_local0 = MBh.EmitEventToRoot( "toggle_pause_off" )
f17_local0( f17_arg0 )
LUI.FlowManager.RequestCloseAllMenus( f17_arg0 )
end,
text_default_color = Colors.yellow
}
} )
else
if not f16_arg1 and GameX.GetGameMode() ~= "infect" then
for f16_local11 = 0, Cac.GetNumCustomSlots( f16_local0, "loadouts" ) - 1, 1 do
LUI.MenuBuilder.BuildAddChild( f16_local4, f0_local9( f16_local0, f16_local6, f16_local7, f16_local5, f16_local11, Cac.GetLoadoutName( f16_local0, f16_local6, f16_local7, f16_local5, f16_local11 ), f16_local8 ) )
end
end
local f16_local11 = "defaultClassesTeam" .. Game.GetPlayerTeam()
if f16_local11 == "defaultClassesTeam0" then
f16_local11 = "defaultClassesTeam2"
end
if Cac.HasCustomClasses( f16_local0, f16_local6, f16_local7, f16_local11 ) and not f0_local8( f16_local0, f16_local6, f16_local7, f16_local11 ) then
if not f16_arg1 and GameX.GetGameMode() ~= "infect" then
LUI.MenuBuilder.BuildAddChild( f16_local4, {
type = "UIImage",
id = "dividing_line",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 8,
right = 450,
top = 0,
bottom = 2,
material = RegisterMaterial( "white" ),
alpha = 0.3
}
}
} )
LUI.MenuBuilder.BuildAddChild( f16_local4, {
type = "UIImage",
id = "dividing_spacer",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
height = 5,
alpha = 0
}
}
} )
LUI.MenuBuilder.BuildAddChild( f16_local4, {
type = "UIGenericButton",
id = "default_loadouts_btn",
properties = {
squadLocation = f16_local6,
squadMemberIndex = f16_local7,
classLocation = f16_local11,
slot = Cac.GetFirstCustomClass( f16_local0, f16_local6, f16_local7, f16_local11 ),
controller = f16_local0,
button_text = Engine.Localize( "@LUA_MENU_DEFAULT_CLASSES" ),
button_action_func = function ( f18_arg0, f18_arg1 )
f18_arg0:dispatchEventToMenuRoot( {
name = "refresh_char_select_list",
defaultLoadouts = true
} )
end,
text_default_color = Cac.Settings.DataLoc[f16_local5].maxClassSlots and Colors.yellow or Colors.generic_button_text_default_color,
button_over_func = f0_local7
}
} )
else
for f16_local12 = 0, Cac.GetNumCustomSlots( f16_local0, f16_local11 ) - 1, 1 do
if Cac.IsClassInUse( f16_local0, f16_local6, f16_local7, f16_local11, f16_local12 ) then
if (GameX.GetGameMode() == "sd" or GameX.GetGameMode() == "sr") and f16_local12 == 5 then
break
end
local f16_local15 = Cac.GetLoadoutName( f16_local0, f16_local6, f16_local7, f16_local11, f16_local12 )
if GameX.GetGameMode() == "infect" then
if f16_local9 == Teams.allies and f16_local12 == 0 then
f16_local15 = Engine.Localize( "LUA_MENU_MP_SURVIVOR_LOADOUT" )
elseif f16_local9 == Teams.axis and f16_local12 == 0 then
f16_local15 = Engine.Localize( "LUA_MENU_MP_INFECTED_LOADOUT" )
elseif f16_local9 == Teams.axis and f16_local12 == 1 then
break
end
end
LUI.MenuBuilder.BuildAddChild( f16_local4, f0_local9( f16_local0, f16_local6, f16_local7, f16_local11, f16_local12, f16_local15, f16_local8, f16_local5 ) )
end
end
end
end
end
self:addElement( f16_local4 )
return self
end
local f0_local11 = function ()
local self = LUI.UIElement.new()
self.id = "class_restrictions_warning"
self:registerAnimationState( "default", {
leftAnchor = false,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
top = 54,
right = -100,
width = 500,
height = 28,
alpha = 0
} )
self:registerAnimationState( "visible", {
alpha = 1
} )
self:animateToState( "default" )
self:registerEventHandler( "show_class_restrictions_warning", function ( element, event )
element:animateToState( "visible" )
return true
end )
self:registerEventHandler( "hide_class_restrictions_warning", function ( element, event )
element:animateToState( "default" )
return true
end )
local f19_local1 = LUI.UIImage.new()
f19_local1.id = "class_restrictions_warning_icon"
f19_local1:registerAnimationState( "default", {
leftAnchor = false,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
right = 0,
top = 2,
width = 28,
height = 28,
material = RegisterMaterial( "icon_new_3" ),
alpha = 1
} )
f19_local1:animateToState( "default" )
self:addElement( f19_local1 )
local f19_local2 = LUI.UIText.new()
f19_local2.id = "class_restrictions_warning_text"
f19_local2:setText( Engine.Localize( "PATCH_MENU_ITEM_RESTRICTED" ) )
f19_local2:registerAnimationState( "default", CoD.ColorizeState( Colors.orange, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
font = CoD.TextSettings.NormalFont.Font,
left = 0,
right = -35,
top = 5,
bottom = 5 + CoD.TextSettings.NormalFont.Height,
alignment = LUI.Alignment.Right
} ) )
f19_local2:animateToState( "default" )
self:addElement( f19_local2 )
return self
end
local f0_local12 = function ( f22_arg0 )
local self = LUI.UIElement.new()
self.id = "change_loadout_display_id"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 130,
bottom = 0,
right = 0,
alpha = 1
} )
self:animateToState( "default", 0 )
self:registerEventHandler( "menu_create", function ( element, event )
element:disableTreeFocus()
end )
local f22_local1 = "defaultClassesTeam" .. Game.GetPlayerTeam()
local f22_local2 = GameX.GetGameMode()
local f22_local3 = LUI.MenuBuilder.BuildRegisteredType
local f22_local4 = "cac_recap"
local f22_local5 = {
exclusiveController = f22_arg0.exclusiveController,
squad_location = Cac.GetSquadLoc(),
member_index = Cac.GetActiveSquadMember( f22_arg0.exclusiveController )
}
if f0_local4( f22_local2 ) then
local f22_local6 = f22_local1
end
f22_local5.class_location = f22_local6 or Cac.GetCustomClassLoc( "loadouts" )
f22_local5.loadout_slot = 0
f22_local3 = f22_local3( f22_local4, f22_local5 )
f22_local3.id = "change_loadout_recap_id"
self:addElement( f22_local3 )
if Engine.UsingSplitscreenUpscaling() then
f22_local4 = {}
f22_local4 = GameX.GetSafeZoneSize()
f22_local5 = {}
f22_local5 = f22_local3:getLocalRect()
f22_local3:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
rightAnchor = true,
leftAnchor = false,
top = f22_local5[2],
bottom = f22_local5[4],
right = f22_local4[3],
width = f22_local5[3] - f22_local5[1]
} )
f22_local3:animateToState( "default", 0 )
end
return self
end
LUI.MenuBuilder.registerType( "class_select_main", function ( f24_arg0, f24_arg1, f24_arg2 )
local f24_local0 = Engine.Localize( "@LUA_MENU_CHOOSE_CLASS_CAPS" )
local self = LUI.UIElement.new()
self.id = "mp_change_loadout_id"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
alpha = 1
} )
self:animateToState( "default", 0 )
self:registerEventHandler( "menu_create", f0_local0 )
self:registerOmnvarHandler( "ui_pause_menu_show", LUI.mp_hud.OptionsMenu.pauseMenuUpdate )
self:registerOmnvarHandler( "ui_options_menu", f0_local6 )
local f24_local2 = LUI.UIElement.new( {
worldBlur = 5
} )
f24_local2:setupWorldBlur()
f24_local2.id = "csWorldBlurOverlay"
self:addElement( f24_local2 )
self:addElement( LUI.mp_hud.OptionsMenu.mp_pause_menu_background_def() )
LUI.MenuBuilder.BuildAddChild( self, {
type = "button_helper_text_main",
id = "cshelper_text_id"
} )
if GameX.IsOnlineMatch() and not GameX.IsSplitscreen() then
local f24_local3 = LUI.MenuBuilder.BuildRegisteredType( "online_friends_widget" )
f24_local3.id = "csfriends_widget_id"
self:addElement( f24_local3 )
end
local f24_local3 = LUI.UIBindButton.new()
f24_local3.id = "clBackToGameStartButton"
f24_local3:registerEventHandler( "button_start", f0_local2 )
f24_local3:registerEventHandler( "button_secondary", f0_local2 )
self:addElement( f0_local11() )
self:addElement( LUI.mp_hud.OptionsMenu.mp_pause_menu_title_def( f24_local0 ) )
self:addElement( f24_local3 )
self:addElement( f0_local12( f24_arg1 ) )
local f24_local4 = LUI.UITimer.new( 250, {
name = "menuCreationTimer"
}, nil, true, self, false )
f24_local4.id = "updateTimer"
self:addElement( f24_local4 )
self:registerEventHandler( "menuCreationTimer", function ( element, event )
element.listOfLoadouts = f0_local10( f24_arg1 )
self:addElement( element.listOfLoadouts )
element.listOfLoadouts:processEvent( {
name = "gain_focus"
} )
end )
self:registerEventHandler( "refresh_char_select_list", function ( element, event )
local f26_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
f26_local0.defaultLoadouts = event.defaultLoadouts
local f26_local1 = nil
if event.defaultLoadouts then
f26_local1 = Engine.Localize( "@PATCH_MENU_DEFAULT_CLASSES_CAPS" )
else
f26_local1 = Engine.Localize( "@LUA_MENU_CHOOSE_CLASS_CAPS" )
end
element:dispatchEventToMenuRoot( {
name = "update_header_text",
string = f26_local1
} )
element.listOfLoadouts:close()
element.listOfLoadouts = f0_local10( f24_arg1, event.defaultLoadouts )
self:addElement( element.listOfLoadouts )
element.listOfLoadouts:processEvent( {
name = "gain_focus"
} )
end )
return self
end )
LockTable( _M )

View File

@ -0,0 +1,630 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ( f1_arg0, f1_arg1 )
Engine.NotifyServer( "gambler_anim_complete", 1 )
end
f0_local1 = function ( f2_arg0 )
if Game.GetOmnvar( f2_arg0 ) >= 0 then
return true
else
return false
end
end
f0_local2 = function ( f3_arg0, f3_arg1 )
local f3_local0 = f3_arg1.value
if f3_local0 ~= nil then
if Game.IsCinematicCameraActive() then
return
end
local f3_local1 = 500
local f3_local2 = f3_arg0:getChildById( "damageFeedbackImageId" )
if f3_local0 == "hitblastshield" then
f3_local2:animateToState( "blastshield", 0 )
elseif f3_local0 == "thermobaric_debuff" then
f3_local2:animateToState( "thermoDebuff", 0 )
f3_local1 = 1000
elseif f3_local0 == "hitlightarmor" then
f3_local2:animateToState( "light_armor", 0 )
elseif f3_local0 == "hitmorehealth" then
f3_local2:animateToState( "more_health", 0 )
elseif f3_local0 == "hitmotionsensor" then
f3_local2:animateToState( "motion_sensor", 0 )
f3_local1 = 2500
elseif f3_local0 == "hitalienarmor" then
f3_local2:animateToState( "alienarmor", 0 )
elseif f3_local0 == "hitaliensoft" then
f3_local2:animateToState( "aliensoft", 0 )
elseif f3_local0 == "hitjuggernaut" then
f3_local2:animateToState( "juggernaut", 0 )
elseif f3_local0 == "hitkill" then
f3_local2:animateToState( "hitkill", 0 )
elseif f3_local0 == "hitkilljugg" then
f3_local2:animateToState( "hitkilljugg", 0 )
elseif f3_local0 == "hitdeadeyekill" then
f3_local2:animateToState( "hitdeadeyekill", 0 )
elseif f3_local0 == "hitkillblast" then
f3_local2:animateToState( "hitkillblast", 0 )
elseif f3_local0 == "thermodebuff_kill" then
f3_local2:animateToState( "thermodebuff_kill", 0 )
else
f3_local2:animateToState( "default", 0 )
end
local f3_local3 = MBh.AnimateSequence( {
{
"active",
0
},
{
"default",
f3_local1
}
} )
f3_local3( f3_arg0 )
end
end
local f0_local3 = function ( f4_arg0, f4_arg1 )
local f4_local0 = f4_arg1.value
if f4_local0 ~= nil then
if Game.IsCinematicCameraActive() then
return
end
local f4_local1 = f4_arg0:getChildById( "deadeyeBaseContainer" )
local f4_local2 = f4_arg0:getChildById( "deadeyePulseContainer" )
if f4_local0 == "hitcritical" or f4_local0 == "hitdeadeyekill" then
local f4_local3 = MBh.AnimateSequence( {
{
"default",
100
},
{
"active",
20
},
{
"close",
50
}
} )
f4_local3( f4_local1 )
f4_local3 = MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
50
},
{
"close",
90
}
} )
f4_local3( f4_local2 )
end
end
end
local f0_local4 = function ( f5_arg0, f5_arg1 )
if f5_arg1.value ~= -1 then
local f5_local0 = f5_arg0:getChildById( "gamblerIconId" )
local f5_local1 = f5_arg0:getChildById( "gamblerTextId" )
local f5_local2 = Engine.TableLookupByRow( PerkTable.File, f5_arg1.value, PerkTable.Cols.Image )
local f5_local3 = Engine.TableLookupByRow( PerkTable.File, f5_arg1.value, PerkTable.Cols.Name )
local f5_local4 = RegisterMaterial( f5_local2 )
f5_local1:setText( Engine.Localize( f5_local3 ) )
CoD.SetMaterial( f5_local0, f5_local4 )
local f5_local5 = MBh.AnimateSequence( {
{
"active",
0
},
{
"inactive",
2500
}
} )
f5_local5( f5_arg0 )
end
end
local f0_local5 = function ()
local self = LUI.UIElement.new()
self:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = -16,
bottom = 16,
left = -16,
right = 16,
alpha = 1
} )
self:animateToState( "default" )
self:registerOmnvarHandler( "damage_feedback", f0_local3 )
local f6_local1 = LUI.UIElement.new()
f6_local1.id = "deadeyeBaseContainer"
f6_local1:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = -16,
left = -16,
right = 16,
height = 64,
alpha = 0
} )
f6_local1:registerAnimationState( "active", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = -20,
left = -20,
right = 20,
height = 70,
alpha = 0.5
} )
f6_local1:registerAnimationState( "close", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = -22,
left = -22,
right = 22,
height = 72,
alpha = 0
} )
f6_local1:animateToState( "default" )
local f6_local2 = LUI.UIImage.new()
f6_local2.id = "deadeyeBaseImage"
f6_local2:registerAnimationState( "default", {
material = RegisterMaterial( "damage_feedback_deadeye" ),
topAnchor = true,
leftAnchor = true,
rightAnchor = true,
bottomAnchor = true,
alpha = 1
} )
f6_local2:animateToState( "default" )
f6_local1:addElement( f6_local2 )
local f6_local3 = LUI.UIElement.new()
f6_local3.id = "deadeyePulseContainer"
f6_local3:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = -16,
left = -16,
right = 16,
height = 64,
alpha = 0
} )
f6_local3:registerAnimationState( "active", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = -32,
left = -32,
right = 32,
height = 128,
alpha = 1
} )
f6_local3:registerAnimationState( "close", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = -64,
left = -64,
right = 64,
height = 256,
alpha = 0
} )
f6_local3:animateToState( "default" )
local f6_local4 = LUI.UIImage.new()
f6_local4.id = "deadeyePulseImage"
f6_local4:registerAnimationState( "default", {
material = RegisterMaterial( "damage_feedback_deadeye" ),
topAnchor = true,
leftAnchor = true,
rightAnchor = true,
bottomAnchor = true,
alpha = 1
} )
f6_local4:animateToState( "default" )
f6_local3:addElement( f6_local4 )
self:addElement( f6_local1 )
self:addElement( f6_local3 )
return self
end
local f0_local6 = function ()
local self = LUI.UIElement.new()
self.id = "gamblerHudId"
self:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = -16,
bottom = 16,
left = -16,
right = 16,
alpha = 0
} )
self:registerAnimationState( "active", {
alpha = 1
} )
self:registerAnimationState( "inactive", {
alpha = 0
} )
self:animateToState( "default" )
self:registerOmnvarHandler( "ui_gambler_show", f0_local4 )
self:registerEventHandler( "transition_complete_inactive", f0_local0 )
local f7_local1 = LUI.UIImage.new()
f7_local1.id = "gamblerIconId"
f7_local1:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = 95,
left = -20,
right = 20,
height = 40
} )
f7_local1:animateToState( "default" )
local f7_local2 = LUI.UIText.new()
f7_local2.id = "gamblerTextId"
f7_local2:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
bottom = 160,
left = -100,
right = 100,
height = CoD.TextSettings.SmallFont.Height,
font = CoD.TextSettings.SmallFont.Font,
alignment = LUI.Alignment.Center,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f7_local2:animateToState( "default" )
f7_local2:setText( "Enter Ability Name Here" )
f7_local2:setTextStyle( CoD.TextStyle.Shadowed )
self:addElement( f7_local1 )
self:addElement( f7_local2 )
return self
end
function damageFeedbackHudDef()
local f8_local0 = RegisterMaterial( "damage_feedback" )
local self = LUI.UIElement.new()
self.id = "damageFeedbackHud"
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
right = 0,
bottom = 0
} )
self:animateToState( "default" )
local f8_local2 = LUI.UIElement.new()
f8_local2:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = -16,
bottom = 16,
left = -16,
right = 16,
alpha = 0
} )
f8_local2:registerAnimationState( "active", {
alpha = 1
} )
f8_local2:animateToState( "default" )
f8_local2:registerOmnvarHandler( "damage_feedback", f0_local2 )
local f8_local3 = {
{
name = "default",
material = f8_local0
}
}
if not Engine.IsAliensMode() then
local f8_local4 = Engine.UsingSplitscreenUpscaling() and 137 or 100
local f8_local5 = RegisterMaterial( "damage_feedback_blastshield" )
local f8_local6 = RegisterMaterial( "damage_feedback_thermodebuff" )
local f8_local7 = RegisterMaterial( "damage_feedback_juggernaut" )
LUI.ConcatenateToTable( f8_local3, {
{
name = "blastshield",
material = f8_local5
},
{
name = "thermoDebuff",
material = f8_local6
},
{
name = "juggernaut",
material = f8_local7
},
{
name = "light_armor",
material = RegisterMaterial( "damage_feedback_lightarmor" )
},
{
name = "more_health",
material = RegisterMaterial( "damage_feedback_morehealth" )
},
{
name = "motion_sensor",
material = RegisterMaterial( "damage_feedback_motionsensor" )
},
{
name = "hitkill",
material = f8_local0,
red = 0.9,
green = 0.63,
blue = 0
},
{
name = "hitkilljugg",
material = f8_local7,
red = 0.9,
green = 0.63,
blue = 0
},
{
name = "hitkillblast",
material = f8_local5,
red = 0.9,
green = 0.63,
blue = 0
},
{
name = "hitdeadeyekill",
material = f8_local0,
red = 0.9,
green = 0.63,
blue = 0
},
{
name = "thermodebuff_kill",
material = f8_local6,
red = 0.9,
green = 0.63,
blue = 0
}
} )
else
LUI.ConcatenateToTable( f8_local3, {
{
name = "alienarmor",
material = RegisterMaterial( "damage_feedback_alienarmor" )
},
{
name = "aliensoft",
material = RegisterMaterial( "damage_feedback_aliensoft" )
}
} )
end
local f8_local4 = LUI.UIImage.new()
f8_local4.id = "damageFeedbackImageId"
for f8_local9, f8_local10 in ipairs( f8_local3 ) do
local f8_local11 = f8_local4
local f8_local12 = f8_local4.registerAnimationState
local f8_local13 = f8_local10.name
local f8_local14 = {
material = f8_local10.material,
topAnchor = true,
bottomAnchor = false
}
local f8_local8
if f8_local10.leftAnchor ~= nil then
f8_local8 = f8_local10.leftAnchor
else
f8_local8 = true
end
f8_local14.leftAnchor = f8_local8
if f8_local10.rightAnchor ~= nil then
f8_local8 = f8_local10.rightAnchor
else
f8_local8 = true
end
f8_local14.rightAnchor = f8_local8
f8_local14.top = f8_local10.top or 0
f8_local14.height = f8_local10.height or 64
f8_local14.left = f8_local10.left
f8_local14.right = f8_local10.right
f8_local14.red = f8_local10.red or 1
f8_local14.blue = f8_local10.blue or 1
f8_local14.green = f8_local10.green or 1
f8_local12( f8_local11, f8_local13, f8_local14 )
end
f8_local4:animateToState( "default" )
f8_local2:addElement( f8_local4 )
self:addElement( f8_local2 )
self:addElement( f0_local5() )
self:addElement( f0_local6() )
return self
end
local f0_local7 = function ( f9_arg0, f9_arg1 )
local f9_local0 = f9_arg1.value
if f9_local0 ~= nil then
if Game.IsCinematicCameraActive() then
return
end
local f9_local1 = 500
local f9_local2 = f9_arg0:getChildById( "hudIconTypeImageId" )
if f9_local0 == "scavenger" and f0_local1( "ui_gambler_show" ) == false then
f9_local2:animateToState( "scavenger", 0 )
f9_local1 = 2500
elseif f9_local0 == "boxofguns" and f0_local1( "ui_gambler_show" ) == false then
f9_local2:animateToState( "boxofguns", 0 )
f9_local1 = 2500
elseif f9_local0 == "throwingknife" and f0_local1( "ui_gambler_show" ) == false then
f9_local2:animateToState( "throwingknife", 0 )
f9_local1 = 2500
elseif f9_local0 == "oracle" and f0_local1( "ui_gambler_show" ) == false then
f9_local2:animateToState( "oracle", 0 )
f9_local1 = 2500
else
f9_local2:animateToState( "default", 0 )
end
local f9_local3 = MBh.AnimateSequence( {
{
"active",
0
},
{
"default",
f9_local1
}
} )
f9_local3( f9_arg0 )
end
end
function hudIconTypeHudDef()
local self = LUI.UIElement.new()
self.id = "hudIconTypeHud"
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
right = 0,
bottom = 0
} )
self:animateToState( "default" )
local f10_local1 = LUI.UIElement.new()
f10_local1:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = -16,
bottom = 16,
left = -16,
right = 16,
alpha = 0
} )
f10_local1:registerAnimationState( "active", {
alpha = 1
} )
f10_local1:animateToState( "default" )
f10_local1:registerOmnvarHandler( "damage_feedback_other", f0_local7 )
local f10_local2 = {}
if not Engine.IsAliensMode() then
local f10_local3 = Engine.UsingSplitscreenUpscaling() and 137 or 100
LUI.ConcatenateToTable( f10_local2, {
{
name = "scavenger",
material = RegisterMaterial( "scavenger_pickup" ),
leftAnchor = false,
rightAnchor = false,
top = f10_local3,
left = -36,
right = 36,
height = 36
},
{
name = "boxofguns",
material = RegisterMaterial( "boxofguns_pickup" ),
leftAnchor = false,
rightAnchor = false,
top = f10_local3,
left = -36,
right = 36,
height = 36
},
{
name = "throwingknife",
material = RegisterMaterial( "throwingknife_pickup" ),
leftAnchor = false,
rightAnchor = false,
top = f10_local3,
left = -36,
right = 36,
height = 36
},
{
name = "oracle",
material = RegisterMaterial( "icon_ks_skylark_uav_hud" ),
leftAnchor = true,
rightAnchor = false,
top = f10_local3,
left = 0,
height = 36,
width = 36,
red = 0.9,
green = 0.63,
blue = 0
}
} )
end
local f10_local3 = LUI.UIImage.new()
f10_local3.id = "hudIconTypeImageId"
for f10_local8, f10_local9 in ipairs( f10_local2 ) do
local f10_local10 = f10_local3
local f10_local11 = f10_local3.registerAnimationState
local f10_local12 = f10_local9.name
local f10_local13 = {
material = f10_local9.material,
topAnchor = true,
bottomAnchor = false
}
local f10_local7
if f10_local9.leftAnchor ~= nil then
f10_local7 = f10_local9.leftAnchor
else
f10_local7 = true
end
f10_local13.leftAnchor = f10_local7
if f10_local9.rightAnchor ~= nil then
f10_local7 = f10_local9.rightAnchor
else
f10_local7 = true
end
f10_local13.rightAnchor = f10_local7
f10_local13.top = f10_local9.top or 0
f10_local13.height = f10_local9.height or 64
f10_local13.width = f10_local9.width
f10_local13.left = f10_local9.left
f10_local13.right = f10_local9.right
f10_local13.red = f10_local9.red or 1
f10_local13.blue = f10_local9.blue or 1
f10_local13.green = f10_local9.green or 1
f10_local11( f10_local10, f10_local12, f10_local13 )
end
f10_local3:animateToState( "default" )
f10_local1:addElement( f10_local3 )
self:addElement( f10_local1 )
return self
end
LUI.MenuBuilder.registerType( "damageFeedbackHudDef", damageFeedbackHudDef )
LUI.MenuBuilder.registerType( "hudIconTypeHudDef", hudIconTypeHudDef )
LockTable( _M )

314
lui/mp_hud/dighud.dec.lua Normal file
View File

@ -0,0 +1,314 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = {
"icon_perks_ready_up",
"icon_perks_sleight_of_hand",
"icon_perks_agility",
"icon_perks_marathon",
"icon_perks_stalker",
"icon_perks_strong_arm",
"icon_perks_on_the_go",
"icon_perks_reflex",
"icon_perks_steady_aim",
"icon_perks_quickdraw",
"icon_perks_takedown",
"icon_perks_blind_eye",
"icon_perks_dead_silence",
"icon_perks_incog",
"icon_perks_assassin",
"icon_perks_recon",
"icon_perks_scavenger",
"icon_perks_sitrep",
"icon_perks_amplifier",
"icon_perks_com_link",
"icon_perks_resiliance",
"icon_perks_icu",
"icon_perks_focus",
"icon_perks_tac_resist",
"icon_perks_blast_shield",
"icon_perks_danger_close",
"icon_perks_ping",
"icon_perks_deadeye"
}
f0_local1 = function ( f1_arg0, f1_arg1 )
if f1_arg1.value == -1 then
f1_arg0:animateToState( "finished", 0 )
elseif f1_arg1.value == 1 then
local f1_local0 = f1_arg0:getChildById( "digHudPerkTextContainer" )
local f1_local1 = f1_arg0:getChildById( "digHudPerkRow" )
local f1_local2 = MBh.AnimateSequence( {
{
"active",
0
},
{
"active",
3500
},
{
"finished",
500
}
} )
f1_local2( f1_arg0 )
local f1_local3 = MBh.AnimateSequence( {
{
"opening",
50
},
{
"active",
100
},
{
"active",
3850
},
{
"default",
0
}
} )
f1_local3( f1_local0 )
f1_local1:processEvent( {
name = "start_scroll",
slowScrollCount = 7,
slowScrollTime = 175,
fastScrollTime = 60,
immediate = true
} )
end
end
LUI.MenuBuilder.registerType( "digKillstreakHudDef", function ()
local f2_local0 = 64
local f2_local1 = 64
local f2_local2 = 8
local f2_local3 = f2_local1 * f2_local2
local self = LUI.UIElement.new()
self.id = "digHud"
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
} )
self:animateToState( "default" )
local f2_local5 = LUI.UIElement.new()
f2_local5.id = "digHudContainer"
f2_local5:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = 40,
bottom = 80,
left = -200,
right = 200,
alpha = 0
} )
f2_local5:registerAnimationState( "active", {
alpha = 1
} )
f2_local5:registerAnimationState( "inactive", {
alpha = 0
} )
f2_local5:registerAnimationState( "finished", {
alpha = 0
} )
f2_local5:animateToState( "default" )
f2_local5:registerOmnvarHandler( "ui_dig_killstreak_show", f0_local1 )
f2_local5:registerEventHandler( "transition_complete_finished", function ( element, event )
element:dispatchEventToChildren( {
name = "request_stop_scroll"
} )
end )
local f2_local6 = LUI.UIHorizontalList.new()
f2_local6.id = "digHudPerkRow"
f2_local6:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = false,
top = 0,
bottom = 0,
left = -f2_local3 * 0.5 + f2_local1 * 0.5,
width = f2_local3,
alignment = LUI.Alignment.Left,
alpha = 1
} )
f2_local6:registerAnimationState( "scrolled", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = false,
top = 0,
bottom = 0,
left = -f2_local3 * 0.5 - f2_local1 * 0.5,
width = f2_local3,
alpha = 1
} )
f2_local6:animateToState( "default" )
f2_local6:registerEventHandler( "start_scroll", function ( element, event )
element:animateToState( "default", 0 )
element.scrollCount = 0
element.slowScrollCount = event.slowScrollCount
element.slowScrollTime = event.slowScrollTime
element.fastScrollTime = event.fastScrollTime
element:processEvent( {
name = "next_scroll",
immediate = true
} )
end )
f2_local6:registerEventHandler( "next_scroll", function ( element, event )
local f5_local0 = element.scrollCount
local f5_local1 = element.slowScrollCount
f5_local0 = REG7 and element.slowScrollTime or element.fastScrollTime
element:animateToState( "scrolled", f5_local0 )
element:dispatchEventToChildren( {
name = "start_scroll",
scrollTime = f5_local0,
immediate = true
} )
end )
f2_local6:registerEventHandler( "transition_complete_scrolled", function ( element, event )
if element.requestStopScroll then
element.requestStopScroll = nil
element.scrollCount = nil
else
element.scrollCount = element.scrollCount + 1
element:animateToState( "default", 0 )
element:dispatchEventToChildren( {
name = "cycle_material",
immediate = true
} )
element:processEvent( {
name = "next_scroll",
immediate = true
} )
end
end )
f2_local6:registerEventHandler( "request_stop_scroll", function ( element, event )
if element.scrollCount then
element.requestStopScroll = true
end
end )
for f2_local7 = 1, f2_local2, 1 do
local f2_local10 = f2_local7
local f2_local11 = LUI.UIElement.new()
f2_local11.id = "digHudPerkIconContainer" .. f2_local10
f2_local11:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f2_local0 / 2,
left = -f2_local1 / 2,
bottom = f2_local0 / 2,
right = f2_local1 / 2,
alpha = 1
} )
f2_local11:registerAnimationState( "hidden", {
alpha = 0
} )
f2_local11:animateToState( "default" )
f2_local11:registerEventHandler( "start_scroll", function ( element, event )
if f2_local10 == 1 then
element:animateToState( "default", 0 )
element:animateToState( "hidden", event.scrollTime )
elseif f2_local10 == f2_local2 then
element:animateToState( "hidden", 0 )
element:animateToState( "default", event.scrollTime )
end
end )
f2_local6:addElement( f2_local11 )
local f2_local12 = LUI.UIImage.new()
f2_local12.id = "digHudPerkIcon" .. f2_local10
f2_local12.materialID = f2_local10
f2_local12:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = RegisterMaterial( f0_local0[f2_local12.materialID] )
} )
f2_local12:animateToState( "default" )
f2_local12:registerEventHandler( "cycle_material", function ( element, event )
element.materialID = element.materialID + 1
if #f0_local0 < element.materialID then
element.materialID = 1
end
element:registerAnimationState( "updatedMaterial", {
material = RegisterMaterial( f0_local0[element.materialID] )
} )
element:animateToState( "updatedMaterial", 0 )
end )
f2_local11:addElement( f2_local12 )
end
local f2_local7 = LUI.UIElement.new()
f2_local7.id = "digHudPerkTextContainer"
f2_local7:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
bottom = 80,
height = 20,
width = 200,
alpha = 0
} )
f2_local7:registerAnimationState( "opening", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
bottom = 80,
height = 40,
width = 400,
alpha = 1
} )
f2_local7:registerAnimationState( "active", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
bottom = 80,
height = 20,
width = 200,
alpha = 1
} )
f2_local7:animateToState( "default" )
local f2_local8 = LUI.UIText.new()
f2_local8.id = "digHudPerkText"
f2_local8:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Center,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f2_local8:animateToState( "default" )
f2_local8:setText( Engine.Localize( "@MP_DIG_LEVEL_KILLSTREAK_ACTIVATED" ) )
f2_local8:setTextStyle( CoD.TextStyle.Shadowed )
f2_local7:addElement( f2_local8 )
f2_local5:addElement( f2_local6 )
f2_local5:addElement( f2_local7 )
self:addElement( f2_local5 )
return self
end )
LockTable( _M )

View File

@ -0,0 +1,230 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ( f1_arg0, f1_arg1 )
LUI.FlowManager.RequestLeaveMenu( f1_arg0 )
end
f0_local1 = function ( f2_arg0, f2_arg1 )
f2_arg0:setText( f2_arg1.message_text )
f2_arg0:dispatchEventToRoot( {
name = "resize_popup"
} )
end
f0_local2 = function ( f3_arg0 )
Engine.ExecFirstClient( "xpartybackout" )
Engine.ExecFirstClient( "disconnect" )
end
local f0_local3 = function ( f4_arg0 )
Engine.ExecFirstClient( "xpartydisbandafterround" )
Engine.ExecFirstClient( "hostmigration_start_backout" )
end
local f0_local4 = function ( f5_arg0 )
return Engine.GetDvarBool( "onlinegame" )
end
local f0_local5 = function ( f6_arg0 )
if f0_local4( f6_arg0 ) then
Engine.ExecFirstClient( "xstopprivateparty" )
Engine.ExecFirstClient( "disconnect" )
Engine.ExecFirstClient( "xblive_privatematch 0" )
Engine.ExecFirstClient( "onlinegame 1" )
Engine.ExecFirstClient( "xstartprivateparty" )
else
Engine.ExecFirstClient( "disconnect" )
end
end
local f0_local6 = function ( f7_arg0 )
local f7_local0 = Engine.GetDvarBool( "squad_match" )
Engine.ExecFirstClient( "xstopprivateparty" )
Engine.ExecFirstClient( "xpartydisbandafterround" )
if f7_local0 then
Engine.ExecFirstClient( "disconnect" )
Engine.ExecFirstClient( "xblive_privatematch 0" )
Engine.ExecFirstClient( "onlinegame 1" )
Engine.ExecFirstClient( "xstartprivateparty" )
else
Engine.ExecFirstClient( "hostmigration_start" )
end
end
local f0_local7 = function ( f8_arg0, f8_arg1 )
if Engine.GetDvarBool( "sv_running" ) then
Engine.NotifyServer( "end_game", 1 )
else
f0_local5( f8_arg0 )
end
LUI.FlowManager.RequestCloseAllMenus( f8_arg0 )
end
local f0_local8 = function ( f9_arg0, f9_arg1 )
LUI.FlowManager.RequestLeaveMenu( f9_arg0 )
Engine.Exec( "onPlayerQuit" )
if Engine.GetDvarBool( "sv_running" ) then
f0_local3( f9_arg0 )
else
f0_local2( f9_arg0 )
end
LUI.FlowManager.RequestCloseAllMenus( f9_arg0 )
end
local f0_local9 = function ( f10_arg0, f10_arg1 )
LUI.FlowManager.RequestLeaveMenu( f10_arg0 )
Engine.Exec( "onPlayerQuit" )
if Engine.GetDvarBool( "sv_running" ) then
f0_local6( f10_arg0 )
else
f0_local5( f10_arg0 )
end
LUI.FlowManager.RequestCloseAllMenus( f10_arg0 )
end
local f0_local10 = function ( f11_arg0 )
local f11_local0 = Lobby.IsInPrivateParty()
if f11_local0 then
f11_local0 = Lobby.IsPrivatePartyHost()
if f11_local0 then
f11_local0 = not Lobby.IsAloneInPrivateParty()
end
end
return f11_local0
end
local f0_local11 = function ( f12_arg0, f12_arg1 )
local f12_local0 = Engine.GetDvarBool( "squad_match" )
local f12_local1 = Engine.GetDvarBool( "squad_use_hosts_squad" )
if f12_local0 and Lobby.IsInPrivateParty() and Lobby.IsPrivatePartyHost() then
Squad.PostMatch( 0, 0, 0, 0, true )
Engine.NotifyServer( "end_game", 2 )
elseif f12_local1 and Lobby.IsPrivatePartyHost() and Lobby.IsAloneInPrivateParty() and Lobby.IsAlone() then
Engine.NotifyServer( "end_game", 2 )
elseif f0_local10( f12_arg0 ) then
LUI.FlowManager.RequestLeaveMenu( f12_arg0, true )
LUI.FlowManager.RequestPopupMenu( f12_arg0, "popup_pull_party", false )
else
Engine.Exec( "onPlayerQuit" )
if Engine.GetDvarBool( "sv_running" ) then
f0_local6( f12_arg0 )
else
f0_local5( f12_arg0 )
end
LUI.FlowManager.RequestCloseAllMenus( f12_arg0 )
end
end
local f0_local12 = function ()
local self = LUI.UIElement.new()
self.id = "end_game_id"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = -50,
left = 0,
bottom = 0,
right = 0,
alpha = 1
} )
self:animateToState( "default", 0 )
local f13_local1 = Engine.Localize( "@LUA_MENU_END_GAME_DESC" )
local f13_local2 = Engine.Localize( "@LUA_MENU_LEAVE_GAME_TITLE" )
if Engine.IsAliensMode() and Game.GetOmnvar( "ui_alien_is_solo" ) then
f13_local1 = Engine.Localize( "@ALIENS_LEAVE_GAME_DESC" )
f13_local2 = Engine.Localize( "@MENU_NOTICE" )
end
LUI.MenuBuilder.BuildAddChild( self, {
type = "generic_yesno_popup",
id = "privateGame_options_list_id",
properties = {
message_text_alignment = LUI.Alignment.Center,
message_text = f13_local1,
popup_title = f13_local2,
padding_top = 12,
yes_action = f0_local7
}
} )
local f13_local3 = LUI.UIBindButton.new()
f13_local3.id = "endBackToGameStartButton"
f13_local3:registerEventHandler( "button_start", f0_local0 )
self:addElement( f13_local3 )
return self
end
local f0_local13 = function ()
local self = LUI.UIElement.new()
self.id = "leave_game_id"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = -50,
left = 0,
bottom = 0,
right = 0,
alpha = 1
} )
self:animateToState( "default", 0 )
LUI.MenuBuilder.BuildAddChild( self, {
type = "generic_yesno_popup",
id = "publicGame_options_list_id",
properties = {
message_text_alignment = LUI.Alignment.Center,
message_text = Engine.IsAliensMode() and Engine.Localize( "@ALIENS_LEAVE_GAME_DESC" ) or Engine.Localize( "@LUA_MENU_LEAVE_GAME_DESC" ),
popup_title = Engine.IsAliensMode() and Engine.Localize( "@MENU_NOTICE" ) or Engine.Localize( "@LUA_MENU_LEAVE_GAME_TITLE" ),
padding_top = 12,
yes_action = f0_local11
}
} )
local f14_local1 = LUI.UIBindButton.new()
f14_local1.id = "leaveBackToGameStartButton"
f14_local1:registerEventHandler( "button_start", f0_local0 )
self:addElement( f14_local1 )
return self
end
local f0_local14 = function ()
local self = LUI.UIElement.new()
self.id = "pull_party_out_id"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = -50,
left = 0,
bottom = 0,
right = 0,
alpha = 1
} )
self:animateToState( "default", 0 )
LUI.MenuBuilder.BuildAddChild( self, {
type = "generic_yesno_popup",
id = "party_pullout_list_id",
properties = {
message_text_alignment = LUI.Alignment.Center,
message_text = Engine.Localize( "@LUA_MENU_PULL_PARTY_DESC" ),
popup_title = Engine.Localize( "@LUA_MENU_LEAVE_GAME_TITLE" ),
padding_top = 12,
yes_action = f0_local8,
no_action = f0_local9,
cancel_means_no = false
}
} )
local f15_local1 = LUI.UIBindButton.new()
f15_local1.id = "leavePullPartyButton"
f15_local1:registerEventHandler( "button_start", f0_local0 )
self:addElement( f15_local1 )
return self
end
LUI.MenuBuilder.registerType( "popup_end_game", f0_local12 )
LUI.MenuBuilder.registerType( "popup_leave_game", f0_local13 )
LUI.MenuBuilder.registerType( "popup_pull_party", f0_local14 )
LockTable( _M )

View File

@ -0,0 +1,152 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ( f1_arg0, f1_arg1 )
if CoD.IsFireTeamMode() then
if Game.InKillCam() then
return
end
local f1_local0 = f1_arg0:getChildById( "tacticNameDef" )
if f1_arg0.current_state ~= "active" then
f1_arg0.current_state = "active"
f1_local0:animateToState( "default", 0 )
if Engine.GetDvarString( "ui_gametype" ) == "war" then
LUI.FlowManager.RequestAddMenu( f1_arg0, "mp_fire_team_menu_war", true, f1_arg1.controller, false )
else
LUI.FlowManager.RequestAddMenu( f1_arg0, "mp_fire_team_menu", true, f1_arg1.controller, false )
end
elseif f1_arg0.current_state ~= "default" then
f1_arg0.current_state = "default"
f1_local0:animateToState( "active", 0 )
end
end
end
f0_local1 = function ()
return {
type = "UITimer",
id = "fireTeamHudTimerId",
properties = {
event = "update_tickables",
group = "hud",
interval = 200
}
}
end
f0_local2 = function ()
return {
type = "UIText",
id = "botNameDef",
properties = {
text = ""
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
height = CoD.TextSettings.HudEuroBigFont.Height,
font = CoD.TextSettings.HudEuroBigFont.Font,
alignment = LUI.Alignment.Center,
red = 1,
green = 1,
blue = 1,
alpha = 0
},
active = MBh.BaseState( "default", {
alpha = 1
} )
}
}
end
local f0_local3 = function ()
return {
type = "UIText",
id = "tacticNameDef",
properties = {
text = Engine.Localize( FireTeam.tactic_name )
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 200,
height = CoD.TextSettings.HudEuroBigFont.Height,
font = CoD.TextSettings.HudEuroBigFont.Font,
alignment = LUI.Alignment.Left,
red = 1,
green = 1,
blue = 1,
alpha = 0
},
active = MBh.BaseState( "default", {
alpha = 1
} )
}
}
end
local f0_local4 = function ( f5_arg0, f5_arg1 )
if CoD.IsFireTeamMode() then
local f5_local0 = f5_arg0:getChildById( "tacticNameDef" )
if f5_local0.properties.text ~= FireTeam.tactic_name then
f5_local0:setText( Engine.Localize( FireTeam.tactic_name ) )
f5_local0.properties.text = FireTeam.tactic_name
end
local f5_local1 = Game.GetPlayerstateClientnum()
if f5_arg0.client_num ~= f5_local1 and f5_local1 > 0 then
f5_arg0.client_num = f5_local1
local f5_local2 = Game.GetPlayerScoreInfo( f5_local1 )
local f5_local3 = f5_arg0:getChildById( "botNameDef" )
f5_local3:setText( f5_local2.name or "" )
end
end
end
local f0_local5 = function ( f6_arg0, f6_arg1 )
if CoD.IsFireTeamMode() then
local f6_local0 = f6_arg0:getChildById( "botNameDef" )
f6_local0:animateToState( "active", 0 )
end
end
LUI.MenuBuilder.registerDef( "fireTeamHudDef", function ()
local f7_local0 = {
type = "UIElement",
id = "fireTeamHud",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0
}
},
properties = {
client_num = -1
},
handlers = {
menu_create = f0_local5,
toggle_scoreboard = f0_local0,
update_tickables = f0_local4
}
}
local f7_local1 = {}
local f7_local2 = f0_local1()
local f7_local3 = f0_local2()
local f7_local4 = f0_local3()
f7_local0.children = f7_local2
return f7_local0
end )
LockTable( _M )

View File

@ -0,0 +1,476 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 0
f0_local1 = 0
f0_local2 = 0
local f0_local3 = 1
local f0_local4 = 30
local f0_local5 = f0_local4 / 2
local f0_local6 = 40 / 2
local f0_local7 = 0
local f0_local8 = 80
local f0_local9 = 60
local f0_local10 = f0_local9 / 2
local f0_local11 = 160
local f0_local12 = function ( f1_arg0, f1_arg1, f1_arg2 )
local f1_local0 = f1_arg0:getChildById( "fire_team_bg_" .. f1_arg1 )
if f1_local0 ~= nil then
if f1_arg2 ~= nil then
f1_local0.properties.toggle_state = f1_arg2
elseif f1_local0.properties.toggle_state == 1 then
f1_local0.properties.toggle_state = 0
else
f1_local0.properties.toggle_state = 1
end
if f1_local0.properties.toggle_state == 1 then
f1_local0:animateToState( "active", 0 )
else
f1_local0:animateToState( "default", 0 )
end
end
end
local f0_local13 = function ( f2_arg0, f2_arg1, f2_arg2, f2_arg3 )
return {
type = "UIImage",
id = "fire_team_bg_" .. f2_arg0,
states = {
default = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f2_arg3 - f0_local10,
left = f2_arg2 - f0_local10,
width = f0_local9,
height = f0_local9,
material = RegisterMaterial( "waypoint_captureneutral_" .. f2_arg1 ),
alpha = 1
},
active = MBh.BaseState( "default", {
material = RegisterMaterial( "waypoint_capture_" .. f2_arg1 )
} )
},
properties = {
toggle_state = 0
}
}
end
local f0_local14 = function ( f3_arg0, f3_arg1, f3_arg2, f3_arg3 )
return {
type = "UIText",
id = "fire_team_image_" .. f3_arg0,
properties = {
text = Engine.Localize( f3_arg1 )
},
states = {
default = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f3_arg3 - f0_local5,
left = f3_arg2 - f0_local5,
width = f0_local4,
height = f0_local4,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Center,
alpha = 1
}
}
}
end
local f0_local15 = function ( f4_arg0, f4_arg1, f4_arg2, f4_arg3, f4_arg4 )
return {
type = "UIText",
id = "fire_team_bg_" .. f4_arg0,
properties = {
text = Engine.Localize( f4_arg1 ),
toggle_state = 0
},
states = {
default = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f4_arg3 - 8,
left = f4_arg2,
width = 1,
height = 16,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = f4_arg4,
red = 1,
green = 1,
blue = 1,
alpha = 1
},
active = MBh.BaseState( "default", {
red = 0.88,
green = 0.65,
blue = 0.17
} )
}
}
end
local f0_local16 = function ( f5_arg0, f5_arg1 )
Engine.NotifyServer( "tactics_menu", 1 )
f0_local12( f5_arg0, "a", f0_local0 )
f0_local12( f5_arg0, "b", f0_local1 )
f0_local12( f5_arg0, "x", f0_local2 )
f0_local12( f5_arg0, "y", f0_local3 )
f5_arg0:processEvent( {
name = "mp_fire_team_on"
} )
end
local f0_local17 = function ( f6_arg0, f6_arg1 )
local f6_local0 = f6_arg0:getChildById( "fire_team_bg_a" )
local f6_local1 = f6_arg0:getChildById( "fire_team_bg_b" )
local f6_local2 = f6_arg0:getChildById( "fire_team_bg_x" )
local f6_local3 = f6_arg0:getChildById( "fire_team_bg_y" )
f0_local0 = f6_local0.properties.toggle_state
f0_local1 = f6_local1.properties.toggle_state
f0_local2 = f6_local2.properties.toggle_state
f0_local3 = f6_local3.properties.toggle_state
end
local f0_local18 = function ( f7_arg0 )
local f7_local0 = f7_arg0:getChildById( "fire_team_bg_a" )
local f7_local1 = f7_arg0:getChildById( "fire_team_bg_b" )
local f7_local2 = f7_arg0:getChildById( "fire_team_bg_x" )
if f7_local0.properties.toggle_state == 0 and f7_local1.properties.toggle_state == 0 and f7_local2.properties.toggle_state == 0 then
f0_local12( f7_arg0, "y", 1 )
else
f0_local12( f7_arg0, "y", 0 )
end
end
local f0_local19 = function ( f8_arg0, f8_arg1 )
local f8_local0 = f8_arg0:getChildById( "fire_team_bg_a" )
local f8_local1 = f8_arg0:getChildById( "fire_team_bg_b" )
local f8_local2 = f8_arg0:getChildById( "fire_team_bg_x" )
local f8_local3 = ""
if f8_local0.properties.toggle_state == 1 then
f8_local3 = f8_local3 .. "a"
end
if f8_local1.properties.toggle_state == 1 then
f8_local3 = f8_local3 .. "b"
end
if f8_local2.properties.toggle_state == 1 then
f8_local3 = f8_local3 .. "c"
end
local f8_local4 = {
= 1,
a = 2,
b = 3,
c = 4,
ab = 5,
ac = 6,
bc = 7,
abc = 8
}
local f8_local5 = {
= "@MPUI_FT_TACTIC_NONE",
a = Engine.Localize( "@MPUI_FT_HOLD_1", "A" ),
b = Engine.Localize( "@MPUI_FT_HOLD_1", "B" ),
c = Engine.Localize( "@MPUI_FT_HOLD_1", "C" ),
ab = Engine.Localize( "@MPUI_FT_HOLD_2", "A", "B" ),
ac = Engine.Localize( "@MPUI_FT_HOLD_2", "A", "C" ),
bc = Engine.Localize( "@MPUI_FT_HOLD_2", "B", "C" ),
abc = Engine.Localize( "@MPUI_FT_HOLD_3" )
}
FireTeam.tactic_name = f8_local5[f8_local3]
Engine.NotifyServer( "tactic_select", f8_local4[f8_local3] )
end
local f0_local20 = function ( f9_arg0, f9_arg1 )
if f9_arg1.down then
if f9_arg1.button == "shoulderl" then
Engine.NotifyServer( "bot_select", -1 )
elseif f9_arg1.button == "shoulderr" then
Engine.NotifyServer( "bot_select", 1 )
elseif f9_arg1.button == "primary" then
f0_local12( f9_arg0, "a" )
f0_local18( f9_arg0 )
f0_local19( f9_arg0, f9_arg1 )
elseif f9_arg1.button == "secondary" then
f0_local12( f9_arg0, "b" )
f0_local18( f9_arg0 )
f0_local19( f9_arg0, f9_arg1 )
elseif f9_arg1.button == "alt1" then
f0_local12( f9_arg0, "x" )
f0_local18( f9_arg0 )
f0_local19( f9_arg0, f9_arg1 )
elseif f9_arg1.button == "alt2" then
f0_local12( f9_arg0, "a", 0 )
f0_local12( f9_arg0, "b", 0 )
f0_local12( f9_arg0, "x", 0 )
f0_local12( f9_arg0, "y", 1 )
f0_local19( f9_arg0, f9_arg1 )
elseif f9_arg1.button == "select" then
f9_arg0:dispatchEventToRoot( {
name = "toggle_scoreboard"
} )
end
end
end
local f0_local21 = function ( f10_arg0, f10_arg1 )
if f10_arg1.down then
if f10_arg1.button == "shoulderl" then
Engine.NotifyServer( "bot_select", -1 )
elseif f10_arg1.button == "shoulderr" then
Engine.NotifyServer( "bot_select", 1 )
elseif f10_arg1.button == "primary" then
f0_local12( f10_arg0, "a", 1 )
f0_local12( f10_arg0, "b", 0 )
f0_local12( f10_arg0, "x", 0 )
f0_local12( f10_arg0, "y", 0 )
FireTeam.tactic_name = "@MPUI_FT_TACTIC_AMBUSH"
Engine.NotifyServer( "tactic_select", 2 )
elseif f10_arg1.button == "secondary" then
f0_local12( f10_arg0, "a", 0 )
f0_local12( f10_arg0, "b", 1 )
f0_local12( f10_arg0, "x", 0 )
f0_local12( f10_arg0, "y", 0 )
FireTeam.tactic_name = "@MPUI_FT_TACTIC_BUDDY"
Engine.NotifyServer( "tactic_select", 3 )
elseif f10_arg1.button == "alt1" then
f0_local12( f10_arg0, "a", 0 )
f0_local12( f10_arg0, "b", 0 )
f0_local12( f10_arg0, "x", 1 )
f0_local12( f10_arg0, "y", 0 )
FireTeam.tactic_name = "@MPUI_FT_TACTIC_HUNT"
Engine.NotifyServer( "tactic_select", 4 )
elseif f10_arg1.button == "alt2" then
f0_local12( f10_arg0, "a", 0 )
f0_local12( f10_arg0, "b", 0 )
f0_local12( f10_arg0, "x", 0 )
f0_local12( f10_arg0, "y", 1 )
FireTeam.tactic_name = "@MPUI_FT_TACTIC_NONE"
Engine.NotifyServer( "tactic_select", 1 )
elseif f10_arg1.button == "select" then
f10_arg0:dispatchEventToRoot( {
name = "toggle_scoreboard"
} )
end
end
end
local f0_local22 = function ( f11_arg0, f11_arg1 )
Engine.NotifyServer( "tactics_menu", 0 )
f0_local17( f11_arg0, nil )
LUI.FlowManager.RequestCloseAllMenus( f11_arg0, nil )
end
local f0_local23 = function ()
return {
type = "UIText",
id = "mp_fire_team_title",
properties = {
text = Engine.Localize( "@MPUI_FT_TACTICS" )
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
height = 30,
font = CoD.TextSettings.HudEuroBigFont.Font,
alignment = LUI.Alignment.Center,
alpha = 1
}
}
}
end
local f0_local24 = function ()
return {
type = "UIImage",
id = "mp_fire_team_bg",
states = {
default = {
leftAnchor = true,
topAnchor = true,
rightAnchor = true,
bottomAnchor = true,
top = 0,
left = 0,
material = RegisterMaterial( "black" ),
alpha = 0.7
}
}
}
end
local f0_local25 = function ()
return {
type = "UIImage",
id = "mp_fire_team_title_line",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
top = 30,
height = 2,
material = RegisterMaterial( "white" ),
alpha = 0.3
}
}
}
end
local f0_local26 = 0
local f0_local27 = 0
local f0_local28 = 24
local f0_local29 = 68
local f0_local30 = 80
local f0_local31 = 20
local f0_local32 = function ()
local f15_local0 = {
type = "UIElement",
id = "mp_fire_team_menu_id",
states = {
default = {
leftAnchor = true,
topAnchor = true,
rightAnchor = false,
bottomAnchor = false,
left = 110,
top = 210,
width = 0,
height = 200,
alpha = 0
},
opening = MBh.BaseState( "default", {
width = 300,
alpha = 0.25
} ),
active = MBh.BaseState( "default", {
width = 280,
alpha = 1
} )
}
}
local f15_local1 = {}
local f15_local2 = f0_local24()
local f15_local3 = f0_local25()
local f15_local4 = f0_local23()
local f15_local5 = f0_local14( "a", "@PLATFORM_UI_SELECTBUTTON", f0_local26, f0_local27 + f0_local28 )
local f15_local6 = f0_local13( "a", "a", f0_local26, f0_local27 + f0_local29 )
local f15_local7 = f0_local14( "b", "@PLATFORM_BACK_BUTTON", f0_local26 + f0_local28, f0_local27 )
local f15_local8 = f0_local13( "b", "b", f0_local26 + f0_local29, f0_local27 )
local f15_local9 = f0_local14( "x", "@PLATFORM_CHALLENGE_BLADE_BUTTON", f0_local26 - f0_local28, f0_local27 )
local f15_local10 = f0_local13( "x", "c", f0_local26 - f0_local29, f0_local27 )
local f15_local11 = f0_local14( "y", "@PLATFORM_Y_BUTTON", f0_local26, f0_local27 - f0_local28 )
local f15_local12 = f0_local15( "y", "@MPUI_FT_TACTIC_NONE", f0_local26, f0_local27 - f0_local28 - f0_local31 - 8, LUI.Alignment.Center )
local f15_local13 = f0_local14( "lb", "@PLATFORM_FB_PREV_PAGE_BUTTON", f0_local26 - f0_local30, f0_local27 - 50 )
local f15_local14 = f0_local15( "lb", "@MPUI_FT_PREV", f0_local26 - f0_local30 - f0_local31, f0_local27 - 50, LUI.Alignment.Right )
local f15_local15 = f0_local14( "rb", "@PLATFORM_FB_NEXT_PAGE_BUTTON", f0_local26 + f0_local30, f0_local27 - 50 )
local f15_local16 = f0_local15( "rb", "@MPUI_FT_NEXT", f0_local26 + f0_local30 + f0_local31, f0_local27 - 50, LUI.Alignment.Left )
f15_local0.children = f15_local2
f15_local0.handlers = {
menu_create = f0_local16,
gamepad_button = f0_local20,
toggle_scoreboard = f0_local22,
mp_fire_team_on = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
125
},
{
"active",
125
}
} )
}
return f15_local0
end
local f0_local33 = 0
local f0_local34 = 15
local f0_local35 = 24
local f0_local36 = 80
local f0_local37 = 20
local f0_local38 = function ()
local f16_local0 = {
type = "UIElement",
id = "mp_fire_team_menu_id",
states = {
default = {
leftAnchor = true,
topAnchor = true,
rightAnchor = false,
bottomAnchor = false,
left = 110,
top = 210,
width = 0,
height = 150,
alpha = 0
},
opening = MBh.BaseState( "default", {
width = 300,
alpha = 0.25
} ),
active = MBh.BaseState( "default", {
width = 280,
alpha = 1
} )
}
}
local f16_local1 = {}
local f16_local2 = f0_local24()
local f16_local3 = f0_local25()
local f16_local4 = f0_local23()
local f16_local5 = f0_local14( "a", "@PLATFORM_UI_SELECTBUTTON", f0_local33, f0_local34 + f0_local35 )
local f16_local6 = f0_local15( "a", "@MPUI_FT_TACTIC_AMBUSH", f0_local33, f0_local34 + f0_local35 + f0_local37 + 2, LUI.Alignment.Center )
local f16_local7 = f0_local14( "b", "@PLATFORM_BACK_BUTTON", f0_local33 + f0_local35, f0_local34 )
local f16_local8 = f0_local15( "b", "@MPUI_FT_TACTIC_BUDDY", f0_local33 + f0_local35 + f0_local37, f0_local34 - 8, LUI.Alignment.Left )
local f16_local9 = f0_local14( "x", "@PLATFORM_CHALLENGE_BLADE_BUTTON", f0_local33 - f0_local35, f0_local34 )
local f16_local10 = f0_local15( "x", "@MPUI_FT_TACTIC_HUNT", f0_local33 - f0_local35 - f0_local37, f0_local34 - 8, LUI.Alignment.Right )
local f16_local11 = f0_local14( "y", "@PLATFORM_Y_BUTTON", f0_local33, f0_local34 - f0_local35 )
local f16_local12 = f0_local15( "y", "@MPUI_FT_TACTIC_NONE", f0_local33, f0_local34 - f0_local35 - f0_local37 - 2, LUI.Alignment.Center )
local f16_local13 = f0_local14( "lb", "@PLATFORM_FB_PREV_PAGE_BUTTON", f0_local33 - f0_local36, f0_local34 - 40 )
local f16_local14 = f0_local15( "lb", "@MPUI_FT_PREV", f0_local33 - f0_local36 - f0_local37, f0_local34 - 40, LUI.Alignment.Right )
local f16_local15 = f0_local14( "rb", "@PLATFORM_FB_NEXT_PAGE_BUTTON", f0_local33 + f0_local36, f0_local34 - 40 )
local f16_local16 = f0_local15( "rb", "@MPUI_FT_NEXT", f0_local33 + f0_local36 + f0_local37, f0_local34 - 40, LUI.Alignment.Left )
f16_local0.children = f16_local2
f16_local0.handlers = {
menu_create = f0_local16,
gamepad_button = f0_local21,
toggle_scoreboard = f0_local22,
mp_fire_team_on = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
125
},
{
"active",
125
}
} )
}
return f16_local0
end
LUI.MenuBuilder.registerDef( "mp_fire_team_menu", f0_local32 )
LUI.MenuBuilder.registerDef( "mp_fire_team_menu_war", f0_local38 )
LockTable( _M )

View File

@ -0,0 +1,97 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ( f1_arg0, f1_arg1 )
if f1_arg1 ~= nil and f1_arg1.bold ~= nil and f1_arg1.bold == true and f1_arg1.message ~= nil then
f1_arg0:setText( f1_arg1.message )
local f1_local0 = MBh.AnimateSequence( {
{
"opening",
0
},
{
"active",
100
},
{
"active",
2500
},
{
"default",
100
}
} )
f1_local0( f1_arg0 )
end
end
LUI.MenuBuilder.registerDef( "gameMessageHudDef", function ()
return {
type = "UIElement",
id = "gameMessageHudId",
states = {
default = {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 200,
left = -32,
bottom = 32,
right = 32
}
},
children = {
{
type = "UIText",
id = "gameMessageTextId",
properties = {
text = "",
textStyle = CoD.TextStyle.Shadowed
},
states = {
default = {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = 0,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alpha = 0
},
opening = {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = -256,
bottom = CoD.TextSettings.HudEuroNormalFont.Height + 80,
right = 256,
alpha = 1
},
active = {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = -256,
bottom = CoD.TextSettings.HudEuroNormalFont.Height,
right = 256,
alpha = 1
}
},
handlers = {
game_message = f0_local0
}
}
}
}
end )
LockTable( _M )

View File

@ -0,0 +1,751 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 512
f0_local1 = 128
f0_local2 = 512
local f0_local3 = 128
local f0_local4 = 64
local f0_local5 = 64
local f0_local6 = 32
local f0_local7 = 64
local f0_local8 = 32
local f0_local9 = 64
local f0_local10 = 192
local f0_local11 = 192
local f0_local12 = 16
local f0_local13 = 16
local f0_local14 = 256
local f0_local15 = 256
local f0_local16 = 192
local f0_local17 = 192
local f0_local18 = 192
local f0_local19 = 192
local f0_local20 = function ( f1_arg0, f1_arg1 )
if f1_arg1.value > 0 then
f1_arg0:animateToState( "active", 0 )
if not f1_arg0.played_flash then
local f1_local0 = f1_arg0:getFirstDescendentById( "heli_pilot_flash_image_id" )
local f1_local1 = MBh.AnimateSequence( {
{
"active",
0
},
{
"closing",
500
}
} )
f1_local1( f1_local0 )
f1_arg0.played_flash = true
end
local f1_local0 = f1_arg0:getFirstDescendentById( "heli_pilot_reticle_image_id" )
local f1_local1 = f1_arg0:getFirstDescendentById( "heli_pilot_altitude_back_image_id" )
local f1_local2 = f1_arg0:getFirstDescendentById( "heli_pilot_speed_back_image_id" )
local f1_local3 = f1_arg0:getFirstDescendentById( "heli_pilot_reticle_zoomed_image_id" )
local f1_local4 = f1_arg0:getFirstDescendentById( "heli_pilot_flare_back_image_id" )
local f1_local5 = f1_arg0:getFirstDescendentById( "heli_pilot_mg_back_image_id" )
if f1_arg1.value == 1 then
f1_local3:animateToState( "default", 0 )
local f1_local6 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
150
},
{
"active",
250
}
} )
f1_local6( f1_local0 )
f1_local6 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
400
},
{
"active",
250
}
} )
f1_local6( f1_local1 )
f1_local6 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
350
},
{
"active",
250
}
} )
f1_local6( f1_local2 )
f1_local6 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
250
},
{
"active",
250
}
} )
f1_local6( f1_local4 )
f1_local6 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
250
},
{
"active",
250
}
} )
f1_local6( f1_local5 )
elseif f1_arg1.value == 2 then
f1_local0:animateToState( "default", 350 )
f1_local1:animateToState( "default", 350 )
f1_local2:animateToState( "default", 350 )
f1_local4:animateToState( "default", 0 )
f1_local5:animateToState( "default", 0 )
local f1_local6 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
150
},
{
"active",
250
}
} )
f1_local6( f1_local3 )
end
else
f1_arg0.played_flash = false
f1_arg0:animateToState( "default", 0 )
end
end
local f0_local21 = function ()
local f2_local0 = RegisterMaterial( "apache_ammo_mp" )
local self = LUI.UIElement.new()
self.id = "flare_ammo_container"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 0,
right = -5,
height = f0_local12 * 2,
width = f0_local13,
spacing = 0
} )
self:animateToState( "default", 0 )
local f2_local2 = LUI.UIImage.new()
f2_local2.id = "flare_ammo1"
f2_local2:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 2,
right = 0,
height = f0_local12,
width = f0_local13,
material = f2_local0,
alpha = 1
} )
f2_local2:animateToState( "default", 0 )
f2_local2:registerAnimationState( "inactive", {
alpha = 0
} )
local f2_local3 = LUI.UIImage.new()
f2_local3.id = "flare_ammo2"
f2_local3:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 12,
right = 0,
height = f0_local12,
width = f0_local13,
material = f2_local0,
alpha = 1
} )
f2_local3:animateToState( "default", 0 )
f2_local3:registerAnimationState( "inactive", {
alpha = 0
} )
self:addElement( f2_local2 )
self:addElement( f2_local3 )
return self
end
local f0_local22 = function ( f3_arg0, f3_arg1 )
local f3_local0 = f3_arg0:getChildById( "flare_ammo_container" )
if f3_arg1.value < 2 then
local f3_local1 = f3_local0:getChildById( "flare_ammo" .. f3_arg1.value + 1 )
local f3_local2 = MBh.AnimateSequence( {
{
"inactive",
50
},
{
"inactive",
50
},
{
"default",
0
},
{
"default",
50
},
{
"inactive",
50
},
{
"inactive",
50
},
{
"default",
0
},
{
"default",
50
},
{
"inactive",
150
}
} )
f3_local2( f3_local1 )
f3_local1:animateToState( "inactive", 250 )
else
local f3_local1 = f3_local0:getChildById( "flare_ammo1" )
f3_local1:animateToState( "default", 0 )
local f3_local2 = f3_local0:getChildById( "flare_ammo2" )
f3_local2:animateToState( "default", 0 )
end
end
local f0_local23 = function ( f4_arg0, f4_arg1 )
local f4_local0 = f4_arg0:getChildById( "heli_pilot_warn_left_image_id" )
local f4_local1 = f4_arg0:getChildById( "heli_pilot_warn_right_image_id" )
local f4_local2 = MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
250
},
{
"default",
250
},
{
"active",
250
},
{
"default",
250
},
{
"active",
250
},
{
"default",
250
}
} )
if f4_arg1.value == 1 then
f4_local2( f4_local0 )
f4_local2( f4_local1 )
elseif f4_arg1.value == 2 then
f4_local2( f4_local1 )
elseif f4_arg1.value == 3 then
f4_local2( f4_local0 )
end
end
local f0_local24 = function ( f5_arg0, f5_arg1 )
local f5_local0 = f5_arg0:getChildById( "heli_pilot_flare_back_image_id" )
local f5_local1 = f5_local0:getChildById( "heli_pilot_flare_text_id" )
local f5_local2 = f5_local0:getChildById( "heli_pilot_zoom_text_id" )
local f5_local3 = f5_arg0:getChildById( "heli_pilot_mg_back_image_id" )
local f5_local4 = f5_local3:getChildById( "heli_pilot_mg_text_id" )
f5_local1:setText( Engine.Localize( "@PLATFORM_HELI_PILOT_POP_FLARE" ) )
f5_local2:setText( Engine.Localize( "@PLATFORM_HELI_PILOT_ZOOM" ) )
f5_local4:setText( Engine.Localize( "@PLATFORM_HELI_PILOT_FIRE" ) )
end
LUI.MenuBuilder.registerType( "heliPilotOverlayDef", function ()
local f6_local0 = RegisterMaterial( "apache_altitude_back_mp" )
local f6_local1 = RegisterMaterial( "apache_speed_back_mp" )
local f6_local2 = RegisterMaterial( "apache_reticle_mp" )
local f6_local3 = RegisterMaterial( "apache_flare_back_mp" )
local f6_local4 = RegisterMaterial( "apache_mg_back_mp" )
local f6_local5 = RegisterMaterial( "apache_zoom_overlay_mp" )
local f6_local6 = RegisterMaterial( "apache_warn_lock_left_mp" )
local f6_local7 = RegisterMaterial( "apache_warn_lock_right_mp" )
local f6_local8 = RegisterMaterial( "apache_visor_mp" )
local f6_local9 = RegisterMaterial( "pointflash" )
local self = LUI.UIElement.new()
self.id = "heli_pilot_overlay_container_id"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
alpha = 1
} )
self:registerOmnvarHandler( "ui_heli_pilot", f0_local20 )
self:registerEventHandler( "init_overlay", f0_local20 )
self:registerEventHandler( "refresh_controls", f0_local24 )
local f6_local11 = LUI.UIImage.new()
f6_local11.id = "heli_pilot_visor_image_id"
f6_local11:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f6_local8,
alpha = 1
} )
f6_local11:animateToState( "default", 0 )
local f6_local12 = LUI.UIImage.new()
f6_local12.id = "heli_pilot_flash_image_id"
f6_local12:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f0_local14,
left = -f0_local15,
bottom = f0_local14,
right = f0_local15,
material = f6_local9,
alpha = 0
} )
f6_local12:animateToState( "default", 0 )
f6_local12:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f0_local14,
left = -f0_local15,
bottom = f0_local14,
right = f0_local15,
alpha = 1
} )
f6_local12:registerAnimationState( "closing", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f0_local14 * -2,
left = -f0_local15 * 100,
bottom = f0_local14 * -2,
right = f0_local15 * 100,
alpha = 0
} )
local f6_local13 = LUI.UIImage.new()
f6_local13.id = "heli_pilot_reticle_image_id"
f6_local13:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f6_local2,
alpha = 0
} )
f6_local13:animateToState( "default", 0 )
f6_local13:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -(f0_local4 * 0.5) - 40,
left = -(f0_local5 * 0.5) - 40,
bottom = f0_local4 * 0.5 + 40,
right = f0_local5 * 0.5 + 40,
alpha = 0
} )
f6_local13:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f0_local4 * 0.5,
left = -f0_local5 * 0.5,
bottom = f0_local4 * 0.5,
right = f0_local5 * 0.5,
alpha = 1
} )
local f6_local14 = LUI.UIImage.new()
f6_local14.id = "heli_pilot_reticle_zoomed_image_id"
f6_local14:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f6_local5,
alpha = 0
} )
f6_local14:animateToState( "default", 0 )
f6_local14:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -(f0_local10 * 0.5) - 40,
left = -(f0_local11 * 0.5) - 40,
bottom = f0_local10 * 0.5 + 40,
right = f0_local11 * 0.5 + 40,
zRot = 180,
alpha = 0
} )
f6_local14:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f0_local10 * 0.5,
left = -f0_local11 * 0.5,
bottom = f0_local10 * 0.5,
right = f0_local11 * 0.5,
zRot = 0,
alpha = 1
} )
local f6_local15 = LUI.UIImage.new()
f6_local15.id = "heli_pilot_altitude_back_image_id"
f6_local15:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = -(f0_local0 * 0.5) + 500,
left = -500,
bottom = f0_local0 * 0.5 - 500,
width = f0_local1,
material = f6_local0,
alpha = 0
} )
f6_local15:animateToState( "default", 0 )
f6_local15:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = -(f0_local0 * 0.5) - 10,
left = 110,
bottom = f0_local0 * 0.5 + 10,
width = f0_local1,
alpha = 1
} )
f6_local15:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = -(f0_local0 * 0.5),
left = 100,
bottom = f0_local0 * 0.5,
width = f0_local1,
alpha = 1
} )
local f6_local16 = LUI.UIImage.new()
f6_local16.id = "heli_pilot_speed_back_image_id"
f6_local16:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = -(f0_local2 * 0.5) + 500,
right = 500,
bottom = f0_local2 * 0.5 - 500,
width = f0_local3,
material = f6_local1,
alpha = 0
} )
f6_local16:animateToState( "default", 0 )
f6_local16:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = -(f0_local2 * 0.5) - 10,
right = -110,
bottom = f0_local2 * 0.5 + 10,
width = f0_local3,
alpha = 1
} )
f6_local16:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = -(f0_local2 * 0.5),
right = -100,
bottom = f0_local2 * 0.5,
width = f0_local3,
alpha = 1
} )
local f6_local17 = LUI.UIImage.new()
f6_local17.id = "heli_pilot_flare_back_image_id"
f6_local17:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 100,
left = 250,
bottom = 100,
width = f0_local7,
material = f6_local3,
alpha = 0
} )
f6_local17:animateToState( "default", 0 )
f6_local17:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 100 - f0_local6 * 0.5 - 40,
left = 210,
bottom = 100 + f0_local6 * 0.5 + 40,
width = f0_local7,
alpha = 0
} )
f6_local17:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 100 - f0_local6 * 0.5,
left = 250,
bottom = 100 + f0_local6 * 0.5,
width = f0_local7,
alpha = 1
} )
f6_local17:registerOmnvarHandler( "ui_heli_pilot_flare_ammo", f0_local22 )
local f6_local18 = LUI.UIText.new()
f6_local18.id = "heli_pilot_flare_text_id"
f6_local18:setText( Engine.Localize( "@PLATFORM_HELI_PILOT_POP_FLARE" ) )
f6_local18:setTextStyle( CoD.TextStyle.Shadowed )
f6_local18:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = 30,
left = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 256,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Left
} )
f6_local18:animateToState( "default", 0 )
local f6_local19 = LUI.UIText.new()
f6_local19.id = "heli_pilot_zoom_text_id"
f6_local19:setText( Engine.Localize( "@PLATFORM_HELI_PILOT_ZOOM" ) )
f6_local19:setTextStyle( CoD.TextStyle.Shadowed )
f6_local19:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = 50,
left = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 256,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Left
} )
f6_local19:animateToState( "default", 0 )
f6_local17:addElement( f0_local21() )
f6_local17:addElement( f6_local18 )
f6_local17:addElement( f6_local19 )
local f6_local20 = LUI.UIImage.new()
f6_local20.id = "heli_pilot_mg_back_image_id"
f6_local20:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 100,
right = -250,
bottom = 100,
width = f0_local9,
material = f6_local4,
alpha = 0
} )
f6_local20:animateToState( "default", 0 )
f6_local20:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 100 - f0_local8 * 0.5 - 40,
right = -210,
bottom = 100 + f0_local8 * 0.5 + 40,
width = f0_local9,
alpha = 0
} )
f6_local20:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 100 - f0_local8 * 0.5,
right = -250,
bottom = 100 + f0_local8 * 0.5,
width = f0_local9,
alpha = 1
} )
local f6_local21 = LUI.UIText.new()
f6_local21.id = "heli_pilot_mg_text_id"
f6_local21:setText( Engine.Localize( "@PLATFORM_HELI_PILOT_FIRE" ) )
f6_local21:setTextStyle( CoD.TextStyle.Shadowed )
f6_local21:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = 30,
right = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 256,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right
} )
f6_local21:animateToState( "default", 0 )
f6_local20:addElement( f6_local21 )
local f6_local22 = LUI.UIElement.new()
f6_local22.id = "heli_pilot_warn_container"
f6_local22:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f0_local16 / 2,
left = -440,
bottom = f0_local16 / 2,
right = 440
} )
f6_local22:animateToState( "default", 0 )
f6_local22:registerOmnvarHandler( "ui_heli_pilot_warn", f0_local23 )
local f6_local23 = LUI.UIImage.new()
f6_local23.id = "heli_pilot_warn_left_image_id"
f6_local23:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
height = f0_local16,
width = f0_local17,
material = f6_local6,
red = 1,
green = 1,
blue = 1,
alpha = 0
} )
f6_local23:animateToState( "default", 0 )
f6_local23:registerAnimationState( "active", {
red = Colors.orange.r,
green = Colors.orange.g,
blue = Colors.orange.b,
alpha = 1
} )
local f6_local24 = LUI.UIImage.new()
f6_local24.id = "heli_pilot_warn_right_image_id"
f6_local24:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 0,
right = 0,
height = f0_local18,
width = f0_local19,
material = f6_local7,
red = 1,
green = 1,
blue = 1,
alpha = 0
} )
f6_local24:animateToState( "default", 0 )
f6_local24:registerAnimationState( "active", {
red = Colors.orange.r,
green = Colors.orange.g,
blue = Colors.orange.b,
alpha = 1
} )
f6_local22:addElement( f6_local23 )
f6_local22:addElement( f6_local24 )
self:addElement( f6_local11 )
self:addElement( f6_local12 )
self:addElement( f6_local13 )
self:addElement( f6_local14 )
self:addElement( f6_local15 )
self:addElement( f6_local16 )
self:addElement( f6_local17 )
self:addElement( f6_local20 )
self:addElement( f6_local22 )
return self
end )
LockTable( _M )

182
lui/mp_hud/hints.dec.lua Normal file
View File

@ -0,0 +1,182 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 0.65
function mantleHintDef()
local self = LUI.UIElement.new()
self.id = "mantleHintId"
self:setupOwnerdraw( CoD.Ownerdraw.CGMantleHint, f0_local0, CoD.TextStyle.Shadowed )
local f1_local1 = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = -80,
left = -32,
right = 32,
height = 64,
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alpha = 0.6
}
if Engine.UsingSplitscreenUpscaling() then
f1_local1.bottom = -20
end
self:registerAnimationState( "default", f1_local1 )
self:animateToState( "default", 0 )
return self
end
function cursorHintDef()
local self = LUI.UIElement.new()
self.id = "cursorHintId"
self:setupOwnerdraw( CoD.Ownerdraw.CGCursorHint, f0_local0, CoD.TextStyle.Shadowed )
local f2_local1 = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = -160,
left = -32,
right = 32,
height = 64,
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alpha = 0.6
}
if Engine.UsingSplitscreenUpscaling() then
f2_local1.bottom = -60
end
self:registerAnimationState( "default", f2_local1 )
self:animateToState( "default", 0 )
return self
end
function invalidCmdHintDef()
local self = LUI.UIElement.new()
self.id = "invalidCmdHintId"
self:setupOwnerdraw( CoD.Ownerdraw.CGInvalidCmdHint, f0_local0, CoD.TextStyle.Shadowed )
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 162,
left = -32,
right = 32,
height = 64,
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alpha = 0.6
} )
self:animateToState( "default", 0 )
return self
end
function spectatorControlsDef()
local self = LUI.UIElement.new()
self.id = "spectatorControlsId"
self:setupOwnerdraw( CoD.Ownerdraw.CGSpectatorControls, f0_local0, CoD.TextStyle.Shadowed )
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = -5,
left = 10,
height = 5,
width = 512,
alignment = CoD.OwnerdrawAlignment.TextTopLeft,
font = CoD.TextSettings.HudEuroConRegTinyFont.Font,
alpha = 0.6
} )
self:animateToState( "default", 0 )
return self
end
function breathHintDef()
local self = LUI.UIElement.new()
self.id = "breathHintId"
self:setupOwnerdraw( CoD.Ownerdraw.CGHoldBreathHint, f0_local0, CoD.TextStyle.Shadowed )
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 40,
left = -32,
right = 32,
height = 64,
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alpha = 0.6
} )
self:animateToState( "default", 0 )
return self
end
function zoomHintDef()
local self = LUI.UIElement.new()
self.id = "zoomHintId"
self:setupOwnerdraw( CoD.Ownerdraw.CGChangeZoomHint, f0_local0, CoD.TextStyle.Shadowed )
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 70,
left = -32,
right = 32,
height = 64,
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alpha = 0.6
} )
self:animateToState( "default", 0 )
return self
end
function toggleHybridHintDef()
local self = LUI.UIElement.new()
self.id = "toggleHybridHintId"
self:setupOwnerdraw( CoD.Ownerdraw.CGToggleHybridHint, f0_local0, CoD.TextStyle.Shadowed )
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 40,
left = -32,
right = 32,
height = 64,
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alpha = 0.6
} )
self:animateToState( "default", 0 )
return self
end
function toggleThermalHintDef()
local self = LUI.UIElement.new()
self.id = "toggleThermalHintId"
self:setupOwnerdraw( CoD.Ownerdraw.CGToggleThermalHint, f0_local0, CoD.TextStyle.Shadowed )
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 40,
left = -32,
right = 32,
height = 64,
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alpha = 0.6
} )
self:animateToState( "default", 0 )
return self
end
LockTable( _M )

646
lui/mp_hud/hordehud.dec.lua Normal file
View File

@ -0,0 +1,646 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = ""
f0_local1 = 0
f0_local2 = 5
local f0_local3 = function ( f1_arg0, f1_arg1 )
if f1_arg1.value < 1 then
return
else
local f1_local0 = MBh.AnimateSequence( {
{
"active",
50
},
{
"default",
1000
}
} )
f1_local0( f1_arg0 )
end
end
local f0_local4 = function ()
local f2_local0 = Game.GetPlayerWeaponName()
if f2_local0 == "none" then
return f2_local0
end
local f2_local1 = string.find( f2_local0, "_" )
local f2_local2 = string.sub( f2_local0, 1, f2_local1 - 1 )
if f2_local2 == "iw5" or f2_local2 == "iw6" then
f2_local2 = string.sub( f2_local0, 1, string.find( f2_local0, "_", f2_local1 + 1 ) - 1 )
end
return f2_local2
end
local f0_local5 = function ( menu, controller )
local self = LUI.UIElement.new()
self.id = "killstreak_limit"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = -445
} )
self:animateToState( "default", 0 )
local f3_local1 = LUI.UIText.new()
f3_local1.id = "killstreak_limit_text"
f3_local1:setText( Engine.Localize( "@HORDE_KILLSTREAK_LIMIT" ) )
f3_local1:setTextStyle( CoD.TextStyle.Shadowed )
f3_local1:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
height = CoD.TextSettings.HudIW6BigFont.Height,
font = CoD.TextSettings.HudIW6BigFont.Font,
red = Colors.orange.r,
green = Colors.orange.g,
blue = Colors.orange.b,
alignment = LUI.Alignment.Center,
alpha = 0
} )
f3_local1:registerAnimationState( "active", {
alpha = 1
} )
f3_local1:animateToState( "default", 0 )
f3_local1:registerOmnvarHandler( "ui_killstreak_limit", f0_local3 )
self:addElement( f3_local1 )
return self
end
local f0_local6 = function ( f4_arg0, f4_arg1 )
local f4_local0 = f4_arg0:getChildById( "point" .. f0_local1 )
if f4_local0 ~= nil then
local f4_local1 = f4_local0:getFirstChild()
if f4_local1 ~= nil then
f4_local1:setText( "+" .. f4_arg1.value )
f4_local0:registerAnimationState( "large", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
left = math.random( 140, 290 ),
top = math.random( 40, 190 ),
width = 102,
height = CoD.TextSettings.HudEuroMedSmallFont.Height * 1.5,
alpha = 1
} )
local f4_local2 = MBh.AnimateSequence( {
{
"large",
0
},
{
"default",
1000
}
} )
f4_local2( f4_local0, nil )
end
end
f0_local1 = (f0_local1 + 1) % f0_local2
end
local f0_local7 = function ( f5_arg0 )
local self = LUI.UIElement.new()
self.id = "point" .. f5_arg0
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
left = 180,
top = 60,
width = 128,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
alpha = 0
} )
self:animateToState( "default", 0 )
local f5_local1 = LUI.UIText.new()
f5_local1.id = "point_text"
f5_local1:setText( "+" .. math.random( 10, 60 ) )
f5_local1:setTextStyle( CoD.TextStyle.Shadowed )
f5_local1:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alignment = LUI.Alignment.Center
} )
f5_local1:animateToState( "default", 0 )
self:addElement( f5_local1 )
return self
end
local f0_local8 = function ( f6_arg0, f6_arg1 )
local f6_local0 = f0_local4()
local f6_local1 = Engine.TableLookup( HordeIconsTable.File, HordeIconsTable.Cols.Ref, f6_local0, HordeIconsTable.Cols.Image )
local f6_local2 = Engine.TableLookup( HordeIconsTable.File, HordeIconsTable.Cols.Ref, f6_local0, HordeIconsTable.Cols.Misc )
local f6_local3 = RegisterMaterial( f6_local1 )
local f6_local4 = f6_arg0:getChildById( "weaponImage" )
if f6_local1 ~= "" then
CoD.SetMaterial( f6_local4, f6_local3 )
if f6_local2 == "weapon_pistol" then
if f6_local0 == "iw6_magnumhorde" then
f6_local4:animateToState( "magnum", 0 )
else
f6_local4:animateToState( "pistol", 0 )
end
elseif f6_local2 == "weapon_sniper" or f6_local2 == "weapon_shotgun" then
f6_local4:animateToState( "sniper_shot", 0 )
elseif f6_local2 == "weapon_lmg" then
f6_local4:animateToState( "lmg", 0 )
else
f6_local4:animateToState( "other", 0 )
end
end
end
local f0_local9 = function ( f7_arg0, f7_arg1 )
f0_local8( f7_arg0, f7_arg1 )
end
local f0_local10 = function ( f8_arg0, f8_arg1 )
local f8_local0 = f8_arg0:getFirstDescendentById( "middle" )
f8_local0:registerAnimationState( "move_bar", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
width = f8_arg1.value / 100 * f8_local0.m_width,
height = f8_local0.m_height
} )
f8_local0:animateToState( "move_bar", 150 )
end
local f0_local11 = function ( f9_arg0, f9_arg1, f9_arg2, f9_arg3, f9_arg4, f9_arg5, f9_arg6, f9_arg7, f9_arg8 )
local f9_local0 = RegisterMaterial( f9_arg6 )
local f9_local1 = RegisterMaterial( f9_arg7 )
local self = LUI.UIHorizontalList.new()
self.id = f9_arg0
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = f9_arg2,
left = f9_arg1,
height = f9_arg5,
width = f9_arg4,
alignment = LUI.Alignment.Left,
alpha = 1
} )
self:animateToState( "default", 0 )
self:registerOmnvarHandler( f9_arg8, f0_local10 )
local f9_local3 = LUI.UIImage.new()
f9_local3.id = "middle"
f9_local3.m_width = f9_arg4
f9_local3.m_height = f9_arg5
f9_local3:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
height = f9_arg5,
width = 0,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
material = f9_local0,
alpha = 1
} )
f9_local3:registerAnimationState( "full", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
height = f9_arg5,
width = f9_arg4,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
material = f9_local0,
alpha = 1
} )
f9_local3:animateToState( "default", 0 )
local f9_local4 = LUI.UIImage.new()
f9_local4.id = "end"
f9_local4:registerAnimationState( "default", {
topAnchor = true,
rightAnchor = true,
top = 0,
right = 0,
height = f9_arg5,
width = f9_arg3,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
material = f9_local1,
alpha = 1
} )
f9_local4:animateToState( "default", 0 )
self:addElement( f9_local3 )
self:addElement( f9_local4 )
return self
end
local f0_local12 = function ( f10_arg0, f10_arg1 )
f10_arg0:setText( f10_arg1.value )
end
local f0_local13 = function ( f11_arg0, f11_arg1 )
f11_arg0:setText( f11_arg1.value )
end
local f0_local14 = function ()
local f12_local0 = 56
local f12_local1 = 206
local f12_local2 = CoD.TextSettings.HudEuroMedSmallFont
local f12_local3 = CoD.TextSettings.HudDigitalExtraBigFont
local f12_local4 = 250
local f12_local5 = RegisterMaterial( "hud_safeguard_roundback" )
local self = LUI.UIElement.new()
self.id = "horde_hud_round"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
left = 10,
bottom = -10,
height = f12_local0,
width = f12_local1
} )
self:animateToState( "default", 0 )
local f12_local7 = LUI.UIImage.new()
f12_local7.id = "round_bg"
f12_local7:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
height = f12_local0,
width = f12_local1,
material = f12_local5,
alpha = 0.7
} )
f12_local7:animateToState( "default", 0 )
local f12_local8 = LUI.UIText.new()
f12_local8.id = "round_text"
f12_local8:setTextStyle( CoD.TextStyle.Shadowed )
f12_local8:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 6,
left = 10,
width = 64,
height = f12_local2.Height,
font = f12_local2.Font,
alignment = LUI.Alignment.Left,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 0
} )
f12_local8:registerAnimationState( "active", {
alpha = 1
} )
f12_local8:animateToState( "default", 0 )
f12_local8:registerEventHandler( "hud_on", MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
500
}
} ) )
f12_local8:setText( Engine.Localize( "@MP_HORDE_ROUND_NUM" ) )
local f12_local9 = LUI.UIText.new()
f12_local9.id = "round_number_bg"
f12_local9:setText( "888" )
f12_local9:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
left = 79,
bottom = -6,
height = f12_local3.Height,
width = 80,
font = f12_local3.Font,
alignment = LUI.Alignment.Right,
red = 0,
green = 0,
blue = 0,
alpha = 0
} )
f12_local9:registerAnimationState( "active", {
alpha = 0.25
} )
f12_local9:animateToState( "default", 0 )
f12_local9:registerEventHandler( "hud_on", MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
500
}
} ) )
local f12_local10 = LUI.UIText.new()
f12_local10.id = "round_number"
f12_local10:setText( "1" )
f12_local10:setTextStyle( CoD.TextStyle.Shadowed )
f12_local10:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
left = 79,
bottom = -6,
height = f12_local3.Height,
width = 80,
font = f12_local3.Font,
alignment = LUI.Alignment.Right,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 0
} )
f12_local10:registerAnimationState( "active", {
alpha = 1
} )
f12_local10:animateToState( "default", 0 )
f12_local10:registerEventHandler( "hud_on", MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
500
}
} ) )
f12_local10:registerOmnvarHandler( "ui_horde_round_number", f0_local13 )
self:addElement( f12_local7 )
self:addElement( f12_local8 )
self:addElement( f12_local9 )
self:addElement( f12_local10 )
return self
end
LUI.MenuBuilder.registerType( "hordeHudDef", function ()
local f13_local0 = 64
local f13_local1 = 500
local f13_local2 = CoD.TextSettings.HudDigitalExtraBigFont
local f13_local3 = 250
local f13_local4 = RegisterMaterial( "hud_safeguard_levelback" )
local self = LUI.UIElement.new()
self.id = "horde_hud"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0
} )
self:animateToState( "default", 0 )
local f13_local6 = LUI.UIElement.new()
f13_local6.id = "horde_hud_weapon_support"
f13_local6:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 20,
left = 10,
height = 400,
width = 400
} )
f13_local6:animateToState( "default", 0 )
f13_local6:registerEventHandler( "weapon_change", f0_local8 )
f13_local6:registerOmnvarHandler( "ui_horde_award_points", f0_local6 )
f13_local6:registerEventHandler( "menu_create", f0_local9 )
local f13_local7 = LUI.UIImage.new()
f13_local7.id = "bar_bg"
f13_local7:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
height = f13_local0,
width = f13_local1,
red = 1,
blue = 1,
green = 1,
material = f13_local4,
alpha = 0.7
} )
f13_local7:animateToState( "default", 0 )
local f13_local8 = LUI.UIText.new()
f13_local8.id = "supportDropText"
f13_local8:setText( Engine.Localize( "@MP_HORDE_NEXT_AIR_DROP" ) )
f13_local8:setTextStyle( CoD.TextStyle.Shadowed )
f13_local8:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 64,
left = 0,
width = 128,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Left,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 0
} )
f13_local8:registerAnimationState( "active", {
alpha = 1
} )
f13_local8:animateToState( "default", 0 )
f13_local8:registerEventHandler( "hud_on", MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
500
}
} ) )
local f13_local9 = LUI.UIText.new()
f13_local9.id = "weaponLevelTextBG"
f13_local9:setText( "888" )
f13_local9:setTextStyle( CoD.TextStyle.Shadowed )
f13_local9:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 3,
left = 3,
width = 75,
height = f13_local2.Height,
font = f13_local2.Font,
alignment = LUI.Alignment.Right,
red = 0,
green = 0,
blue = 0,
alpha = 0
} )
f13_local9:registerAnimationState( "active", {
alpha = 0.1
} )
f13_local9:animateToState( "default", 0 )
f13_local9:registerEventHandler( "hud_on", MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
500
}
} ) )
local f13_local10 = LUI.UIText.new()
f13_local10.id = "weaponLevelText"
f13_local10:setText( "1" )
f13_local10:setTextStyle( CoD.TextStyle.Shadowed )
f13_local10:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 3,
left = 3,
width = 75,
height = f13_local2.Height,
font = f13_local2.Font,
alignment = LUI.Alignment.Right,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 0
} )
f13_local10:registerAnimationState( "active", {
alpha = 1
} )
f13_local10:animateToState( "default", 0 )
f13_local10:registerEventHandler( "hud_on", MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
500
}
} ) )
f13_local10:registerOmnvarHandler( "ui_horde_weapon_level", f0_local12 )
local f13_local11 = LUI.UIImage.new()
f13_local11.id = "weaponImage"
f13_local11:registerAnimationState( "pistol", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = -10,
left = 175,
height = 64,
width = -128,
alpha = 1
} )
f13_local11:registerAnimationState( "magnum", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = -10,
left = 195,
height = 64,
width = -128,
alpha = 1
} )
f13_local11:registerAnimationState( "sniper_shot", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = -16,
left = 210,
height = 64,
width = -128,
alpha = 1
} )
f13_local11:registerAnimationState( "lmg", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = -15,
left = 210,
height = 64,
width = -128,
alpha = 1
} )
f13_local11:registerAnimationState( "other", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = -12,
left = 210,
height = 64,
width = -128,
alpha = 1
} )
f13_local11:animateToState( "pistol", 0 )
f13_local6:addElement( f13_local7 )
f13_local6:addElement( f0_local11( "weaponLevel", 105, 24, 26, 168, 25, "hud_safeguard_weapon_bar", "hud_safeguard_weapon_end", "ui_horde_weapon_progress" ) )
f13_local6:addElement( f0_local11( "supportDrop", 9, 50, 16, 268, 12, "hud_safeguard_support_bar", "hud_safeguard_support_end", "ui_horde_support_drop_progress" ) )
for f13_local12 = 0, f0_local2 - 1, 1 do
f13_local6:addElement( f0_local7( f13_local12 ) )
end
f13_local6:addElement( f13_local8 )
f13_local6:addElement( f13_local9 )
f13_local6:addElement( f13_local10 )
f13_local6:addElement( f13_local11 )
f13_local6:addElement( LUI.MenuBuilder.buildItems( {
type = "talkerHudDef"
}, f13_local6.properties, f13_local6 ) )
self:addElement( f13_local6 )
self:addElement( f0_local5() )
return self
end )
LUI.MenuBuilder.registerType( "hordeRoundHudDef", f0_local14 )
LockTable( _M )

View File

@ -0,0 +1,437 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ( f1_arg0, f1_arg1 )
local f1_local0 = 32
local f1_local1 = 32
local f1_local2, f1_local3, f1_local4, f1_local5, f1_local6, f1_local7 = nil
if f1_arg1.value > 0 then
f1_local3 = Engine.TableLookup( HordeIconsTable.File, HordeIconsTable.Cols.Index, f1_arg1.value, HordeIconsTable.Cols.Image )
f1_local4 = Engine.TableLookup( HordeIconsTable.File, HordeIconsTable.Cols.Index, f1_arg1.value, HordeIconsTable.Cols.Name )
f1_local5 = f1_arg0:getChildById( "horde_hud_perk_container_" .. f1_local4 )
if f1_local5 then
f1_local6 = f1_local5:getChildById( "horde_hud_perk_image_bg" .. f1_local4 )
f1_local7 = f1_local5:getChildById( "horde_hud_perk_image_" .. f1_local4 )
end
f1_local2 = RegisterMaterial( f1_local3 )
elseif f1_arg1.value < 0 then
f1_local4 = Engine.TableLookup( HordeIconsTable.File, HordeIconsTable.Cols.Index, f1_arg1.value * -1, HordeIconsTable.Cols.Name )
f1_local5 = f1_arg0:getChildById( "horde_hud_perk_container_" .. f1_local4 )
if f1_local5 then
f1_local6 = f1_local5:getChildById( "horde_hud_perk_image_bg" .. f1_local4 )
f1_local7 = f1_local5:getChildById( "horde_hud_perk_image_" .. f1_local4 )
end
end
if f1_arg1.value > 0 and not f1_local7 then
local self = LUI.UIElement.new()
self.id = "horde_hud_perk_container_" .. f1_local4
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = 0,
left = 0,
height = f1_local0,
width = f1_local1,
material = f1_local2,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
self:animateToState( "default", 0 )
local f1_local9 = LUI.UIImage.new()
f1_local9.id = "horde_hud_perk_image_bg" .. f1_local4
f1_local9:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f1_local0 / 2.1,
left = -f1_local1 / 2.1,
bottom = f1_local0 / 1.9,
right = f1_local1 / 1.9,
material = f1_local2,
red = Colors.black.r,
green = Colors.black.g,
blue = Colors.black.b,
alpha = 0
} )
f1_local9:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f1_local0 / 1.4,
left = -f1_local1 / 1.4,
bottom = f1_local0 / 1.2,
right = f1_local1 / 1.2,
material = f1_local2,
red = Colors.black.r,
green = Colors.black.g,
blue = Colors.black.b,
alpha = 0.1
} )
f1_local9:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f1_local0 / 2.1,
left = -f1_local1 / 2.1,
bottom = f1_local0 / 1.9,
right = f1_local1 / 1.9,
material = f1_local2,
red = Colors.black.r,
green = Colors.black.g,
blue = Colors.black.b,
alpha = 0.5
} )
f1_local9:registerAnimationState( "flash", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f1_local0 / 1.6,
left = -f1_local1 / 1.6,
bottom = f1_local0 / 1.4,
right = f1_local1 / 1.4,
red = Colors.black.r,
green = Colors.black.g,
blue = Colors.black.b,
alpha = 0.3
} )
f1_local9:animateToState( "default", 0 )
local f1_local10 = LUI.UIImage.new()
f1_local10.id = "horde_hud_perk_image_" .. f1_local4
f1_local10:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f1_local0 / 2,
left = -f1_local1 / 2,
bottom = f1_local0 / 2,
right = f1_local1 / 2,
material = f1_local2,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 0
} )
f1_local10:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f1_local0 / 1.3,
left = -f1_local1 / 1.3,
bottom = f1_local0 / 1.3,
right = f1_local1 / 1.3,
material = f1_local2,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 0.5
} )
f1_local10:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f1_local0 / 2,
left = -f1_local1 / 2,
bottom = f1_local0 / 2,
right = f1_local1 / 2,
material = f1_local2,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f1_local10:registerAnimationState( "flash", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f1_local0 / 1.5,
left = -f1_local1 / 1.5,
bottom = f1_local0 / 1.5,
right = f1_local1 / 1.5,
red = Colors.orange.r,
green = Colors.orange.g,
blue = Colors.orange.b,
alpha = 0.8
} )
f1_local10:animateToState( "default", 0 )
self:addElement( f1_local9 )
self:addElement( f1_local10 )
f1_arg0:addElement( self )
local f1_local11 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
100
},
{
"active",
50
}
} )
f1_local11( f1_local9 )
f1_local11 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
100
},
{
"active",
50
}
} )
f1_local11( f1_local10 )
elseif f1_local7 then
if f1_arg1.value > 0 and not f1_local7.isFlashing then
local self = MBh.AnimateLoop( {
{
"flash",
300
},
{
"active",
700
}
} )
self( f1_local6 )
self = MBh.AnimateLoop( {
{
"flash",
300
},
{
"active",
700
}
} )
self( f1_local7 )
f1_local7.isFlashing = true
elseif f1_arg1.value > 0 and f1_local7.isFlashing == true then
local self = MBh.AnimateToState( "active" )
self( f1_local6 )
self = MBh.AnimateToState( "active" )
self( f1_local7 )
f1_local7.isFlashing = false
elseif f1_arg1.value < 0 then
f1_local5:close()
end
else
f1_local5 = f1_arg0:getFirstChild()
while f1_local5 ~= nil do
local self = f1_local5:getNextSibling()
f1_local5:close()
f1_local5 = self
end
end
end
f0_local1 = function ( f2_arg0, f2_arg1 )
local f2_local0 = f2_arg0:getChildById( "horde_hud_exp_ammo_image" )
if f2_arg1.value > 0 and not f2_local0.shown then
local f2_local1 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
100
},
{
"active",
50
}
} )
f2_local1( f2_arg0 )
f2_local0.shown = true
elseif f2_arg1.value > 0 and not f2_local0.flashing then
local f2_local1 = MBh.AnimateLoop( {
{
"flash",
300
},
{
"default",
700
}
} )
f2_local1( f2_local0 )
f2_local0.flashing = true
else
f2_local0.shown = false
f2_local0.flashing = false
local f2_local1 = MBh.AnimateToState( "default" )
f2_local1( f2_local0 )
f2_arg0:animateToState( "default", 0 )
end
end
f0_local2 = function ()
local self = LUI.UIHorizontalList.new()
self.id = "horde_hud_perks"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
spacing = 0
} )
self:animateToState( "default", 0 )
self:registerOmnvarHandler( "ui_horde_update_perk", f0_local0 )
return self
end
local f0_local3 = function ()
local f4_local0 = 250
local f4_local1 = 32
local f4_local2 = 416
local f4_local3 = 12
local f4_local4 = 205
local self = LUI.UIElement.new()
self.id = "horde_hud_perks_container"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -f4_local3,
left = f4_local3 + f4_local4,
height = f4_local1,
width = 0
} )
self:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -f4_local3,
left = f4_local3 + f4_local4,
height = f4_local1,
width = f4_local2,
alpha = 1
} )
self:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -f4_local3,
left = f4_local3 + f4_local4,
height = f4_local1,
width = f4_local2 + 40,
alpha = 1
} )
self:animateToState( "default", 0 )
self:registerEventHandler( "hud_on", MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
f4_local0 / 2
},
{
"active",
f4_local0 / 2
}
} ) )
self:addElement( f0_local2() )
return self
end
local f0_local4 = function ()
local f5_local0 = 40
local f5_local1 = 40
local f5_local2 = 250
local f5_local3 = Engine.TableLookup( HordeIconsTable.File, HordeIconsTable.Cols.Ref, "specialty_explosivebullets", HordeIconsTable.Cols.Image )
local self = LUI.UIElement.new()
self.id = "horde_hud_exp_ammo_container"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -65,
right = -175,
height = f5_local0,
width = f5_local1,
alpha = 0
} )
self:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -65,
right = -175,
height = f5_local0,
width = f5_local1,
alpha = 1
} )
self:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -25,
right = -135,
height = f5_local0 * 3,
width = f5_local1 * 3,
alpha = 0.5
} )
self:animateToState( "default", 0 )
self:registerOmnvarHandler( "ui_horde_update_explosive", f0_local1 )
local f5_local5 = LUI.UIImage.new()
f5_local5.id = "horde_hud_exp_ammo_image"
f5_local5:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = RegisterMaterial( f5_local3 ),
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f5_local5:registerAnimationState( "flash", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local0 / 1.5,
left = -f5_local0 / 1.5,
bottom = f5_local0 / 1.5,
right = f5_local0 / 1.5,
red = Colors.orange.r,
green = Colors.orange.g,
blue = Colors.orange.b,
alpha = 0.8
} )
f5_local5:animateToState( "default", 0 )
self:addElement( f5_local5 )
return self
end
LUI.MenuBuilder.registerType( "hordePerksHudDef", f0_local3 )
LUI.MenuBuilder.registerType( "hordeExpAmmoHudDef", f0_local4 )
LockTable( _M )

View File

@ -0,0 +1,84 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ( f1_arg0, f1_arg1 )
LUI.FlowManager.RequestLeaveMenu( f1_arg0 )
end
f0_local1 = function ( f2_arg0, f2_arg1 )
f2_arg0:setText( Game.GetMigrationStatus() )
end
f0_local2 = function ()
local self = LUI.UIElement.new()
self.id = "percentage_display_id"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
top = 100,
left = 100,
height = 65,
width = 512
} )
self:animateToState( "default", 0 )
local f3_local1 = LUI.UIText.new()
f3_local1.id = "hm_description_id"
f3_local1:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
top = 0,
left = 0,
height = CoD.TextSettings.BoldFont.Height,
width = 512,
font = CoD.TextSettings.BoldFont.Font,
alignment = LUI.Alignment.left
} )
f3_local1:animateToState( "default", 0 )
f3_local1:setText( "" )
f3_local1:setTextStyle( CoD.TextStyle.Shadowed )
f3_local1:registerEventHandler( "host_migration_update", f0_local1 )
LUI.MenuBuilder.BuildAddChild( f3_local1, {
type = "UITimer",
id = "hm_description_refresh_id",
properties = {
event = "host_migration_update",
interval = 250
}
} )
self:addElement( f3_local1 )
return self
end
LUI.MenuBuilder.registerType( "host_migration_main", function ()
local f4_local0 = Engine.Localize( "@LUA_MENU_HOST_MIGRATION_CAPS" )
local self = LUI.UIElement.new()
self.id = "host_migration_id"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
alpha = 1
} )
self:animateToState( "default", 0 )
self:registerEventHandler( "hide_host_migration", f0_local0 )
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIWorldBlur",
id = "hmWorldBlurOverlay",
states = {
default = {
worldBlur = 5
}
}
} )
self:addElement( LUI.mp_hud.OptionsMenu.mp_pause_menu_background_def() )
self:addElement( LUI.mp_hud.OptionsMenu.mp_pause_menu_title_def( f4_local0 ) )
self:addElement( f0_local2() )
return self
end )
LockTable( _M )

1434
lui/mp_hud/hud.dec.lua Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,68 @@
SplashTable = {
File = "mp/splashTable.csv",
Cols = {
Ref = 0,
Name = 1,
Desc = 2,
Image = 3,
Duration = 4,
Red = 5,
Green = 6,
Blue = 7,
Alpha = 8,
Sound = 9,
DontKnow = 10,
SplashType = 11
}
}
IntelChallengesTable = {
File = "mp/intelChallenges.csv",
Cols = {
Ref = 0,
Name = 1,
Reward = 2,
Target = 3,
Available = 4
}
}
KillCamAbilitiesBitMaskTable = {
File = "mp/killCamAbilitiesBitMaskTable.csv",
Cols = {
Index = 0,
Ref = 1,
BitMask = 2
}
}
XPEventTable = {
File = "mp/xp_event_table.csv",
Cols = {
Ref = 0,
Name = 1,
Sound = 2,
XPValueDM = 3,
XPValueWar = 4,
XPValueSD = 5,
XPValueDom = 6,
XPValueConf = 7,
XPValueSR = 8,
XPValueBnty = 9,
XPValueGrind = 10,
XPValueBlitz = 11,
XPValueCranked = 12,
XPValueInfect = 13,
XPValueSOTF = 14,
XPValueHorde = 15,
XPValueMugger = 16,
XPValueAliens = 17
}
}
HordeIconsTable = {
File = "mp/hordeIcons.csv",
Cols = {
Index = 0,
Ref = 1,
Name = 2,
Image = 3,
Misc = 4
}
}

View File

@ -0,0 +1,271 @@
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_INVENTORY_KILLSTREAK", "+actionslot 4" )
f16_local0[#f16_local0 + 1] = ControlBindFactory( "@MENU_SECONDARY_INVENTORY", "+actionslot 2" )
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 = "UIStencil",
children = {
{
type = "UIVerticalList",
childrenFeeder = OptionsFeeder,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = -25,
top = 0,
bottom = 0
}
}
}
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right_wide,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
},
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 = "UIWorldBlur",
id = "world_blur_id",
states = {
default = {
worldBlur = 5
}
}
},
{
type = "UIImage",
id = "options_background",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0.5,
material = RegisterMaterial( "black" )
}
}
},
{
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 )

View File

@ -0,0 +1,732 @@
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 InGameDisabledFunc( f2_arg0, f2_arg1 )
return not Engine.CanVidRestart()
end
function PicmipDisabledFunc()
local f3_local0 = InGameDisabledFunc()
if not f3_local0 then
f3_local0 = Engine.GetDvarInt( "ui_r_picmip_manual" ) == 0
end
return f3_local0
end
f0_local0 = nil
function NVidiaButtonOver( f4_arg0, f4_arg1 )
f0_local0 = f4_arg0.id
f4_arg0:dispatchEventToRoot( {
name = "show_nvidia_subtitle",
immediate = true
} )
end
function NVidiaButtonUp( f5_arg0, f5_arg1 )
if f0_local0 == f5_arg0.id then
f0_local0 = nil
f5_arg0:dispatchEventToRoot( {
name = "hide_nvidia_subtitle",
immediate = true
} )
end
end
function OptionsWindowRefresh( f6_arg0, f6_arg1 )
if f6_arg1.source_input == "button_action" or f6_arg1.source_input == "key_bound" or f6_arg1.source_input == "button_right" or f6_arg1.source_input == "button_left" then
f6_arg0:processEvent( {
name = "menu_refresh"
} )
f6_arg0:processEvent( {
name = "refresh_content"
} )
end
end
function OptionsWindowTriggerRefresh( f7_arg0, f7_arg1 )
f7_arg0:dispatchEventToRoot( {
name = "options_window_refresh",
source_input = f7_arg1.name,
immediate = true
} )
end
function GetFOV( f8_arg0 )
return (Engine.GetDvarFloat( "ui_cg_fov" ) - f8_arg0.Min) / (f8_arg0.Max - f8_arg0.Min)
end
function SliderChange( f9_arg0, f9_arg1, f9_arg2, f9_arg3 )
Engine.SetDvarFloat( f9_arg3, math.min( f9_arg1, math.max( f9_arg0, Engine.GetDvarFloat( f9_arg3 ) + f9_arg2 ) ) )
end
function OptionFactory( f10_arg0, f10_arg1, f10_arg2, f10_arg3, f10_arg4, f10_arg5, f10_arg6, f10_arg7, f10_arg8, f10_arg9, f10_arg10, f10_arg11 )
local f10_local0 = nil
local f10_local1 = 1
local f10_local2 = Engine.GetDvarType( f10_arg0 )
local f10_local3 = nil
if f10_arg9 then
f10_local3 = {
variant = GenericButtonSettings.Variants.Slider,
button_text = Engine.Localize( f10_arg1 ),
button_display_func = function ( f11_arg0, f11_arg1 )
return f10_arg11( f10_arg10 )
end,
button_left_func = function ( f12_arg0, f12_arg1 )
SliderChange( f10_arg10.Min, f10_arg10.Max, -f10_arg10.Step, f10_arg0 )
end,
button_right_func = function ( f13_arg0, f13_arg1 )
SliderChange( f10_arg10.Min, f10_arg10.Max, f10_arg10.Step, f10_arg0 )
end
}
else
if f10_local2 == DvarTypeTable.DvarString or f10_local2 == DvarTypeTable.DvarEnum then
f10_local0 = Engine.GetDvarString( f10_arg0 )
elseif f10_local2 == DvarTypeTable.DvarInt then
f10_local0 = Engine.GetDvarInt( f10_arg0 )
elseif f10_local2 == DvarTypeTable.DvarBool then
f10_local0 = Engine.GetDvarBool( f10_arg0 )
end
for f10_local7, f10_local8 in pairs( f10_arg2 ) do
if f10_local8.value == f10_local0 then
f10_local1 = f10_local7
break
end
end
f10_local4 = function ( f14_arg0, f14_arg1 )
if f10_local2 == DvarTypeTable.DvarString or f10_local2 == DvarTypeTable.DvarEnum then
Engine.SetDvarString( f10_arg0, f10_arg2[f10_local1].value )
elseif f10_local2 == DvarTypeTable.DvarInt then
Engine.SetDvarInt( f10_arg0, f10_arg2[f10_local1].value )
elseif f10_local2 == DvarTypeTable.DvarBool then
Engine.SetDvarBool( f10_arg0, f10_arg2[f10_local1].value )
end
OptionsWindowTriggerRefresh( f14_arg0, f14_arg1 )
end
f10_local3 = {
variant = GenericButtonSettings.Variants.Select,
button_text = Engine.Localize( f10_arg1 ),
button_display_func = function ( f15_arg0, f15_arg1 )
return f10_arg6 and f10_arg2[f10_local1].text or Engine.Localize( f10_arg2[f10_local1].text )
end,
button_left_func = function ( f16_arg0, f16_arg1 )
f10_local1 = 1 + (#f10_arg2 + f10_local1 - 1 - 1) % #f10_arg2
f10_local4( f16_arg0, f16_arg1 )
end,
button_right_func = function ( f17_arg0, f17_arg1 )
f10_local1 = 1 + (f10_local1 - 1 + 1) % #f10_arg2
f10_local4( f17_arg0, f17_arg1 )
end,
button_over_func = f10_arg7,
button_up_func = f10_arg8
}
end
return {
type = "UIGenericButton",
id = "option_" .. f10_arg0,
disabledFunc = f10_arg4 or function ()
return false
end
,
states = {
default = {
alpha = 1
},
invisible = {
alpha = 0
}
},
properties = f10_local3,
handlers = {
check_show_apply = function ( f19_arg0, f19_arg1 )
if f10_arg3 then
if f10_arg9 then
local f19_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f19_arg0 )
if Engine.GetDvarFloat( f10_arg3 ) ~= Engine.GetDvarFloat( f10_arg0 ) then
f19_local0.showApplySettings = true
if f10_arg5 then
f19_local0.vidRestart = true
end
end
else
local f19_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f19_arg0 )
local f19_local1 = nil
local f19_local2 = Engine.GetDvarType( f10_arg3 )
if f19_local2 == DvarTypeTable.DvarString or f19_local2 == DvarTypeTable.DvarEnum then
f19_local1 = Engine.GetDvarString( f10_arg3 )
elseif f19_local2 == DvarTypeTable.DvarInt then
f19_local1 = tostring( Engine.GetDvarInt( f10_arg3 ) )
elseif f19_local2 == DvarTypeTable.DvarBool then
if Engine.GetDvarBool( f10_arg3 ) then
local f19_local3 = "1"
end
f19_local1 = f19_local3 or "0"
elseif f19_local2 == DvarTypeTable.DvarFloat then
f19_local1 = tostring( Engine.GetDvarFloat( f10_arg3 ) )
end
if f19_local1 ~= f10_arg2[f10_local1].value then
f19_local0.showApplySettings = true
if f10_arg5 then
f19_local0.vidRestart = true
end
end
end
end
end
}
}
end
function OptionsFeeder( f20_arg0 )
local f20_local0 = {
[#f20_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", InGameDisabledFunc, true )
}
local f20_local1 = {}
for f20_local5, f20_local6 in pairs( Engine.GetDvarEnumList( "r_displayRefresh" ) ) do
f20_local1[#f20_local1 + 1] = {
text = f20_local6,
value = f20_local6
}
end
f20_local0[#f20_local0 + 1] = OptionFactory( "ui_r_displayRefresh", "@MENU_SCREEN_REFRESH_RATE", f20_local1, "r_displayRefresh", InGameDisabledFunc, true )
f20_local0[#f20_local0 + 1] = OptionFactory( "ui_r_vsync", "@MENU_SYNC_EVERY_FRAME", {
{
text = "@LUA_MENU_YES",
value = "1"
},
{
text = "@LUA_MENU_NO",
value = "0"
}
}, "r_vsync", InGameDisabledFunc, true )
f20_local0[#f20_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", InGameDisabledFunc, true )
if Engine.IsMultiplayer() then
f20_local2 = {}
f20_local3 = SliderBounds.FOV.Max - SliderBounds.FOV.Min
for f20_local4 = 0, f20_local3, 1 do
local f20_local7 = tostring( SliderBounds.FOV.Min + f20_local4 )
f20_local2[f20_local4 + 1] = {
text = Engine.MarkLocalized( f20_local7 ),
value = f20_local7
}
end
f20_local0[#f20_local0 + 1] = OptionFactory( "ui_cg_fov", "@MENU_FOV", f20_local2, "cg_fov", nil, false, true, function ( f21_arg0, f21_arg1 )
f21_arg0:dispatchEventToRoot( {
name = "show_fov_subtitle",
immediate = true
} )
end, function ( f22_arg0, f22_arg1 )
f22_arg0:dispatchEventToRoot( {
name = "hide_fov_subtitle",
immediate = true
} )
end, false, false, false )
end
f20_local0[#f20_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
f20_local0[#f20_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", InGameDisabledFunc, true )
else
f20_local0[#f20_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", InGameDisabledFunc, true )
end
f20_local0[#f20_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 )
f20_local0[#f20_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", InGameDisabledFunc, true )
f20_local0[#f20_local0 + 1] = OptionFactory( "ui_r_mbEnableA", "@MENU_MOTION_BLUR", {
{
text = "@LUA_MENU_YES",
value = "1"
},
{
text = "@LUA_MENU_NO",
value = "0"
}
}, "r_mbEnableA", InGameDisabledFunc, true )
f20_local0[#f20_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
f20_local0[#f20_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", InGameDisabledFunc, true )
else
f20_local0[#f20_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", InGameDisabledFunc, true )
end
f20_local0[#f20_local0 + 1] = OptionFactory( "ui_sm_enable", "@MENU_SHADOWS", {
{
text = "@LUA_MENU_YES",
value = "1"
},
{
text = "@LUA_MENU_NO",
value = "0"
}
}, "sm_enable", InGameDisabledFunc, true )
f20_local0[#f20_local0 + 1] = OptionFactory( "ui_r_picmip_manual", "@MENU_TEXTURE_QUALITY", {
{
text = "@MENU_AUTOMATIC",
value = "0"
},
{
text = "@MENU_MANUAL",
value = "1"
}
}, "r_picmip_manual", InGameDisabledFunc, true )
f20_local0[#f20_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 )
f20_local0[#f20_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 )
f20_local0[#f20_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 )
f20_local0[#f20_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
f20_local0[#f20_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", InGameDisabledFunc, true, nil, NVidiaButtonOver, NVidiaButtonUp )
end
if Engine.APEXTurbulenceAvailable() then
f20_local0[#f20_local0 + 1] = OptionFactory( "ui_r_apex_turbulence", "@MENU_APEX_TURBULENCE", {
{
text = "@MENU_ON",
value = "1"
},
{
text = "@MENU_OFF",
value = "0"
}
}, "r_apex_turbulence", InGameDisabledFunc, true, nil, NVidiaButtonOver, NVidiaButtonUp )
end
return f20_local0
end
function OptionsMainCreate( f23_arg0, f23_arg1 )
Engine.ExecNow( "profile_menuDvarsSetup" )
f23_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
function OptionsMainClose( f24_arg0, f24_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 = "UIStencil",
children = {
{
type = "UIVerticalList",
childrenFeeder = OptionsFeeder,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = -25,
top = 0,
bottom = 0
}
}
}
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right_wide,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
}
}
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 = "UIWorldBlur",
id = "world_blur_id",
states = {
default = {
worldBlur = 5
}
}
},
{
type = "UIImage",
id = "options_background",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0.5,
material = RegisterMaterial( "black" )
}
}
},
{
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,
bottom = OptionsListDims.menu_bottom + 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 ( f27_arg0, f27_arg1 )
f27_arg0:setText( Engine.Localize( "@MENU_NVIDIA_OPTION_SUB" ) )
f27_arg0:animateToState( "show_me", 0 )
end
,
hide_nvidia_subtitle = function ( f28_arg0, f28_arg1 )
f28_arg0:animateToState( "hide_me", 0 )
end
,
show_fov_subtitle = function ( f29_arg0, f29_arg1 )
f29_arg0:setText( Engine.Localize( "@LUA_MENU_MP_FOV_OPTION_SUB" ) )
f29_arg0:animateToState( "show_me", 0 )
end
,
hide_fov_subtitle = function ( f30_arg0, f30_arg1 )
f30_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 )

View File

@ -0,0 +1,186 @@
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 ControlBindFactory( f5_arg0, f5_arg1 )
return {
type = "UIGenericButton",
id = "bind_" .. f5_arg1,
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( f5_arg0 ),
button_display_func = function ( f6_arg0, f6_arg1 )
return GetDisplay( f5_arg1 )
end
,
button_action_func = function ( f7_arg0, f7_arg1 )
Engine.BindKey( f5_arg1 )
OptionsWindowTriggerRefresh( f7_arg0, f7_arg1 )
end
},
handlers = {
element_refresh = MBh.EmitEvent( "content_refresh" ),
key_bound = OptionsWindowTriggerRefresh
}
}
end
function OptionsFeeder( f8_arg0 )
local f8_local0 = {}
Engine.ExecNow( "profile_menuDvarsSetup" )
f8_local0[#f8_local0 + 1] = ControlBindFactory( "@MENU_TEXT_CHAT", "chatmodepublic" )
f8_local0[#f8_local0 + 1] = ControlBindFactory( "@MENU_TEXT_TEAM_CHAT", "chatmodeteam" )
f8_local0[#f8_local0 + 1] = ControlBindFactory( "@MENU_VOICE_CHAT_BUTTON", "+talk" )
return f8_local0
end
function OptionsMainCreate( f9_arg0, f9_arg1 )
f9_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
function chat_controls_vlist()
return {
type = "UIStencil",
children = {
{
type = "UIVerticalList",
childrenFeeder = OptionsFeeder,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = -25,
top = 0,
bottom = 0
}
}
}
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right_wide,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
},
handlers = {
options_window_refresh = OptionsWindowRefresh
}
}
end
function chat_controls()
return {
type = "UIElement",
id = "chat_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 ( f12_arg0, f12_arg1 )
Engine.Exec( "updategamerprofile" )
end
},
children = {
{
type = "UIWorldBlur",
id = "world_blur_id",
states = {
default = {
worldBlur = 5
}
}
},
{
type = "UIImage",
id = "options_background",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0.5,
material = RegisterMaterial( "black" )
}
}
},
{
type = "generic_menu_title",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_CHAT" )
}
},
{
type = "chat_controls_vlist",
id = "chat_controls_vlist_id"
},
{
type = "button_helper_text_main",
id = "button_helper_text_id"
},
{
type = "UIBindButton",
id = "back_button",
handlers = {
button_secondary = MBh.LeaveMenu()
}
}
}
}
end
LUI.MenuBuilder.registerDef( "chat_controls_vlist", chat_controls_vlist )
LUI.MenuBuilder.registerDef( "chat_controls", chat_controls )
LockTable( _M )

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,432 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function GamepadDisabledFunc( f1_arg0, f1_arg1 )
return not Engine.GetProfileData( "gpadEnabled" )
end
function OptionsWindowRefresh( f2_arg0, f2_arg1 )
if f2_arg1.source_input == "button_action" or f2_arg1.source_input == "key_bound" or f2_arg1.source_input == "button_right" or f2_arg1.source_input == "button_left" then
f2_arg0:processEvent( {
name = "menu_refresh"
} )
f2_arg0:processEvent( {
name = "refresh_content"
} )
end
end
function SinglePlayerDisableFunction( f3_arg0, f3_arg1 )
return not Engine.IsMultiplayer()
end
function OptionsWindowTriggerRefresh( f4_arg0, f4_arg1 )
f4_arg0:dispatchEventToRoot( {
name = "options_window_refresh",
source_input = f4_arg1.name,
immediate = true
} )
end
function OptionFactoryProfileData( f5_arg0, f5_arg1, f5_arg2, f5_arg3, f5_arg4, f5_arg5, f5_arg6 )
local f5_local0 = Engine.GetProfileData( f5_arg0 )
local f5_local1 = 1
for f5_local5, f5_local6 in pairs( f5_arg3 ) do
if f5_local6.value == f5_local0 then
f5_local1 = f5_local5
break
end
end
f5_local2 = function ( f6_arg0, f6_arg1 )
Engine.ExecNow( f5_arg1 )
Engine.ExecNow( "profile_menuDvarsFinish" )
OptionsWindowTriggerRefresh( f6_arg0, f6_arg1 )
if f5_arg6 and type( f5_arg6 ) == "function" then
f5_arg6( f6_arg0 )
end
end
f5_local3 = {
type = "UIGenericButton",
id = "option_" .. f5_arg0,
disabledFunc = f5_arg4 or function ()
return false
end
}
f5_local4 = {
variant = GenericButtonSettings.Variants.Select
}
if f5_arg5 then
local f5_local7 = f5_arg2
end
f5_local4.button_text = f5_local7 or Engine.Localize( f5_arg2 )
f5_local4.button_display_func = function ( f8_arg0, f8_arg1 )
return Engine.Localize( f5_arg3[f5_local1].text )
end
f5_local4.button_left_func = function ( f9_arg0, f9_arg1 )
f5_local1 = 1 + (#f5_arg3 + f5_local1 - 1 - 1) % #f5_arg3
f5_local2( f9_arg0, f9_arg1 )
end
f5_local4.button_right_func = function ( f10_arg0, f10_arg1 )
f5_local1 = 1 + (f5_local1 - 1 + 1) % #f5_arg3
f5_local2( f10_arg0, f10_arg1 )
end
f5_local3.properties = f5_local4
f5_local3.handlers = {
element_refresh = MBh.EmitEvent( "content_refresh" )
}
return f5_local3
end
function SliderOptionFactory( f11_arg0, f11_arg1, f11_arg2, f11_arg3, f11_arg4, f11_arg5 )
local f11_local0 = function ( f12_arg0, f12_arg1, f12_arg2, f12_arg3, f12_arg4 )
Engine.SetDvarFloat( f11_arg0, math.min( f12_arg1, math.max( f12_arg0, Engine.GetDvarFloat( f11_arg0 ) + f12_arg2 ) ) )
Engine.ExecNow( "profile_menuDvarsFinish" )
OptionsWindowTriggerRefresh( f12_arg3, f12_arg4 )
end
return {
type = "UIGenericButton",
id = "options_" .. f11_arg0,
disabledFunc = f11_arg5 or function ()
return false
end
,
properties = {
button_text = Engine.Localize( f11_arg1 ),
variant = GenericButtonSettings.Variants.Slider,
button_display_func = function ( f14_arg0, f14_arg1 )
return (Engine.GetDvarFloat( f11_arg0 ) - f11_arg2) / (f11_arg3 - f11_arg2)
end
,
button_left_func = function ( f15_arg0, f15_arg1 )
f11_local0( f11_arg2, f11_arg3, -f11_arg4, f15_arg0, f15_arg1 )
end
,
button_right_func = function ( f16_arg0, f16_arg1 )
f11_local0( f11_arg2, f11_arg3, f11_arg4, f16_arg0, f16_arg1 )
end
},
handlers = {
element_refresh = MBh.EmitEvent( "content_refresh" )
}
}
end
function GetButtonsLayoutName()
local f17_local0 = Engine.GetProfileData( "gpadButtonsConfig" )
if f17_local0 == "buttons_default" then
return Engine.Localize( "@MENU_DEFAULT" )
elseif f17_local0 == "buttons_tactical" then
return Engine.Localize( "@MENU_TACTICAL" )
elseif f17_local0 == "buttons_lefty" then
return Engine.Localize( "@MENU_LEFTY" )
elseif f17_local0 == "buttons_nomad" then
return Engine.Localize( "@MENU_NOMAD" )
elseif f17_local0 == "buttons_nomad_tactical" then
return Engine.Localize( "@MENU_NOMAD_TACTICAL" )
elseif f17_local0 == "buttons_default_alt" then
return Engine.Localize( "@MENU_DEFAULT_ALT" )
elseif f17_local0 == "buttons_tactical_alt" then
return Engine.Localize( "@MENU_TACTICAL_ALT" )
elseif f17_local0 == "buttons_lefty_alt" then
return Engine.Localize( "@MENU_LEFTY_ALT" )
elseif f17_local0 == "buttons_nomad_alt" then
return Engine.Localize( "@MENU_NOMAD_ALT" )
else
return Engine.Localize( "@MENU_NOMAD_TACTICAL_ALT" )
end
end
function ButtonsLayoutAction( f18_arg0, f18_arg1 )
LUI.FlowManager.RequestAddMenu( f18_arg0, "buttons", true, f18_arg1.controller, false )
end
function GetSticksLayoutName()
local f19_local0 = Engine.GetProfileData( "gpadSticksConfig" )
if f19_local0 == "thumbstick_default" then
return Engine.Localize( "@MENU_DEFAULT" )
elseif f19_local0 == "thumbstick_southpaw" then
return Engine.Localize( "@MENU_SOUTHPAW" )
elseif f19_local0 == "thumbstick_legacy" then
return Engine.Localize( "@MENU_LEGACY" )
elseif f19_local0 == "thumbstick_southpaw_ns" then
return Engine.Localize( "@MENU_SOUTHPAW_NS" )
elseif f19_local0 == "thumbstick_legacysouthpaw_ns" then
return Engine.Localize( "@MENU_LEGACY_SOUTHPAW_NS" )
else
return Engine.Localize( "@MENU_LEGACY_SOUTHPAW" )
end
end
function SticksLayoutAction( f20_arg0, f20_arg1 )
LUI.FlowManager.RequestAddMenu( f20_arg0, "thumbstick", true, f20_arg1.controller, false )
end
function GetSensitivityText()
local f21_local0 = Engine.GetDvarFloat( "profileMenuOption_sensitivity" )
if f21_local0 == 1 then
return Engine.Localize( "@MENU_LOW" ) .. " " .. f21_local0
elseif f21_local0 == 3 then
return Engine.Localize( "@MENU_MEDIUM" ) .. " " .. f21_local0
elseif f21_local0 == 7 then
return Engine.Localize( "@MENU_HIGH" ) .. " " .. f21_local0
elseif f21_local0 == 13 then
return Engine.Localize( "@MENU_VERY_HIGH" ) .. " " .. f21_local0
elseif f21_local0 == 20 then
return Engine.Localize( "@MENU_INSANE" ) .. " " .. f21_local0
else
return f21_local0 .. ""
end
end
function SensitivityChange( f22_arg0, f22_arg1 )
Engine.SetDvarFloat( "profileMenuOption_sensitivity", math.min( 20, math.max( 1, Engine.GetDvarFloat( "profileMenuOption_sensitivity" ) + f22_arg1 ) ) )
Engine.MenuDvarsFinish( f22_arg0 )
end
function OnToggleGPadEnabled( f23_arg0 )
LUI.FlowManager.tryAddMouseCursor( Engine.GetLuiRoot() )
Engine.Exec( "updategamerprofile" )
f23_arg0:dispatchEventToRoot( {
name = "refresh_button_helper",
dispatchChildren = true
} )
end
function OptionsFeeder( f24_arg0 )
local f24_local0 = {}
Engine.ExecNow( "profile_menuDvarsSetup" )
f24_local0[#f24_local0 + 1] = OptionFactoryProfileData( "gpadEnabled", "profile_toggleEnableGamepad", "LUA_MENU_GAMEPAD", {
{
text = "@LUA_MENU_DISABLED",
value = false
},
{
text = "@LUA_MENU_ENABLED",
value = true
}
}, nil, nil, OnToggleGPadEnabled )
f24_local0[#f24_local0 + 1] = {
type = "UIGenericButton",
id = "stick_layout_button_id",
disabledFunc = GamepadDisabledFunc,
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( "MENU_THUMBSTICK_LAYOUT" ),
button_display_func = GetSticksLayoutName,
button_action_func = SticksLayoutAction
}
}
f24_local0[#f24_local0 + 1] = {
type = "UIGenericButton",
id = "buttons_layout_button_id",
disabledFunc = GamepadDisabledFunc,
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( "MENU_BUTTON_LAYOUT" ),
button_display_func = GetButtonsLayoutName,
button_action_func = ButtonsLayoutAction
}
}
f24_local0[#f24_local0 + 1] = OptionFactoryProfileData( "invertedPitch", "profile_toggleInvertedPitch", "MENU_LOOK_INVERSION", {
{
text = "@LUA_MENU_DISABLED",
value = false
},
{
text = "@LUA_MENU_ENABLED",
value = true
}
}, GamepadDisabledFunc )
f24_local0[#f24_local0 + 1] = {
type = "UIGenericButton",
id = "sensitivity_button_id",
disabledFunc = GamepadDisabledFunc,
properties = {
variant = GenericButtonSettings.Variants.Select,
button_text = Engine.Localize( "MENU_LOOK_SENSITIVITY" ),
button_display_func = GetSensitivityText,
button_left_func = function ( f25_arg0, f25_arg1 )
return SensitivityChange( f24_arg0.exclusiveController, -1 )
end,
button_right_func = function ( f26_arg0, f26_arg1 )
return SensitivityChange( f24_arg0.exclusiveController, 1 )
end
}
}
f24_local0[#f24_local0 + 1] = OptionFactoryProfileData( "rumble", "profile_toggleRumble", "MENU_CONTROLLER_VIBRATION", {
{
text = "@LUA_MENU_DISABLED",
value = false
},
{
text = "@LUA_MENU_ENABLED",
value = true
}
}, GamepadDisabledFunc )
if SinglePlayerDisableFunction() then
f24_local0[#f24_local0 + 1] = OptionFactoryProfileData( "autoAim", "profile_toggleAutoAim", "MENU_AIM_ASSIST", {
{
text = "@LUA_MENU_DISABLED",
value = false
},
{
text = "@LUA_MENU_ENABLED",
value = true
}
}, GamepadDisabledFunc )
end
f24_local0[#f24_local0 + 1] = OptionFactoryProfileData( "leanEnabled", "profile_toggleLean", "LUA_MENU_LEAN_TOGGLE", {
{
text = "@LUA_MENU_ENABLED",
value = true
},
{
text = "@LUA_MENU_DISABLED",
value = false
}
}, GamepadDisabledFunc )
if Engine.IsDevelopmentBuild() then
f24_local0[#f24_local0 + 1] = OptionFactoryProfileData( "useDevKeyboard", "profile_toggleDevKeyboard", "DEBUG_KEYBOARD", {
{
text = "@LUA_MENU_DISABLED",
value = false
},
{
text = "@LUA_MENU_ENABLED",
value = true
}
}, GamepadDisabledFunc, true )
end
return f24_local0
end
function OptionsMainCreate( f27_arg0, f27_arg1 )
f27_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
function OptionsMainClose( f28_arg0, f28_arg1 )
Engine.Exec( "updategamerprofile" )
end
function gamepad_controls_vlist()
return {
type = "UIStencil",
children = {
{
type = "UIVerticalList",
childrenFeeder = OptionsFeeder,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = -25,
top = 0,
bottom = 0
}
}
}
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right_wide,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
},
handlers = {}
}
end
function gamepad_controls()
return {
type = "UIElement",
id = "gamepad_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 = OptionsMainClose,
options_window_refresh = OptionsWindowRefresh
},
children = {
{
type = "UIWorldBlur",
id = "world_blur_id",
states = {
default = {
worldBlur = 5
}
}
},
{
type = "UIImage",
id = "options_background",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0.5,
material = RegisterMaterial( "black" )
}
}
},
{
type = "generic_menu_title",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_GAMEPAD" )
}
},
{
type = "gamepad_controls_vlist",
id = "gamepad_controls_vlist_id"
},
{
type = "button_helper_text_main",
id = "button_helper_text_id"
},
{
type = "UIBindButton",
id = "back_button",
handlers = {
button_secondary = MBh.LeaveMenu()
}
}
}
}
end
LUI.MenuBuilder.registerDef( "gamepad_controls_vlist", gamepad_controls_vlist )
LUI.MenuBuilder.registerDef( "gamepad_controls", gamepad_controls )
LockTable( _M )

View File

@ -0,0 +1,327 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function SinglePlayerDisableFunction( f1_arg0, f1_arg1 )
return not Engine.IsMultiplayer()
end
function GetDisplay( f2_arg0 )
return Engine.GetBinding( f2_arg0 )
end
function bindKey( f3_arg0 )
Engine.BindKey( f3_arg0 )
end
function OptionsWindowRefresh( f4_arg0, f4_arg1 )
if f4_arg1.source_input == "button_action" or f4_arg1.source_input == "key_bound" then
f4_arg0:processEvent( {
name = "menu_refresh"
} )
f4_arg0:processEvent( {
name = "refresh_content"
} )
end
end
function OptionsWindowTriggerRefresh( f5_arg0, f5_arg1 )
f5_arg0:dispatchEventToRoot( {
name = "options_window_refresh",
source_input = f5_arg1.name,
immediate = true
} )
end
function ControlBindFactory( f6_arg0, f6_arg1 )
return {
type = "UIGenericButton",
id = "bind_" .. f6_arg1,
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( f6_arg0 ),
button_display_func = function ( f7_arg0, f7_arg1 )
return GetDisplay( f6_arg1 )
end
,
button_action_func = function ( f8_arg0, f8_arg1 )
Engine.BindKey( f6_arg1 )
OptionsWindowTriggerRefresh( f8_arg0, f8_arg1 )
end
},
handlers = {
element_refresh = MBh.EmitEvent( "content_refresh" ),
key_bound = OptionsWindowTriggerRefresh
}
}
end
function OptionFactory( f9_arg0, f9_arg1, f9_arg2 )
local f9_local0 = nil
local f9_local1 = 1
local f9_local2 = Engine.GetDvarType( f9_arg0 )
if f9_local2 == DvarTypeTable.DvarString 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_local6, f9_local7 in pairs( f9_arg2 ) do
if f9_local7.value == f9_local0 then
f9_local1 = f9_local6
break
end
end
f9_local3 = function ( f10_arg0, f10_arg1 )
if f9_arg0 == "ui_mousePitch" then
if Engine.GetDvarBool( f9_arg0 ) then
Engine.SetDvarFloat( "m_pitch", MousePitchTable.PitchFloat )
else
Engine.SetDvarFloat( "m_pitch", -MousePitchTable.PitchFloat )
end
end
if f9_local2 == DvarTypeTable.DvarString 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
end
return {
type = "UIGenericButton",
id = "option_" .. f9_arg0,
properties = {
variant = GenericButtonSettings.Variants.Select,
button_text = Engine.Localize( f9_arg1 ),
button_display_func = function ( f11_arg0, f11_arg1 )
return Engine.Localize( f9_arg2[f9_local1].text )
end
,
button_left_func = function ( f12_arg0, f12_arg1 )
f9_local1 = 1 + (#f9_arg2 + f9_local1 - 1 - 1) % #f9_arg2
f9_local3( f12_arg0, f12_arg1 )
end
,
button_right_func = function ( f13_arg0, f13_arg1 )
f9_local1 = 1 + (f9_local1 - 1 + 1) % #f9_arg2
f9_local3( f13_arg0, f13_arg1 )
end
}
}
end
function SliderOptionFactory( f14_arg0, f14_arg1, f14_arg2, f14_arg3, f14_arg4, f14_arg5, f14_arg6 )
local f14_local0 = function ( f15_arg0, f15_arg1, f15_arg2 )
Engine.SetDvarFloat( f14_arg0, math.min( f15_arg1, math.max( f15_arg0, Engine.GetDvarFloat( f14_arg0 ) + f15_arg2 ) ) )
Engine.ExecNow( "profile_menuDvarsFinish" )
end
return {
type = "UIGenericButton",
id = "options_" .. f14_arg0,
properties = {
button_text = Engine.Localize( f14_arg1 ),
variant = GenericButtonSettings.Variants.Slider,
button_display_func = function ( f16_arg0, f16_arg1 )
return (Engine.GetDvarFloat( f14_arg0 ) - f14_arg2) / (f14_arg3 - f14_arg2)
end
,
button_left_func = function ( f17_arg0, f17_arg1 )
f14_local0( f14_arg2, f14_arg3, -f14_arg4 )
end
,
button_right_func = function ( f18_arg0, f18_arg1 )
f14_local0( f14_arg2, f14_arg3, f14_arg4 )
end
,
button_over_func = MBh.EmitEventToRoot( "brightness_over" ),
button_up_func = MBh.EmitEventToRoot( "brightness_up" )
}
}
end
function OptionsFeeder( f19_arg0 )
local f19_local0 = {}
local f19_local1 = {}
Engine.ExecNow( "profile_menuDvarsSetup" )
f19_local0[#f19_local0 + 1] = SliderOptionFactory( "sensitivity", "@MENU_MOUSE_SENSITIVITY", SliderBounds.MouseSensitivity.Min, SliderBounds.MouseSensitivity.Max, SliderBounds.MouseSensitivity.Step )
if SinglePlayerDisableFunction() then
f19_local1 = {
{
text = "@LUA_MENU_YES",
value = true
},
{
text = "@LUA_MENU_NO",
value = false
}
}
else
f19_local1 = {
{
text = "@LUA_MENU_YES",
value = "1"
},
{
text = "@LUA_MENU_NO",
value = "0"
}
}
end
f19_local0[#f19_local0 + 1] = OptionFactory( "ui_mousePitch", "@MENU_INVERT_MOUSE", f19_local1 )
f19_local0[#f19_local0 + 1] = OptionFactory( "m_filter", "@MENU_SMOOTH_MOUSE", {
{
text = "@LUA_MENU_YES",
value = true
},
{
text = "@LUA_MENU_NO",
value = false
}
} )
f19_local0[#f19_local0 + 1] = OptionFactory( "cl_freelook", "@MENU_FREE_LOOK", {
{
text = "@LUA_MENU_YES",
value = true
},
{
text = "@LUA_MENU_NO",
value = false
}
} )
f19_local0[#f19_local0 + 1] = ControlBindFactory( "@MENU_LOOK_UP", "+lookup" )
f19_local0[#f19_local0 + 1] = ControlBindFactory( "@MENU_LOOK_DOWN", "+lookdown" )
f19_local0[#f19_local0 + 1] = ControlBindFactory( "@MENU_HOLD_MOUSE_LOOK", "+mlook" )
f19_local0[#f19_local0 + 1] = ControlBindFactory( "@MENU_CENTER_VIEW", "centerview" )
return f19_local0
end
function OptionsMainCreate( f20_arg0, f20_arg1 )
f20_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
function OptionsMainClose( f21_arg0, f21_arg1 )
Engine.ExecNow( "profile_menuDvarsFinish" )
Engine.Exec( "updategamerprofile" )
end
function look_controls_vlist()
return {
type = "UIStencil",
children = {
{
type = "UIVerticalList",
childrenFeeder = OptionsFeeder,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = -25,
top = 0,
bottom = 0
}
}
}
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right_wide,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
},
handlers = {
options_window_refresh = OptionsWindowRefresh
}
}
end
function look_controls()
return {
type = "UIElement",
id = "look_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 = OptionsMainClose
},
children = {
{
type = "UIWorldBlur",
id = "world_blur_id",
states = {
default = {
worldBlur = 5
}
}
},
{
type = "UIImage",
id = "options_background",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0.5,
material = RegisterMaterial( "black" )
}
}
},
{
type = "generic_menu_title",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_LOOK" )
}
},
{
type = "look_controls_vlist",
id = "look_controls_vlist_id"
},
{
type = "button_helper_text_main",
id = "button_helper_text_id"
},
{
type = "UIBindButton",
id = "back_button",
handlers = {
button_secondary = MBh.LeaveMenu()
}
}
}
}
end
LUI.MenuBuilder.registerDef( "look_controls_vlist", look_controls_vlist )
LUI.MenuBuilder.registerDef( "look_controls", look_controls )
LockTable( _M )

View File

@ -0,0 +1,203 @@
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 ControlBindFactory( f5_arg0, f5_arg1 )
return {
type = "UIGenericButton",
id = "bind_" .. f5_arg1,
disabledFunc = shouldBeDisabledFunc or function ()
return false
end
,
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( f5_arg0 ),
button_display_func = function ( f7_arg0, f7_arg1 )
return GetDisplay( f5_arg1 )
end
,
button_action_func = function ( f8_arg0, f8_arg1 )
Engine.BindKey( f5_arg1 )
OptionsWindowTriggerRefresh( f8_arg0, f8_arg1 )
end
},
handlers = {
element_refresh = MBh.EmitEvent( "content_refresh" ),
key_bound = OptionsWindowTriggerRefresh
}
}
end
function OptionsFeeder( f9_arg0 )
local f9_local0 = {}
Engine.ExecNow( "profile_menuDvarsSetup" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_FORWARD", "+forward" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_MOVE_BACK", "+back" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_MOVE_LEFT", "+moveleft" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_MOVE_RIGHT", "+moveright" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_STANDJUMP", "+gostand" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_CROUCH", "+togglecrouch" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_PRONE", "toggleprone" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_SPRINT_HOLD_BREATH", "+breath_sprint" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_HOLD_DOWN_CROUCH", "+movedown" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_HOLD_DOWN_PRONE", "+prone" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_CHANGE_STANCE", "+stance" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_SPRINT", "+sprint" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_HOLD_BREATH", "+holdbreath" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_TURN_LEFT", "+left" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_TURN_RIGHT", "+right" )
f9_local0[#f9_local0 + 1] = ControlBindFactory( "@MENU_STRAFE", "+strafe" )
return f9_local0
end
function OptionsMainCreate( f10_arg0, f10_arg1 )
f10_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
function movement_vlist()
return {
type = "UIStencil",
children = {
{
type = "UIVerticalList",
childrenFeeder = OptionsFeeder,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = -25,
top = 0,
bottom = 0
}
}
}
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right_wide,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
},
handlers = {
options_window_refresh = OptionsWindowRefresh
}
}
end
function movement_controls()
return {
type = "UIElement",
id = "movement_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 ( f13_arg0, f13_arg1 )
Engine.Exec( "updategamerprofile" )
end
},
children = {
{
type = "UIWorldBlur",
id = "world_blur_id",
states = {
default = {
worldBlur = 5
}
}
},
{
type = "UIImage",
id = "options_background",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0.5,
material = RegisterMaterial( "black" )
}
}
},
{
type = "generic_menu_title",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_MOVEMENT" )
}
},
{
type = "movement_vlist",
id = "movement_vlist_id"
},
{
type = "button_helper_text_main",
id = "button_helper_text_id"
},
{
type = "UIBindButton",
id = "back_button",
handlers = {
button_secondary = MBh.LeaveMenu()
}
}
}
}
end
LUI.MenuBuilder.registerDef( "movement_vlist", movement_vlist )
LUI.MenuBuilder.registerDef( "movement_controls", movement_controls )
LockTable( _M )

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,219 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 250
f0_local1 = -1
f0_local2 = 89.6
local f0_local3 = 358.4
local f0_local4 = function ( f1_arg0, f1_arg1 )
f0_local1 = f1_arg1.value
local f1_local0 = Game.GetOmnvar( "ui_splash_optional_number" )
local f1_local1 = nil
if f1_arg0.prev_activeIntel ~= f0_local1 then
f1_arg0.prev_activeIntel = f0_local1
if f0_local1 >= 0 then
f1_local1 = Engine.Localize( "@" .. Engine.TableLookupByRow( IntelChallengesTable.File, f0_local1, IntelChallengesTable.Cols.Name ), f1_local0 )
else
f1_arg0:processEvent( {
name = "message_off"
} )
end
if f1_local1 ~= nil then
local f1_local2 = f1_arg0:getChildById( "intelChallengeBgId" )
local f1_local3 = f1_arg0:getChildById( "intelChallengeTextId" )
f1_local3:setText( f1_local1 )
f1_arg0:processEvent( {
name = "message_on",
value = 500 + 1000 * tonumber( Engine.TableLookup( SplashTable.File, SplashTable.Cols.Ref, Engine.TableLookupByRow( IntelChallengesTable.File, f0_local1, IntelChallengesTable.Cols.Ref ), SplashTable.Cols.Duration ) )
} )
end
end
end
local f0_local5 = function ( f2_arg0, f2_arg1 )
local f2_local0 = f2_arg1.value
local f2_local1 = nil
if f2_local0 ~= -1 then
f2_local1 = Engine.Localize( "@" .. Engine.TableLookupByRow( IntelChallengesTable.File, f0_local1, IntelChallengesTable.Cols.Name ), f2_local0 )
end
if f2_local1 ~= nil then
local f2_local2 = f2_arg0:getChildById( "intelChallengeTextId" )
f2_local2:setText( f2_local1 )
end
end
LUI.MenuBuilder.registerType( "intelInfoHudDef", function ()
local f3_local0 = RegisterMaterial( "hud_message_bg" )
local f3_local1 = RegisterMaterial( "popup_icon_intel" )
local self = LUI.UIElement.new()
self.id = "intelInfoHud"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -80,
left = 5,
height = f0_local2,
width = 0,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -80,
left = 5,
height = f0_local2,
width = f0_local3,
alpha = 1
} )
self:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -80,
left = 5,
height = f0_local2,
width = f0_local3 + 40,
alpha = 1
} )
self:registerAnimationState( "closing", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -80,
left = 5,
height = f0_local2,
width = f0_local3,
alpha = 1
} )
self:registerOmnvarHandler( "ui_intel_active_index", f0_local4 )
self:registerOmnvarHandler( "ui_intel_progress_current", f0_local5 )
self:registerEventHandler( "hud_on", function ( element, event )
if element.prev_activeIntel == f0_local1 and f0_local1 ~= -1 then
local f4_local0 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
f0_local0 / 2
},
{
"active",
f0_local0 / 2
}
} )
f4_local0( element )
end
end )
self:registerEventHandler( "message_on", function ( element, event )
local f5_local0 = event.value
if not event.value then
f5_local0 = 0
end
local f5_local1 = MBh.AnimateSequence( {
{
"default",
0
},
{
"default",
f5_local0
},
{
"opening",
f0_local0 / 2
},
{
"active",
f0_local0 / 2
}
} )
f5_local1( element )
end )
self:registerEventHandler( "message_off", MBh.AnimateSequence( {
{
"active",
0
},
{
"closing",
f0_local0 / 2
},
{
"default",
f0_local0 / 2
}
} ) )
local f3_local3 = LUI.UIImage.new()
f3_local3.id = "intelChallengeBgId"
f3_local3:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f3_local0
} )
f3_local3:animateToState( "default", 0 )
local f3_local4 = LUI.UIImage.new()
f3_local4.id = "intelChallengeIconId"
f3_local4:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 15,
left = 0,
height = 64,
width = 64,
material = f3_local1
} )
f3_local4:animateToState( "default", 0 )
local f3_local5 = LUI.UIText.new()
f3_local5.id = "intelChallengeHeaderTextId"
f3_local5:setText( Engine.Localize( "@LUA_MENU_INTEL_CHALLENGE_CAPS" ) )
f3_local5:setTextStyle( CoD.TextStyle.Shadowed )
f3_local5:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
top = 15,
left = 64,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = f0_local3 * 0.8,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Left,
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b
} )
f3_local5:animateToState( "default", 0 )
local f3_local6 = LUI.UIText.new()
f3_local6.id = "intelChallengeTextId"
f3_local6:setText( "" )
f3_local6:setTextStyle( CoD.TextStyle.Shadowed )
f3_local6:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
top = 35,
left = 64,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = f0_local3 * 0.6,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Left
} )
f3_local6:animateToState( "default", 0 )
self:addElement( f3_local3 )
self:addElement( f3_local4 )
self:addElement( f3_local5 )
self:addElement( f3_local6 )
return self
end )
LockTable( _M )

View File

@ -0,0 +1,249 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = {
"one",
"two",
"three",
"four"
}
f0_local1 = 500
f0_local2 = 1000
local f0_local3 = {
101,
127,
139,
149,
167,
191,
241
}
local f0_local4 = 20
local f0_local5 = function ( f1_arg0, f1_arg1 )
if f1_arg0.current_state ~= "default" then
f1_arg0:animateToState( "default", 0 )
f1_arg0.current_state = "default"
end
end
local f0_local6 = function ( f2_arg0 )
return f2_arg0[math.random( 1, #f2_arg0 )]
end
local f0_local7 = function ( f3_arg0, f3_arg1 )
local f3_local0 = {}
local f3_local1 = math.random( 0, 2 )
for f3_local2 = 0, f3_local1, 1 do
local f3_local5 = f3_local2
local f3_local6 = table.insert
local f3_local7 = f3_local0
local f3_local8 = {}
local f3_local9 = f0_local6( f0_local0 )
local f3_local10 = f0_local6( f0_local3 )
f3_local6( f3_local7, f3_local9 )
end
local f3_local2 = table.insert
local f3_local3 = f3_local0
local f3_local4 = {}
local f3_local5 = f0_local6( f0_local0 )
local f3_local6 = math.random( f0_local1, f0_local2 )
f3_local2( f3_local3, f3_local5 )
f3_local1 = math.random( 2, 4 )
for f3_local2 = 0, f3_local1, 1 do
f3_local5 = f3_local2
f3_local6 = table.insert
local f3_local7 = f3_local0
local f3_local8 = {}
local f3_local9 = f0_local6( f0_local0 )
local f3_local10 = f0_local6( f0_local3 )
f3_local6( f3_local7, f3_local9 )
end
f3_local3 = MBh.AnimateSequence( f3_local0 )
f3_local3( f3_arg0 )
end
function GetStaticSequence( f4_arg0 )
local f4_local0 = {}
for f4_local1 = 0, f4_arg0, 1 do
local f4_local4 = f4_local1
local f4_local5 = table.insert
local f4_local6 = f4_local0
local f4_local7 = {}
local f4_local8 = f0_local6( f0_local0 )
local f4_local9 = f0_local6( kVeryShortFlickerTimes )
f4_local5( f4_local6, f4_local8 )
end
return f4_local0
end
local f0_local8 = function ( f5_arg0, f5_arg1 )
local f5_local0 = MBh.AnimateSequence( GetStaticSequence( math.random( 3, 6 ) ) )
f5_local0( f5_arg0 )
end
local f0_local9 = function ()
return {
type = "UIElement",
id = "jammerEffectArtifact",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
alpha = f0_local4
}
},
children = {
{
type = "UIImage",
id = "jammerArtifactId",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = RegisterMaterial( "digidam_artifacts_1" ),
alpha = 0
},
active = {
alpha = 1
},
one = {
material = RegisterMaterial( "digidam_artifacts_1" ),
alpha = 1
},
two = {
material = RegisterMaterial( "digidam_artifacts_2" ),
alpha = 1
},
three = {
material = RegisterMaterial( "digidam_artifacts_3" ),
alpha = 1
},
four = {
material = RegisterMaterial( "digidam_artifacts_6" ),
alpha = 1
}
},
handlers = {
hud_static_on = f0_local7,
hud_static_off = MBh.AnimateToState( "default" ),
hud_off = MBh.AnimateToState( "default" )
}
}
}
}
end
local f0_local10 = function ()
return {
type = "UIElement",
id = "jammerEffectStatic",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
alpha = f0_local4
}
},
children = {
{
type = "UIImage",
id = "jammerStaticId",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = RegisterMaterial( "white" ),
alpha = 0
},
base = {
material = RegisterMaterial( "digidam_static_1" ),
alpha = 0
},
one = {
material = RegisterMaterial( "digidam_static_1" ),
alpha = 1
},
two = {
material = RegisterMaterial( "digidam_static_2" ),
alpha = 1
},
three = {
material = RegisterMaterial( "digidam_static_3" ),
alpha = 1
},
four = {
material = RegisterMaterial( "digidam_static_4" ),
alpha = 1
}
},
handlers = {
hud_static_on = f0_local8,
hud_static_off = MBh.AnimateToState( "default" ),
hud_off = MBh.AnimateToState( "default" )
}
}
}
}
end
local f0_local11 = function ()
return {
type = "UIElement",
id = "jammerEffectNoSignal",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
alpha = 0
},
active = {
alpha = f0_local4
}
},
handlers = {
hud_nosignal_on = MBh.AnimateToState( "active", 0.5 ),
hud_nosignal_off = MBh.AnimateToState( "default", 0.25 ),
hud_off = MBh.AnimateToState( "default" ),
hud_on = function ( f9_arg0, f9_arg1 )
if Game.GetOmnvar( "ui_hud_static" ) == 3 then
f9_arg0:processEvent( {
name = "hud_nosignal_on"
} )
end
end
},
children = {
{
type = "UIImage",
id = "noSignalBgId",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = RegisterMaterial( "digidam_nosignal_1" ),
alpha = 1
}
}
}
}
}
end
LUI.MenuBuilder.registerDef( "jammerEffectArtifactDef", f0_local9 )
LUI.MenuBuilder.registerDef( "jammerEffectStaticDef", f0_local10 )
LUI.MenuBuilder.registerDef( "jammerEffectNoSignalDef", f0_local11 )
LockTable( _M )

View File

@ -0,0 +1,53 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ( f1_arg0, f1_arg1 )
if f1_arg1.value == 1 and f1_arg0.current_state ~= "active" then
f1_arg0:animateToState( "active", 0 )
f1_arg0.current_state = "active"
elseif f1_arg1.value == 0 and f1_arg0.current_state ~= "default" then
f1_arg0:animateToState( "default", 0 )
f1_arg0.current_state = "default"
end
end
LUI.MenuBuilder.registerType( "juggernautOverlayDef", function ()
local f2_local0 = RegisterMaterial( "juggernaut_overlay_half" )
local self = LUI.UIElement.new()
self.id = "juggernautOverlayContainerId"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
alpha = 1
} )
self:registerOmnvarHandler( "ui_juggernaut", f0_local0 )
self:registerEventHandler( "init_overlay", f0_local0 )
local f2_local2 = LUI.UILitImage.new()
f2_local2.id = "odinOverlayImageId"
f2_local2:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f2_local0
} )
f2_local2:animateToState( "default", 0 )
self:addElement( f2_local2 )
return self
end )
LockTable( _M )

Some files were not shown because too many files have changed in this diff Show More