Re: [hlcoders] Hud round counter not displaying correctly
where is the time being sent from and updated? Client or Server? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Hud round counter not displaying correctly
The timer is created using the CountdownTimer class; So when the round_start event fires client / server both create a timer using CountdownTimer class. Once the timer is created you can get the time is elapsed with a pointer roundTimer-GetRemainingTime(); I convert the GetRemainingTime() to minutes and then seconds. Again the timer isn't the issue I do not think.. The function below DevMsg shows in the console the time like is should, Just the swprintf() is not displaying, it shows 0 in the hud. Not sure why it displays 0 because the DevMsg() is is showing the time counting down. So why does the hud only show 0? My Paint(); is what calls PaintTime(); void CHudRoundTimer::PaintTime(HFont font, int xpos, int ypos, int mins, int secs) { DevMsg(2,mins %i seconds %i\n, mins, secs); surface()-DrawSetTextFont(font); wchar_t unicode[6]; swprintf(unicode, L%d:%.2d, mins, secs); surface()-DrawSetTextPos(xpos, ypos); // surface()-DrawSetTextColor( 255, 0, 0, 255 ); for (wchar_t *ch = unicode; *ch != 0; ch++) { surface()-DrawUnicodeChar(*ch); } } r00t 3:16 CQC Gaming www.cqc-gaming.com - Original Message - From: British_Bomber [EMAIL PROTECTED] To: hlcoders@list.valvesoftware.com Sent: Monday, February 28, 2005 5:17 AM Subject: Re: [hlcoders] Hud round counter not displaying correctly where is the time being sent from and updated? Client or Server? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Hud round counter not displaying correctly
Oh forgot to mention, When the timer gets to around 10 seconds the hud will change red. This also works in-game So the hud works just the timer isn't being displayed. r00t 3:16 CQC Gaming www.cqc-gaming.com - Original Message - From: British_Bomber [EMAIL PROTECTED] To: hlcoders@list.valvesoftware.com Sent: Monday, February 28, 2005 5:17 AM Subject: Re: [hlcoders] Hud round counter not displaying correctly where is the time being sent from and updated? Client or Server? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Hud round counter not displaying correctly
Nevermind I figured it out, I had the wrong font set. It seems that if you have m_hTextFont as the font it will not work :P It is now working sorry for the emails.. r00t 3:16 CQC Gaming www.cqc-gaming.com - Original Message - From: r00t 3:16 [EMAIL PROTECTED] To: hlcoders@list.valvesoftware.com Sent: Monday, February 28, 2005 3:01 PM Subject: Re: [hlcoders] Hud round counter not displaying correctly The timer is created using the CountdownTimer class; So when the round_start event fires client / server both create a timer using CountdownTimer class. Once the timer is created you can get the time is elapsed with a pointer roundTimer-GetRemainingTime(); I convert the GetRemainingTime() to minutes and then seconds. Again the timer isn't the issue I do not think.. The function below DevMsg shows in the console the time like is should, Just the swprintf() is not displaying, it shows 0 in the hud. Not sure why it displays 0 because the DevMsg() is is showing the time counting down. So why does the hud only show 0? My Paint(); is what calls PaintTime(); void CHudRoundTimer::PaintTime(HFont font, int xpos, int ypos, int mins, int secs) { DevMsg(2,mins %i seconds %i\n, mins, secs); surface()-DrawSetTextFont(font); wchar_t unicode[6]; swprintf(unicode, L%d:%.2d, mins, secs); surface()-DrawSetTextPos(xpos, ypos); // surface()-DrawSetTextColor( 255, 0, 0, 255 ); for (wchar_t *ch = unicode; *ch != 0; ch++) { surface()-DrawUnicodeChar(*ch); } } r00t 3:16 CQC Gaming www.cqc-gaming.com - Original Message - From: British_Bomber [EMAIL PROTECTED] To: hlcoders@list.valvesoftware.com Sent: Monday, February 28, 2005 5:17 AM Subject: Re: [hlcoders] Hud round counter not displaying correctly where is the time being sent from and updated? Client or Server? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] Hud round counter not displaying correctly
I created a hud timer which the timer starts with a round_start event. Everything looks fine, and when tracing looks fine as well. However the hud will only show 0 it will not actually show the round counting down.. This is the code below, I wanted to make sure mins, secs were not 0 and they are not using the DevMsg I can not figure out why the swprintf is not w orking, and only displaying 0.. DevMsg will actually display the round counting down. void CHudRoundTimer::PaintTime( HFont font, int xpos, int ypos, int mins, int secs ) { DevMsg(2,mins %i seconds %i\n, mins, secs); surface()-DrawSetTextFont(font); wchar_t unicode[6]; swprintf(unicode, L%d:%.2d, mins, secs); surface()-DrawSetTextPos(xpos, ypos); // surface()-DrawSetTextColor( 255, 0, 0, 255 ); for (wchar_t *ch = unicode; *ch != 0; ch++) { surface()-DrawUnicodeChar(*ch); } } I have been working on this now for a couple of hours and looking through a couple of other classes this looks right. r00t 3:16 CQC Gaming www.cqc-gaming.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders