~swag/armagetronad/0.2.9-sty+ct+ap-fork

« back to all changes in this revision

Viewing changes to src/tron/gHud.cpp

  • Committer: SwagTron
  • Date: 2019-03-05 07:13:03 UTC
  • Revision ID: swagtron-20190305071303-5m4cn9hs6h8ydsgf
- Ported toggle from 0.4. Seems kind of hacky. Had to add another FindConfigItem of type tConfItemBase due to tab completion using the previous tString function. Plan to change this later, but I really needed the toggle function. Tried to cast the two, but that did not work out. Seemed like the bug-less option for the time being. Those unfamiliar with this function, you can now toggle boolean commands (Ex. toggle text_out)

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
REAL subby_ScoreLocX=-0.95, subby_ScoreLocY=-0.85, subby_ScoreSize =.13;
59
59
REAL subby_FastestLocX=-0.0, subby_FastestLocY=-0.95, subby_FastestSize =.12;
60
60
REAL subby_AlivePeopleLocX=.45, subby_AlivePeopleLocY=-0.95, subby_AlivePeopleSize =.13;
61
 
REAL subby_PingLocX=.80, subby_PingLocY=-0.95, subby_PingSize =.13;
62
 
 
63
 
bool showPosition = false;
 
61
REAL subby_PingLocX=.80, subby_PingLocY=-0.95, subby_PingSize =.13;
 
62
 
 
63
bool showPosition = true;
64
64
REAL subby_CoordLocX = -0.557, subby_CoordLoxY = -0.75, subby_CoordSize = 0.13;
65
65
 
66
66
REAL max_player_speed=0;
126
126
        titletext << "0xff3333" << title;
127
127
    }
128
128
}
129
 
 
130
 
static REAL sg_hudCacheThreshold=.0001;
131
 
static tSettingItem< REAL > sg_minDropIntervalConf( "HUD_CACHE_THRESHOLD", sg_hudCacheThreshold );
 
129
 
 
130
static REAL sg_hudCacheThreshold=.0001;
 
131
static tSettingItem< REAL > sg_minDropIntervalConf( "HUD_CACHE_THRESHOLD", sg_hudCacheThreshold );
132
132
 
133
133
class gGLMeter
134
134
{
496
496
                                rTextField ping(subby_PingLocX-((.15*size*(length-1.5))/2.0),subby_PingLocY,.15*size,.3*size);
497
497
                                ping << "0xfefefe" << message;
498
498
                            }
499
 
                        }
500
 
 
501
 
                        if (showPosition)
502
 
                        {
503
 
                            tString output;
504
 
                            float posX = h->MapPosition().x;
505
 
                            float posY = h->MapPosition().y;
506
 
                            output << "Position X: " << posX << "\n";
507
 
                            output << "Position Y: " << posY;
508
 
                            int length = output.Len();
509
 
                            float size = subby_CoordSize;
510
 
                            rTextField location(subby_CoordLocX-((.15*size*(length-1.5))/2.0),subby_CoordLoxY,.15*size,.3*size);
511
 
                            location << output;
512
 
                        }
513
 
 
 
499
                        }
 
500
#ifdef DEBUG
 
501
                        if (showPosition)
 
502
                        {
 
503
                            tString output;
 
504
                            float posX = h->Position().x;
 
505
                            float posY = h->Position().y;
 
506
                            output << "Position X: " << posX << "\n";
 
507
                            output << "Position Y: " << posY;
 
508
                            int length = output.Len();
 
509
                            float size = subby_CoordSize;
 
510
                            rTextField location(subby_CoordLocX-((.15*size*(length-1.5))/2.0),subby_CoordLoxY,.15*size,.3*size);
 
511
                            location << output;
 
512
                        }
 
513
#endif
514
514
                    }
515
515
                }
516
516
            }