Merge lp:~widelands-dev/widelands/bug-1818909-web-encyclopedia into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 9009
Proposed branch: lp:~widelands-dev/widelands/bug-1818909-web-encyclopedia
Merge into: lp:widelands
Diff against target: 41 lines (+8/-2)
3 files modified
data/tribes/buildings/productionsites/frisians/well/helptexts.lua (+5/-0)
data/tribes/scripting/mapobject_info/ware_helptext.lua (+1/-1)
src/website/map_object_info.cc (+2/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1818909-web-encyclopedia
Reviewer Review Type Date Requested Status
hessenfarmer code review Approve
Review via email: mp+364141@code.launchpad.net

Commit message

Web encyclopedia fixes
- Add tribe-specific ware purpose texts to web encyclopedia
- Add missing purpose helptext to Frisian well

To post a comment you must log in.
Revision history for this message
hessenfarmer (stephan-lutz) wrote :

Ok for the frisians well.

for the Other fix we will now have a leading space in the helptexts if "default" doesn't exist. And that is pretty much the case for all tribe specific wares.

Furthermore all help texts are coded in a way that "default" is used if tribe is not specified, although the "default" text is written in a style that it is general info applicable for all tribes.
so for me a proper fix would be to fix this in the coding (if loop) of all help texts for multi tribe wares rather than doing it like in this branch.

review: Needs Fixing
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 4567. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/503493489.
Appveyor build 4354. State: failed. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1818909_web_encyclopedia-4354.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Rather than doing a complete redesign of all the wares, I call trim on the strings.

The leading and trailing whitespaces do not matter in-game, because the font renderer will kill them. The same is true for HTML, but I fixed it anyway because I don't like it if the JSON data is not clean.

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

Ok
should be working for b20, but we should probably add some consistency after that. In a way that it is clear that default is not a default value (i.e. if no tribe specific text exists) but general (i.e. the same for all tribes)

review: Approve (code review)
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 4570. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/503717637.
Appveyor build 4357. State: failed. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1818909_web_encyclopedia-4357.

Revision history for this message
GunChleoc (gunchleoc) wrote :

If you can come up with a better name for the variable, I'm all ears :)

Thanks for the review!

Input queue test timeout again

@bunnybot merge force

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/tribes/buildings/productionsites/frisians/well/helptexts.lua'
2--- data/tribes/buildings/productionsites/frisians/well/helptexts.lua 2018-04-25 07:55:28 +0000
3+++ data/tribes/buildings/productionsites/frisians/well/helptexts.lua 2019-03-08 17:27:45 +0000
4@@ -8,6 +8,11 @@
5 return pgettext ("frisians_building", "Chieftain Arldor’s retort when he was asked why his tribe can’t drink salt water")
6 end
7
8+function building_helptext_purpose()
9+ -- TRANSLATORS: Purpose helptext for a building
10+ return pgettext("building", "Draws water out of the deep.")
11+end
12+
13 function building_helptext_note()
14 -- TRANSLATORS#: Note helptext for a building
15 return ""
16
17=== modified file 'data/tribes/scripting/mapobject_info/ware_helptext.lua'
18--- data/tribes/scripting/mapobject_info/ware_helptext.lua 2016-05-13 07:43:27 +0000
19+++ data/tribes/scripting/mapobject_info/ware_helptext.lua 2019-03-08 17:27:45 +0000
20@@ -4,6 +4,6 @@
21 return {
22 func = function(tribename, helptext_script)
23 include(helptext_script)
24- return ware_helptext(tribename)
25+ return ware_helptext() .. " " .. ware_helptext(tribename)
26 end
27 }
28
29=== modified file 'src/website/map_object_info.cc'
30--- src/website/map_object_info.cc 2019-02-23 11:00:49 +0000
31+++ src/website/map_object_info.cc 2019-03-08 17:27:45 +0000
32@@ -194,7 +194,8 @@
33 cr->push_arg(tribe.name());
34 cr->push_arg(ware.helptext_script());
35 cr->resume();
36- const std::string help_text = cr->pop_string();
37+ std::string help_text = cr->pop_string();
38+ boost::algorithm::trim(help_text);
39 json_ware->add_string("helptext", help_text);
40 } catch (LuaError& err) {
41 json_ware->add_string("helptext", err.what());

Subscribers

People subscribed via source and target branches

to status/vote changes: