185 lines
4.5 KiB
Lua
185 lines
4.5 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 )
|
|
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 )
|