[Widelands-dev] [Merge] lp:~widelands-dev/widelands/animation_scaling into lp:widelands

2016-11-17 Thread bunnybot
Continuous integration builds have changed state:

Travis build 1623. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/176793249.
Appveyor build 1461. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_animation_scaling-1461.
-- 
https://code.launchpad.net/~widelands-dev/widelands/animation_scaling/+merge/310718
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/animation_scaling.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1426465-scenario-timings into lp:widelands

2016-11-17 Thread bunnybot
Continuous integration builds have changed state:

Travis build 1621. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/176654850.
Appveyor build 1459. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1426465_scenario_timings-1459.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1426465-scenario-timings/+merge/39
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1426465-scenario-timings into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/animation_scaling into lp:widelands

2016-11-17 Thread GunChleoc
Review: Resubmit

Refactoring done, please have another look.


- Moved all the sizing and positioning calculations into the animation class.
- get_width() and hotspot() are gone.
- get_height() is still used by the soldiers to position their health bar etc.
- We now have source_rectangle and destination_rectangle functions to get rid
  of the rendertarget reference in the animation class
- Killed some programming by exception
-- 
https://code.launchpad.net/~widelands-dev/widelands/animation_scaling/+merge/310718
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/animation_scaling.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/toolbar_cleanup into lp:widelands

2016-11-17 Thread bunnybot
Continuous integration builds have changed state:

Travis build 1620. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/176648416.
Appveyor build 1458. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_toolbar_cleanup-1458.
-- 
https://code.launchpad.net/~widelands-dev/widelands/toolbar_cleanup/+merge/35
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/toolbar_cleanup into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1426465-scenario-timings into lp:widelands

2016-11-17 Thread GunChleoc
GunChleoc has proposed merging 
lp:~widelands-dev/widelands/bug-1426465-scenario-timings into lp:widelands.

Commit message:
Tweaked timings in tutorials and scenarios:

- New function set_objective_done that adds a configurable sleep time
  when marking an objective as done
- Barbarian scenario 1: Shifted story messages back to reduce the barrage
  at the start of the scenario.
  Also, more felling axes to make clearing the trees easier.
- Atlantean scenario : Trigger warehouse objective earlier, so we can
  expand faster and have some horses ready when racing for the lake.
- Warfare Tutorial: Build trainingsites concurrently in order to save time.
- Economy tutorial: Sleep longer for the stock window.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1426465 in widelands: "Introduce delay between completion of an 
objective and the trigger of a dialog popup"
  https://bugs.launchpad.net/widelands/+bug/1426465
  Bug #1623996 in widelands: "Economy tutorial - sleep longer for the Stock"
  https://bugs.launchpad.net/widelands/+bug/1623996

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1426465-scenario-timings/+merge/39
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1426465-scenario-timings into lp:widelands.
=== modified file 'data/campaigns/atl01.wmf/scripting/mission_thread.lua'
--- data/campaigns/atl01.wmf/scripting/mission_thread.lua	2015-11-03 18:52:00 +
+++ data/campaigns/atl01.wmf/scripting/mission_thread.lua	2016-11-17 09:50:24 +
@@ -18,38 +18,45 @@
 end
 
 function build_warehouse_and_horsefarm()
-   local fields = {
+   -- Sleeps until one of the given fields is owned by p1.
+   local function wait_for_owns_a_field(fields)
+  local fowned = nil
+  while not fowned do
+ for idx, f in ipairs(fields) do
+if f.owner == p1 then
+   fowned = f
+   break
+end
+ end
+ sleep(5000)
+  end
+   end
+
+   wait_for_owns_a_field({
+  map:get_field(60, 139),
+  map:get_field(98, 128),
+  map:get_field(120, 126)
+   })
+
+   msg_boxes(horsefarm_and_warehouse_story)
+   local o = add_campaign_objective(obj_horsefarm_and_warehouse)
+   while not check_for_buildings(p1, {
+  atlanteans_horsefarm = 1,
+  atlanteans_warehouse = 1,
+   }) do sleep(2384) end
+   set_objective_done(o)
+
+   -- Now check if the water should rise
+   wait_for_owns_a_field({
   map:get_field(42, 88),
   map:get_field(64, 105),
   map:get_field(93, 89),
   map:get_field(90, 66),
-   }
+   })
 
-   local fowned = nil
-   while not fowned do
-  for idx, f in ipairs(fields) do
- if f.owner == p1 then
-fowned = f
-break
- end
-  end
-  sleep(3213)
-   end
-- Has been started from the very beginning
-   expand_objective.done = true
+   set_objective_done(expand_objective)
let_the_water_rise = true
-
-   local pts = wait_for_roadbuilding_and_scroll(fowned)
-   msg_boxes(horsefarm_and_warehouse_story)
-   -- Go back to where we were
-   timed_scroll(array_reverse(pts))
-
-   local o = add_campaign_objective(obj_horsefarm_and_warehouse)
-   while not check_for_buildings(p1, {
-  atlanteans_horsefarm = 1,
-  atlanteans_warehouse = 1,
-   }) do sleep(2384) end
-   o.done = true
 end
 
 function build_training()
@@ -60,7 +67,7 @@
   atlanteans_dungeon = 1,
   atlanteans_labyrinth = 1
}) do sleep(3874) end
-   o.done = true
+   set_objective_done(o)
 
msg_boxes(training_story_end)
 end
@@ -79,7 +86,7 @@
   atlanteans_armorsmithy = 1,
   atlanteans_toolsmithy = 1,
}) do sleep(3478) end
-   o.done = true
+   set_objective_done(o)
 
sleep(15 * 60 * 1000) -- sleep a while
run(build_training)
@@ -105,7 +112,7 @@
   atlanteans_fishbreeders_house = 1,
   atlanteans_smokery = 2,
}) do sleep(2789) end
-   o.done = true
+   set_objective_done(o)
 
msg_boxes(food_story_ended_messages)
 end
@@ -122,7 +129,7 @@
   atlanteans_gold_spinning_mill = 1,
   atlanteans_weaving_mill = 1
}) do sleep(6273) end
-   o.done = true
+   set_objective_done(o)
 
msg_boxes(spidercloth_story_ended_messages)
 
@@ -140,7 +147,7 @@
   atlanteans_quarry = 1,
   atlanteans_sawmill = 1,
}) do sleep(3731) end
-   o.done = true
+   set_objective_done(o)
 
run(make_spidercloth_production)
 

=== modified file 'data/campaigns/bar01.wmf/scripting/mission_thread.lua'
--- data/campaigns/bar01.wmf/scripting/mission_thread.lua	2016-01-28 05:24:34 +
+++ data/campaigns/bar01.wmf/scripting/mission_thread.lua	2016-11-17 09:50:24 +
@@ -24,26 +24,31 @@
plr:reveal_fields(al_thunran:region(8))
message_box_objective(plr, briefing_msg_02) -- Al'thunran
plr:reveal_fields(grave:region(4))
-   message_box_objective(plr, briefing_msg_03) -- grave
-   message_box_objective(plr, 

[Widelands-dev] [Merge] lp:~widelands-dev/widelands/toolbar_cleanup into lp:widelands

2016-11-17 Thread GunChleoc
The proposal to merge lp:~widelands-dev/widelands/toolbar_cleanup into 
lp:widelands has been updated.

Commit Message changed to:

Replaced repetitive toolbar button hook macros with a common function 
'add_toolbar_button'. UniqueWindows can have a button assigned to them that 
will be permpressed/not permpressed depending on whether the window is open. 
Redesigned GameStatisticsMenu to use those new functions as well.

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/toolbar_cleanup/+merge/35
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/toolbar_cleanup into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-863185-census-on-destroyed-building into lp:widelands

2016-11-17 Thread GunChleoc
Review: Resubmit

Next try.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-863185-census-on-destroyed-building/+merge/309818
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-863185-census-on-destroyed-building.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/toolbar_cleanup into lp:widelands

2016-11-17 Thread GunChleoc
GunChleoc has proposed merging lp:~widelands-dev/widelands/toolbar_cleanup into 
lp:widelands.

Commit message:
Replaced repetitive toolbar button hook macros with a common function 
'add_toolbar_button'. UniqueWindows can have a button assigned to them that 
will be permpressed/not permpressed depending on whether the window is open.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/toolbar_cleanup/+merge/35
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/toolbar_cleanup into lp:widelands.
=== modified file 'src/editor/editorinteractive.cc'
--- src/editor/editorinteractive.cc	2016-11-03 07:20:57 +
+++ src/editor/editorinteractive.cc	2016-11-17 08:27:19 +
@@ -93,56 +93,47 @@
  realtime_(SDL_GetTicks()),
  is_painting_(false),
  tools_(new Tools()),
- history_(new EditorHistory(undo_, redo_)),
-
-#define INIT_BUTTON(image, name, tooltip)  \
-	TOOLBAR_BUTTON_COMMON_PARAMETERS(name), g_gr->images().get(image), tooltip
-
- toggle_main_menu_(
-INIT_BUTTON("images/wui/menus/menu_toggle_menu.png", "menu", _("Main Menu"))),
- toggle_tool_menu_(
-INIT_BUTTON("images/wui/editor/editor_menu_toggle_tool_menu.png", "tools", _("Tools"))),
- toggle_toolsize_menu_(INIT_BUTTON(
-"images/wui/editor/editor_menu_set_toolsize_menu.png", "toolsize", _("Tool Size"))),
- toggle_minimap_(
-INIT_BUTTON("images/wui/menus/menu_toggle_minimap.png", "minimap", _("Minimap"))),
- toggle_buildhelp_(INIT_BUTTON("images/wui/menus/menu_toggle_buildhelp.png",
-   "buildhelp",
-   _("Show Building Spaces (on/off)"))),
- reset_zoom_(
-INIT_BUTTON("images/wui/menus/menu_reset_zoom.png", "reset_zoom", _("Reset zoom"))),
- toggle_player_menu_(
-INIT_BUTTON("images/wui/editor/editor_menu_player_menu.png", "players", _("Players"))),
- undo_(INIT_BUTTON("images/wui/editor/editor_undo.png", "undo", _("Undo"))),
- redo_(INIT_BUTTON("images/wui/editor/editor_redo.png", "redo", _("Redo"))),
- toggle_help_(INIT_BUTTON("images/ui_basic/menu_help.png", "help", _("Help"))) {
-	toggle_main_menu_.sigclicked.connect(boost::bind(::toggle_mainmenu, this));
-	toggle_tool_menu_.sigclicked.connect(boost::bind(::tool_menu_btn, this));
-	toggle_toolsize_menu_.sigclicked.connect(
-	   boost::bind(::toolsize_menu_btn, this));
-	toggle_minimap_.sigclicked.connect(boost::bind(::toggle_minimap, this));
-	toggle_buildhelp_.sigclicked.connect(boost::bind(::toggle_buildhelp, this));
-	reset_zoom_.sigclicked.connect(
-	   [this] { zoom_around(1.f, Vector2f(get_w() / 2.f, get_h() / 2.f)); });
-	toggle_player_menu_.sigclicked.connect(boost::bind(::toggle_playermenu, this));
-	undo_.sigclicked.connect([this] { history_->undo_action(egbase().world()); });
-	redo_.sigclicked.connect([this] { history_->redo_action(egbase().world()); });
-	toggle_help_.sigclicked.connect(boost::bind(::toggle_help, this));
-
-	toolbar_.set_layout_toplevel(true);
-	toolbar_.add(_main_menu_, UI::Align::kLeft);
-	toolbar_.add(_tool_menu_, UI::Align::kLeft);
-	toolbar_.add(_toolsize_menu_, UI::Align::kLeft);
-	toolbar_.add(_player_menu_, UI::Align::kLeft);
-	toolbar_.add_space(15);
-	toolbar_.add(_minimap_, UI::Align::kLeft);
-	toolbar_.add(_buildhelp_, UI::Align::kLeft);
-	toolbar_.add(_zoom_, UI::Align::kLeft);
-	toolbar_.add_space(15);
-	toolbar_.add(_, UI::Align::kLeft);
-	toolbar_.add(_, UI::Align::kLeft);
-	toolbar_.add_space(15);
-	toolbar_.add(_help_, UI::Align::kLeft);
+ history_(new EditorHistory(*undo_, *redo_)) {
+	add_toolbar_button("wui/menus/menu_toggle_menu", "menu", _("Main Menu"), _, true);
+	mainmenu_.open_window = [this] { new EditorMainMenu(*this, mainmenu_); };
+
+	add_toolbar_button(
+	   "wui/editor/editor_menu_toggle_tool_menu", "tools", _("Tools"), _, true);
+	toolmenu_.open_window = [this] { new EditorToolMenu(*this, toolmenu_); };
+
+	add_toolbar_button(
+	   "wui/editor/editor_menu_set_toolsize_menu", "toolsize", _("Tool Size"), _, true);
+	toolsizemenu_.open_window = [this] { new EditorToolsizeMenu(*this, toolsizemenu_); };
+
+	add_toolbar_button(
+	   "wui/menus/menu_toggle_minimap", "minimap", _("Minimap"), _registry(), true);
+	minimap_registry().open_window = [this] { toggle_minimap(); };
+
+	toggle_buildhelp_ = add_toolbar_button(
+	   "wui/menus/menu_toggle_buildhelp", "buildhelp", _("Show Building Spaces (on/off)"));
+	toggle_buildhelp_->sigclicked.connect(boost::bind(::toggle_buildhelp, this));
+
+	reset_zoom_ = add_toolbar_button(
+		"wui/menus/menu_reset_zoom", "reset_zoom", _("Reset zoom"));
+	reset_zoom_->sigclicked.connect(
+		[this] { zoom_around(1.f, Vector2f(get_w() / 2.f, get_h() / 2.f)); });
+
+	add_toolbar_button(
+	   "wui/editor/editor_menu_player_menu", "players",