iw6-lui/lui/mp_hud/a10overlayhud.dec.lua
2024-09-12 17:25:45 +02:00

802 lines
16 KiB
Lua

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 )