From: <baz...@us...> - 2008-04-27 13:04:26
|
Revision: 8442 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8442&view=rev Author: bazaarmagetron Date: 2008-04-27 06:04:18 -0700 (Sun, 27 Apr 2008) Log Message: ----------- epsy46: colored team names in team menu Modified Paths: -------------- armagetronad/trunk/armagetronad/src/engine/eTeam.cpp armagetronad/trunk/armagetronad/src/engine/eTeam.h armagetronad/trunk/armagetronad/src/tron/gTeam.cpp Property Changed: ---------------- armagetronad/trunk/armagetronad/ Property changes on: armagetronad/trunk/armagetronad ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-04-23 19:07:38.540999889 +0200 committer: wrtlprnft <wrt...@us...> properties: branch-nick: trunk-armagetronad-work + timestamp: 2008-04-27 16:58:18.187999964 +0200 committer: epsy46 <ep...@fr...> properties: branch-nick: trunk Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 613 z-...@us...-20080211141509-cwbrb6hmtz9313jr 626 z-...@us...-20080214170110-rhfpd874zuogr3cm 627 z-...@us...-20080214170244-1gstsfe9yzyvrx9b 657 z-...@us...-20080301093905-0jwh1zg9srukp8fn 678 wrt...@us...-20080320130546-cr72y7d9q5a8nk7a 679 z-...@us...-20080324202056-eybvkm0gjomywbcq 680 z-...@us...-20080326104303-kpkkrwiw1fioi0rd 681 epsy-20080327213346-setzm7umdzzuk2dm 683 wrt...@us...-20080402122117-54nak33inuca02o9 684 wrt...@us...-20080402122804-2xhc8bgyrjsa09cd 685 wrt...@us...-20080418093840-cxtpql4xw2vsbmyn 686 ep...@fr...-20080418200503-q16s8az3yewn4x7a 687 ep...@fr...-20080419004917-bq4vguy9vpbkmlo3 688 wrt...@us...-20080419185850-ksm1feadrrhqigjb 689 wrt...@us...-20080423170738-zb8v72r0asm7cp52 + 613 z-...@us...-20080211141509-cwbrb6hmtz9313jr 626 z-...@us...-20080214170110-rhfpd874zuogr3cm 627 z-...@us...-20080214170244-1gstsfe9yzyvrx9b 657 z-...@us...-20080301093905-0jwh1zg9srukp8fn 678 wrt...@us...-20080320130546-cr72y7d9q5a8nk7a 679 z-...@us...-20080324202056-eybvkm0gjomywbcq 680 z-...@us...-20080326104303-kpkkrwiw1fioi0rd 681 epsy-20080327213346-setzm7umdzzuk2dm 683 wrt...@us...-20080402122117-54nak33inuca02o9 684 wrt...@us...-20080402122804-2xhc8bgyrjsa09cd 685 wrt...@us...-20080418093840-cxtpql4xw2vsbmyn 686 ep...@fr...-20080418200503-q16s8az3yewn4x7a 687 ep...@fr...-20080419004917-bq4vguy9vpbkmlo3 688 wrt...@us...-20080419185850-ksm1feadrrhqigjb 689 wrt...@us...-20080423170738-zb8v72r0asm7cp52 691 ep...@fr...-20080427145818-212ave5ohdhth4ph Modified: armagetronad/trunk/armagetronad/src/engine/eTeam.cpp =================================================================== --- armagetronad/trunk/armagetronad/src/engine/eTeam.cpp 2008-04-25 18:00:53 UTC (rev 8441) +++ armagetronad/trunk/armagetronad/src/engine/eTeam.cpp 2008-04-27 13:04:18 UTC (rev 8442) @@ -303,6 +303,14 @@ r = g = b = 7; } + if ( oldr != r || oldg != g || oldb != b || name != updateName) + { + tColoredString newColoredName; + newColoredName << tColoredString::ColorString(r,g,b) + << name; + coloredName = newColoredName; + } + // if the name has been changed then update it if (name!=updateName) { @@ -314,13 +322,13 @@ tOutput message; tColoredString name; name << *oldest; - name << tColoredString::ColorString(1,1,1); + name << tColoredString::ColorString(-1,-1,-1); message.SetTemplateParameter(1, name); tColoredString resetColor; resetColor << tColoredString::ColorString(r,g,b); resetColor << updateName; - resetColor << tColoredString::ColorString(1,1,1); + resetColor << tColoredString::ColorString(-1,-1,-1); message.SetTemplateParameter(2, resetColor); message << "$team_renamed"; sn_ConsoleOut(message); Modified: armagetronad/trunk/armagetronad/src/engine/eTeam.h =================================================================== --- armagetronad/trunk/armagetronad/src/engine/eTeam.h 2008-04-25 18:00:53 UTC (rev 8441) +++ armagetronad/trunk/armagetronad/src/engine/eTeam.h 2008-04-27 13:04:18 UTC (rev 8442) @@ -54,6 +54,7 @@ unsigned short r,g,b; // team color tString name; // our name + tString coloredName; //!< our colored name bool locked_; //!< if set, only invited players may join @@ -174,6 +175,9 @@ const tString& Name() const { return name; } + const tString& ColoredName() const { + return coloredName; + } virtual void PrintName(tString &s) const; // print out an understandable name in to s Modified: armagetronad/trunk/armagetronad/src/tron/gTeam.cpp =================================================================== --- armagetronad/trunk/armagetronad/src/tron/gTeam.cpp 2008-04-25 18:00:53 UTC (rev 8441) +++ armagetronad/trunk/armagetronad/src/tron/gTeam.cpp 2008-04-27 13:04:18 UTC (rev 8442) @@ -60,7 +60,7 @@ } // Handling the $team_join template ;) - text->SetTemplateParameter(1 , team->Name() ); + text->SetTemplateParameter(1 , team->ColoredName() ); text->SetTemplateParameter(2 , team->NumPlayers() ); if (team->PlayerMayJoin(player)) text->SetTemplateParameter(3, se_TeamMenu_Team_Ok); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |