117
122
rTextField titletext(locx-((.15*size*(length-1.5))/2.0),locy,.12*size,.24*size); //centre -1.0 for null char and -.5 for half a char width = -1.5
118
123
titletext << "0xff3333" << title;
131
: oldTime_( -100 ), oldRel_( -100 )
135
void Display( float value,float max, float locx, float locy, float size, const char * t,bool displayvalue = true, bool reverse = false, REAL r=.5, REAL g=.5, REAL b=1)
137
REAL rel = value/max;
138
REAL time = se_GameTime();
139
REAL change = rel - oldRel_;
141
// see if the gauge change is enough to warrant an update
142
if ( change * change * ( time - oldTime_ ) > .000001 || time < oldTime_ )
152
rDisplayListFiller filler( list_ );
153
GLmeter_subby(value, max, locx, locy, size, t, displayvalue, reverse, r, g, b );
157
REAL oldTime_; // last rendered game time
158
REAL oldRel_; // last rendered gauge position
159
rDisplayList list_; // caching display list
162
// caches stuff based on two float properties
167
: propa_(-1), propb_(-1)
171
bool Call( REAL propa, REAL propb )
173
if ( propa != propa_ || propb != propb_ )
130
191
static int alivepeople, alivemates, thetopscore, hudfpscount;
132
193
static void tank_display_hud( ePlayerNetID* me ){
331
390
myping = me->ping;
333
392
if(subby_ShowSpeedMeter)
334
GLmeter_subby(h->Speed(),maxmeterspeed,subby_SpeedGaugeLocX,subby_SpeedGaugeLocY,subby_SpeedGaugeSize,"Speed"); // easy to use configurable meters
394
static gGLMeter meter[MAX_PLAYERS];
395
meter[player->ID()].Display(h->Speed(),maxmeterspeed,subby_SpeedGaugeLocX,subby_SpeedGaugeLocY,subby_SpeedGaugeSize,"Speed"); // easy to use configurable meters
335
397
if(subby_ShowRubberMeter)
337
GLmeter_subby(h->GetRubber(),sg_rubberCycle,subby_RubberGaugeLocX,subby_RubberGaugeLocY,subby_RubberGaugeSize," Rubber Used");
399
static gGLMeter meter[MAX_PLAYERS];
400
meter[player->ID()].Display(h->GetRubber(),sg_rubberCycle,subby_RubberGaugeLocX,subby_RubberGaugeLocY,subby_RubberGaugeSize," Rubber Used");
338
401
if ( gCycle::RubberMalusActive() )
339
GLmeter_subby(100/(1+h->GetRubberMalus()),100,subby_RubberGaugeLocX,subby_RubberGaugeLocY,subby_RubberGaugeSize,"",true, false, 1,.5,.5);
403
static gGLMeter meter2[MAX_PLAYERS];
404
meter2[player->ID()].Display(100/(1+h->GetRubberMalus()),100,subby_RubberGaugeLocX,subby_RubberGaugeLocY,subby_RubberGaugeSize,"",true, false, 1,.5,.5);
341
407
if(subby_ShowBrakeMeter)
342
GLmeter_subby(h->GetBrakingReservoir(), 1.0,subby_BrakeGaugeLocX,subby_BrakeGaugeLocY,subby_BrakeGaugeSize, " Brakes");
409
static gGLMeter meter[MAX_PLAYERS];
410
meter[player->ID()].Display(h->GetBrakingReservoir(), 1.0,subby_BrakeGaugeLocX,subby_BrakeGaugeLocY,subby_BrakeGaugeSize, " Brakes");
344
413
// bool displayfastest = true;// put into global, set via menusytem... subby to do.make sr_DISPLAYFASTESTout
346
415
if(subby_ShowSpeedFastest)
349
float size= subby_FastestSize;
350
tColoredString message,messageColor;
351
messageColor << "0xbf9d50";
353
sprintf(fasteststring,"%.1f",max);
354
message << " Fastest: " << name << " " << fasteststring;
355
message.RemoveHex(); //cheers tank;
356
int length = message.Len();
358
rTextField speed_fastest(subby_FastestLocX-((.15*size*(length-1.5))/2.0),subby_FastestLocY,.15*size,.3*size);
417
static gTextCache cacheArray[MAX_PLAYERS];
418
gTextCache & cache = cacheArray[player->ID()];
419
if ( !cache.Call( max, 0 ) )
421
rDisplayListFiller filler( cache.list_ );
423
float size= subby_FastestSize;
424
tColoredString message,messageColor;
425
messageColor << "0xbf9d50";
427
sprintf(fasteststring,"%.1f",max);
428
message << " Fastest: " << name << " " << fasteststring;
429
message.RemoveHex(); //cheers tank;
430
int length = message.Len();
432
rTextField speed_fastest(subby_FastestLocX-((.15*size*(length-1.5))/2.0),subby_FastestLocY,.15*size,.3*size);
359
433
/* rTextField speed_fastest(.7-((.15*size*(length-1.5))/2.0),.65,.15*size,.3*size); */
361
speed_fastest << messageColor << message;
435
speed_fastest << messageColor << message;
367
439
if(subby_ShowScore){
369
if(myscore==topscore){
371
}else if (myscore > topscore){
440
static gTextCache cacheArray[MAX_PLAYERS];
441
gTextCache & cache = cacheArray[player->ID()];
442
if ( !cache.Call( topscore, myscore ) )
444
rDisplayListFiller filler( cache.list_ );
447
if(myscore==topscore){
449
}else if (myscore > topscore){
455
float size = subby_ScoreSize;
456
rTextField score(subby_ScoreLocX,subby_ScoreLocY,.15*size,.3*size);
457
score << " Scores\n";
458
score << "0xefefef" << "Me: Top:\n";
459
score << colour << myscore << " 0xffff00" << topscore ;
377
float size = subby_ScoreSize;
378
rTextField score(subby_ScoreLocX,subby_ScoreLocY,.15*size,.3*size);
379
score << " Scores\n";
380
score << "0xefefef" << "Me: Top:\n";
381
score << colour << myscore << " 0xffff00" << topscore ;
384
463
if(subby_ShowAlivePeople){
386
message << "Enemies: " << alivepeople << " Friends: " << alivemates;
387
int length = message.Len();
388
float size = subby_AlivePeopleSize;
389
rTextField enemies_alive(subby_AlivePeopleLocX-((.15*size*(length-1.5))/2.0),subby_AlivePeopleLocY,.15*size,.3*size);
390
enemies_alive << "0xfefefe" << message;
464
static gTextCache cacheArray[MAX_PLAYERS];
465
gTextCache & cache = cacheArray[player->ID()];
466
if ( !cache.Call( alivepeople, alivemates ) )
468
rDisplayListFiller filler( cache.list_ );
471
message << "Enemies: " << alivepeople << " Friends: " << alivemates;
472
int length = message.Len();
473
float size = subby_AlivePeopleSize;
474
rTextField enemies_alive(subby_AlivePeopleLocX-((.15*size*(length-1.5))/2.0),subby_AlivePeopleLocY,.15*size,.3*size);
475
enemies_alive << "0xfefefe" << message;
393
479
if(subby_ShowPing){
395
message << "Ping: " << int(myping * 1000) << " ms" ;
396
int length = message.Len();
397
float size = subby_PingSize;
398
rTextField ping(subby_PingLocX-((.15*size*(length-1.5))/2.0),subby_PingLocY,.15*size,.3*size);
399
ping << "0xfefefe" << message;
480
static gTextCache cacheArray[MAX_PLAYERS];
481
gTextCache & cache = cacheArray[player->ID()];
482
if ( !cache.Call( 0, myping ) )
484
rDisplayListFiller filler( cache.list_ );
487
message << "Ping: " << int(myping * 1000) << " ms" ;
488
int length = message.Len();
489
float size = subby_PingSize;
490
rTextField ping(subby_PingLocX-((.15*size*(length-1.5))/2.0),subby_PingLocY,.15*size,.3*size);
491
ping << "0xfefefe" << message;