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

54 lines
1.4 KiB
Lua

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 )