Author: tschmitz
Date: Sat Aug 27 01:44:19 2011
New Revision: 50933
URL: http://svn.gna.org/viewcvs/wesnoth?rev=50933&view=rev
Log:
Fixed: hide_whiteboard preference does nothing.
Modified:
trunk/src/whiteboard/manager.cpp
trunk/src/whiteboard/manager.hpp
Modified: trunk/src/whiteboard/manager.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/manager.cpp?rev=50933&r1=50932&r2=50933&view=diff
==============================================================================
--- trunk/src/whiteboard/manager.cpp (original)
+++ trunk/src/whiteboard/manager.cpp Sat Aug 27 01:44:19 2011
@@ -65,7 +65,7 @@
key_poller_(new CKey),
hidden_unit_hexes_(),
net_buffer_(resources::teams->size()),
- team_plans_hidden_(resources::teams->size(),false)
+
team_plans_hidden_(resources::teams->size(),preferences::hide_whiteboard())
{
LOG_WB << "Manager initialized.\n";
}
@@ -261,7 +261,7 @@
}
/* private */
-void manager::update_plan_hiding(size_t team_index) const
+void manager::update_plan_hiding(size_t team_index)
{
//We don't control the "viewing" side ... we're probably an observer
if(!resources::teams->at(team_index).is_human())
@@ -270,6 +270,10 @@
{
foreach(team& t, *resources::teams)
{
+ //make sure only appropriate teams are hidden
+ if(!t.is_network_human())
+ team_plans_hidden_[t.side()-1] = false;
+
if(t.is_enemy(team_index+1) ||
team_plans_hidden_[t.side()-1])
t.get_side_actions()->hide();
else
@@ -278,7 +282,7 @@
}
resources::teams->at(team_index).get_side_actions()->validate_actions();
}
-void manager::update_plan_hiding() const
+void manager::update_plan_hiding()
{update_plan_hiding(viewer_team());}
void manager::on_viewer_change(size_t team_index)
Modified: trunk/src/whiteboard/manager.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/manager.hpp?rev=50933&r1=50932&r2=50933&view=diff
==============================================================================
--- trunk/src/whiteboard/manager.hpp (original)
+++ trunk/src/whiteboard/manager.hpp Sat Aug 27 01:44:19 2011
@@ -166,8 +166,8 @@
void validate_actions_if_needed();
/// Called by all of the save_***() methods after they have added their
action to the queue
void on_save_action(unit const* unit_with_plan) const;
- void update_plan_hiding(size_t viewing_team) const;
- void update_plan_hiding() const; //same as above, but uses
wb::viewer_team() as default argument
+ void update_plan_hiding(size_t viewing_team);
+ void update_plan_hiding(); //same as above, but uses wb::viewer_team()
as default argument
///Tracks whether the whiteboard is active.
bool active_;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits