~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-24 05:43:34 UTC
  • Revision ID: swagtron-20190324054334-dhst2s4vcdpuehhd
Allowed show_position to be used made it more accurate. Was kind of odd the show_position definition wasnt also if debug, so the command was in the game just didnt do anything. 
Added /info to get general information about players. Stuff /players and /colors wouldnt show. Displays: Colored Name, Position, Direction, Used Rubber out of max, Speed, Spectating / Playing, Chatting, Sometimes Alive / Dead
Usage: /info - Returns own information
       /info playername - Returns that players name. (or more depending if the search word is found in more than one player) 
Fixed the /colors command a bit, also moved the function to a proper spot and made the output editable (added player_colors_text)

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 = true;
 
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
 
#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
 
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
 
514
514
                    }
515
515
                }
516
516
            }