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

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 )

View File

@ -0,0 +1,948 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = Engine.Localize( "@LUA_MENU_KILLCAM_CAPS" )
f0_local1 = Engine.Localize( "@LUA_MENU_KILLED_BY_CAPS" )
f0_local2 = RegisterMaterial( "white" )
local f0_local3 = 4
local f0_local4 = 12
local f0_local5 = 0
local f0_local6 = 1
local f0_local7 = function ( f1_arg0, f1_arg1 )
if not f1_arg0.kcElems then
f1_arg0.kcElems = {}
local f1_local0 = {}
if GameX.GetGameMode() ~= "horde" then
f1_local0 = {
"killCamRespawnText",
"killCamWeaponImage",
"killCamWeaponHL",
"killCamWeaponNameText",
"killCamAbilitiesHL",
"killCamPlayerCard",
"playerCardBg",
"playerCardPatchBg",
"playerCardPatch",
"playerCardQuipText",
"playerCardClanTagText",
"playerCardRankIcon",
"playerCardRankText",
"playerCardNameText",
"killCamVictimAttacker",
"killCamVictimAttackerText",
"killCamCountDownBar",
"killCamCorners",
"killCamBottom",
"killCamTitleText"
}
else
f1_local0 = {
"killCamCorners"
}
end
for f1_local1 = 1, #f1_local0, 1 do
f1_arg0.kcElems[f1_local0[f1_local1]] = f1_arg0:getFirstDescendentById( f1_local0[f1_local1] )
end
end
end
local f0_local8 = function ( f2_arg0 )
local f2_local0 = f2_arg0.kcElems.killCamRespawnText
local f2_local1 = MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
250
}
} )
f2_local1( f2_local0 )
f2_local1 = Game.GetOmnvar( "ui_killcam_text" )
if f2_local1 == "skip" then
f2_local0:setText( Engine.Localize( "@PLATFORM_PRESS_TO_SKIP" ) )
elseif f2_local1 == "respawn" then
f2_local0:setText( Engine.Localize( "@PLATFORM_PRESS_TO_RESPAWN" ) )
else
f2_local0:setText( "" )
end
end
local f0_local9 = function ( f3_arg0 )
local f3_local0 = f3_arg0.kcElems.killCamWeaponImage
local f3_local1 = f3_arg0.kcElems.killCamWeaponNameText
local f3_local2 = {}
for f3_local3 = 1, f0_local3, 1 do
f3_local2[f3_local3] = f3_arg0.kcElems.killCamWeaponHL:getChildById( "killCamAttachment" .. f3_local3 )
end
local f3_local3 = Game.GetOmnvar( "ui_killcam_killedby_killstreak" )
local f3_local4 = Game.GetOmnvar( "ui_killcam_killedby_weapon" )
local f3_local5 = ""
local f3_local6 = ""
local f3_local7 = ""
if f3_local4 ~= -1 then
f3_local7 = Engine.TableLookupByRow( StatsTable.File, f3_local4, StatsTable.Cols.WeaponImage )
f3_local6 = Engine.TableLookupByRow( StatsTable.File, f3_local4, StatsTable.Cols.WeaponName )
f3_local5 = Engine.TableLookupByRow( StatsTable.File, f3_local4, StatsTable.Cols.WeaponRef )
elseif f3_local3 ~= -1 then
f3_local7 = Engine.TableLookupByRow( KillstreakTable.File, f3_local3, KillstreakTable.Cols.UnearnedIcon )
f3_local6 = Engine.TableLookupByRow( KillstreakTable.File, f3_local3, KillstreakTable.Cols.Name )
end
if f3_local7 == nil or f3_local7 == "" then
f3_local0:animateToState( "inactive", 0 )
else
if CoD.WeaponListPrimary[f3_local5] ~= nil or CoD.WeaponListSecondary[f3_local5] ~= nil or string.find( f3_local5, "knifeonly" ) then
f3_local0:animateToState( "primaryWeapon", 0 )
else
f3_local0:animateToState( "otherWeapon", 0 )
end
CoD.SetMaterial( f3_local0, RegisterMaterial( f3_local7 ) )
end
local f3_local8 = f3_local1
local f3_local9 = f3_local1.setText
local f3_local10
if f3_local6 and f3_local6 ~= "" then
f3_local10 = Engine.Localize( f3_local6 )
if not f3_local10 then
else
f3_local9( f3_local8, f3_local10 )
for f3_local9 = 1, #f3_local2, 1 do
local f3_local11 = Game.GetOmnvar( "ui_killcam_killedby_attachment" .. f3_local9 )
local f3_local12 = ""
if f3_local11 ~= -1 then
f3_local12 = Engine.TableLookupByRow( AttachmentTable.File, f3_local11, AttachmentTable.Cols.Image )
end
if f3_local12 == nil or f3_local12 == "" then
f3_local2[f3_local9]:animateToState( "default", 0 )
else
CoD.SetMaterial( f3_local2[f3_local9], RegisterMaterial( f3_local12 ) )
f3_local2[f3_local9]:animateToState( "active", 0 )
end
end
end
end
f3_local10 = ""
end
local f0_local10 = function ( f4_arg0 )
local f4_local0 = f4_arg0.kcElems.killCamAbilitiesHL:getFirstChild()
while f4_local0 ~= nil do
local f4_local1 = f4_local0:getNextSibling()
f4_local0:close()
f4_local0 = f4_local1
end
if Game.GetOmnvar( "ui_killcam_killedby_killstreak" ) ~= -1 then
return
elseif GameX.UsesFakeLoadout() then
return
end
local f4_local2 = {}
local f4_local3 = Game.GetOmnvar( "ui_killcam_killedby_abilities1" )
local f4_local4 = Game.GetOmnvar( "ui_killcam_killedby_abilities2" )
for f4_local5 = 1, 24, 1 do
f4_local2[f4_local5] = hasbit( f4_local3, bit( f4_local5 ) )
f4_local2[f4_local5 + 24] = hasbit( f4_local4, bit( f4_local5 ) )
end
for f4_local5 = 1, #f4_local2, 1 do
if f4_local2[f4_local5] then
local f4_local8 = Engine.TableLookup( KillCamAbilitiesBitMaskTable.File, KillCamAbilitiesBitMaskTable.Cols.Index, f4_local5, KillCamAbilitiesBitMaskTable.Cols.Ref )
local f4_local9 = Engine.TableLookup( PerkTable.File, PerkTable.Cols.Ref, f4_local8, PerkTable.Cols.Cost )
local f4_local10 = RegisterMaterial( Engine.TableLookup( PerkTable.File, PerkTable.Cols.Ref, f4_local8, PerkTable.Cols.Image ) )
local self = LUI.UIImage.new()
self.id = "killCamAbility" .. f4_local5
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = 0,
left = 0,
height = 32,
width = 32,
material = f4_local10
} )
self:animateToState( "default", 0 )
f4_arg0.kcElems.killCamAbilitiesHL:addElement( self )
end
end
end
local f0_local11 = function ( f5_arg0 )
local f5_local0 = f5_arg0.kcElems.playerCardBg
local f5_local1 = f5_arg0.kcElems.playerCardPatchBg
local f5_local2 = f5_arg0.kcElems.playerCardPatch
local f5_local3 = f5_arg0.kcElems.playerCardQuipText
local f5_local4 = f5_arg0.kcElems.playerCardClanTagText
local f5_local5 = f5_arg0.kcElems.playerCardRankIcon
local f5_local6 = f5_arg0.kcElems.playerCardRankText
local f5_local7 = f5_arg0.kcElems.playerCardNameText
local f5_local8 = Game.GetOmnvar( "ui_killcam_killedby_id" )
if f5_local8 == -1 then
f5_arg0.kcElems.killCamPlayerCard:animateToState( "default", 0 )
return
end
f5_arg0.kcElems.killCamPlayerCard:animateToState( "default_regular_killcam", 0 )
local f5_local9 = Game.GetPlayerScoreInfo( f5_local8 )
f5_local6:setText( "" )
if f5_local9 and f5_local9.rank then
f5_local6:setText( f5_local9.rank + 1 )
end
local f5_local10
if f5_local9 then
f5_local10 = f5_local9.name
if not f5_local10 then
else
f5_local4:setText( "" )
if Engine.IsConsoleGame() and string.sub( f5_local10, 1, 1 ) == "[" then
local f5_local11 = string.find( f5_local10, "]" )
if f5_local11 then
f5_local4:setText( string.sub( f5_local10, 1, f5_local11 ) )
f5_local10 = string.sub( f5_local10, f5_local11 + 1 )
end
end
f5_local7:setText( f5_local10 )
if f5_local9 then
if f5_local9.rank and f5_local9.prestige and f5_local9.prestige > 0 then
CoD.SetMaterial( f5_local5, RegisterMaterial( Rank.GetRankIcon( f5_local9.rank, f5_local9.prestige or 0 ) ) )
elseif f5_local9.rankIcon then
CoD.SetMaterial( f5_local5, f5_local9.rankIcon )
end
end
local f5_local11 = Game.GetPlayerCard( f5_local8 )
CoD.SetMaterial( f5_local0, RegisterMaterial( Engine.TableLookup( BackgroundsTable.File, BackgroundsTable.Cols.Ref, f5_local11.background, BackgroundsTable.Cols.CardImage ) ) )
CoD.SetMaterial( f5_local1, RegisterMaterial( Engine.TableLookup( PatchBackingsTable.File, PatchBackingsTable.Cols.Ref, f5_local11.patchBacking, PatchBackingsTable.Cols.CardImage ) ) )
CoD.SetMaterial( f5_local2, RegisterMaterial( Engine.TableLookup( PatchesTable.File, PatchesTable.Cols.Ref, f5_local11.patch, PatchesTable.Cols.CardImage ) ) )
f5_local3:setText( Engine.Localize( Engine.TableLookup( PatchesTable.File, PatchesTable.Cols.Ref, f5_local11.patch, PatchesTable.Cols.Quip ) ) )
end
end
f5_local10 = ""
end
local f0_local12 = function ( f6_arg0 )
local f6_local0 = f6_arg0.kcElems.playerCardBg
local f6_local1 = f6_arg0.kcElems.playerCardPatchBg
local f6_local2 = f6_arg0.kcElems.playerCardPatch
local f6_local3 = f6_arg0.kcElems.playerCardQuipText
local f6_local4 = f6_arg0.kcElems.playerCardRankIcon
local f6_local5 = f6_arg0.kcElems.playerCardRankText
local f6_local6 = f6_arg0.kcElems.playerCardNameText
local f6_local7 = Game.GetOmnvar( "ui_killcam_victim_id" )
if f6_local7 == -1 then
f6_arg0.kcElems.killCamPlayerCard:animateToState( "default", 0 )
return
end
f6_arg0.kcElems.killCamPlayerCard:animateToState( "default_regular_killcam", 0 )
local f6_local8 = Game.GetPlayerScoreInfo( f6_local7 )
f6_local5:setText( "" )
if f6_local8 and f6_local8.rank then
f6_local5:setText( f6_local8.rank + 1 )
end
local f6_local9
if f6_local8 then
f6_local9 = f6_local8.name
if not f6_local9 then
else
f6_local6:setText( f6_local9 )
if f6_local8 then
if f6_local8.rank and f6_local8.prestige and f6_local8.prestige > 0 then
CoD.SetMaterial( f6_local4, RegisterMaterial( Rank.GetRankIcon( f6_local8.rank, f6_local8.prestige or 0 ) ) )
elseif f6_local8.rankIcon then
CoD.SetMaterial( f6_local4, f6_local8.rankIcon )
end
end
local f6_local10 = Game.GetPlayerCard( f6_local7 )
CoD.SetMaterial( f6_local0, RegisterMaterial( Engine.TableLookup( BackgroundsTable.File, BackgroundsTable.Cols.Ref, f6_local10.background, BackgroundsTable.Cols.CardImage ) ) )
CoD.SetMaterial( f6_local1, RegisterMaterial( Engine.TableLookup( PatchBackingsTable.File, PatchBackingsTable.Cols.Ref, f6_local10.patchBacking, PatchBackingsTable.Cols.CardImage ) ) )
CoD.SetMaterial( f6_local2, RegisterMaterial( Engine.TableLookup( PatchesTable.File, PatchesTable.Cols.Ref, f6_local10.patch, PatchesTable.Cols.CardImage ) ) )
end
end
f6_local9 = ""
end
local f0_local13 = function ( f7_arg0, f7_arg1 )
if f7_arg1.value <= 0 then
f7_arg0:processEvent( {
name = "killcam_off"
} )
return
elseif GameX.GetGameMode() ~= "horde" then
f0_local8( f7_arg0 )
f0_local9( f7_arg0 )
f0_local10( f7_arg0 )
f0_local11( f7_arg0 )
f7_arg0.kcElems.killCamBottom:animateToState( "active", 0 )
f7_arg0.kcElems.killCamCountDownBar:animateToState( "active", 0 )
f7_arg0.kcElems.killCamTitleText:animateToState( "active", 0 )
f7_arg0:dispatchEventToChildren( {
name = "killcam_on"
} )
end
f7_arg0:processEvent( {
name = "killcam_on"
} )
f7_arg0:animateToState( "active", 0 )
end
local f0_local14 = function ( f8_arg0, f8_arg1 )
local f8_local0 = f8_arg0.kcElems.killCamCountDownBar
local f8_local1 = f8_arg0.kcElems.killCamVictimAttacker
local f8_local2 = f8_arg0.kcElems.killCamVictimAttackerText
local f8_local3 = f8_arg0.kcElems.killCamPlayerCard
local f8_local4 = f8_arg0.kcElems.killCamBottom
local f8_local5 = f8_arg0.kcElems.killCamTitleText
f8_local0:animateToState( "inactive", 0 )
if f8_arg1.value == f0_local5 then
f0_local12( f8_arg0 )
f8_arg0:animateToState( "active", 0 )
f8_local4:animateToState( "default", 0 )
local f8_local6 = MBh.AnimateSequence( {
{
"default_final_killcam",
0
},
{
"opening",
250
},
{
"active",
1250
},
{
"leaving",
250
}
} )
f8_local6( f8_local3 )
f8_local2:setText( "" )
f8_local6 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
250
},
{
"active",
1250
},
{
"leaving",
250
}
} )
f8_local6( f8_local1 )
elseif f8_arg1.value == f0_local6 then
f0_local11( f8_arg0 )
f8_arg0:animateToState( "active", 0 )
f8_local5:animateToState( "inactive", 0 )
local f8_local6 = MBh.AnimateSequence( {
{
"default_final_killcam",
0
},
{
"opening",
250
},
{
"active",
4500
}
} )
f8_local6( f8_local3 )
f8_local2:setText( "" )
f8_local6 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
250
},
{
"active",
2000
},
{
"leaving",
250
}
} )
f8_local6( f8_local1 )
f8_local6 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
250
},
{
"active",
0
}
} )
f8_local6( f8_local4 )
else
f8_arg0:animateToState( "default", 0 )
end
end
local f0_local15 = function ()
local f9_local0 = RegisterMaterial( "hud_killcam_corner" )
local self = LUI.UIElement.new()
self.id = "killCamCorners"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
alpha = 1
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "inactive", {
alpha = 0
} )
local f9_local2 = LUI.UIImage.new()
f9_local2.id = "topLeftCorner"
f9_local2:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
height = 512,
width = 512,
material = f9_local0,
alpha = 1,
zRot = 0
} )
f9_local2:animateToState( "default", 0 )
local f9_local3 = LUI.UIImage.new()
f9_local3.id = "bottomLeftCorner"
f9_local3:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = 0,
left = 0,
height = 512,
width = 512,
material = f9_local0,
alpha = 1,
zRot = 90
} )
f9_local3:animateToState( "default", 0 )
local f9_local4 = LUI.UIImage.new()
f9_local4.id = "bottomRightCorner"
f9_local4:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = 0,
height = 512,
width = 512,
material = f9_local0,
alpha = 1,
zRot = 180
} )
f9_local4:animateToState( "default", 0 )
local f9_local5 = LUI.UIImage.new()
f9_local5.id = "topRightCorner"
f9_local5:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 0,
right = 0,
height = 512,
width = 512,
material = f9_local0,
alpha = 1,
zRot = 270
} )
f9_local5:animateToState( "default", 0 )
self:addElement( f9_local2 )
self:addElement( f9_local3 )
self:addElement( f9_local4 )
self:addElement( f9_local5 )
return self
end
local f0_local16 = function ()
local self = LUI.UIElement.new()
self.id = "killCamPlayerCard"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 96,
left = 95,
height = 64,
width = 256,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "default_regular_killcam", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 96,
left = 95,
height = 64,
width = 256,
alpha = 1
} )
self:registerAnimationState( "default_final_killcam", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 50,
left = 0,
height = 64,
width = 256,
alpha = 0
} )
self:registerAnimationState( "opening", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 50,
left = 470,
height = 64,
width = 256,
alpha = 1
} )
self:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 50,
left = 500,
height = 64,
width = 256,
alpha = 1
} )
self:registerAnimationState( "leaving", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 50,
left = 1000,
height = 64,
width = 256,
alpha = 0
} )
self:addElement( LUI.mp_hud.PlayerCardHud.playerCardHudDef() )
return self
end
local f0_local17 = function ()
local f11_local0 = RegisterMaterial( "kk_label_orange" )
local self = LUI.UIElement.new()
self.id = "killCamCountDownBar"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
height = 200,
width = 634,
alpha = 1
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "inactive", {
alpha = 0
} )
self:registerAnimationState( "active", {
alpha = 1
} )
local f11_local2 = LUI.UIImage.new()
f11_local2.id = "killCamCountDownBarImage"
f11_local2:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
height = 32,
material = f11_local0
} )
f11_local2:animateToState( "default", 0 )
local f11_local3 = LUI.UICountdown.new( {} )
f11_local3.id = "killCamCounterDownTimer"
f11_local3:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -5,
left = 180,
height = CoD.TextSettings.HudDigitalBigFont.Height,
width = 100,
font = CoD.TextSettings.HudDigitalBigFont.Font,
alignment = LUI.Alignment.Right
} )
f11_local3:animateToState( "default", 0 )
f11_local3:registerEventHandler( "killcam_on", function ( element, event )
element:setEndTime( Game.GetOmnvar( "ui_killcam_end_milliseconds" ) )
end )
local f11_local4 = LUI.UIText.new()
f11_local4.id = "killCamKilledByText"
f11_local4:setText( f0_local1 )
f11_local4:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -8,
left = 300,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 200,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Left
} )
f11_local4:animateToState( "default", 0 )
f11_local2:addElement( f11_local3 )
f11_local2:addElement( f11_local4 )
self:addElement( f11_local2 )
return self
end
local f0_local18 = function ()
local f13_local0 = RegisterMaterial( "kk_lowbar" )
local self = LUI.UIElement.new()
self.id = "killCamBottom"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = 500,
height = 128,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = -20,
height = 128,
alpha = 1
} )
self:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = -20,
height = 128,
alpha = 1
} )
local f13_local2 = LUI.UIImage.new()
f13_local2.id = "killCamBottomBg"
f13_local2:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f13_local0
} )
f13_local2:animateToState( "default", 0 )
local f13_local3 = LUI.UIText.new()
f13_local3.id = "killCamTitleText"
f13_local3:setText( f0_local0 )
f13_local3:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -60,
right = -120,
height = CoD.TextSettings.HudEuroExtraBigFont.Height,
width = 512,
font = CoD.TextSettings.HudEuroExtraBigFont.Font,
alignment = LUI.Alignment.Right,
alpha = 1
} )
f13_local3:animateToState( "default", 0 )
f13_local3:registerAnimationState( "inactive", {
alpha = 0
} )
f13_local3:registerAnimationState( "active", {
alpha = 1
} )
local f13_local4 = LUI.UIText.new()
f13_local4.id = "killCamRespawnText"
f13_local4:setText( "" )
f13_local4:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -35,
right = -120,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 512,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right
} )
f13_local4:animateToState( "default", 0 )
local f13_local5 = LUI.UIHorizontalList.new()
f13_local5.id = "killCamWeaponHL"
f13_local5:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -80,
left = 100,
height = 32,
width = 512,
alignment = LUI.Alignment.Left,
spacing = 15
} )
f13_local5:animateToState( "default", 0 )
local f13_local6 = LUI.UIText.new()
f13_local6.id = "killCamWeaponNameText"
f13_local6:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -60,
left = 90,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 256,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Left
} )
f13_local6:animateToState( "default", 0 )
local f13_local7 = LUI.UIImage.new()
f13_local7.id = "killCamWeaponImage"
f13_local7:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = 0,
left = 0,
height = 76,
width = 150,
material = f0_local2,
alpha = 1
} )
f13_local7:animateToState( "default", 0 )
f13_local7:registerAnimationState( "primaryWeapon", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = 0,
left = 0,
height = 76,
width = 150,
alpha = 1
} )
f13_local7:registerAnimationState( "killstreakWeapon", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = 0,
left = 0,
height = 64,
width = 64,
alpha = 1
} )
f13_local7:registerAnimationState( "otherWeapon", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = 0,
left = 0,
height = 64,
width = 64,
alpha = 1
} )
f13_local7:registerAnimationState( "inactive", {
alpha = 0
} )
f13_local5:addElement( f13_local7 )
for f13_local8 = 1, f0_local3, 1 do
local f13_local11 = LUI.UIImage.new()
f13_local11.id = "killCamAttachment" .. f13_local8
f13_local11:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = 0,
left = 0,
height = 32,
width = 32,
material = f0_local2,
alpha = 0
} )
f13_local11:animateToState( "default", 0 )
f13_local11:registerAnimationState( "active", {
alpha = 1
} )
f13_local5:addElement( f13_local11 )
end
local f13_local8 = LUI.UIHorizontalList.new()
f13_local8.id = "killCamAbilitiesHL"
f13_local8:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -26,
left = 90,
height = 32,
width = 512,
alignment = LUI.Alignment.Left,
spacing = 0
} )
f13_local8:animateToState( "default", 0 )
self:addElement( f13_local2 )
self:addElement( f13_local3 )
self:addElement( f13_local4 )
self:addElement( f13_local5 )
self:addElement( f13_local8 )
self:addElement( f13_local6 )
return self
end
local f0_local19 = function ()
local self = LUI.UIElement.new()
self.id = "killCamVictimAttacker"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnhor = false,
bottomAnchor = false,
rightAnchor = true,
top = 110,
right = 0,
height = CoD.TextSettings.HudEuroExtraBigFont.Height,
width = 512,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "opening", {
topAnchor = true,
leftAnhor = false,
bottomAnchor = false,
rightAnchor = true,
top = 110,
right = -470,
height = CoD.TextSettings.HudEuroExtraBigFont.Height,
width = 512,
alpha = 1
} )
self:registerAnimationState( "active", {
topAnchor = true,
leftAnhor = false,
bottomAnchor = false,
rightAnchor = true,
top = 110,
right = -500,
height = CoD.TextSettings.HudEuroExtraBigFont.Height,
width = 512,
alpha = 1
} )
self:registerAnimationState( "leaving", {
topAnchor = true,
leftAnhor = false,
bottomAnchor = false,
rightAnchor = true,
top = 110,
right = -1000,
height = CoD.TextSettings.HudEuroExtraBigFont.Height,
width = 512,
alpha = 0
} )
local f14_local1 = LUI.UIText.new()
f14_local1.id = "killCamVictimAttackerText"
f14_local1:setText( "" )
f14_local1:setTextStyle( CoD.TextStyle.Shadowed )
f14_local1:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
font = CoD.TextSettings.HudEuroExtraBigFont.Font,
alignment = LUI.Alignment.Right
} )
f14_local1:animateToState( "default", 0 )
self:addElement( f14_local1 )
return self
end
LUI.MenuBuilder.registerType( "killCamHudDef", function ()
local self = LUI.UIElement.new()
self.id = "killCamHudId"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
alpha = 1
} )
self:registerEventHandler( "menu_create", f0_local7 )
self:registerOmnvarHandler( "ui_killcam_end_milliseconds", f0_local13 )
if GameX.GetGameMode() ~= "horde" then
self:registerOmnvarHandler( "ui_killcam_victim_or_attacker", f0_local14 )
end
self:registerEventHandler( "killcam_on", MBh.AnimateToState( "active", 0 ) )
self:registerEventHandler( "killcam_off", function ( element, event )
local f16_local0 = MBh.DoMultiple
local f16_local1 = {}
local f16_local2 = MBh.AnimateToState( "default", 0 )
local f16_local3 = MBh.EmitOmnvarUpdateEventToRoot( "ui_predator_missile" )
f16_local0 = f16_local0( f16_local2 )
f16_local0( element, event )
end )
self:addElement( f0_local15() )
if GameX.GetGameMode() ~= "horde" then
self:addElement( f0_local17() )
self:addElement( f0_local16() )
self:addElement( f0_local18() )
self:addElement( f0_local19() )
end
self:addElement( LUI.MenuBuilder.buildItems( {
type = "talkerHudDef"
}, self.properties, self ) )
return self
end )
LockTable( _M )

View File

@ -0,0 +1,847 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 30
f0_local1 = 4
f0_local2 = KillstreakTable.Cols.UnearnedIcon
local f0_local3 = KillstreakTable.Cols.DPadIcon
local f0_local4 = 25.6
local f0_local5 = 25.6
local f0_local6 = 32
local f0_local7 = 32
local f0_local8 = 32
local f0_local9 = 32
local f0_local10 = 0
local f0_local11 = -23
local f0_local12 = function ( f1_arg0, f1_arg1 )
local f1_local0 = 0
for f1_local1 = 0, f0_local1 - 1, 1 do
if Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "hasStreak", f1_local1 ) then
f1_local0 = f1_local0 + 1
end
end
if f1_local0 > 1 and (Engine.IsConsoleGame() == true or 1 == Engine.IsGamepadEnabled()) and Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "isSpecialist" ) == false then
if f1_arg0.current_state ~= "active" then
f1_arg0:animateToState( "active", 250 )
f1_arg0.current_state = "active"
end
elseif f1_arg0.current_state ~= "default" then
f1_arg0:animateToState( "default", 0 )
f1_arg0.current_state = "default"
end
end
local f0_local13 = function ( f2_arg0, f2_arg1 )
local f2_local0 = 0
local f2_local1 = 0
local f2_local2 = Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "count" ) or 0
local f2_local3 = Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "countToNext" ) or 0
local f2_local4 = Game.GetOmnvar( "ui_half_tick" )
if f2_local3 <= f2_local2 then
f2_local2 = f2_local3
f2_local4 = false
end
if 0 < f2_local2 then
f2_local0 = 1
f2_local1 = math.min( f2_local2, f2_local3 )
for f2_local5 = f2_local0, f2_local1, 1 do
local f2_local8 = f2_arg0:getChildById( f2_local5 )
if f2_local8.current_state ~= "filled" then
f2_local8:animateToState( "filled", 250 )
f2_local8.current_state = "filled"
end
end
end
if f2_local4 == true then
f2_local1 = f2_local2 + 1
local f2_local5 = f2_arg0:getChildById( f2_local1 )
if f2_local5.current_state ~= "half" then
f2_local5:animateToState( "half", 250 )
f2_local5.current_state = "half"
end
end
if f2_local2 < f2_local3 then
f2_local0 = f2_local1 + 1
f2_local1 = f2_local3
for f2_local5 = f2_local0, f2_local1, 1 do
local f2_local8 = f2_arg0:getChildById( f2_local5 )
if f2_local8.current_state ~= "empty" then
f2_local8:animateToState( "empty", 250 )
f2_local8.current_state = "empty"
end
end
end
f2_local0 = f2_local1 + 1
f2_local1 = f0_local0
for f2_local5 = f2_local0, f2_local1, 1 do
local f2_local8 = f2_arg0:getChildById( f2_local5 )
if f2_local8.current_state ~= "default" then
f2_local8:animateToState( "default", 100 )
f2_local8.current_state = "default"
end
end
end
local f0_local14 = function ( f3_arg0, f3_arg1 )
for f3_local0 = 0, f0_local1 - 1, 1 do
local f3_local3 = f3_arg0:getChildById( "icon" .. f3_local0 + 1 )
local f3_local4 = Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "isSpecialist" )
local f3_local5 = Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "hasStreak", f3_local0 )
local f3_local6 = Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "icons", f3_local0 )
local f3_local7 = f0_local2
local f3_local8 = "specialty_null"
if f3_local6 ~= 0 then
if f3_local5 then
f3_local7 = f0_local3
end
f3_local8 = Engine.TableLookup( KillstreakTable.File, KillstreakTable.Cols.Index, f3_local6, f3_local7 )
end
local f3_local9 = 0
if f3_local7 == f0_local3 then
f3_local9 = 1
elseif f3_local7 == f0_local2 and f3_local0 ~= 0 and f3_local8 ~= "specialty_null" then
f3_local9 = 0.5
end
if f3_local3.current_state ~= f3_local8 or f3_local3.current_alpha ~= f3_local9 then
CoD.SetMaterial( f3_local3, RegisterMaterial( f3_local8 ), f3_local9 )
f3_local3.current_state = f3_local8
f3_local3.current_alpha = f3_local9
end
end
local f3_local0 = f3_arg0:getChildById( "bonusIcon" )
local f3_local1 = Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "hasStreak", 4 )
if f3_local1 and f3_local0.current_state ~= "active" then
f3_local0:animateToState( "active", 250 )
f3_local0.current_state = "active"
end
if not f3_local1 and f3_local0.current_state ~= "default" then
f3_local0:animateToState( "default", 0 )
f3_local0.current_state = "default"
end
end
local f0_local15 = function ( f4_arg0, f4_arg1 )
for f4_local0 = 0, f0_local1 - 1, 1 do
local f4_local3 = f4_arg0:getChildById( "available" .. f4_local0 + 1 )
if Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "hasStreak", f4_local0 ) then
if f4_local3.current_state ~= "available" then
f4_local3:animateToState( "ks_slot_available", 250 )
f4_local3.current_state = "available"
if Engine.IsConsoleGame() == false and 0 == Engine.IsGamepadEnabled() then
local f4_local4 = f4_local3:getChildById( "keybindTextId" )
f4_local4:setText( Engine.GetKeyBindingLocalizedString( 0, f4_local4.keybinding ) )
end
end
end
if f4_local3.current_state ~= "default" then
f4_local3:animateToState( "default", 0 )
f4_local3.current_state = "default"
end
end
end
local f0_local16 = function ( f5_arg0, f5_arg1 )
local f5_local0 = Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "selectedIndex" )
local f5_local1 = "default"
if f5_local0 == 0 then
f5_local1 = "ks_slot_0_selected"
elseif f5_local0 == 1 then
f5_local1 = "ks_slot_1_selected"
elseif f5_local0 == 2 then
f5_local1 = "ks_slot_2_selected"
elseif f5_local0 == 3 then
f5_local1 = "ks_slot_3_selected"
end
if Engine.IsConsoleGame() == false and Engine.IsGamepadEnabled() == 0 then
f5_local1 = "default"
end
if f5_arg0.current_state ~= f5_local1 then
f5_arg0:animateToState( f5_local1, 250 )
f5_arg0.current_state = f5_local1
local f5_local2 = f5_arg0:getChildById( "killstreakSelectedHighlight" )
local f5_local3 = f5_local2:getChildById( "killstreakSelectedRightArrow" )
if f5_local1 == "ks_slot_0_selected" then
f5_local3:animateToState( f5_local1, 250 )
else
f5_local3:animateToState( "default", 250 )
end
end
end
local f0_local17 = function ( f6_arg0, f6_arg1 )
local f6_local0 = 2
local f6_local1 = Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "selectedIndex" )
if f6_local1 >= 0 then
local f6_local2 = Engine.Localize( "@" .. Engine.TableLookup( KillstreakTable.File, KillstreakTable.Cols.Index, Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "icons", f6_local1 ), f6_local0 ) )
if f6_local2 ~= nil and f6_local2 ~= f6_arg0.previous_killstreak_name then
f6_arg0:setText( f6_local2 )
local f6_local3 = MBh.AnimateSequence( {
{
"default",
0
},
{
"slide_in",
150
},
{
"slide_in",
1200
},
{
"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
}
} )
f6_local3( f6_arg0 )
f6_arg0.previous_killstreak_name = f6_local2
f6_arg0.current_state = "slide_in"
end
end
end
local f0_local18 = function ( f7_arg0, f7_arg1 )
local f7_local0 = f7_arg0:getChildById( "killstreakInfoHudId" )
local f7_local1 = f7_local0:getChildById( "killstreakAvailableHud" )
for f7_local2 = 0, f0_local1 - 1, 1 do
local f7_local5 = f7_local1:getChildById( "available" .. f7_local2 + 1 )
local f7_local6 = Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "hasStreak", f7_local2 )
local f7_local7 = f7_local5:getChildById( "keybindTextId" )
if f7_local6 then
f7_local7:setText( Engine.GetKeyBindingLocalizedString( 0, f7_local7.keybinding ) )
end
if 0 == Engine.IsGamepadEnabled() then
if not Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "isSpecialist" ) or f7_local2 == 0 then
f7_local7:animateToState( "default", 0 )
else
f7_local7:animateToState( "inactive", 0 )
end
end
f7_local7:animateToState( "inactive", 0 )
end
end
local f0_local19 = function ( f8_arg0, f8_arg1 )
local f8_local0 = GameX.GetGameMode()
local f8_local1
if f8_local0 ~= "sotf" and f8_local0 ~= "infect" and Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "countToNext" ) ~= 0 then
f8_local1 = false
else
f8_local1 = true
end
if f8_local1 then
if f8_arg0.current_state ~= "inactive" then
f8_arg0:animateToState( "inactive", 0 )
f8_arg0.current_state = "inactive"
end
elseif f8_arg0.current_state ~= "default" then
f8_arg0:animateToState( "default", 0 )
f8_arg0.current_state = "default"
end
end
local f0_local20 = function ( f9_arg0, f9_arg1 )
local f9_local0 = RegisterMaterial( "specialty_null" )
local self = LUI.UIImage.new()
self.id = f9_arg0
local f9_local2 = 0
if f9_arg1 then
f9_local2 = f9_arg1
end
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = f9_local2,
height = f0_local4,
width = f0_local5,
material = f9_local0,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
material = f9_local0,
alpha = 1
} )
self:registerAnimationState( "inactive", {
material = f9_local0,
alpha = 0.5
} )
return self
end
local f0_local21 = function ( f10_arg0, f10_arg1, f10_arg2 )
local self = LUI.UIElement.new()
self.id = f10_arg0
self:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = 0,
height = f10_arg1,
width = f10_arg2
} )
self:animateToState( "default", 0 )
return self
end
local f0_local22 = function ( f11_arg0, f11_arg1, f11_arg2, f11_arg3, f11_arg4, f11_arg5 )
local f11_local0 = RegisterMaterial( "hud_killstreak_available" )
local self = LUI.UIImage.new()
self.id = f11_arg0
local f11_local2 = 0
if f11_arg3 then
f11_local2 = f11_arg3
end
local f11_local3 = 0
if f11_arg4 then
f11_local3 = f11_arg4
end
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = f11_local2,
height = f11_arg1,
width = f11_arg2,
alpha = 0,
material = f11_local0,
zRot = f11_local3
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "ks_slot_available", {
material = f11_local0,
alpha = 1
} )
if false == Engine.IsConsoleGame() then
local f11_local4 = LUI.UIText.new()
f11_local4.id = "keybindTextId"
f11_local4.keybinding = f11_arg5
f11_local4:setText( Engine.GetKeyBindingLocalizedString( 0, f11_arg5 ) )
if f11_arg4 then
f11_local3 = f11_local3 * -1
end
f11_local4:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = 17,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = f0_local7,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
zRot = f11_local3,
alpha = 1
} )
f11_local4:registerAnimationState( "inactive", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = 17,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = f0_local7,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
zRot = f11_local3,
alpha = 0
} )
if 0 == Engine.IsGamepadEnabled() then
if not Engine.GetPlayerData( CoD.StatsGroup.Common, "killstreaksState", "isSpecialist" ) or f11_arg0 == "available1" then
f11_local4:animateToState( "default", 0 )
else
f11_local4:animateToState( "inactive", 0 )
end
else
f11_local4:animateToState( "inactive", 0 )
end
self:addElement( f11_local4 )
end
return self
end
local f0_local23 = function ()
local f12_local0 = RegisterMaterial( "hud_killstreak_dpad_arrow_up" )
local f12_local1 = RegisterMaterial( "hud_killstreak_dpad_arrow_down" )
local self = LUI.UIElement.new()
self.id = "killstreakScrollArrowsHud"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -52,
right = -33,
height = 117,
width = 19.2,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
alpha = 1
} )
self:registerEventHandler( "killstreak_info_refresh", f0_local12 )
local f12_local3 = LUI.UIImage.new()
f12_local3.id = "killstreakSelectedUpArrow"
f12_local3:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 2,
height = 12.8,
width = 19.2,
material = f12_local0
} )
f12_local3:animateToState( "default", 0 )
local f12_local4 = LUI.UIImage.new()
f12_local4.id = "killstreakSelectedDownArrow"
f12_local4:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
height = 12.8,
material = f12_local1
} )
f12_local4:animateToState( "default", 0 )
self:addElement( f12_local3 )
self:addElement( f12_local4 )
return self
end
local f0_local24 = function ()
local f13_local0 = RegisterMaterial( "hud_killstreak_bar_full" )
local f13_local1 = RegisterMaterial( "hud_killstreak_bar_empty" )
local f13_local2 = RegisterMaterial( "hud_killstreak_bar_half" )
local self = LUI.UIElement.new()
self.id = "killstreakTicksHud"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -62,
right = -55,
height = 275,
width = 50
} )
self:animateToState( "default", 0 )
local f13_local4 = LUI.UIVerticalList.new()
f13_local4.id = "columnKillstreakTicks"
f13_local4:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
spacing = -4,
alignment = LUI.Alignment.Bottom
} )
f13_local4:animateToState( "default", 0 )
f13_local4:registerEventHandler( "killstreak_info_refresh", f0_local13 )
for f13_local5 = 1, f0_local0, 1 do
local f13_local8 = LUI.UIImage.new()
f13_local8.id = f13_local5
f13_local8:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
height = 9.6,
right = 0,
width = 25.6,
material = f13_local0,
alpha = 0
} )
f13_local8:animateToState( "default", 0 )
f13_local8:registerAnimationState( "filled", {
material = f13_local0,
alpha = 1
} )
f13_local8:registerAnimationState( "half", {
material = f13_local2,
alpha = 1
} )
f13_local8:registerAnimationState( "empty", {
material = f13_local1,
alpha = 1
} )
f13_local4:addElement( f13_local8 )
end
self:addElement( f13_local4 )
return self
end
local f0_local25 = function ()
local f14_local0 = RegisterMaterial( "specialty_perks_all" )
local self = LUI.UIVerticalList.new()
self.id = "killstreakIconsHud"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -20,
right = -26,
height = 310,
width = 90,
spacing = 0,
alignment = LUI.Alignment.Bottom
} )
self:animateToState( "default", 0 )
self:registerEventHandler( "killstreak_info_refresh", f0_local14 )
local f14_local2 = f0_local20( "icon1", 7 )
local f14_local3 = f0_local20( "icon2" )
local f14_local4 = f0_local20( "icon3" )
local f14_local5 = f0_local20( "icon4" )
local f14_local6 = LUI.UIImage.new()
f14_local6.id = "bonusIcon"
f14_local6:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = 0,
height = f0_local4,
width = f0_local5,
material = f14_local0,
alpha = 0
} )
f14_local6:animateToState( "default", 0 )
f14_local6:registerAnimationState( "active", {
material = f14_local0,
alpha = 1
} )
local f14_local7 = f0_local21( "spacer1", 4, f0_local5 )
local f14_local8 = f0_local21( "spacer2", 16, f0_local5 )
local f14_local9 = f0_local21( "spacer3", 7, f0_local5 )
local f14_local10 = f0_local21( "spacer4", 6, f0_local5 )
local f14_local11 = f0_local21( "spacer5", 15, f0_local5 )
self:addElement( f14_local7 )
self:addElement( f14_local2 )
self:addElement( f14_local8 )
self:addElement( f14_local3 )
self:addElement( f14_local9 )
self:addElement( f14_local4 )
self:addElement( f14_local10 )
self:addElement( f14_local5 )
self:addElement( f14_local11 )
self:addElement( f14_local6 )
return self
end
local f0_local26 = function ()
local self = LUI.UIVerticalList.new()
self.id = "killstreakAvailableHud"
self:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = -20,
right = -23,
height = 310,
width = 90,
spacing = 0,
alignment = LUI.Alignment.Bottom
} )
self:animateToState( "default", 0 )
self:registerEventHandler( "killstreak_info_refresh", f0_local15 )
local f15_local1 = f0_local22( "available1", f0_local6, f0_local7, 8, -45, "+actionslot 4" )
local f15_local2 = f0_local22( "available2", f0_local6, f0_local7, nil, nil, "+actionslot 5" )
local f15_local3 = f0_local22( "available3", f0_local6, f0_local7, nil, nil, "+actionslot 6" )
local f15_local4 = f0_local22( "available4", f0_local6, f0_local7, nil, nil, "+actionslot 7" )
local f15_local5 = f0_local21( "spacer", 10, f0_local7 )
self:addElement( f15_local1 )
self:addElement( f15_local5 )
self:addElement( f15_local2 )
self:addElement( f15_local3 )
self:addElement( f15_local4 )
return self
end
local f0_local27 = function ()
local f16_local0 = RegisterMaterial( "hud_killstreak_highlight" )
local f16_local1 = RegisterMaterial( "hud_killstreak_dpad_arrow_right" )
local self = LUI.UIElement.new()
self.id = "killstreakSelectedHud"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = f0_local10,
right = f0_local11,
height = f0_local8,
width = f0_local9,
zRot = 0,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "ks_slot_0_selected", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = f0_local10 - 20,
right = f0_local11 + 7,
height = f0_local8,
width = f0_local9,
zRot = -45,
alpha = 1
} )
self:registerAnimationState( "ks_slot_1_selected", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = f0_local10 - 63,
right = f0_local11,
height = f0_local8,
width = f0_local9,
zRot = 0,
alpha = 1
} )
self:registerAnimationState( "ks_slot_2_selected", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = f0_local10 - 95,
right = f0_local11,
height = f0_local8,
width = f0_local9,
zRot = 0,
alpha = 1
} )
self:registerAnimationState( "ks_slot_3_selected", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = f0_local10 - 127,
right = f0_local11,
height = f0_local8,
width = f0_local9,
zRot = 0,
alpha = 1
} )
self:registerEventHandler( "killstreak_info_refresh", f0_local16 )
local f16_local3 = LUI.UIImage.new()
f16_local3.id = "killstreakSelectedHighlight"
f16_local3:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = 0,
height = f0_local8,
width = f0_local9,
material = f16_local0
} )
f16_local3:animateToState( "default", 0 )
local f16_local4 = LUI.UIImage.new()
f16_local4.id = "killstreakSelectedRightArrow"
f16_local4:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = -5,
right = 12,
height = 19.2,
width = 12.8,
material = f16_local1,
zRot = 0
} )
f16_local4:animateToState( "default", 0 )
f16_local4:registerAnimationState( "ks_slot_0_selected", {
bottomAnchor = true,
rightAnchor = true,
bottom = -19,
right = 5,
height = 19.2,
width = 12.8,
material = f16_local1,
zRot = 45
} )
f16_local3:addElement( f16_local4 )
self:addElement( f16_local3 )
return self
end
local f0_local28 = function ()
local f17_local0 = RegisterMaterial( "hud_ks_back" )
local self = LUI.UIElement.new()
self.id = "killstreakBgHud"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -45,
right = -15,
height = 128,
width = 64,
alpha = 1
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "inactive", {
alpha = 0
} )
self:registerEventHandler( "killstreak_info_refresh", f0_local19 )
local f17_local2 = LUI.UIImage.new()
f17_local2.id = "killstreakBg"
f17_local2:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f17_local0
} )
f17_local2:animateToState( "default", 0 )
self:addElement( f17_local2 )
return self
end
LUI.MenuBuilder.registerType( "killstreakInfoHudDef", function ()
local f18_local0 = Engine.IsConsoleGame() == true
local self = LUI.UIElement.new()
self.id = "killstreakInfoHud"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
height = 380,
right = 0,
width = 150,
alpha = 1
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "inactive", {
alpha = 0
} )
self:registerEventHandler( "show_ks_info", MBh.AnimateToState( "default", 0 ) )
self:registerEventHandler( "hide_ks_info", MBh.AnimateToState( "inactive", 0 ) )
if f18_local0 == false and not GameX.IsHardcoreMode() then
self:registerEventHandler( "hud_on", f0_local18 )
end
local f18_local2 = {
event = "killstreak_info_refresh",
group = "hud",
interval = 150
}
local f18_local3 = LUI.UITimer.new( f18_local2.interval, f18_local2.event, f18_local2.group )
f18_local3.id = "killstreakRefreshTimer"
local f18_local4 = LUI.UIText.new()
f18_local4.id = "killstreakInfoKillstreakName"
f18_local4:setText( "" )
f18_local4:setTextStyle( CoD.TextStyle.Shadowed )
f18_local4:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = -15,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
right = -500,
width = 400,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right,
alpha = 0
} )
f18_local4:animateToState( "default", 0 )
f18_local4:registerAnimationState( "slide_in", {
bottomAnchor = true,
rightAnchor = true,
bottom = -15,
right = -258,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 400,
alpha = 1
} )
f18_local4:registerAnimationState( "blink_off", {
bottomAnchor = true,
rightAnchor = true,
bottom = -15,
right = -258,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 400,
alpha = 0
} )
f18_local4:registerAnimationState( "blink_on", {
bottomAnchor = true,
rightAnchor = true,
bottom = -15,
right = -258,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 400,
alpha = 1
} )
f18_local4:registerOmnvarHandler( "ui_killstreak_scroll", f0_local17 )
local f18_local5 = LUI.UIElement.new()
f18_local5.id = "killstreakInfoHudId"
f18_local5:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = 0,
height = 256,
width = 64
} )
f18_local5:animateToState( "default", 0 )
f18_local5:addElement( f0_local28() )
f18_local5:addElement( f0_local24() )
f18_local5:addElement( f0_local26() )
f18_local5:addElement( f0_local23() )
f18_local5:addElement( f0_local27() )
f18_local5:addElement( f0_local25() )
if not GameX.IsHardcoreMode() then
self:addElement( f18_local3 )
self:addElement( f18_local4 )
self:addElement( f18_local5 )
else
self:addElement( f18_local4 )
end
return self
end )
LockTable( _M )

View File

@ -0,0 +1,734 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 750
f0_local1 = 100
f0_local2 = function ( f1_arg0, f1_arg1 )
local f1_local0 = ""
if f1_arg1.value == "waiting_for_teams" then
if not GameX.gameModeIsFFA() then
f1_local0 = Engine.Localize( "@MP_WAITING_FOR_TEAMS" )
else
f1_local0 = Engine.Localize( "@MP_WAITING_FOR_MORE_PLAYERS" )
end
elseif f1_arg1.value == "opponent_forfeiting_in" then
f1_local0 = Engine.Localize( "@MP_OPPONENT_FORFEITING_IN" )
elseif f1_arg1.value == "match_starting_in" then
f1_local0 = Engine.Localize( "@MP_MATCH_STARTING_IN" )
elseif f1_arg1.value == "match_resuming_in" then
f1_local0 = Engine.Localize( "@MP_MATCH_RESUMING_IN" )
elseif f1_arg1.value == "first_infected_in" then
f1_local0 = Engine.Localize( "@SPLASHES_INFECTED_STARTS_IN" )
end
f1_arg0:setText( f1_local0 )
end
local f0_local3 = function ( f2_arg0, f2_arg1 )
if f2_arg1.value > 0 then
if f2_arg0.current_state ~= "active" then
f2_arg0:animateToState( "active", 0 )
f2_arg0.current_state = "active"
f0_local2( f2_arg0:getChildById( "matchStartDesc" ), {
name = "ui_match_start_text",
value = Game.GetOmnvar( "ui_match_start_text" )
} )
end
elseif f2_arg0.current_state ~= "default" then
f2_arg0:animateToState( "default", 0 )
f2_arg0.current_state = "default"
return
end
local f2_local0 = f2_arg0:getChildById( "countdownContainer" )
local f2_local1 = f2_local0:getChildById( "countdownValueText" )
local f2_local2 = f2_arg0:getChildById( "ghostedCountdownContainer" )
local f2_local3 = f2_local2:getChildById( "ghostedCountdownValueText" )
f2_local1:setText( f2_arg1.value )
f2_local3:setText( f2_arg1.value )
local f2_local4 = MBh.AnimateSequence( {
{
"opening",
0
},
{
"active",
f0_local1
},
{
"active",
f0_local0
},
{
"default",
150
}
} )
f2_local4( f2_local0 )
f2_local4 = MBh.AnimateSequence( {
{
"default",
0
},
{
"default",
f0_local1
},
{
"active",
0
},
{
"closing",
350
}
} )
f2_local4( f2_local2 )
end
local f0_local4 = function ( f3_arg0, f3_arg1 )
if f3_arg1.value == -1 then
return
end
local f3_local0 = Game.GetPlayerTeam()
local f3_local1 = 0
if f3_local0 > 0 then
local f3_local2 = GameX.GetFactionName( f3_local0 )
local f3_local3 = f3_arg0:getChildById( "faction_icon_container" )
local f3_local4 = f3_local3:getChildById( "faction_icon" )
local f3_local5 = f3_arg0:getChildById( "faction_name_parent_container" )
local f3_local6 = f3_local5:getChildById( "faction_name_container" )
local f3_local7 = f3_local5:getChildById( "ghosted_faction_name_container" )
local f3_local8 = f3_local5:getChildById( "faction_name_glint" )
local f3_local9 = f3_local6:getChildById( "faction_name" )
local f3_local10 = f3_local7:getChildById( "ghosted_faction_name" )
CoD.SetMaterial( f3_local4, RegisterMaterial( Engine.TableLookup( FactionTable.File, FactionTable.Cols.Ref, f3_local2, FactionTable.Cols.FactionHudIcon ) ) )
local f3_local11 = Engine.Localize( "@" .. Engine.TableLookup( FactionTable.File, FactionTable.Cols.Ref, f3_local2, FactionTable.Cols.Name ) )
f3_local9:setText( f3_local11 )
f3_local10:setText( f3_local11 )
local f3_local12 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
125
},
{
"active",
0
},
{
"active",
2500
},
{
"leaving",
150
}
} )
f3_local12( f3_local3 )
f3_local12 = 1250
local f3_local13 = 150
local f3_local14 = MBh.AnimateSequence( {
{
"default",
0
},
{
"default",
500
},
{
"opening",
0
},
{
"active",
f3_local13
},
{
"active",
f3_local12
},
{
"default",
50
},
{
"default",
50
},
{
"active",
0
},
{
"active",
50
},
{
"default",
50
},
{
"default",
50
},
{
"active",
0
},
{
"active",
50
},
{
"default",
150
}
} )
f3_local14( f3_local6 )
f3_local14 = MBh.AnimateSequence( {
{
"default",
0
},
{
"default",
500
},
{
"default",
f3_local13
},
{
"active",
0
},
{
"closing",
350
}
} )
f3_local14( f3_local7 )
f3_local14 = MBh.AnimateSequence( {
{
"default",
0
},
{
"default",
500
},
{
"default",
f3_local13
},
{
"active",
0
},
{
"closing",
250
}
} )
f3_local14( f3_local8 )
f3_local1 = 2750
end
local f3_local2 = GameX.GetGameMode()
local f3_local3 = Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f3_local2, GameTypesTable.Cols.ObjectiveHintAttackers )
if f3_arg1.value == 1 then
f3_local3 = Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f3_local2, GameTypesTable.Cols.ObjectiveHintDefenders )
end
local f3_local4 = Engine.Localize( "@" .. f3_local3 )
local f3_local5 = f3_arg0:getChildById( "objective_container" )
local f3_local6 = f3_local5:getChildById( "objective_bg" )
local f3_local7 = f3_local5:getChildById( "objective_text" )
f3_local7:setText( f3_local4 )
local f3_local8 = MBh.AnimateSequence( {
{
"default",
0
},
{
"default",
f3_local1
},
{
"opening",
150
},
{
"active",
150
},
{
"active",
2000
},
{
"default",
250
}
} )
f3_local8( f3_local5 )
f3_arg0:animateToState( "active", 0 )
end
function matchStartHudDef()
local self = LUI.UIElement.new()
self.id = "matchStartHud"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = -32,
bottom = 32,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
alpha = 1
} )
self:registerOmnvarHandler( "ui_match_start_countdown", f0_local3 )
local f4_local1 = LUI.UIText.new()
f4_local1.id = "matchStartDesc"
f4_local1:setText( "" )
f4_local1:setTextStyle( CoD.TextStyle.Shadowed )
f4_local1:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = -20,
height = CoD.TextSettings.HudEuroBigFont.Height,
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.HudEuroBigFont.Font,
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b
} )
f4_local1:animateToState( "default", 0 )
local f4_local2 = CoD.TextSettings.HudDigitalExtraBigFont.Height * 0.5
local f4_local3 = 128
local f4_local4 = LUI.UIElement.new()
f4_local4.id = "countdownContainer"
f4_local4:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f4_local2,
left = -f4_local3,
bottom = f4_local2,
right = f4_local3,
alpha = 0
} )
f4_local4:animateToState( "default", 0 )
f4_local4:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f4_local2 * 10,
left = -f4_local3 * 10,
bottom = f4_local2 * 10,
right = f4_local3 * 10,
alpha = 0
} )
f4_local4:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f4_local2,
left = -f4_local3,
bottom = f4_local2,
right = f4_local3,
alpha = 1
} )
local f4_local5 = LUI.UIText.new()
f4_local5.id = "countdownValueText"
f4_local5:setText( "" )
f4_local5:setTextStyle( CoD.TextStyle.Shadowed )
f4_local5:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
font = CoD.TextSettings.HudDigitalExtraBigFont.Font,
alignment = LUI.Alignment.Center
} )
f4_local5:animateToState( "default", 0 )
f4_local4:addElement( f4_local5 )
local f4_local6 = LUI.UIElement.new()
f4_local6.id = "ghostedCountdownContainer"
f4_local6:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f4_local2,
left = -f4_local3,
bottom = f4_local2,
right = f4_local3,
alpha = 0
} )
f4_local6:animateToState( "default", 0 )
f4_local6:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f4_local2,
left = -f4_local3,
bottom = f4_local2,
right = f4_local3,
alpha = 0.75
} )
f4_local6:registerAnimationState( "closing", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f4_local2 * 2,
left = -f4_local3 * 2,
bottom = f4_local2 * 2,
right = f4_local3 * 2,
alpha = 0
} )
local f4_local7 = LUI.UIText.new()
f4_local7.id = "ghostedCountdownValueText"
f4_local7:setText( "" )
f4_local7:setTextStyle( CoD.TextStyle.Shadowed )
f4_local7:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
font = CoD.TextSettings.HudDigitalExtraBigFont.Font,
alignment = LUI.Alignment.Center
} )
f4_local7:animateToState( "default", 0 )
f4_local6:addElement( f4_local7 )
self:addElement( f4_local1 )
self:addElement( f4_local6 )
self:addElement( f4_local4 )
return self
end
local f0_local5 = function ()
local f5_local0 = RegisterMaterial( "white" )
local f5_local1 = RegisterMaterial( "pointflash" )
local f5_local2 = RegisterMaterial( "kk_lowbar" )
local self = LUI.UIElement.new()
self.id = "matchStartObjectiveHud"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
height = 128,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
alpha = 1
} )
self:registerOmnvarHandler( "ui_objective_text", f0_local4 )
local f5_local4 = -30
local f5_local5 = LUI.UIElement.new()
f5_local5.id = "faction_icon_container"
f5_local5:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -640 - f5_local4,
left = -640,
bottom = 640 - f5_local4,
right = 640,
alpha = 0
} )
f5_local5:animateToState( "default", 0 )
f5_local5:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -6.4 - f5_local4,
left = -6.4,
bottom = 6.4 - f5_local4,
right = 6.4,
alpha = 1
} )
f5_local5:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -64 - f5_local4,
left = -64,
bottom = 64 - f5_local4,
right = 64,
alpha = 1
} )
f5_local5:registerAnimationState( "leaving", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 0 - f5_local4,
left = 0,
bottom = 0 - f5_local4,
right = 0,
alpha = 0
} )
local f5_local6 = LUI.UIImage.new()
f5_local6.id = "faction_icon"
f5_local6:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f5_local0
} )
f5_local6:animateToState( "default", 0 )
f5_local5:addElement( f5_local6 )
local f5_local7 = LUI.UIElement.new()
f5_local7.id = "faction_name_parent_container"
f5_local7:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = -CoD.TextSettings.HudEuroBigFont.Height - f5_local4 + 30,
left = -128,
height = CoD.TextSettings.HudEuroBigFont.Height,
width = 256
} )
f5_local7:animateToState( "default", 0 )
local f5_local8 = LUI.UIImage.new()
f5_local8.id = "faction_name_glint"
f5_local8:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -128,
left = -128,
bottom = 128,
right = 128,
material = f5_local1,
alpha = 0
} )
f5_local8:animateToState( "default", 0 )
f5_local8:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -128,
left = -128,
bottom = 128,
right = 128,
material = f5_local1,
alpha = 1
} )
f5_local8:registerAnimationState( "closing", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 256,
left = -640,
bottom = -256,
right = 640,
material = f5_local1,
alpha = 0
} )
local f5_local9 = CoD.TextSettings.HudEuroBigFont.Height * 0.5
local f5_local10 = 128
local f5_local11 = LUI.UIElement.new()
f5_local11.id = "faction_name_container"
f5_local11:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local9,
left = -f5_local10,
bottom = f5_local9,
right = f5_local10,
alpha = 0
} )
f5_local11:animateToState( "default", 0 )
f5_local11:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local9 * 10,
left = -f5_local10 * 10,
bottom = f5_local9 * 10,
right = f5_local10 * 10,
alpha = 0
} )
f5_local11:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local9,
left = -f5_local10,
bottom = f5_local9,
right = f5_local10,
alpha = 1
} )
local f5_local12 = LUI.UIText.new()
f5_local12.id = "faction_name"
f5_local12:setText( "" )
f5_local12:setTextStyle( CoD.TextStyle.Shadowed )
f5_local12:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
font = CoD.TextSettings.HudEuroBigFont.Font,
alignment = LUI.Alignment.Center,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b
} )
f5_local12:animateToState( "default", 0 )
f5_local11:addElement( f5_local12 )
local f5_local13 = LUI.UIElement.new()
f5_local13.id = "ghosted_faction_name_container"
f5_local13:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local9,
left = -f5_local10,
bottom = f5_local9,
right = f5_local10,
alpha = 0
} )
f5_local13:animateToState( "default", 0 )
f5_local13:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local9,
left = -f5_local10,
bottom = f5_local9,
right = f5_local10,
alpha = 0.75
} )
f5_local13:registerAnimationState( "closing", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local9 * 2,
left = -f5_local10 * 2,
bottom = f5_local9 * 2,
right = f5_local10 * 2,
alpha = 0
} )
local f5_local14 = LUI.UIText.new()
f5_local14.id = "ghosted_faction_name"
f5_local14:setText( "" )
f5_local14:setTextStyle( CoD.TextStyle.Shadowed )
f5_local14:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alignment = LUI.Alignment.Center
} )
f5_local14:animateToState( "default", 0 )
f5_local13:addElement( f5_local14 )
f5_local7:addElement( f5_local8 )
f5_local7:addElement( f5_local13 )
f5_local7:addElement( f5_local11 )
local f5_local15 = LUI.UIElement.new()
f5_local15.id = "objective_container"
f5_local15:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = -128,
height = 128,
alpha = 0
} )
f5_local15:animateToState( "default", 0 )
f5_local15:registerAnimationState( "opening", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = -15,
height = 153.6,
alpha = 1
} )
f5_local15:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = -15,
height = 128,
alpha = 1
} )
local f5_local16 = LUI.UIImage.new()
f5_local16.id = "objective_bg"
f5_local16:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = -128,
height = -128,
material = f5_local2,
alpha = 0.5
} )
f5_local16:animateToState( "default", 0 )
local f5_local17 = 40
local f5_local18 = LUI.UIText.new()
f5_local18.id = "objective_text"
f5_local18:setText( "" )
f5_local18:setTextStyle( CoD.TextStyle.Shadowed )
f5_local18:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = -CoD.TextSettings.HudEuroBigFont.Height - f5_local17,
height = CoD.TextSettings.HudEuroBigFont.Height,
font = CoD.TextSettings.HudEuroBigFont.Font,
alignment = LUI.Alignment.Center,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b
} )
f5_local18:animateToState( "default", 0 )
f5_local15:addElement( f5_local16 )
f5_local15:addElement( f5_local18 )
self:addElement( f5_local5 )
self:addElement( f5_local7 )
self:addElement( f5_local15 )
return self
end
LUI.MenuBuilder.registerType( "matchStartHudDef", matchStartHudDef )
LUI.MenuBuilder.registerType( "matchStartObjectiveHudDef", f0_local5 )
LockTable( _M )

View File

@ -0,0 +1,290 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 250
f0_local1 = 250
f0_local2 = 250
local f0_local3 = 1000
local f0_local4 = 750
local f0_local5 = 250
local f0_local6 = 230.4
local f0_local7 = 460.8
local f0_local8 = function ( f1_arg0, f1_arg1 )
if f1_arg0.current_state ~= "active" then
f1_arg0:animateToState( "active", f0_local0 )
f1_arg0.current_state = "active"
end
end
local f0_local9 = function ( f2_arg0, f2_arg1 )
if f2_arg0.current_state ~= "default" then
f2_arg0:animateToState( "default", 0 )
f2_arg0.current_state = "default"
end
end
LUI.MenuBuilder.registerType( "minimapHudDef", function ()
local f3_local0 = RegisterMaterial( "hud_minimap_border" )
local f3_local1 = 140
local f3_local2 = 268
local f3_local3 = 15
local f3_local4 = 13
local self = LUI.UIElement.new()
self.id = "minimapHud"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
height = f0_local6,
width = f0_local7
} )
self:animateToState( "default", 0 )
local f3_local6 = LUI.UIImage.new()
f3_local6.id = "minimapBorder"
f3_local6:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
height = 0,
material = f3_local0,
alpha = 1
} )
f3_local6:animateToState( "default", 0 )
f3_local6:registerAnimationState( "active", {
height = f0_local6
} )
f3_local6:registerAnimationState( "opening", {
height = f0_local6 + 40
} )
f3_local6:registerEventHandler( "hud_off", f0_local9 )
f3_local6:registerEventHandler( "hud_on", MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
f0_local0 / 2
},
{
"active",
f0_local0 / 2
}
} ) )
self:addElement( f3_local6 )
local f3_local7 = LUI.MenuBuilder.BuildAddChild
local f3_local8 = self
local f3_local9 = {
type = "UIMinimap",
id = "minimap",
states = {
default = {
topAnchor = true,
leftAnchor = true,
top = f3_local3,
left = f3_local4,
height = f3_local1,
width = f3_local2,
alpha = 0
},
active = {
alpha = 0.5
},
nosignal = {
alpha = 0.05
}
}
}
local f3_local10 = {
hud_off = function ( f4_arg0, f4_arg1 )
f0_local9( f4_arg0, f4_arg1 )
f4_arg0:dispatchEventToChildren( f4_arg1 )
end,
hud_on = function ( f5_arg0, f5_arg1 )
f5_arg0:dispatchEventToChildren( f5_arg1 )
local f5_local0 = MBh.AnimateSequence( {
{
"default",
0
},
{
"default",
f0_local0
},
{
"active",
f0_local1
}
} )
f5_local0( f5_arg0 )
end
}
local f3_local11 = MBh.AnimateSequence
local f3_local12 = {}
local f3_local13 = {
"active",
0
}
local f3_local14 = {}
local f3_local15 = "default"
local f3_local16 = math.random( 10, 50 )
f3_local14 = f3_local15
f3_local15 = {}
f3_local16 = "active"
local f3_local17 = math.random( 10, 50 )
f3_local15 = f3_local16
f3_local16 = {}
f3_local17 = "default"
local f3_local18 = math.random( 10, 50 )
f3_local16 = f3_local17
f3_local17 = {}
f3_local18 = "active"
local f3_local19 = math.random( 10, 50 )
f3_local17 = f3_local18
f3_local18 = {}
f3_local19 = "default"
local f3_local20 = math.random( 10, 50 )
f3_local18 = f3_local19
f3_local19 = {}
f3_local20 = "active"
local f3_local21 = math.random( 10, 50 )
f3_local19 = f3_local20
f3_local20 = {}
f3_local21 = "default"
local f3_local22 = math.random( 50, 100 )
f3_local20 = f3_local21
f3_local21 = {
"active",
250
}
f3_local12[1] = f3_local13
f3_local12[2] = f3_local14
f3_local12[3] = f3_local15
f3_local12[4] = f3_local16
f3_local12[5] = f3_local17
f3_local12[6] = f3_local18
f3_local12[7] = f3_local19
f3_local12[8] = f3_local20
f3_local12[9] = f3_local21
f3_local10.hud_shake = f3_local11( f3_local12 )
f3_local10.hud_nosignal_on = MBh.AnimateToState( "nosignal", 0.25 )
f3_local10.hud_nosignal_off = MBh.AnimateToState( "active", 0.25 )
f3_local9.handlers = f3_local10
f3_local9.children = {
{
type = "jammerEffectStaticDef",
id = "minimapStatic"
},
{
type = "jammerEffectArtifactDef",
id = "minimapArtifact"
},
{
type = "jammerEffectNoSignalDef",
id = "minimapNoSignal"
}
}
f3_local7( f3_local8, f3_local9 )
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIMinimapIcons",
id = "minimapIcons",
properties = {
drawPlayer = true
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = f3_local3,
left = f3_local4,
height = f3_local1,
width = f3_local2,
alpha = 0
},
active = {
alpha = 1
},
nosignal = {
alpha = 0
},
static = {
alpha = 0.25
}
},
handlers = {
hud_off = f0_local9,
hud_on = MBh.AnimateSequence( {
{
"default",
0
},
{
"default",
f0_local0 + f0_local1
},
{
"active",
f0_local2
}
} ),
hud_nosignal_on = MBh.AnimateToState( "nosignal", 0.25 ),
hud_nosignal_off = MBh.AnimateToState( "active", 0.25 ),
hud_static = MBh.AnimateToState( "static", 0.25 )
}
} )
LUI.MenuBuilder.BuildAddChild( self, {
type = "UICompass",
id = "minimapCompass",
states = {
default = {
topAnchor = true,
leftAnchor = true,
top = 15,
left = 17,
height = 10,
width = f3_local2 - 7,
material = RegisterMaterial( "minimap_tickertape_mp" ),
alpha = 0
},
active = {
alpha = 1
},
nosignal = {
alpha = 0.05
}
},
handlers = {
hud_off = f0_local9,
hud_on = MBh.AnimateSequence( {
{
"default",
0
},
{
"default",
f0_local0 + f0_local1 + f0_local2
},
{
"active",
f0_local3,
true,
true
}
} ),
hud_nosignal_on = MBh.AnimateToState( "nosignal", 0.25 ),
hud_nosignal_off = MBh.AnimateToState( "active", 0.25 )
}
} )
self:addElement( LUI.MenuBuilder.buildItems( {
type = "talkerHudDef"
}, self.properties, self ) )
return self
end )
LockTable( _M )

2227
lui/mp_hud/mlghud.dec.lua Normal file

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,522 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 0
f0_local1 = function ( f1_arg0 )
local self = LUI.UIElement.new( {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 0,
right = -20,
height = 0,
width = 512,
alpha = 0,
alignment = LUI.Alignment.Right,
spacing = 0
} )
self.id = "obitItemElemId"
self:registerAnimationState( "opening", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 0,
right = -20,
height = CoD.TextSettings.HudEuroMedSmallFont.Height + 10,
width = 512,
alpha = 1
} )
self:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 0,
right = -20,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 512,
alpha = 0.5
} )
self:animateToState( "default", 0 )
self:registerEventHandler( "menu_create", MBh.AnimateSequenceAndClose( {
{
"default",
0
},
{
"opening",
75
},
{
"active",
75
},
{
"active",
5000
},
{
"default",
250
}
} ) )
self:registerEventHandler( "menu_close", MBh.AnimateSequenceAndClose( {
{
"active",
0
},
{
"default",
250
}
} ) )
return self
end
f0_local2 = function ( f2_arg0 )
local self = LUI.UIHorizontalList.new( {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
alignment = LUI.Alignment.Right,
spacing = 0
} )
self.id = "obitItemHLId"
self:animateToState( "default", 0 )
return self
end
local f0_local3 = function ( f3_arg0 )
local f3_local0 = Game.GetPlayerName( f3_arg0.victim )
local self = LUI.UIText.new( {
topAnchor = true,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
right = 0,
width = 200,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b
} )
self.id = "obitVictimTextId"
self:setText( f3_local0 )
self:setTextStyle( CoD.TextStyle.Shadowed )
self:animateToState( "default", 0 )
local f3_local2, f3_local3, f3_local4, f3_local5 = GetTextDimensions( f3_local0, CoD.TextSettings.HudEuroMedSmallFont.Font, CoD.TextSettings.HudEuroMedSmallFont.Height )
local f3_local6 = f3_local4 - f3_local2
self:registerAnimationState( "me", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
right = 0,
width = f3_local6,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b
} )
self:registerAnimationState( "friendly", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
right = 0,
width = f3_local6,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = Colors.cyan.r,
green = Colors.cyan.g,
blue = Colors.cyan.b
} )
self:registerAnimationState( "enemy", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
right = 0,
width = f3_local6,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = Colors.orange.r,
green = Colors.orange.g,
blue = Colors.orange.b
} )
local f3_local7 = Game.GetPlayerTeam()
if MLG.IsMLGSpectator() then
f3_local7 = Game.GetLastMLGSpectateTeam()
elseif f3_local7 == Teams.spectator then
f3_local7 = Game.GetPlayerTeam( Game.GetPlayerstateClientnum() )
end
if Game.GetPlayerTeam( f3_arg0.victim ) == f3_local7 then
if Game.GetPlayerClientnum() == f3_arg0.victim then
self:animateToState( "me", 0 )
elseif GameX.gameModeIsFFA() then
self:animateToState( "enemy", 0 )
else
self:animateToState( "friendly", 0 )
end
else
self:animateToState( "enemy", 0 )
end
return self
end
local f0_local4 = function ( f4_arg0 )
local f4_local0 = Game.GetPlayerName( f4_arg0.attacker )
local self = LUI.UIText.new( {
topAnchor = true,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
right = 0,
width = 200,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b
} )
self.id = "obitAttackerTextId"
self:setText( f4_local0 )
self:setTextStyle( CoD.TextStyle.Shadowed )
self:animateToState( "default", 0 )
local f4_local2, f4_local3, f4_local4, f4_local5 = GetTextDimensions( f4_local0, CoD.TextSettings.HudEuroMedSmallFont.Font, CoD.TextSettings.HudEuroMedSmallFont.Height )
local f4_local6 = f4_local4 - f4_local2
self:registerAnimationState( "friendly", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
right = 0,
width = f4_local6,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = Colors.cyan.r,
green = Colors.cyan.g,
blue = Colors.cyan.b
} )
self:registerAnimationState( "enemy", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
right = 0,
width = f4_local6,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = Colors.orange.r,
green = Colors.orange.g,
blue = Colors.orange.b
} )
local f4_local7 = Game.GetPlayerTeam()
if MLG.IsMLGSpectator() then
f4_local7 = Game.GetLastMLGSpectateTeam()
elseif f4_local7 == Teams.spectator then
f4_local7 = Game.GetPlayerTeam( Game.GetPlayerstateClientnum() )
end
if Game.GetPlayerTeam( f4_arg0.attacker ) == f4_local7 then
if Game.GetPlayerClientnum() == f4_arg0.attacker then
self:animateToState( "default", 0 )
elseif GameX.gameModeIsFFA() then
self:animateToState( "enemy", 0 )
else
self:animateToState( "friendly", 0 )
end
else
self:animateToState( "enemy", 0 )
end
return self
end
local f0_local5 = function ( menu, controller )
local self = LUI.UIElement.new( {
topAnchor = true,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
top = 0,
right = 0,
width = 5
} )
self.id = "obitSpacer" .. controller
self:animateToState( "default", 0 )
return self
end
local f0_local6 = function ( f6_arg0 )
local f6_local0 = CoD.TextSettings.HudEuroBigFont.Height * Engine.GetMaterialAspectRatio( f6_arg0.icon )
local self = LUI.UIImage.new( {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = -CoD.TextSettings.HudEuroBigFont.Height / 2,
bottom = CoD.TextSettings.HudEuroBigFont.Height / 2,
right = 0,
width = f6_local0,
material = f6_arg0.icon
} )
self.id = "obitWeaponImageId"
if f6_arg0.flip then
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = -CoD.TextSettings.HudEuroBigFont.Height / 2,
bottom = CoD.TextSettings.HudEuroBigFont.Height / 2,
right = 0,
width = -f6_local0,
material = f6_arg0.icon
} )
end
self:animateToState( "default", 0 )
return self
end
local f0_local7 = function ( f7_arg0 )
local self = LUI.UIElement.new( {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 0,
right = 0,
height = 0,
width = 512,
alpha = 0,
alignment = LUI.Alignment.Right,
spacing = 0
} )
self.id = "connectTextElemId"
self:registerAnimationState( "opening", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 0,
right = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height + 10,
width = 512,
alpha = 1
} )
self:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 0,
right = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 512,
alpha = 0.5
} )
self:animateToState( "default", 0 )
self:registerEventHandler( "menu_create", MBh.AnimateSequenceAndClose( {
{
"default",
0
},
{
"opening",
75
},
{
"active",
75
},
{
"active",
5000
},
{
"default",
250
}
} ) )
self:registerEventHandler( "menu_close", MBh.AnimateSequenceAndClose( {
{
"active",
0
},
{
"default",
250
}
} ) )
local f7_local1 = LUI.UIText.new( {
topAnchor = true,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
right = -20,
width = 512,
alignment = LUI.Alignment.Right,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b
} )
f7_local1.id = "connectTextId"
f7_local1:setText( f7_arg0.message )
f7_local1:setTextStyle( CoD.TextStyle.Shadowed )
self:addElement( f7_local1 )
return self
end
local f0_local8 = function ( f8_arg0, f8_arg1 )
local f8_local0 = nil
if f8_arg1.name == "obituary" then
local f8_local1
if f8_arg1.attacker == nil or f8_arg1.attacker == f8_arg1.victim then
f8_local1 = false
else
f8_local1 = true
end
local f8_local2 = ""
if f8_local1 then
f8_local2 = Game.GetPlayerName( f8_arg1.attacker )
end
local f8_local3 = Game.GetPlayerName( f8_arg1.victim )
f8_local0 = f0_local1( f8_arg1 )
local f8_local4 = f0_local2( f8_arg1 )
f8_local0:addElement( f8_local4 )
f8_local4:addElement( f0_local3( f8_arg1 ) )
f8_local4:addElement( f0_local5( f8_arg1, 1 ) )
f8_local4:addElement( f0_local6( f8_arg1 ) )
f8_local4:addElement( f0_local5( f8_arg1, 2 ) )
if f8_local1 then
f8_local4:addElement( f0_local4( f8_arg1 ) )
end
elseif f8_arg1.bold ~= nil and f8_arg1.bold == false and f8_arg1.message ~= nil then
f8_local0 = f0_local7( f8_arg1 )
end
if f8_local0 ~= nil then
f8_local0:processEvent( {
name = "menu_create"
} )
f8_local0.id = "obitElemId" .. f0_local0
f0_local0 = f0_local0 + 1
local f8_local1 = f8_arg0:getFirstChild()
if f8_local1 then
LUI.UIElement.addElementBefore( f8_local0, f8_local1 )
else
LUI.UIElement.addElement( f8_arg0, f8_local0 )
end
end
local f8_local1 = f8_arg0:getNumChildren()
local f8_local2 = f8_arg0:getLastChild()
if f8_local2 and f8_local1 > 4 then
f8_local2:processEvent( {
name = "menu_close"
} )
f8_local1 = f8_local1 - 1
while f8_local1 > 4 do
local f8_local3 = f8_local2:getPreviousSibling()
if f8_local3 then
f8_local3:processEvent( {
name = "menu_close"
} )
end
f8_local1 = f8_local1 - 1
end
end
end
function obituaryHudDef()
local self = LUI.UIElement.new()
self.id = "obituaryHudId"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 60,
right = 0,
height = 256,
width = 256,
alpha = 1
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "inactive", {
alpha = 0
} )
local f9_local1 = LUI.UIVerticalList.new( {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
spacing = 3,
alignment = MLG.IsMLGSpectator() and LUI.Alignment.Bottom or nil
} )
f9_local1.id = "obituaryVLId"
f9_local1:registerAnimationState( "showrival", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 15,
left = 0,
bottom = 0,
right = 0,
spacing = 3
} )
f9_local1:animateToState( "default", 0 )
f9_local1:registerEventHandler( "obituary", f0_local8 )
f9_local1:registerEventHandler( "game_message", f0_local8 )
f9_local1:registerEventHandler( "open_rival_info", MBh.AnimateSequence( {
{
"default",
0
},
{
"showrival",
62.5
}
} ) )
f9_local1:registerEventHandler( "close_rival_info", MBh.AnimateSequence( {
{
"showrival",
0
},
{
"showrival",
187.5
},
{
"default",
62.5
}
} ) )
self:addElement( f9_local1 )
return self
end
LUI.MenuBuilder.registerType( "obituaryHudDef", obituaryHudDef )
LockTable( _M )

View File

@ -0,0 +1,807 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 512
f0_local1 = 512
f0_local2 = 1
local f0_local3 = 2
local f0_local4 = -1
local f0_local5 = -2
local f0_local6 = -2
local f0_local7 = -3
local f0_local8 = function ( f1_arg0, f1_arg1 )
local f1_local0 = "@KILLSTREAKS_ODIN_SUPPORT"
local f1_local1 = "@KILLSTREAKS_ODIN_ASSAULT"
local f1_local2 = "@PLATFORM_ODIN_SMOKE"
local f1_local3 = "@PLATFORM_ODIN_AIRDROP"
local f1_local4 = "@PLATFORM_ODIN_MARKING"
local f1_local5 = "@PLATFORM_ODIN_JUGGERNAUT"
local f1_local6 = "@PLATFORM_ODIN_LARGE_ROD"
local f1_local7 = "@PLATFORM_ODIN_SMALL_ROD"
local f1_local8 = "@LUA_MENU_RECHARGING"
if f1_arg1.value == f0_local2 or f1_arg1.value == f0_local3 then
f1_arg0:animateToState( "active", 0 )
if f1_arg1.value == f0_local2 then
local f1_local9 = f1_arg0:getChildById( "odin_text_bits" )
f1_local9 = f1_local9:getChildById( "name_text" )
f1_local9:setText( Engine.Localize( f1_local0 ) )
elseif f1_arg1.value == f0_local3 then
local f1_local9 = f1_arg0:getChildById( "odin_text_bits" )
f1_local9 = f1_local9:getChildById( "name_text" )
f1_local9:setText( Engine.Localize( f1_local1 ) )
end
local f1_local9 = f1_arg0:getChildById( "odinControlsLeftId" )
local f1_local10 = f1_local9:getChildById( "odinControlsLeftVLId" )
local f1_local11 = f1_arg0:getChildById( "odinControlsRightId" )
local f1_local12 = f1_local11:getChildById( "odinControlsRightVLId" )
local f1_local13 = f1_local10:getChildById( "smokeTextId" )
local f1_local14 = f1_local10:getChildById( "airdropTextId" )
local f1_local15 = f1_local12:getChildById( "markingTextId" )
local f1_local16 = f1_local12:getChildById( "juggernautTextId" )
local f1_local17 = Game.GetOmnvar( "ui_odin_smoke_ammo" )
local f1_local18 = Game.GetOmnvar( "ui_odin_airdrop_ammo" )
local f1_local19 = Game.GetOmnvar( "ui_odin_marking_ammo" )
local f1_local20 = Game.GetOmnvar( "ui_odin_juggernaut_ammo" )
if f1_arg1.value == f0_local2 then
f1_local13:setText( Engine.Localize( f1_local2 ) )
f1_local13.current_state = "smoke"
f1_local14:setText( Engine.Localize( f1_local3 ) )
f1_local14.current_state = "airdrop"
f1_local15:setText( Engine.Localize( f1_local4 ) )
f1_local15.current_state = "marking"
f1_local16:setText( Engine.Localize( f1_local5 ) )
f1_local16.current_state = "juggernaut"
if f1_arg1.name == "init_overlay" then
if f1_local17 == f0_local4 then
f1_local13:setText( Engine.Localize( f1_local8 ) )
f1_local13:processEvent( {
name = "flashing"
} )
f1_local13.current_state = "recharging"
end
if f1_local18 == f0_local4 then
f1_local14:setText( Engine.Localize( f1_local8 ) )
f1_local14:processEvent( {
name = "flashing"
} )
f1_local14.current_state = "recharging"
end
if f1_local19 == f0_local4 then
f1_local15:setText( Engine.Localize( f1_local8 ) )
f1_local15:processEvent( {
name = "flashing"
} )
f1_local15.current_state = "recharging"
end
if f1_local20 == f0_local4 then
f1_local16:setText( Engine.Localize( f1_local8 ) )
f1_local16:processEvent( {
name = "flashing"
} )
f1_local16.current_state = "recharging"
end
end
elseif f1_arg1.value == f0_local3 then
f1_local13:setText( Engine.Localize( f1_local7 ) )
f1_local13.current_state = "small_rod"
f1_local14:setText( Engine.Localize( f1_local3 ) )
f1_local14.current_state = "airdrop"
f1_local15:setText( Engine.Localize( f1_local6 ) )
f1_local15.current_state = "large_rod"
f1_local16:setText( Engine.Localize( f1_local5 ) )
f1_local16.current_state = "juggernaut"
if f1_arg1.name == "init_overlay" then
if f1_local17 == f0_local5 then
f1_local13:setText( Engine.Localize( f1_local8 ) )
f1_local13:processEvent( {
name = "flashing"
} )
f1_local13.current_state = "recharging"
end
if f1_local18 == f0_local4 then
f1_local14:setText( Engine.Localize( f1_local8 ) )
f1_local14:processEvent( {
name = "flashing"
} )
f1_local14.current_state = "recharging"
end
if f1_local19 == f0_local5 then
f1_local15:setText( Engine.Localize( f1_local8 ) )
f1_local15:processEvent( {
name = "flashing"
} )
f1_local15.current_state = "recharging"
end
if f1_local20 == f0_local4 then
f1_local16:setText( Engine.Localize( f1_local8 ) )
f1_local16:processEvent( {
name = "flashing"
} )
f1_local16.current_state = "recharging"
end
end
end
local f1_local21 = MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
150
}
} )
f1_local21( f1_local9 )
f1_local21 = MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
150
}
} )
f1_local21( f1_local11 )
f1_local21 = f1_arg0:getChildById( "odinOverlayGrainId" )
local f1_local22 = MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
1000
}
} )
f1_local22( f1_local21 )
else
f1_arg0:animateToState( "default", 0 )
end
end
local f0_local9 = function ( f2_arg0, f2_arg1 )
local f2_local0 = "@PLATFORM_ODIN_SMOKE"
local f2_local1 = "@PLATFORM_ODIN_SMALL_ROD"
local f2_local2 = "@LUA_MENU_RECHARGING"
local f2_local3 = f2_arg0:getChildById( "odinControlsLeftId" )
local f2_local4 = f2_local3:getChildById( "odinControlsLeftVLId" )
local f2_local5 = f2_local4:getChildById( "smokeTextId" )
if f2_arg1.value == f0_local2 then
f2_local5:setText( Engine.Localize( f2_local0 ) )
f2_local5:processEvent( {
name = "stop_flashing"
} )
f2_local5.current_state = "smoke"
elseif f2_arg1.value == f0_local3 then
f2_local5:setText( Engine.Localize( f2_local1 ) )
f2_local5:processEvent( {
name = "stop_flashing"
} )
f2_local5.current_state = "small_rod"
else
f2_local5:setText( Engine.Localize( f2_local2 ) )
f2_local5:processEvent( {
name = "flashing"
} )
if f2_arg1.value == f0_local5 then
local f2_local6 = f2_arg0:getChildById( "odinOverlayGrainId" )
local f2_local7 = MBh.AnimateSequence( {
{
"fired",
0
},
{
"active",
250
}
} )
f2_local7( f2_local6 )
end
f2_local5.current_state = "recharging"
end
end
local f0_local10 = function ( f3_arg0, f3_arg1 )
local f3_local0 = "@PLATFORM_ODIN_AIRDROP"
local f3_local1 = "@LUA_MENU_RECHARGING"
local f3_local2 = f3_arg0:getChildById( "odinControlsLeftId" )
local f3_local3 = f3_local2:getChildById( "odinControlsLeftVLId" )
local f3_local4 = f3_local3:getChildById( "airdropTextId" )
if f3_arg1.value == f0_local2 or f3_arg1.value == f0_local3 then
f3_local4:setText( Engine.Localize( f3_local0 ) )
f3_local4:processEvent( {
name = "stop_flashing"
} )
f3_local4.current_state = "airdrop"
else
f3_local4:setText( Engine.Localize( f3_local1 ) )
f3_local4:processEvent( {
name = "flashing"
} )
f3_local4.current_state = "recharging"
end
end
local f0_local11 = function ( f4_arg0, f4_arg1 )
local f4_local0 = "@PLATFORM_ODIN_MARKING"
local f4_local1 = "@PLATFORM_ODIN_LARGE_ROD"
local f4_local2 = "@LUA_MENU_RECHARGING"
local f4_local3 = f4_arg0:getChildById( "odinControlsRightId" )
local f4_local4 = f4_local3:getChildById( "odinControlsRightVLId" )
local f4_local5 = f4_local4:getChildById( "markingTextId" )
if f4_arg1.value == f0_local2 then
f4_local5:setText( Engine.Localize( f4_local0 ) )
f4_local5:processEvent( {
name = "stop_flashing"
} )
f4_local5.current_state = "marking"
elseif f4_arg1.value == f0_local3 then
f4_local5:setText( Engine.Localize( f4_local1 ) )
f4_local5:processEvent( {
name = "stop_flashing"
} )
f4_local5.current_state = "large_rod"
else
f4_local5:setText( Engine.Localize( f4_local2 ) )
f4_local5:processEvent( {
name = "flashing"
} )
if f4_arg1.value == f0_local5 then
local f4_local6 = f4_arg0:getChildById( "odinOverlayGrainId" )
local f4_local7 = MBh.AnimateSequence( {
{
"fired",
0
},
{
"active",
250
}
} )
f4_local7( f4_local6 )
end
f4_local5.current_state = "recharging"
end
end
local f0_local12 = function ( f5_arg0, f5_arg1 )
local f5_local0 = "@PLATFORM_ODIN_JUGGERNAUT"
local f5_local1 = "@PLATFORM_ODIN_JUGGERNAUT_MOVE"
local f5_local2 = "@LUA_MENU_ODIN_JUGGERNAUT_DEAD"
local f5_local3 = "@LUA_MENU_RECHARGING"
local f5_local4 = f5_arg0:getChildById( "odinControlsRightId" )
local f5_local5 = f5_local4:getChildById( "odinControlsRightVLId" )
local f5_local6 = f5_local5:getChildById( "juggernautTextId" )
if f5_arg1.value == f0_local6 then
f5_local6:setText( Engine.Localize( f5_local1 ) )
f5_local6:processEvent( {
name = "stop_flashing"
} )
f5_local6.current_state = "move"
elseif f5_arg1.value == f0_local7 then
f5_local6:setText( Engine.Localize( f5_local2 ) )
f5_local6:processEvent( {
name = "stop_flashing"
} )
f5_local6.current_state = "dead"
elseif f5_arg1.value == f0_local2 or f5_arg1.value == f0_local3 then
f5_local6:setText( Engine.Localize( f5_local0 ) )
f5_local6:processEvent( {
name = "stop_flashing"
} )
f5_local6.current_state = "juggernaut"
else
f5_local6:setText( Engine.Localize( f5_local3 ) )
f5_local6:processEvent( {
name = "flashing"
} )
f5_local6.current_state = "recharging"
end
end
local f0_local13 = function ( f6_arg0, f6_arg1 )
local f6_local0 = 364.77
local f6_local1 = 397.52
if not f6_arg0.current_alt_dir then
f6_arg0.current_alt_dir = 0.01
end
if not f6_arg0.current_alt then
f6_arg0.current_alt = math.random( f6_local0, f6_local1 )
end
if f6_arg0.current_alt < f6_local1 then
f6_arg0.current_alt_dir = math.random( 1, 100 ) * 0.01
else
f6_arg0.current_alt_dir = -math.random( 1, 100 ) * 0.01
end
f6_arg0.current_alt = f6_arg0.current_alt + f6_arg0.current_alt_dir
local f6_local2 = f6_arg0:getChildById( "altitude_text" )
f6_local2:setText( string.format( "%.2f", f6_arg0.current_alt ) )
end
local f0_local14 = function ( f7_arg0, f7_arg1 )
local f7_local0 = f7_arg0:getChildById( "position_text" )
f7_local0:setText( "61911." .. Game.GetTime() )
end
local f0_local15 = function ()
local f8_local0 = "@PLATFORM_ODIN_AIRDROP"
local f8_local1 = "@PLATFORM_ODIN_SMOKE"
local self = LUI.UIElement.new()
self.id = "odinControlsLeftId"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
left = -750,
top = -32,
bottom = 32,
width = 512,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
alpha = 1
} )
local f8_local3 = LUI.UIVerticalList.new()
f8_local3.id = "odinControlsLeftVLId"
f8_local3:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
spacing = 20
} )
f8_local3:animateToState( "default", 0 )
local f8_local4 = LUI.UIText.new()
f8_local4.id = "airdropTextId"
f8_local4:setText( f8_local0 )
f8_local4:setTextStyle( CoD.TextStyle.Shadowed )
f8_local4:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
left = 0,
right = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = 1,
green = 1,
blue = 1,
alignment = LUI.Alignment.Right,
alpha = 1
} )
f8_local4:animateToState( "default", 0 )
f8_local4:registerAnimationState( "flash1", {
red = 1,
green = 0,
blue = 0,
alpha = 0.5
} )
f8_local4:registerAnimationState( "flash2", {
red = 1,
green = 1,
blue = 1,
alpha = 0.25
} )
f8_local4:registerEventHandler( "flashing", MBh.AnimateLoop( {
{
"flash1",
250
},
{
"flash2",
250
}
} ) )
f8_local4:registerEventHandler( "stop_flashing", MBh.AnimateToState( "default", 0 ) )
local f8_local5 = LUI.UIText.new()
f8_local5.id = "smokeTextId"
f8_local5:setText( f8_local1 )
f8_local5:setTextStyle( CoD.TextStyle.Shadowed )
f8_local5:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
left = 0,
right = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = 1,
green = 1,
blue = 1,
alignment = LUI.Alignment.Right,
alpha = 1
} )
f8_local5:animateToState( "default", 0 )
f8_local5:registerAnimationState( "flash1", {
red = 1,
green = 0,
blue = 0,
alpha = 0.5
} )
f8_local5:registerAnimationState( "flash2", {
red = 1,
green = 1,
blue = 1,
alpha = 0.25
} )
f8_local5:registerEventHandler( "flashing", MBh.AnimateLoop( {
{
"flash1",
250
},
{
"flash2",
250
}
} ) )
f8_local5:registerEventHandler( "stop_flashing", MBh.AnimateToState( "default", 0 ) )
if Engine.IsPS3() then
f8_local3:addElement( f8_local5 )
f8_local3:addElement( f8_local4 )
else
f8_local3:addElement( f8_local4 )
f8_local3:addElement( f8_local5 )
end
self:addElement( f8_local3 )
return self
end
local f0_local16 = function ()
local f9_local0 = "@PLATFORM_ODIN_JUGGERNAUT"
local f9_local1 = "@PLATFORM_ODIN_MARKING"
local self = LUI.UIElement.new()
self.id = "odinControlsRightId"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
right = 750,
top = -32,
bottom = 32,
width = 512,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
alpha = 1
} )
local f9_local3 = LUI.UIVerticalList.new()
f9_local3.id = "odinControlsRightVLId"
f9_local3:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
spacing = 20
} )
f9_local3:animateToState( "default", 0 )
local f9_local4 = LUI.UIText.new()
f9_local4.id = "juggernautTextId"
f9_local4:setText( f9_local0 )
f9_local4:setTextStyle( CoD.TextStyle.Shadowed )
f9_local4:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
left = 0,
right = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = 1,
green = 1,
blue = 1,
alignment = LUI.Alignment.Left,
alpha = 1
} )
f9_local4:animateToState( "default", 0 )
f9_local4:registerAnimationState( "flash1", {
red = 1,
green = 0,
blue = 0,
alpha = 0.5
} )
f9_local4:registerAnimationState( "flash2", {
red = 1,
green = 1,
blue = 1,
alpha = 0.25
} )
f9_local4:registerEventHandler( "flashing", MBh.AnimateLoop( {
{
"flash1",
250
},
{
"flash2",
250
}
} ) )
f9_local4:registerEventHandler( "stop_flashing", MBh.AnimateToState( "default", 0 ) )
local f9_local5 = LUI.UIText.new()
f9_local5.id = "markingTextId"
f9_local5:setText( f9_local1 )
f9_local5:setTextStyle( CoD.TextStyle.Shadowed )
f9_local5:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
left = 0,
right = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = 1,
green = 1,
blue = 1,
alignment = LUI.Alignment.Left,
alpha = 1
} )
f9_local5:animateToState( "default", 0 )
f9_local5:registerAnimationState( "flash1", {
red = 1,
green = 0,
blue = 0,
alpha = 0.5
} )
f9_local5:registerAnimationState( "flash2", {
red = 1,
green = 1,
blue = 1,
alpha = 0.25
} )
f9_local5:registerEventHandler( "flashing", MBh.AnimateLoop( {
{
"flash1",
250
},
{
"flash2",
250
}
} ) )
f9_local5:registerEventHandler( "stop_flashing", MBh.AnimateToState( "default", 0 ) )
if Engine.IsPS3() then
f9_local3:addElement( f9_local5 )
f9_local3:addElement( f9_local4 )
else
f9_local3:addElement( f9_local4 )
f9_local3:addElement( f9_local5 )
end
self:addElement( f9_local3 )
return self
end
local f0_local17 = function ()
local self = LUI.UIElement.new()
self.id = "odin_text_bits"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true
} )
self:animateToState( "default", 0 )
self:registerEventHandler( "altitude_refresh", f0_local13 )
self:registerEventHandler( "position_refresh", f0_local14 )
local f10_local1 = LUI.UITimer.new( 1000, "altitude_refresh" )
f10_local1.id = "altitude_timer"
local f10_local2 = LUI.UITimer.new( 500, "position_refresh" )
f10_local2.id = "position_timer"
local f10_local3 = LUI.UIText.new()
f10_local3.id = "name_text"
f10_local3:setText( "" )
f10_local3:setTextStyle( CoD.TextStyle.Shadowed )
f10_local3:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 80,
right = -225,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 256,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = 1,
green = 1,
blue = 1,
alignment = LUI.Alignment.Right,
alpha = 1
} )
f10_local3:animateToState( "default", 0 )
local f10_local4 = LUI.UIText.new()
f10_local4.id = "location_text"
f10_local4:setText( Engine.Localize( "@MENU_LOCATION" ) .. Engine.Localize( "@" .. Engine.TableLookup( "mp/mapNames.csv", 0, Engine.GetDvarString( "ui_mapname" ), 1 ) ) )
f10_local4:setTextStyle( CoD.TextStyle.Shadowed )
f10_local4:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -82,
left = 225,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 256,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = 1,
green = 1,
blue = 1,
alignment = LUI.Alignment.Left,
alpha = 1
} )
f10_local4:animateToState( "default", 0 )
local f10_local5 = LUI.UIText.new()
f10_local5.id = "altitude_text"
f10_local5:setText( "" )
f10_local5:setTextStyle( CoD.TextStyle.Shadowed )
f10_local5:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -97,
right = -225,
height = CoD.TextSettings.HudDigitalSmallFont.Height,
width = 256,
font = CoD.TextSettings.HudDigitalSmallFont.Font,
red = 1,
green = 1,
blue = 1,
alignment = LUI.Alignment.Right,
alpha = 1
} )
f10_local5:animateToState( "default", 0 )
local f10_local6 = LUI.UIText.new()
f10_local6.id = "position_text"
f10_local6:setText( "8041.5679" )
f10_local6:setTextStyle( CoD.TextStyle.Shadowed )
f10_local6:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -82,
right = -225,
height = CoD.TextSettings.HudDigitalSmallFont.Height,
width = 256,
font = CoD.TextSettings.HudDigitalSmallFont.Font,
red = 1,
green = 1,
blue = 1,
alignment = LUI.Alignment.Right,
alpha = 1
} )
f10_local6:animateToState( "default", 0 )
self:addElement( f10_local1 )
self:addElement( f10_local2 )
self:addElement( f10_local3 )
self:addElement( f10_local5 )
self:addElement( f10_local4 )
self:addElement( f10_local6 )
return self
end
local f0_local18 = function ()
local f11_local0 = RegisterMaterial( "odin_overlay_grain" )
local self = LUI.UIElement.new()
self.id = "odinOverlayGrainId"
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:registerAnimationState( "active", {
alpha = 0.1
} )
self:registerAnimationState( "fired", {
alpha = 0.5
} )
local f11_local2 = LUI.UIImage.new()
f11_local2.id = "odinOverlayGrainImageId"
f11_local2:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f11_local0,
red = 0.9,
green = 1,
blue = 1
} )
f11_local2:animateToState( "default", 0 )
self:addElement( f11_local2 )
return self
end
local f0_local19 = function ( f12_arg0, f12_arg1 )
local f12_local0 = "@PLATFORM_ODIN_SMOKE"
local f12_local1 = "@PLATFORM_ODIN_AIRDROP"
local f12_local2 = "@PLATFORM_ODIN_MARKING"
local f12_local3 = "@PLATFORM_ODIN_JUGGERNAUT"
local f12_local4 = "@PLATFORM_ODIN_JUGGERNAUT_MOVE"
local f12_local5 = "@PLATFORM_ODIN_LARGE_ROD"
local f12_local6 = "@PLATFORM_ODIN_SMALL_ROD"
local f12_local7 = f12_arg0:getChildById( "odinControlsLeftId" )
local f12_local8 = f12_local7:getChildById( "odinControlsLeftVLId" )
local f12_local9 = f12_local8:getChildById( "airdropTextId" )
local f12_local10 = f12_local8:getChildById( "smokeTextId" )
if f12_local9.current_state and f12_local9.current_state == "airdrop" then
f12_local9:setText( Engine.Localize( f12_local1 ) )
end
if f12_local10.current_state then
if f12_local10.current_state == "smoke" then
f12_local10:setText( Engine.Localize( f12_local0 ) )
elseif f12_local10.current_state == "small_rod" then
f12_local10:setText( Engine.Localize( f12_local6 ) )
end
end
local f12_local11 = f12_arg0:getChildById( "odinControlsRightId" )
local f12_local12 = f12_local11:getChildById( "odinControlsRightVLId" )
local f12_local13 = f12_local12:getChildById( "juggernautTextId" )
local f12_local14 = f12_local12:getChildById( "markingTextId" )
if f12_local13.current_state then
if f12_local13.current_state == "juggernaut" then
f12_local13:setText( Engine.Localize( f12_local3 ) )
elseif f12_local13.current_state == "move" then
f12_local13:setText( Engine.Localize( f12_local4 ) )
end
end
if f12_local14.current_state then
if f12_local14.current_state == "marking" then
f12_local14:setText( Engine.Localize( f12_local2 ) )
elseif f12_local14.current_state == "large_rod" then
f12_local14:setText( Engine.Localize( f12_local5 ) )
end
end
end
LUI.MenuBuilder.registerType( "odinOverlayDef", function ()
local self = LUI.UIElement.new()
self.id = "odinOverlayContainerId"
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:registerEventHandler( "init_overlay", f0_local8 )
self:registerEventHandler( "refresh_controls", f0_local19 )
self:registerOmnvarHandler( "ui_odin", f0_local8 )
self:registerOmnvarHandler( "ui_odin_smoke_ammo", f0_local9 )
self:registerOmnvarHandler( "ui_odin_airdrop_ammo", f0_local10 )
self:registerOmnvarHandler( "ui_odin_marking_ammo", f0_local11 )
self:registerOmnvarHandler( "ui_odin_juggernaut_ammo", f0_local12 )
self:addElement( f0_local15() )
self:addElement( f0_local16() )
self:addElement( f0_local17() )
self:addElement( f0_local18() )
return self
end )
LockTable( _M )

View File

@ -0,0 +1,677 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function mpPauseMenuCreateHandler( f1_arg0, f1_arg1 )
f1_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
if GameX.IsOnlineMatch() and not GameX.IsSplitscreen() then
f1_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addFriendsButton )
end
end
function chooseClassButtonAction( f2_arg0, f2_arg1 )
LUI.FlowManager.RequestAddMenu( f2_arg0, "class_select_main", true, f2_arg1.controller )
end
function updateDescText( f3_arg0, f3_arg1 )
f3_arg0:setText( Engine.Localize( f3_arg1.string ) )
end
function mpMapHandler( f4_arg0, f4_arg1 )
local f4_local0 = f4_arg0:getChildById( "map_mini_id" )
local f4_local1 = f4_arg0:getChildById( "map_mini_icons_id" )
if GameX.IsHardcoreMode() or Game.IsEmpJammed() or Game.GetOmnvar( "ui_hud_static" ) > 0 or Game.GetOmnvar( "ui_hud_emp_artifact" ) or Game.InKillCam() or Game.GetOmnvar( "ui_session_state" ) == "dead" then
f4_local0:animateToState( "inactive", 0 )
f4_local1:animateToState( "inactive", 0 )
else
f4_local0:animateToState( "default", 0 )
f4_local1:animateToState( "default", 0 )
end
end
function changeTeamButtonAction( f5_arg0, f5_arg1 )
LUI.FlowManager.RequestAddMenu( f5_arg0, "team_select_main", true, f5_arg1.controller )
end
function mutePlayersButtonAction( f6_arg0, f6_arg1 )
LUI.FlowManager.RequestAddMenu( f6_arg0, "popup_mute_players", true, f6_arg1.controller )
end
function optionsButtonAction( f7_arg0, f7_arg1 )
if Engine.IsConsoleGame() then
LUI.FlowManager.RequestAddMenu( f7_arg0, "mp_in_game_controls_menu", true, f7_arg1.controller )
if GameX.IsSplitscreen() then
GameX.SetOptionState( true )
f7_arg0:dispatchEventToAllOtherRoots( {
name = "refresh_options_button",
immediate = true
} )
end
else
LUI.FlowManager.RequestAddMenu( f7_arg0, "pc_controls", true, f7_arg1.controller )
end
end
function endGameButtonAction( f8_arg0, f8_arg1 )
local f8_local0 = Engine.GetDvarBool( "isMatchMakingGame" )
local f8_local1 = Engine.GetDvarBool( "sv_running" )
if f8_local0 then
LUI.FlowManager.RequestPopupMenu( f8_arg0, "popup_leave_game", true, f8_arg1.controller )
else
LUI.FlowManager.RequestPopupMenu( f8_arg0, "popup_end_game", true, f8_arg1.controller )
end
end
function checkTeamChoice( f9_arg0 )
if Engine.IsSquadVsSquadMode() then
return false
else
return Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f9_arg0, GameTypesTable.Cols.TeamChoice ) == "1"
end
end
function chooseClassCheck( f10_arg0, f10_arg1, f10_arg2 )
local f10_local0 = Game.GetPlayerTeam()
if GameX.UsesFakeLoadout() then
return true
elseif f10_arg0 == true then
return true
elseif f10_arg0 == false then
if f10_arg2 == true and (f10_local0 == Teams.allies or f10_local0 == Teams.axis) then
return true
elseif f10_arg2 == false then
return true
end
end
return false
end
function pauseMenuUpdate( f11_arg0, f11_arg1 )
if f11_arg1.value ~= true then
local f11_local0 = MBh.CloseAllMenus()
f11_local0( f11_arg0, f11_arg1 )
end
end
function optionsLockedUpdate( f12_arg0, f12_arg1 )
return GameX.IsOptionStateLocked()
end
function refreshOptionDisable( f13_arg0, f13_arg1 )
if not f13_arg0.disabled then
f13_arg0:processEvent( {
name = "disable"
} )
elseif f13_arg0.disabled then
f13_arg0:processEvent( {
name = "enable"
} )
end
end
function options_def()
local f14_local0 = GameX.GetGameMode()
local f14_local1 = Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f14_local0, GameTypesTable.Cols.ClassChoice ) == "1"
if not f14_local1 then
f14_local1 = GameX.UsesFakeLoadout()
end
local f14_local2 = checkTeamChoice( f14_local0 )
local f14_local3 = GameX.IsRankedMatch()
local f14_local4 = Engine.GetDvarBool( "splitscreen_ingame" )
local f14_local5 = Game.GetOmnvar( "ui_team_selected" )
local f14_local6 = Game.GetOmnvar( "ui_loadout_selected" )
local f14_local7 = chooseClassCheck( f14_local3, f14_local5, f14_local2 )
local self = LUI.UIVerticalList.new()
self.id = "pause_selections_Id"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = GenericMenuDims.menu_top,
left = GenericMenuDims.menu_left,
bottom = GenericMenuDims.menu_bottom,
right = GenericMenuDims.menu_right,
alignment = LUI.Alignment.Top
} )
self:animateToState( "default", 0 )
self:makeFocusable()
if f14_local0 ~= "aliens" and false == CoD.IsFireTeamMode() and f14_local1 == true and f14_local7 == true and not MLG.IsMLGSpectator() then
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIGenericButton",
id = "btn_MPPause_0",
properties = {
childNum = 1,
button_text = Engine.Localize( "@LUA_MENU_CHOOSE_CLASS_CAPS" ),
button_action_func = chooseClassButtonAction
}
} )
end
if f14_local0 ~= "aliens" and false == CoD.IsFireTeamMode() and f14_local2 == true and f14_local3 == false and not MLG.IsMLGSpectator() then
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIGenericButton",
id = "btn_MPPause_1",
properties = {
childNum = 2,
button_text = Engine.Localize( "@LUA_MENU_CHANGE_TEAM_CAPS" ),
button_action_func = changeTeamButtonAction
}
} )
end
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIGenericButton",
id = "btn_MPPause_2",
disabledFunc = optionsLockedUpdate,
properties = {
childNum = 3,
button_text = Engine.Localize( "@LUA_MENU_OPTIONS_CAPS" ),
button_action_func = optionsButtonAction
},
handlers = {
refresh_options_button = refreshOptionDisable
}
} )
if GameX.IsOnlineMatch() and (not Engine.IsAliensMode() or not Game.GetOmnvar( "ui_alien_is_solo" )) and not MLG.IsMLGSpectator() then
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIGenericButton",
id = "btn_MPPause_3",
properties = {
childNum = 4,
button_text = Engine.Localize( "@LUA_MENU_MUTE_PLAYERS_CAPS" ),
button_action_func = mutePlayersButtonAction
}
} )
end
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIGenericButton",
id = "btn_MPPause_5",
properties = {
childNum = 6,
button_text = Engine.Localize( "@LUA_MENU_END_GAME_CAPS" ),
button_action_func = endGameButtonAction
}
} )
return self
end
function game_mode_def()
local f15_local0 = GameX.GetGameMode()
local f15_local1 = Engine.Localize( "@" .. Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f15_local0, GameTypesTable.Cols.Name ) .. "_CAPS" )
local f15_local2, f15_local3, f15_local4 = nil
if MatchRules.IsUsingMatchRulesData() then
f15_local4 = MatchRules.GetData( "commonOption", "scoreLimit" )
else
f15_local3 = Engine.GetDvarInt( "scr_" .. f15_local0 .. "_winlimit" )
if f15_local3 <= 1 then
f15_local4 = Engine.GetDvarInt( "scr_" .. f15_local0 .. "_scorelimit" )
else
f15_local4 = f15_local3
end
end
if f15_local4 == 0 then
f15_local2 = Engine.Localize( "@OBJECTIVES_" .. f15_local0 .. "" )
else
f15_local2 = Engine.Localize( "@OBJECTIVES_" .. f15_local0 .. "_SCORE", f15_local4 )
end
local f15_local5 = nil
if Engine.UsingSplitscreenUpscaling() then
f15_local5 = {
topAnchor = true,
leftAnchor = false,
top = GenericMenuDims.menu_top,
height = 65,
width = 350
}
else
f15_local5 = {
topAnchor = true,
leftAnchor = true,
top = 135,
left = 690,
height = 65,
width = 350
}
end
local self = LUI.UIElement.new( f15_local5 )
self.id = "gamemode_Id"
local f15_local7 = LUI.UIText.new()
f15_local7.id = "gamemode_title_Id"
f15_local7:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
top = 0,
left = 0,
height = CoD.TextSettings.BoldFont.Height,
width = 256,
font = CoD.TextSettings.BoldFont.Font,
alignment = LUI.Alignment.Left
} )
f15_local7:animateToState( "default", 0 )
f15_local7:setText( f15_local1 )
f15_local7:setTextStyle( CoD.TextStyle.Shadowed )
local f15_local8 = LUI.UIText.new()
f15_local8.id = "gamemode_desc_Id"
f15_local8:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
top = CoD.TextSettings.BoldFont.Height,
left = 0,
height = CoD.TextSettings.NormalFont.Height,
width = 350,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
red = Colors.primary_text_color.r,
green = Colors.primary_text_color.g,
blue = Colors.primary_text_color.b
} )
f15_local8:animateToState( "default", 0 )
f15_local8:setText( f15_local2 )
f15_local8:setTextStyle( CoD.TextStyle.Shadowed )
self:addElement( f15_local7 )
self:addElement( f15_local8 )
return self
end
function map_display_def()
local f16_local0 = Engine.Localize( "@" .. Engine.TableLookup( "mp/mapNames.csv", 0, Engine.GetDvarString( "ui_mapname" ), 2 ) )
local f16_local1 = RegisterMaterial( "hud_minimap_border" )
local f16_local2 = math.min( GenericMenuDims.menu_bottom - GenericMenuDims.menu_top - CoD.TextSettings.BoldFont.Height - 5, 350 )
local f16_local3 = f16_local2
local f16_local4 = nil
if Engine.UsingSplitscreenUpscaling() then
local self = {}
self = GameX.GetSafeZoneSize()
f16_local4 = {
topAnchor = true,
rightAnchor = true,
right = self[3],
top = GenericMenuDims.menu_top,
height = f16_local2 + 30,
width = f16_local3
}
else
f16_local4 = {
topAnchor = true,
leftAnchor = true,
top = 235,
left = 690,
height = f16_local2 + 30,
width = f16_local3
}
end
local self = LUI.UIElement.new( f16_local4 )
self.id = "map_Id"
self:registerEventHandler( "menu_create", mpMapHandler )
self:registerOmnvarHandler( "ui_session_state", mpMapHandler )
local f16_local6 = LUI.UIText.new()
f16_local6.id = "map_title_Id"
f16_local6:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
top = 0,
left = 0,
height = CoD.TextSettings.BoldFont.Height,
width = 256,
font = CoD.TextSettings.BoldFont.Font,
alignment = LUI.Alignment.Left
} )
f16_local6:animateToState( "default", 0 )
f16_local6:setText( f16_local0 )
f16_local6:setTextStyle( CoD.TextStyle.Shadowed )
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIMinimap",
id = "map_mini_id",
properties = {
compassType = CoD.CompassType.Full
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
top = CoD.TextSettings.BoldFont.Height + 5,
left = 0,
height = f16_local2,
width = f16_local3,
alpha = 0.5
},
inactive = {
alpha = 0
}
}
} )
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIMinimapIcons",
id = "map_mini_icons_id",
properties = {
compassType = CoD.CompassType.Full
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
top = CoD.TextSettings.BoldFont.Height + 5,
left = 0,
height = f16_local2,
width = f16_local3,
alpha = 1
},
inactive = {
alpha = 0
}
}
} )
self:addElement( f16_local6 )
return self
end
function mp_pause_menu_background_def()
local self = LUI.UIImage.new()
self.id = "pmOptionsScreenOverlay"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = RegisterMaterial( "black" ),
red = Colors.window_border_color.r,
green = Colors.window_border_color.g,
blue = Colors.window_border_color.b,
alpha = 0.5
} )
self:animateToState( "default", 0 )
return self
end
function mp_pause_menu_title_def( f18_arg0 )
local self = LUI.UIElement.new()
self.id = "mp_pause_title"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0
} )
self:animateToState( "default", 0 )
LUI.MenuBuilder.BuildAddChild( self, {
type = "generic_menu_title",
id = "mp_pause_title_text",
properties = {
menu_title = f18_arg0
}
} )
return self
end
function mp_pause_menu()
local f19_local0 = Engine.IsAliensMode()
local f19_local1 = Engine.IsSquadVsSquadMode()
local f19_local2 = Engine.Localize
local self
if f19_local0 then
self = "@ALIENS_PAUSE_CAPS"
if not self then
if f19_local1 then
self = "@LUA_MENU_PAUSE_SQUADS_CAPS"
if not self then
else
f19_local2 = f19_local2( self )
self = LUI.UIElement.new()
self.id = "mp_pause_menu_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:registerAnimationState( "hidden", {
alpha = 0
} )
self:registerEventHandler( "menu_create", mpPauseMenuCreateHandler )
self:registerEventHandler( "popup_inactive", MBh.AnimateToState( "default", 0 ) )
self:registerEventHandler( "gain_focus", MBh.HandleSilently( MBh.AnimateToState( "default", 0 ) ) )
self:registerOmnvarHandler( "ui_pause_menu_show", pauseMenuUpdate )
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIWorldBlur",
id = "pmWorldBlurOverlay",
states = {
default = {
worldBlur = 5
}
}
} )
self:addElement( mp_pause_menu_background_def() )
LUI.MenuBuilder.BuildAddChild( self, {
type = "button_helper_text_main",
id = "pmhelper_text_id"
} )
if GameX.IsOnlineMatch() and not GameX.IsSplitscreen() then
LUI.MenuBuilder.BuildAddChild( self, {
type = "online_friends_widget",
id = "pmfriends_widget_id"
} )
end
local f19_local4 = LUI.UIBindButton.new()
f19_local4.id = "pmBackToGameStartButton"
local f19_local5 = f19_local4
local f19_local6 = f19_local4.registerEventHandler
local f19_local7 = "button_start"
local f19_local8 = MBh.DoMultiple
local f19_local9 = {}
local f19_local10 = MBh.EmitEventToRoot( "toggle_pause_off" )
local f19_local11 = MBh.CloseAllMenus()
f19_local6( f19_local5, f19_local7, f19_local8( f19_local10 ) )
f19_local5 = f19_local4
f19_local6 = f19_local4.registerEventHandler
f19_local7 = "button_select"
f19_local8 = MBh.DoMultiple
f19_local9 = {}
f19_local10 = MBh.EmitEventToRoot( "toggle_pause_off" )
f19_local11 = MBh.CloseAllMenus()
f19_local6( f19_local5, f19_local7, f19_local8( f19_local10 ) )
f19_local5 = f19_local4
f19_local6 = f19_local4.registerEventHandler
f19_local7 = "button_secondary"
f19_local8 = MBh.DoMultiple
f19_local9 = {}
f19_local10 = MBh.EmitEventToRoot( "toggle_pause_off" )
f19_local11 = MBh.CloseAllMenus()
f19_local6( f19_local5, f19_local7, f19_local8( f19_local10 ) )
self:addElement( mp_pause_menu_title_def( f19_local2 ) )
self:addElement( options_def() )
self:addElement( f19_local4 )
if not Engine.IsAliensMode() then
self:addElement( game_mode_def() )
self:addElement( map_display_def() )
else
self:addElement( LUI.mp_hud.AlienScoreboards.pause_menu_scoreboard() )
end
return self
end
end
self = "@LUA_MENU_PAUSE_CAPS"
end
else
if f19_local1 then
self = "@LUA_MENU_PAUSE_SQUADS_CAPS"
if not self then
else
f19_local2 = f19_local2( self )
self = LUI.UIElement.new()
self.id = "mp_pause_menu_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:registerAnimationState( "hidden", {
alpha = 0
} )
self:registerEventHandler( "menu_create", mpPauseMenuCreateHandler )
self:registerEventHandler( "popup_inactive", MBh.AnimateToState( "default", 0 ) )
self:registerEventHandler( "gain_focus", MBh.HandleSilently( MBh.AnimateToState( "default", 0 ) ) )
self:registerOmnvarHandler( "ui_pause_menu_show", pauseMenuUpdate )
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIWorldBlur",
id = "pmWorldBlurOverlay",
states = {
default = {
worldBlur = 5
}
}
} )
self:addElement( mp_pause_menu_background_def() )
LUI.MenuBuilder.BuildAddChild( self, {
type = "button_helper_text_main",
id = "pmhelper_text_id"
} )
if GameX.IsOnlineMatch() and not GameX.IsSplitscreen() then
LUI.MenuBuilder.BuildAddChild( self, {
type = "online_friends_widget",
id = "pmfriends_widget_id"
} )
end
local f19_local4 = LUI.UIBindButton.new()
f19_local4.id = "pmBackToGameStartButton"
local f19_local5 = f19_local4
local f19_local6 = f19_local4.registerEventHandler
local f19_local7 = "button_start"
local f19_local8 = MBh.DoMultiple
local f19_local9 = {}
local f19_local10 = MBh.EmitEventToRoot( "toggle_pause_off" )
local f19_local11 = MBh.CloseAllMenus()
f19_local6( f19_local5, f19_local7, f19_local8( f19_local10 ) )
f19_local5 = f19_local4
f19_local6 = f19_local4.registerEventHandler
f19_local7 = "button_select"
f19_local8 = MBh.DoMultiple
f19_local9 = {}
f19_local10 = MBh.EmitEventToRoot( "toggle_pause_off" )
f19_local11 = MBh.CloseAllMenus()
f19_local6( f19_local5, f19_local7, f19_local8( f19_local10 ) )
f19_local5 = f19_local4
f19_local6 = f19_local4.registerEventHandler
f19_local7 = "button_secondary"
f19_local8 = MBh.DoMultiple
f19_local9 = {}
f19_local10 = MBh.EmitEventToRoot( "toggle_pause_off" )
f19_local11 = MBh.CloseAllMenus()
f19_local6( f19_local5, f19_local7, f19_local8( f19_local10 ) )
self:addElement( mp_pause_menu_title_def( f19_local2 ) )
self:addElement( options_def() )
self:addElement( f19_local4 )
if not Engine.IsAliensMode() then
self:addElement( game_mode_def() )
self:addElement( map_display_def() )
else
self:addElement( LUI.mp_hud.AlienScoreboards.pause_menu_scoreboard() )
end
return self
end
end
self = "@LUA_MENU_PAUSE_CAPS"
end
f19_local2 = f19_local2( self )
self = LUI.UIElement.new()
self.id = "mp_pause_menu_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:registerAnimationState( "hidden", {
alpha = 0
} )
self:registerEventHandler( "menu_create", mpPauseMenuCreateHandler )
self:registerEventHandler( "popup_inactive", MBh.AnimateToState( "default", 0 ) )
self:registerEventHandler( "gain_focus", MBh.HandleSilently( MBh.AnimateToState( "default", 0 ) ) )
self:registerOmnvarHandler( "ui_pause_menu_show", pauseMenuUpdate )
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIWorldBlur",
id = "pmWorldBlurOverlay",
states = {
default = {
worldBlur = 5
}
}
} )
self:addElement( mp_pause_menu_background_def() )
LUI.MenuBuilder.BuildAddChild( self, {
type = "button_helper_text_main",
id = "pmhelper_text_id"
} )
if GameX.IsOnlineMatch() and not GameX.IsSplitscreen() then
LUI.MenuBuilder.BuildAddChild( self, {
type = "online_friends_widget",
id = "pmfriends_widget_id"
} )
end
local f19_local4 = LUI.UIBindButton.new()
f19_local4.id = "pmBackToGameStartButton"
local f19_local5 = f19_local4
local f19_local6 = f19_local4.registerEventHandler
local f19_local7 = "button_start"
local f19_local8 = MBh.DoMultiple
local f19_local9 = {}
local f19_local10 = MBh.EmitEventToRoot( "toggle_pause_off" )
local f19_local11 = MBh.CloseAllMenus()
f19_local6( f19_local5, f19_local7, f19_local8( f19_local10 ) )
f19_local5 = f19_local4
f19_local6 = f19_local4.registerEventHandler
f19_local7 = "button_select"
f19_local8 = MBh.DoMultiple
f19_local9 = {}
f19_local10 = MBh.EmitEventToRoot( "toggle_pause_off" )
f19_local11 = MBh.CloseAllMenus()
f19_local6( f19_local5, f19_local7, f19_local8( f19_local10 ) )
f19_local5 = f19_local4
f19_local6 = f19_local4.registerEventHandler
f19_local7 = "button_secondary"
f19_local8 = MBh.DoMultiple
f19_local9 = {}
f19_local10 = MBh.EmitEventToRoot( "toggle_pause_off" )
f19_local11 = MBh.CloseAllMenus()
f19_local6( f19_local5, f19_local7, f19_local8( f19_local10 ) )
self:addElement( mp_pause_menu_title_def( f19_local2 ) )
self:addElement( options_def() )
self:addElement( f19_local4 )
if not Engine.IsAliensMode() then
self:addElement( game_mode_def() )
self:addElement( map_display_def() )
else
self:addElement( LUI.mp_hud.AlienScoreboards.pause_menu_scoreboard() )
end
return self
end
LUI.MenuBuilder.registerType( "mp_pause_menu", mp_pause_menu )
LockTable( _M )

View File

@ -0,0 +1,897 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = Engine.Localize( "@LUA_MENU_OPPOSING_TEAM_CAPS" )
f0_local1 = Engine.Localize( "@LUA_MENU_EMPTY" )
f0_local2 = Engine.Localize( "@LUA_MENU_SCORE" )
local f0_local3 = Engine.Localize( "@LUA_MENU_KILLS" )
local f0_local4 = Engine.Localize( "@LUA_MENU_DEATHS" )
local f0_local5 = Engine.Localize( "@LUA_MENU_ASSISTS" )
local f0_local6 = Engine.Localize( "@LUA_MENU_CAPTURES" )
local f0_local7 = Engine.Localize( "@LUA_MENU_PLANTS" )
local f0_local8 = Engine.Localize( "@LUA_MENU_TAGS" )
local f0_local9 = Engine.Localize( "@LUA_MENU_RESCUES" )
local f0_local10 = function ()
local f1_local0 = Engine.GetDvarString( "ui_gametype" )
local f1_local1 = {
{
type = "optionsMenuScoreboardHeaderDef",
id = "scoreHeader"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow1"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow2"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow3"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow4"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow5"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow6"
},
{
type = "optionsMenuScoreboardHeaderOpForDef",
id = "scoreHeaderOpFor"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow7"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow8"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow9"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow10"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow11"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow12"
}
}
if f1_local0 == "dm" or f1_local0 == "adrn" or f1_local0 == "mugger" or f1_local0 == "assn" or f1_local0 == "fo" or f1_local0 == "sna" then
f1_local1 = {
{
type = "optionsMenuScoreboardHeaderDef"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow1"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow2"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow3"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow4"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow5"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow6"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow7"
},
{
type = "optionsMenuScoreboardRowDef",
id = "listRow8"
}
}
end
return f1_local1
end
local f0_local11 = function ( f2_arg0, f2_arg1 )
local f2_local0 = RegisterMaterial( "specialty_null" )
local f2_local1 = RegisterMaterial( "waypoint_dogtags_friendlys" )
local f2_local2 = RegisterMaterial( "waypoint_dogtags" )
local f2_local3 = RegisterMaterial( "killiconsuicide" )
local f2_local4 = f2_arg0:getChildById( "scoreboardRows" )
local f2_local5 = Engine.GetDvarString( "ui_gametype" )
local f2_local6 = 12
local f2_local7 = f2_local6 * 0.5
local f2_local8 = GameX.gameModeIsFFA()
if f2_local8 then
f2_local6 = 8
end
local f2_local9 = f2_local4:getChildById( "scoreHeader" )
local f2_local10 = f2_local9:getChildById( "scoreHeaderRowList" )
local f2_local11 = f2_local10:getChildById( "assistsText" )
local f2_local12 = Game.GetPlayerScoreRanking()
for f2_local13 = 1, f2_local6, 1 do
local f2_local16 = f2_local4:getChildById( "listRow" .. f2_local13 )
local f2_local17 = f2_local16:getChildById( "rowList" )
local f2_local18 = f2_local16:getChildById( "scoreRowBg" )
local f2_local19 = f2_local17:getChildById( "rankIcon" )
local f2_local20 = f2_local17:getChildById( "rankNumber" )
local f2_local21 = f2_local17:getChildById( "gamertag" )
local f2_local22 = f2_local17:getChildById( "score" )
local f2_local23 = f2_local17:getChildById( "kills" )
local f2_local24 = f2_local17:getChildById( "deaths" )
local f2_local25 = f2_local17:getChildById( "assists" )
local f2_local26 = "default"
local f2_local27 = Game.GetPlayerTeam()
if GameX.IsSpectatingNotOnTeam() then
f2_local27 = spectatorFakeTeam
end
local f2_local28 = f2_local13
if f2_local8 == false and f2_local7 < f2_local13 then
f2_local27 = GameX.GetPlayerOpposingTeam()
f2_local28 = f2_local13 - f2_local7
end
local f2_local29 = Game.GetPlayerScoreInfoAtRank( f2_local27, f2_local28 )
if f2_local29 ~= nil then
if f2_local16.current_state ~= "filled" then
f2_local16:animateToState( "filled", 250 )
f2_local16.current_state = "filled"
end
if f2_local13 % 2 == 0 then
f2_local26 = "bar_b"
end
if f2_local12 == f2_local13 then
f2_local26 = "highlight"
end
if f2_local5 == "sr" then
if f2_local29.extrascore1 == 1 then
f2_local26 = "downed"
elseif f2_local29.extrascore1 == 2 then
f2_local26 = "dead"
end
elseif f2_local29.isDead == true then
f2_local26 = "dead"
end
local f2_local30 = f2_local29.rankIcon
if f2_local5 == "sr" then
if f2_local26 == "downed" then
if f2_local27 == Game.GetPlayerTeam() then
f2_local30 = f2_local1
else
f2_local30 = f2_local2
end
elseif f2_local26 == "dead" then
f2_local30 = f2_local3
end
end
if f2_local4.rank_icon ~= f2_local30 then
CoD.SetMaterial( f2_local19, f2_local30 )
end
f2_local20:setText( f2_local29.rank + 1 )
f2_local21:setText( f2_local29.name )
if f2_local5 == "war" then
f2_local22:setText( f2_local29.score )
f2_local23:setText( f2_local29.kills )
f2_local24:setText( f2_local29.deaths )
f2_local25:setText( f2_local29.assists )
f2_local11:setText( f0_local5 )
elseif f2_local5 == "dom" then
f2_local22:setText( f2_local29.score )
f2_local23:setText( f2_local29.kills )
f2_local24:setText( f2_local29.deaths )
f2_local25:setText( f2_local29.extrascore0 )
f2_local11:setText( f0_local6 )
elseif f2_local5 == "sd" then
f2_local22:setText( f2_local29.score )
f2_local23:setText( f2_local29.kills )
f2_local24:setText( f2_local29.deaths )
f2_local25:setText( f2_local29.extrascore0 )
f2_local11:setText( f0_local7 )
elseif f2_local5 == "conf" then
f2_local22:setText( f2_local29.score )
f2_local23:setText( f2_local29.kills )
f2_local24:setText( f2_local29.deaths )
f2_local25:setText( f2_local29.extrascore0 )
f2_local11:setText( f0_local8 )
elseif f2_local5 == "dm" then
f2_local22:setText( f2_local29.score )
f2_local23:setText( f2_local29.kills )
f2_local24:setText( f2_local29.deaths )
f2_local25:setText( f2_local29.assists )
f2_local11:setText( f0_local5 )
elseif f2_local5 == "gun" then
f2_local22:setText( f2_local29.score )
f2_local23:setText( f2_local29.kills )
f2_local24:setText( f2_local29.deaths )
f2_local25:setText( f2_local29.assists )
f2_local11:setText( f0_local5 )
elseif f2_local5 == "mugger" then
f2_local22:setText( f2_local29.score )
f2_local23:setText( f2_local29.kills )
f2_local24:setText( f2_local29.deaths )
f2_local25:setText( f2_local29.assists )
f2_local11:setText( f0_local8 )
elseif f2_local5 == "sr" then
f2_local22:setText( f2_local29.score )
f2_local23:setText( f2_local29.kills )
f2_local24:setText( f2_local29.deaths )
f2_local25:setText( f2_local29.extrascore0 )
f2_local11:setText( f0_local9 )
elseif f2_local5 == "blitz" then
f2_local22:setText( f2_local29.score )
f2_local23:setText( f2_local29.kills )
f2_local24:setText( f2_local29.deaths )
f2_local25:setText( f2_local29.assists )
f2_local11:setText( f0_local5 )
end
else
if f2_local4.rank_icon ~= f2_local0 then
CoD.SetMaterial( f2_local19, f2_local0 )
end
if f2_local16.current_state ~= "default" then
f2_local16:animateToState( "default", 250 )
f2_local16.current_state = "default"
end
f2_local20:setText( "" )
f2_local21:setText( f0_local1 )
f2_local22:setText( "" )
f2_local23:setText( "" )
f2_local24:setText( "" )
f2_local25:setText( "" )
end
if f2_local18.current_state ~= f2_local26 then
f2_local18:animateToState( f2_local26, 250 )
f2_local18.current_state = f2_local26
if f2_local26 == "highlight" then
f2_local20:animateToState( "black_text", 0 )
f2_local21:animateToState( "black_text", 0 )
f2_local22:animateToState( "black_text", 0 )
f2_local23:animateToState( "black_text", 0 )
f2_local24:animateToState( "black_text", 0 )
f2_local25:animateToState( "black_text", 0 )
else
f2_local20:animateToState( "default", 0 )
f2_local21:animateToState( "default", 0 )
f2_local22:animateToState( "default", 0 )
f2_local23:animateToState( "default", 0 )
f2_local24:animateToState( "default", 0 )
f2_local25:animateToState( "default", 0 )
end
end
end
end
local f0_local12 = function ( f3_arg0, f3_arg1 )
end
local f0_local13 = 200
local f0_local14 = 650
local f0_local15 = 2
local f0_local16 = function ()
return {
type = "UIElement",
id = "optionsMenuScoreboardHud",
states = {
default = {
topAnchor = true,
rightAnchor = true,
top = 50,
height = f0_local13,
right = -10,
width = f0_local14,
alpha = 1
}
},
handlers = {
options_menu_scoreboard_refresh = f0_local11
},
children = {
{
type = "UITimer",
id = "optionsMenuScoreboardRefreshTimer",
properties = {
event = "options_menu_scoreboard_refresh",
group = "hud",
interval = 250
}
},
{
type = "UIVerticalList",
id = "scoreboardRows",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
alignment = LUI.Alignment.Left,
spacing = f0_local15,
alpha = 1
}
},
children = f0_local10()
}
}
}
end
local f0_local17 = 20
local f0_local18 = 20
local f0_local19 = 256
local f0_local20 = 50
local f0_local21 = 75
local f0_local22 = 75
local f0_local23 = 75
local f0_local24 = 7
local f0_local25 = function ()
return {
type = "UIElement",
id = "scoreHeader",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
left = 0,
bottom = CoD.TextSettings.HudEuroMedSmallFont.Height + 5,
right = 0
}
},
children = {
{
type = "UIImage",
id = "scoreHeaderBg",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 5,
left = 0,
bottom = CoD.TextSettings.HudEuroMedSmallFont.Height + 10,
right = f0_local14,
material = RegisterMaterial( "hud_scoreboard_header" )
}
}
},
{
type = "UIHorizontalList",
id = "scoreHeaderRowList",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
spacing = f0_local24
}
},
children = {
{
type = "UIElement",
id = "spacer",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = f0_local17 + f0_local18 + f0_local19 + f0_local24 * 3
}
}
},
{
type = "UIText",
id = "scoreText",
properties = {
text = f0_local2
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 8,
left = 0,
bottom = CoD.TextSettings.HudEuroMedSmallFont.Height + 7,
right = 50,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right,
alpha = 0.75
}
}
},
{
type = "UIText",
id = "killsText",
properties = {
text = f0_local3
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 8,
left = 0,
bottom = CoD.TextSettings.HudEuroMedSmallFont.Height + 7,
right = 75,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right,
alpha = 0.75
}
}
},
{
type = "UIText",
id = "deathsText",
properties = {
text = f0_local4
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 8,
left = 0,
bottom = CoD.TextSettings.HudEuroMedSmallFont.Height + 7,
right = 75,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right,
alpha = 0.75
}
}
},
{
type = "UIText",
id = "assistsText",
properties = {
text = f0_local5
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 8,
left = 0,
bottom = CoD.TextSettings.HudEuroMedSmallFont.Height + 7,
right = 75,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right,
alpha = 0.75
}
}
}
}
}
}
}
end
local f0_local26 = function ()
local f6_local0 = RegisterMaterial( "hud_scoreboard_bar_a" )
return {
type = "UIButton",
id = "scoreRow",
properties = {
rankIcon = placeholder_material,
rankNumber = "",
gamertag = f0_local1,
score = "",
kills = "",
deaths = "",
assists = "",
current_state = "default"
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
left = 0,
height = 20,
right = 0,
alpha = 0.25
},
filled = {
alpha = 1
}
},
handlers = {
button_action = f0_local12
},
children = {
{
type = "UIImage",
id = "scoreRowBg",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f6_local0,
alpha = 0.75
},
bar_a = {
material = f6_local0,
alpha = 1
},
bar_b = {
material = RegisterMaterial( "hud_scoreboard_bar_b" ),
alpha = 0.4
},
downed = {
material = RegisterMaterial( "hud_scoreboard_dead_yellow" ),
alpha = 0.65
},
dead = {
material = RegisterMaterial( "hud_scoreboard_dead_red" ),
alpha = 0.65
},
highlight = {
material = RegisterMaterial( "hud_scoreboard_highlight_you" ),
alpha = 1
}
},
handlers = {
button_over = function ( f7_arg0, f7_arg1 )
f7_arg0:animateToState( "downed", 0 )
end
,
button_up = function ( f8_arg0, f8_arg1 )
f8_arg0:animateToState( f8_arg0.properties.current_state, 0 )
end
}
},
{
type = "UIHorizontalList",
id = "rowList",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
spacing = 0
}
},
properties = {
rankIcon = MBh.Property( "rankIcon" ),
rankNumber = MBh.Property( "rankNumber" ),
gamertag = MBh.Property( "gamertag" ),
score = MBh.Property( "score" ),
kills = MBh.Property( "kills" ),
deaths = MBh.Property( "deaths" ),
assists = MBh.Property( "assists" )
},
children = {
{
type = "UIImage",
id = "rankIcon",
properties = {
rankIcon = MBh.Property( "rankIcon" )
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = f0_local17,
material = MBh.Property( "rankIcon" )
}
}
},
{
type = "UIText",
id = "rankNumber",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 5,
left = 0,
bottom = 5 + CoD.TextSettings.HudEuroMedTinyFont.Height,
right = f0_local18 + 10,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Left,
red = 1,
green = 1,
blue = 1,
alpha = 1
},
black_text = {
red = 0,
green = 0,
blue = 0,
alpha = 1
}
},
properties = {
text = MBh.Property( "rankNumber" )
}
},
{
type = "UIText",
id = "gamertag",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = f0_local19 + 10,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = 1,
green = 1,
blue = 1,
alpha = 1
},
black_text = {
red = 0,
green = 0,
blue = 0,
alpha = 1
}
},
properties = {
text = MBh.Property( "gamertag" )
}
},
{
type = "UIText",
id = "score",
properties = {
text = MBh.Property( "score" )
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = f0_local20 + 10,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right,
red = 1,
green = 1,
blue = 1,
alpha = 1
},
black_text = {
red = 0,
green = 0,
blue = 0,
alpha = 1
}
}
},
{
type = "UIText",
id = "kills",
properties = {
text = MBh.Property( "kills" )
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = f0_local21 + 8,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right,
red = 1,
green = 1,
blue = 1,
alpha = 1
},
black_text = {
red = 0,
green = 0,
blue = 0,
alpha = 1
}
}
},
{
type = "UIText",
id = "deaths",
properties = {
text = MBh.Property( "deaths" )
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = f0_local22 + 6,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right,
red = 1,
green = 1,
blue = 1,
alpha = 1
},
black_text = {
red = 0,
green = 0,
blue = 0,
alpha = 1
}
}
},
{
type = "UIText",
id = "assists",
properties = {
text = MBh.Property( "assists" )
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = f0_local23 + 6,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right,
red = 1,
green = 1,
blue = 1,
alpha = 1
},
black_text = {
red = 0,
green = 0,
blue = 0,
alpha = 1
}
}
}
}
}
}
}
end
local f0_local27 = function ()
return {
type = "UIElement",
id = "scoreHeaderOpFor",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
left = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height + 5,
right = 0
}
},
children = {
{
type = "UIImage",
id = "scoreHeaderOpForBg",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 5,
left = 0,
bottom = CoD.TextSettings.HudEuroMedSmallFont.Height + 10,
right = f0_local14,
material = RegisterMaterial( "hud_scoreboard_header" )
}
}
},
{
type = "UIText",
id = "headerOpForText",
properties = {
text = f0_local0
},
states = {
default = {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 8,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
right = -5,
width = 200,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right,
alpha = 1
}
}
}
}
}
end
LUI.MenuBuilder.registerDef( "optionsMenuScoreboardHudDef", f0_local16 )
LUI.MenuBuilder.registerDef( "optionsMenuScoreboardRowDef", f0_local26 )
LUI.MenuBuilder.registerDef( "optionsMenuScoreboardHeaderDef", f0_local25 )
LUI.MenuBuilder.registerDef( "optionsMenuScoreboardHeaderOpForDef", f0_local27 )
LockTable( _M )

View File

@ -0,0 +1,277 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ()
if Game.InKillCam() then
if Game.IsCinematicCameraActive() then
return false
elseif Game.IsKillCamEntityActive() then
return false
end
elseif Game.IsSpectatorCameraActive() then
return false
end
return true
end
f0_local1 = function ( f2_arg0, f2_arg1 )
if not f0_local0() then
f2_arg0:dispatchEventToChildren( {
name = "heliPilotOverlayDef_ended"
} )
f2_arg0:dispatchEventToChildren( {
name = "predatorMissileOverlayDef_ended"
} )
f2_arg0:dispatchEventToChildren( {
name = "odinOverlayDef_ended"
} )
f2_arg0:dispatchEventToChildren( {
name = "juggernautOverlayDef_ended"
} )
f2_arg0:dispatchEventToChildren( {
name = "a10OverlayDef_ended"
} )
f2_arg0:dispatchEventToChildren( {
name = "vanguardOverlayDef_ended"
} )
f2_arg0:dispatchEventToChildren( {
name = "juggPredatorOverlayDef_ended"
} )
f2_arg0:dispatchEventToChildren( {
name = "ac130OverlayDef_ended"
} )
end
end
f0_local2 = function ( f3_arg0, f3_arg1 )
local f3_local0 = f3_arg1.killstreak
if f3_arg0.openOverlays[f3_local0] then
return
elseif not f0_local0() then
return
else
local f3_local1 = LUI.MenuBuilder.buildItems( {
type = f3_local0
}, f3_arg0.properties, f3_arg0 )
f3_local1:registerEventHandler( f3_local0 .. "_ended", function ( element, event )
element:close()
f3_arg0.openOverlays[f3_local0] = false
end )
f3_arg0.openOverlays[f3_local0] = true
f3_arg0:addElement( f3_local1 )
f3_local1:processEvent( {
name = "init_overlay",
omnvar = f3_arg1.omnvar,
value = f3_arg1.value
} )
end
end
local f0_local3 = function ( f5_arg0, f5_arg1 )
if f5_arg1.value == 1 then
f5_arg0:dispatchEventToRoot( {
name = "add_overlay",
target = f5_arg0,
killstreak = "heliPilotOverlayDef",
omnvar = f5_arg1.omnvar,
value = f5_arg1.value
} )
elseif f5_arg1.value == 0 then
f5_arg0:dispatchEventToChildren( {
name = "heliPilotOverlayDef_ended"
} )
end
end
local f0_local4 = function ( f6_arg0, f6_arg1 )
if f6_arg1.value == 1 then
f6_arg0:dispatchEventToRoot( {
name = "add_overlay",
target = f6_arg0,
killstreak = "predatorMissileOverlayDef",
omnvar = f6_arg1.omnvar,
value = f6_arg1.value
} )
elseif f6_arg1.value == 0 then
f6_arg0:dispatchEventToChildren( {
name = "predatorMissileOverlayDef_ended"
} )
end
end
local f0_local5 = function ( f7_arg0, f7_arg1 )
if f7_arg1.value == 1 or f7_arg1.value == 2 then
f7_arg0:dispatchEventToRoot( {
name = "add_overlay",
target = f7_arg0,
killstreak = "odinOverlayDef",
omnvar = f7_arg1.omnvar,
value = f7_arg1.value
} )
elseif f7_arg1.value == -1 then
f7_arg0:dispatchEventToChildren( {
name = "odinOverlayDef_ended"
} )
end
end
local f0_local6 = function ( f8_arg0, f8_arg1 )
if f8_arg1.value == 1 then
f8_arg0:dispatchEventToRoot( {
name = "add_overlay",
target = f8_arg0,
killstreak = "juggernautOverlayDef",
omnvar = f8_arg1.omnvar,
value = f8_arg1.value
} )
elseif f8_arg1.value == 0 then
f8_arg0:dispatchEventToChildren( {
name = "juggernautOverlayDef_ended"
} )
end
end
local f0_local7 = function ( f9_arg0, f9_arg1 )
if f9_arg1.value == true then
f9_arg0:dispatchEventToRoot( {
name = "add_overlay",
target = f9_arg0,
killstreak = "a10OverlayDef",
omnvar = f9_arg1.omnvar,
value = f9_arg1.value
} )
elseif f9_arg1.value == false then
f9_arg0:dispatchEventToChildren( {
name = "a10OverlayDef_ended"
} )
end
end
local f0_local8 = function ( f10_arg0, f10_arg1 )
if f10_arg1.value == 1 then
f10_arg0:dispatchEventToRoot( {
name = "add_overlay",
target = f10_arg0,
killstreak = "vanguardOverlayDef",
omnvar = f10_arg1.omnvar,
value = f10_arg1.value
} )
elseif f10_arg1.value == 0 then
f10_arg0:dispatchEventToChildren( {
name = "vanguardOverlayDef_ended"
} )
end
end
local f0_local9 = function ( f11_arg0, f11_arg1 )
if f11_arg1.value then
f11_arg0:dispatchEventToRoot( {
name = "add_overlay",
target = f11_arg0,
killstreak = "juggPredatorOverlayDef",
omnvar = f11_arg1.omnvar,
value = f11_arg1.value
} )
elseif not f11_arg1.value then
f11_arg0:dispatchEventToChildren( {
name = "juggPredatorOverlayDef_ended"
} )
end
end
local f0_local10 = function ( f12_arg0, f12_arg1 )
if f12_arg1.value then
f12_arg0:dispatchEventToRoot( {
name = "add_overlay",
target = f12_arg0,
killstreak = "ac130OverlayDef",
omnvar = f12_arg1.omnvar,
value = f12_arg1.value
} )
elseif not f12_arg1.value then
f12_arg0:dispatchEventToChildren( {
name = "ac130OverlayDef_ended"
} )
end
end
local f0_local11 = function ( f13_arg0, f13_arg1 )
local f13_local0 = Game.GetOmnvar( "ui_heli_pilot" )
local f13_local1 = Game.GetOmnvar( "ui_predator_missile" )
local f13_local2 = Game.GetOmnvar( "ui_odin" )
local f13_local3 = Game.GetOmnvar( "ui_juggernaut" )
local f13_local4 = Game.GetOmnvar( "ui_a10" )
local f13_local5 = Game.GetOmnvar( "ui_vanguard" )
local f13_local6 = Game.GetOmnvar( "ui_predator_hud" )
local f13_local7 = Game.GetOmnvar( "ui_ac130_hud" )
f0_local3( f13_arg0, {
name = "ui_heli_pilot",
value = f13_local0
} )
f0_local4( f13_arg0, {
name = "ui_predator_missile",
value = f13_local1
} )
f0_local5( f13_arg0, {
name = "ui_odin",
value = f13_local2
} )
f0_local6( f13_arg0, {
name = "ui_juggernaut",
value = f13_local3
} )
f0_local7( f13_arg0, {
name = "ui_a10",
value = f13_local4
} )
f0_local8( f13_arg0, {
name = "ui_vanguard",
value = f13_local5
} )
f0_local9( f13_arg0, {
name = "ui_predator_hud",
value = f13_local6
} )
f0_local10( f13_arg0, {
name = "ui_ac130_hud",
value = f13_local7
} )
end
local f0_local12 = function ( f14_arg0, f14_arg1 )
local f14_local0 = f14_arg0:getFirstChild()
while f14_local0 do
f14_local0:processEvent( f14_arg1 )
f14_local0 = f14_local0:getNextSibling()
end
end
LUI.MenuBuilder.registerType( "overlayHudDef", function ()
local self = LUI.UIElement.new( {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0
} )
self.id = "overlayId"
self.openOverlays = {}
self:registerOmnvarHandler( "ui_heli_pilot", f0_local3 )
self:registerOmnvarHandler( "ui_predator_missile", f0_local4 )
self:registerOmnvarHandler( "ui_odin", f0_local5 )
self:registerOmnvarHandler( "ui_juggernaut", f0_local6 )
self:registerOmnvarHandler( "ui_a10", f0_local7 )
self:registerOmnvarHandler( "ui_vanguard", f0_local8 )
self:registerOmnvarHandler( "ui_predator_hud", f0_local9 )
self:registerOmnvarHandler( "ui_ac130_hud", f0_local10 )
self:registerEventHandler( "add_overlay", f0_local2 )
self:registerEventHandler( "playerstate_client_changed", f0_local11 )
self:registerEventHandler( "refresh_controls", f0_local12 )
self:registerEventHandler( "camera_client_changed", f0_local1 )
return self
end )
LockTable( _M )

View File

@ -0,0 +1,197 @@
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 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
250
},
{
"active",
0
},
{
"active",
3000
},
{
"default",
250
}
} )
f1_local0( f1_arg0 )
end
f0_local1 = function ( f2_arg0, f2_arg1 )
if f2_arg1.value == 1 then
f2_arg0:closeChildren()
local f2_local0 = {}
local f2_local1 = Game.GetOmnvar( "ui_spawn_abilities1" )
local f2_local2 = Game.GetOmnvar( "ui_spawn_abilities2" )
for f2_local3 = 1, 24, 1 do
f2_local0[f2_local3] = hasbit( f2_local1, bit( f2_local3 ) )
f2_local0[f2_local3 + 24] = hasbit( f2_local2, bit( f2_local3 ) )
end
for f2_local3 = 1, #f2_local0, 1 do
if f2_local0[f2_local3] then
local f2_local6 = Engine.TableLookup( KillCamAbilitiesBitMaskTable.File, KillCamAbilitiesBitMaskTable.Cols.Index, f2_local3, KillCamAbilitiesBitMaskTable.Cols.Ref )
local f2_local7 = Engine.TableLookup( PerkTable.File, PerkTable.Cols.Ref, f2_local6, PerkTable.Cols.Cost )
local f2_local8 = Engine.TableLookup( PerkTable.File, PerkTable.Cols.Ref, f2_local6, PerkTable.Cols.Image )
local f2_local9 = RegisterMaterial( "white" )
local f2_local10 = RegisterMaterial( f2_local8 )
local f2_local11 = Engine.TableLookup( PerkTable.File, PerkTable.Cols.Ref, f2_local6, PerkTable.Cols.Name )
local f2_local12 = nil
local f2_local13 = false
for self = 1, Cac.Abilities.Settings.AbilitiesNumCategories, 1 do
for f2_local17 = 1, Cac.Abilities.Settings.AbilitiesPerCategory, 1 do
if Cac.GetAbilitySlotRef( Cac.GetAbilityRef( self - 1 ), f2_local17 ) == f2_local6 then
f2_local13 = true
break
end
end
if f2_local13 == true then
end
end
local self = LUI.UIElement.new()
self.id = "perk_container" .. f2_local3
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = -16,
left = 0,
bottom = 18,
width = 32
} )
self:animateToState( "default", 0 )
local f2_local15 = LUI.UIImage.new()
f2_local15.id = "perk_bg" .. f2_local3
f2_local15:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
red = 1,
green = 1,
blue = 1,
material = f2_local9
} )
f2_local15:animateToState( "default", 0 )
local f2_local16 = LUI.UIImage.new()
f2_local16.id = "perk_bar" .. f2_local3
f2_local16:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 31,
height = 3,
red = Colors.cac_ability[f2_local12].r,
green = Colors.cac_ability[f2_local12].g,
blue = Colors.cac_ability[f2_local12].b,
material = f2_local9
} )
f2_local16:animateToState( "default", 0 )
local f2_local20 = LUI.UIImage.new()
f2_local20.id = "perk_image" .. f2_local3
f2_local20:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
height = 32,
red = 0,
green = 0,
blue = 0,
material = f2_local10
} )
f2_local20:animateToState( "default", 0 )
local f2_local17 = LUI.UIText.new()
f2_local17.id = "perk_text" .. f2_local3
f2_local17:setText( Engine.Localize( "@" .. f2_local11 ) )
f2_local17:setTextStyle( CoD.TextStyle.Shadowed )
f2_local17:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -CoD.TextSettings.HudEuroMedSmallFont.Height / 2,
left = 35,
bottom = CoD.TextSettings.HudEuroMedSmallFont.Height / 2,
right = 547,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Left
} )
f2_local17:animateToState( "default", 0 )
self:addElement( f2_local15 )
self:addElement( f2_local16 )
self:addElement( f2_local20 )
self:addElement( f2_local17 )
f2_arg0:addElement( self )
end
end
f0_local0( f2_arg0:getParent(), f2_arg1 )
end
end
LUI.MenuBuilder.registerType( "perksOnSpawnHudDef", function ()
local self = LUI.UIElement.new()
self.id = "perks_on_spawn_hud"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 250,
left = -500,
height = 456,
width = 512,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "opening", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 250,
left = 30,
height = 456,
width = 512,
alpha = 1
} )
self:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 250,
left = 10,
height = 456,
width = 512,
alpha = 1
} )
local f3_local1 = LUI.UIVerticalList.new()
f3_local1.id = "perks_on_spawn_vl"
f3_local1:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
spacing = 1
} )
f3_local1:animateToState( "default", 0 )
f3_local1:registerOmnvarHandler( "ui_spawn_abilities_show", f0_local1 )
self:addElement( f3_local1 )
return self
end )
LockTable( _M )

View File

@ -0,0 +1,171 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 1.2
function playerCardHudDef()
local f1_local0 = RegisterMaterial( "white" )
local f1_local1 = RegisterMaterial( "card_bg" )
local self = LUI.UIElement.new()
self.id = "playerCard"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true
} )
self:animateToState( "default", 0 )
local f1_local3 = LUI.UIImage.new()
f1_local3.id = "playerCard"
f1_local3:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
height = 64 * f0_local0 + 10,
width = 256 * f0_local0 + 75,
material = f1_local1
} )
f1_local3:animateToState( "default", 0 )
local f1_local4 = LUI.UIImage.new()
f1_local4.id = "playerCardBg"
f1_local4:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -15,
right = -43,
height = 32 * f0_local0,
width = 256 * f0_local0,
material = f1_local1
} )
f1_local4:animateToState( "default", 0 )
local f1_local5 = LUI.UIImage.new()
f1_local5.id = "playerCardPatchBg"
f1_local5:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
height = 64 * f0_local0,
width = 64 * f0_local0,
material = f1_local0
} )
f1_local5:animateToState( "default", 0 )
local f1_local6 = LUI.UIImage.new()
f1_local6.id = "playerCardPatch"
f1_local6:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
height = 64 * f0_local0,
width = 64 * f0_local0,
material = f1_local0
} )
f1_local6:animateToState( "default", 0 )
local f1_local7 = LUI.UIMarqueeText.new()
f1_local7.id = "playerCardNameText"
f1_local7:setText( "" )
f1_local7:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 13,
left = 75,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 255,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Left
} )
f1_local7:animateToState( "default", 0 )
local f1_local8 = LUI.UIText.new()
f1_local8.id = "playerCardQuipText"
f1_local8:setText( "" )
f1_local8:setTextStyle( CoD.TextStyle.Shadowed )
f1_local8:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -38,
left = 75,
height = CoD.TextSettings.HudEuroMedTinyFont.Height,
width = 512,
font = CoD.TextSettings.HudEuroMedTinyFont.Font,
alignment = LUI.Alignment.Left
} )
f1_local8:animateToState( "default", 0 )
local f1_local9 = LUI.UIText.new()
f1_local9.id = "playerCardClanTagText"
f1_local9:setText( "" )
f1_local9:setTextStyle( CoD.TextStyle.Shadowed )
f1_local9:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -15,
left = 75,
height = CoD.TextSettings.HudEuroMedTinyFont.Height,
width = 512,
font = CoD.TextSettings.HudEuroMedTinyFont.Font,
alignment = LUI.Alignment.Left
} )
f1_local9:animateToState( "default", 0 )
local f1_local10 = LUI.UIImage.new()
f1_local10.id = "playerCardRankIcon"
f1_local10:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -13,
right = -90,
height = 32,
width = 32,
material = f1_local0
} )
f1_local10:animateToState( "default", 0 )
local f1_local11 = LUI.UIText.new()
f1_local11.id = "playerCardRankText"
f1_local11:setText( "" )
f1_local11:setTextStyle( CoD.TextStyle.Outlined )
f1_local11:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -9,
right = -47,
height = CoD.TextSettings.HudEuroBigFont.Height + 10,
width = 64,
font = CoD.TextSettings.HudEuroBigFont.Font,
alignment = LUI.Alignment.Right,
red = 1,
green = 1,
blue = 1
} )
f1_local11:animateToState( "default", 0 )
f1_local3:addElement( f1_local4 )
f1_local3:addElement( f1_local5 )
f1_local3:addElement( f1_local6 )
f1_local3:addElement( f1_local7 )
f1_local3:addElement( f1_local8 )
f1_local3:addElement( f1_local9 )
f1_local3:addElement( f1_local10 )
f1_local3:addElement( f1_local11 )
self:addElement( f1_local3 )
return self
end
LUI.MenuBuilder.registerType( "playerCardHudDef", playerCardHudDef )
LockTable( _M )

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,389 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 1250
f0_local1 = 100
f0_local2 = function ( f1_arg0, f1_arg1 )
if f1_arg1.value == -1 then
return
elseif Game.InKillCam() and not MLG.IsMLGSpectator() then
return
end
local f1_local0 = f1_arg0:getChildById( "pointsBgImage" )
local f1_local1 = f1_arg0:getChildById( "pointsContainer" )
local f1_local2 = f1_local1:getChildById( "pointsValueText" )
local f1_local3 = f1_arg0:getChildById( "ghostedPointsContainer" )
local f1_local4 = f1_local3:getChildById( "ghostedPointsValueText" )
if f1_arg1.value >= 0 then
f1_local2:setText( "+" .. f1_arg1.value )
f1_local4:setText( "+" .. f1_arg1.value )
else
f1_local2:setText( "-" .. f1_arg1.value )
f1_local4:setText( "-" .. f1_arg1.value )
end
local f1_local5 = MBh.AnimateSequence( {
{
"opening",
0
},
{
"active",
f0_local1
},
{
"active",
f0_local0
},
{
"default",
50
},
{
"default",
50
},
{
"active",
0
},
{
"active",
50
},
{
"default",
50
},
{
"default",
50
},
{
"active",
0
},
{
"active",
50
},
{
"default",
150
}
} )
f1_local5( f1_local1 )
f1_local5 = MBh.AnimateSequence( {
{
"default",
0
},
{
"default",
f0_local1
},
{
"active",
0
},
{
"closing",
350
}
} )
f1_local5( f1_local3 )
f1_local5 = MBh.AnimateSequence( {
{
"default",
0
},
{
"default",
f0_local1
},
{
"active",
0
},
{
"closing",
250
}
} )
f1_local5( f1_local0 )
end
local f0_local3 = function ( f2_arg0, f2_arg1 )
local f2_local0 = f2_arg0:getChildById( "pointsBgImage" )
local f2_local1 = f2_arg0:getChildById( "pointsContainer" )
local f2_local2 = f2_arg0:getChildById( "ghostedPointsContainer" )
f2_local1:animateToState( "default" )
f2_local2:animateToState( "closing" )
f2_local0:animateToState( "closing" )
end
local f0_local4 = function ( f3_arg0, f3_arg1 )
local f3_local0 = f3_arg0:getChildById( "pointsDescText" )
if Game.InKillCam() and not MLG.IsMLGSpectator() then
return
end
f3_local0:setText( Engine.Localize( "@" .. Engine.TableLookupByRow( XPEventTable.File, f3_arg1.value, XPEventTable.Cols.Name ) ) )
local f3_local1 = MBh.AnimateSequence( {
{
"opening",
0
},
{
"opening",
f0_local1
},
{
"active",
150
},
{
"active",
f0_local0
},
{
"closing",
100
}
} )
f3_local1( f3_local0 )
f3_local1 = Engine.TableLookupByRow( XPEventTable.File, f3_arg1.value, XPEventTable.Cols.Sound )
if f3_local1 and f3_local1 ~= "null" then
Engine.PlaySound( f3_local1 )
end
end
local f0_local5 = function ( f4_arg0, f4_arg1 )
local f4_local0 = f4_arg0:getChildById( "pointsDescText" )
f4_local0:animateToState( "closing" )
end
LUI.MenuBuilder.registerType( "pointsPopupHudDef", function ()
local f5_local0 = RegisterMaterial( "pointflash" )
local self = LUI.UIElement.new()
self.id = "pointsPopupHud"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -85,
left = 25,
bottom = CoD.TextSettings.HudEuroNormalFont.Height - 85,
right = 57
} )
self:animateToState( "default", 0 )
self:registerOmnvarHandler( "ui_points_popup", f0_local2 )
self:registerOmnvarHandler( "ui_points_popup_desc", f0_local4 )
if MLG.IsMLGSpectator() then
self:registerEventHandler( "playerstate_client_changed", function ( element, event )
f0_local3( element, event )
f0_local5( element, event )
end )
end
local f5_local2 = LUI.UIImage.new()
f5_local2.id = "pointsBgImage"
f5_local2:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -128,
left = -128,
bottom = 128,
right = 128,
material = f5_local0,
alpha = 0
} )
f5_local2:animateToState( "default", 0 )
f5_local2:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -128,
left = -128,
bottom = 128,
right = 128,
material = f5_local0,
alpha = 1
} )
f5_local2:registerAnimationState( "closing", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 256,
left = -640,
bottom = -256,
right = 640,
material = f5_local0,
alpha = 0
} )
local f5_local3 = CoD.TextSettings.HudEuroNormalFont.Height * 0.5
local f5_local4 = 128
local f5_local5 = LUI.UIElement.new()
f5_local5.id = "pointsContainer"
f5_local5:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local3,
left = -f5_local4,
bottom = f5_local3,
right = f5_local4,
alpha = 0
} )
f5_local5:animateToState( "default", 0 )
f5_local5:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local3 * 10,
left = -f5_local4 * 10,
bottom = f5_local3 * 10,
right = f5_local4 * 10,
alpha = 0
} )
f5_local5:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local3,
left = -f5_local4,
bottom = f5_local3,
right = f5_local4,
alpha = 1
} )
local f5_local6 = LUI.UIText.new()
f5_local6.id = "pointsValueText"
f5_local6:setText( "" )
f5_local6:setTextStyle( CoD.TextStyle.Shadowed )
f5_local6:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alignment = LUI.Alignment.Center,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b
} )
f5_local6:animateToState( "default", 0 )
f5_local5:addElement( f5_local6 )
local f5_local7 = LUI.UIElement.new()
f5_local7.id = "ghostedPointsContainer"
f5_local7:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local3,
left = -f5_local4,
bottom = f5_local3,
right = f5_local4,
alpha = 0
} )
f5_local7:animateToState( "default", 0 )
f5_local7:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local3,
left = -f5_local4,
bottom = f5_local3,
right = f5_local4,
alpha = 0.75
} )
f5_local7:registerAnimationState( "closing", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local3 * 2,
left = -f5_local4 * 2,
bottom = f5_local3 * 2,
right = f5_local4 * 2,
alpha = 0
} )
local f5_local8 = LUI.UIText.new()
f5_local8.id = "ghostedPointsValueText"
f5_local8:setText( "" )
f5_local8:setTextStyle( CoD.TextStyle.Shadowed )
f5_local8:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alignment = LUI.Alignment.Center
} )
f5_local8:animateToState( "default", 0 )
f5_local7:addElement( f5_local8 )
local f5_local9 = LUI.UIText.new()
f5_local9.id = "pointsDescText"
f5_local9:setText( "" )
f5_local9:setTextStyle( CoD.TextStyle.Shadowed )
f5_local9:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local3 + 20,
left = -f5_local4,
bottom = f5_local3 + 20,
right = f5_local4,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alignment = LUI.Alignment.Center,
alpha = 0
} )
f5_local9:animateToState( "default", 0 )
f5_local9:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local3 + 20,
left = -f5_local4 - 100,
bottom = f5_local3 + 20,
right = f5_local4 - 100,
alpha = 0
} )
f5_local9:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local3 + 20,
left = -f5_local4,
bottom = f5_local3 + 20,
right = f5_local4,
alpha = 1
} )
f5_local9:registerAnimationState( "closing", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f5_local3 + 20,
left = -f5_local4 + 100,
bottom = f5_local3 + 20,
right = f5_local4 + 100,
alpha = 0
} )
self:addElement( f5_local2 )
self:addElement( f5_local7 )
self:addElement( f5_local5 )
self:addElement( f5_local9 )
return self
end )
LockTable( _M )

View File

@ -0,0 +1,274 @@
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 Engine.IsConsoleGame() then
local f1_local0 = f1_arg0:getChildById( "predatorMissileControlsVLId" )
local f1_local1 = f1_local0:getChildById( "steeringTextId" )
if IsCurrentSticksLayoutSouthpaw() then
f1_local1:setText( Engine.Localize( "@PLATFORM_PREDATOR_MISSILE_AIM_SOUTHPAW" ) )
elseif IsCurrentSticksLayoutLegacy() or IsCurrentSticksLayoutLegacySouthpaw() then
f1_local1:setText( Engine.Localize( "@PLATFORM_PREDATOR_MISSILE_AIM_LEGACY" ) )
else
f1_local1:setText( Engine.Localize( "@PLATFORM_PREDATOR_MISSILE_AIM" ) )
end
end
if f1_arg1.value == 1 then
f1_arg0:animateToState( "active", 0 )
local f1_local0 = f1_arg0:getChildById( "predatorMissileReticleImageId" )
local f1_local2 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
150
},
{
"active",
0
}
} )
f1_local2( f1_local0 )
f1_local2 = f1_arg0:getChildById( "predatorMissileControlsVLId" )
local f1_local3 = MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
150
}
} )
f1_local3( f1_local2 )
elseif f1_arg1.value == 2 then
local f1_local0 = f1_arg0:getChildById( "predatorMissileStaticId" )
f1_local0:animateToState( "active", 0 )
local f1_local1 = f1_arg0:getChildById( "predatorMissileReticleImageId" )
f1_local1:animateToState( "default", 0 )
local f1_local2 = f1_arg0:getChildById( "predatorMissileControlsVLId" )
f1_local2:animateToState( "default", 0 )
else
f1_arg0:animateToState( "default", 0 )
local f1_local0 = f1_arg0:getChildById( "predatorMissileStaticId" )
f1_local0:animateToState( "default", 0 )
end
end
f0_local1 = function ( f2_arg0, f2_arg1 )
local f2_local0 = f2_arg0:getChildById( "predatorMissileControlsVLId" )
local f2_local1 = f2_local0:getChildById( "steeringTextId" )
local f2_local2 = f2_local0:getChildById( "boostTextId" )
f2_local1:setText( Engine.Localize( "@PLATFORM_PREDATOR_MISSILE_AIM" ) )
if Game.GetOmnvar( "ui_predator_missiles_left" ) > 0 then
f2_local2:setText( Engine.Localize( "@PLATFORM_PREDATOR_MISSILE_FIRE" ) )
end
f2_local2:setText( Engine.Localize( "@PLATFORM_PREDATOR_MISSILE_BOOST" ) )
end
function predatorMissileOverlayDef()
local f3_local0 = RegisterMaterial( "white" )
local f3_local1 = RegisterMaterial( "ac130_overlay_grain" )
local f3_local2 = RegisterMaterial( "missilecam_reticle" )
local f3_local3, f3_local4 = GameX.GetScreenDims()
local self = LUI.UIElement.new()
self.id = "predatorMissileOverlayContainerId"
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_predator_missile", f0_local0 )
self:registerEventHandler( "init_overlay", f0_local0 )
self:registerEventHandler( "refresh_controls", f0_local1 )
local f3_local6 = LUI.UIImage.new()
f3_local6.id = "predatorMissileOverlayImageId"
f3_local6:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f3_local1,
red = 0.9,
green = 1,
blue = 1,
alpha = 0.3
} )
f3_local6:animateToState( "default", 0 )
local f3_local7 = LUI.UIImage.new()
f3_local7.id = "predatorMissileReticleImageId"
f3_local7:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f3_local2,
alpha = 0
} )
f3_local7:animateToState( "default", 0 )
f3_local7:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -(f3_local4 * 0.5) - 80,
left = -(f3_local3 * 0.5) - 80,
bottom = f3_local4 * 0.5 + 80,
right = f3_local3 * 0.5 + 80,
material = f3_local2,
alpha = 0.5
} )
f3_local7:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -f3_local4 * 0.5,
left = -f3_local3 * 0.5,
bottom = f3_local4 * 0.5,
right = f3_local3 * 0.5,
material = f3_local2,
alpha = 1
} )
local f3_local8 = LUI.UIVerticalList.new()
f3_local8.id = "predatorMissileControlsVLId"
f3_local8:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = -80,
left = -256,
right = 256,
height = 64,
alpha = 0,
spacing = 0
} )
f3_local8:animateToState( "default", 0 )
f3_local8:registerAnimationState( "active", {
alpha = 1
} )
local f3_local9 = LUI.UIText.new()
f3_local9.id = "steeringTextId"
f3_local9:setText( Engine.Localize( "@PLATFORM_PREDATOR_MISSILE_AIM" ) )
f3_local9:setTextStyle( CoD.TextStyle.Shadowed )
f3_local9:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
left = 0,
right = 0,
height = CoD.TextSettings.HudEuroBigFont.Height,
font = CoD.TextSettings.HudEuroBigFont.Font,
alignment = LUI.Alignment.Center
} )
f3_local9:animateToState( "default", 0 )
local f3_local10 = function ()
if Game.GetOmnvar( "ui_predator_missiles_left" ) > 0 then
return Engine.Localize( "@PLATFORM_PREDATOR_MISSILE_FIRE" )
else
return Engine.Localize( "@PLATFORM_PREDATOR_MISSILE_BOOST" )
end
end
local f3_local11 = LUI.UIText.new()
f3_local11.id = "boostTextId"
f3_local11:setText( f3_local10() )
f3_local11:setTextStyle( CoD.TextStyle.Shadowed )
f3_local11:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
left = 0,
right = 0,
height = CoD.TextSettings.HudEuroBigFont.Height,
font = CoD.TextSettings.HudEuroBigFont.Font,
alignment = LUI.Alignment.Center
} )
f3_local11:animateToState( "default", 0 )
f3_local11:registerOmnvarHandler( "ui_predator_missiles_left", function ( f5_arg0, f5_arg1 )
f5_arg0:setText( f3_local10() )
end )
f3_local8:addElement( f3_local9 )
f3_local8:addElement( f3_local11 )
local f3_local12 = LUI.UIElement.new()
f3_local12.id = "predatorMissileStaticId"
f3_local12:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
alpha = 0
} )
f3_local12:animateToState( "default", 0 )
f3_local12:registerAnimationState( "active", {
alpha = 1
} )
local f3_local13 = LUI.UIImage.new()
f3_local13.id = "predatorMissileWhiteImageId"
f3_local13:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f3_local0
} )
f3_local13:animateToState( "default", 0 )
local f3_local14 = LUI.UIImage.new()
f3_local14.id = "predatorMissileStaticImageId"
f3_local14:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f3_local1
} )
f3_local14:animateToState( "default", 0 )
f3_local12:addElement( f3_local13 )
f3_local12:addElement( f3_local14 )
self:addElement( f3_local6 )
self:addElement( f3_local7 )
self:addElement( f3_local8 )
self:addElement( f3_local12 )
return self
end
LUI.MenuBuilder.registerType( "predatorMissileOverlayDef", predatorMissileOverlayDef )
LockTable( _M )

View File

@ -0,0 +1,519 @@
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 and f1_arg0.current_state ~= "active" then
f1_arg0:animateToState( "active", 0 )
f1_arg0.current_state = "active"
elseif not f1_arg1.value and f1_arg0.current_state ~= "default" then
f1_arg0:animateToState( "default", 0 )
f1_arg0.current_state = "default"
end
end
f0_local1 = function ( f2_arg0, f2_arg1, f2_arg2, f2_arg3 )
local f2_local0 = 128
local self = LUI.UIImage.new()
self.id = "predText" .. tostring( f2_arg0 ) .. "id"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = f2_arg2 - f2_local0 / 2,
right = f2_arg1,
zRot = f2_arg3,
width = f2_local0,
height = f2_local0,
material = RegisterMaterial( "ui_predator_text01" ),
alpha = 1
} )
self:registerAnimationState( "1", {
material = RegisterMaterial( "ui_predator_text01" )
} )
self:registerAnimationState( "2", {
material = RegisterMaterial( "ui_predator_text02" )
} )
self:registerAnimationState( "3", {
material = RegisterMaterial( "ui_predator_text03" )
} )
self:registerAnimationState( "4", {
material = RegisterMaterial( "ui_predator_text04" )
} )
self:animateToState( "default", 0 )
local f2_local2 = 250
local f2_local3 = 750
local f2_local4 = 4
local f2_local5 = 11 + 2 * (f2_arg0 - 1)
local f2_local6 = {}
for f2_local7 = 1, f2_local5, 1 do
local f2_local10 = f2_local7
table.insert( f2_local6, {
tostring( math.random( f2_local4 ) ),
math.random( f2_local2, f2_local3 )
} )
end
local f2_local8 = MBh.AnimateLoop( f2_local6 )
f2_local8( self )
return self
end
f0_local2 = function ()
local f3_local0 = GameX.IsSplitscreen() and 192 or 384
local self = LUI.UIImage.new()
self.id = "predatorGraphId"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = -0.5 * f3_local0,
left = 0,
width = 0.5 * f3_local0,
height = f3_local0,
material = RegisterMaterial( "ui_predator_graph_01" ),
alpha = 1
} )
self:registerAnimationState( "1", {
material = RegisterMaterial( "ui_predator_graph_02" )
} )
self:registerAnimationState( "2", {
material = RegisterMaterial( "ui_predator_graph_03" )
} )
self:registerAnimationState( "3", {
material = RegisterMaterial( "ui_predator_graph_04" )
} )
self:animateToState( "default", 0 )
local f3_local2 = MBh.AnimateLoop( {
{
"3",
100
},
{
"1",
100
},
{
"2",
50
},
{
"3",
50
},
{
"2",
100
},
{
"default",
3000
}
} )
f3_local2( self )
return self
end
local f0_local3 = function ()
local f4_local0 = 192
local self = LUI.UIImage.new()
self.id = "predatorScanlineId"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = -f4_local0,
right = undefined,
width = f4_local0,
material = RegisterMaterial( "ui_predator_wipe" ),
alpha = 1
} )
self:registerAnimationState( "swipe", {
leftAnchor = false,
rightAnchor = true,
left = undefined,
right = f4_local0
} )
self:registerOmnvarHandler( "ui_predator_hud_scanline", function ( f5_arg0, f5_arg1 )
if f5_arg1.value then
self:animateToState( "default", 0 )
self:animateToState( "swipe", 125 )
else
self:animateToState( "default", 0 )
end
end )
self:animateToState( "default", 0 )
return self
end
local f0_local4 = function ( f6_arg0, f6_arg1 )
if f6_arg1.value == 0 then
f6_arg0:animateToState( "default", 0 )
LUI.UITimer.Stop( f6_arg0.positionTimer )
elseif f6_arg1.value == 2 then
f6_arg0:dispatchEventToChildren( {
name = "reticleLocked"
} )
elseif f6_arg1.value == 1 then
f6_arg0:animateToState( "active", 0 )
LUI.UITimer.Reset( f6_arg0.positionTimer )
f6_arg0:dispatchEventToChildren( {
name = "reticleZoom"
} )
end
end
local f0_local5 = function ( f7_arg0, f7_arg1, f7_arg2, f7_arg3, f7_arg4, f7_arg5, f7_arg6, f7_arg7 )
local self = LUI.UIImage.new()
self.id = f7_arg0
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f7_arg2,
left = f7_arg3,
height = 128,
width = 128,
material = RegisterMaterial( f7_arg1 ),
zRot = f7_arg4,
alpha = 0
} )
self:registerAnimationState( "on", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f7_arg2,
left = f7_arg3,
height = 128,
width = 128,
zRot = f7_arg4,
alpha = 1
} )
self:registerAnimationState( "dim", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f7_arg2,
left = f7_arg3,
height = 128,
width = 128,
zRot = f7_arg4,
alpha = 0.25
} )
self:registerAnimationState( "large", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = f7_arg6,
left = f7_arg7,
height = 500,
width = 500,
zRot = f7_arg4,
alpha = 1
} )
local f7_local1 = 50
self:animateToState( "default", 0 )
self:registerEventHandler( "reticleLocked", MBh.AnimateSequence( {
{
"dim",
f7_local1
},
{
"on",
f7_local1
},
{
"dim",
f7_local1
},
{
"on",
f7_local1
},
{
"dim",
f7_local1
},
{
"on",
f7_local1
}
} ) )
self:registerEventHandler( "reticleZoom", MBh.AnimateSequence( {
{
"default",
0
},
{
"large",
0
},
{
"on",
f7_arg5
}
} ) )
return self
end
local f0_local6 = function ()
local self = LUI.UIElement.new()
self.id = "predatorReticleConainterId"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
width = 1,
height = 1,
alpha = 0
} )
self:registerAnimationState( "active", {
alpha = 1
} )
self:animateToState( "default", 0 )
local f8_local1 = LUI.UITimer.new( 16, "updateTargetPos", nil, false, false, false, true )
f8_local1.id = "predatorReticleTimerId"
self.positionTimer = f8_local1
self:addElement( f8_local1 )
self:registerEventHandler( "updateTargetPos", function ( element, event )
local f9_local0 = Game.GetOmnvar( "ui_predator_target_ent" )
if f9_local0 > -1 then
local f9_local1, f9_local2 = Game.GetScreenLocation( f9_local0, "j_spineupper" )
if f9_local1 and f9_local2 then
local f9_local3, f9_local4 = nil
local f9_local5 = ScreenResolution[currentScreenResolution]
element:registerAnimationState( "position", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = LUI.clamp( f9_local2, 0, f9_local5.height ),
left = LUI.clamp( f9_local1, 0, f9_local5.width ),
width = 0,
height = 0,
alpha = 1
} )
element:animateToState( "position", 0 )
end
end
end )
self:registerOmnvarHandler( "ui_predator_hud_reticle", f0_local4 )
for f8_local5, f8_local6 in pairs( {
{
elementName = "predatorReticleBottomId",
imageName = "ui_predator_reticle_bottom",
vertOffset = -50,
horizOffset = -60,
zRot = 0,
zoomInTime = 375,
zoomInVert = 500,
zoomInHoriz = -60
},
{
elementName = "predatorReticleRightId",
imageName = "ui_predator_reticle_side",
vertOffset = -82,
horizOffset = -46,
zRot = 0,
zoomInTime = 375,
zoomInVert = -800,
zoomInHoriz = 800
},
{
elementName = "predatorReticleLeftId",
imageName = "ui_predator_reticle_side",
vertOffset = -76,
horizOffset = -84,
zRot = 122,
zoomInTime = 375,
zoomInVert = -800,
zoomInHoriz = -800
}
} ) do
self:addElement( f0_local5( f8_local6.elementName, f8_local6.imageName, f8_local6.vertOffset, f8_local6.horizOffset, f8_local6.zRot, f8_local6.zoomInTime, f8_local6.zoomInVert, f8_local6.zoomInHoriz ) )
end
return self
end
local f0_local7 = function ( f10_arg0, f10_arg1, f10_arg2 )
local self = LUI.UIText.new()
self.id = f10_arg0
self:setText( Engine.Localize( f10_arg1 ) )
self:setTextStyle( CoD.TextStyle.Shadowed )
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
left = 0,
right = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = 1,
green = 1,
blue = 1,
alignment = f10_arg2,
alpha = 1
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "flash1", {
red = 1,
green = 0,
blue = 0,
alpha = 0.5
} )
self:registerAnimationState( "flash2", {
red = 1,
green = 1,
blue = 1,
alpha = 0.25
} )
self:registerEventHandler( "flashing", MBh.AnimateLoop( {
{
"flash1",
250
},
{
"flash2",
250
}
} ) )
self:registerEventHandler( "stop_flashing", MBh.AnimateToState( "default", 0 ) )
return self
end
local f0_local8 = function ( f11_arg0, f11_arg1, f11_arg2, f11_arg3, f11_arg4 )
local f11_local0 = "Right"
local f11_local1 = LUI.Alignment.Left
local f11_local2 = 600
local f11_local3 = undefined
local f11_local4 = f11_local2
if f11_arg3 then
f11_local0 = "Left"
f11_local1 = LUI.Alignment.Right
f11_local3 = -f11_local2
f11_local4 = undefined
end
local f11_local5 = f11_arg0 .. f11_local0
local self = LUI.UIElement.new()
self.id = f11_local5
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
left = f11_local3,
right = f11_local4,
top = f11_arg4,
bottom = f11_arg4 + 64,
width = 512,
alpha = 0
} )
self:registerAnimationState( "active", {
alpha = 1
} )
self:registerAnimationState( "blink", {
alpha = 0.5
} )
self:animateToState( "default", 0 )
local f11_local7 = LUI.UIVerticalList.new()
f11_local7.id = f11_local5 .. "vList"
f11_local7:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
spacing = 20
} )
f11_local7:animateToState( "default", 0 )
f11_local7:addElement( f0_local7( f11_local5 .. "Trigger", f11_arg2, f11_local1 ) )
self:addElement( f11_local7 )
return self
end
LUI.MenuBuilder.registerType( "juggPredatorOverlayDef", function ()
local self = LUI.UIElement.new()
self.id = "juggPredatorOverlayContainerId"
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:registerAnimationState( "active", {
alpha = 1
} )
self:registerOmnvarHandler( "ui_predator_hud_graph", f0_local0 )
self:registerEventHandler( "init_overlay", f0_local0 )
local f12_local1 = LUI.UIImage.new()
f12_local1.id = "juggPredatorOverlayImgId"
f12_local1:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
material = RegisterMaterial( "ui_predator_overlay" ),
alpha = 1
} )
f12_local1:animateToState( "default", 0 )
self:addElement( f12_local1 )
local f12_local2 = 128
if GameX.IsSplitscreen() then
f12_local2 = 36
end
local f12_local3 = f0_local8( "predatorControls", "@MP_JUGG_PREDATOR_UI_CLOAK", "@MP_JUGG_PREDATOR_UI_VISION", true, f12_local2 )
self:addElement( f12_local3 )
f12_local3:animateToState( "active" )
local f12_local4 = f0_local8( "predatorControls", "@MP_JUGG_PREDATOR_UI_VISION", "@MP_JUGG_PREDATOR_UI_FIRE", false, f12_local2 )
f12_local4:registerOmnvarHandler( "ui_predator_hud_reticle", function ( f13_arg0, f13_arg1 )
if f13_arg1.value == 0 then
f13_arg0:animateToState( "default", 0 )
elseif f13_arg1.value == 2 then
f13_arg0:animateToState( "active", 1 )
elseif f13_arg1.value == 3 then
local f13_local0 = MBh.AnimateLoop( {
{
"blink",
250
},
{
"active",
250
}
} )
f13_local0( f13_arg0, f13_arg1 )
end
end )
self:addElement( f12_local4 )
self:addElement( f0_local2() )
local f12_local5 = nil
if not GameX.IsSplitscreen() then
self:addElement( f0_local1( 0, -45, -120, 25 ) )
self:addElement( f0_local1( 3, -45, 110, -50 ) )
end
self:addElement( f0_local1( 1, -20, -50, 0 ) )
self:addElement( f0_local1( 2, -20, 30, 0 ) )
self:addElement( f0_local6() )
self:addElement( f0_local3() )
return self
end )
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,184 @@
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
if type( nil ) ~= "boolean" then
f1_local0 = f1_arg1.value
else
f1_local0 = f1_arg1.value ~= 0
end
if f1_local0 then
local f1_local1 = MBh.AnimateSequence( {
{
"opening",
0
},
{
"active",
f1_arg0.properties.open_time or 100
},
{
"default",
f1_arg0.properties.fade_time or 2000
}
} )
f1_local1( f1_arg0 )
else
f1_arg0:animateToState( "default", 0 )
end
end
f0_local1 = function ( f2_arg0, f2_arg1, f2_arg2, f2_arg3, f2_arg4 )
local f2_local0, f2_local1 = GameX.GetScreenDims()
f2_local0 = f2_local0 / 2
f2_local1 = f2_local1 / 2
local f2_local2 = f2_arg2 == LUI.Alignment.Left
local f2_local3 = f2_arg2 == LUI.Alignment.Center
local f2_local4 = f2_arg2 == LUI.Alignment.Right
local self = LUI.UIImage.new()
self.id = "screen_effect_" .. f2_arg0
local f2_local6 = self
local f2_local7 = self.registerAnimationState
local f2_local8 = "default"
local f2_local9 = {
material = RegisterMaterial( f2_arg0 ),
topAnchor = false,
bottomAnchor = false,
leftAnchor = not f2_local4,
rightAnchor = not f2_local2,
bottom = f2_local1
}
local f2_local10
if f2_arg3 then
f2_local10 = 0
if not f2_local10 then
else
f2_local9.top = f2_local10
if f2_local4 then
f2_local10 = -2 * f2_local0
if not f2_local10 then
else
f2_local9.left = f2_local10
if f2_local2 then
f2_local10 = 2 * f2_local0
if not f2_local10 then
else
f2_local9.right = f2_local10
f2_local9.alpha = 0
f2_local7( f2_local6, f2_local8, f2_local9 )
self:animateToState( "default" )
f2_local6 = self
f2_local7 = self.registerAnimationState
f2_local8 = "active"
f2_local9 = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = not f2_local4,
rightAnchor = not f2_local2,
bottom = f2_local1
}
if f2_arg3 then
f2_local10 = 0
if not f2_local10 then
else
f2_local9.top = f2_local10
if f2_local4 then
f2_local10 = -2 * f2_local0
if not f2_local10 then
else
f2_local9.left = f2_local10
if f2_local2 then
f2_local10 = 2 * f2_local0
if not f2_local10 then
else
f2_local9.right = f2_local10
f2_local9.alpha = f2_arg1
f2_local7( f2_local6, f2_local8, f2_local9 )
f2_local6 = self
f2_local7 = self.registerAnimationState
f2_local8 = "opening"
f2_local9 = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = not f2_local4,
rightAnchor = not f2_local2,
bottom = f2_local1
}
if f2_arg3 then
f2_local10 = 0
if not f2_local10 then
else
f2_local9.top = f2_local10
f2_local9.left = 0
f2_local9.right = 0
f2_local9.alpha = 0
f2_local7( f2_local6, f2_local8, f2_local9 )
self:registerOmnvarHandler( f2_arg4, f0_local0 )
return self
end
end
f2_local10 = -f2_local1
end
end
f2_local10 = 0
end
end
f2_local10 = 0
end
end
f2_local10 = -f2_local1
end
end
f2_local10 = 0
end
end
f2_local10 = 0
end
end
f2_local10 = -f2_local1
end
function screenEffectsHudDef()
local self = LUI.UIElement.new()
self.id = "screenEffectsHudId"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0
} )
self:animateToState( "default" )
return self
end
function lowHealthHudDef()
local self = LUI.UILitImage.new()
self.id = "lowHealthHudDefId"
self:setupOwnerdraw( CoD.Ownerdraw.CGLowHealthOverlay )
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = RegisterMaterial( "vfx_blood_screen_overlay" )
} )
self:animateToState( "default", 0 )
return self
end
LUI.MenuBuilder.registerType( "lowHealthHudDef", lowHealthHudDef )
LUI.MenuBuilder.registerType( "screenEffectsHudDef", screenEffectsHudDef )
LockTable( _M )

View File

@ -0,0 +1,140 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function UpdateSpectator( f1_arg0, f1_arg1 )
local f1_local0 = f1_arg0:getChildById( "spectatorPlayerCard" )
local f1_local1 = Game.GetPlayerstateClientnum()
if f1_local0.current_client_num ~= f1_local1 then
local f1_local2 = f1_local0:getFirstDescendentById( "playerCardBg" )
local f1_local3 = f1_local0:getFirstDescendentById( "playerCardPatchBg" )
local f1_local4 = f1_local0:getFirstDescendentById( "playerCardPatch" )
local f1_local5 = f1_local0:getFirstDescendentById( "playerCardQuipText" )
local f1_local6 = f1_local0:getFirstDescendentById( "playerCardClanTagText" )
local f1_local7 = f1_local0:getFirstDescendentById( "playerCardRankIcon" )
local f1_local8 = f1_local0:getFirstDescendentById( "playerCardRankText" )
local f1_local9 = f1_local0:getFirstDescendentById( "playerCardNameText" )
local f1_local10 = nil
if f1_local1 ~= -1 then
f1_local10 = Game.GetPlayerScoreInfo( f1_local1 )
end
if f1_local10 and f1_local1 ~= Game.GetPlayerClientnum() then
f1_local8:setText( "" )
if f1_local10.rank then
f1_local8:setText( f1_local10.rank + 1 )
end
local f1_local11 = f1_local10.name or ""
f1_local6:setText( "" )
if Engine.IsConsoleGame() and string.sub( f1_local11, 1, 1 ) == "[" then
local f1_local12 = string.find( f1_local11, "]" )
if f1_local12 then
f1_local6:setText( string.sub( f1_local11, 1, f1_local12 ) )
f1_local11 = string.sub( f1_local11, f1_local12 + 1 )
end
end
f1_local9:setText( f1_local11 )
if f1_local10.rankIcon then
CoD.SetMaterial( f1_local7, f1_local10.rankIcon )
end
local f1_local12 = Game.GetPlayerCard( f1_local1 )
CoD.SetMaterial( f1_local2, RegisterMaterial( Engine.TableLookup( BackgroundsTable.File, BackgroundsTable.Cols.Ref, f1_local12.background, BackgroundsTable.Cols.CardImage ) ) )
CoD.SetMaterial( f1_local3, RegisterMaterial( Engine.TableLookup( PatchBackingsTable.File, PatchBackingsTable.Cols.Ref, f1_local12.patchBacking, PatchBackingsTable.Cols.CardImage ) ) )
CoD.SetMaterial( f1_local4, RegisterMaterial( Engine.TableLookup( PatchesTable.File, PatchesTable.Cols.Ref, f1_local12.patch, PatchesTable.Cols.CardImage ) ) )
f1_local5:setText( Engine.Localize( Engine.TableLookup( PatchesTable.File, PatchesTable.Cols.Ref, f1_local12.patch, PatchesTable.Cols.Quip ) ) )
local f1_local13 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
150
},
{
"active",
150
}
} )
f1_local13( f1_local0 )
else
f1_local0:animateToState( "default", 0 )
end
f1_local0.current_client_num = f1_local1
end
end
LUI.MenuBuilder.registerType( "spectatorHudDef", function ()
local self = LUI.UIElement.new()
self.id = "spectatorHud"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0
} )
self:animateToState( "default", 0 )
self:registerEventHandler( "hud_refresh", UpdateSpectator )
local f2_local1 = LUI.UIText.new()
f2_local1.id = "spectatorTextId"
f2_local1:setText( Engine.Localize( "@LUA_MENU_SPECTATING_CAPS" ) )
f2_local1:setTextStyle( CoD.TextStyle.Shadowed )
f2_local1:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 60,
left = -512,
height = CoD.TextSettings.HudEuroBigFont.Height,
right = 512,
font = CoD.TextSettings.HudEuroBigFont.Font,
alpha = 0.6
} )
f2_local1:animateToState( "default", 0 )
local f2_local2 = LUI.UIElement.new()
f2_local2.id = "spectatorPlayerCard"
f2_local2:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = -60,
left = -512,
height = 64,
width = 256,
alpha = 0
} )
f2_local2:animateToState( "default", 0 )
f2_local2:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = -60,
left = -128,
height = 64,
width = 256,
alpha = 1
} )
f2_local2:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = -60,
left = -118,
height = 64,
width = 256,
alpha = 1
} )
f2_local2:addElement( LUI.mp_hud.PlayerCardHud.playerCardHudDef() )
self:addElement( f2_local1 )
self:addElement( f2_local2 )
self:addElement( LUI.mp_hud.Hints.spectatorControlsDef() )
return self
end )
LockTable( _M )

View File

@ -0,0 +1,825 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 89.6
f0_local1 = 358.4
f0_local2 = function ( f1_arg0, f1_arg1 )
local f1_local0 = tonumber( Engine.TableLookupByRow( SplashTable.File, f1_arg0, SplashTable.Cols.Duration ) ) * 1000
local f1_local1 = Engine.TableLookupByRow( SplashTable.File, f1_arg0, SplashTable.Cols.Image )
local f1_local2 = Engine.Localize( Engine.TableLookupByRow( SplashTable.File, f1_arg0, SplashTable.Cols.Name ), f1_arg1 )
local f1_local3 = ""
if f1_arg0 == 37 then
f1_local3 = Engine.Localize( Engine.TableLookupByRow( SplashTable.File, f1_arg0, SplashTable.Cols.Desc ), Engine.Localize( "@" .. Engine.TableLookup( "mp/rankTable.csv", 0, f1_arg1, 5 ) ) )
else
f1_local3 = Engine.Localize( Engine.TableLookupByRow( SplashTable.File, f1_arg0, SplashTable.Cols.Desc ), f1_arg1 )
end
return f1_local0, f1_local1, f1_local2, f1_local3
end
local f0_local3 = function ( f2_arg0, f2_arg1 )
local f2_local0 = f2_arg1.value
if f2_local0 == -1 then
f2_arg0:animateToState( "default", 0 )
return
end
local f2_local1, f2_local2, f2_local3, f2_local4 = f0_local2( f2_local0, Game.GetOmnvar( "ui_splash_optional_number" ) )
local f2_local5 = f2_arg0:getChildById( "splashBackingImageId" )
local f2_local6 = f2_arg0:getChildById( "splashImageId" )
if f2_local2 and string.len( f2_local2 ) ~= 0 then
CoD.SetMaterial( f2_local6, RegisterMaterial( f2_local2 ) )
f2_local5:animateToState( "active", 0 )
f2_local6:animateToState( "active", 0 )
else
f2_local5:animateToState( "default", 0 )
f2_local6:animateToState( "default", 0 )
end
local f2_local7 = f2_arg0:getChildById( "splashNameId" )
f2_local7:setText( f2_local3 )
local f2_local8 = f2_arg0:getChildById( "splashDescId" )
f2_local8:setText( f2_local4 )
local f2_local9 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
150
},
{
"active",
150
},
{
"active",
f2_local1
},
{
"leave",
150
}
} )
f2_local9( f2_arg0 )
end
local f0_local4 = function ( f3_arg0, f3_arg1 )
local f3_local0 = f3_arg1.value
if f3_local0 == -1 then
f3_arg0:animateToState( "default", 0 )
return
end
local f3_local1 = Engine.TableLookupByRow( SplashTable.File, f3_local0, SplashTable.Cols.Ref )
local f3_local2 = tonumber( Engine.TableLookupByRow( SplashTable.File, f3_local0, SplashTable.Cols.Duration ) ) * 1000
local f3_local3 = Game.GetOmnvar( "ui_splash_killstreak_optional_number" )
local f3_local4 = ""
local f3_local5 = Game.GetOmnvar( "ui_splash_killstreak_clientnum" )
if f3_local5 >= 0 then
f3_local4 = Game.GetPlayerName( f3_local5 )
end
local f3_local6 = RegisterMaterial( Engine.TableLookup( KillstreakTable.File, KillstreakTable.Cols.Ref, f3_local1, KillstreakTable.Cols.DPadIcon ) )
local f3_local7 = f3_arg0:getChildById( "earnedKillstreakImageId" )
CoD.SetMaterial( f3_local7, f3_local6 )
local f3_local8 = f3_arg0:getChildById( "earnedKillstreakBackingImageId" )
local f3_local9 = f3_arg0:getChildById( "earnedKillstreakPlayerNameId" )
f3_local9:setText( f3_local4 )
local f3_local10 = Engine.Localize( Engine.TableLookupByRow( SplashTable.File, f3_local0, SplashTable.Cols.Desc ) )
local f3_local11 = f3_arg0:getChildById( "earnedKillstreakNameId" )
f3_local11:setText( f3_local10 )
local f3_local12 = Engine.Localize( Engine.TableLookupByRow( SplashTable.File, f3_local0, SplashTable.Cols.Name ), f3_local3 )
local f3_local13 = f3_arg0:getChildById( "earnedKillstreakDescId" )
f3_local13:setText( f3_local12 )
local f3_local14 = MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
0
},
{
"active",
f3_local2
},
{
"leave",
250
}
} )
f3_local14( f3_arg0 )
f3_local14 = MBh.AnimateSequence( {
{
"start",
0
},
{
"opening",
150
},
{
"active",
150
}
} )
f3_local14( f3_local8 )
f3_local14 = MBh.AnimateSequence( {
{
"start",
0
},
{
"opening",
150
},
{
"active",
150
}
} )
f3_local14( f3_local7 )
f3_local14 = MBh.AnimateSequence( {
{
"start",
0
},
{
"start",
500
},
{
"opening",
100
},
{
"active",
100
}
} )
f3_local14( f3_local11 )
if f3_local3 ~= 0 then
f3_local14 = MBh.AnimateSequence( {
{
"start",
0
},
{
"start",
750
},
{
"opening",
100
},
{
"active",
100
}
} )
f3_local14( f3_local13 )
else
f3_local13:animateToState( "default", 0 )
end
end
local f0_local5 = function ( f4_arg0, f4_arg1 )
local f4_local0 = f4_arg1.value
if f4_local0 == -1 then
f4_arg0:animateToState( "default", 0 )
return
end
local f4_local1 = tonumber( Engine.TableLookupByRow( SplashTable.File, f4_local0, SplashTable.Cols.Duration ) ) * 1000
local f4_local2 = Game.GetOmnvar( "ui_splash_playercard_optional_number" )
local f4_local3 = Game.GetOmnvar( "ui_splash_playercard_clientnum" )
local f4_local4 = Game.GetPlayerTeam( f4_local3 )
local f4_local5 = Game.GetPlayerName( f4_local3 )
local f4_local6 = Game.GetPlayerCard( f4_local3 )
if Engine.IsConsoleGame() and string.sub( f4_local5, 1, 1 ) == "[" then
local f4_local7 = string.find( f4_local5, "]" )
if f4_local7 then
local f4_local8 = string.sub( f4_local5, 1, f4_local7 )
f4_local5 = string.sub( f4_local5, f4_local7 + 1 )
end
end
f4_arg0:setSplashCardData( Engine.TableLookup( PatchesTable.File, PatchesTable.Cols.Ref, f4_local6.patch, PatchesTable.Cols.CardImage ), f4_local5, Engine.Localize( Engine.TableLookupByRow( SplashTable.File, f4_local0, SplashTable.Cols.Name ), f4_local2 ) )
f4_arg0:showSplashCard( f4_local1 )
local f4_local9 = Game.GetPlayerTeam()
local f4_local10 = GameX.gameModeIsFFA()
local f4_local11 = true
if f4_local10 then
local f4_local12 = Game.GetPlayerScoreInfoAtRank( f4_local9, Game.GetPlayerScoreRanking() )
f4_local11 = f4_local5 ~= f4_local12.name
else
f4_local11 = f4_local9 ~= f4_local4
end
local f4_local13 = f4_arg0:getChildById( "cardSplashTitleId" )
if f4_local11 then
f4_local13:SetColor( Colors.orange.r, Colors.orange.g, Colors.orange.b )
else
f4_local13:SetColor( Colors.cyan.r, Colors.cyan.g, Colors.cyan.b )
end
end
local f0_local6 = function ( f5_arg0, f5_arg1 )
local f5_local0 = f5_arg1.value
if f5_local0 == -1 then
f5_arg0:animateToState( "default", 0 )
return
else
local f5_local1, f5_local2, f5_local3, f5_local4 = f0_local2( f5_local0, Game.GetOmnvar( "ui_challenge_splash_optional_number" ) )
f5_arg0:setSplashCardData( f5_local2, f5_local3, f5_local4 )
local f5_local5 = f5_arg0:getChildById( "cardSplashTitleId" )
f5_local5:animateToState( "default", 0 )
f5_arg0:showSplashCard( f5_local1 )
end
end
local f0_local7 = function ( menu, controller )
local self = LUI.UIElement.new()
self.id = menu
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 155,
left = -f0_local1,
height = f0_local0,
width = f0_local1,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 155,
left = 5,
height = f0_local0,
width = f0_local1,
alpha = 1
} )
self:registerAnimationState( "opening", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 155,
left = 25,
height = f0_local0,
width = f0_local1,
alpha = 1
} )
self:registerAnimationState( "leave", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 155,
left = -f0_local1,
height = f0_local0,
width = f0_local1,
alpha = 0
} )
local f6_local1 = LUI.UIImage.new()
f6_local1.id = "cardSplashBgId"
f6_local1:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = controller
} )
f6_local1:animateToState( "default", 0 )
local f6_local2 = LUI.UIImage.new()
f6_local2.id = "cardSplashIconId"
f6_local2:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 15,
left = 0,
height = 64,
width = 64,
material = default_material
} )
f6_local2:animateToState( "default", 0 )
local f6_local3 = 0.58
local f6_local4 = LUI.UIMarqueeText.new()
f6_local4.id = "cardSplashTitleId"
f6_local4:setText( "" )
f6_local4:setTextStyle( CoD.TextStyle.Shadowed )
f6_local4:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 15,
left = 64,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = f0_local1 * f6_local3,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Left,
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b
} )
f6_local4:animateToState( "default", 0 )
local f6_local5 = LUI.UIMarqueeText.new()
f6_local5.id = "cardSplashDescId"
f6_local5:setText( "" )
f6_local5:setTextStyle( CoD.TextStyle.Shadowed )
f6_local5:SetUseTextWrapping( true )
f6_local5:SetTextHeight( CoD.TextSettings.HudEuroMedSmallFont.Height )
f6_local5:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 35,
left = 64,
height = 0,
width = f0_local1 * f6_local3,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Left
} )
f6_local5:animateToState( "default", 0 )
f6_local5:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 35,
left = 64,
height = CoD.TextSettings.HudEuroMedSmallFont.Height * 2,
width = f0_local1 * f6_local3
} )
self:addElement( f6_local1 )
self:addElement( f6_local2 )
self:addElement( f6_local4 )
self:addElement( f6_local5 )
self.setSplashCardData = function ( f7_arg0, f7_arg1, f7_arg2, f7_arg3 )
local f7_local0 = f7_arg0:getChildById( "cardSplashIconId" )
if f7_arg1 and string.len( f7_arg1 ) ~= 0 then
CoD.SetMaterial( f7_local0, RegisterMaterial( f7_arg1 ) )
f7_local0:animateToState( "active", 0 )
end
local f7_local1 = f7_arg0:getChildById( "cardSplashTitleId" )
f7_local1:setText( f7_arg2 )
local f7_local2 = f7_arg0:getChildById( "cardSplashDescId" )
f7_local2:setText( f7_arg3 )
f7_local2:animateToState( "active", 0 )
end
self.showSplashCard = function ( f8_arg0, f8_arg1 )
local f8_local0 = MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
150
},
{
"active",
150
},
{
"active",
f8_arg1
},
{
"leave",
150
}
} )
f8_local0( f8_arg0 )
end
return self
end
LUI.MenuBuilder.registerType( "splashesHudDef", function ()
local f9_local0 = RegisterMaterial( "white" )
local f9_local1 = RegisterMaterial( "hud_message_bg" )
local f9_local2 = RegisterMaterial( "popup_backing" )
local self = LUI.UIElement.new()
self.id = "splashesHud"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0
} )
self:animateToState( "default", 0 )
local f9_local4 = nil
if not Engine.UsingSplitscreenUpscaling() then
f9_local4 = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -250,
height = 64,
width = 64
}
else
f9_local4 = {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 10,
height = 64,
width = 64
}
end
local f9_local5 = LUI.UIElement.new( LUI.MenuBuilder.AnimStateBasedOn( f9_local4, {
left = -532,
alpha = 0
} ) )
f9_local5.id = "splashId"
f9_local5:registerAnimationState( "opening", LUI.MenuBuilder.AnimStateBasedOn( f9_local4, {
left = -12,
alpha = 1
} ) )
f9_local5:registerAnimationState( "active", LUI.MenuBuilder.AnimStateBasedOn( f9_local4, {
alpha = 1
} ) )
f9_local5:registerAnimationState( "leave", LUI.MenuBuilder.AnimStateBasedOn( f9_local4, {
left = 468,
alpha = 0
} ) )
f9_local5:registerOmnvarHandler( "ui_splash_idx", f0_local3 )
local f9_local6 = LUI.UIImage.new()
f9_local6.id = "splashBackingImageId"
f9_local6:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = -64,
height = 64,
width = 64,
material = f9_local2,
alpha = 0
} )
f9_local6:animateToState( "default", 0 )
f9_local6:registerAnimationState( "active", {
alpha = 1
} )
local f9_local7 = LUI.UIImage.new()
f9_local7.id = "splashImageId"
f9_local7:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = -64,
height = 64,
width = 64,
material = f9_local0,
alpha = 0
} )
f9_local7:animateToState( "default", 0 )
f9_local7:registerAnimationState( "active", {
alpha = 1
} )
local f9_local8 = LUI.UIText.new()
f9_local8.id = "splashNameId"
f9_local8:setText( "" )
f9_local8:setTextStyle( CoD.TextStyle.Shadowed )
f9_local8:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 10,
left = 0,
height = CoD.TextSettings.HudEuroBigFont.Height,
width = 1024,
font = CoD.TextSettings.HudEuroBigFont.Font,
alignment = LUI.Alignment.Left,
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b
} )
f9_local8:animateToState( "default", 0 )
local f9_local9 = LUI.UIText.new()
f9_local9.id = "splashDescId"
f9_local9:setText( "" )
f9_local9:setTextStyle( CoD.TextStyle.Shadowed )
f9_local9:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 35,
left = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 350,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Left
} )
f9_local9:animateToState( "default", 0 )
f9_local5:addElement( f9_local6 )
f9_local5:addElement( f9_local7 )
f9_local5:addElement( f9_local8 )
f9_local5:addElement( f9_local9 )
local f9_local10, f9_local11 = nil
if not Engine.UsingSplitscreenUpscaling() then
f9_local10 = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -250,
width = 64,
height = 64,
scale = 0,
alpha = 0
}
local f9_local12 = {}
f9_local12 = GameX.GetScreenDims()
f9_local11 = LUI.MenuBuilder.AnimStateBasedOn( f9_local10, {
left = f9_local12[1] / 2,
top = f9_local12[2] / 2,
scale = -1
} )
else
f9_local10 = {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 10,
width = 64,
height = 64,
scale = 0,
alpha = 0
}
local f9_local12 = {}
f9_local12 = GameX.GetScreenDims()
f9_local11 = LUI.MenuBuilder.AnimStateBasedOn( f9_local10, {
left = f9_local12[1] / 2,
top = f9_local12[2],
scale = -1
} )
end
local f9_local12 = LUI.UIElement.new( f9_local10 )
f9_local12.id = "earnedKillstreakSplashId"
f9_local12:registerAnimationState( "active", LUI.MenuBuilder.AnimStateBasedOn( f9_local10, {
alpha = 1
} ) )
f9_local12:registerAnimationState( "leave", f9_local11 )
f9_local12:registerOmnvarHandler( "ui_splash_killstreak_idx", f0_local4 )
local f9_local13 = LUI.UIImage.new()
f9_local13.id = "earnedKillstreakBackingImageId"
f9_local13:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = -64,
height = 64,
width = 64,
material = f9_local2,
alpha = 0
} )
f9_local13:animateToState( "default", 0 )
f9_local13:registerAnimationState( "start", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = -256,
left = -320,
bottom = 320,
right = 320,
alpha = 0
} )
f9_local13:registerAnimationState( "opening", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = -64,
height = 64,
width = 64,
alpha = 1
} )
f9_local13:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = -64,
height = 64,
width = 64,
alpha = 1
} )
local f9_local14 = LUI.UIImage.new()
f9_local14.id = "earnedKillstreakImageId"
f9_local14:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = -64,
height = 64,
width = 64,
material = f9_local0,
alpha = 0
} )
f9_local14:animateToState( "default", 0 )
f9_local14:registerAnimationState( "start", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = -256,
left = -320,
bottom = 320,
right = 320,
alpha = 0
} )
f9_local14:registerAnimationState( "opening", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = -64,
height = 32,
width = 32,
alpha = 1
} )
f9_local14:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = -64,
height = 64,
width = 64,
alpha = 1
} )
local f9_local15 = LUI.UIText.new()
f9_local15.id = "earnedKillstreakPlayerNameId"
f9_local15:setText( "" )
f9_local15:setTextStyle( CoD.TextStyle.Shadowed )
f9_local15:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = -25,
left = 0,
right = 1024,
height = CoD.TextSettings.HudEuroNormalFont.Height,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alignment = LUI.Alignment.Left,
red = Colors.cyan.r,
green = Colors.cyan.g,
blue = Colors.cyan.b
} )
f9_local15:animateToState( "default", 0 )
local f9_local16 = LUI.UIText.new()
f9_local16.id = "earnedKillstreakNameId"
f9_local16:setText( "" )
f9_local16:setTextStyle( CoD.TextStyle.Shadowed )
f9_local16:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 10,
left = 0,
height = CoD.TextSettings.HudEuroNormalFont.Height,
width = 1024,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alignment = LUI.Alignment.Left,
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b,
alpha = 0
} )
f9_local16:animateToState( "default", 0 )
f9_local16:registerAnimationState( "start", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 10,
left = -64,
height = CoD.TextSettings.HudEuroNormalFont.Height,
width = 1024,
alpha = 0
} )
f9_local16:registerAnimationState( "opening", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 10,
left = 40,
height = CoD.TextSettings.HudEuroNormalFont.Height,
width = 1024,
alpha = 1
} )
f9_local16:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 10,
left = 0,
height = CoD.TextSettings.HudEuroNormalFont.Height,
width = 1024,
alpha = 1
} )
local f9_local17 = LUI.UIText.new()
f9_local17.id = "earnedKillstreakDescId"
f9_local17:setText( "" )
f9_local17:setTextStyle( CoD.TextStyle.Shadowed )
f9_local17:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 35,
left = 0,
height = CoD.TextSettings.HudEuroNormalFont.Height,
width = 1024,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alignment = LUI.Alignment.Left,
alpha = 0
} )
f9_local17:animateToState( "default", 0 )
f9_local17:registerAnimationState( "start", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 35,
left = -64,
height = CoD.TextSettings.HudEuroNormalFont.Height,
width = 1024,
alpha = 0
} )
f9_local17:registerAnimationState( "opening", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 35,
left = 40,
height = CoD.TextSettings.HudEuroNormalFont.Height,
width = 1024,
alpha = 1
} )
f9_local17:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 35,
left = 0,
height = CoD.TextSettings.HudEuroNormalFont.Height,
width = 1024,
alpha = 1
} )
f9_local12:addElement( f9_local15 )
f9_local12:addElement( f9_local16 )
f9_local12:addElement( f9_local17 )
f9_local12:addElement( f9_local13 )
f9_local12:addElement( f9_local14 )
local f9_local18 = f0_local7( "playerCardId", f9_local1 )
f9_local18:registerOmnvarHandler( "ui_splash_playercard_idx", f0_local5 )
local f9_local19 = f0_local7( "challengeSplashId", f9_local1 )
f9_local19:registerOmnvarHandler( "ui_challenge_splash_idx", f0_local6 )
self:addElement( f9_local5 )
self:addElement( f9_local12 )
self:addElement( f9_local18 )
self:addElement( f9_local19 )
return self
end )
LockTable( _M )

View File

@ -0,0 +1,235 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = RegisterMaterial( "voice_on" )
f0_local1 = function ()
local f1_local0 = {
type = "UIVerticalList",
id = "talkersVLId",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 32,
left = 0,
height = 256,
width = 256,
alignment = LUI.Alignment.Left,
spacing = 0
}
},
children = {}
}
for f1_local1 = 1, 4, 1 do
local f1_local4 = f1_local0.children
local f1_local5 = {
type = "UIElement",
id = "talkersChildrenContainerId" .. f1_local1,
states = {
default = {
topAnchor = true,
leftAnchor = true,
top = 0,
left = 0,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 256,
alpha = 0
},
active = {
alpha = 1
}
},
handlers = {
talker_refresh = function ( f2_arg0, f2_arg1 )
assert( f2_arg1.original )
local f2_local0 = f2_arg1.original.newValue
if f2_local0 ~= -1 then
local f2_local1 = f2_arg0:getFirstChild()
f2_local1:setText( Game.GetPlayerName( f2_local0 ) )
if f2_arg0.current_state ~= "active" then
f2_arg0:animateToState( "active", 0 )
f2_arg0.current_state = "active"
end
elseif f2_arg0.current_state ~= "default" then
f2_arg0:animateToState( "default", 250 )
f2_arg0.current_state = "default"
end
end
}
}
local f1_local6 = {}
local f1_local7 = {
type = "UIText",
id = "talkersNameTextId" .. f1_local1,
properties = {
text = "",
textStyle = CoD.TextStyle.Shadowed
}
}
local f1_local8 = {}
local f1_local9 = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0
}
local f1_local10
if not Engine.IsAliensMode() then
f1_local10 = CoD.TextSettings.HudEuroMedSmallFont.Height
if not f1_local10 then
else
f1_local9.left = f1_local10
f1_local9.right = Engine.IsAliensMode() and -5 or nil
f1_local9.width = 200
f1_local9.height = CoD.TextSettings.HudEuroMedSmallFont.Height
f1_local9.font = CoD.TextSettings.HudEuroMedSmallFont.Font
f1_local9.alignment = Engine.IsAliensMode() and LUI.Alignment.Right or LUI.Alignment.Left
f1_local8.default = f1_local9
f1_local7.states = f1_local8
f1_local8 = {
type = "UIImage",
id = "talkersIconImageId" .. f1_local1
}
f1_local9 = {}
f1_local10 = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0
}
local f1_local11
if not Engine.IsAliensMode() then
f1_local11 = 0
if not f1_local11 then
else
f1_local10.left = f1_local11
f1_local10.right = Engine.IsAliensMode() and 0 or nil
f1_local10.height = CoD.TextSettings.HudEuroMedSmallFont.Height
f1_local10.width = CoD.TextSettings.HudEuroMedSmallFont.Height * (Engine.IsAliensMode() and -1 or 1)
f1_local10.material = f0_local0
f1_local9.default = f1_local10
f1_local8.states = f1_local9
f1_local9 = {
type = "UIIntWatch",
properties = {
dataSource = "Talker",
param1 = f1_local1 - 1
},
handlers = {
int_watch_alert = MBh.EmitEventToParent( "talker_refresh", {
saveOriginal = true
} )
}
}
f1_local6[1] = f1_local7
f1_local6[2] = f1_local8
f1_local6[3] = f1_local9
f1_local5.children = f1_local6
f1_local4[f1_local1] = f1_local5
end
end
f1_local11 = nil
end
end
f1_local10 = nil
end
return f1_local0
end
LUI.MenuBuilder.registerDef( "talkerHudDef", function ()
local f3_local0 = {
type = "UIElement",
id = "talkerHudId",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 10,
left = 295,
height = 256,
width = 256,
alpha = 1
},
inactive = {
alpha = 0
}
},
handlers = {
hud_off = MBh.AnimateToState( "inactive", 0 ),
hud_on = MBh.AnimateToState( "default", 0 )
}
}
local f3_local1 = {}
local f3_local2 = {
type = "UIImage",
id = "talkerPlayerImageId"
}
local f3_local3 = {}
local f3_local4 = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0
}
local f3_local5
if not Engine.IsAliensMode() then
f3_local5 = 0
if not f3_local5 then
else
f3_local4.left = f3_local5
f3_local4.right = Engine.IsAliensMode() and -11 or nil
f3_local4.height = 32
f3_local5 = Engine.IsAliensMode() and -1 or 1
local f3_local6 = 32 * f3_local5
f3_local4.width = f3_local5
f3_local4.material = f0_local0
f3_local4.alpha = 0
f3_local3.default = f3_local4
f3_local3.talking = {
alpha = 1
}
f3_local2.states = f3_local3
f3_local2.handlers = {
talking_refresh = function ( f4_arg0, f4_arg1 )
assert( f4_arg1.original )
if f4_arg1.original.newValue ~= 0 and f4_arg0.current_state ~= "talking" then
f4_arg0:animateToState( "talking", 0 )
f4_arg0.current_state = "talking"
elseif f4_arg1.original.newValue == 0 and f4_arg0.current_state ~= "default" then
f4_arg0:animateToState( "default", 150 )
f4_arg0.current_state = "default"
end
end
}
f3_local2.children = {
{
type = "UIIntWatch",
properties = {
dataSource = "Talking"
},
handlers = {
int_watch_alert = MBh.EmitEventToParent( "talking_refresh", {
saveOriginal = true
} )
}
}
}
f3_local3 = f0_local1()
f3_local0.children = f3_local2
return f3_local0
end
end
f3_local5 = nil
end )
LockTable( _M )

View File

@ -0,0 +1,519 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = Engine.Localize( "@LUA_MENU_WINNING" )
f0_local1 = Engine.Localize( "@LUA_MENU_LOSING" )
f0_local2 = Engine.Localize( "@LUA_MENU_TIED" )
local f0_local3 = Engine.Localize( "@" .. Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, Engine.GetDvarString( "ui_gametype" ), GameTypesTable.Cols.Name ) )
local f0_local4 = 215
local f0_local5 = 10
local f0_local6 = 22
local f0_local7 = 22
local f0_local8 = 250
local f0_local9 = 10000
function SetTextAndAnimateSequenceIfChanged( f1_arg0, f1_arg1, f1_arg2, f1_arg3 )
if f1_arg0.current_state ~= f1_arg2 then
f1_arg0:setText( f1_arg1 )
local f1_local0 = MBh.AnimateSequence( f1_arg3 )
f1_local0( f1_arg0 )
f1_arg0.current_state = f1_arg2
end
end
local f0_local10 = {
{
"default",
0
},
{
"slide_in",
250
}
}
local f0_local11 = {
winning = {
text = f0_local0,
status = "winning",
anim = {
{
"default",
0
},
{
"slide_in",
250
},
{
"winning",
250
}
}
},
losing = {
text = f0_local1,
status = "losing",
anim = {
{
"default",
0
},
{
"slide_in",
250
},
{
"losing",
250
}
}
},
tied = {
text = f0_local2,
status = "tied",
anim = {
{
"default",
0
},
{
"slide_in",
250
},
{
"tied",
250
}
}
}
}
local f0_local12 = function ( f2_arg0 )
local self = LUI.UIText.new()
self.id = f2_arg0.id or nil
self:setupUIBindText( f2_arg0.dataSource )
self:registerAnimationState( "default", {
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
bottom = f2_arg0.bottom,
height = f2_arg0.height,
font = f2_arg0.font,
alignment = f2_arg0.alignment
} )
self:animateToState( "default", 0 )
return self
end
local f0_local13 = function ( f3_arg0 )
local self = LUI.UIHorizontalList.new()
self.id = f3_arg0.id or nil
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = f3_arg0.bottom or 0,
left = f3_arg0.left or 0,
height = f3_arg0.height
} )
self:animateToState( "default", 0 )
if f3_arg0.startcap ~= nil then
local f3_local1 = LUI.UIImage.new()
f3_local1.id = "start_cap"
f3_local1:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
bottom = 0,
left = 0,
width = f3_arg0.startcap.width,
height = f3_arg0.imageHeight,
material = RegisterMaterial( f3_arg0.startcap.material )
} )
f3_local1:animateToState( "default", 0 )
self:addElement( f3_local1 )
end
local f3_local1 = LUI.UIImage.new()
f3_local1.id = "middle"
f3_local1:setupUIScorebar( f3_arg0.dataSource )
f3_local1.m_maxScore = f3_arg0.maxScore
f3_local1.m_maxWidth = f3_arg0.maxWidth - (f3_arg0.startcap and f3_arg0.startcap.width or 0) - (f3_arg0.endcap and f3_arg0.endcap.width or 0)
f3_local1:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
bottom = 0,
height = f3_arg0.imageHeight,
material = RegisterMaterial( f3_arg0.material )
} )
f3_local1:animateToState( "default", 0 )
self:addElement( f3_local1 )
if f3_arg0.endcap ~= nil then
local f3_local2 = LUI.UIImage.new()
f3_local2.id = "end_cap"
f3_local2:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
bottom = 0,
left = 0,
width = f3_arg0.endcap.width,
height = f3_arg0.imageHeight,
material = RegisterMaterial( f3_arg0.endcap.material )
} )
f3_local2:animateToState( "default", 0 )
self:addElement( f3_local2 )
end
return self
end
local f0_local14 = function ()
if GameX.gameModeIsFFA() then
local f4_local0 = Game.GetPlayerScoreRanking() or 0
if f4_local0 > 1 then
local f4_local1 = GameX.GetPlayerScoreInfoAtRankForGameMode( Teams.free, 1, GameX.GetGameMode() )
local f4_local2 = GameX.GetPlayerScoreInfoAtRankForGameMode( Teams.free, f4_local0, GameX.GetGameMode() )
if f4_local1.score == f4_local2.score then
return "tied"
else
return "losing"
end
end
local f4_local1 = Game.GetPlayerName()
local f4_local2 = Game.GetPlayerScore()
local f4_local3 = Game.GetPlayerTeam()
local f4_local4 = Game.GetNumPlayersOnTeam( f4_local3 )
local f4_local5 = false
for f4_local6 = 1, f4_local4, 1 do
local f4_local9 = Game.GetPlayerScoreInfoAtRank( f4_local3, f4_local6 )
if f4_local9 and f4_local9.name ~= f4_local1 then
f4_local5 = f4_local9.score == f4_local2
if f4_local5 then
break
end
end
end
if f4_local5 then
return "tied"
end
return "winning"
else
local f4_local0 = Game.GetPlayerTeam()
local f4_local1 = GameX.GetPlayerOpposingTeam()
local f4_local2 = Game.GetTeamScore( f4_local0 ) or 0
local f4_local3 = Game.GetTeamScore( f4_local1 ) or 0
if f4_local3 < f4_local2 then
return "winning"
elseif f4_local2 < f4_local3 then
return "losing"
elseif f4_local2 == f4_local3 then
return "tied"
else
return nil
end
end
end
local f0_local15 = function ( f5_arg0, f5_arg1 )
if f5_arg0.current_match_status ~= f5_arg1 then
local f5_local0 = f5_arg0:getChildById( "cycle_text_timer" )
f5_local0:reset()
end
end
local f0_local16 = function ( f6_arg0, f6_arg1 )
local f6_local0 = f6_arg0
if f6_arg0.id ~= "score_info_text" then
local f6_local1 = f6_arg0:getParent()
f6_local0 = f6_local1:getChildById( "score_info_text" )
end
if f6_local0.current_score_info == nil then
f6_local0.current_score_info = "game_mode"
f6_local0.current_match_status = "tied"
SetTextAndAnimateSequenceIfChanged( f6_local0, f0_local3, "game_mode", f0_local10 )
return
elseif f6_arg1.name == "cycle_text" then
if f6_local0.current_score_info ~= "game_mode" then
f6_local0.current_score_info = "game_mode"
else
f6_local0.current_score_info = "win_lose_tie"
end
end
if f6_local0.current_score_info == "game_mode" then
if f6_arg1.name == "cycle_text" then
SetTextAndAnimateSequenceIfChanged( f6_local0, f0_local3, "game_mode", f0_local10 )
else
local f6_local1 = f0_local14()
if f6_local1 ~= f6_local0.current_match_status then
SetTextAndAnimateSequenceIfChanged( f6_local0, f0_local11[f6_local1].text, f0_local11[f6_local1].status, f0_local11[f6_local1].anim )
f6_local0.current_match_status = f0_local11[f6_local1].status
end
end
else
local f6_local1 = f0_local14()
SetTextAndAnimateSequenceIfChanged( f6_local0, f0_local11[f6_local1].text, f0_local11[f6_local1].status, f0_local11[f6_local1].anim )
f0_local15( f6_local0, f0_local11[f6_local1].status )
f6_local0.current_match_status = f0_local11[f6_local1].status
end
end
LUI.MenuBuilder.registerType( "teamScoresHudDef", function ()
local f7_local0 = RegisterMaterial( "hud_scorebar_bg" )
local f7_local1 = Engine.GetDvarInt( "ui_scorelimit" )
local self = LUI.UIElement.new()
self.id = "teamScoresId"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -10,
left = -18,
height = 128,
width = 0,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -10,
left = -18,
height = 128,
width = 512,
alpha = 1
} )
self:registerAnimationState( "opening", {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -10,
left = -18,
height = 128,
width = 552,
alpha = 1
} )
self:registerEventHandler( "hud_on", MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
f0_local8 / 2
},
{
"active",
f0_local8 / 2
}
} ) )
local f7_local3 = LUI.UIImage.new()
f7_local3.id = "teamScoresBgId"
f7_local3:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f7_local0
} )
f7_local3:animateToState( "default", 0 )
local f7_local4 = LUI.UIElement.new()
f7_local4.id = "teamScoresFriendlyScore"
f7_local4:registerAnimationState( "default", {
bottomAnchor = true,
leftAnchor = true,
bottom = -27,
left = 58,
height = CoD.TextSettings.HudDigitalBigFont.Height,
width = 40
} )
f7_local4:animateToState( "default", 0 )
local f7_local5 = LUI.UIText.new()
f7_local5.id = "teamScoresFriendlyScoreBg"
f7_local5:setText( "8888" )
f7_local5:registerAnimationState( "default", {
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
bottom = 0,
height = CoD.TextSettings.HudDigitalBigFont.Height,
font = CoD.TextSettings.HudDigitalBigFont.Font,
alignment = LUI.Alignment.Right,
red = 0,
green = 0,
blue = 0,
alpha = 0.25
} )
f7_local5:animateToState( "default", 0 )
f7_local4:addElement( f7_local5 )
f7_local4:addElement( f0_local12( {
id = "friendlyTeamScoreNum",
dataSource = "TeamScoreFriendly",
bottom = 0,
height = CoD.TextSettings.HudDigitalBigFont.Height,
font = CoD.TextSettings.HudDigitalBigFont.Font,
alignment = LUI.Alignment.Right
} ) )
local f7_local6 = LUI.UIElement.new()
f7_local6.id = "teamScoresEnemyScore"
f7_local6:registerAnimationState( "default", {
bottomAnchor = true,
leftAnchor = true,
bottom = -3,
left = 58,
height = CoD.TextSettings.HudDigitalNormalFont.Height,
width = 40
} )
f7_local6:animateToState( "default", 0 )
local f7_local7 = LUI.UIText.new()
f7_local7.id = "teamScoresEnemyScoreBg"
f7_local7:setText( "8888" )
f7_local7:registerAnimationState( "default", {
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
bottom = 0,
height = CoD.TextSettings.HudDigitalNormalFont.Height,
font = CoD.TextSettings.HudDigitalNormalFont.Font,
alignment = LUI.Alignment.Right,
red = 0,
green = 0,
blue = 0,
alpha = 0.25
} )
f7_local7:animateToState( "default", 0 )
f7_local6:addElement( f7_local7 )
f7_local6:addElement( f0_local12( {
id = "enemyTeamScoreNum",
dataSource = "TeamScoreEnemy",
bottom = 0,
height = CoD.TextSettings.HudDigitalNormalFont.Height,
font = CoD.TextSettings.HudDigitalNormalFont.Font,
alignment = LUI.Alignment.Right
} ) )
local f7_local8 = LUI.UIVerticalList.new()
f7_local8.id = "teamScoreBars"
f7_local8:registerAnimationState( "default", {
bottomAnchor = true,
leftAnchor = true,
bottom = 10,
left = 101,
height = 50,
width = 200,
spacing = 5
} )
f7_local8:animateToState( "default", 0 )
f7_local8:addElement( f0_local13( {
id = "friendlyTeamScorebar",
dataSource = "TeamScoreFriendly",
bottom = 0,
left = 0,
height = 17,
maxScore = f7_local1,
material = "hud_scorebar_min_cyan",
maxWidth = f0_local4,
imageHeight = f0_local7,
endcap = {
material = "hud_scorebar_cap_cyan",
width = f0_local6
}
} ) )
f7_local8:addElement( f0_local13( {
id = "enemyTeamScorebar",
dataSource = "TeamScoreEnemy",
bottom = 0,
left = 0,
height = 17,
maxScore = f7_local1,
material = "hud_scorebar_min_orange",
maxWidth = f0_local4 - 12,
imageHeight = f0_local7,
endcap = {
material = "hud_scorebar_cap_orange",
width = f0_local6
}
} ) )
local f7_local9 = LUI.UIText.new()
f7_local9.id = "score_info_text"
f7_local9:setText( "" )
f7_local9:setTextStyle( CoD.TextStyle.Shadowed )
f7_local9:registerAnimationState( "default", {
leftAnchor = true,
bottomAnchor = true,
bottom = -10,
left = 500,
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
} )
f7_local9:animateToState( "default", 0 )
f7_local9:registerAnimationState( "slide_in", {
leftAnchor = true,
bottomAnchor = true,
bottom = -10,
left = 315,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f7_local9:registerAnimationState( "winning", {
red = Colors.cyan.r,
green = Colors.cyan.g,
blue = Colors.cyan.b
} )
f7_local9:registerAnimationState( "losing", {
red = Colors.orange.r,
green = Colors.orange.g,
blue = Colors.orange.b
} )
f7_local9:registerAnimationState( "tied", {
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b
} )
f7_local9:registerAnimationState( "blink_off", {
alpha = 0
} )
f7_local9:registerAnimationState( "blink_on", {
alpha = 1
} )
f7_local9:registerEventHandler( "cycle_text", f0_local16 )
local f7_local10 = {
event = "cycle_text",
group = "hud",
interval = f0_local9
}
local f7_local11 = LUI.UITimer.new( f7_local10.interval, f7_local10.event, f7_local10.group )
f7_local11.id = "cycle_text_timer"
f7_local9:addElement( f7_local11 )
local f7_local12 = LUI.UIElement.new()
f7_local12:setupUIIntWatch( "TeamScoreFriendly" )
f7_local12.id = "friendly_score_watch"
f7_local12:registerEventHandler( "int_watch_alert", f0_local16 )
local f7_local13 = LUI.UIElement.new()
f7_local13:setupUIIntWatch( "TeamScoreEnemy" )
f7_local13.id = "enemy_score_watch"
f7_local13:registerEventHandler( "int_watch_alert", f0_local16 )
f7_local3:addElement( f7_local4 )
f7_local3:addElement( f7_local6 )
f7_local3:addElement( f7_local8 )
f7_local3:addElement( f7_local9 )
f7_local3:addElement( f7_local12 )
f7_local3:addElement( f7_local13 )
f7_local3:addElement( LUI.MenuBuilder.buildItems( {
type = "timersHudDef"
}, f7_local3.properties, f7_local3 ) )
self:addElement( f7_local3 )
return self
end )
LockTable( _M )

View File

@ -0,0 +1,192 @@
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 )
if GameX.IsOnlineMatch() and not GameX.IsSplitscreen() then
f1_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addFriendsButton )
end
end
f0_local1 = function ( f2_arg0, f2_arg1 )
LUI.FlowManager.RequestLeaveMenu( f2_arg0 )
end
f0_local2 = function ( f3_arg0, f3_arg1 )
Engine.NotifyServer( "team_select", 0 )
local f3_local0 = Engine.GetDvarString( "g_gametype" )
end
local f0_local3 = function ( f4_arg0, f4_arg1 )
Engine.NotifyServer( "team_select", 1 )
local f4_local0 = Engine.GetDvarString( "g_gametype" )
end
local f0_local4 = function ( f5_arg0, f5_arg1 )
Engine.NotifyServer( "team_select", 2 )
local f5_local0 = Engine.GetDvarString( "g_gametype" )
end
local f0_local5 = function ( f6_arg0, f6_arg1 )
Engine.NotifyServer( "team_select", 3 )
local f6_local0 = MBh.EmitEventToRoot( "toggle_pause_off" )
f6_local0( f6_arg0 )
LUI.FlowManager.RequestCloseAllMenus( f6_arg0 )
end
local f0_local6 = function ()
local f7_local0 = MatchRules.GetData( "commonOption", "spectateModeAllowed" )
local f7_local1 = Game.GetPlayerTeam()
if Engine.GetDvarBool( "xblive_competitionmatch" ) and Engine.GetDvarBool( "xblive_privatematch" ) then
f7_local0 = 0
end
local self = LUI.UIVerticalList.new()
self.id = "team_select_selections_Id"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = GenericMenuDims.menu_top,
left = GenericMenuDims.menu_left,
bottom = GenericMenuDims.menu_bottom,
right = GenericMenuDims.menu_right,
alignment = LUI.Alignment.Top
} )
self:animateToState( "default", 0 )
self:makeFocusable()
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIGenericButton",
id = "btn_MPTeamChange_0",
properties = {
childNum = 1,
button_text = Engine.Localize( "@LUA_MENU_AUTOASSIGN_CAPS" ),
button_action_func = f0_local4
}
} )
local f7_local3 = LUI.MenuBuilder.BuildAddChild
local f7_local4 = self
local f7_local5 = {
type = "UIGenericButton",
id = "btn_MPTeamChange_1"
}
local f7_local6 = {
childNum = 2,
button_text = GameX.GetLocalizedTeamName( Teams.allies ),
button_action_func = f0_local3
}
local f7_local7
if f7_local1 == Teams.allies then
f7_local7 = Colors.yellow
if not f7_local7 then
else
f7_local6.text_default_color = f7_local7
f7_local5.properties = f7_local6
f7_local5.handlers = {
menu_create = function ( f8_arg0, f8_arg1 )
f8_arg0.listDefaultFocus = f7_local1 == Teams.allies
end
}
f7_local3( f7_local4, f7_local5 )
f7_local3 = LUI.MenuBuilder.BuildAddChild
f7_local4 = self
f7_local5 = {
type = "UIGenericButton",
id = "btn_MPTeamChange_2"
}
f7_local6 = {
childNum = 3,
button_text = GameX.GetLocalizedTeamName( Teams.axis ),
button_action_func = f0_local2
}
if f7_local1 == Teams.axis then
f7_local7 = Colors.yellow
if not f7_local7 then
else
f7_local6.text_default_color = f7_local7
f7_local5.properties = f7_local6
f7_local5.handlers = {
menu_create = function ( f9_arg0, f9_arg1 )
f9_arg0.listDefaultFocus = f7_local1 == Teams.axis
end
}
f7_local3( f7_local4, f7_local5 )
if f7_local0 ~= 0 then
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIGenericButton",
id = "btn_MPTeamChange_3",
properties = {
childNum = 4,
button_text = Engine.Localize( "@LUA_MENU_SPECTATOR_CAPS" ),
button_action_func = f0_local5,
text_default_color = Game.GetOmnvar( "ui_spectator_selected" ) and Colors.yellow or Colors.generic_button_text_default_color
},
handlers = {
menu_create = function ( f10_arg0, f10_arg1 )
f10_arg0.listDefaultFocus = Game.GetOmnvar( "ui_spectator_selected" ) == 1
end
}
} )
end
return self
end
end
f7_local7 = Colors.generic_button_text_default_color
end
end
f7_local7 = Colors.generic_button_text_default_color
end
LUI.MenuBuilder.registerType( "team_select_main", function ()
local f11_local0 = Engine.Localize( "@LUA_MENU_CHANGE_TEAM_CAPS" )
local self = LUI.UIElement.new()
self.id = "mp_team_select_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 )
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIWorldBlur",
id = "tsWorldBlurOverlay",
states = {
default = {
worldBlur = 5
}
}
} )
self:addElement( LUI.mp_hud.OptionsMenu.mp_pause_menu_background_def() )
LUI.MenuBuilder.BuildAddChild( self, {
type = "button_helper_text_main",
id = "tshelper_text_id"
} )
if GameX.IsOnlineMatch() and not GameX.IsSplitscreen() then
LUI.MenuBuilder.BuildAddChild( self, {
type = "online_friends_widget",
id = "tsfriends_widget_id"
} )
end
local f11_local2 = LUI.UIBindButton.new()
f11_local2.id = "tsBackToGameStartButton"
f11_local2:registerEventHandler( "button_start", f0_local1 )
f11_local2:registerEventHandler( "button_secondary", f0_local1 )
self:addElement( LUI.mp_hud.OptionsMenu.mp_pause_menu_title_def( f11_local0 ) )
self:addElement( f0_local6() )
self:addElement( LUI.mp_hud.OptionsMenu.game_mode_def() )
self:addElement( LUI.mp_hud.OptionsMenu.map_display_def() )
self:addElement( f11_local2 )
return self
end )
LockTable( _M )

View File

@ -0,0 +1,581 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function SendEventIfChanged( f1_arg0, f1_arg1 )
if f1_arg0.current_state ~= f1_arg1 then
f1_arg0:processEvent( {
name = f1_arg1
} )
f1_arg0.current_state = f1_arg1
end
end
function AnimateToStateIfChanged( f2_arg0, f2_arg1, f2_arg2 )
if f2_arg0.current_state ~= f2_arg1 then
local f2_local0 = MBh.AnimateToState( f2_arg1, f2_arg2 )
f2_local0( f2_arg0 )
f2_arg0.current_state = f2_arg1
end
end
f0_local0 = function ( f3_arg0, f3_arg1 )
local f3_local0 = Game.GetOmnvar( "ui_bomb_timer" )
local f3_local1 = Game.GetOmnvar( "ui_carrying_bomb" )
local f3_local2 = nil
if f3_local0 == 0 and f3_local1 then
f3_local2 = "matchTimerBomber"
elseif f3_local0 == 0 and not f3_local1 then
f3_local2 = "matchTimer"
elseif f3_local0 == 4 then
f3_local2 = "nukeTimer"
else
f3_local2 = "bombTimer"
end
if f3_local0 == 0 then
local f3_local3 = f3_arg0:getChildById( "match_timer" )
if f3_local3 then
local f3_local4 = Game.GetTimeLeft()
if f3_local4 <= 0 then
AnimateToStateIfChanged( f3_local3, "inactive", 0 )
elseif f3_local4 <= 30000 then
SendEventIfChanged( f3_local3, "flash" )
else
AnimateToStateIfChanged( f3_local3, "default", 0 )
end
end
local f3_local4 = f3_arg0:getChildById( "bomb_timer" )
if f3_local4 then
AnimateToStateIfChanged( f3_local4, "inactive", 0 )
local f3_local5 = f3_arg0:getChildById( "bomb_timer_image" )
if f3_local1 then
AnimateToStateIfChanged( f3_local5, "bomb", 0 )
else
AnimateToStateIfChanged( f3_local5, "inactive", 0 )
end
end
local f3_local5 = f3_arg0:getChildById( "paused_timer" )
if f3_local5 then
AnimateToStateIfChanged( f3_local5, "inactive", 0 )
end
elseif f3_local0 == 5 then
local f3_local3 = f3_arg0:getChildById( "match_timer" )
if f3_local3 then
AnimateToStateIfChanged( f3_local3, "inactive", 0 )
end
local f3_local4 = f3_arg0:getChildById( "bomb_timer" )
if f3_local4 then
AnimateToStateIfChanged( f3_local4, "inactive", 0 )
local f3_local5 = f3_arg0:getChildById( "bomb_timer_image" )
if f3_local1 then
AnimateToStateIfChanged( f3_local5, "bomb", 0 )
else
AnimateToStateIfChanged( f3_local5, "inactive", 0 )
end
end
local f3_local5 = f3_arg0:getChildById( "paused_timer" )
if f3_local5 then
SendEventIfChanged( f3_local5, "flash" )
end
else
local f3_local3 = f3_arg0:getChildById( "match_timer" )
if f3_local3 then
AnimateToStateIfChanged( f3_local3, "inactive", 0 )
end
local f3_local4 = f3_arg0:getChildById( "paused_timer" )
if f3_local4 then
AnimateToStateIfChanged( f3_local4, "inactive", 0 )
end
local f3_local5
if f3_local0 == 4 then
f3_local5 = Game.GetOmnvar( "ui_nuke_end_milliseconds" )
if not f3_local5 then
else
local f3_local6 = f3_local5 - Game.GetTime()
local f3_local7 = f3_arg0:getChildById( "bomb_timer" )
if f3_local6 > 0 then
f3_local7:setEndTime( f3_local5 )
end
SendEventIfChanged( f3_local7, "flash" )
local f3_local8 = f3_arg0:getChildById( "bomb_timer_image" )
local f3_local9 = AnimateToStateIfChanged
local f3_local10 = f3_local8
local f3_local11
if f3_local0 == 4 then
f3_local11 = "nuke"
if not f3_local11 then
else
f3_local9( f3_local10, f3_local11, 0 )
end
end
f3_local11 = "bomb"
end
end
f3_local5 = Game.GetOmnvar( "ui_bomb_timer_endtime" )
end
end
f0_local1 = function ( f4_arg0, f4_arg1 )
local f4_local0 = Game.GetOmnvar( "ui_bomb_timer" )
local f4_local1 = f4_arg0:getChildById( "bomb_timer_image" )
if f4_arg1.name == "playerstate_client_changed" then
f4_arg1.value = Game.GetOmnvar( "ui_carrying_bomb" )
end
if f4_arg1.value == true then
AnimateToStateIfChanged( f4_local1, "bomb", 250 )
elseif f4_local0 == 0 or f4_local0 == 5 then
AnimateToStateIfChanged( f4_local1, "inactive", 0 )
else
local f4_local2 = AnimateToStateIfChanged
local f4_local3 = f4_local1
local f4_local4
if f4_local0 == 4 then
f4_local4 = "nuke"
if not f4_local4 then
else
f4_local2( f4_local3, f4_local4, 0 )
end
end
f4_local4 = "bomb"
end
end
f0_local2 = function ( f5_arg0, f5_arg1 )
local f5_local0 = f5_arg0:getChildById( "match_timer" )
local f5_local1 = f5_arg0:getChildById( "bomb_timer" )
local f5_local2 = f5_arg0:getChildById( "bomb_timer_image" )
f5_local0.current_state = nil
f5_local1.current_state = nil
f5_local2.current_state = nil
f0_local0( f5_arg0, f5_arg1 )
end
local f0_local3 = function ( f6_arg0, f6_arg1 )
if Game.GetOmnvar( "ui_bomb_timer" ) == 0 then
f0_local2( f6_arg0, f6_arg1 )
end
end
local f0_local4 = function ( f7_arg0, f7_arg1 )
if Game.GetOmnvar( "ui_bomb_timer" ) == 0 then
local f7_local0 = f7_arg0:getChildById( "match_timer" )
SendEventIfChanged( f7_arg0, "flash" )
end
end
local f0_local5 = function ( f8_arg0 )
local f8_local0 = f8_arg0:getChildById( "cranked_warning_bg" )
local f8_local1 = MBh.AnimateToState( "default", 0 )
f8_local1( f8_local0 )
f8_local1 = f8_arg0:getChildById( "cranked_text" )
local f8_local2 = MBh.AnimateToState( "default", 0 )
f8_local2( f8_local1 )
f8_local2 = f8_arg0:getChildById( "cranked_countdown_bg" )
local f8_local3 = MBh.AnimateToState( "default", 0 )
f8_local3( f8_local2 )
f8_local3 = f8_arg0:getChildById( "cranked_countdown" )
local f8_local4 = MBh.AnimateToState( "default", 0 )
f8_local4( f8_local3 )
end
local f0_local6 = function ( f9_arg0, f9_arg1 )
if f9_arg1.value > 0 then
f9_arg0:animateToState( "active", 250 )
local f9_local0 = f9_arg0:getChildById( "cranked_countdown" )
f9_local0:setEndTime( f9_arg1.value )
f9_local0:animateToState( "default", 0 )
elseif f9_arg0.current_state ~= "default" then
f9_arg0:animateToState( "default", 250 )
end
f0_local5( f9_arg0 )
end
local f0_local7 = function ( f10_arg0 )
local f10_local0 = MBh.AnimateLoop( {
{
"default",
350
},
{
"flashing",
350
}
} )
f10_local0( f10_arg0 )
end
local f0_local8 = function ( f11_arg0, f11_arg1 )
f0_local7( f11_arg0:getChildById( "cranked_warning_bg" ) )
f0_local7( f11_arg0:getChildById( "cranked_text" ) )
f0_local7( f11_arg0:getChildById( "cranked_countdown_bg" ) )
f0_local7( f11_arg0:getChildById( "cranked_countdown" ) )
end
local f0_local9 = function ( f12_arg0, f12_arg1 )
if f12_arg1.value == "round_time" then
f12_arg0:setText( Engine.Localize( "@MP_HORDE_SPECIAL_ROUND_TIME" ) )
elseif f12_arg1.value == "start_time" then
f12_arg0:setText( Engine.Localize( "@MP_HORDE_ROUND_START_TIMER" ) )
else
f12_arg0:setText( Engine.Localize( "@LUA_MENU_CRANKED_CAPS" ) )
end
end
local f0_local10 = function ( f13_arg0, f13_arg1 )
local f13_local0 = Game.GetOmnvar( "ui_cranked_bomb_timer_end_milliseconds" )
f0_local6( f13_arg0, {
name = "ui_cranked_bomb_timer_end_milliseconds",
value = f13_local0
} )
if f13_local0 <= 5000 + Game.GetTime() then
f0_local8( f13_arg0 )
end
end
local f0_local11 = function ()
local f14_local0 = RegisterMaterial( "hud_suitcase_bomb" )
local f14_local1 = RegisterMaterial( "icon_ks_level_hud" )
local self = LUI.UIElement.new()
self.id = "timersHud"
self:registerAnimationState( "default", {
bottomAnchor = true,
leftAnchor = true,
bottom = MLG.IsMLGSpectator() and -75 or -30,
left = MLG.IsMLGSpectator() and 195 or 320,
alpha = 1
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "inactive", {
alpha = 0
} )
self:registerEventHandler( "menu_create", f0_local0 )
self:registerOmnvarHandler( "ui_bomb_timer", f0_local0 )
self:registerEventHandler( "timeBeingReset", f0_local3 )
self:registerOmnvarHandler( "ui_carrying_bomb", f0_local1 )
self:registerEventHandler( "playerstate_client_changed", f0_local1 )
local f14_local3 = LUI.UICountdown.new( {
endTime = "round_end"
} )
f14_local3.id = "match_timer"
f14_local3:setTextStyle( CoD.TextStyle.Shadowed )
f14_local3:registerAnimationState( "default", {
bottomAnchor = true,
leftAnchor = true,
bottom = 0,
left = 0,
width = 60,
height = CoD.TextSettings.HudDigitalNormalFont.Height,
font = CoD.TextSettings.HudDigitalNormalFont.Font,
alignment = LUI.Alignment.Right,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f14_local3:animateToState( "default", 0 )
f14_local3:registerAnimationState( "white", {
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f14_local3:registerAnimationState( "red", {
red = Colors.red.r,
green = Colors.red.g,
blue = Colors.red.b,
alpha = 1
} )
f14_local3:registerAnimationState( "inactive", {
alpha = 0
} )
f14_local3:registerEventHandler( "flash", MBh.AnimateLoop( {
{
"red",
1000
},
{
"white",
0
}
} ) )
f14_local3:registerEventHandler( "timeout", MBh.AnimateToState( "inactive", 0 ) )
f14_local3:registerEventHandler( "time30sec", f0_local4 )
f14_local3:registerEventHandler( "timeReset", MBh.EmitEventToParent( "timeBeingReset" ) )
local f14_local4 = LUI.UICountdown.new( {} )
f14_local4.id = "bomb_timer"
f14_local4:setTextStyle( CoD.TextStyle.Shadowed )
f14_local4:registerAnimationState( "default", {
bottomAnchor = true,
leftAnchor = true,
bottom = 0,
left = 0,
width = 60,
height = CoD.TextSettings.HudDigitalNormalFont.Height,
font = CoD.TextSettings.HudDigitalNormalFont.Font,
alignment = LUI.Alignment.Right,
red = 1,
green = 1,
blue = 1,
alpha = 0
} )
f14_local4:animateToState( "default", 0 )
f14_local4:registerAnimationState( "white", {
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f14_local4:registerAnimationState( "red", {
red = Colors.red.r,
green = Colors.red.g,
blue = Colors.red.b,
alpha = 1
} )
f14_local4:registerAnimationState( "inactive", {
alpha = 0
} )
f14_local4:registerEventHandler( "flash", MBh.AnimateLoop( {
{
"red",
1000
},
{
"white",
0
}
} ) )
local f14_local5 = LUI.UIImage.new()
f14_local5.id = "bomb_timer_image"
f14_local5:registerAnimationState( "default", {
bottomAnchor = true,
leftAnchor = true,
bottom = -22,
left = 0,
height = 64,
width = 64,
material = f14_local0,
alpha = 0
} )
f14_local5:animateToState( "default", 0 )
f14_local5:registerAnimationState( "bomb", {
material = f14_local0,
alpha = 1
} )
f14_local5:registerAnimationState( "nuke", {
material = f14_local1,
alpha = 1
} )
f14_local5:registerAnimationState( "inactive", {
alpha = 0
} )
local f14_local6 = LUI.UIText.new()
f14_local6.id = "paused_timer"
f14_local6:setTextStyle( CoD.TextStyle.Shadowed )
f14_local6:setText( Engine.Localize( "@LUA_MENU_MP_COUNTDOWN_PAUSED" ) )
f14_local6:registerAnimationState( "default", {
bottomAnchor = true,
leftAnchor = true,
bottom = 0,
left = -10,
width = 200,
height = CoD.TextSettings.HudDigitalSmallFont.Height,
font = CoD.TextSettings.HudDigitalSmallFont.Font,
alignment = LUI.Alignment.Left,
red = 1,
green = 1,
blue = 1,
alpha = 0
} )
f14_local6:animateToState( "default", 0 )
f14_local6:registerAnimationState( "white", {
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f14_local6:registerAnimationState( "red", {
red = Colors.red.r,
green = Colors.red.g,
blue = Colors.red.b,
alpha = 1
} )
f14_local6:registerAnimationState( "inactive", {
alpha = 0
} )
f14_local6:registerEventHandler( "flash", MBh.AnimateLoop( {
{
"red",
500
},
{
"white",
0
}
} ) )
if not MLG.IsMLGSpectator() then
self:addElement( f14_local3 )
end
self:addElement( f14_local4 )
self:addElement( f14_local5 )
self:addElement( f14_local6 )
return self
end
local f0_local12 = {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
bottom = -200,
left = 250,
height = 128,
width = 256,
alpha = 0
}
if Engine.UsingSplitscreenUpscaling() then
f0_local12.bottom = -100
f0_local12.left = 350
end
local f0_local13 = {
alpha = 1
}
local f0_local14 = function ()
local f15_local0 = RegisterMaterial( "cranked_back_1" )
local f15_local1 = RegisterMaterial( "cranked_back_2" )
local self = LUI.UIElement.new()
self.id = "crankedBombTimerHudIdContainerWrapper"
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
alpha = 1
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "hidden", {
alpha = 0
} )
self:registerEventHandler( "cod_caster_view_free", MBh.AnimateToState( "hidden", 250 ) )
self:registerEventHandler( "cod_caster_view_player", MBh.AnimateToState( "default", 0 ) )
local f15_local3 = LUI.UIElement.new()
f15_local3.id = "crankedBombTimerHudId"
f15_local3:registerAnimationState( "default", f0_local12 )
f15_local3:animateToState( "default", 0 )
f15_local3:registerAnimationState( "active", f0_local13 )
f15_local3:registerOmnvarHandler( "ui_cranked_bomb_timer_end_milliseconds", f0_local6 )
f15_local3:registerOmnvarHandler( "ui_cranked_bomb_timer_final_seconds", f0_local8 )
f15_local3:registerEventHandler( "playerstate_client_changed", f0_local10 )
local f15_local4 = LUI.UIImage.new()
f15_local4.id = "cranked_bg"
f15_local4:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f15_local0,
alpha = 1
} )
f15_local4:animateToState( "default", 0 )
local f15_local5 = LUI.UIImage.new()
f15_local5.id = "cranked_warning_bg"
f15_local5:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f15_local1,
alpha = 0
} )
f15_local5:animateToState( "default", 0 )
f15_local5:registerAnimationState( "flashing", {
alpha = 1
} )
local f15_local6 = LUI.UIText.new()
f15_local6.id = "cranked_text"
f15_local6:setText( Engine.Localize( "@LUA_MENU_CRANKED_CAPS" ) )
f15_local6:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -35,
right = -38,
height = CoD.TextSettings.HudEuroConRegSmallFont.Height,
width = 256,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Right,
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b,
alpha = 1
} )
f15_local6:animateToState( "default", 0 )
f15_local6:registerOmnvarHandler( "ui_cranked_bomb_timer_text", f0_local9 )
local f15_local7 = LUI.UIText.new()
f15_local7.id = "cranked_countdown_bg"
f15_local7:setText( "8:88.8" )
f15_local7:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 33,
left = 30,
height = CoD.TextSettings.HudDigitalExtraBigFont.Height,
width = 128,
font = CoD.TextSettings.HudDigitalExtraBigFont.Font,
alignment = LUI.Alignment.Right,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 0.15
} )
f15_local7:animateToState( "default", 0 )
f15_local7:registerAnimationState( "flashing", {
red = Colors.black.r,
green = Colors.black.g,
blue = Colors.black.b
} )
local f15_local8 = LUI.UICountdown.new( {} )
f15_local8.id = "cranked_countdown"
f15_local8:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 33,
left = 30,
height = CoD.TextSettings.HudDigitalExtraBigFont.Height,
width = 128,
font = CoD.TextSettings.HudDigitalExtraBigFont.Font,
alignment = LUI.Alignment.Right,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f15_local8:animateToState( "default", 0 )
f15_local8:registerAnimationState( "flashing", {
red = Colors.black.r,
green = Colors.black.g,
blue = Colors.black.b
} )
self:addElement( f15_local3 )
f15_local3:addElement( f15_local4 )
f15_local3:addElement( f15_local5 )
f15_local3:addElement( f15_local6 )
f15_local3:addElement( f15_local7 )
f15_local3:addElement( f15_local8 )
return self
end
LUI.MenuBuilder.registerType( "timersHudDef", f0_local11 )
LUI.MenuBuilder.registerType( "crankedBombTimerHudDef", f0_local14 )
LockTable( _M )

View File

@ -0,0 +1,545 @@
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( "@KILLSTREAKS_VANGUARD_HEADING_LABEL", Game.GetOmnvar( "ui_vanguard_heading" ) ) )
local f2_local1 = f2_arg0:getChildById( "vanguardAltitudeId" )
f2_local1:setText( Engine.Localize( "@KILLSTREAKS_VANGUARD_ALT_LABEL", Game.GetOmnvar( "ui_vanguard_altitude" ) ) )
local f2_local2 = f2_arg0:getChildById( "vanguardRangeId" )
f2_local2:setText( Engine.Localize( "@KILLSTREAKS_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 = "@KILLSTREAKS_VANGUARD_WEAPON_STATUS_READY"
if f3_arg1.value < 0 then
f3_local1 = "@KILLSTREAKS_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( "@KILLSTREAKS_VANGUARD_WEAPON_STATUS_LABEL", Engine.Localize( f3_local1 ) ) )
end
local f0_local3 = function ( f4_arg0, f4_arg1 )
local f4_local0 = f4_arg0:getChildById( "vanguardControlsVLId" )
local f4_local1 = f4_local0:getChildById( "steeringTextId" )
local f4_local2 = f4_local0:getChildById( "steeringText2Id" )
local f4_local3 = f4_local0:getChildById( "fireTextId" )
if CoD.UsingController() then
f4_local1:setText( Engine.Localize( "@KILLSTREAKS_REMOTE_UAV_ASCEND" ) )
f4_local2:setText( Engine.Localize( "@KILLSTREAKS_REMOTE_UAV_DESCEND" ) )
else
f4_local1:setText( Engine.Localize( "@PLATFORM_REMOTE_UAV_ASCEND" ) )
f4_local2:setText( Engine.Localize( "@PLATFORM_REMOTE_UAV_DESCEND" ) )
end
f4_local3:setText( Engine.Localize( "@PLATFORM_PREDATOR_MISSILE_FIRE" ) )
end
function vanguardOverlayDef()
local f5_local0 = RegisterMaterial( "ac130_overlay_grain" )
local f5_local1 = RegisterMaterial( "gryphon_hud_mp" )
local f5_local2 = RegisterMaterial( "white" )
local f5_local3, f5_local4 = GameX.GetScreenDims()
local f5_local5, f5_local6 = nil
local self = LUI.UIElement.new()
self.id = "vanguardOverlayContainerId"
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_vanguard", f0_local0 )
self:registerEventHandler( "init_overlay", f0_local0 )
self:registerEventHandler( "refresh_controls", f0_local3 )
self:registerOmnvarHandler( "ui_vanguard_heading", f0_local1 )
self:registerOmnvarHandler( "ui_vanguard_ammo", f0_local2 )
local f5_local8 = LUI.UIImage.new()
f5_local8.id = "vanguardOverlayImageId"
f5_local8:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f5_local0,
red = 0.9,
green = 1,
blue = 1,
alpha = 0.45
} )
f5_local8:animateToState( "default", 0 )
f5_local8:registerAnimationState( "active", {
alpha = 1
} )
self:addElement( f5_local8 )
local f5_local9 = LUI.UIImage.new()
f5_local9.id = "vanguardReticleImageId"
f5_local9:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f5_local1,
alpha = 0
} )
f5_local9:animateToState( "default", 0 )
f5_local9:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f5_local1,
alpha = 1
} )
self:addElement( f5_local9 )
local f5_local10 = LUI.UIText.new()
f5_local10.id = "vanguardWarning"
f5_local10:setText( Engine.Localize( "@KILLSTREAKS_REMOTE_UAV_OUT_OF_RANGE" ) )
f5_local10:setTextStyle( CoD.TextStyle.None )
f5_local10: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
} )
f5_local10:animateToState( "default", 0 )
f5_local10:registerAnimationState( "showing", {
red = Colors.red.r,
alpha = 1
} )
f5_local10:registerAnimationState( "blink", {
red = 0.5,
alpha = 0.5
} )
if not MLG.IsMLGSpectator() then
f5_local6 = LUI.UIHorizontalList.new()
f5_local6.id = "vanguardControlsVLId"
f5_local6:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = -66,
left = -384,
right = 384,
height = 64,
alpha = 1,
spacing = 0
} )
f5_local6:animateToState( "default", 0 )
local f5_local11 = LUI.UIText.new()
f5_local11.id = "steeringTextId"
local f5_local12 = nil
if CoD.UsingController() then
f5_local12 = "@KILLSTREAKS_REMOTE_UAV_ASCEND"
else
f5_local12 = "@PLATFORM_REMOTE_UAV_ASCEND"
end
f5_local11:setText( Engine.Localize( f5_local12 ) )
f5_local11:setTextStyle( CoD.TextStyle.Shadowed )
f5_local11:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = 0,
width = 256,
height = CoD.TextSettings.HudEuroNormalFont.Height,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alignment = LUI.Alignment.Center
} )
f5_local11:animateToState( "default", 0 )
local f5_local13 = LUI.UIText.new()
f5_local13.id = "steeringText2Id"
if CoD.UsingController() then
f5_local12 = "@KILLSTREAKS_REMOTE_UAV_DESCEND"
else
f5_local12 = "@PLATFORM_REMOTE_UAV_DESCEND"
end
f5_local13:setText( Engine.Localize( f5_local12 ) )
f5_local13:setTextStyle( CoD.TextStyle.Shadowed )
f5_local13:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = 0,
width = 256,
height = CoD.TextSettings.HudEuroNormalFont.Height,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alignment = LUI.Alignment.Center
} )
f5_local13:animateToState( "default", 0 )
local f5_local14 = LUI.UIText.new()
f5_local14.id = "fireTextId"
f5_local14:setText( Engine.Localize( "@PLATFORM_PREDATOR_MISSILE_FIRE" ) )
f5_local14:setTextStyle( CoD.TextStyle.Shadowed )
f5_local14:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
bottom = 0,
width = 256,
height = CoD.TextSettings.HudEuroNormalFont.Height,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alignment = LUI.Alignment.Center
} )
f5_local14:animateToState( "default", 0 )
f5_local6:addElement( f5_local13 )
f5_local6:addElement( f5_local14 )
f5_local6:addElement( f5_local11 )
end
if not MLG.IsMLGSpectator() then
f5_local5 = LUI.UIText.new()
f5_local5.id = "vanguardTitleId"
f5_local5:setText( Engine.Localize( "@KILLSTREAKS_VANGUARD_TITLE" ) )
f5_local5:setTextStyle( CoD.TextStyle.None )
f5_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
} )
f5_local5:animateToState( "default", 0 )
self:addElement( f5_local5 )
end
local f5_local11 = RegisterMaterial( "apache_ammo_mp" )
local f5_local12 = LUI.UIImage.new()
f5_local12.id = "bar1"
f5_local12:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 72,
right = 128,
height = 16,
width = 16,
material = f5_local11,
alpha = 1,
zRot = 90
} )
f5_local12:animateToState( "default", 0 )
f5_local12:registerAnimationState( "blink_on", {
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f5_local12:registerAnimationState( "blink_off", {
red = Colors.grey_2.r,
green = Colors.grey_2.g,
blue = Colors.grey_2.b,
alpha = 0.25
} )
self:addElement( f5_local12 )
f5_local5 = LUI.UIText.new()
f5_local5.id = "vanguardFlightModeId"
f5_local5:setText( Engine.Localize( "@KILLSTREAKS_VANGUARD_FLIGHT_MODE" ) )
f5_local5:setTextStyle( CoD.TextStyle.None )
f5_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
} )
f5_local5:animateToState( "default", 0 )
self:addElement( f5_local5 )
f5_local5 = LUI.UIText.new()
f5_local5.id = "vanguardHeadingId"
f5_local5:setText( Engine.Localize( "@KILLSTREAKS_VANGUARD_HEADING_LABEL" ) )
f5_local5:setTextStyle( CoD.TextStyle.None )
f5_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
} )
f5_local5:animateToState( "default", 0 )
self:addElement( f5_local5 )
f5_local5 = LUI.UIText.new()
f5_local5.id = "vanguardAltitudeId"
f5_local5:setText( Engine.Localize( "@KILLSTREAKS_VANGUARD_ALT_LABEL" ) )
f5_local5:setTextStyle( CoD.TextStyle.None )
f5_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
} )
f5_local5:animateToState( "default", 0 )
self:addElement( f5_local5 )
f5_local5 = LUI.UIText.new()
f5_local5.id = "vanguardWeaponId"
f5_local5:setText( Engine.Localize( "@KILLSTREAKS_VANGUARD_WEAPON_STATUS_LABEL", Engine.Localize( "@KILLSTREAKS_VANGUARD_WEAPON_STATUS_READY" ) ) )
f5_local5:setTextStyle( CoD.TextStyle.None )
f5_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 = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
f5_local5:animateToState( "default", 0 )
f5_local5:registerAnimationState( "reload", {
red = Colors.md_grey.r,
green = Colors.md_grey.g,
blue = Colors.md_grey.b
} )
self:addElement( f5_local5 )
f5_local5 = LUI.UIText.new()
f5_local5.id = "vanguardRangeId"
f5_local5:setText( Engine.Localize( "@KILLSTREAKS_VANGUARD_RANGE", 0 ) )
f5_local5:setTextStyle( CoD.TextStyle.None )
f5_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
} )
f5_local5:animateToState( "default", 0 )
self:addElement( f5_local5 )
local f5_local13 = LUI.UIElement.new()
f5_local13.id = "vanguardStaticId"
f5_local13:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
alpha = 0
} )
f5_local13:animateToState( "default", 0 )
f5_local13:registerAnimationState( "active", {
alpha = 0.1
} )
f5_local13:registerAnimationState( "active2", {
alpha = 0.2
} )
f5_local13:registerAnimationState( "active3", {
alpha = 0.3
} )
f5_local13:registerAnimationState( "active4", {
alpha = 0.4
} )
f5_local13:registerAnimationState( "active5", {
alpha = 0.5
} )
f5_local13:registerAnimationState( "active6", {
alpha = 0.6
} )
f5_local13:registerAnimationState( "active7", {
alpha = 0.7
} )
f5_local13:registerAnimationState( "active8", {
alpha = 0.8
} )
f5_local13:registerAnimationState( "active9", {
alpha = 0.9
} )
f5_local13:registerAnimationState( "active10", {
alpha = 1
} )
local f5_local14 = LUI.UIImage.new()
f5_local14.id = "vanguardWhiteImageId"
f5_local14:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f5_local2
} )
f5_local14:animateToState( "default", 0 )
local f5_local15 = LUI.UIImage.new()
f5_local15.id = "vanguardStaticImageId"
f5_local15:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f5_local0
} )
f5_local15:animateToState( "default", 0 )
f5_local13:addElement( f5_local14 )
f5_local13:addElement( f5_local15 )
if not MLG.IsMLGSpectator() then
self:addElement( f5_local6 )
end
self:addElement( f5_local13 )
self:addElement( f5_local10 )
return self
end
LUI.MenuBuilder.registerType( "vanguardOverlayDef", vanguardOverlayDef )
LockTable( _M )

View File

@ -0,0 +1,242 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function deriveUVType()
local f1_local0 = 0
local f1_local1 = Game.GetPlayerWeaponName()
if string.find( f1_local1, "eotech" ) ~= nil then
f1_local0 = 1
elseif string.find( f1_local1, "l115a3scope" ) ~= nil or string.find( f1_local1, "l115a3vzscope" ) ~= nil or string.find( f1_local1, "usrscope" ) ~= nil or string.find( f1_local1, "usrvzscope" ) ~= nil then
f1_local0 = 2
end
return f1_local0
end
function weaponChange_updateWeaponUVType( f2_arg0, f2_arg1 )
local f2_local0 = deriveUVType()
if f2_local0 ~= f2_arg0.WEAPON_UV_TYPE then
if f2_arg0.WEAPON_UV_TYPE == 0 then
elseif f2_arg0.WEAPON_UV_TYPE == 1 then
weaponAttachUpdate_eotechReset( f2_arg0 )
elseif f2_arg0.WEAPON_UV_TYPE == 2 then
else
end
if f2_local0 == 0 then
Game.EnableViewModelUVAnimTimeOverride( false )
else
Game.EnableViewModelUVAnimTimeOverride( true )
Game.SetViewModelUVAnimTimeOverride( 0 )
end
f2_arg0.WEAPON_UV_TYPE = f2_local0
end
end
function timer_updateWeaponAttachment( f3_arg0, f3_arg1 )
if f3_arg0.WEAPON_UV_TYPE == -1 then
weaponChange_updateWeaponUVType( f3_arg0, f3_arg1 )
end
if isEMPed() then
if f3_arg0.WEAPON_UV_TYPE == 1 then
weaponAttachUpdate_eotechEMP()
elseif f3_arg0.WEAPON_UV_TYPE == 2 then
weaponAttachUpdate_scopeKillsEMP()
end
elseif f3_arg0.WEAPON_UV_TYPE == 1 then
weaponAttachUpdate_eotech( f3_arg0, f3_arg1 )
elseif f3_arg0.WEAPON_UV_TYPE == 2 then
weaponAttachUpdate_scopeKills( f3_arg0, f3_arg1 )
end
end
function isEMPed()
return Game.GetOmnvar( "ui_hud_emp_artifact" ) or Game.GetOmnvar( "ui_hud_static" ) > 0
end
f0_local0 = 24
f0_local1 = 31.25
function weaponAttachUpdate_eotech( f5_arg0, f5_arg1 )
local f5_local0 = Game.GetWeaponDamageStats()
local f5_local1 = Game.GetCrosshairTraceDistance()
if f5_local1 == 0 then
f5_local1 = f5_local0.minDamageRange
end
local f5_local2 = 0
local f5_local3 = f5_local0.minDamageRange - f5_local0.maxDamageRange
if f5_local3 ~= 0 then
f5_local2 = 1 - LUI.clamp( (f5_local1 - f5_local0.maxDamageRange) / f5_local3, 0, 1 )
end
if f5_arg0.EOTECH_BAR_DISPLAY_PREV == nil then
f5_arg0.EOTECH_BAR_DISPLAY_PREV = 0
end
local f5_local4 = (f5_local2 - f5_arg0.EOTECH_BAR_DISPLAY_PREV) * 0.25 + f5_arg0.EOTECH_BAR_DISPLAY_PREV
Game.SetViewModelUVAnimTimeOverride( LUI.clamp( math.floor( f5_local4 * f0_local0 ) * f0_local1, f0_local1, f0_local1 * (f0_local0 - 1) ) )
f5_arg0.EOTECH_BAR_DISPLAY_PREV = f5_local4
end
function weaponAttachUpdate_eotechReset( f6_arg0 )
f6_arg0.EOTECH_BAR_DISPLAY_PREV = 0
end
function weaponAttachUpdate_eotechNewClient( f7_arg0 )
weaponAttachUpdate_eotechReset( f7_arg0, event )
end
function weaponAttachUpdate_eotechEMP()
Game.SetViewModelUVAnimTimeOverride( (f0_local0 + 1) * f0_local1 )
end
f0_local2 = 0
local f0_local3 = 1
local f0_local4 = 2
local f0_local5 = 3
local f0_local6 = 4
local f0_local7 = 5
local f0_local8 = 6
local f0_local9 = 7
local f0_local10 = 125
function omnvarScope_updateSniperScopeState( f9_arg0, f9_arg1 )
f9_arg0.SCOPE_DISPLAY_STATE_NEW = f9_arg1.value
end
function weaponAttachUpdate_scopeKills( f10_arg0, f10_arg1 )
if f10_arg0.SCOPE_DISPLAY_STATE == -1 then
initScopeDisplayState( f10_arg0, 0, f0_local2, f0_local3, -1, 10 )
end
if f10_arg0.SCOPE_DISPLAY_STATE_NEW ~= -1 then
initScopeDisplayStateByNum( f10_arg0, f10_arg0.SCOPE_DISPLAY_STATE_NEW )
f10_arg0.SCOPE_DISPLAY_STATE_NEW = -1
end
if f10_arg0.SCOPE_STATE_FLASH_COUNT == -1 or f10_arg0.SCOPE_STATE_FLASH_COUNT > 0 then
f10_arg0.SCOPE_STATE_UPDATES = f10_arg0.SCOPE_STATE_UPDATES + 1
if f10_arg0.SCOPE_STATE_FLASH_PER <= f10_arg0.SCOPE_STATE_UPDATES then
local f10_local0 = f10_arg0.SCOPE_STATE_FRAME_CURRENT
local f10_local1 = f10_arg0.SCOPE_STATE_FRAME_A
f10_arg0.SCOPE_STATE_FRAME_CURRENT = REG9 and f10_arg0.SCOPE_STATE_FRAME_B or f10_arg0.SCOPE_STATE_FRAME_A
if f10_arg0.SCOPE_STATE_FLASH_COUNT ~= -1 then
f10_arg0.SCOPE_STATE_FLASH_COUNT = f10_arg0.SCOPE_STATE_FLASH_COUNT - 1
end
f10_arg0.SCOPE_STATE_UPDATES = 0
end
elseif f10_arg0.SCOPE_STATE_FRAME_CURRENT ~= f10_arg0.SCOPE_STATE_FRAME_A then
f10_arg0.SCOPE_STATE_FRAME_CURRENT = f10_arg0.SCOPE_STATE_FRAME_A
end
Game.SetViewModelUVAnimTimeOverride( f0_local10 * f10_arg0.SCOPE_STATE_FRAME_CURRENT )
end
function weaponAttachUpdate_scopeNewClient( f11_arg0 )
forceScopeDisplayStateByNum( f11_arg0, Game.GetOmnvar( "weap_sniper_display_state" ) )
end
function forceScopeDisplayStateByNum( f12_arg0, f12_arg1 )
initScopeDisplayStateByNum( f12_arg0, f12_arg1 )
if f12_arg0.SCOPE_STATE_FLASH_COUNT ~= -1 then
f12_arg0.SCOPE_STATE_FLASH_COUNT = 0
end
end
function initScopeDisplayStateByNum( f13_arg0, f13_arg1 )
if f13_arg1 == 0 then
initScopeDisplayState( f13_arg0, f13_arg1, f0_local2, f0_local3, -1, 10 )
elseif f13_arg1 == 1 then
initScopeDisplayState( f13_arg0, f13_arg1, f0_local4, f0_local3, 10, 5 )
elseif f13_arg1 == 2 then
initScopeDisplayState( f13_arg0, f13_arg1, f0_local5, f0_local3, 10, 5 )
elseif f13_arg1 == 3 then
initScopeDisplayState( f13_arg0, f13_arg1, f0_local6, f0_local3, 10, 5 )
elseif f13_arg1 == 4 then
initScopeDisplayState( f13_arg0, f13_arg1, f0_local8, f0_local3, 10, 5 )
end
end
function initScopeDisplayState( f14_arg0, f14_arg1, f14_arg2, f14_arg3, f14_arg4, f14_arg5 )
f14_arg0.SCOPE_DISPLAY_STATE = f14_arg1
f14_arg0.SCOPE_STATE_FRAME_A = f14_arg2
f14_arg0.SCOPE_STATE_FRAME_B = f14_arg3
f14_arg0.SCOPE_STATE_FLASH_COUNT = f14_arg4
f14_arg0.SCOPE_STATE_FLASH_PER = f14_arg5
f14_arg0.SCOPE_STATE_FRAME_CURRENT = f14_arg2
f14_arg0.SCOPE_STATE_UPDATES = 0
Game.SetViewModelUVAnimTimeOverride( f0_local10 * f14_arg0.SCOPE_STATE_FRAME_CURRENT )
end
function weaponAttachUpdate_scopeKillsEMP()
Game.SetViewModelUVAnimTimeOverride( f0_local9 * f0_local10 )
end
function weaponAttachmentProcessing_init( f16_arg0 )
f16_arg0.WEAPON_UV_TYPE = -1
f16_arg0.EOTECH_BAR_DISPLAY_PREV = nil
f16_arg0.SCOPE_DISPLAY_STATE = -1
f16_arg0.SCOPE_STATE_FRAME_A = f0_local2
f16_arg0.SCOPE_STATE_FRAME_B = f0_local3
f16_arg0.SCOPE_STATE_FRAME_CURRENT = f16_arg0.SCOPE_STATE_FRAME_A
f16_arg0.SCOPE_STATE_FLASH_COUNT = -1
f16_arg0.SCOPE_STATE_FLASH_PER = 10
f16_arg0.SCOPE_STATE_UPDATES = 0
f16_arg0.SCOPE_DISPLAY_STATE_NEW = -1
end
function clientChanged_updateAttachmentState( f17_arg0, f17_arg1 )
weaponAttachmentProcessing_init( f17_arg0 )
weaponAttachUpdate_eotechNewClient( f17_arg0 )
weaponAttachUpdate_scopeNewClient( f17_arg0 )
weaponChange_updateWeaponUVType( f17_arg0, f17_arg1 )
end
function weaponAttachmentProcessing()
local self = LUI.UIElement.new()
self.id = "weapAttachment"
self:registerEventHandler( "update_weapon_attachment", timer_updateWeaponAttachment )
self:addElement( LUI.UITimer.new( 50, "update_weapon_attachment" ) )
self:registerEventHandler( "weapon_change", weaponChange_updateWeaponUVType )
self:registerOmnvarHandler( "weap_sniper_display_state", omnvarScope_updateSniperScopeState )
self:registerEventHandler( "playerstate_client_changed", clientChanged_updateAttachmentState )
weaponAttachmentProcessing_init( self )
return self
end
local f0_local11 = function ()
if Game.InKillCam() then
if Game.IsCinematicCameraActive() then
return false
elseif Game.IsKillCamEntityActive() then
return false
end
elseif Game.IsSpectatorCameraActive() then
return false
end
return true
end
function blurTargetChanged( f20_arg0, f20_arg1 )
if f0_local11() then
Game.StartBlur( Game.GetOmnvar( "blur_target" ), Game.GetOmnvar( "blur_duration_ms" ) )
else
Game.StartBlur( 0, 0 )
end
end
function blurClientChanged( f21_arg0, f21_arg1 )
if f0_local11() then
Game.StartBlur( Game.GetOmnvar( "blur_target" ), 0 )
else
Game.StartBlur( 0, 0 )
end
end
function blurProcessing()
local self = LUI.UIElement.new()
self.id = "blurUpdater"
self:registerOmnvarHandler( "blur_target", blurTargetChanged )
self:registerEventHandler( "playerstate_client_changed", blurClientChanged )
self:registerEventHandler( "camera_client_changed", blurClientChanged )
return self
end
LUI.MenuBuilder.registerType( "weaponAttachmentProcessing", weaponAttachmentProcessing )
LUI.MenuBuilder.registerType( "blurProcessing", blurProcessing )
LockTable( _M )

View File

@ -0,0 +1,906 @@
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 not f1_arg1 then
f1_arg1 = Game.GetPlayerWeaponName()
end
if f1_arg0.current_weaponName ~= f1_arg1 then
f1_arg0.current_weaponName = f1_arg1
f1_arg0.current_showAmmo = false
if f1_arg1 == "none" then
f1_arg0.current_showAmmo = false
return false
end
local f1_local0 = string.find( f1_arg1, "_" )
local f1_local1 = string.sub( f1_arg1, 1, f1_local0 - 1 )
if f1_local1 == "iw5" or f1_local1 == "iw6" then
f1_local1 = string.sub( f1_arg1, 1, string.find( f1_arg1, "_", f1_local0 + 1 ) - 1 )
end
if CoD.WeaponListPrimary[f1_local1] ~= nil or CoD.WeaponListSecondary[f1_local1] ~= nil then
f1_arg0.current_showAmmo = true
return true
else
f1_arg0.current_showAmmo = false
return false
end
else
return f1_arg0.current_showAmmo
end
end
f0_local1 = function ( f2_arg0, f2_arg1 )
if f2_arg1.weapon_name ~= nil and f2_arg1.weapon_name ~= f2_arg0.previous_weapon_name then
if f2_arg1.display_name then
f2_arg0:setText( f2_arg1.display_name )
end
local f2_local0 = MBh.AnimateSequence( {
{
"default",
0
},
{
"slide_in",
250
},
{
"slide_in",
1200
},
{
"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
}
} )
f2_local0( f2_arg0 )
f2_arg0.previous_weapon_name = f2_arg1.weapon_name
end
end
f0_local2 = function ( f3_arg0, f3_arg1 )
local f3_local0 = f3_arg1.weapon_name
if not f3_local0 then
f3_local0 = Game.GetPlayerWeaponName()
end
if f3_arg0.weaponNameRight ~= f3_local0 then
f3_arg0.weaponNameRight = f3_local0
if f0_local0( f3_arg0, f3_local0 ) then
if f3_arg0.current_state ~= "active" then
f3_arg0:animateToState( "active", 0 )
f3_arg0.current_state = "active"
end
elseif f3_arg0.current_state ~= "default" then
f3_arg0:animateToState( "default", 0 )
f3_arg0.current_state = "default"
end
end
end
local f0_local3 = function ( f4_arg0, f4_arg1 )
if GameX.GetGameMode() == "horde" then
f0_local2( f4_arg0, f4_arg1 )
end
end
local f0_local4 = function ( f5_arg0, f5_arg1 )
local f5_local0 = f5_arg1.weapon_name
if not f5_local0 then
f5_local0 = Game.GetPlayerWeaponName()
if not string.find( f5_local0, "akimbo" ) then
return
end
end
if f5_arg0.weaponNameLeft ~= f5_local0 then
f5_arg0.weaponNameLeft = f5_local0
if string.find( f5_local0, "akimbo" ) ~= nil then
if f5_arg0.current_state ~= "active" then
f5_arg0:animateToState( "active", 0 )
f5_arg0.current_state = "active"
end
elseif f5_arg0.current_state ~= "default" then
f5_arg0:animateToState( "default", 0 )
f5_arg0.current_state = "default"
end
end
end
local f0_local5 = function ( f6_arg0, f6_arg1 )
local f6_local0
if Game.IsWeaponAltModeUsable() == 0 or f6_arg1.weapon_name == "none" then
f6_local0 = false
else
f6_local0 = true
end
if f6_local0 then
local f6_local1 = Game.GetWeaponAltModeMaterial()
if not f6_local1 then
return
end
f6_arg0:registerAnimationState( "alt_mode_on", {
topAnchor = f6_arg0.properties.tAnchor,
leftAnchor = f6_arg0.properties.lAnchor,
bottomAnchor = f6_arg0.properties.bAnchor,
rightAnchor = f6_arg0.properties.rAnchor,
bottom = f6_arg0.properties.b or 0,
height = f6_arg0.properties.h or 0,
right = f6_arg0.properties.r or 0,
width = f6_arg0.properties.w or 0,
red = f6_arg0.properties.color and f6_arg0.properties.color[1] or 1,
green = f6_arg0.properties.color and f6_arg0.properties.color[2] or 1,
blue = f6_arg0.properties.color and f6_arg0.properties.color[3] or 1,
alpha = 1,
material = RegisterMaterial( f6_local1 )
} )
f6_arg0:animateToState( "alt_mode_on", 100 )
else
f6_arg0:animateToState( "default", 0 )
end
end
local f0_local6 = function ( f7_arg0, f7_arg1 )
local f7_local0 = Game.GetPlayerWeaponName()
if f0_local0( f7_arg0, f7_local0 ) then
local f7_local1 = Game.GetPlayerStockAmmo()
local f7_local2 = Game.GetPlayerMaxClipAmmo()
local f7_local3 = Game.GetPlayerClipAmmo( 1 )
local f7_local4 = Game.GetPlayerClipAmmo( 2 )
local f7_local5 = 0.33
local f7_local6 = ""
local f7_local7 = "default"
local f7_local8 = string.find( f7_local0, "akimbo" ) ~= nil
if not (f7_local8 ~= false or f7_local3 ~= 0 or f7_local1 ~= 0) or f7_local8 == true and f7_local3 == 0 and f7_local4 == 0 and f7_local1 == 0 then
f7_local6 = Engine.Localize( "@WEAPON_NO_AMMO" )
f7_local7 = "no_ammo"
elseif f7_local3 <= f7_local2 * f7_local5 or f7_local8 and f7_local4 <= f7_local2 * f7_local5 then
if f7_local1 == 0 then
f7_local6 = Engine.Localize( "@PLATFORM_LOW_AMMO_NO_RELOAD" )
f7_local7 = "low_ammo"
elseif f7_local3 ~= 0 or f7_local8 and f7_local4 ~= 0 then
if false == Engine.IsConsoleGame() and 1 == Engine.IsGamepadEnabled() then
f7_local6 = Engine.Localize( "@PLATFORM_RELOAD_GAMEPAD" )
else
f7_local6 = Engine.Localize( "@PLATFORM_RELOAD" )
end
f7_local7 = "reload"
end
end
if f7_local7 == "default" and f7_arg0.current_state ~= f7_local7 then
f7_arg0:animateToState( f7_local7, 0 )
f7_arg0:setText( f7_local6 )
elseif f7_local7 == "reload" and f7_arg0.current_state ~= f7_local7 then
f7_arg0:animateToState( f7_local7, 250 )
f7_arg0:setText( f7_local6 )
elseif f7_local7 == "low_ammo" and f7_arg0.current_state ~= f7_local7 then
f7_arg0:processEvent( {
name = "low_ammo_flashing_red"
} )
f7_arg0:setText( f7_local6 )
elseif f7_local7 == "no_ammo" and f7_arg0.current_state ~= f7_local7 then
f7_arg0:animateToState( f7_local7, 250 )
f7_arg0:setText( f7_local6 )
end
f7_arg0.current_state = f7_local7
elseif f7_arg0.current_state ~= "default" then
f7_arg0:animateToState( "default", 0 )
f7_arg0:setText( "" )
f7_arg0.current_state = "default"
end
end
local f0_local7 = function ( f8_arg0, f8_arg1 )
local f8_local0 = f8_arg0:getChildById( "weapon_info_grind_text" )
f8_local0:setText( f8_arg1.value )
end
local f0_local8 = function ( f9_arg0, f9_arg1 )
f0_local7( f9_arg0, {
value = Game.GetOmnvar( "ui_grind_tags" )
} )
end
local f0_local9 = function ( f10_arg0 )
local self = LUI.UIElement.new()
self.id = f10_arg0.id
self:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = f10_arg0.bottom,
right = f10_arg0.right,
height = f10_arg0.height,
width = f10_arg0.width,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
alpha = 1
} )
self:registerEventHandler( "weapon_change", f10_arg0.eventFunc )
self:registerEventHandler( "playerstate_client_changed", f10_arg0.eventFunc )
local f10_local1 = LUI.UIImage.new()
f10_local1.id = f10_arg0.bg.id
f10_local1:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = f10_arg0.bg.bottom or 0,
right = f10_arg0.bg.right or 0,
height = f10_arg0.bg.height or 0,
width = f10_arg0.bg.width or 0,
material = f10_arg0.bg.material
} )
f10_local1:animateToState( "default", 0 )
local f10_local2 = LUI.UIHorizontalList.new()
f10_local2.id = f10_arg0.hl.id or nil
f10_local2:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = f10_arg0.hl.bottom or 0,
right = f10_arg0.hl.right or 0,
height = f10_arg0.hl.height or 0,
alignment = LUI.Alignment.Right
} )
f10_local2:animateToState( "default", 0 )
if f10_arg0.startcap ~= nil then
local f10_local3 = LUI.UIImage.new()
f10_local3.id = "start_cap"
f10_local3:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = 0,
height = f10_arg0.imageHeight,
width = f10_arg0.startcap.width,
material = RegisterMaterial( f10_arg0.startcap.material )
} )
f10_local3:animateToState( "default", 0 )
f10_local2:addElement( f10_local3 )
end
local f10_local3 = LUI.UIImage.new()
f10_local3.id = "middle"
f10_local3:setupUIScorebar( f10_arg0.dataSource )
f10_local3.m_maxWidth = f10_arg0.maxWidth - (f10_arg0.startcap and f10_arg0.startcap.width or 0) - (f10_arg0.endcap and f10_arg0.endcap.width or 0)
f10_local3:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = 0,
height = f10_arg0.imageHeight,
material = RegisterMaterial( f10_arg0.material )
} )
f10_local3:animateToState( "default", 0 )
f10_local2:addElement( f10_local3 )
if f10_arg0.endcap ~= nil then
local f10_local4 = LUI.UIImage.new()
f10_local4.id = "end_cap"
f10_local4:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = 0,
height = f10_arg0.imageHeight,
width = f10_arg0.endcap.width,
material = RegisterMaterial( f10_arg0.endcap.material )
} )
f10_local4:animateToState( "default", 0 )
f10_local2:addElement( f10_local4 )
end
local f10_local4 = LUI.UIText.new()
f10_local4.id = f10_arg0.text.id
f10_local4:setupUIBindText( f10_arg0.dataSource )
f10_local4:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = f10_arg0.text.bottom or 0,
right = f10_arg0.text.right or 0,
height = CoD.TextSettings.HudDigitalSmallFont.Height,
font = CoD.TextSettings.HudDigitalSmallFont.Font,
alignment = LUI.Alignment.Right,
red = 0,
green = 0,
blue = 0,
alpha = 1
} )
f10_local4:animateToState( "default", 0 )
self:addElement( f10_local1 )
self:addElement( f10_local2 )
self:addElement( f10_local4 )
return self
end
local f0_local10 = function ()
local f11_local0 = RegisterMaterial( "hud_ammo_line" )
local f11_local1 = RegisterMaterial( "hud_ammobar_back" )
local f11_local2 = 128
local f11_local3 = 24
local f11_local4 = 24
local self = LUI.UIElement.new()
self.id = "weaaponHudId"
self:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = -31,
right = -20,
height = 100,
width = 400
} )
self:animateToState( "default", 0 )
local f11_local6 = LUI.UIText.new()
f11_local6.id = "weaponInfoWeaponName"
f11_local6:setText( "" )
f11_local6:setTextStyle( CoD.TextStyle.Shadowed )
f11_local6:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = -500,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 400,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right,
alpha = 0
} )
f11_local6:animateToState( "default", 0 )
f11_local6:registerAnimationState( "slide_in", {
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = -240,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 400,
alpha = 1
} )
f11_local6:registerAnimationState( "blink_off", {
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = -240,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 400,
alpha = 0
} )
f11_local6:registerAnimationState( "blink_on", {
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = -240,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 400,
alpha = 1
} )
f11_local6:registerEventHandler( "weapon_change", f0_local1 )
f11_local6:registerEventHandler( "playerstate_client_changed", f0_local1 )
local f11_local7 = LUI.UIElement.new()
f11_local7.id = "weaponInfoClipAmmo"
f11_local7:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = 0,
height = CoD.TextSettings.HudDigitalSmallFont.Height,
width = 256
} )
f11_local7:animateToState( "default", 0 )
local f11_local8 = LUI.UIImage.new()
f11_local8.id = "clip_ammo_line"
f11_local8:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = 0,
height = 32,
width = 256,
material = f11_local0
} )
f11_local8:animateToState( "default", 0 )
local f11_local9 = LUI.UIVerticalList.new()
f11_local9.id = "weaponInfoClipAmmoList"
f11_local9:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = -1,
right = 0,
height = 32,
width = 256,
spacing = 0,
alignment = LUI.Alignment.Bottom
} )
f11_local9:animateToState( "default", 0 )
local f11_local10 = f0_local9( {
id = "clipAmmoRightContainer",
dataSource = "ClipAmmoRight",
material = "hud_clip_bar",
maxWidth = f11_local2,
bottom = 0,
right = 0,
height = f11_local4,
width = f11_local2,
imageHeight = f11_local4,
eventFunc = f0_local2,
bg = {
id = "clipAmmoBgRight",
bottom = 1,
right = 0,
height = 32,
width = 256,
material = f11_local1
},
hl = {
id = "clipAmmoBarRight",
bottom = 0,
right = -90,
height = f11_local4,
width = f11_local2
},
endcap = {
material = "hud_clip_bar_cap",
width = f11_local3
},
text = {
id = "clipAmmoTextRight",
bottom = -5,
right = -90
}
} )
local f11_local11 = 20
local f11_local12 = f0_local9( {
id = "clipAmmoLeftContainer",
dataSource = "ClipAmmoLeft",
material = "hud_clip_bar",
maxWidth = f11_local2 - f11_local11,
bottom = 0,
right = f11_local11,
height = f11_local4,
width = f11_local2 - f11_local11,
imageHeight = f11_local4,
eventFunc = f0_local4,
bg = {
id = "clipAmmoBgLeft",
bottom = 1,
right = 0,
height = 32,
width = 256,
material = f11_local1
},
hl = {
id = "clipAmmoBarLeft",
bottom = 0,
right = -90 - f11_local11,
height = f11_local4,
width = f11_local2 - f11_local11
},
endcap = {
material = "hud_clip_bar_cap",
width = f11_local3
},
text = {
id = "clipAmmoTextLeft",
bottom = -5,
right = -90 - f11_local11
}
} )
f11_local10:registerEventHandler( "menu_create", f0_local3 )
f11_local9:addElement( f11_local10 )
f11_local9:addElement( f11_local12 )
f11_local7:addElement( f11_local8 )
f11_local7:addElement( f11_local9 )
local f11_local13 = LUI.UIElement.new()
f11_local13.id = "weaponInfoStockAmmo"
f11_local13:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = -2,
right = -35,
height = CoD.TextSettings.HudDigitalBigFont.Height,
width = 50,
alpha = 0
} )
f11_local13:animateToState( "default", 0 )
f11_local13:registerAnimationState( "active", {
alpha = 1
} )
f11_local13:registerEventHandler( "weapon_change", f0_local2 )
f11_local13:registerEventHandler( "playerstate_client_changed", f0_local2 )
f11_local13:registerEventHandler( "menu_create", f0_local3 )
local f11_local14 = LUI.UIText.new()
f11_local14.id = "weaponInfoStockAmmoBg"
f11_local14:setText( "888" )
f11_local14:registerAnimationState( "default", {
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
height = CoD.TextSettings.HudDigitalBigFont.Height,
font = CoD.TextSettings.HudDigitalBigFont.Font,
alignment = LUI.Alignment.Right,
red = 0,
green = 0,
blue = 0,
alpha = 0.25
} )
f11_local14:animateToState( "default", 0 )
local f11_local15 = LUI.UIText.new()
f11_local15.id = "weaponInfoStockAmmoText"
f11_local15:setupUIBindText( "StockAmmo" )
f11_local15:registerAnimationState( "default", {
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
height = CoD.TextSettings.HudDigitalBigFont.Height,
font = CoD.TextSettings.HudDigitalBigFont.Font,
alignment = LUI.Alignment.Right,
red = 1,
green = 1,
blue = 1,
alpha = 1
} )
f11_local15:animateToState( "default", 0 )
f11_local13:addElement( f11_local14 )
f11_local13:addElement( f11_local15 )
self:addElement( f11_local6 )
self:addElement( f11_local7 )
self:addElement( f11_local13 )
return self
end
local f0_local11 = function ()
local f12_local0 = RegisterMaterial( "white" )
local self = LUI.UIHorizontalList.new()
self.id = "primaryGrenadeHud"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -10,
right = -60,
height = 20,
width = 20,
spacing = -10,
alignment = LUI.Alignment.Right
} )
self:animateToState( "default", 0 )
local f12_local2 = LUI.UIElement.new()
f12_local2:setupUIIntWatch( "FragAmmo" )
f12_local2.id = "grenade_ammo_watch"
f12_local2:registerEventHandler( "int_watch_alert", function ( element, event )
event.name = "grenade_count_update"
self:processEvent( event )
end )
for f12_local3 = 1, 5, 1 do
local f12_local6 = f12_local3
local f12_local7 = LUI.UIImage.new()
f12_local7:setupUIBindImage( "FragMaterial" )
f12_local7.id = "grenade_" .. f12_local6
f12_local7:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
rightAnchor = true,
bottomAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f12_local0,
alpha = 0
} )
f12_local7:animateToState( "default", 0 )
f12_local7:registerAnimationState( "active", {
alpha = 1
} )
f12_local7:registerEventHandler( "grenade_count_update", function ( element, event )
if event.oldValue < f12_local6 and f12_local6 <= event.newValue then
f12_local7:animateToState( "active", 250 )
elseif f12_local6 <= event.oldValue and event.newValue < f12_local6 then
f12_local7:animateToState( "default", 0 )
end
end )
self:addElement( f12_local7 )
end
self:addElement( f12_local2 )
return self
end
local f0_local12 = function ()
local f15_local0 = RegisterMaterial( "white" )
local self = LUI.UIHorizontalList.new()
self.id = "secondaryGrenadeHud"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -10,
right = -120,
height = 20,
width = 20,
spacing = -12,
alignment = LUI.Alignment.Right
} )
self:animateToState( "default", 0 )
local f15_local2 = LUI.UIElement.new()
f15_local2:setupUIIntWatch( "FlashAmmo" )
f15_local2.id = "tactical_ammo_watch"
f15_local2:registerEventHandler( "int_watch_alert", function ( element, event )
event.name = "tactical_count_update"
self:processEvent( event )
end )
for f15_local3 = 1, 5, 1 do
local f15_local6 = f15_local3
local f15_local7 = LUI.UIImage.new()
f15_local7:setupUIBindImage( "FlashMaterial" )
f15_local7.id = "tactical_" .. f15_local6
f15_local7:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
rightAnchor = true,
bottomAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f15_local0,
alpha = 0
} )
f15_local7:animateToState( "default", 0 )
f15_local7:registerAnimationState( "active", {
alpha = 1
} )
f15_local7:registerEventHandler( "tactical_count_update", function ( element, event )
if event.oldValue < f15_local6 and f15_local6 <= event.newValue then
f15_local7:animateToState( "active", 250 )
elseif f15_local6 <= event.oldValue and event.newValue < f15_local6 then
f15_local7:animateToState( "default", 0 )
end
end )
self:addElement( f15_local7 )
end
self:addElement( f15_local2 )
return self
end
local f0_local13 = function ()
local f18_local0 = RegisterMaterial( "white" )
local f18_local1 = RegisterMaterial( "hud_dpad_arrow_left" )
local self = LUI.UIHorizontalList.new()
self.id = "weaponInfoAltMode"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -10,
right = -150,
height = 25,
width = 100,
spacing = 0,
alignment = LUI.Alignment.Left
} )
self:animateToState( "default", 0 )
local f18_local3 = LUI.UIImage.new()
f18_local3.id = "weaponInfoAltModeIcon"
f18_local3.properties = {
tAnchor = false,
lAnchor = false,
bAnchor = true,
rAnchor = true,
b = 0,
h = 25,
r = 0,
w = 25
}
f18_local3:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
height = 25,
right = 0,
width = 25,
alpha = 0,
material = f18_local0
} )
f18_local3:animateToState( "default", 0 )
f18_local3:registerEventHandler( "weapon_change", f0_local5 )
f18_local3:registerEventHandler( "playerstate_client_changed", f0_local5 )
local f18_local4 = LUI.UIText.new()
f18_local4.id = "weaponInfoAltModeNum"
f18_local4:setupUIBindText( "AltModeAmmo" )
f18_local4:setTextStyle( CoD.TextStyle.Shadowed )
f18_local4:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
height = CoD.TextSettings.HudDigitalSmallFont.Height,
right = 0,
width = 15,
font = CoD.TextSettings.HudDigitalSmallFont.Font,
alpha = 1
} )
f18_local4:animateToState( "default", 0 )
self:addElement( f18_local3 )
self:addElement( f18_local4 )
return self
end
local f0_local14 = function ()
local self = LUI.UIText.new()
self.id = "lowAmmoWarningHud"
self:setText( "" )
self:setTextStyle( CoD.TextStyle.Shadowed )
local f19_local1 = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
bottom = 140,
left = -200,
height = CoD.TextSettings.HudEuroNormalFont.Height,
width = 400,
font = CoD.TextSettings.HudEuroNormalFont.Font,
alignment = LUI.Alignment.Center,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 0
}
if Engine.UsingSplitscreenUpscaling() then
f19_local1.bottom = 90
end
self:registerAnimationState( "default", f19_local1 )
self:animateToState( "default", 0 )
self:registerAnimationState( "reload", {
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
} )
self:registerAnimationState( "low_ammo_on", {
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b,
alpha = 1
} )
self:registerAnimationState( "low_ammo_off", {
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b,
alpha = 1
} )
self:registerAnimationState( "no_ammo", {
red = Colors.red.r,
green = Colors.red.g,
blue = Colors.red.b,
alpha = 1
} )
self:registerEventHandler( "hud_refresh", f0_local6 )
self:registerEventHandler( "low_ammo_flashing_red", MBh.AnimateLoop( {
{
"low_ammo_on",
500
},
{
"low_ammo_off",
0
}
} ) )
return self
end
local f0_local15 = function ()
local f20_local0 = RegisterMaterial( "tags_hud_icon_1" )
local self = LUI.UIElement.new()
self.id = "weapon_info_grind_element"
self:registerAnimationState( "default", {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = true,
bottom = -90,
right = -100,
height = 64,
width = 64
} )
self:animateToState( "default", 0 )
self:registerOmnvarHandler( "ui_grind_tags", f0_local7 )
self:registerEventHandler( "playerstate_client_changed", f0_local8 )
local f20_local2 = LUI.UIImage.new()
f20_local2.id = "weapon_info_grind_icon"
f20_local2:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
material = f20_local0
} )
f20_local2:animateToState( "default", 0 )
local f20_local3 = LUI.UIText.new()
f20_local3.id = "weapon_info_grind_text"
f20_local3:setText( "999" )
f20_local3:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 20,
height = CoD.TextSettings.HudDigitalNormalFont.Height,
font = CoD.TextSettings.HudDigitalNormalFont.Font,
red = 0,
green = 0,
blue = 0
} )
f20_local3:animateToState( "default", 0 )
self:addElement( f20_local2 )
self:addElement( f20_local3 )
return self
end
LUI.MenuBuilder.registerType( "weaponInfoHudDef", function ()
local self = LUI.UIElement.new()
self.id = "weaponInfoHud"
self:registerAnimationState( "default", {
bottomAnchor = true,
rightAnchor = true,
bottom = 0,
right = 0,
height = 300,
width = 600
} )
self:animateToState( "default", 0 )
if not GameX.IsHardcoreMode() then
self:addElement( f0_local10() )
self:addElement( f0_local11() )
self:addElement( f0_local12() )
self:addElement( f0_local13() )
self:addElement( LUI.MenuBuilder.buildItems( {
type = "killstreakInfoHudDef"
}, self.properties, self ) )
if GameX.GetGameMode() == "grind" then
self:addElement( f0_local15() )
end
else
self:addElement( LUI.MenuBuilder.buildItems( {
type = "killstreakInfoHudDef"
}, self.properties, self ) )
end
return self
end )
LUI.MenuBuilder.registerType( "lowAmmoWarningHudDef", f0_local14 )
LockTable( _M )