Page 1 of 1

[TIP] Custom Loading Screen

Posted: Thu Oct 10, 2013 8:14 am
by SimonDenton
I finally figured out how to implement a custom loading screen for my mod and in case the solution isn't clear to some people here's the simple process;

Create a custom console class of your own focusing on the DrawLevelAction function. For example:

Code: Select all

//=============================================================================
// CustomConsole.
//=============================================================================
class CustomConsole extends Console;

function DrawLevelAction( canvas C )
{
	local string BigMessage;
	
       //Probably best if you preserve this vanilla code
	if (Viewport.Actor.bShowMenu )
	{
		BigMessage = "";
		return;
	}
	if ( (Viewport.Actor.Level.Pauser != "") && (Viewport.Actor.Level.LevelAction == LEVACT_None) )
	{
		C.Font = C.BigFont;
		C.Style = 1;
		C.DrawColor.R = 255;
		C.DrawColor.G = 255;
		C.DrawColor.B = 255;

		BigMessage = PausedMessage;
		PrintActionMessage(C, BigMessage);
		return;
	}

         //The awesome part
	else if ( Viewport.Actor.Level.LevelAction == LEVACT_Loading )
        {
          //Add your fancy loading screen stuff here. An image, tip, loading logo?
        }
		
	else if ( Viewport.Actor.Level.LevelAction == LEVACT_Saving )
        {
        }
	else if ( Viewport.Actor.Level.LevelAction == LEVACT_Connecting )
        {
        }

	else if ( Viewport.Actor.Level.LevelAction == LEVACT_Precaching )
        {
        }
}
Now, actually telling your mod to use THIS console instead of Engine.Console is tricky within UScript. I tried overriding the Player class (Player.uc) with my own but the Player and Console variables are constants. However, if you just change Console=Engine.Console in your ini to Console=CustomPackage.CustomConsole then you're good to go!

Just felt like sharing this even if it is a trivial thing to all the master coders out there :D

Re: [TIP] Custom Loading Screen

Posted: Sun Apr 09, 2023 7:34 am
by Jack90
If you invest in a high-quality guitar and take care of it, you may be able to sell it later on for a good price. Cheaper guitars don’t hold their value as well, so investing in a high-quality guitar can actually be a smart financial move in the long run. https://justrightguitar.com/best-guitar-headphone-amp/