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 )