History

Merge pull request #98 from PhilipRosedale/master

Added stats to menu bar for both avatars and other servers

birarda committed 13 years ago

Commit 79a17892 parents 1c6048e 7d52af61 file · +10 −3Browse files

Showing the changes to interface/src/main.cpp (1 of 1 file). Show all

Unified · Split

interface/src/main.cpp+10−3
@@ -983,11 +983,18 @@ void display(void) · 982 unmodified lines
983983 menu.render(WIDTH,HEIGHT);
984984 }
985985
986− // Draw number of nearby people always
986+ // Stats at upper right of screen about who domain server is telling us about
987987 glPointSize(1.0f);
988988 char agents[100];
989− sprintf(agents, "Agents: %ld\n", AgentList::getInstance()->getAgents().size());
990− drawtext(WIDTH-100,20, 0.10, 0, 1.0, 0, agents, 1, 0, 0);
989+
990+ int totalAgents = AgentList::getInstance()->getAgents().size();
991+ int totalAvatars = 0, totalServers = 0;
992+ for (int i = 0; i < totalAgents; i++) {
993+ (AgentList::getInstance()->getAgents()[i].getType() == AGENT_TYPE_INTERFACE)
994+ ? totalAvatars++ : totalServers++;
995+ }
996+ sprintf(agents, "Servers: %d, Avatars: %d\n", totalServers, totalAvatars);
997+ drawtext(WIDTH-150,20, 0.10, 0, 1.0, 0, agents, 1, 0, 0);
991998
992999 if (::paintOn) {
9931000

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t