[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src multiplayer_connect.cpp multiplayer...
From: |
Philippe Plantier |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src multiplayer_connect.cpp multiplayer... |
Date: |
Sat, 19 Mar 2005 12:59:14 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Philippe Plantier <address@hidden> 05/03/19 17:59:14
Modified files:
src : multiplayer_connect.cpp multiplayer_ui.cpp
multiplayer_ui.hpp multiplayer_wait.cpp
Log message:
Added display of player colour and player number in the multiplayer
wait screen.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_connect.cpp.diff?tr1=1.128&tr2=1.129&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_ui.cpp.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_ui.hpp.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_wait.cpp.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
Patches:
Index: wesnoth/src/multiplayer_connect.cpp
diff -u wesnoth/src/multiplayer_connect.cpp:1.128
wesnoth/src/multiplayer_connect.cpp:1.129
--- wesnoth/src/multiplayer_connect.cpp:1.128 Sat Mar 19 17:33:32 2005
+++ wesnoth/src/multiplayer_connect.cpp Sat Mar 19 17:59:13 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_connect.cpp,v 1.128 2005/03/19 17:33:32 gruikya Exp $ */
+/* $Id: multiplayer_connect.cpp,v 1.129 2005/03/19 17:59:13 gruikya Exp $ */
/*
Copyright (C)
Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -853,25 +853,11 @@
std::string prefix;
prefix.resize(1);
- //Colors
- prefix[0] = 1;
- player_colours_.push_back(prefix + _("Red"));
- prefix[0] = 2;
- player_colours_.push_back(prefix + _("Blue"));
- prefix[0] = 3;
- player_colours_.push_back(prefix + _("Green"));
- prefix[0] = 4;
- player_colours_.push_back(prefix + _("Yellow"));
- prefix[0] = 5;
- player_colours_.push_back(prefix + _("Purple"));
- prefix[0] = 6;
- player_colours_.push_back(prefix + _("Orange"));
- prefix[0] = 7;
- player_colours_.push_back(prefix + _("Grey"));
- prefix[0] = 8;
- player_colours_.push_back(prefix + _("White"));
- prefix[0] = 9;
- player_colours_.push_back(prefix + _("Brown"));
+
+ // Colours
+ for(int i = 0; i < 9; ++i) {
+ player_colours_.push_back(get_colour_string(i));
+ }
// Populates "sides_" from the level configuration
sides_.reserve(sides.second - sides.first);
Index: wesnoth/src/multiplayer_ui.cpp
diff -u wesnoth/src/multiplayer_ui.cpp:1.14 wesnoth/src/multiplayer_ui.cpp:1.15
--- wesnoth/src/multiplayer_ui.cpp:1.14 Sat Mar 19 16:21:02 2005
+++ wesnoth/src/multiplayer_ui.cpp Sat Mar 19 17:59:13 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_ui.cpp,v 1.14 2005/03/19 16:21:02 gruikya Exp $ */
+/* $Id: multiplayer_ui.cpp,v 1.15 2005/03/19 17:59:13 gruikya Exp $ */
/*
Copyright (C)
Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -40,6 +40,35 @@
}
}
+std::string get_colour_string(int id)
+{
+ std::string prefix(" ");
+ prefix[0] = id + 1;
+
+ switch(id) {
+ case 0:
+ return prefix + _("Red");
+ case 1:
+ return prefix + _("Blue");
+ case 2:
+ return prefix + _("Green");
+ case 3:
+ return prefix + _("Yellow");
+ case 4:
+ return prefix + _("Purple");
+ case 5:
+ return prefix + _("Orange");
+ case 6:
+ return prefix + _("Grey");
+ case 7:
+ return prefix + _("White");
+ case 8:
+ return prefix + _("Brown");
+ default:
+ return _("Invalid colour");
+ }
+}
+
chat::chat()
{
}
Index: wesnoth/src/multiplayer_ui.hpp
diff -u wesnoth/src/multiplayer_ui.hpp:1.6 wesnoth/src/multiplayer_ui.hpp:1.7
--- wesnoth/src/multiplayer_ui.hpp:1.6 Sat Mar 19 16:21:02 2005
+++ wesnoth/src/multiplayer_ui.hpp Sat Mar 19 17:59:13 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_ui.hpp,v 1.6 2005/03/19 16:21:02 gruikya Exp $ */
+/* $Id: multiplayer_ui.hpp,v 1.7 2005/03/19 17:59:13 gruikya Exp $ */
/*
Copyright (C)
Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -30,6 +30,8 @@
void check_response(network::connection res, const config& data);
+std::string get_colour_string(int id);
+
//this class memorizes a chat session.
class chat
{
Index: wesnoth/src/multiplayer_wait.cpp
diff -u wesnoth/src/multiplayer_wait.cpp:1.17
wesnoth/src/multiplayer_wait.cpp:1.18
--- wesnoth/src/multiplayer_wait.cpp:1.17 Sat Mar 19 17:33:32 2005
+++ wesnoth/src/multiplayer_wait.cpp Sat Mar 19 17:59:13 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_wait.cpp,v 1.17 2005/03/19 17:33:32 gruikya Exp $ */
+/* $Id: multiplayer_wait.cpp,v 1.18 2005/03/19 17:59:13 gruikya Exp $ */
/*
Copyright (C)
Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -407,11 +407,14 @@
}
std::stringstream str;
+ str << sd["side"] << ". " << COLUMN_SEPARATOR;
str << description << COLUMN_SEPARATOR << side_name <<
COLUMN_SEPARATOR;
+ // Mark parentheses translatable for languages like Japanese
if(!leader_name.empty())
- str << "(" << leader_name << ")";
+ str << _("(") << leader_name << _(")");
str << COLUMN_SEPARATOR << sd["gold"] << ' ' <<
sgettext("unit^Gold")
<< COLUMN_SEPARATOR << sd["team_name"];
+ str << COLUMN_SEPARATOR <<
get_colour_string(lexical_cast_default<int>(sd["colour"], 0) - 1);
details.push_back(str.str());
}