I used a custom proxy to load a suitable image on my loading panels, rather
than changing anything in the UI code itself - you could probably use
something like this, or a procedural material to display dynamic text too.

The meat of the proxy is as follows:

#define DEFAULT_NAME "vgui/loading/default"

bool CLevelLoadingProxy::Init( IMaterial *pMaterial, KeyValues *pKeyValues )
{
        bool found = false;
        m_pBaseTextureVar = pMaterial->FindVar( "$basetexture", &found );
        if ( !found )
                return false;

        m_pDefaultTexture = materials->FindTexture( DEFAULT_NAME,
TEXTURE_GROUP_VGUI );
        if ( IsErrorTexture( m_pDefaultTexture ) )
                return false;

        m_pDefaultTexture->IncrementReferenceCount();

        return true;
}

void CLevelLoadingProxy::OnBind( void *pC_BaseEntity )
{
        if ( !m_pBaseTextureVar )
                return;

        ITexture *texture = NULL;
        char loadingimage[ 512 ];
        const char *mapname = engine->GetLevelName();

        Q_snprintf( loadingimage, sizeof( loadingimage ), "vgui/loading/%s",
mapname );

        texture = materials->FindTexture( loadingimage, TEXTURE_GROUP_VGUI,
false );
        if ( !IsErrorTexture( texture ) )
        {
                m_pBaseTextureVar->SetTextureValue( texture );
                return;
        }

        if ( m_pDefaultTexture )
        {
                m_pBaseTextureVar->SetTextureValue( m_pDefaultTexture );
                return;
        }
}

As you can see, I get the name of the current map (there must be a way of
doing this that returns the map name at an earlier point in the loading
process, possibly CSDKModeManager::LevelInit) and use that to load the
relevant loading image. If there isn't a suitable image, it shows a default
image instead that's just pleasantly generic.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of dave
daveslastname
Sent: 10 February 2008 02:34
To: hlcoders@list.valvesoftware.com
Subject: Re: [hlcoders] Loading screen art

--
[ Picked text/plain from multipart/alternative ]
Yep, I was wondering this as well. Changing the RES file and adding images,
text and changing panel sizes is not hard.  But making those changes and
images specific to whatever map is being loaded appears... very difficult to
say the least.  You'd think this would be something easily editable in
Source, for the sole purpose of letting players know what's coming up next
and maybe show a map briefing or something (we all know players don't read
the mission briefings when they can just click past it), but I guess not.





_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to