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

Proposed by hessenfarmer
Status: Merged
Merged at revision: 9089
Proposed branch: lp:~widelands-dev/widelands/bugfix-buildings-tooltips
Merge into: lp:widelands
Diff against target: 38 lines (+9/-1)
2 files modified
src/logic/map_objects/tribes/production_program.cc (+3/-0)
src/logic/map_objects/tribes/worker.cc (+6/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bugfix-buildings-tooltips
Reviewer Review Type Date Requested Status
Toni Förster played Approve
GunChleoc Approve
Review via email: mp+366607@code.launchpad.net

Commit message

Fixes various bugs with buildings tooltips

Description of the change

For lumberjacks, scouts and trainingsites tooltips are now cleared if building starts working again.
Trainingsites now show completed messages

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 4823. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/525342093.
Appveyor build 4604. State: failed. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bugfix_buildings_tooltips-4604.

Revision history for this message
GunChleoc (gunchleoc) wrote :

1 nit, not tested yet.

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

Ok adrresed code review. However .c_str() did not compile so I stood with .str() which works fine.

Have tested this and added a translators hint.

Revision history for this message
GunChleoc (gunchleoc) wrote :

I overlooked that you were using boost::format, so c_str() is not necessary.

So, code LGTM now :)

review: Approve
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 4829. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/525646461.
Appveyor build 4610. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bugfix_buildings_tooltips-4610.

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

Thanks for the review. I would wait for an independent test review, unless you decide to already have it relying on my own testing

Revision history for this message
Toni Förster (stonerl) wrote :

Can confirm that it is working.

Just one addition. In case of the Mines, the message "Main coal/gold/iron vein exhausted" should have the highest priority. If the vein is exhausted and no ration/snack/meal is available. The message for exhausted veins should not be replaced by the no food message.

Shall I open another bugreport for this?

review: Approve (played)
Revision history for this message
hessenfarmer (stephan-lutz) wrote :

I think I have seen already an old bugreport for this (the mines) lately. So you could search the bugs and promote this old one for b21 instead.

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

As the fix for the mines messages is more complex I'd like to have this one first.

@bunnybot merge

Revision history for this message
bunnybot (widelandsofficial) wrote :

Refusing to merge, since Travis is not green. Use @bunnybot merge force for merging anyways.

Travis build 4829. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/525646461.

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

the inputqueues test again (gcc4.8 debug this time)

@bunnybot merge force

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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-28 14:59:09 +0000
@@ -1415,6 +1415,9 @@
1415 throw wexception("Fail training soldier!!");1415 throw wexception("Fail training soldier!!");
1416 }1416 }
1417 ps.molog(" Training done!\n");1417 ps.molog(" Training done!\n");
1418 /** TRANSLATORS: Success message of a trainingsite ‘%s’ stands for the description of the training program */
1419 /** e.g. Completed upgrading soldier evade from level 0 to level 1 */
1420 ps.set_production_result((boost::format(_("Completed %s")) % ps.top_state().program->descname()).str());
14181421
1419 upcast(TrainingSite, ts, &ps);1422 upcast(TrainingSite, ts, &ps);
1420 ts->training_successful(attribute, level);1423 ts->training_successful(attribute, level);
14211424
=== 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-28 14:59:09 +0000
@@ -340,6 +340,9 @@
340 return true;340 return true;
341 }341 }
342 if (action.sparam1 == "immovable") {342 if (action.sparam1 == "immovable") {
343 if (upcast(ProductionSite, productionsite, get_location(game))) {
344 productionsite->unnotify_player();
345 }
343 std::vector<ImmovableFound> list;346 std::vector<ImmovableFound> list;
344 if (action.iparam2 < 0)347 if (action.iparam2 < 0)
345 map.find_reachable_immovables(area, &list, cstep);348 map.find_reachable_immovables(area, &list, cstep);
@@ -2639,7 +2642,9 @@
2639 */2642 */
2640bool Worker::run_scout(Game& game, State& state, const Action& action) {2643bool Worker::run_scout(Game& game, State& state, const Action& action) {
2641 molog(" Try scouting for %i ms with search in radius of %i\n", action.iparam2, action.iparam1);2644 molog(" Try scouting for %i ms with search in radius of %i\n", action.iparam2, action.iparam1);
26422645 if (upcast(ProductionSite, productionsite, get_location(game))) {
2646 productionsite->unnotify_player();
2647 }
2643 ++state.ivar1;2648 ++state.ivar1;
2644 start_task_scout(game, action.iparam1, action.iparam2);2649 start_task_scout(game, action.iparam1, action.iparam2);
2645 // state reference may be invalid now2650 // state reference may be invalid now

Subscribers

People subscribed via source and target branches

to status/vote changes: