[TIP] Custom Loading Screen

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
Post Reply
User avatar
SimonDenton
NSF
Posts: 78
Joined: Sun Mar 08, 2009 8:32 am

[TIP] Custom Loading Screen

Post 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
Jack90
UNATCO
Posts: 112
Joined: Sat Mar 18, 2023 11:55 am

Re: [TIP] Custom Loading Screen

Post 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/
Post Reply