CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: David White <[EMAIL PROTECTED]> 05/07/19 23:45:59
Modified files:
src : multiplayer_ui.cpp
src/widgets : menu.cpp
Log message:
fixes to the user's menu in the mp lobby when there are many users
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_ui.cpp.diff?tr1=1.28&tr2=1.29&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/menu.cpp.diff?tr1=1.95&tr2=1.96&r1=text&r2=text
Patches:
Index: wesnoth/src/multiplayer_ui.cpp
diff -u wesnoth/src/multiplayer_ui.cpp:1.28 wesnoth/src/multiplayer_ui.cpp:1.29
--- wesnoth/src/multiplayer_ui.cpp:1.28 Mon Jun 6 20:12:47 2005
+++ wesnoth/src/multiplayer_ui.cpp Tue Jul 19 23:45:58 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_ui.cpp,v 1.28 2005/06/06 20:12:47 gruikya Exp $ */
+/* $Id: multiplayer_ui.cpp,v 1.29 2005/07/19 23:45:58 Sirp Exp $ */
/*
Copyright (C) 2005
Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -351,7 +351,8 @@
void ui::layout_children(const SDL_Rect& rect)
{
title_.set_location(xscale(11)+4, xscale(42) + 4);
- users_menu_.set_width(xscale(159));
+ users_menu_.set_width(xscale(159));
+ users_menu_.set_max_width(xscale(159));
users_menu_.set_location(xscale(856), yscale(42));
users_menu_.set_height(yscale(715));
users_menu_.set_max_height(yscale(715));
@@ -375,19 +376,17 @@
void ui::set_user_list(const std::vector<std::string>& list, bool silent)
{
- const int old_users = user_list_.size();
- user_list_ = list;
- const int new_users = user_list_.size();
-
if(!silent) {
- if(new_users < old_users) {
+ if(list.size() < user_list_.size()) {
sound::play_sound(game_config::sounds::user_leave);
- } else if(new_users > old_users) {
+ } else if(list.size() > user_list_.size()) {
sound::play_sound(game_config::sounds::user_arrive);
}
- }
+ }
+
+ user_list_ = list;
- users_menu_.set_items(user_list_);
+ users_menu_.set_items(user_list_,true,true);
}
const gui::widget& ui::title() const
Index: wesnoth/src/widgets/menu.cpp
diff -u wesnoth/src/widgets/menu.cpp:1.95 wesnoth/src/widgets/menu.cpp:1.96
--- wesnoth/src/widgets/menu.cpp:1.95 Sat Jun 4 19:16:06 2005
+++ wesnoth/src/widgets/menu.cpp Tue Jul 19 23:45:59 2005
@@ -396,7 +396,8 @@
void menu::set_max_height(const int new_max_height) {
max_height_ = new_max_height;
itemRects_.clear();
- max_items_ = -1;
+ max_items_ = -1;
+ update_size();
}
void menu::set_max_width(const int new_max_width) {