Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/net-pwd-security into lp:widelands

2018-03-11 Thread Notabilis
@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/net-pwd-security/+merge/340540
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/net-pwd-security.

___
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-website/scheduling_minor_fix into lp:widelands-website

2018-03-11 Thread kaputtnik
I just stumbled over the term 'Multiplayer' as the header for scheduling. What 
do you think about calling it 'Define your playtime'?
-- 
https://code.launchpad.net/~widelands-dev/widelands-website/scheduling_minor_fix/+merge/341061
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands-website/scheduling_minor_fix into 
lp:widelands-website.

___
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/net-pwd-security into lp:widelands

2018-03-11 Thread noreply
The proposal to merge lp:~widelands-dev/widelands/net-pwd-security into 
lp:widelands has been updated.

Status: Needs review => Merged

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

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

2018-03-11 Thread Benedikt Straub
I changed the early attack warning as R M suggested, and the "out of bricks" 
hint now has a li_arrow for the constructionsite hint (also using this for the 
"out of reed" hint).

I also changed the aqua farm helptext note to omit the brickmaker and emphasise 
the clay pit.

> What is the reason for not triggering the rations objective while the gahter 
> materials objective is not done yet?

I changed the objective because it was said some time ago that a definite 
objective might be preferred here instead of having nothing. Plus, the player 
will be glad he has stockpiled these materials when he is told to build many 
buildings later. 
>From the player´s point of view, I dislike getting a clear objective like 
>"gather 30 granite" and then it is considered complete before I actually did 
>what was required because the story progresses. This should only happen in 
>corner cases, but not on purpose. And if this objective remains until done, it 
>will be pointless, as it is not relevant for anything.
-- 
https://code.launchpad.net/~widelands-dev/widelands/frisians/+merge/336910
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/frisians.

___
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-1751620-floating-images into lp:widelands

2018-03-11 Thread Notabilis
Notabilis has proposed merging 
lp:~widelands-dev/widelands/bug-1751620-floating-images into lp:widelands.

Commit message:
Implementing text floating around images.

Requested reviews:
  GunChleoc (gunchleoc)
Related bugs:
  Bug #1751620 in widelands: "Bring back floating images in font renderer"
  https://bugs.launchpad.net/widelands/+bug/1751620

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1751620-floating-images/+merge/341286

Implements a richtext attribute to allow text to flow around images.
-- 
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1751620-floating-images.
=== modified file 'data/scripting/richtext.lua'
--- data/scripting/richtext.lua	2018-02-24 15:31:26 +
+++ data/scripting/richtext.lua	2018-03-11 16:52:13 +
@@ -419,9 +419,8 @@
 function li_image(imagepath, text)
return
   div("width=100%",
- div(p(vspace(6) .. img(imagepath) .. space(6))) ..
- div(p(space(6))) ..
- div("width=*", p(vspace(6) .. text .. vspace(12)))
+		div("float=left padding_r=6", p(img(imagepath))) ..
+ p(text)
   )
 end
 

=== modified file 'src/graphic/text/rt_parse.cc'
--- src/graphic/text/rt_parse.cc	2018-02-25 11:51:29 +
+++ src/graphic/text/rt_parse.cc	2018-03-11 16:52:13 +
@@ -261,8 +261,9 @@
 
 The same attributes as :ref:`rt_tags_rt`, plus the following:
 
-* **margin**: Shrink all contents to leave a margin towards the outer edge of this tag's rectangle
-* **float**: To be implemented. Allowed values are ``left``,  ``right``
+* **margin**: Shrink all contents to leave a margin towards the outer edge of this tag's rectangle.
+* **float**: Make text float around this div. Allowed values are ``left``,  ``right``. Structure has to be
+  something like: ``div("width=100%", div("float=left padding_r=6", p(img(imagepath))) .. p(text))``
 * **valign**: Align the contents vertically. Allowed values are ``top`` (default), ``center`` or ``middle``, ``bottom``.
 * **width**: The width of this element, as a pixel amount, or as a percentage.
   The last ``div`` in a row can be expanded automatically by using ``*``.

=== modified file 'src/graphic/text/rt_render.cc'
--- src/graphic/text/rt_render.cc	2018-02-25 18:20:58 +
+++ src/graphic/text/rt_render.cc	2018-03-11 16:52:13 +
@@ -292,6 +292,9 @@
 	int32_t x_, y_;
 };
 
+/*
+ * Class to calculate positions of nodes within a div tag.
+ */
 class Layout {
 public:
 	explicit Layout(std::vector>& all)
@@ -307,19 +310,7 @@
 	fit_nodes(std::vector>* rv, uint16_t w, Borders p, bool trim_spaces);
 
 private:
-	// Represents a change in the rendering constraints. For example when an
-	// Image is inserted, the width will become wider after it. This is a
-	// constraint change.
-	struct ConstraintChange {
-		int at_y;
-		int32_t delta_w;
-		int32_t delta_offset_x;
-
-		bool operator<(const ConstraintChange& o) const {
-			return at_y > o.at_y || (at_y == o.at_y && delta_w > o.delta_w);
-		}
-	};
-
+	bool calculate_line_width(uint16_t *x, uint16_t *w, uint16_t lineheight);
 	uint16_t fit_line(uint16_t w,
 	  const Borders&,
 	  std::vector>* rv,
@@ -328,13 +319,55 @@
 	uint16_t h_;
 	size_t idx_;
 	std::vector>& all_nodes_;
-	std::priority_queue constraint_changes_;
+	std::queue> floats_;
 };
 
-uint16_t Layout::fit_line(uint16_t w,
-  const Borders& p,
-  std::vector>* rv,
-  bool trim_spaces) {
+/**
+ * Calculate the width of a line at h_ taking into account floating elements.
+ * @param x The first useable x position in the line. Has to be set by the caller,
+ *  might be modified inside this function.
+ * @param x The useable width of the line. Has to be set by the caller,
+ *  might be modified inside this function.
+ * @param lineheight The height of the line the maximum width should be calculated of.
+ * @return Whether less than the full width can be used (i.e., there is a float).
+ */
+bool Layout::calculate_line_width(uint16_t *x, uint16_t *w, uint16_t lineheight) {
+	// Drop elements we already passed
+	while (!floats_.empty() && h_ >= floats_.front()->y() + floats_.front()->height()) {
+			floats_.pop();
+	}
+	if (floats_.empty()) {
+		return false;
+	}
+	// Check whether there is an element at the current height
+	std::shared_ptr n = floats_.front();
+	if (h_ + lineheight < n->y()) {
+		// Nope, nothing in the current line
+		// Since the elements are ordered, no further element can match
+		return false;
+	}
+
+	if (n->get_floating() == RenderNode::FLOAT_LEFT) {
+		*x += n->width();
+	} else {
+		assert(n->get_floating() == RenderNode::FLOAT_RIGHT);
+		*w -= n->width();
+	}
+	return true;
+}
+
+/*
+ * Calculate x positions of nodes in one line and return them in rv.
+ * As many nodes of all_nodes_ are added to the line as there is space.
+ * Remove leading/trailing spaces and assign x positions to all elements.
+

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

2018-03-11 Thread hessenfarmer
> 
> > What is the reason for not triggering the rations objective while the gahter
> materials objective is not done yet?
> 
> I changed the objective because it was said some time ago that a definite
> objective might be preferred here instead of having nothing. Plus, the player
> will be glad he has stockpiled these materials when he is told to build many
> buildings later.
> From the player´s point of view, I dislike getting a clear objective like
> "gather 30 granite" and then it is considered complete before I actually did
> what was required because the story progresses. This should only happen in
> corner cases, but not on purpose. And if this objective remains until done, it
> will be pointless, as it is not relevant for anything.

my question was not menat in this way what I would have suggested is to have 
the gather materials objective running and if the player runs out of rations 
the rations objective is triggered as well instead of providing rations to the 
player. So there are now 2 parallel objectives to be fulfilled. 
And I don't think it isn't relevant for anything as the materials are needed in 
the game anyway. I just prevents some bottlenecks in the economy. But if you 
want to have more meaning in it you could continue the story only if both of 
the objectives are fulfilled. Don't get me wrong this is not essential it is 
more the less a cherry on the cake, but I just don't like giving the player 
something without a good reason.
sometime ago I had a discussion with GunChleoc while developing my scenarios 
for the empire tribe and we both agreed that a less linear storyline is more 
interesting for the player. so this is just a chance to have multiple 
objectives with the player to decide which one to solve first. 

@ GunChleoc and all the other devs:
What is the current opinion about merging this branch? I would still give it a 
go as the texts are now profread by our chieftain.
-- 
https://code.launchpad.net/~widelands-dev/widelands/frisians/+merge/336910
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/frisians.

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

2018-03-11 Thread bunnybot
Continuous integration builds have changed state:

Travis build 3287. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/352011452.
Appveyor build 3095. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_frisians-3095.
-- 
https://code.launchpad.net/~widelands-dev/widelands/frisians/+merge/336910
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/frisians.

___
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-1751620-floating-images into lp:widelands

2018-03-11 Thread bunnybot
Continuous integration builds have changed state:

Travis build 3288. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/352028977.
Appveyor build 3096. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1751620_floating_images-3096.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1751620-floating-images/+merge/341286
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1751620-floating-images.

___
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