CoD.Loading = {} CoD.Loading.DidYouKnow = {} CoD.Loading.DidYouKnow.theater = { "MPTIP_THEATER_CONTROL_SCHEMES", "MPTIP_THEATER_CAMERA_MODES", "MPTIP_THEATER_TIMELINE", "MPTIP_THEATER_SCOREBOARD", "MPTIP_THEATER_MONTAGE", "MPTIP_THEATER_PAUSE", "MPTIP_THEATER_DISCARD", "MPTIP_THEATER_PREVIEW", "MPTIP_THEATER_TRANSITIONS", "MPTIP_THEATER_FILESHARE", "MPTIP_THEATER_RATE", "MPTIP_THEATER_SCOREBOARD_SWITCH", "MPTIP_THEATER_CLIENTS", } CoD.Loading.DidYouKnow.general = { "MPTIP_CREATE_A_CLASS_TIP", "MPTIP_CUSTOM_CLASS_TIP", "MPTIP_FRIENDS_LIST_TIP", "MPTIP_ASSIST_TIP", "MPTIP_CUSTOM_GAME_TIP", "MPTIP_SHOOTING_AIRCRAFT_TIP", "MPTIP_ENEMY_ON_MINIMAP_TIP", "MPTIP_MOTD_TIP", "MPTIP_LOOK_SENSITIVITY_TIP", "MPTIP_PAUSE_MENU_MAP_TIP", "MPTIP_FAST_ADS_WALK_TIP", "MPTIP_AUTOMATIC_WEAPONS_TIP", "MPTIP_DEAD_ALLIES_TIP", "MPTIP_GROUND_WEAPONS_TIP", "MPTIP_PISTOL_TIP", "MPTIP_LOCK_ON_TIP", "MPTIP_ADS_TIP", "MPTIP_FOOTSTEPS_TIP", "MPTIP_STAY_INSIDE_TIP", "MPTIP_MUTE_TIP", "MPTIP_THEATER_TIP", "MPTIP_HUD_TIP", "MPTIP_DTP_TIP", "MPTIP_CROSSBOW_TIP", "MPTIP_AAR_TIP", "MPTIP_COMBAT_TRAINING_TIP", "MPTIP_MATCH_BONUS_TIP", "MPTIP_WILDCARDS_TIP", "MPTIP_FRIENDS_BAR_TIP", "MPTIP_HELD_KNIFE_TIP", "MPTIP_ONE_GUN_PICKUP_TIP", "MPTIP_SHOTGUN_SLUG_TIP", "MPTIP_GHOST_FADE_TIP", "MPTIP_HARDCORE_HUD_TIP", "MPTIP_HARDCORE_MINIMAP_TIP", "MPTIP_WILLY_PETE_TIP", "MPTIP_TACTICAL_INSERTION_TIP", "MPTIP_TOMAHAWK_TIP", "MPTIP_C4_OBJECTIVES_TIP", "MPTIP_GRENADE_SOUND_TIP", "MPTIP_NO_COOKING_TIP", "MPTIP_CLAYMORE_TIP", "MPTIP_SHOCK_CHARGE_TIP", "MPTIP_FAST_MAG_TIP", "MPTIP_EXTENDED_MAGS_TIP", "MPTIP_DEEP_IMPACT_TIP", "MPTIP_SUPPRESSOR_TIP", "MPTIP_STEADY_AIM_TIP", "MPTIP_ATTACHMENT_VARIETY_TIP", "MPTIP_ATTACHMENTS_TIP", "MPTIP_TARGET_FINDER_TIP", "MPTIP_MMS_TIP", "MPTIP_SELECT_FIRE_TIP", "MPTIP_EXTREME_CARDIO_TIP", "MPTIP_UTILITY_TIP", "MPTIP_GHILLIE_SUIT_TIP", "MPTIP_FLAK_TIP", "MPTIP_KILLSTREAKS_MENU_TIP", "MPTIP_LOOPING_KILLSTREAK_TIP", "MPTIP_KILLSTREAKS_STAY_TIP", "MPTIP_TRANSPORT_HELI_TIP", "MPTIP_SR71_TIP", "MPTIP_ATTACK_DOG_TIP", "MPTIP_WAR_MACHINE_TIP", "MPTIP_TURRET_TIP", "MPTIP_DETONATE_TIP", "MPTIP_BOOST_TIP", "MPTIP_AUTO_EXPLODE_TIP", "MPTIP_TURRET_MELEE_TIP", "MPTIP_SCORESTREAK_OBJECTIVE_TIP", "MPTIP_REMOTE_CONTROL_TIP", "MPTIP_HK_INCOMING_TIP", "MPTIP_VTOL_MOVEMENT_TIP", "MPTIP_HELLSTORM_CLUSTER_TIP", "MPTIP_GUARDIAN_TIP", "MPTIP_TARGET_DIAMOND_LOS_TIP", } CoD.Loading.DidYouKnow.public = { "MPTIP_XP_SOURCES_TIP", "MPTIP_LEADERBOARD_TIP", "MPTIP_CHALLENGE_REWARDS_TIP", "MPTIP_LEAGUE_GAME_TIP", } CoD.Loading.DidYouKnow.league = { "MPTIP_LEAGUE_WINS_TIP", "MPTIP_LEAGUE_BONUS_TIP", "MPTIP_LEAGUE_LEAVE_TIP", "MPTIP_LEAGUE_EARNING_TIP", } CoD.Loading.DidYouKnow.sd = { "MPTIP_SERACH_AND_DESTROY_TIP", } CoD.Loading.DidYouKnow.dom = { "MPTIP_DOMINATION_TIP", } CoD.Loading.DidYouKnow.koth = { "MPTIP_HARDPOINT_TIP", } CoD.Loading.DidYouKnow.gun = { "MPTIP_WAGER_GOLD_DOT", "MPTIP_WAGER_GUN_DEMOTE", "MPTIP_WAGER_GUN_SUICIDE", } CoD.Loading.DidYouKnow.oic = { "MPTIP_WAGER_GOLD_DOT", "MPTIP_WAGER_OIC_KNIFE", "MPTIP_WAGER_OIC_LIVES", } CoD.Loading.DidYouKnow.shrp = { "MPTIP_WAGER_GOLD_DOT", "MPTIP_WAGER_SHARP_PERKS", "MPTIP_WAGER_SHARP_FINAL", } CoD.Loading.DidYouKnow.sas = { "MPTIP_WAGER_GOLD_DOT", "MPTIP_WAGER_STICKS_TOMAHAWK", "MPTIP_WAGER_STICKS_POINTS", "MPTIP_WAGER_STICKS_SPYPLANE", } CoD.Loading.DidYouKnow.zombies = { "Without the hard work of all of the Plutonium developers the games we love would have died off long ago.", } CoD.Loading.FadeInTime = 1000 CoD.Loading.LoadingDelayTime = 2000 CoD.Loading.SpinnerDelayTime = 19000 CoD.Loading.DYKFontName = "Default" CoD.Loading.DYKFont = CoD.fonts[CoD.Loading.DYKFontName] CoD.Loading.DYKFontHeight = CoD.textSize[CoD.Loading.DYKFontName] ToggleMapImage = function(MapImage, f1_arg1) if UIExpression.IsCinematicWebm() == 1 then if not MapImage.iswebm then MapImage:setImage(RegisterMaterial("webm_720p")) MapImage.iswebm = true end elseif MapImage.iswebm then MapImage:setImage(RegisterMaterial("black")) MapImage.iswebm = false end end WatchForUserActionToSkipFunc = function(LoadingWidget, f2_arg1) if f2_arg1.button == "left" then LoadingWidget:processEvent({ name = "loading_startplay", }) end end CoD.Loading.HideContinueButton = function(ContinueButton, f3_arg1) ContinueButton:beginAnimation("hide", 1000) ContinueButton:setAlpha(0) end SkipFunc = function(LoadingWidget, f4_arg1) local f4_local0, f4_local1 = Engine.GetUserSafeArea() local f4_local2 = Dvar.ui_errorMessage:get() if f4_local2 ~= "" then LoadingWidget.errorText = LUI.UIText.new({ left = -f4_local0 / 2, top = 36, right = f4_local0 / 2, bottom = 36 + CoD.textSize.Condensed, leftAnchor = false, topAnchor = true, rightAnchor = false, bottomAnchor = false, font = CoD.fonts.Condensed, alignment = LUI.Alignment.Left, }) LoadingWidget:addElement(LoadingWidget.errorText) LoadingWidget.errorText:setText(f4_local2) Dvar.ui_errorMessage:set("") end if CoD.useMouse then LoadingWidget:registerEventHandler("mouseup", WatchForUserActionToSkipFunc) end LoadingWidget.continueButton:registerEventHandler("hide_continue_button", CoD.Loading.HideContinueButton) LoadingWidget.continueButton:addElement(LUI.UITimer.new(5000, "hide_continue_button", true, LoadingWidget.continueButton)) LoadingWidget.continueButton:beginAnimation("show", 1000) LoadingWidget.continueButton:setAlpha(1) LUI.UIButton.gainFocus(LoadingWidget.continueButton, f4_arg1) end StartCinematicFunc = function(LoadingWidget, f5_arg1) Engine.Stop3DCinematic(0) end LUI.createMenu.Loading = function(LocalClientIndex) local LoadingWidget = CoD.Menu.NewFromState("Loading", { leftAnchor = true, rightAnchor = true, left = 0, right = 0, topAnchor = true, bottomAnchor = true, top = 0, bottom = 0, }) LoadingWidget:setOwner(LocalClientIndex) LoadingWidget:registerEventHandler("start_loading", CoD.Loading.StartLoading) LoadingWidget:registerEventHandler("start_spinner", CoD.Loading.StartSpinner) LoadingWidget:registerEventHandler("fade_in_map_location", CoD.Loading.FadeInMapLocation) LoadingWidget:registerEventHandler("fade_in_gametype", CoD.Loading.FadeInGametype) LoadingWidget:registerEventHandler("fade_in_map_image", CoD.Loading.FadeInMapImage) local UseLoadingMovie = false local Mapname = Dvar.ui_mapname:get() local Gametype = Dvar.ui_gametype:get() local LoadscreenName = "loadscreen_" .. Mapname if CoD.isZombie == true then if Engine.GameModeIsMode(CoD.GAMEMODE_THEATER) == false and Dvar.party_maxplayers:get() == 1 and (Mapname == CoD.Zombie.MAP_ZM_HIGHRISE or Mapname == CoD.Zombie.MAP_ZM_PRISON or Mapname == CoD.Zombie.MAP_ZM_BURIED or Mapname == CoD.Zombie.MAP_ZM_TOMB) and Gametype == CoD.Zombie.GAMETYPE_ZCLASSIC then LoadscreenName = "black" UseLoadingMovie = true else LoadscreenName = GetMapLoadscreenName(Mapname, Gametype, Dvar.ui_zm_mapstartlocation:get()) Engine.SetDvar("ui_zm_useloadingmovie", 0) end end LoadingWidget.mapImage = LUI.UIStreamedImage.new({ leftAnchor = false, rightAnchor = false, left = -640, right = 640, topAnchor = false, bottomAnchor = false, top = -360, bottom = 360, material = RegisterMaterial(LoadscreenName), red = 0, green = 0, blue = 0, alpha = 1, }) LoadingWidget:addElement(LoadingWidget.mapImage) if UseLoadingMovie == true then LoadingWidget.mapImage:setShaderVector(0, 0, 0, 0, 0) LoadingWidget.mapImage.iswebm = false end if UseLoadingMovie == false then local LoadingScreenGradientTop = LUI.UIImage.new() LoadingScreenGradientTop:setLeftRight(false, false, -640, 640) LoadingScreenGradientTop:setTopBottom(true, false, 0, 200) LoadingScreenGradientTop:setImage(RegisterMaterial("gradient_top")) LoadingWidget:addElement(LoadingScreenGradientTop) local LoadingScreenGradientBottom = LUI.UIImage.new() LoadingScreenGradientBottom:setLeftRight(false, false, -640, 640) LoadingScreenGradientBottom:setTopBottom(false, true, -200, 0) LoadingScreenGradientBottom:setImage(RegisterMaterial("gradient_bottom")) LoadingWidget:addElement(LoadingScreenGradientBottom) end local VerticalOffset = 50 local HorizontalOffset = 70 local BigFont = "Big" local CondensedFont = "Condensed" LoadingWidget.mapNameLabel = LUI.UIText.new() LoadingWidget.mapNameLabel:setLeftRight(true, false, HorizontalOffset, HorizontalOffset + 1) LoadingWidget.mapNameLabel:setTopBottom(true, false, VerticalOffset, VerticalOffset + CoD.textSize[BigFont]) LoadingWidget.mapNameLabel:setFont(CoD.fonts[BigFont]) LoadingWidget.mapNameLabel:setRGB(CoD.BOIIOrange.r, CoD.BOIIOrange.g, CoD.BOIIOrange.b) LoadingWidget.mapNameLabel:setAlpha(0) LoadingWidget.mapNameLabel:registerEventHandler("transition_complete_map_name_fade_in", CoD.Loading.MapNameFadeInComplete) LoadingWidget:addElement(LoadingWidget.mapNameLabel) VerticalOffset = VerticalOffset + CoD.textSize[BigFont] - 5 LoadingWidget.mapLocationLabel = LUI.UIText.new() LoadingWidget.mapLocationLabel:setLeftRight(true, false, HorizontalOffset, HorizontalOffset + 1) LoadingWidget.mapLocationLabel:setTopBottom(true, false, VerticalOffset, VerticalOffset + CoD.textSize[CondensedFont]) LoadingWidget.mapLocationLabel:setFont(CoD.fonts[CondensedFont]) LoadingWidget.mapLocationLabel:setRGB(CoD.offWhite.r, CoD.offWhite.g, CoD.offWhite.b) LoadingWidget.mapLocationLabel:setAlpha(0) LoadingWidget.mapLocationLabel:registerEventHandler("transition_complete_map_location_fade_in", CoD.Loading.MapLocationFadeInComplete) LoadingWidget:addElement(LoadingWidget.mapLocationLabel) VerticalOffset = VerticalOffset + CoD.textSize[CondensedFont] - 2 LoadingWidget.gametypeLabel = LUI.UIText.new() LoadingWidget.gametypeLabel:setLeftRight(true, false, HorizontalOffset, HorizontalOffset + 1) LoadingWidget.gametypeLabel:setTopBottom(true, false, VerticalOffset, VerticalOffset + CoD.textSize[CondensedFont]) LoadingWidget.gametypeLabel:setFont(CoD.fonts[CondensedFont]) LoadingWidget.gametypeLabel:setRGB(CoD.offWhite.r, CoD.offWhite.g, CoD.offWhite.b) LoadingWidget.gametypeLabel:setAlpha(0) LoadingWidget.gametypeLabel:registerEventHandler("transition_complete_gametype_fade_in", CoD.Loading.GametypeFadeInComplete) LoadingWidget:addElement(LoadingWidget.gametypeLabel) VerticalOffset = VerticalOffset + CoD.textSize[CondensedFont] + 5 local DemoTitle = Engine.Localize("MPUI_TITLE_CAPS") .. ":" local f6_local14_1, f6_local14_2, f6_local14_3, f6_local14_4 = GetTextDimensions(DemoTitle, CoD.fonts[CondensedFont], CoD.textSize[CondensedFont]) local DemoDuration = Engine.Localize("MPUI_DURATION_CAPS") .. ":" local f6_local16_1, f6_local16_2, f6_local16_3, f6_local16_4 = GetTextDimensions(DemoDuration, CoD.fonts[CondensedFont], CoD.textSize[CondensedFont]) local DemoAuthor = Engine.Localize("MPUI_AUTHOR_CAPS") .. ":" local f6_local18_1, f6_local18_2, f6_local18_3, f6_local18_4 = GetTextDimensions(DemoAuthor, CoD.fonts[CondensedFont], CoD.textSize[CondensedFont]) local HorizontalOffset2 = math.max(f6_local14_3, f6_local16_3, f6_local18_3) + 5 local VerticalOffset2 = 0 LoadingWidget.demoInfoContainer = LUI.UIElement.new() LoadingWidget.demoInfoContainer:setLeftRight(true, false, HorizontalOffset, 600) LoadingWidget.demoInfoContainer:setTopBottom(true, false, VerticalOffset, VerticalOffset + 600) LoadingWidget.demoInfoContainer:setAlpha(0) LoadingWidget:addElement(LoadingWidget.demoInfoContainer) LoadingWidget.demoTitleTitle = LUI.UIText.new() LoadingWidget.demoTitleTitle:setLeftRight(true, true, 0, 0) LoadingWidget.demoTitleTitle:setTopBottom(true, false, VerticalOffset2, VerticalOffset2 + CoD.textSize[CondensedFont]) LoadingWidget.demoTitleTitle:setFont(CoD.fonts[CondensedFont]) LoadingWidget.demoTitleTitle:setRGB(CoD.BOIIOrange.r, CoD.BOIIOrange.g, CoD.BOIIOrange.b) LoadingWidget.demoTitleTitle:setAlignment(LUI.Alignment.Left) LoadingWidget.demoTitleTitle:setText(DemoTitle) LoadingWidget.demoInfoContainer:addElement(LoadingWidget.demoTitleTitle) LoadingWidget.demoTitleLabel = LUI.UIText.new() LoadingWidget.demoTitleLabel:setLeftRight(true, true, HorizontalOffset2, 0) LoadingWidget.demoTitleLabel:setTopBottom(true, false, VerticalOffset2, VerticalOffset2 + CoD.textSize[CondensedFont]) LoadingWidget.demoTitleLabel:setFont(CoD.fonts[CondensedFont]) LoadingWidget.demoTitleLabel:setRGB(CoD.offWhite.r, CoD.offWhite.g, CoD.offWhite.b) LoadingWidget.demoTitleLabel:setAlignment(LUI.Alignment.Left) LoadingWidget.demoInfoContainer:addElement(LoadingWidget.demoTitleLabel) VerticalOffset2 = VerticalOffset2 + CoD.textSize[CondensedFont] - 2 LoadingWidget.demoDurationTitle = LUI.UIText.new() LoadingWidget.demoDurationTitle:setLeftRight(true, true, 0, 0) LoadingWidget.demoDurationTitle:setTopBottom(true, false, VerticalOffset2, VerticalOffset2 + CoD.textSize[CondensedFont]) LoadingWidget.demoDurationTitle:setFont(CoD.fonts[CondensedFont]) LoadingWidget.demoDurationTitle:setRGB(CoD.BOIIOrange.r, CoD.BOIIOrange.g, CoD.BOIIOrange.b) LoadingWidget.demoDurationTitle:setAlignment(LUI.Alignment.Left) LoadingWidget.demoDurationTitle:setText(DemoDuration) LoadingWidget.demoInfoContainer:addElement(LoadingWidget.demoDurationTitle) LoadingWidget.demoDurationLabel = LUI.UIText.new() LoadingWidget.demoDurationLabel:setLeftRight(true, true, HorizontalOffset2, 0) LoadingWidget.demoDurationLabel:setTopBottom(true, false, VerticalOffset2, VerticalOffset2 + CoD.textSize[CondensedFont]) LoadingWidget.demoDurationLabel:setFont(CoD.fonts[CondensedFont]) LoadingWidget.demoDurationLabel:setRGB(CoD.offWhite.r, CoD.offWhite.g, CoD.offWhite.b) LoadingWidget.demoDurationLabel:setAlignment(LUI.Alignment.Left) LoadingWidget.demoInfoContainer:addElement(LoadingWidget.demoDurationLabel) VerticalOffset2 = VerticalOffset2 + CoD.textSize[CondensedFont] - 2 LoadingWidget.demoAuthorTitle = LUI.UIText.new() LoadingWidget.demoAuthorTitle:setLeftRight(true, true, 0, 0) LoadingWidget.demoAuthorTitle:setTopBottom(true, false, VerticalOffset2, VerticalOffset2 + CoD.textSize[CondensedFont]) LoadingWidget.demoAuthorTitle:setFont(CoD.fonts[CondensedFont]) LoadingWidget.demoAuthorTitle:setRGB(CoD.BOIIOrange.r, CoD.BOIIOrange.g, CoD.BOIIOrange.b) LoadingWidget.demoAuthorTitle:setAlignment(LUI.Alignment.Left) LoadingWidget.demoAuthorTitle:setText(DemoAuthor) LoadingWidget.demoInfoContainer:addElement(LoadingWidget.demoAuthorTitle) LoadingWidget.demoAuthorLabel = LUI.UIText.new() LoadingWidget.demoAuthorLabel:setLeftRight(true, true, HorizontalOffset2, 0) LoadingWidget.demoAuthorLabel:setTopBottom(true, false, VerticalOffset2, VerticalOffset2 + CoD.textSize[CondensedFont]) LoadingWidget.demoAuthorLabel:setFont(CoD.fonts[CondensedFont]) LoadingWidget.demoAuthorLabel:setRGB(CoD.offWhite.r, CoD.offWhite.g, CoD.offWhite.b) LoadingWidget.demoAuthorLabel:setAlignment(LUI.Alignment.Left) LoadingWidget.demoInfoContainer:addElement(LoadingWidget.demoAuthorLabel) local f6_local21 = 3 local f6_local22 = CoD.Loading.DYKFontHeight + f6_local21 * 2 local f6_local23 = 2 local f6_local24 = f6_local22 + 1 + f6_local23 + CoD.Loading.DYKFontHeight - VerticalOffset local f6_local25 = CoD.Menu.Width - 5 * 2 local f6_local26 = -200 local f6_local27 = 0 local f6_local28 = 2 local f6_local29 = f6_local22 - f6_local28 * 2 local f6_local30 = 6 LoadingWidget.loadingBarContainer = LUI.UIElement.new() LoadingWidget.loadingBarContainer:setLeftRight(false, false, -f6_local25 / 2, f6_local25 / 2) LoadingWidget.loadingBarContainer:setTopBottom(false, true, f6_local26 - f6_local24, f6_local26) LoadingWidget.loadingBarContainer:setAlpha(0) LoadingWidget:addElement(LoadingWidget.loadingBarContainer) LoadingWidget.dykContainer = LUI.UIElement.new() LoadingWidget.dykContainer:setLeftRight(true, true, 0, 0) LoadingWidget.dykContainer:setTopBottom(true, false, f6_local27, f6_local27 + f6_local22) LoadingWidget.dykContainer.containerHeight = f6_local22 LoadingWidget.dykContainer.textAreaWidth = f6_local25 - f6_local21 - f6_local30 - f6_local28 - f6_local29 - 1 LoadingWidget.loadingBarContainer:addElement(LoadingWidget.dykContainer) if CoD.isZombie == false then CoD.Loading.SetupDYKContainerImages(LoadingWidget.dykContainer) LoadingWidget.didYouKnow = LUI.UIText.new() LoadingWidget.didYouKnow:setLeftRight(true, true, f6_local21 + f6_local30, -f6_local28 - f6_local29 - 1) LoadingWidget.didYouKnow:setTopBottom(true, false, f6_local21, f6_local21 + CoD.Loading.DYKFontHeight) LoadingWidget.didYouKnow:setRGB(CoD.offWhite.r, CoD.offWhite.g, CoD.offWhite.b) LoadingWidget.didYouKnow:setFont(CoD.Loading.DYKFont) LoadingWidget.didYouKnow:setAlignment(LUI.Alignment.Left) LoadingWidget.didYouKnow:setPriority(0) LoadingWidget.dykContainer:addElement(LoadingWidget.didYouKnow) else f6_local30 = 0 end f6_local27 = f6_local27 + f6_local22 + 1 LoadingWidget.spinner = LUI.UIImage.new() LoadingWidget.spinner:setLeftRight(false, true, -f6_local28 - f6_local29, -f6_local28) LoadingWidget.spinner:setTopBottom(false, false, -f6_local29 / 2, f6_local29 / 2) LoadingWidget.spinner:setImage(RegisterMaterial("lui_loader_32")) LoadingWidget.spinner:setShaderVector(0, 0, 0, 0, 0) LoadingWidget.spinner:setAlpha(0) LoadingWidget.dykContainer:addElement(LoadingWidget.spinner) local f6_local31 = LUI.UIImage.new() f6_local31:setLeftRight(true, true, 1, -1) f6_local31:setTopBottom(true, false, f6_local27, f6_local27 + f6_local23) f6_local31:setRGB(0.1, 0.1, 0.1) LoadingWidget.loadingBarContainer:addElement(f6_local31) local LoadingBarLine = LUI.UIImage.new() LoadingBarLine:setLeftRight(true, true, 1, -1) LoadingBarLine:setTopBottom(true, false, f6_local27, f6_local27 + f6_local23) LoadingBarLine:setRGB(CoD.BOIIOrange.r, CoD.BOIIOrange.g, CoD.BOIIOrange.b) LoadingBarLine:setupLoadingBar() LoadingWidget.loadingBarContainer:addElement(LoadingBarLine) local f6_local33 = 1 local f6_local34 = LUI.UIImage.new() f6_local34:setLeftRight(true, true, 2, -2) f6_local34:setTopBottom(true, false, f6_local27, f6_local27 + f6_local33) f6_local34:setRGB(1, 1, 1) f6_local34:setAlpha(0.5) f6_local34:setupLoadingBar() LoadingWidget.loadingBarContainer:addElement(f6_local34) f6_local27 = f6_local27 + f6_local23 LoadingWidget.statusLabel = LUI.UIText.new() LoadingWidget.statusLabel:setLeftRight(true, true, f6_local21 + f6_local30, 0) LoadingWidget.statusLabel:setTopBottom(true, false, f6_local27, f6_local27 + CoD.Loading.DYKFontHeight) LoadingWidget.statusLabel:setAlpha(0.55) LoadingWidget.statusLabel:setFont(CoD.Loading.DYKFont) LoadingWidget.statusLabel:setAlignment(LUI.Alignment.Left) LoadingWidget.statusLabel:setupLoadingStatusText() LoadingWidget.loadingBarContainer:addElement(LoadingWidget.statusLabel) if UseLoadingMovie == true then LoadingWidget.mapImage:registerEventHandler("loading_updateimage", ToggleMapImage) LoadingWidget:addElement(LUI.UITimer.new(16, "loading_updateimage", false, LoadingWidget.mapImage)) Engine.SetDvar("ui_zm_useloadingmovie", 1) local f6_local36 = 15 local f6_local37, f6_local38 = Engine.GetUserSafeArea() LoadingWidget.continueButton = LUI.UIButton.new() LoadingWidget.continueButton:setLeftRight(false, false, -f6_local37, f6_local37 / -13) LoadingWidget.continueButton:setTopBottom(false, false, f6_local38 / 2 - CoD.textSize.Condensed - f6_local36, f6_local38 / 2 - f6_local36) LoadingWidget.continueButton:setAlignment(LUI.Alignment.Right) LoadingWidget.continueButton:setAlpha(0) LoadingWidget.continueButton:setActionEventName("loading_startplay") LoadingWidget:addElement(LoadingWidget.continueButton) LoadingWidget.continueButton:addElement(CoD.ButtonPrompt.new("start", "", LoadingWidget, "loading_startplay", true)) LoadingWidget.continueButton.label = LUI.UIText.new() LoadingWidget.continueButton.label:setLeftRight(true, true, 0, 0) LoadingWidget.continueButton.label:setTopBottom(true, true, 0, 0) LoadingWidget.continueButton.label:setFont(CoD.fonts.Condensed) LoadingWidget.continueButton.label:setAlignment(LUI.Alignment.Right) LoadingWidget.continueButton:addElement(LoadingWidget.continueButton.label) LoadingWidget.continueButton.label:setText(Engine.Localize("PLATFORM_SKIP")) LoadingWidget.continueButton:setHandleMouse(false) LoadingWidget:registerEventHandler("loading_displaycontinue", SkipFunc) LoadingWidget:registerEventHandler("loading_startplay", StartCinematicFunc) else LoadingWidget:addElement(LUI.UITimer.new(CoD.Loading.LoadingDelayTime, "start_loading", true, LoadingWidget)) LoadingWidget:addElement(LUI.UITimer.new(CoD.Loading.SpinnerDelayTime, "start_spinner", true, LoadingWidget)) end return LoadingWidget end function GetMapLoadscreenName(map, gametype, location) if map == "zm_transit" and gametype ~= "zclassic" then gametype = "zstandard" end if location == "diner" then map = "zm_transit_dr" gametype = "zcleansed" end if location == "power" or location == "tunnel" or location == "cornfield" then gametype = "zstandard" location = "transit" end if location == "nuked" then gametype = "zstandard" end if location == "cellblock" or location == "docks" then gametype = "zgrief" location = "cellblock" end if location == "street" or location == "maze" then gametype = "zgrief" location = "street" end return "loadscreen_" .. map .. "_" .. gametype .. "_" .. location end CoD.Loading.GetDidYouKnowString = function() local TotalStrings = 0 local DidYouKnowString = "" local RandomIndex = 0 if Engine.GameModeIsMode(CoD.GAMEMODE_THEATER) == true then local NumberOfTheaterStrings = #CoD.Loading.DidYouKnow.theater if NumberOfTheaterStrings ~= nil and NumberOfTheaterStrings > 0 then DidYouKnowString = CoD.Loading.DidYouKnow.theater[math.random(NumberOfTheaterStrings)] end elseif CoD.isZombie == true then local NumberOfZombieStrings = #CoD.Loading.DidYouKnow.zombies if NumberOfZombieStrings ~= nil and NumberOfZombieStrings > 0 then DidYouKnowString = CoD.Loading.DidYouKnow.zombies[math.random(NumberOfZombieStrings)] end else local NumberOfGeneralStrings = #CoD.Loading.DidYouKnow.general TotalStrings = TotalStrings + NumberOfGeneralStrings local Gametype = Dvar.ui_gametype:get() local NumberOfGametypeStrings = 0 if Gametype ~= nil and Gametype ~= "" and CoD.Loading.DidYouKnow[Gametype] then NumberOfGametypeStrings = #CoD.Loading.DidYouKnow[Gametype] end TotalStrings = TotalStrings + NumberOfGametypeStrings local NumberOfLeagueStrings = 0 local NumberOfPublicMatchStrings = 0 if Engine.GameModeIsMode(CoD.GAMEMODE_LEAGUE_MATCH) == true then NumberOfLeagueStrings = #CoD.Loading.DidYouKnow.league elseif Engine.GameModeIsMode(CoD.GAMEMODE_PUBLIC_MATCH) == true then NumberOfPublicMatchStrings = #CoD.Loading.DidYouKnow.public end TotalStrings = TotalStrings + NumberOfLeagueStrings + NumberOfPublicMatchStrings RandomIndex = math.random(TotalStrings) if RandomIndex <= NumberOfGeneralStrings then DidYouKnowString = CoD.Loading.DidYouKnow.general[RandomIndex] elseif NumberOfGametypeStrings > 0 and RandomIndex <= NumberOfGeneralStrings + NumberOfGametypeStrings then DidYouKnowString = CoD.Loading.DidYouKnow[Gametype][RandomIndex - NumberOfGeneralStrings] elseif NumberOfPublicMatchStrings > 0 and RandomIndex <= NumberOfGeneralStrings + NumberOfGametypeStrings + NumberOfPublicMatchStrings then DidYouKnowString = CoD.Loading.DidYouKnow.public[RandomIndex - NumberOfGeneralStrings - NumberOfGametypeStrings] elseif NumberOfLeagueStrings > 0 and RandomIndex <= TotalStrings then DidYouKnowString = CoD.Loading.DidYouKnow.league[RandomIndex - NumberOfGeneralStrings - NumberOfGametypeStrings - NumberOfPublicMatchStrings] end end if DidYouKnowString == nil or DidYouKnowString == "" then return "" else return Engine.Localize(DidYouKnowString) end end CoD.Loading.StartLoading = function(LoadingWidget, f8_arg1) CoD.Loading.SetMapGametypeText(LoadingWidget) if UIExpression.IsDemoPlaying(LoadingWidget:getOwner()) ~= 0 then local DemoAuthor = Dvar.ls_demoauthor:get() LoadingWidget.demoTitleLabel:setText(Dvar.ls_demotitle:get()) LoadingWidget.demoDurationLabel:setText(UIExpression.SecondsAsTime(nil, Dvar.ls_demoduration:get())) LoadingWidget.demoAuthorLabel:setText(DemoAuthor) if DemoAuthor == "" then LoadingWidget.demoAuthorTitle:setAlpha(0) end end if CoD.isZombie == false then local DidYouKnowString = CoD.Loading.GetDidYouKnowString() local f8_local4_1, f8_local4_2, f8_local4_3, f8_local4_4 = GetTextDimensions(DidYouKnowString, CoD.Loading.DYKFont, CoD.Loading.DYKFontHeight) if LoadingWidget.dykContainer.textAreaWidth < f8_local4_3 then LoadingWidget.dykContainer:setTopBottom(true, false, -CoD.Loading.DYKFontHeight, LoadingWidget.dykContainer.containerHeight) end LoadingWidget.didYouKnow:setText(DidYouKnowString) end LoadingWidget.mapNameLabel:beginAnimation("map_name_fade_in", CoD.Loading.FadeInTime) LoadingWidget.mapNameLabel:setAlpha(1) end function CoD.Loading.SetMapGametypeText(LoadingWidget) local map = UIExpression.DvarString(nil, "ui_mapname") local gametype = UIExpression.DvarString(nil, "ui_gametype") local location = UIExpression.DvarString(nil, "ui_zm_mapstartlocation") local mapNameText = CoD.Loading.GetMapNameDisplayName(map, gametype, location) local mapLocationText = CoD.Loading.GetMapLocationDisplayName(map) local gametypeText = CoD.Loading.GetGametypeDisplayName(gametype) LoadingWidget.mapNameLabel:setText(mapNameText) LoadingWidget.mapLocationLabel:setText(mapLocationText) LoadingWidget.gametypeLabel:setText(gametypeText) end function CoD.Loading.GetMapNameDisplayName(map, gametype, location) if gametype == CoD.Zombie.GAMETYPE_ZCLASSIC then return CoD.GetZombieGameTypeDescription(gametype, map) end return Engine.Localize(UIExpression.TableLookup(nil, CoD.gametypesTable, 0, 5, 3, location, 4)) end function CoD.Loading.GetMapLocationDisplayName(map) if map == CoD.Zombie.MAP_ZM_NUKED then return UIExpression.ToUpper(nil, Dvar.ls_mapname:get()) end return UIExpression.ToUpper(nil, Dvar.ls_maplocation:get()) end function CoD.Loading.GetGametypeDisplayName(gametype) if gametype == CoD.Zombie.GAMETYPE_ZCLASSIC then return Engine.Localize("ZMUI_ZCLASSIC_GAMEMODE_CAPS") end if gametype == CoD.Zombie.GAMETYPE_ZGRIEF and UIExpression.DvarString(nil, "ui_gametype_obj") ~= "" then return Engine.Localize("ZMUI_" .. UIExpression.DvarString(nil, "ui_gametype_obj") .. "_CAPS") end return Engine.Localize("ZMUI_" .. gametype .. "_CAPS") end CoD.Loading.StartSpinner = function(LoadingWidget, f9_arg1) LoadingWidget.spinner:beginAnimation("spinner_fade_in", 200) LoadingWidget.spinner:setAlpha(1) end CoD.Loading.MapNameFadeInComplete = function(MapnameLabel) MapnameLabel:dispatchEventToParent({ name = "fade_in_map_location", }) end CoD.Loading.FadeInMapLocation = function(LoadingWidget) LoadingWidget.mapLocationLabel:beginAnimation("map_location_fade_in", CoD.Loading.FadeInTime) LoadingWidget.mapLocationLabel:setAlpha(1) end CoD.Loading.MapLocationFadeInComplete = function(MapLocationLabel) MapLocationLabel:dispatchEventToParent({ name = "fade_in_gametype", }) end CoD.Loading.FadeInGametype = function(LoadingWidget) LoadingWidget.gametypeLabel:beginAnimation("gametype_fade_in", CoD.Loading.FadeInTime) LoadingWidget.gametypeLabel:setAlpha(0.6) end CoD.Loading.GametypeFadeInComplete = function(GametypeLabel) GametypeLabel:dispatchEventToParent({ name = "fade_in_map_image", }) end CoD.Loading.FadeInMapImage = function(LoadingWidget) LoadingWidget.mapImage:beginAnimation("map_image_fade_in", CoD.Loading.FadeInTime) LoadingWidget.mapImage:setRGB(1, 1, 1) LoadingWidget.loadingBarContainer:beginAnimation("loading_bar_fade_in", CoD.Loading.FadeInTime) LoadingWidget.loadingBarContainer:setAlpha(1) if UIExpression.IsDemoPlaying(LoadingWidget:getOwner()) ~= 0 then LoadingWidget.demoInfoContainer:beginAnimation("demo_info_fade_in", CoD.Loading.FadeInTime) LoadingWidget.demoInfoContainer:setAlpha(1) end end CoD.Loading.SetupDYKContainerImages = function(DYKContainer) local BackgroundImage1 = LUI.UIImage.new() BackgroundImage1:setLeftRight(true, true, 0, 0) BackgroundImage1:setTopBottom(true, true, 0, 0) BackgroundImage1:setRGB(0, 0, 0) BackgroundImage1:setAlpha(0.52) BackgroundImage1:setPriority(-110) DYKContainer:addElement(BackgroundImage1) local Border = CoD.Border.new(1, 1, 1, 1, 0.05) Border:setPriority(-100) DYKContainer:addElement(Border) local BackgroundImage2 = LUI.UIImage.new() BackgroundImage2:setLeftRight(true, true, 2, -2) BackgroundImage2:setTopBottom(true, true, 1, -1) BackgroundImage2:setImage(RegisterMaterial(CoD.MPZM("menu_mp_cac_grad_stretch", "menu_zm_cac_grad_stretch"))) BackgroundImage2:setRGB(0, 0, 0) BackgroundImage2:setAlpha(0.65) BackgroundImage2:setPriority(-80) DYKContainer:addElement(BackgroundImage2) local BackgroundImage3 = LUI.UIImage.new() BackgroundImage3:setLeftRight(true, true, 3, -3) BackgroundImage3:setTopBottom(true, false, 3, 23) BackgroundImage3:setImage(RegisterMaterial(CoD.MPZM("menu_mp_cac_grad_stretch", "menu_zm_cac_grad_stretch"))) BackgroundImage3:setPriority(100) BackgroundImage3:setAlpha(0.06) DYKContainer:addElement(BackgroundImage3) end