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

735 lines
17 KiB
Lua

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 )