wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src display.cpp


From: Philippe Plantier
Subject: [Wesnoth-cvs-commits] wesnoth/src display.cpp
Date: Wed, 16 Mar 2005 16:02:45 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Philippe Plantier <address@hidden>      05/03/16 21:02:45

Modified files:
        src            : display.cpp 

Log message:
        Adding in patch #3831 from sanna:  Make the entire message line in the 
nick
        color when /me substitution is used

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/display.cpp.diff?tr1=1.299&tr2=1.300&r1=text&r2=text

Patches:
Index: wesnoth/src/display.cpp
diff -u wesnoth/src/display.cpp:1.299 wesnoth/src/display.cpp:1.300
--- wesnoth/src/display.cpp:1.299       Wed Mar 16 20:50:11 2005
+++ wesnoth/src/display.cpp     Wed Mar 16 21:02:45 2005
@@ -1,4 +1,4 @@
-/* $Id: display.cpp,v 1.299 2005/03/16 20:50:11 ydirson Exp $ */
+/* $Id: display.cpp,v 1.300 2005/03/16 21:02:45 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -2211,6 +2211,12 @@
                ypos += font::get_floating_label_rect(m->handle).h;
        }
 
+       SDL_Color speaker_colour = {255,255,255,255};
+       if(side >= 1) {
+               speaker_colour = team::get_side_colour(side);
+       }
+       
+       SDL_Color message_colour = chat_message_colour;
        std::stringstream str;
        std::stringstream message_str;
        message_str << msg;
@@ -2218,6 +2224,7 @@
                if(action) {
                        str << "<" << speaker;
                        message_str << ">";
+                       message_colour = speaker_colour;
                } else {
                        str << "<" << speaker << ">";
                }
@@ -2225,22 +2232,19 @@
                if(action) {
                        str << "*" << speaker;
                        message_str << "*";
+                       message_colour = speaker_colour;
                } else {
                        str << "*" << speaker << "*";
                }
        }
 
-       SDL_Color speaker_colour = {255,255,255,255};
-       if(side >= 1) {
-               speaker_colour = team::get_side_colour(side);
-       }
 
        const SDL_Rect rect = map_area();
        const int speaker_handle = 
font::add_floating_label(str.str(),font::SIZE_SMALL,speaker_colour,
-                                                          
rect.x+chat_message_x,rect.y+ypos,
-                                                                               
                           
0,0,-1,rect,font::LEFT_ALIGN,&chat_message_bg,chat_message_border);
+               rect.x+chat_message_x,rect.y+ypos,
+               
0,0,-1,rect,font::LEFT_ALIGN,&chat_message_bg,chat_message_border);
 
-       const int message_handle = 
font::add_floating_label(message_str.str(),font::SIZE_SMALL,chat_message_colour,
+       const int message_handle = 
font::add_floating_label(message_str.str(),font::SIZE_SMALL,message_colour,
                rect.x + chat_message_x + 
font::get_floating_label_rect(speaker_handle).w,rect.y+ypos,
                
0,0,-1,rect,font::LEFT_ALIGN,&chat_message_bg,chat_message_border);
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]