[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src display.cpp playturn.cpp widgets/te...
From: |
Isaac Clerencia |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src display.cpp playturn.cpp widgets/te... |
Date: |
Fri, 12 Nov 2004 19:33:41 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Isaac Clerencia <address@hidden> 04/11/13 00:27:26
Modified files:
src : display.cpp playturn.cpp
src/widgets : textbox.cpp textbox.hpp
Log message:
Made the background for chat messages and chat input more opaque,
as it was difficult to read it over snowy terrain
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/display.cpp.diff?tr1=1.273&tr2=1.274&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playturn.cpp.diff?tr1=1.285&tr2=1.286&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/textbox.cpp.diff?tr1=1.63&tr2=1.64&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/textbox.hpp.diff?tr1=1.35&tr2=1.36&r1=text&r2=text
Patches:
Index: wesnoth/src/display.cpp
diff -u wesnoth/src/display.cpp:1.273 wesnoth/src/display.cpp:1.274
--- wesnoth/src/display.cpp:1.273 Wed Nov 10 03:10:33 2004
+++ wesnoth/src/display.cpp Sat Nov 13 00:27:25 2004
@@ -1,4 +1,4 @@
-/* $Id: display.cpp,v 1.273 2004/11/10 03:10:33 Sirp Exp $ */
+/* $Id: display.cpp,v 1.274 2004/11/13 00:27:25 isaaccp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -2239,8 +2239,8 @@
const int chat_message_border = 5;
const int chat_message_x = 10;
const int chat_message_y = 10;
- const SDL_Color chat_message_colour = {200,200,200,200};
- const SDL_Color chat_message_bg = {0,0,0,100};
+ const SDL_Color chat_message_colour = {255,255,255,255};
+ const SDL_Color chat_message_bg = {0,0,0,140};
}
void display::add_chat_message(const std::string& speaker, int side, const
std::string& message, display::MESSAGE_TYPE type)
Index: wesnoth/src/playturn.cpp
diff -u wesnoth/src/playturn.cpp:1.285 wesnoth/src/playturn.cpp:1.286
--- wesnoth/src/playturn.cpp:1.285 Wed Nov 10 19:20:21 2004
+++ wesnoth/src/playturn.cpp Sat Nov 13 00:27:25 2004
@@ -1,4 +1,4 @@
-/* $Id: playturn.cpp,v 1.285 2004/11/10 19:20:21 cedricd Exp $ */
+/* $Id: playturn.cpp,v 1.286 2004/11/13 00:27:25 isaaccp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -2524,11 +2524,13 @@
const SDL_Rect& area = gui_.map_area();
+ const SDL_Color textbox_bg = {0,0,0,140};
+
const int border_size = 10;
const int ypos = area.y+area.h-30 - (textbox_.check != NULL ?
textbox_.check->height() + border_size : 0);
textbox_.label =
font::add_floating_label(label,font::SIZE_NORMAL,font::YELLOW_COLOUR,area.x+border_size,ypos,0,0,-1,
- area,font::LEFT_ALIGN);
+ area,font::LEFT_ALIGN, &textbox_bg);
if(textbox_.label == 0) {
return;
}
@@ -2541,7 +2543,7 @@
return;
}
- textbox_.box.assign(new gui::textbox(gui_,textbox_width));
+ textbox_.box.assign(new
gui::textbox(gui_,textbox_width,"",true,256,0.8,0.6));
textbox_.box->set_volatile(true);
textbox_.box->set_location(area.x + label_area.w + border_size*2,ypos);
Index: wesnoth/src/widgets/textbox.cpp
diff -u wesnoth/src/widgets/textbox.cpp:1.63
wesnoth/src/widgets/textbox.cpp:1.64
--- wesnoth/src/widgets/textbox.cpp:1.63 Sat Nov 6 13:13:16 2004
+++ wesnoth/src/widgets/textbox.cpp Sat Nov 13 00:27:26 2004
@@ -1,4 +1,4 @@
-/* $Id: textbox.cpp,v 1.63 2004/11/06 13:13:16 silene Exp $ */
+/* $Id: textbox.cpp,v 1.64 2004/11/13 00:27:26 isaaccp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -28,12 +28,13 @@
const int font_size = font::SIZE_PLUS;
-textbox::textbox(display& d, int width, const std::string& text, bool
editable, size_t max_size)
+textbox::textbox(display& d, int width, const std::string& text, bool
editable, size_t max_size, double alpha, double alpha_focus)
: scrollarea(d), max_size_(max_size), text_(string_to_wstring(text)),
cursor_(text_.size()), selstart_(-1), selend_(-1),
grabmouse_(false), text_pos_(0), editable_(editable),
show_cursor_(true), show_cursor_at_(0), text_image_(NULL),
- wrap_(false), line_height_(0), yscroll_(0)
+ wrap_(false), line_height_(0), yscroll_(0), alpha_(alpha),
+ alpha_focus_(alpha_focus)
{
// static const SDL_Rect area = d.screen_area();
// const int height =
font::draw_text(NULL,area,font_size,font::NORMAL_COLOUR,"ABCD",0,0).h;
@@ -118,7 +119,7 @@
surface surf = disp().video().getSurface();
gui::draw_solid_tinted_rectangle(loc.x,loc.y,loc.w,loc.h,0,0,0,
- focus() ? 0.2 : 0.4, surf);
+ focus() ? alpha_focus_ : alpha_, surf);
SDL_Rect src;
Index: wesnoth/src/widgets/textbox.hpp
diff -u wesnoth/src/widgets/textbox.hpp:1.35
wesnoth/src/widgets/textbox.hpp:1.36
--- wesnoth/src/widgets/textbox.hpp:1.35 Sat Nov 6 09:19:28 2004
+++ wesnoth/src/widgets/textbox.hpp Sat Nov 13 00:27:26 2004
@@ -1,4 +1,4 @@
-/* $Id: textbox.hpp,v 1.35 2004/11/06 09:19:28 silene Exp $ */
+/* $Id: textbox.hpp,v 1.36 2004/11/13 00:27:26 isaaccp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -28,7 +28,7 @@
class textbox : public scrollarea
{
public:
- textbox(display& d, int width, const std::string& text="", bool
editable=true, size_t max_size = 256);
+ textbox(display& d, int width, const std::string& text="", bool
editable=true, size_t max_size = 256, double alpha = 0.4, double alpha_focus =
0.2);
const std::string text() const;
void set_text(const std::string& text);
@@ -52,7 +52,7 @@
size_t max_size_;
wide_string text_;
-
+
// mutable unsigned int firstOnScreen_;
int cursor_;
int selstart_;
@@ -77,6 +77,9 @@
size_t line_height_, yscroll_;
+ double alpha_;
+ double alpha_focus_;
+
void handle_event(const SDL_Event& event);
void draw_cursor(int pos, display &disp) const;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src display.cpp playturn.cpp widgets/te...,
Isaac Clerencia <=