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

2019-08-13 Thread GunChleoc
Review: Approve

LGTM :)

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/371171
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/workarea-fixes.

___
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/workarea-fixes into lp:widelands

2019-08-11 Thread Benedikt Straub
Benedikt Straub has proposed merging lp:~widelands-dev/widelands/workarea-fixes 
into lp:widelands.

Commit message:
Fix workarea layers getting stuck by always hiding them when the building 
window closes or warps

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1830345 in widelands: "overlapping workareas are very performance hungry"
  https://bugs.launchpad.net/widelands/+bug/1830345
  Bug #1830647 in widelands: "Indicate workarea border more clearly"
  https://bugs.launchpad.net/widelands/+bug/1830647
  Bug #1839690 in widelands: "Construction site work area overlay becomes stuck"
  https://bugs.launchpad.net/widelands/+bug/1839690

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/371171
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes into lp:widelands.
=== modified file 'src/wui/buildingwindow.cc'
--- src/wui/buildingwindow.cc	2019-08-10 16:38:15 +
+++ src/wui/buildingwindow.cc	2019-08-11 16:01:24 +
@@ -58,7 +58,6 @@
  building_position_(b.get_position()),
  showing_workarea_(false),
  avoid_fastclick_(avoid_fastclick),
- is_warping_(false),
  expeditionbtn_(nullptr) {
 	buildingnotes_subscriber_ = Notifications::subscribe(
 	   [this](const Widelands::NoteBuilding& note) { on_building_note(note); });
@@ -72,10 +71,8 @@
 }
 
 BuildingWindow::~BuildingWindow() {
-	if (!is_warping_) {
-		// Accessing the toggle_workarea_ button can cause segfaults, so we leave it alone
-		hide_workarea(false);
-	}
+	// Accessing the toggle_workarea_ button can cause segfaults, so we leave it alone
+	hide_workarea(false);
 }
 
 void BuildingWindow::on_building_note(const Widelands::NoteBuilding& note) {
@@ -90,7 +87,6 @@
 		// The building is no more. Next think() will call die().
 		case Widelands::NoteBuilding::Action::kStartWarp:
 			igbase()->add_wanted_building_window(building_position_, get_pos(), is_minimal());
-			is_warping_ = true;
 			break;
 		default:
 			break;

=== modified file 'src/wui/buildingwindow.h'
--- src/wui/buildingwindow.h	2019-05-25 12:21:14 +
+++ src/wui/buildingwindow.h	2019-08-11 16:01:24 +
@@ -135,8 +135,6 @@
 
 	bool showing_workarea_;
 	bool avoid_fastclick_;
-	// The building is being transformed from a contructionsite to a finished building etc.
-	bool is_warping_;
 
 	UI::Button* expeditionbtn_;
 	std::unique_ptr>

___
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/workarea-fixes into lp:widelands

2019-06-23 Thread Benedikt Straub
inputqueues

@bunnybot merge force
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/workarea-fixes.

___
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/workarea-fixes into lp:widelands

2019-06-23 Thread bunnybot
Refusing to merge, since Travis is not green. Use @bunnybot merge force for 
merging anyways.

Travis build 5211. State: errored. Details: 
https://travis-ci.org/widelands/widelands/builds/548652135.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/workarea-fixes.

___
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/workarea-fixes into lp:widelands

2019-06-23 Thread GunChleoc
Review: Approve

Retested and still working :)

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/workarea-fixes.

___
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/workarea-fixes into lp:widelands

2019-06-21 Thread bunnybot
Continuous integration builds have changed state:

Travis build 5211. State: errored. Details: 
https://travis-ci.org/widelands/widelands/builds/548652135.
Appveyor build 4990. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_workarea_fixes-4990.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-05 Thread GunChleoc
The proposal to merge lp:~widelands-dev/widelands/workarea-fixes into 
lp:widelands has been updated.

Commit message changed to:

- Highlight the buildings the overlapping workareas belong to
- Fix behaviour of the W hotkey
- Show productionsite overlaps only for certain building types
  of interest

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-05 Thread GunChleoc
Sorry for the comment spam tested and working nicely. I am also happy with 
the colors and borders :)
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-05 Thread GunChleoc
2 comments for code readability

Diff comments:

> 
> === modified file 'src/logic/map_objects/tribes/tribes.cc'
> --- src/logic/map_objects/tribes/tribes.cc2019-05-29 06:24:42 +
> +++ src/logic/map_objects/tribes/tribes.cc2019-06-05 14:12:33 +
> @@ -335,6 +335,21 @@
>   for (const auto& job : de->working_positions()) {
>   
> workers_->get_mutable(job.first)->add_employer(i);
>   }
> +
> + for (const auto& pair : 
> de->get_highlight_overlapping_workarea_for()) {

Please add a comment above this loop to describe what it's for.

> + const DescriptionIndex di = 
> safe_building_index(pair.first);
> + if (upcast(const ProductionSiteDescr, p, 
> get_building_descr(di))) {
> + if (!p->workarea_info().empty()) {
> + continue;
> + }
> + throw GameDataError(
> + "Productionsite %s will 
> inform about conflicting building %s which doesn’t have a workarea",
> + de->name().c_str(), 
> pair.first.c_str());
> + }
> + throw GameDataError(
> + "Productionsite %s will inform 
> about conflicting building %s which is not a productionsite",
> + de->name().c_str(), 
> pair.first.c_str());
> + }
>   }
>  
>   // Register which buildings buildings can have been enhanced 
> from
> 
> === modified file 'src/wui/fieldaction.cc'
> --- src/wui/fieldaction.cc2019-05-31 19:31:45 +
> +++ src/wui/fieldaction.cc2019-06-05 14:12:33 +
> @@ -768,11 +779,14 @@
>   continue;
>   }
>   const Widelands::BuildingDescr* d = 
> nullptr;
> + bool positive;

Turn this into bool& again and then pass bool* to the functions. This will make 
the code easier to read.

>   if (imm_type == 
> Widelands::MapObjectType::CONSTRUCTIONSITE) {
>   
> upcast(Widelands::ConstructionSite, cs, imm);
>   d = cs->get_info().becomes;
>   if ((descr.type() == 
> Widelands::MapObjectType::PRODUCTIONSITE &&
> -  d->type() != 
> Widelands::MapObjectType::PRODUCTIONSITE) ||
> +  (d->type() != 
> Widelands::MapObjectType::PRODUCTIONSITE ||
> +  !dynamic_cast Widelands::ProductionSiteDescr&>(descr).
> + 
> highlight_overlapping_workarea_for(d->name(), positive))) ||
>   ((descr.type() == 
> Widelands::MapObjectType::MILITARYSITE ||
> descr.type() == 
> Widelands::MapObjectType::WAREHOUSE) &&
>                imm_type != 
> Widelands::MapObjectType::MILITARYSITE &&


-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-05 Thread GunChleoc
Don't worry, kaputtnik, we can't always agree on everything and your opinion is 
just as valid as everybody else's
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-05 Thread bunnybot
Continuous integration builds have changed state:

Travis build 5157. State: errored. Details: 
https://travis-ci.org/widelands/widelands/builds/541797771.
Appveyor build 4939. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_workarea_fixes-4939.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-05 Thread kaputtnik
ok, ok :-)

Sorry for the noise. Will be quiet now.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-05 Thread GunChleoc
OK, Lua entries it is.

And I am in favor of this feature too - it will come in handy, especially for 
less-experienced players.

I think we could have an explanation in the basic control tutorial, after the 
quarries have been placed and before messages get introduced. Don't do this in 
trunk or in this branch though, because I have a merge request open that 
introduces big changes to the tutorial code, and the merge conflicts would be 
eek.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-05 Thread hessenfarmer
It was definitely wanted by more then one player. 

I like it too. Especially if it shows good or bad coverage. 

I think the basic tutorial should bhe the place to explain this as early as 
possible, cause it will be already there.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-05 Thread Benedikt Straub
Good idea, will implement that :)


> On the other side: Is it worth the work for a feature
> - which is hard to explain

I can just add an explanation in a tutorial. Would the economy tut or bar01 be 
the better place for it?

> - which was wanted by a single player

I would not have implemented it so soon if I didn´t want it as well… ;)

> - were other players know how to handle the 'problem' without this feature

…by clicking a dozen times and still overlooking something. I like this feature 
better than that ;)
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-05 Thread hessenfarmer
Definitions look good from my side so far. 
one additional question / demand?

Would it be possible to distinguish between wanted overlaps (e.g. forester and 
lumberjack shown in greenish colour) and unwanted overlaps (e.g. farm and 
forester shown in red shadows)


-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-05 Thread Benedikt Straub
> Hm on second thought - the beekeeper -> fields rule might be actually covered 
> by rule 4

The farm plants only barley_field_tiny, but the flowering attrib belongs to 
barley_field_medium. We would have to check not only whether they plant 
the same attrib, but also whether one plants something that turns into 
something that turns into something … that has the attrib the other collects.

Since it´s only a few entries per building, that would be much more effort than 
doing it in Lua…
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-05 Thread GunChleoc
Hm on second thought - the beekeeper -> fields rule might be actually covered 
by rule 4, so that would be an argument in favor of the rule-based approach, 
because we already found a bug in this branch ;)
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-05 Thread kaputtnik
While i am not convinced by this feature at all, i agree with Gun. The lua 
files are already full of tables and options, which make it hard to understand 
for beginners (modders).

On the other side: Is it worth the work for a feature

- which is hard to explain
- which was wanted by a single player
- were other players know how to handle the 'problem' without this feature

-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-05 Thread GunChleoc
As pointed out by hessenfarmer in 
https://bugs.launchpad.net/widelands/+bug/1830345/comments/17, The beekeeper 
would be interested in farms and berries too. So, let's keep the Lua design and 
add those to the building. A rule-based approach would get very complicated 
with that.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-04 Thread bunnybot
Continuous integration builds have changed state:

Travis build 5150. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/541329085.
Appveyor build 4932. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_workarea_fixes-4932.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-04 Thread GunChleoc
I'm still in favor of deducing these in the engine so that we won't need to 
maintain these Lua definitions, which will be prone to bugs.

Criteria could be:

1. If both buildings mine the same resource
2. If both buildings plant an immovable
3. If both buildings collect an immovable
4. If one building plants an immovable and the other collects it and it is the 
same attrib
5. If both buildings plant or collect the same bob attrib

If we want to go this route, we will need to base it off 
https://code.launchpad.net/~widelands-dev/widelands/unify-program-parsers/+merge/367936
 in order not to get merge conflicts.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-06-04 Thread Benedikt Straub
Benedikt Straub has proposed merging lp:~widelands-dev/widelands/workarea-fixes 
into lp:widelands.

Commit message:
– Highlight the buildings the overlapping workareas belong to
– Fix behaviour of the W hotkey
– Show productionsite overlaps only for certain building types of interest

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1830345 in widelands: "overlapping workareas are very performance hungry"
  https://bugs.launchpad.net/widelands/+bug/1830345
  Bug #1830647 in widelands: "Indicate workarea border more clearly"
  https://bugs.launchpad.net/widelands/+bug/1830647

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368342
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes into lp:widelands.
=== modified file 'data/tribes/buildings/productionsites/atlanteans/armorsmithy/init.lua'
--- data/tribes/buildings/productionsites/atlanteans/armorsmithy/init.lua	2018-09-12 03:04:08 +
+++ data/tribes/buildings/productionsites/atlanteans/armorsmithy/init.lua	2019-06-04 16:05:14 +
@@ -55,6 +55,13 @@
 --done, including any animations and sounds played.
 --See :doc:`productionsite_program`.
 --
+--**indicate_workarea_overlaps**
+--*Optional*. The names of other productionsites whose workareas should be highlighted
+--if theirs overlap with this building’s workarea while the player is placing a
+--building of this type e.g.::
+--
+--indicate_workarea_overlaps = { "atlanteans_farm", "atlanteans_blackroot_farm" },
+--
 --**out_of_resource_notification**.
 --*Optional*. This table defines the message sent by the productionsite
 --to the player if it has run out of a resource to collect. There are 4

=== modified file 'data/tribes/buildings/productionsites/atlanteans/blackroot_farm/init.lua'
--- data/tribes/buildings/productionsites/atlanteans/blackroot_farm/init.lua	2019-05-31 12:56:36 +
+++ data/tribes/buildings/productionsites/atlanteans/blackroot_farm/init.lua	2019-06-04 16:05:14 +
@@ -42,6 +42,12 @@
   "blackroot"
},
 
+   indicate_workarea_overlaps = {
+  "atlanteans_blackroot_farm",
+  "atlanteans_farm",
+  "atlanteans_foresters_house",
+   },
+
programs = {
   work = {
  -- TRANSLATORS: Completed/Skipped/Did not start working because ...

=== modified file 'data/tribes/buildings/productionsites/atlanteans/coalmine/init.lua'
--- data/tribes/buildings/productionsites/atlanteans/coalmine/init.lua	2019-05-29 18:29:28 +
+++ data/tribes/buildings/productionsites/atlanteans/coalmine/init.lua	2019-06-04 16:05:14 +
@@ -43,6 +43,10 @@
   atlanteans_miner = 3
},
 
+   indicate_workarea_overlaps = {
+  "atlanteans_coalmine",
+   },
+
inputs = {
   { name = "smoked_fish", amount = 10 },
   { name = "smoked_meat", amount = 6 },

=== modified file 'data/tribes/buildings/productionsites/atlanteans/crystalmine/init.lua'
--- data/tribes/buildings/productionsites/atlanteans/crystalmine/init.lua	2019-05-29 18:29:28 +
+++ data/tribes/buildings/productionsites/atlanteans/crystalmine/init.lua	2019-06-04 16:05:14 +
@@ -55,6 +55,10 @@
   "granite"
},
 
+   indicate_workarea_overlaps = {
+  "atlanteans_crystalmine",
+   },
+
programs = {
   work = {
  -- TRANSLATORS: Completed/Skipped/Did not start working because ...

=== modified file 'data/tribes/buildings/productionsites/atlanteans/farm/init.lua'
--- data/tribes/buildings/productionsites/atlanteans/farm/init.lua	2019-05-31 12:56:36 +
+++ data/tribes/buildings/productionsites/atlanteans/farm/init.lua	2019-06-04 16:05:14 +
@@ -46,6 +46,12 @@
   "corn"
},
 
+   indicate_workarea_overlaps = {
+  "atlanteans_blackroot_farm",
+  "atlanteans_farm",
+  "atlanteans_foresters_house",
+   },
+
programs = {
   work = {
  -- TRANSLATORS: Completed/Skipped/Did not start working because ...

=== modified file 'data/tribes/buildings/productionsites/atlanteans/fishbreeders_house/init.lua'
--- data/tribes/buildings/productionsites/atlanteans/fishbreeders_house/init.lua	2019-05-29 18:29:28 +
+++ data/tribes/buildings/productionsites/atlanteans/fishbreeders_house/init.lua	2019-06-04 16:05:14 +
@@ -47,6 +47,11 @@
   },
},
 
+   indicate_workarea_overlaps = {
+  "atlanteans_fishers_house",
+  "atlanteans_fishbreeders_house",
+   },
+
out_of_resource_notification = {
   -- Translators: Short for "Out of ..." for a resource
   title = _"No Fish",

=== modified file 'data/tribes/buildings/productionsites/atlanteans/fishers_house/init.lua'
--- data/tribes/buildings

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

2019-05-31 Thread noreply
The proposal to merge lp:~widelands-dev/widelands/workarea-fixes into 
lp:widelands has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368083
-- 
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/workarea-fixes.

___
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/workarea-fixes into lp:widelands

2019-05-31 Thread Benedikt Straub
This time it´s just the inputqueues

@bunnybot merge force
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368083
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/workarea-fixes.

___
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/workarea-fixes into lp:widelands

2019-05-31 Thread bunnybot
Refusing to merge, since Travis is not green. Use @bunnybot merge force for 
merging anyways.

Travis build 5105. State: errored. Details: 
https://travis-ci.org/widelands/widelands/builds/539671778.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368083
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/workarea-fixes.

___
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/workarea-fixes into lp:widelands

2019-05-31 Thread bunnybot
Continuous integration builds have changed state:

Travis build 5105. State: errored. Details: 
https://travis-ci.org/widelands/widelands/builds/539671778.
Appveyor build 4886. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_workarea_fixes-4886.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368083
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/workarea-fixes.

___
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/workarea-fixes into lp:widelands

2019-05-31 Thread Benedikt Straub
@bunnybot merge

-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368083
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/workarea-fixes.

___
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/workarea-fixes into lp:widelands

2019-05-31 Thread bunnybot
Refusing to merge, since Travis is not green. Use @bunnybot merge force for 
merging anyways.

Travis build 5102. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/539598587.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368083
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/workarea-fixes.

___
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/workarea-fixes into lp:widelands

2019-05-31 Thread Benedikt Straub
@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368083
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/workarea-fixes.

___
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/workarea-fixes into lp:widelands

2019-05-30 Thread bunnybot
Continuous integration builds have changed state:

Travis build 5100. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/539371759.
Appveyor build 4881. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_workarea_fixes-4881.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368083
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/workarea-fixes.

___
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/workarea-fixes into lp:widelands

2019-05-30 Thread bunnybot
Refusing to merge, since Travis is not green. Use @bunnybot merge force for 
merging anyways.

Travis build 5100. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/539371759.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368083
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/workarea-fixes.

___
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/workarea-fixes into lp:widelands

2019-05-30 Thread GunChleoc
Review: Approve

:P

Looks good though :)

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368083
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/workarea-fixes.

___
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/workarea-fixes into lp:widelands

2019-05-30 Thread Benedikt Straub
Done. The diff is now almost 50% longer :P
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368083
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-05-30 Thread GunChleoc
Code LGTM and it's all working well :)

Could you make the surrounding line thicker? It's too thin to be noticeable, 
really.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368083
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-05-29 Thread bunnybot
Continuous integration builds have changed state:

Travis build 5087. State: errored. Details: 
https://travis-ci.org/widelands/widelands/builds/538879884.
Appveyor build 4867. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_workarea_fixes-4867.
-- 
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368083
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes 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/workarea-fixes into lp:widelands

2019-05-29 Thread Benedikt Straub
Benedikt Straub has proposed merging lp:~widelands-dev/widelands/workarea-fixes 
into lp:widelands.

Commit message:
· Draw a narrow border around workareas for better visibility
· Improve performance by only recalculating the workarea shader data when needed
· Add the hotkey W to enable/disable highlighting workarea overlaps

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1830345 in widelands: "overlapping workareas are very performance hungry"
  https://bugs.launchpad.net/widelands/+bug/1830345
  Bug #1830647 in widelands: "Indicate workarea border more clearly"
  https://bugs.launchpad.net/widelands/+bug/1830647

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/workarea-fixes/+merge/368083
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/workarea-fixes into lp:widelands.
=== added file 'data/images/wui/fieldaction/menu_show_workarea_overlap.png'
Binary files data/images/wui/fieldaction/menu_show_workarea_overlap.png	1970-01-01 00:00:00 + and data/images/wui/fieldaction/menu_show_workarea_overlap.png	2019-05-29 18:00:02 + differ
=== modified file 'src/graphic/gl/fields_to_draw.h'
--- src/graphic/gl/fields_to_draw.h	2019-02-27 19:00:36 +
+++ src/graphic/gl/fields_to_draw.h	2019-05-29 18:00:02 +
@@ -96,7 +96,6 @@
 		return _[index];
 	}
 
-private:
 	// Calculates the index of the given field with ('fx', 'fy') being geometric
 	// coordinates in the map. Returns INVALID_INDEX if this field is not in the
 	// fields_to_draw.
@@ -112,6 +111,7 @@
 		return yidx * w_ + xidx;
 	}
 
+private:
 	// Minimum and maximum field coordinates (geometric) to render. Can be negative.
 	int min_fx_ = 0;
 	int max_fx_ = 0;

=== modified file 'src/graphic/gl/workarea_program.cc'
--- src/graphic/gl/workarea_program.cc	2019-05-17 07:13:04 +
+++ src/graphic/gl/workarea_program.cc	2019-05-29 18:00:02 +
@@ -24,7 +24,8 @@
 #include "graphic/gl/utils.h"
 #include "graphic/texture.h"
 
-WorkareaProgram::WorkareaProgram() {
+WorkareaProgram::WorkareaProgram()
+	: cache_(nullptr) {
 	gl_program_.build("workarea");
 
 	attr_position_ = glGetAttribLocation(gl_program_.object(), "attr_position");
@@ -36,22 +37,32 @@
 void WorkareaProgram::gl_draw(int gl_texture, float z_value) {
 	glUseProgram(gl_program_.object());
 
-	auto& gl_state = Gl::State::instance();
-	gl_state.enable_vertex_attrib_array({attr_position_, attr_overlay_});
-
-	gl_array_buffer_.bind();
-	gl_array_buffer_.update(vertices_);
-
-	Gl::vertex_attrib_pointer(
-	   attr_position_, 2, sizeof(PerVertexData), offsetof(PerVertexData, gl_x));
-	Gl::vertex_attrib_pointer(
-	   attr_overlay_, 4, sizeof(PerVertexData), offsetof(PerVertexData, overlay_r));
-
-	gl_state.bind(GL_TEXTURE0, gl_texture);
-
-	glUniform1f(u_z_value_, z_value);
-
-	glDrawArrays(GL_TRIANGLES, 0, vertices_.size());
+	{
+		auto& gl_state = Gl::State::instance();
+		gl_state.enable_vertex_attrib_array({attr_position_, attr_overlay_});
+		gl_array_buffer_.bind();
+		gl_array_buffer_.update(vertices_);
+		Gl::vertex_attrib_pointer(
+		   attr_position_, 2, sizeof(PerVertexData), offsetof(PerVertexData, gl_x));
+		Gl::vertex_attrib_pointer(
+		   attr_overlay_, 4, sizeof(PerVertexData), offsetof(PerVertexData, overlay_r));
+		gl_state.bind(GL_TEXTURE0, gl_texture);
+		glUniform1f(u_z_value_, z_value);
+		glDrawArrays(GL_TRIANGLES, 0, vertices_.size());
+	}
+	{
+		auto& gl_state = Gl::State::instance();
+		gl_state.enable_vertex_attrib_array({attr_position_, attr_overlay_});
+		gl_array_buffer_.bind();
+		gl_array_buffer_.update(outer_vertices_);
+		Gl::vertex_attrib_pointer(
+		   attr_position_, 2, sizeof(PerVertexData), offsetof(PerVertexData, gl_x));
+		Gl::vertex_attrib_pointer(
+		   attr_overlay_, 4, sizeof(PerVertexData), offsetof(PerVertexData, overlay_r));
+		gl_state.bind(GL_TEXTURE0, gl_texture);
+		glUniform1f(u_z_value_, z_value);
+		glDrawArrays(GL_LINES, 0, outer_vertices_.size());
+	}
 }
 
 constexpr uint8_t kWorkareaTransparency = 127;
@@ -81,9 +92,9 @@
 	return RGBAColor(r, g, b, special.a);
 }
 
-void WorkareaProgram::add_vertex(const FieldsToDraw::Field& field, RGBAColor overlay) {
-	vertices_.emplace_back();
-	PerVertexData& back = vertices_.back();
+void WorkareaProgram::add_vertex(const FieldsToDraw::Field& field, RGBAColor overlay, std::vector* v) {
+	v->emplace_back();
+	PerVertexData& back = v->back();
 
 	back.gl_x = field.gl_position.x;
 	back.gl_y = field.gl_position.y;
@@ -97,15 +108,34 @@
Workareas workarea,
const FieldsToDraw& fields_to_draw,
float z_value) {
+	const FieldsToDraw::Field& topleft = fields_to_draw.at(0);
+	if (cache_ && cache_->fcoords == topleft.fcoords && cache_->surface_pixel == topleft.surface_pixel &a