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

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

[Wesnoth-cvs-commits] wesnoth/src multiplayer_lobby.cpp multiplayer_l...


From: Jon Daniel
Subject: [Wesnoth-cvs-commits] wesnoth/src multiplayer_lobby.cpp multiplayer_l...
Date: Sat, 17 Sep 2005 16:16:41 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Jon Daniel <address@hidden>     05/09/17 20:16:39

Modified files:
        src            : multiplayer_lobby.cpp multiplayer_lobby.hpp 

Log message:
        * made selected() return bool tweaked the observe and join conditions
        * dos2unix

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_lobby.cpp.diff?tr1=1.90&tr2=1.91&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_lobby.hpp.diff?tr1=1.17&tr2=1.18&r1=text&r2=text

Patches:
Index: wesnoth/src/multiplayer_lobby.cpp
diff -u wesnoth/src/multiplayer_lobby.cpp:1.90 
wesnoth/src/multiplayer_lobby.cpp:1.91
--- wesnoth/src/multiplayer_lobby.cpp:1.90      Sat Sep 17 15:03:33 2005
+++ wesnoth/src/multiplayer_lobby.cpp   Sat Sep 17 20:16:38 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_lobby.cpp,v 1.90 2005/09/17 15:03:33 Sirp Exp $ */
+/* $Id: multiplayer_lobby.cpp,v 1.91 2005/09/17 20:16:38 j_daniel Exp $ */
 /*
    Copyright (C)
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -460,17 +460,17 @@
        join_game_.hide(!games_menu_.selection_is_joinable());
        observe_game_.hide(!games_menu_.selection_is_observable());
 
-       const bool observe = observe_game_.pressed() || (games_menu_.selected() 
>= 0 && games_menu_.selection_is_observable() && 
!games_menu_.selection_is_joinable());
-       const bool join = join_game_.pressed() || (games_menu_.selected() >= 0 
&& games_menu_.selection_is_joinable());
+       const bool observe = (observe_game_.pressed() || 
(games_menu_.selected() && !games_menu_.selection_is_joinable())) && 
games_menu_.selection_is_observable();
+       const bool join = (join_game_.pressed() || games_menu_.selected()) && 
games_menu_.selection_is_joinable();
 
        if(join || observe) {
-               const config* game = gamelist().child("gamelist");
-
+               const config* game = gamelist().child("gamelist");
+
                const int selected = games_menu_.selection();
                if(game != NULL && selected >= 0) {
-                       const config::const_child_itors i = 
game->child_range("game");
-                       wassert(i.first + selected < i.second);
-
+                       const config::const_child_itors i = 
game->child_range("game");
+                       wassert(i.first + selected < i.second);
+
                        const config& game_cfg = **(i.first + selected);
                        const std::string& id = game_cfg["id"];
 
Index: wesnoth/src/multiplayer_lobby.hpp
diff -u wesnoth/src/multiplayer_lobby.hpp:1.17 
wesnoth/src/multiplayer_lobby.hpp:1.18
--- wesnoth/src/multiplayer_lobby.hpp:1.17      Sat Sep 17 15:03:33 2005
+++ wesnoth/src/multiplayer_lobby.hpp   Sat Sep 17 20:16:38 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_lobby.hpp,v 1.17 2005/09/17 15:03:33 Sirp Exp $ */
+/* $Id: multiplayer_lobby.hpp,v 1.18 2005/09/17 20:16:38 j_daniel Exp $ */
 /*
    Copyright (C)
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -55,7 +55,7 @@
        bool empty() const { return games_.empty(); }
        bool selection_is_joinable() const { return empty() ? false : 
games_[selected_].vacant_slots; }
        bool selection_is_observable() const { return empty() ? false : 
games_[selected_].observers; }
-       int selected() const { return double_clicked_ && !empty() ? 
static_cast<int>(selected_) : -1; }
+       bool selected() const { return double_clicked_ && !empty(); }
        int selection() const { return selected_; }
 protected:
 private:




reply via email to

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