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

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

[Wesnoth-cvs-commits] wesnoth/src font.cpp font.hpp multiplayer_conne...


From: Jordà Polo
Subject: [Wesnoth-cvs-commits] wesnoth/src font.cpp font.hpp multiplayer_conne...
Date: Sat, 07 May 2005 17:53:44 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Jordà Polo <address@hidden>     05/05/07 21:53:43

Modified files:
        src            : font.cpp font.hpp multiplayer_connect.cpp 
                         multiplayer_create.cpp multiplayer_ui.cpp 
                         multiplayer_wait.cpp 
        src/widgets    : button.cpp slider.cpp 

Log message:
        User interface polishing:
        * MP lobby: improved background
        * MP lobby: tweaked margins and paddings
        * MP lobby: getting rid of font::GOOD_COLOUR
        * MP lobby: fixed multiplayer_wait game_menu_'s width
        * Slider is now less "bright"
        * The text of disabled buttons is now grayed out

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/font.cpp.diff?tr1=1.138&tr2=1.139&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/font.hpp.diff?tr1=1.54&tr2=1.55&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_connect.cpp.diff?tr1=1.142&tr2=1.143&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_create.cpp.diff?tr1=1.23&tr2=1.24&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_ui.cpp.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_wait.cpp.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/button.cpp.diff?tr1=1.63&tr2=1.64&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/slider.cpp.diff?tr1=1.39&tr2=1.40&r1=text&r2=text

Patches:
Index: wesnoth/src/font.cpp
diff -u wesnoth/src/font.cpp:1.138 wesnoth/src/font.cpp:1.139
--- wesnoth/src/font.cpp:1.138  Sat May  7 10:01:40 2005
+++ wesnoth/src/font.cpp        Sat May  7 21:53:42 2005
@@ -1,4 +1,4 @@
-/* $Id: font.cpp,v 1.138 2005/05/07 10:01:40 silene Exp $ */
+/* $Id: font.cpp,v 1.139 2005/05/07 21:53:42 ettin Exp $ */
 /* vim:set encoding=utf-8: */
 /*
    Copyright (C) 2003 by David White <address@hidden>
@@ -312,12 +312,14 @@
 }
 
 const SDL_Color NORMAL_COLOUR = {0xDD,0xDD,0xDD,0},
+                LOBBY_COLOUR  = {0xBB,0xBB,0xBB,0},
                 GOOD_COLOUR   = {0x00,0xFF,0x00,0},
                 BAD_COLOUR    = {0xFF,0x00,0x00,0},
                 BLACK_COLOUR  = {0x00,0x00,0x00,0},
                 DARK_COLOUR   = {0x00,0x00,0x66,0},
                 YELLOW_COLOUR = {0xFF,0xFF,0x00,0},
                 BUTTON_COLOUR = {0xBC,0xB0,0x88,0},
+                STONED_COLOUR = {0xA0,0xA0,0xA0,0},
                 TITLE_COLOUR  = {0xBC,0xB0,0x88,0};
 
 const char LARGE_TEXT='*', SMALL_TEXT='`', GOOD_TEXT='@', BAD_TEXT='#',
Index: wesnoth/src/font.hpp
diff -u wesnoth/src/font.hpp:1.54 wesnoth/src/font.hpp:1.55
--- wesnoth/src/font.hpp:1.54   Sat Apr  2 14:06:35 2005
+++ wesnoth/src/font.hpp        Sat May  7 21:53:42 2005
@@ -1,4 +1,4 @@
-/* $Id: font.hpp,v 1.54 2005/04/02 14:06:35 gruikya Exp $ */
+/* $Id: font.hpp,v 1.55 2005/05/07 21:53:42 ettin Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -44,8 +44,9 @@
 void set_font_list(const std::vector<subset_descriptor>& fontlist);
 
 //various standard colours
-extern const SDL_Color NORMAL_COLOUR, GOOD_COLOUR, BAD_COLOUR, BLACK_COLOUR,
-                       DARK_COLOUR, YELLOW_COLOUR, BUTTON_COLOUR, TITLE_COLOUR;
+extern const SDL_Color NORMAL_COLOUR, LOBBY_COLOUR, GOOD_COLOUR, BAD_COLOUR,
+                       BLACK_COLOUR, DARK_COLOUR, YELLOW_COLOUR, BUTTON_COLOUR,
+                       STONED_COLOUR, TITLE_COLOUR;
 
 //standard markups
 extern const char LARGE_TEXT, SMALL_TEXT, GOOD_TEXT, BAD_TEXT, NORMAL_TEXT, 
BLACK_TEXT, BOLD_TEXT, IMAGE, NULL_MARKUP;
Index: wesnoth/src/multiplayer_connect.cpp
diff -u wesnoth/src/multiplayer_connect.cpp:1.142 
wesnoth/src/multiplayer_connect.cpp:1.143
--- wesnoth/src/multiplayer_connect.cpp:1.142   Wed Apr 27 21:11:44 2005
+++ wesnoth/src/multiplayer_connect.cpp Sat May  7 21:53:42 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_connect.cpp,v 1.142 2005/04/27 21:11:44 gruikya Exp $ */
+/* $Id: multiplayer_connect.cpp,v 1.143 2005/05/07 21:53:42 ettin Exp $ */
 /*
    Copyright (C) 
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -49,7 +49,7 @@
        index_(index),
 
        player_number_(parent.video(), 
lexical_cast_default<std::string>(index+1, ""),
-                       font::SIZE_XLARGE, font::GOOD_COLOUR),
+                      font::SIZE_LARGE, font::LOBBY_COLOUR),
        combo_controller_(parent.disp(), parent.player_types_),
        orig_controller_(parent.video(), cfg["description"], font::SIZE_SMALL), 
        combo_faction_(parent.disp(), parent.player_factions_),
@@ -57,7 +57,7 @@
        combo_team_(parent.disp(), parent.player_teams_),
        combo_colour_(parent.disp(), parent.player_colours_),
        slider_gold_(parent.video()),
-       label_gold_(parent.video(), "100", font::SIZE_NORMAL, 
font::GOOD_COLOUR),
+       label_gold_(parent.video(), "100", font::SIZE_SMALL, 
font::LOBBY_COLOUR),
        enabled_(!parent_->params_.saved_game),
        changed_(false),
        llm_(parent.era_sides_, &parent.game_data_, enabled_ ? &combo_leader_ : 
NULL)
@@ -154,15 +154,15 @@
 
 void connect::side::add_widgets_to_scrollpane(gui::scrollpane& pane, int pos)
 { 
-       pane.add_widget(&player_number_, 10, 3 + pos);
-       pane.add_widget(&combo_controller_, 30, 5 + pos);
-       pane.add_widget(&orig_controller_, 30 + (combo_controller_.width() - 
orig_controller_.width()) / 2, 35 + pos + (combo_leader_.height() - 
orig_controller_.height()) / 2);
-       pane.add_widget(&combo_faction_, 145, 5 + pos);
-       pane.add_widget(&combo_leader_, 145, 35 + pos);
-       pane.add_widget(&combo_team_, 260, 5 + pos);
-       pane.add_widget(&combo_colour_, 375, 5 + pos);
-       pane.add_widget(&slider_gold_, 490, 5 + pos);
-       pane.add_widget(&label_gold_, 500 + slider_gold_.width(), 5 + pos);
+       pane.add_widget(&player_number_, 0, 5 + pos);
+       pane.add_widget(&combo_controller_, 20, 5 + pos);
+       pane.add_widget(&orig_controller_, 20 + (combo_controller_.width() - 
orig_controller_.width()) / 2, 35 + pos + (combo_leader_.height() - 
orig_controller_.height()) / 2);
+       pane.add_widget(&combo_faction_, 135, 5 + pos);
+       pane.add_widget(&combo_leader_, 135, 35 + pos);
+       pane.add_widget(&combo_team_, 250, 5 + pos);
+       pane.add_widget(&combo_colour_, 365, 5 + pos);
+       pane.add_widget(&slider_gold_, 480, 5 + pos);
+       pane.add_widget(&label_gold_, 490 + slider_gold_.width(), 8 + pos);
 }
 
 void connect::side::process_event()
@@ -478,16 +478,16 @@
 
        team_prefix_(std::string(_("Team")) + " "),
 
-       waiting_label_(video(), ""),
+       waiting_label_(video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
        message_full_(false),
        default_controller_(default_controller),
 
        scroll_pane_(video()),
-       type_title_label_(video(), _("Player/Type"), font::SIZE_NORMAL, 
font::GOOD_COLOUR),
-       faction_title_label_(video(), _("Faction"), font::SIZE_NORMAL, 
font::GOOD_COLOUR),
-       team_title_label_(video(), _("Team"), font::SIZE_NORMAL, 
font::GOOD_COLOUR),
-       colour_title_label_(video(), _("Color"), font::SIZE_NORMAL, 
font::GOOD_COLOUR),
-       gold_title_label_(video(), _("Gold"), font::SIZE_NORMAL, 
font::GOOD_COLOUR),
+       type_title_label_(video(), _("Player/Type"), font::SIZE_SMALL, 
font::LOBBY_COLOUR),
+       faction_title_label_(video(), _("Faction"), font::SIZE_SMALL, 
font::LOBBY_COLOUR),
+       team_title_label_(video(), _("Team"), font::SIZE_SMALL, 
font::LOBBY_COLOUR),
+       colour_title_label_(video(), _("Color"), font::SIZE_SMALL, 
font::LOBBY_COLOUR),
+       gold_title_label_(video(), _("Gold"), font::SIZE_SMALL, 
font::LOBBY_COLOUR),
 
        ai_(video(), _("Computer vs Computer")),
        launch_(video(), _("I'm Ready")),
@@ -775,23 +775,23 @@
        size_t bottom = ca.y + ca.h;
 
        //Buttons
-       right_button->set_location(right - right_button->width() - 
gui::ButtonHPadding,
-                       bottom - right_button->height() - gui::ButtonVPadding);
-       left_button->set_location(right - right_button->width() - 
left_button->width() - gui::ButtonHPadding*2,
-                       bottom - left_button->height()-gui::ButtonVPadding);
-
-       ai_.set_location(left+30, 
bottom-left_button->height()-gui::ButtonVPadding);
-       waiting_label_.set_location(ai_.location().x + ai_.location().w + 10,
-                       bottom-left_button->height()-gui::ButtonVPadding);
+       right_button->set_location(right - right_button->width(),
+                                  bottom - right_button->height());
+       left_button->set_location(right - right_button->width() - 
left_button->width() - gui::ButtonHPadding,
+                                 bottom - left_button->height());
+
+       ai_.set_location(left, bottom-left_button->height());
+       waiting_label_.set_location(ai_.location().x + ai_.location().w + 8,
+                                   bottom-left_button->height() + 4);
 
        // Title and labels
        gui::draw_dialog_title(left,top,&video(),_("Game Lobby"));
 
-       
type_title_label_.set_location((left+30)+(launch_.width()/2)-(type_title_label_.width()/2),top+35);
-       
faction_title_label_.set_location((left+145)+(launch_.width()/2)-(faction_title_label_.width()/2),top+35);
-       
team_title_label_.set_location((left+260)+(launch_.width()/2)-(team_title_label_.width()/2),top+35);
-       
colour_title_label_.set_location((left+375)+(launch_.width()/2)-(colour_title_label_.width()/2),top+35);
-       
gold_title_label_.set_location((left+480)+(launch_.width()/2)-(gold_title_label_.width()/2),top+35);
+       type_title_label_.set_location(left+30, top+35);
+       faction_title_label_.set_location((left+145), top+35);
+       team_title_label_.set_location((left+260), top+35);
+       colour_title_label_.set_location((left+375), top+35);
+       gold_title_label_.set_location((left+493), top+35);
 
        SDL_Rect scroll_pane_rect;
        scroll_pane_rect.x = ca.x;
Index: wesnoth/src/multiplayer_create.cpp
diff -u wesnoth/src/multiplayer_create.cpp:1.23 
wesnoth/src/multiplayer_create.cpp:1.24
--- wesnoth/src/multiplayer_create.cpp:1.23     Thu May  5 22:59:13 2005
+++ wesnoth/src/multiplayer_create.cpp  Sat May  7 21:53:42 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_create.cpp,v 1.23 2005/05/05 22:59:13 ettin Exp $ */
+/* $Id: multiplayer_create.cpp,v 1.24 2005/05/07 21:53:42 ettin Exp $ */
 /*
    Copyright (C) 
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -38,15 +38,15 @@
 
        maps_menu_(disp.video(), std::vector<std::string>()),
        turns_slider_(disp.video()),
-       turns_label_(disp.video(), "", font::SIZE_SMALL, font::GOOD_COLOUR),
+       turns_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
        village_gold_slider_(disp.video()),
-       village_gold_label_(disp.video(), "", font::SIZE_SMALL, 
font::GOOD_COLOUR),
+       village_gold_label_(disp.video(), "", font::SIZE_SMALL, 
font::LOBBY_COLOUR),
        xp_modifier_slider_(disp.video()),
-       xp_modifier_label_(disp.video(), "", font::SIZE_SMALL, 
font::GOOD_COLOUR),
-       name_entry_label_(disp.video(), _("Name of game:"), font::SIZE_SMALL, 
font::GOOD_COLOUR),
-       num_players_label_(disp.video(), "", font::SIZE_SMALL, 
font::GOOD_COLOUR),
-       era_label_(disp.video(), _("Era:"), font::SIZE_SMALL, 
font::GOOD_COLOUR),
-       map_label_(disp.video(), _("Map to play:"), font::SIZE_SMALL, 
font::GOOD_COLOUR),
+       xp_modifier_label_(disp.video(), "", font::SIZE_SMALL, 
font::LOBBY_COLOUR),
+       name_entry_label_(disp.video(), _("Name of game:"), font::SIZE_SMALL, 
font::LOBBY_COLOUR),
+       num_players_label_(disp.video(), "", font::SIZE_SMALL, 
font::LOBBY_COLOUR),
+       era_label_(disp.video(), _("Era:"), font::SIZE_SMALL, 
font::LOBBY_COLOUR),
+       map_label_(disp.video(), _("Map to play:"), font::SIZE_SMALL, 
font::LOBBY_COLOUR),
        fog_game_(disp.video(), _("Fog Of War"), gui::button::TYPE_CHECK),
        shroud_game_(disp.video(), _("Shroud"), gui::button::TYPE_CHECK),
        observers_game_(disp.video(), _("Observers"), gui::button::TYPE_CHECK),
@@ -378,6 +378,7 @@
        SDL_Rect ca = client_area();
 
        const int border_size = 6;
+       const int column_border_size = 10;
        int xpos = ca.x;
        int ypos = ca.y;
 
@@ -408,12 +409,12 @@
        generator_settings_.set_location(xpos, ypos);
 
        // Second column: map menu
-       ypos = ypos_columntop + border_size;
-       xpos += minimap_width + border_size;
+       ypos = ypos_columntop;
+       xpos += minimap_width + column_border_size;
        map_label_.set_location(xpos, ypos);
        ypos += map_label_.height() + border_size;
        maps_menu_.set_max_width(200);
-       maps_menu_.set_max_height(ca.x + ca.h - ypos);
+       maps_menu_.set_max_height(ca.h + ca.x - ypos - border_size);
        maps_menu_.set_location(xpos, ypos);
        // Menu dimensions are only updated when items are set. So do this now.
        int mapsel_save = maps_menu_.selection();
@@ -421,8 +422,8 @@
        maps_menu_.move_selection(mapsel_save);
 
        // Third column: big buch of options
-       ypos = ypos_columntop + border_size;
-       xpos += 200 + border_size;
+       ypos = ypos_columntop;
+       xpos += 200 + column_border_size;
 
        turns_label_.set_location(xpos, ypos);
        ypos += turns_label_.height() + border_size;
@@ -467,11 +468,10 @@
 #endif
 
        // Buttons
-       right_button->set_location(ca.x + ca.w - right_button->width() - 
gui::ButtonHPadding, 
-                       ca.y + ca.h - right_button->height() - 
gui::ButtonVPadding);
+       right_button->set_location(ca.x + ca.w - right_button->width(), 
+                                  ca.y + ca.h - right_button->height());
        left_button->set_location(right_button->location().x - 
left_button->width() -
-                       gui::ButtonHPadding,
-                       ca.y + ca.h - left_button->height() - 
gui::ButtonVPadding);
+                                 gui::ButtonHPadding, ca.y + ca.h - 
left_button->height());
 }
 
 }
Index: wesnoth/src/multiplayer_ui.cpp
diff -u wesnoth/src/multiplayer_ui.cpp:1.22 wesnoth/src/multiplayer_ui.cpp:1.23
--- wesnoth/src/multiplayer_ui.cpp:1.22 Wed Apr 27 21:11:44 2005
+++ wesnoth/src/multiplayer_ui.cpp      Sat May  7 21:53:42 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_ui.cpp,v 1.22 2005/04/27 21:11:44 gruikya Exp $ */
+/* $Id: multiplayer_ui.cpp,v 1.23 2005/05/07 21:53:42 ettin Exp $ */
 /*
    Copyright (C) 2005 
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -216,10 +216,10 @@
 {
        SDL_Rect res;
 
-       res.x = xscale(11) + 6;
-       res.y = yscale(40) + 6;
-       res.w = xscale(833) > 12 ? xscale(833) - 12 : 0;
-       res.h = yscale(524) > 12 ? yscale(524) - 12 : 0;
+       res.x = xscale(10) + 10;
+       res.y = yscale(38) + 10;
+       res.w = xscale(828) > 12 ? xscale(828) - 12 : 0;
+       res.h = yscale(520) > 12 ? yscale(520) - 12 : 0;
 
        return res;
 }
Index: wesnoth/src/multiplayer_wait.cpp
diff -u wesnoth/src/multiplayer_wait.cpp:1.25 
wesnoth/src/multiplayer_wait.cpp:1.26
--- wesnoth/src/multiplayer_wait.cpp:1.25       Wed Apr 27 21:11:44 2005
+++ wesnoth/src/multiplayer_wait.cpp    Sat May  7 21:53:42 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_wait.cpp,v 1.25 2005/04/27 21:11:44 gruikya Exp $ */
+/* $Id: multiplayer_wait.cpp,v 1.26 2005/05/07 21:53:42 ettin Exp $ */
 /*
    Copyright (C) 
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -145,7 +145,7 @@
        ui(disp, cfg, c, gamelist),
 
        cancel_button_(disp.video(), _("Cancel")),
-       start_label_(disp.video(), _("Waiting for game to start...")),
+       start_label_(disp.video(), _("Waiting for game to start..."), 
font::SIZE_SMALL, font::LOBBY_COLOUR),
        game_menu_(disp.video(), std::vector<std::string>()),
 
        game_data_(data),
@@ -268,12 +268,12 @@
        ui::layout_children(rect);
 
        const SDL_Rect ca = client_area();
-       int y = ca.y + ca.h - cancel_button_.height() - gui::ButtonVPadding;
+       int y = ca.y + ca.h - cancel_button_.height();
 
        game_menu_.set_location(ca.x, ca.y);
-       game_menu_.set_measurements(ca.x + ca.w, y - ca.y - 
gui::ButtonVPadding);
-       cancel_button_.set_location(ca.x + ca.w - cancel_button_.width() - 
gui::ButtonHPadding, y);
-       start_label_.set_location(ca.x + gui::ButtonHPadding, y + 4);
+       game_menu_.set_measurements(ca.w, y - ca.y - gui::ButtonVPadding);
+       cancel_button_.set_location(ca.x + ca.w - cancel_button_.width(), y);
+       start_label_.set_location(ca.x, y + 4);
 }
 
 void wait::hide_children(bool hide)
Index: wesnoth/src/widgets/button.cpp
diff -u wesnoth/src/widgets/button.cpp:1.63 wesnoth/src/widgets/button.cpp:1.64
--- wesnoth/src/widgets/button.cpp:1.63 Wed May  4 03:16:39 2005
+++ wesnoth/src/widgets/button.cpp      Sat May  7 21:53:43 2005
@@ -1,4 +1,4 @@
-/* $Id: button.cpp,v 1.63 2005/05/04 03:16:39 Sirp Exp $ */
+/* $Id: button.cpp,v 1.64 2005/05/07 21:53:43 ettin Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -174,12 +174,16 @@
        else
                textx = loc.x + image_w + checkbox_horizontal_padding / 2;
   
-       if (!enabled_)
+       SDL_Color button_colour = font::BUTTON_COLOUR;
+
+       if (!enabled_) {
                image = greyscale_image(image);
+               button_colour = font::STONED_COLOUR;
+       }
 
        video().blit_surface(loc.x, loc.y, image);
        const std::string etext = font::make_text_ellipsis(label_, font_size, 
loc.w);
-       font::draw_text(&video(), clipArea, font_size, font::BUTTON_COLOUR, 
etext, textx, texty);
+       font::draw_text(&video(), clipArea, font_size, button_colour, etext, 
textx, texty);
 
        update_rect(loc);
 }
Index: wesnoth/src/widgets/slider.cpp
diff -u wesnoth/src/widgets/slider.cpp:1.39 wesnoth/src/widgets/slider.cpp:1.40
--- wesnoth/src/widgets/slider.cpp:1.39 Fri Mar 18 21:21:48 2005
+++ wesnoth/src/widgets/slider.cpp      Sat May  7 21:53:43 2005
@@ -1,4 +1,4 @@
-/* $Id: slider.cpp,v 1.39 2005/03/18 21:21:48 ydirson Exp $ */
+/* $Id: slider.cpp,v 1.40 2005/05/07 21:53:43 ettin Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -122,7 +122,7 @@
        surface const screen = video().getSurface();
 
        SDL_Rect line_rect = { loc.x + image->w / 2, loc.y + loc.h / 2, loc.w - 
image->w, 1 };
-       SDL_FillRect(screen, &line_rect, SDL_MapRGB(screen->format, 255, 255, 
255));
+       SDL_FillRect(screen, &line_rect, SDL_MapRGB(screen->format, 221, 221, 
221));
 
        SDL_Rect const &slider = slider_area();
        video().blit_surface(slider.x, slider.y, image);




reply via email to

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