← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/buildhelp_button_toggle into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/buildhelp_button_toggle into lp:widelands.

Commit message:
Made buildhelp button toggle its perm_pressed state again.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/buildhelp_button_toggle/+merge/306712

Stumbled upon another regression: When you hit the spacebar, the "Show Building Spaces" button doesn't show up as pressed.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/buildhelp_button_toggle into lp:widelands.
=== modified file 'src/editor/editorinteractive.cc'
--- src/editor/editorinteractive.cc	2016-08-04 15:49:05 +0000
+++ src/editor/editorinteractive.cc	2016-09-25 17:44:45 +0000
@@ -361,6 +361,10 @@
 		new EditorHelp(*this, helpmenu_, &egbase().lua());
 }
 
+void EditorInteractive::on_buildhelp_changed(const bool value) {
+	toggle_buildhelp_.set_perm_pressed(value);
+}
+
 bool EditorInteractive::handle_key(bool const down, SDL_Keysym const code) {
 	bool handled = InteractiveBase::handle_key(down, code);
 

=== modified file 'src/editor/editorinteractive.h'
--- src/editor/editorinteractive.h	2016-08-04 15:49:05 +0000
+++ src/editor/editorinteractive.h	2016-09-25 17:44:45 +0000
@@ -159,6 +159,7 @@
 	void toggle_mainmenu();
 	void toggle_playermenu();
 	void toggle_help();
+	void on_buildhelp_changed(const bool value) override;
 
 	//  state variables
 	bool need_save_;

=== modified file 'src/wui/interactive_base.cc'
--- src/wui/interactive_base.cc	2016-08-04 15:49:05 +0000
+++ src/wui/interactive_base.cc	2016-09-25 17:44:45 +0000
@@ -217,7 +217,7 @@
 }
 
 void InteractiveBase::toggle_buildhelp() {
-	field_overlay_manager_->show_buildhelp(!field_overlay_manager_->buildhelp());
+	show_buildhelp(!field_overlay_manager_->buildhelp());
 }
 
 void InteractiveBase::on_buildhelp_changed(bool /* value */) {


Follow ups