← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bugfix-buildings-tooltips into lp:widelands

 

hessenfarmer has proposed merging lp:~widelands-dev/widelands/bugfix-buildings-tooltips into lp:widelands.

Commit message:
Fixes various bugs with buildings tooltips

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1374738 in widelands: "Training sites show misleading tooltip"
  https://bugs.launchpad.net/widelands/+bug/1374738
  Bug #1493452 in widelands: ""Completed" messages don't show in trainingsites"
  https://bugs.launchpad.net/widelands/+bug/1493452
  Bug #1627326 in widelands: ""out of trees" message doesn't disappear"
  https://bugs.launchpad.net/widelands/+bug/1627326
  Bug #1790542 in widelands: "Buildings' tooltips not updated"
  https://bugs.launchpad.net/widelands/+bug/1790542

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bugfix-buildings-tooltips/+merge/366607

For lumberjacks, scouts and trainingsites tooltips are now cleared if building starts working again.
Trainingsites now show completed messages
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bugfix-buildings-tooltips into lp:widelands.
=== modified file 'src/logic/map_objects/tribes/production_program.cc'
--- src/logic/map_objects/tribes/production_program.cc	2019-04-24 06:01:37 +0000
+++ src/logic/map_objects/tribes/production_program.cc	2019-04-27 13:34:24 +0000
@@ -1415,6 +1415,7 @@
 		throw wexception("Fail training soldier!!");
 	}
 	ps.molog("  Training done!\n");
+	ps.set_production_result((boost::format(_("Completed %u")) % ps.top_state().program->descname()).str());
 
 	upcast(TrainingSite, ts, &ps);
 	ts->training_successful(attribute, level);

=== modified file 'src/logic/map_objects/tribes/worker.cc'
--- src/logic/map_objects/tribes/worker.cc	2019-04-24 06:01:37 +0000
+++ src/logic/map_objects/tribes/worker.cc	2019-04-27 13:34:24 +0000
@@ -340,6 +340,9 @@
 			return true;
 		}
 		if (action.sparam1 == "immovable") {
+			if (upcast(ProductionSite, productionsite, get_location(game))) {
+				productionsite->unnotify_player();
+			}
 			std::vector<ImmovableFound> list;
 			if (action.iparam2 < 0)
 				map.find_reachable_immovables(area, &list, cstep);
@@ -2639,7 +2642,9 @@
  */
 bool Worker::run_scout(Game& game, State& state, const Action& action) {
 	molog("  Try scouting for %i ms with search in radius of %i\n", action.iparam2, action.iparam1);
-
+	if (upcast(ProductionSite, productionsite, get_location(game))) {
+		productionsite->unnotify_player();
+	}
 	++state.ivar1;
 	start_task_scout(game, action.iparam1, action.iparam2);
 	// state reference may be invalid now


Follow ups