[Wesnoth-cvs-commits] wesnoth/src font.cpp multiplayer_ui.cpp wml_sep... (June 03, 2005 - 12:29)

 

CVSROOT:	/cvsroot/wesnoth
Module name:	wesnoth
Branch: 	
Changes by:	Jon Daniel <j_daniel@xxxxxxxxxxxxxxxx>	05/06/03 10:11:08

Modified files:
	src            : font.cpp multiplayer_ui.cpp wml_separators.hpp 

Log message:
	* changed side colour prefixes to semi ANSI colour escape sequences to
	avoid any conflicts with TAB and BACKSPACE. Now Brown finally will be brown *g*
	* reverted the HEADING_PREFIX and IMG_TEXT_SEPARATOR change.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/font.cpp.diff?tr1=1.142&tr2=1.143&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_ui.cpp.diff?tr1=1.23&tr2=1.24&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/wml_separators.hpp.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

Patches:
Index: wesnoth/src/font.cpp
diff -u wesnoth/src/font.cpp:1.142 wesnoth/src/font.cpp:1.143
--- wesnoth/src/font.cpp:1.142	Mon May 16 22:44:19 2005
+++ wesnoth/src/font.cpp	Fri Jun  3 10:11:08 2005
@@ -1,4 +1,4 @@
-/* $Id: font.cpp,v 1.142 2005/05/16 22:44:19 ydirson Exp $ */
+/* $Id: font.cpp,v 1.143 2005/06/03 10:11:08 j_daniel Exp $ */
 /* vim:set encoding=utf-8: */
 /*
    Copyright (C) 2003 by David White <davidnwhite@xxxxxxxxxxxxxxx>
@@ -595,12 +595,25 @@
 			break;
 		case NULL_MARKUP:
 			return i1+1;
-		default:
-			if(*i1 >= 1 && *i1 <= 9) {
-				*colour = team::get_side_colour(*i1);
-				break;
+		// semi ANSI colour escape sequences at the start of the line for now only
+		case '\027':
+			if(i2 - i1 >= 4) {
+				++i1;
+				if(*i1 == '[') {
+					++i1;
+					if(*i1 == '3') {
+						++i1;
+						if(*i1 >= '0' && *i1 <= '9' && *(i1 + 1) == 'm')
+						{
+							if(*i1 != '0')
+								*colour = team::get_side_colour(lexical_cast<int, char>(*i1));
+							++i1;
+						}
+					}
+				}
 			}
-
+			break;
+		default:
 			return i1;
 		}
 
Index: wesnoth/src/multiplayer_ui.cpp
diff -u wesnoth/src/multiplayer_ui.cpp:1.23 wesnoth/src/multiplayer_ui.cpp:1.24
--- wesnoth/src/multiplayer_ui.cpp:1.23	Sat May  7 21:53:42 2005
+++ wesnoth/src/multiplayer_ui.cpp	Fri Jun  3 10:11:08 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_ui.cpp,v 1.23 2005/05/07 21:53:42 ettin Exp $ */
+/* $Id: multiplayer_ui.cpp,v 1.24 2005/06/03 10:11:08 j_daniel Exp $ */
 /*
    Copyright (C) 2005 
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -70,8 +70,8 @@
 
 std::string get_colour_string(int id)
 {
-	std::string prefix(" ");
-	prefix[0] = id + 1;
+	std::string prefix("\027[3 m");
+	prefix[3] = lexical_cast<char, int>(id + 1);
 
 	switch(id) {
 	case 0:
Index: wesnoth/src/wml_separators.hpp
diff -u wesnoth/src/wml_separators.hpp:1.4 wesnoth/src/wml_separators.hpp:1.5
--- wesnoth/src/wml_separators.hpp:1.4	Thu Jun  2 21:55:37 2005
+++ wesnoth/src/wml_separators.hpp	Fri Jun  3 10:11:08 2005
@@ -2,7 +2,7 @@
 #define WIDGET_DEFINES_HPP_INCLUDED
 
 char const HELP_STRING_SEPARATOR = '|', DEFAULT_ITEM = '*', COLUMN_SEPARATOR = '=',
-           IMAGE_PREFIX = '&', IMG_TEXT_SEPARATOR = 17, HEADING_PREFIX = 18;
+           IMAGE_PREFIX = '&', IMG_TEXT_SEPARATOR = 1, HEADING_PREFIX = 2;
 
 inline bool is_wml_separator(char c)
 {



You are on the gna.org mail server.

Generated by mhonarc, Tue Sep 20 16:50:21 2005