comparison src/network/network_gui.cpp @ 11436:caf4456fbbf3 draft

(svn r15794) -Codechange: remove the DoDrawString part of the old text drawing API
author rubidium <rubidium@openttd.org>
date Sat, 21 Mar 2009 22:46:17 +0000
parents a20dd0000d96
children 9bfb4cdd8e22
comparison
equal deleted inserted replaced
11435:5dc6443c46dd 11436:caf4456fbbf3
904 904
905 /* editbox to set game name */ 905 /* editbox to set game name */
906 this->DrawEditBox(NSSW_GAMENAME); 906 this->DrawEditBox(NSSW_GAMENAME);
907 907
908 /* if password is set, draw red '*' next to 'Set password' button */ 908 /* if password is set, draw red '*' next to 'Set password' button */
909 if (!StrEmpty(_settings_client.network.server_password)) DoDrawString("*", 408, 23, TC_RED); 909 if (!StrEmpty(_settings_client.network.server_password)) DrawString(408, this->width - 2, 23, "*", TC_RED);
910 910
911 /* draw list of maps */ 911 /* draw list of maps */
912 GfxFillRect(11, 63, 258, 215, 0xD7); // black background of maps list 912 GfxFillRect(11, 63, 258, 215, 0xD7); // black background of maps list
913 913
914 for (uint pos = this->vscroll.pos; pos < _fios_items.Length() + 1; pos++) { 914 for (uint pos = this->vscroll.pos; pos < _fios_items.Length() + 1; pos++) {
917 GfxFillRect(11, y - 1, 258, y + 10, 155); // show highlighted item with a different colour 917 GfxFillRect(11, y - 1, 258, y + 10, 155); // show highlighted item with a different colour
918 918
919 if (pos == 0) { 919 if (pos == 0) {
920 DrawString(14, y, STR_4010_GENERATE_RANDOM_NEW_GAME, TC_DARK_GREEN); 920 DrawString(14, y, STR_4010_GENERATE_RANDOM_NEW_GAME, TC_DARK_GREEN);
921 } else { 921 } else {
922 DoDrawString(item->title, 14, y, _fios_colours[item->type] ); 922 DrawString(14, this->width - 1, y, item->title, _fios_colours[item->type] );
923 } 923 }
924 y += NSSWND_ROWSIZE; 924 y += NSSWND_ROWSIZE;
925 925
926 if (y >= this->vscroll.cap * NSSWND_ROWSIZE + NSSWND_START) break; 926 if (y >= this->vscroll.cap * NSSWND_ROWSIZE + NSSWND_START) break;
927 } 927 }
1607 colour = TC_WHITE; 1607 colour = TC_WHITE;
1608 } else { 1608 } else {
1609 colour = TC_BLACK; 1609 colour = TC_BLACK;
1610 } 1610 }
1611 1611
1612 DoDrawString(this->action[i], 4, y, colour); 1612 DrawString(4, this->width - 4, y, this->action[i], colour);
1613 } 1613 }
1614 } 1614 }
1615 1615
1616 virtual void OnMouseLoop() 1616 virtual void OnMouseLoop()
1617 { 1617 {
1716 } 1716 }
1717 1717
1718 /* Filter out spectators */ 1718 /* Filter out spectators */
1719 if (IsValidCompanyID(ci->client_playas)) DrawCompanyIcon(ci->client_playas, 64, y + 1); 1719 if (IsValidCompanyID(ci->client_playas)) DrawCompanyIcon(ci->client_playas, 64, y + 1);
1720 1720
1721 DoDrawString(ci->client_name, 81, y, colour); 1721 DrawString(81, this->width - 2, y, ci->client_name, colour);
1722 1722
1723 y += CLNWND_ROWSIZE; 1723 y += CLNWND_ROWSIZE;
1724 } 1724 }
1725 } 1725 }
1726 1726