[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1675179-lua-hide-fields into lp:widelands

2017-04-21 Thread noreply
The proposal to merge lp:~widelands-dev/widelands/bug-1675179-lua-hide-fields 
into lp:widelands has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1675179-lua-hide-fields/+merge/320981
-- 
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1675179-lua-hide-fields.

___
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-1512093-workers into lp:widelands

2017-04-21 Thread bunnybot
Continuous integration builds have changed state:

Travis build 2106. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/224541702.
Appveyor build 1941. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1512093_workers-1941.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1512093-workers/+merge/322981
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1512093-workers.

___
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-1675179-lua-hide-fields into lp:widelands

2017-04-21 Thread SirVer
Review: Approve

- It only affects the current player, other players' and critters' states 
shouldn't care about what I see

afaik the only thing that does look at your current vision is the scout. And if 
you have a different vision table than some other host on the game around the 
area of the scout, the scout will make different decisions and desync the game. 

I think this branch does not change the dangerous around this (as you said), 
but the feature could be used to potentially desync multiplayer scenarios if 
some reveal code only runs on one of the networked machines. I think this can 
be ignored for now. 


lgtm. 

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1675179-lua-hide-fields/+merge/320981
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1675179-lua-hide-fields.

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

2017-04-21 Thread bunnybot
Continuous integration builds have changed state:

Travis build 2102. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/224419857.
Appveyor build 1937. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_savegame_menu-1937.
-- 
https://code.launchpad.net/~widelands-dev/widelands/savegame-menu/+merge/322924
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/savegame-menu 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-1512093-workers into lp:widelands

2017-04-21 Thread GunChleoc
Fixed one of your nits.

Regarding the comment, I think it's important to have it, and we can't have it 
without it showing up on the homepage. I don't mind, but if you think we should 
have the worker program reference first, we can delay the merge.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1512093-workers/+merge/322981
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1512093-workers.

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

2017-04-21 Thread GunChleoc
Oops, I didn't notice those. Quick push before bunnybot snaps it up for merging.
-- 
https://code.launchpad.net/~widelands-dev/widelands/save_refactor/+merge/322622
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/save_refactor.

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

2017-04-21 Thread kaputtnik
I am struggling with the different coloring of texts:

In Load screen there is yellow for constants (like 'Map Name:') and yellow for 
variables. 
In save screen this is vice versa.

In general an improvement though :-)
-- 
https://code.launchpad.net/~widelands-dev/widelands/savegame-menu/+merge/322924
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/savegame-menu 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/wincondition_dropdown_multiplayer into lp:widelands

2017-04-21 Thread kaputtnik
Review: Approve testing

Started multiplayer game:

Map was 'The Nile', set tribes with no problems, saved the game and reloaded it 
without problems.

So from my side it's ok now :-)
-- 
https://code.launchpad.net/~widelands-dev/widelands/wincondition_dropdown_multiplayer/+merge/322196
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/wincondition_dropdown_multiplayer.

___
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-1512093-workers into lp:widelands

2017-04-21 Thread kaputtnik
Review: Approve website related

Works for the website related stuff :-)

Anyway two diff comments.

Diff comments:

> 
> === modified file 'data/tribes/workers/atlanteans/carrier/init.lua'
> --- data/tribes/workers/atlanteans/carrier/init.lua   2017-02-12 09:10:57 
> +
> +++ data/tribes/workers/atlanteans/carrier/init.lua   2017-04-21 18:41:03 
> +
> @@ -10,7 +25,22 @@
>  add_walking_animations(animations, "walk", dirname, "walk", {8, 25}, 10)
>  add_walking_animations(animations, "walkload", dirname, "walkload", {8, 25}, 
> 10)
>  
> -
> +-- RST
> +-- .. function:: new_carrier_type(table)
> +--
> +--This function adds the definition of a carrier to the engine.
> +--
> +--:arg table: This table contains all the data that the game engine will 
> add
> +--to this carrier. It contains the 
> :ref:`lua_tribes_workers_common`,
> +--plus the following additional properties:

Related to above: Since there is only one additional property, shouldn't it be 
'property:' instead of 'properties:'?

> +--
> +--**ware_hotspot**
> +--*Optional*. The x, y coordinates for adjusting the placement of the
> +--ware being carried. The default value is ``{0, 15}``. Increase 
> ``x``
> +--to shift the ware to the left and ``y`` to shift it upwards. For 
> example::
> +--
> +--   ware_hotspot = { -2, 13 },
> +--
>  tribes:new_carrier_type {
> msgctxt = "atlanteans_worker",
> --msgctxt = msgctxt,
> 
> === added file 'doc/sphinx/source/lua_tribes_workers.rst.org'
> --- doc/sphinx/source/lua_tribes_workers.rst.org  1970-01-01 00:00:00 
> +
> +++ doc/sphinx/source/lua_tribes_workers.rst.org  2017-04-21 18:41:03 
> +
> @@ -0,0 +1,95 @@
> +.. _workers:
> +
> +Workers
> +===
> +
> +Workers are defined in their ``init.lua`` file. They also have a 
> corresponding
> +``helptexts.lua`` file that contains their help text.
> +Worker files are placed in 
> ``data/tribes/workers///``.
> +
> +Types of Workers
> +
> +
> +In addition to the basic worker type, Widelands knows about the following 
> sub types:
> +
> +.. toctree::
> +   :maxdepth: 3
> +
> +REPLACE_ME
> +
> +.. _lua_tribes_workers_common:
> +
> +
> +Common Worker Properties
> +
> +
> +Workers are defined with Lua functions called ``new_worker_type{table}``. 
> The contents of ``table`` depend on the type of worker that you are defining. 
> The common properties shared by all workers are:
> +
> +  **msgctxt**: The context that Gettext will use to disambiguate the
> +  translations for strings in this table.
> +
> +  **name**: A string containing the internal name of this worker.
> +
> +  **descname**: The translatable display name. Use ``pgettext`` with the
> +  ``msgctxt`` above to fetch the string.
> +
> +  **helptext_script**: The full path to the ``helptexts.lua`` script for 
> this worker.
> +
> +  **icon**: The full path to the menu icon for this worker.
> +
> +  **vision_range**
> +  The size of the radius that the worker sees.
> +
> +  **buildcost**
> +  *Optional*. A table with the wares and workers used by warehouses to
> +  create this worker, containing warename - amount pairs, e.g.::
> +
> +  buildcost = { atlanteans_carrier = 1, hammer = 1 }
> +
> +  **default_target_quantity**:
> +  *Optional*. An int defining the default target quantity for the 
> worker's
> +  tribe's economy. Use this if the worker is produced by a production 
> site
> +  rather than the warehouses. For example, ``default_target_quantity = 
> 10``
> +
> +  **experience**
> +  *Optional*. The amount of experience that the worker needs to gather
> +  in order to be transformend into a higher worker type. If `becomes`
> +  is defined, this needs to be set as well.
> +
> +  **becomes**
> +  *Optional*. The name of the higher worker type that this worker will
> +  transform to after gaining enough experience. If `experience`
> +  is defined, this needs to be set as well.
> +
> +  **animations**:
> +   A table containing all animations for this worker.
> +   Workers have an "idle" animation. They also have directional 
> animations
> +   called "walk" and "walkload" which are defined with the help of
> +   :func:`add_walking_animations`, plus additional :ref:`animations` 
> used in their
> +   worker programs. The "idle" and "walk" animations are mandatory.
> +
> +  **programs**:
> +  *Optional*. If the worker leaves the building to do his work, the 
> worker
> +  programs that define which type of space or resource the worker has to 
> find
> +  on the map in order to do his work, and what that work is, including 
> any
> +  animations and sounds played.
> +  See :doc:`worker_program`.
> +
> +TODO(GunChleoc): create Worker Program Reference
> +

The TODO appears in the documentation on the website. Is this intended?

> +Help Texts
> +--
> +
> +Each 

[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1512093-workers into lp:widelands

2017-04-21 Thread GunChleoc
The proposal to merge lp:~widelands-dev/widelands/bug-1512093-workers into 
lp:widelands has been updated.

Commit Message changed to:

Added sphinx documentation for workers. Shifted ware hotspot from WorkerDescr 
to CarrierDescr.

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

2017-04-21 Thread GunChleoc
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1512093-workers 
into lp:widelands.

Commit message:
Added sphinx documentation for workers.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1512093-workers/+merge/322981
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1512093-workers into lp:widelands.
=== modified file 'data/tribes/wares/armor/init.lua'
--- data/tribes/wares/armor/init.lua	2016-10-18 09:06:47 +
+++ data/tribes/wares/armor/init.lua	2017-04-21 18:29:10 +
@@ -10,7 +10,10 @@
 -- ``data/tribes/wares//init.lua``.
 -- The ware will also need its help texts, which are defined in
 -- ``data/tribes/wares//helptexts.lua``
-
+--
+-- Fetching the helptext for a ware depends on the current tribe. So, best copy
+-- the function out of ``data/tribes/wares/bread_paddle/helptexts.lua``
+-- and use it as a base for creating your ware's helptexts.
 
 dirname = path.dirname(__file__)
 
@@ -42,7 +45,7 @@
 --
 --**animations**: A table containing all animations for this ware.
 --Wares have an "idle" animation.
-
+--
 tribes:new_ware_type {
msgctxt = "ware",
name = "armor",

=== modified file 'data/tribes/workers/atlanteans/armorsmith/helptexts.lua'
--- data/tribes/workers/atlanteans/armorsmith/helptexts.lua	2015-10-31 12:11:44 +
+++ data/tribes/workers/atlanteans/armorsmith/helptexts.lua	2017-04-21 18:29:10 +
@@ -1,3 +1,5 @@
+-- The helptext documentation is located in /doc/sphinx/lua_tribes_workers_rst.org
+
 function worker_helptext()
-- TRANSLATORS: Helptext for a worker: Armorsmith
return pgettext("atlanteans_worker", "Produces armor for the soldiers.")

=== modified file 'data/tribes/workers/atlanteans/armorsmith/init.lua'
--- data/tribes/workers/atlanteans/armorsmith/init.lua	2017-02-12 09:10:57 +
+++ data/tribes/workers/atlanteans/armorsmith/init.lua	2017-04-21 18:29:10 +
@@ -1,3 +1,5 @@
+-- The basic worker documentation is located in /doc/sphinx/lua_tribes_workers_rst.org
+
 dirname = path.dirname(__file__)
 
 animations = {

=== modified file 'data/tribes/workers/atlanteans/carrier/init.lua'
--- data/tribes/workers/atlanteans/carrier/init.lua	2017-02-12 09:10:57 +
+++ data/tribes/workers/atlanteans/carrier/init.lua	2017-04-21 18:29:10 +
@@ -1,3 +1,18 @@
+-- RST
+-- .. _lua_tribes_carriers:
+--
+-- Carriers
+-- 
+--
+-- Carriers are specialized workers that carry wares along the roads.
+-- Each tribe has a basic human carrier + a second carrier for busy roads -
+-- usually a beast of burden.
+--
+-- Carriers, like workers, are defined in
+-- ``data/tribes/workers///init.lua``.
+-- The carrier will also need its help texts, which are defined in
+-- ``data/tribes/wares///helptexts.lua``
+
 dirname = path.dirname(__file__)
 
 animations = {
@@ -10,7 +25,22 @@
 add_walking_animations(animations, "walk", dirname, "walk", {8, 25}, 10)
 add_walking_animations(animations, "walkload", dirname, "walkload", {8, 25}, 10)
 
-
+-- RST
+-- .. function:: new_carrier_type(table)
+--
+--This function adds the definition of a carrier to the engine.
+--
+--:arg table: This table contains all the data that the game engine will add
+--to this carrier. It contains the :ref:`lua_tribes_workers_common`,
+--plus the following additional properties:
+--
+--**ware_hotspot**
+--*Optional*. The x, y coordinates for adjusting the placement of the
+--ware being carried. The default value is ``{0, 15}``. Increase ``x``
+--to shift the ware to the left and ``y`` to shift it upwards. For example::
+--
+--   ware_hotspot = { -2, 13 },
+--
 tribes:new_carrier_type {
msgctxt = "atlanteans_worker",
--msgctxt = msgctxt,

=== modified file 'data/tribes/workers/atlanteans/soldier/init.lua'
--- data/tribes/workers/atlanteans/soldier/init.lua	2017-02-12 09:10:57 +
+++ data/tribes/workers/atlanteans/soldier/init.lua	2017-04-21 18:29:10 +
@@ -1,3 +1,17 @@
+-- RST
+-- .. _lua_tribes_soldiers:
+--
+-- Soldiers
+-- 
+--
+-- Soldiers are specialized workers that can occupy and conquer military sites.
+-- Each tribe has exactly one soldier type.
+--
+-- Soldiers, like workers, are defined in
+-- ``data/tribes/workers//soldier/init.lua``.
+-- The soldier will also need its help texts, which are defined in
+-- ``data/tribes/wares//soldier/helptexts.lua``
+
 dirname = path.dirname(__file__)
 
 animations = {
@@ -59,6 +73,123 @@
 }
 add_walking_animations(animations, "walk", dirname, "walk", {20, 34}, 10)
 
+-- RST
+-- .. function:: new_soldier_type(table)
+--
+--This function adds the definition of a soldier to the engine.
+--
+--:arg table: This table contains all the data that the game engine will add
+--to this soldier. It contains the :ref:`lua_tribes_workers_common`,
+--plus the 

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

2017-04-21 Thread SirVer
Review: Needs Fixing



Diff comments:

> === modified file 'src/logic/save_handler.cc'
> --- src/logic/save_handler.cc 2017-01-25 18:55:59 +
> +++ src/logic/save_handler.cc 2017-04-21 16:12:49 +
> @@ -37,25 +37,119 @@
>  #include "wlapplication.h"
>  #include "wui/interactive_base.h"
>  
> +// The actual work of saving is done by the GameSaver
>  using Widelands::GameSaver;
>  
> -/**
> -* Check if autosave is not needed.
> +SaveHandler::SaveHandler()
> +   : next_save_realtime_(0),
> +initialized_(false),
> +allow_saving_(true),
> +save_requested_(false),
> +saving_next_tick_(false),
> +save_filename_(""),
> +autosave_filename_("wl_autosave"),
> +fs_type_(FileSystem::ZIP),
> +autosave_interval_in_ms_(DEFAULT_AUTOSAVE_INTERVAL * 60 * 1000),
> + number_of_rolls_(5)
> +{
> +}
> +
> +void SaveHandler::rollSaveFiles(const std::string& filename) {

Widelands style uses snake_case_for_functions. You have some Javaisms here :)

> +
> +int32_t rolls = number_of_rolls_;
> + log("Autosave: Rolling savefiles (count): %d\n", rolls);
> +rolls--;
> + std::string filename_previous = create_file_name(
> +get_base_dir(), (boost::format("%s_%02d") % filename % rolls).str());
> + if (rolls > 0 && g_fs->file_exists(filename_previous)) {
> + g_fs->fs_unlink(filename_previous); // Delete last of the 
> rolling files
> + log("Autosave: Deleted %s\n", filename_previous.c_str());
> + }
> + rolls--;
> + while (rolls >= 0) {
> + const std::string filename_next = create_file_name(
> +get_base_dir(), (boost::format("%s_%02d") % filename % 
> rolls).str());
> + if (g_fs->file_exists(filename_next)) {
> + g_fs->fs_rename(filename_next, filename_previous); // 
> e.g. wl_autosave_08 -> wl_autosave_09
> + log("Autosave: Rolled %s to %s\n", 
> filename_next.c_str(), filename_previous.c_str());
> + }
> + filename_previous = filename_next;
> + rolls--;
> + }
> +}
> +
> +/**
> + * Check if game should be saved at next tick / think.
> + *
> + * @return true if game should be saved ad next think().
> + */
> +bool SaveHandler::checkNextTick(Widelands::Game& game, uint32_t realtime) {
> +
> + // Perhaps save is due now?
> + if (autosave_interval_in_ms_ <= 0 || next_save_realtime_ > realtime) {
> + return false;  // no autosave or not due, yet
> + }
> +
> +next_save_realtime_ = realtime + autosave_interval_in_ms_;
> +
> + // check if game is paused (in any way)
> + if (game.game_controller()->is_paused_or_zero_speed()) {
> + return false;
> + }
> +
> + log("Autosave: %d ms interval elapsed, current gametime: %s, 
> saving...\n", autosave_interval_in_ms_,
> + gametimestring(game.get_gametime(), true).c_str());
> +
> + game.get_ibase()->log_message(_("Saving gameā€¦"));
> + return true;
> +}
> +
> +/**
> + * If saving fails restore the backup file.
> + *
> + * @return true when save was a success.
> + */
> +bool SaveHandler::saveAndHandleError(Widelands::Game& game,
> + const std::string& 
> complete_filename,
> + const std::string& 
> backup_filename) {
> + std::string error;
> +bool result = save_game(game, complete_filename, );
> + if (!result) {
> + log("Autosave: ERROR! - %s\n", error.c_str());
> + game.get_ibase()->log_message(_("Saving failed!"));
> +
> + // if backup file was created, move it back
> + if (backup_filename.length() > 0) {
> + if (g_fs->file_exists(complete_filename)) {
> + g_fs->fs_unlink(complete_filename);
> + }
> + g_fs->fs_rename(backup_filename, complete_filename);
> + }
> + // Wait 30 seconds until next save try
> + next_save_realtime_ += 3;
> + } else {
> + // if backup file was created, time to remove it
> + if (backup_filename.length() > 0 && 
> g_fs->file_exists(backup_filename))
> + g_fs->fs_unlink(backup_filename);
> + }
> +return result;
> +}
> +
> +/**
> + * Check if autosave is needed and allowed or save was requested by user.
>   */
>  void SaveHandler::think(Widelands::Game& game) {
> +
> + if (!allow_saving_ || game.is_replay()) {
> + return;
> + }
> +
>   uint32_t realtime = SDL_GetTicks();
>   initialize(realtime);
> - std::string filename = autosave_filename_;
> -
> - if (!allow_saving_) {
> - return;
> - }
> - if (game.is_replay()) {
> - return;
> - }
>  
>   // Are we saving now?
>   if (saving_next_tick_ || save_requested_) {
> +std::string filename = 

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

2017-04-21 Thread bunnybot
Continuous integration builds have changed state:

Travis build 2099. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/224275409.
Appveyor build 1934. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_savegame_menu-1934.
-- 
https://code.launchpad.net/~widelands-dev/widelands/savegame-menu/+merge/322924
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/savegame-menu 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/save_refactor into lp:widelands

2017-04-21 Thread bunnybot
Refusing to merge, since Travis is not green. Use @bunnybot merge force for 
merging anyways.

Travis build 2096. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/224242140.
-- 
https://code.launchpad.net/~widelands-dev/widelands/save_refactor/+merge/322622
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/save_refactor.

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

2017-04-21 Thread GunChleoc
The crash should be fixed now - I had to wait for a debug build first ;)
-- 
https://code.launchpad.net/~widelands-dev/widelands/wincondition_dropdown_multiplayer/+merge/322196
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/wincondition_dropdown_multiplayer.

___
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-04-21 Thread GunChleoc
I did a first round of proofreading on the texts.

Note that objective names are identifier code and should chosen to make this 
obvious - a-z and _ only. For example:

   obj_find_artifacts = {
  name = "Find the pieces of Neptune's shrine",

should be

   obj_find_artifacts = {
  name = "find_artifacts",

or

   obj_find_artifacts = {
  name = "find_neptunes_shrine",

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

2017-04-21 Thread Klaus Halfmann
I stil get the crash when starting a saved multiplayer game.
Do you need a detailed crashreport?
-- 
https://code.launchpad.net/~widelands-dev/widelands/wincondition_dropdown_multiplayer/+merge/322196
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/wincondition_dropdown_multiplayer.

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

2017-04-21 Thread GunChleoc
GunChleoc has proposed merging lp:~widelands-dev/widelands/savegame-menu into 
lp:widelands.

Commit message:
Refactored load- and savegame screens

- New common class GameDetails to show information about savegames, analogous 
to MapDetails
- More informative savegame screen
- Load/Savegame screens now use 100% Box layout
- Fixed drawing of frame for scaled Minimap images

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1377660 in widelands: "Fullscreen Menu overhaul"
  https://bugs.launchpad.net/widelands/+bug/1377660

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/savegame-menu/+merge/322924

Complete overhaul of Load Game, Watch Replay and Save Game screens
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/savegame-menu into lp:widelands.
=== modified file 'src/game_io/game_preload_packet.cc'
--- src/game_io/game_preload_packet.cc	2017-01-25 18:55:59 +
+++ src/game_io/game_preload_packet.cc	2017-04-21 07:38:25 +
@@ -46,9 +46,11 @@
 constexpr uint16_t kCurrentPacketVersion = 6;
 constexpr const char* kMinimapFilename = "minimap.png";
 
+// Win condition localization can come from the 'widelands' or 'win_conditions' textdomain.
 std::string GamePreloadPacket::get_localized_win_condition() const {
+	std::string result = _(win_condition_);
 	i18n::Textdomain td("win_conditions");
-	return _(win_condition_);
+	return _(result);
 }
 
 void GamePreloadPacket::read(FileSystem& fs, Game&, MapObjectLoader* const) {

=== modified file 'src/ui_basic/box.cc'
--- src/ui_basic/box.cc	2017-03-02 08:43:30 +
+++ src/ui_basic/box.cc	2017-04-21 07:38:25 +
@@ -88,6 +88,12 @@
 	inner_spacing_ = size;
 }
 
+void Box::set_max_size(int w, int h) {
+	max_x_ = w;
+	max_y_ = h;
+	set_desired_size(w, h);
+}
+
 /**
  * Compute the desired size based on our children. This assumes that the
  * infinite space is zero, and is later on also re-used to calculate the

=== modified file 'src/ui_basic/box.h'
--- src/ui_basic/box.h	2017-02-25 13:27:40 +
+++ src/ui_basic/box.h	2017-04-21 07:38:25 +
@@ -66,6 +66,8 @@
 
 	void set_min_desired_breadth(uint32_t min);
 	void set_inner_spacing(uint32_t size);
+	/// Sets the maximum dimensions and calls set_desired_size()
+	void set_max_size(int w, int h);
 
 protected:
 	void layout() override;

=== modified file 'src/ui_basic/icon.cc'
--- src/ui_basic/icon.cc	2017-01-25 18:55:59 +
+++ src/ui_basic/icon.cc	2017-04-21 07:38:25 +
@@ -54,16 +54,16 @@
 	if (pic_) {
 		const float scale = std::min(1.f, std::min(static_cast(get_w()) / pic_->width(),
 		   static_cast(get_h()) / pic_->height()));
-
-		const float width = scale * get_w();
-		const float height = scale * get_h();
-		const float x = (get_w() - width) / 2.f;
-		const float y = (get_h() - height) / 2.f;
+		// We need to be pixel perfect, so we use ints.
+		const int width = scale * get_w();
+		const int height = scale * get_h();
+		const int x = (get_w() - width) / 2;
+		const int y = (get_h() - height) / 2;
 		dst.blitrect_scale(Rectf(x, y, width, height), pic_,
 		   Recti(0, 0, pic_->width(), pic_->height()), 1., BlendMode::UseAlpha);
-	}
-	if (draw_frame_) {
-		dst.draw_rect(Rectf(0.f, 0.f, get_w(), get_h()), framecolor_);
-	}
+		if (draw_frame_) {
+			dst.draw_rect(Rectf(x, y, width, height), framecolor_);
+		}
+	}	
 }
 }

=== modified file 'src/ui_basic/icon.h'
--- src/ui_basic/icon.h	2017-01-25 18:55:59 +
+++ src/ui_basic/icon.h	2017-04-21 07:38:25 +
@@ -33,6 +33,10 @@
 	Icon(Panel* parent, int32_t x, int32_t y, int32_t w, int32_t h, const Image* picture_id);
 
 	void set_icon(const Image* picture_id);
+	const Image* icon() const {
+		return pic_;
+	}
+
 	void set_frame(const RGBColor& color);
 	void set_no_frame();
 

=== modified file 'src/ui_basic/multilinetextarea.cc'
--- src/ui_basic/multilinetextarea.cc	2017-03-04 18:02:23 +
+++ src/ui_basic/multilinetextarea.cc	2017-04-21 07:38:25 +
@@ -51,6 +51,7 @@
  scrollmode_(scroll_mode),
  pic_background_(nullptr) {
 	assert(scrollmode_ == MultilineTextarea::ScrollMode::kNoScrolling || Scrollbar::kSize <= w);
+	set_scrollmode(scroll_mode);
 	set_thinks(false);
 
 	scrollbar_.moved.connect(boost::bind(::scrollpos_changed, this, _1));
@@ -60,9 +61,6 @@
 	   as_uifont(UI::g_fh1->fontset()->representative_character(), UI_FONT_SIZE_SMALL))
 	  ->height());
 	scrollbar_.set_steps(1);
-	scrollbar_.set_force_draw(scrollmode_ == ScrollMode::kScrollNormalForced ||
-	  scrollmode_ == ScrollMode::kScrollLogForced);
-
 	layout();
 }
 
@@ -192,6 +190,12 @@
 void MultilineTextarea::set_background(const Image* background) {
 	pic_background_ = background;
 }
+void MultilineTextarea::set_scrollmode(MultilineTextarea::ScrollMode scroll_mode) {
+	scrollmode_ = scroll_mode;
+	scrollbar_.set_force_draw(scrollmode_ == 

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

2017-04-21 Thread GunChleoc
I found & fixed another bug where the dropdown wasn't disabled for the client 
with savegames.

I can reproduce the crash but not the disappearing tribe dropdown.
-- 
https://code.launchpad.net/~widelands-dev/widelands/wincondition_dropdown_multiplayer/+merge/322196
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/wincondition_dropdown_multiplayer.

___
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