Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/empire-mission-3 into lp:widelands

2017-05-12 Thread GunChleoc
Yep, I already fixed those two, but I didn't upload yet. I'm going through the 
code with a fine-tooth comb at the moment.
-- 
https://code.launchpad.net/~widelands-dev/widelands/empire-mission-3/+merge/321434
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/empire-mission-3 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/empire-mission-3 into lp:widelands

2017-05-12 Thread GunChleoc
Code refactoring is done, except for 1 NOCOM in the code that I need 
Hessenfarmer's opinion on. Once that is dealt with, the scenario should be 
finished and we need to playtest again - to save some time, I haven't tested my 
changes yet.
-- 
https://code.launchpad.net/~widelands-dev/widelands/empire-mission-3/+merge/321434
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/empire-mission-3 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/fh1-winconditions into lp:widelands

2017-05-12 Thread GunChleoc
GunChleoc has proposed merging lp:~widelands-dev/widelands/fh1-winconditions 
into lp:widelands.

Commit message:
Converted win condition scripts to new font renderer. Formatting functions for 
the new renderer live in data/scripting/richtext.lua

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/fh1-winconditions/+merge/323987

I decided to add a separate script for the formatting stuff. This way, we can 
keep the old renderer around until after the release so that savegames won't 
crash.

I will replace the online documentation for Richtext once we have support for 
campaign scenarios - I haven't touched the message boxes and objectives yet.
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-winconditions into lp:widelands.
=== modified file 'data/scripting/formatting.lua'
--- data/scripting/formatting.lua	2016-10-19 09:00:29 +
+++ data/scripting/formatting.lua	2017-05-12 14:03:15 +
@@ -1,3 +1,6 @@
+-- TODO(GunChleoc): This is for the legacy font renderer. Remove when we remove the old renderer.
+
+
 -- RST
 -- formatting.lua
 -- --

=== added file 'data/scripting/richtext.lua'
--- data/scripting/richtext.lua	1970-01-01 00:00:00 +
+++ data/scripting/richtext.lua	2017-05-12 14:03:15 +
@@ -0,0 +1,412 @@
+-- NOCOM(GunChleoc): Wrap all tags and document allowed attributes when we're done
+-- RST
+-- formatting.lua
+-- --
+--
+-- Functions to simplify and unique text formatting in scenarios and help files.
+-- Most of these functions are simple wrapper functions that make working with
+-- widelands rich text formatting system more bearable.
+-- Function names generally follow HTML names.
+
+
+-- RST
+-- .. function:: localize_list(items, listtype, former_textdomain)
+--
+--Turns an array of string items into a localized string list with
+--appropriate concatenation.
+--
+--e.g. localize_list({"foo", "bar", baz"}, "or", "widelands") will return
+--_"foo, bar or baz"
+--
+--:arg items:  An array of strings
+--:arg listtype:   The type of concatenation to use.
+-- Legal values are "&", "and", "or", and ";"
+--:arg former_textdomain:  The textdomain to restore after running this function.
+--:returns: The concatenated list string, using localized concatenation operators.
+--
+-- Same algorithm as in src/base/i18n
+function localize_list(items, listtype, former_textdomain)
+   set_textdomain("widelands")
+   local result = ""
+   for i, item in pairs(items) do
+  if (i == 1) then
+ result = item
+  elseif (i == #items) then
+ if (listtype == "&") then
+result = _"%1$s & %2$s":bformat(result, item)
+ elseif (listtype == "or") then
+result = _"%1$s or %2$s":bformat(result, item)
+ elseif (listtype == ",") then
+result = _"%1$s, %2$s":bformat(result, item)
+ else
+result = _"%1$s and %2$s":bformat(result, item)
+  end
+  else
+ result = _"%1$s, %2$s":bformat(result, item)
+  end
+   end
+   set_textdomain(former_textdomain)
+   return result
+end
+
+
+-- RST
+-- .. function:: rt(text_or_attributes[, text = nil])
+--
+--Wraps a block of text into Lua rich text.
+--Only call this once for the whole text that gets sent to the backend.
+--There is no general need to wrap an rt tag around your text,
+--because the backend will take care of it.
+--So, only use this function if you wish to add some attributes to the tag.
+--
+--Allowed attributes are:
+--   padding, padding_r, padding_l, padding_b, padding_t: NOCOM(GunChleoc): Document
+--   background:  a background color or image
+--   debug:   add visual debug information and debug log
+--   editor_mode: allow multiple blank spaces for editing
+--
+--:arg attributes: the attributes for the rt tag.
+--:type attributes: :class:`string`
+--:arg text: the text to be enclosed in rich text tags.
+--:type text: :class:`string`
+--:returns: the wrapped rich text.
+--
+function rt(text_or_attributes, text)
+   if text then
+  return "" .. text .. ""
+   else
+  return "" .. text_or_attributes .. ""
+   end
+end
+
+
+-- RST
+-- .. function:: img(src[, attributes = nil])
+--
+--Turns an image src path into an image tag for richtext.
+--
+--:arg src: the file path to the image.
+--:type src: :class:`string`
+--:arg attributes: the attributes for the div tag.
+--:type attributes: :class:`string`
+--
+--Allowed attributes are:
+--   color: a hex color to be applied to the image's player color mask, if it has any
+--   ref:   NOCOM(GunChleoc): I have no idea what it does.
+--
+--:returns: the img tag.
+--
+function img(src, attributes)
+   if attributes then
+  return ""
+   else
+  return

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

2017-05-12 Thread Klaus Halfmann
Uhm, this is all lua, what would be the way to test this?

I cannot judge much about that code.
I will however compile the code and play around with some winconditions
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-winconditions/+merge/323987
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-winconditions 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/fh1-winconditions into lp:widelands

2017-05-12 Thread bunnybot
Continuous integration builds have changed state:

Travis build 2179. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/231575243.
Appveyor build 2014. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fh1_winconditions-2014.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-winconditions/+merge/323987
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-winconditions 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/fh1-multitexture into lp:widelands

2017-05-12 Thread kaputtnik
Got a compiler warning:

/home/kaputtnik/Quellcode/widelands-repo/fh1-multitexture/src/graphic/text/rendered_text.cc:129:14:
 Warnung: unused variable »maximum_size« [-Wunused-variable]
const int maximum_size = kMinimumSizeForTextures;
  ^~~~

And some crashes, but i am not sure if they are related to this branch, because 
trunk crashes also sometimes without a reason. One crash in this branch shows 
in console:

SaveHandler::save_game() took 659ms
Autosave: save took 660 ms
pure virtual method called
terminate called without an active exception
Abgebrochen (Speicherabzug geschrieben

Will try to get a backtrace...
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-multitexture/+merge/323903
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-multitexture 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