Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding

Thread Tools Display Modes
Old 07-05-2007, 07:50 PM   #1
Posts: n/a
"Team" based hud problems

Okay, I am making a singleplayer mod where you can be either a combine or a rebel. I got it working that you load either the normal huv colours or the ones I made for the combine. There's few issues thou. It wont load the new font data (how tall the fonts should be etc.), plus just a second ago I also realised the HudAmmo wont go to it's place but stays in it's original hev suit layout.

The system works by having a serverside entity in the map that calls the "hud_reloadcombinescheme" console command. This then triggers the function in ClientModeShared with m_pViewport->ReloadScheme( "resource/ClientCombineScheme.res", "scripts/CombineHudLayout");

As you can see I added the layout part myself to the ReloadScheme function. After some testing and wondering why changing the tallness of HudNumbers in ClientCombineScheme didn't work, I changed it ClientScheme and I found out that the hud was still using the tallnes from that file.

I start investigating why it is reloading the colours etc. but no the font data. After some time I figure IScheme has something to do with the fonts. I try adding that to the ReloadScheme function as well, but don't find the correct function. I only found ApplySchemeSettings( IScheme) but that didn't work.

Then I notice the gHud.RefreshHudTextures(); in the end of the ReloadScheme, which has the bit that has the comment "//fixup all the font icons". I add the *fromFile variable to that function as well so that it would load the correct .res when needed. No effect.

So, now I also notice all the weapon icons are missing (something I just did?) plus if I change the aspect ratio (or just screen resolution I the mod crashes).
And still no correct HudNumbers tallness or ammo layout. So what to do? How do I get all the fonts are their tallnesses reloaded correctly.

EDIT: Got the Ammo layout working (it was actually set in the HudAnimations.txt) and the weapon icons back (didn't realise that hud.cpp used GetSceme instead of LoadSchemeFromFileEx). Still the font size is wrong.

Last edited by Au-heppa: 07-06-2007 at 05:52 AM.
Reply With Quote
Old 07-06-2007, 12:01 PM   #2
Posts: n/a

The problem is in how to update the fonts m_hNumberFonts and m_hNumberGlowFonts in all CHidNumericDisplays classes (specially CHudHealth and CHudAmmo).
  Reply With Quote

Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -7. The time now is 04:58 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2015, All Rights Reserved.