[TIP] Custom Loading Screen
Posted: Thu Oct 10, 2013 8:14 am
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:
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
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 )
{
}
}
Just felt like sharing this even if it is a trivial thing to all the master coders out there