Merge lp:~widelands-dev/widelands/fh1-tutorial4 into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 8560
Proposed branch: lp:~widelands-dev/widelands/fh1-tutorial4
Merge into: lp:widelands
Diff against target: 544 lines (+119/-139)
2 files modified
data/campaigns/tutorial04_economy.wmf/scripting/texts.lua (+103/-139)
data/scripting/richtext.lua (+16/-0)
To merge this branch: bzr merge lp:~widelands-dev/widelands/fh1-tutorial4
Reviewer Review Type Date Requested Status
Klaus Halfmann Approve
kaputtnik (community) testing Approve
Review via email: mp+336171@code.launchpad.net

Commit message

Converted Tutorial 4 to new font renderer. Added new function "join_sentences(sentence1, sentence2)" to richtext.lua

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 3063. State: failed. Details: https://travis-ci.org/widelands/widelands/builds/329643125.
Appveyor build 2870. State: failed. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fh1_tutorial4-2870.

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Travis had some trasient Issue only
> ... could not connect to ppa.launchpad.net:80 (91.189.95.83), connection timed out
> Unable to locate package g++-6

Same for appveyor:
> Fetching repository commit (0255238)...Error while copying content to a stream.

Code changes look straight forward, will compile and testplay this now.

Revision history for this message
kaputtnik (franku) wrote :

Tested with the fh1-tutorial2 branch and all LGTM :-)

review: Approve (testing)
Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Test this with
./wideland --scenario=/<AbsolutePathTo>widelands-repo/fh1-tutorial4/data/campaigns/tutorial04_economy.wmf/

kaputtnik: Did you test in English or in German?
I will then test the other variant.

Revision history for this message
kaputtnik (franku) wrote :

Oops, didn't test the objectives and there was one issue. In the 'Open the Ware Stastics window' part was a useless paragraphdivider(). I removed it and all looks good now.

Revision history for this message
kaputtnik (franku) wrote :

I have tested in english. The language shouldn't matter, as long the language has no special cases, imho.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 3070. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/330255719.
Appveyor build 2877. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fh1_tutorial4-2877.

Revision history for this message
kaputtnik (franku) wrote :

Klaus, did you finished your test?

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Yes finished in German and found a few missing translations only.
In trunk I found, that the help for bulding sites is some HTML only.

review: Approve (compile testplay)
Revision history for this message
kaputtnik (franku) wrote :

> In trunk I found, that the help for bulding sites is some HTML only.

This is another task, imho

Thanks for testing :-)

@bunnybot merge

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 3075. State: failed. Details: https://travis-ci.org/widelands/widelands/builds/331167754.
Appveyor build 2882. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fh1_tutorial4-2882.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Refusing to merge, since Travis is not green. Use @bunnybot merge force for merging anyways.

Travis build 3075. State: failed. Details: https://travis-ci.org/widelands/widelands/builds/331167754.

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Transient failure in Travis:

> Could not find compiler set in environment variable CC:
> clang-3.4.

No idea whats wrong there.

@bunnybot merge force

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/campaigns/tutorial04_economy.wmf/scripting/texts.lua'
2--- data/campaigns/tutorial04_economy.wmf/scripting/texts.lua 2017-12-16 10:48:12 +0000
3+++ data/campaigns/tutorial04_economy.wmf/scripting/texts.lua 2018-01-20 11:37:48 +0000
4@@ -6,8 +6,7 @@
5 -- Some formating functions
6 -- =========================
7
8-include "scripting/formatting.lua"
9-include "scripting/format_scenario.lua"
10+include "scripting/richtext_scenarios.lua"
11
12
13 -- =============
14@@ -16,7 +15,7 @@
15
16 intro1 = {
17 title = _"Your Economy and its Settings",
18- body = rt(
19+ body = (
20 h1(_[[Economy]]) ..
21 p(_[[Welcome back. In this tutorial, I’ll tell you what you can do to check how well your economy works.]]) ..
22 p(_[[Building your economy up and making it work well and grow is the main part of Widelands. But you can’t control the workers directly – they will follow the general conditions you set.]]) ..
23@@ -29,7 +28,7 @@
24 position = "topright",
25 field = field_near_border,
26 title = _"A Peaceful Land",
27- body = rt(
28+ body = (
29 p(_[[Now about the map: you have settled in a nice valley between two mountains, rich in marble, iron ore and coal. All were hoping for a peaceful life.]]) ..
30 p(_[[But one day, you discovered a barren wasteland with abandoned buildings in the east. A strange aura came from there, and no one wanted to set foot there. But the border could not be left undefended, and so you constructed three castles.]]) ..
31 p(_[[You had not been prepared for war, and you have to hurry now to build up an army.]])
32@@ -40,7 +39,7 @@
33 tavern_burnt_down = {
34 position = "topright",
35 title = _"The Tavern is Burning!",
36- body = rt(
37+ body = (
38 h1(_[[An accident]]) ..
39 p(_[[Oh no, look at this: our tavern is burning! In all the hurry, our innkeeper accidentally dropped a torch. She is fine, but we could not extinguish the fire in time.]])
40 ),
41@@ -51,59 +50,51 @@
42 building_stat = {
43 position = "topright",
44 title = _"Building statistics",
45- body = rt(
46+ body = (
47 h1(_[[Check out your taverns]]) ..
48- p(_[[At first, we should find out how many taverns we currently have. Widelands offers you a window where you can easily check this.]])
49- ) ..
50- rt("image=images/wui/menus/menu_toggle_menu.png",p(_[[First, you will have to open the statistics menu (you can find the corresponding button at the bottom). We will need this menu several times.]])) ..
51- rt("image=images/wui/menus/menu_building_stats.png",p(_[[Afterwards, choose the ‘Building statistics’.]]) ..
52- paragraphdivider() ..
53- listitem_bullet(_[[Open the building statistics window.]]) ..
54- listitem_arrow(_[[You can also use the hotkey ‘b’.]])
55+ p(_[[At first, we should find out how many taverns we currently have. Widelands offers you a window where you can easily check this.]]) ..
56+ li_image("images/wui/menus/menu_toggle_menu.png", _[[First, you will have to open the statistics menu (you can find the corresponding button at the bottom). We will need this menu several times.]]) ..
57+ li_image("images/wui/menus/menu_building_stats.png", _[[Afterwards, choose the ‘Building statistics’.]]) ..
58+ li(_[[Open the building statistics window.]]) ..
59+ li_arrow(_[[You can also use the hotkey ‘b’.]])
60 ),
61 h = 350,
62 obj_name = "open_building_stat",
63 obj_title = _"Open the building statistics window.",
64 obj_body =
65- rt("image=images/wui/menus/menu_building_stats.png", p(_[[The building statistics window gives you an overview over the buildings you have.]])) ..
66- rt(
67- paragraphdivider() ..
68+ li_image("images/wui/menus/menu_building_stats.png", _[[The building statistics window gives you an overview over the buildings you have.]]) ..
69 -- TRANSLATORS: "it" refers to the building statistics window
70- listitem_bullet(_[[Open it. You can access it from the statistics menu.]]) ..
71- listitem_arrow(_[[The statistics menu is accessed via the second button at the bottom. It provides several windows that give you information about the game.]])
72- )
73+ li(_[[Open it. You can access it from the statistics menu.]]) ..
74+ li_arrow(_[[The statistics menu is accessed via the second button at the bottom. It provides several windows that give you information about the game.]])
75 }
76
77 explain_building_stat = {
78 title = _"Building Statistics",
79- body = rt(
80+ body = (
81 p(_[[This is the building statistics window. It shows you all buildings you can own, sorted by their size.]]) ..
82 p(_[[Let me now explain what all those numbers mean:]]) ..
83- paragraphdivider() ..
84- listitem_bullet(_[[‘2/1’ below the quarry: This means that you have two quarries, plus another one which is under construction.]]) ..
85- listitem_bullet(_[[‘0%’: This indicates the average productivity of all buildings of that type. You have just started this game, therefore none of your buildings has done any work yet, but they are going to start working soon.]]) ..
86- listitem_bullet(_[[‘2/4’ below your sentry: For military buildings, the stationed soldiers are shown instead of a productivity. You want to have four soldiers in your sentries, but only two soldiers are stationed in this kind of building. This leaves two vacant positions – we really need more soldiers.]]) ..
87- listitem_arrow(_[[In both cases, the color (green - yellow - red) signals you how good the value is.]]) ..
88- listitem_bullet(_[[If you click on a building, you can scroll through the buildings of the selected type.]]) ..
89- listitem_bullet(_[[If you don’t have any building of a particular building type, it will be shown greyed out.]])
90- ) ..
91- rt(
92+ li(_[[‘2/1’ below the quarry: This means that you have two quarries, plus another one which is under construction.]]) ..
93+ li(_[[‘0%’: This indicates the average productivity of all buildings of that type. You have just started this game, therefore none of your buildings has done any work yet, but they are going to start working soon.]]) ..
94+ li(_[[‘2/4’ below your sentry: For military buildings, the stationed soldiers are shown instead of a productivity. You want to have four soldiers in your sentries, but only two soldiers are stationed in this kind of building. This leaves two vacant positions – we really need more soldiers.]]) ..
95+ li_arrow(_[[In both cases, the color (green - yellow - red) signals you how good the value is.]]) ..
96+ li(_[[If you click on a building, you can scroll through the buildings of the selected type.]]) ..
97+ li(_[[If you don’t have any building of a particular building type, it will be shown greyed out.]]) ..
98 h2(_[[Now it’s your turn]]) ..
99 p(_[[This is enough explanation for now. Now try it out yourself. We want to know whether we still have taverns, so you have to choose the ‘Medium buildings’ tab. Close the building statistics menu afterwards.]])
100 ),
101 obj_name = "check_taverns",
102 obj_title = _"Look up how many taverns you have.",
103- obj_body = rt(
104- listitem_bullet(_[[Choose the ‘Medium buildings’ tab in the building statistics window.]]) ..
105- listitem_bullet(_[[Look up how many taverns you have.]]) ..
106- listitem_arrow(_[[Below every building, there are two lines. The first one shows the number of buildings you own and how many are under construction. The second line shows the average productivity if it is a production site or training site, or the stationed and desired soldiers in military buildings.]]) ..
107- listitem_bullet(_[[Close the building statistics window when you are done.]])
108+ obj_body = (
109+ li(_[[Choose the ‘Medium buildings’ tab in the building statistics window.]]) ..
110+ li(_[[Look up how many taverns you have.]]) ..
111+ li_arrow(_[[Below every building, there are two lines. The first one shows the number of buildings you own and how many are under construction. The second line shows the average productivity if it is a production site or training site, or the stationed and desired soldiers in military buildings.]]) ..
112+ li(_[[Close the building statistics window when you are done.]])
113 )
114 }
115
116 reopen_building_stat = {
117 title = _"You closed the building statistics window!",
118- body = rt(
119+ body = (
120 p(_[[You have closed the building statistics window. I didn’t notice that you switched to the medium buildings to look up the number of taverns. Would you please be so nice and show it to me?]])
121 ),
122 show_instantly = true,
123@@ -114,11 +105,10 @@
124 reopen_building_stat_obj = {
125 obj_name = "open_building_stat_again",
126 obj_title = _"Open the building statistics window again.",
127- obj_body = rt(
128+ obj_body = (
129 p(_[[You closed the building statistics window, although you have not yet looked up the number of taverns.]]) ..
130- paragraphdivider() ..
131 -- TRANSLATORS: "it" refers to the building statistics window.
132- listitem_bullet(_[[Please reopen it and choose the second tab (medium buildings).]])
133+ li(_[[Please reopen it and choose the second tab (medium buildings).]])
134 ),
135 h = 250
136 }
137@@ -126,50 +116,45 @@
138 inventory1 = {
139 position = "topright",
140 title = _"Stock",
141- body = rt(
142+ body = (
143 h1(_[[Check for rations]]) ..
144- p(_[[OK. In the list, you’ve seen that you have no more taverns or inns. That means that you’re not producing any rations. But let’s see what we still have in stock.]])
145- ) ..
146- rt("image=images/wui/menus/menu_stock.png",p(_[[Click on the ‘Stock’ button.]])) ..
147- rt(
148- paragraphdivider() ..
149- listitem_arrow(_[[You can also use the hotkey ‘i’ (as in ‘inventory’) to access this window quickly.]])
150+ p(_[[OK. In the list, you’ve seen that you have no more taverns or inns. That means that you’re not producing any rations. But let’s see what we still have in stock.]]) ..
151+ li_image("images/wui/menus/menu_stock.png", _[[Click on the ‘Stock’ button.]]) ..
152+ li_arrow(_[[You can also use the hotkey ‘i’ (as in ‘inventory’) to access this window quickly.]])
153 ),
154 h = 300,
155 obj_name = "open_inventory",
156 obj_title = _"Open your stock window.",
157- obj_body = rt(
158+ obj_body = (
159 p(_[[The stock menu window gives you an overview over the wares you currently have.]]) ..
160- paragraphdivider() ..
161 -- TRANSLATORS: "it" refers to the stock menu window
162- listitem_bullet(_[[Open it. You can access it from the statistics menu.]]) ..
163- listitem_arrow(_[[The statistics menu is accessed via the second button at the bottom. It provides several windows that give you information about the game.]])
164+ li(_[[Open it. You can access it from the statistics menu.]]) ..
165+ li_arrow(_[[The statistics menu is accessed via the second button at the bottom. It provides several windows that give you information about the game.]])
166 )
167 }
168
169 inventory2 = {
170 title = _"Stock",
171- body = rt(
172+ body = (
173 p(_[[The stock menu window has four tabs. The first (and currently selected) one shows you all your current wares, including those on roads, at flags and inside buildings waiting for processing.]]) ..
174 p(_[[Looking at the rations, there are currently only five in total, probably on their way to somewhere. Five rations are not much for such a big economy.]]) ..
175 p(_[[The second tab shows you all your workers, again those on roads and in buildings summed up.]]) ..
176- p(_[[Now have a look at these two tabs. When you click on the]])) ..
177- rt("image=images/wui/stats/menu_tab_wares_warehouse.png",p(_[[third tab (‘Wares in warehouses’), I’ll continue.]])
178+ p(_[[Now have a look at these two tabs. When you click on the]]) ..
179+ li_image("images/wui/stats/menu_tab_wares_warehouse.png", _[[third tab (‘Wares in warehouses’), I’ll continue.]])
180 ),
181 h = 350,
182 show_instantly = true,
183 obj_name = "switch_stock_tab",
184 obj_title = _"Switch to the third tab in the stock menu window.",
185- obj_body = rt(
186+ obj_body = (
187 p(_[[Have a look at the first two tabs in the stock menu window. They show all the wares and workers you have.]]) ..
188- paragraphdivider() ..
189- listitem_bullet(_[[When you have seen enough, switch to the third tab.]])
190+ li(_[[When you have seen enough, switch to the third tab.]])
191 ),
192 }
193
194 inventory3 = {
195 title = _"Stock",
196- body = rt(
197+ body = (
198 p(_[[The third tab shows you the wares that are stored in your headquarters, your warehouses and ports. They are not needed anywhere and are therefore your reserve.]]) ..
199 p(_[[The fourth tab shows the same thing for workers.]]) ..
200 p(_[[The third tab tells you that there are no rations left in your headquarters – that’s not good!]])
201@@ -180,7 +165,7 @@
202
203 reopen_stock_menu = {
204 title = _"You closed the stock window!",
205- body = rt(
206+ body = (
207 p(_[[You have closed the stock menu window, but I have not yet finished with my explanation. Would you please reopen it and choose the third tab?]])
208 ),
209 show_instantly = true,
210@@ -191,11 +176,10 @@
211 reopen_stock_menu_obj = {
212 obj_name = "open_stock_menu_again",
213 obj_title = _"Open the stock window again.",
214- obj_body = rt(
215+ obj_body = (
216 p(_[[You closed the stock menu window before I finished telling you everything about it. If you already know everything, please feel free to leave this tutorial at any time.]]) ..
217- paragraphdivider() ..
218 -- TRANSLATORS: "it" refers to the stock menu window.
219- listitem_bullet(_[[Otherwise, please reopen it and choose the third tab.]])
220+ li(_[[Otherwise, please reopen it and choose the third tab.]])
221 ),
222 h = 250
223 }
224@@ -203,30 +187,27 @@
225 build_taverns = {
226 position = "topright",
227 title = _"New taverns",
228- body = rt(
229+ body = (
230 h1(_[[We need new taverns]]) ..
231 p(_[[Now that you have an overview, you should act. I think we should build more than one tavern – two or three are better. Remember: as long as we don’t produce rations, our miners won’t dig for ore. And without iron, we cannot forge a single helm.]]) ..
232- paragraphdivider() ..
233- listitem_bullet(_[[Build at least two taverns.]])
234+ li(_[[Build at least two taverns.]])
235 ),
236 h = 300,
237 obj_name = "build_taverns",
238 obj_title = _"Build new taverns.",
239- obj_body = rt(
240+ obj_body = (
241 p(_[[To make our mines work, we need rations again – the more, the better.]]) ..
242- paragraphdivider() ..
243- listitem_bullet(_[[Build at least two taverns.]])
244+ li(_[[Build at least two taverns.]])
245 )
246 }
247
248 ware_encyclopedia = {
249 title = _"Ware Encyclopedia",
250- body = rt(
251+ body = (
252 p(_[[I am not sure if you could follow my remarks. Why do we need rations to get soldiers?]]) ..
253 p(_[[When you’ve played a lot, you will know such things by heart. But when you’re unsure what this tribe needs for a special ware, you can easily look it up in your tribe’s ware encyclopedia.]]) ..
254- p(_[[This encyclopedia can be accessed via]])
255- ) ..
256- rt("image=images/ui_basic/menu_help.png",p(_[[the help button at the bottom. For all your tribe’s wares, it shows a short help text, a list of buildings that produces the ware and the needed wares.]]) ..
257+ p(_[[This encyclopedia can be accessed via]])..
258+ li_image("images/ui_basic/menu_help.png", _[[the help button at the bottom. For all your tribe’s wares, it shows a short help text, a list of buildings that produces the ware and the needed wares.]]) ..
259 p(_[[If you want, you can try it out. A soldier needs a wooden spear and a helmet – from there on out, you can search backwards.]])
260 ),
261 h = 350
262@@ -235,7 +216,7 @@
263 building_priority_settings = {
264 position = "topright",
265 title = _"Priority Settings",
266- body = rt(
267+ body = (
268 h1(_[[Send the wares where they’re needed]]) ..
269 p(_[[Great. Our taverns have now been built up and are supplying us with rations.]]) ..
270 p(_[[At the moment, all mines are supplied with rations. If you want to prioritize a special mine, you simply have to open its window. In the wares tab, behind every ware, you can see ‘traffic lights’.]]) ..
271@@ -249,83 +230,75 @@
272 ware_stats1 = {
273 position = "top",
274 title = _"Ware Statistics",
275- body = rt(
276- p(_[[In the statistics menu, there is also a]])) ..
277- rt("image=images/wui/menus/menu_ware_stats.png",p(_[[‘Ware statistics’ button.]])) ..
278- rt(paragraphdivider() ..
279+ body = (
280+ p(_[[In the statistics menu, there is also a]]) ..
281+ li_image("images/wui/menus/menu_ware_stats.png", _[[‘Ware statistics’ button.]]) ..
282 -- TRANSLATORS: "it" refers to the ware statistics button
283- listitem_bullet(_[[Click on it.]])
284+ li(_[[Click on it.]])
285 ),
286 w = 200,
287 h = 200,
288 obj_name = "open_ware_stat",
289 obj_title = _"Open the ware statistics window.",
290- obj_body = rt(
291- paragraphdivider() ..
292- listitem_bullet(_[[Open the ‘Ware statistics’ window, accessed via the statistics menu.]])
293+ obj_body = (
294+ li(_[[Open the ‘Ware statistics’ window, accessed via the statistics menu.]])
295 )
296 }
297
298 ware_stats2 = {
299 title = _"Ware Statistics",
300- body = rt(
301+ body = (
302 p(_[[In this menu window, you can select wares to see how their production or consumption has changed over time. Try it out with some wares.]]) ..
303- paragraphdivider() ..
304- listitem_bullet(_[[I’ll continue as soon as you click on the]])) ..
305- rt("image=images/wui/stats/menu_tab_wares_econ_health.png",p(_[[third tab (‘Economy health’).]])
306+ li(_[[I’ll continue as soon as you click on the]]) ..
307+ li_image("images/wui/stats/menu_tab_wares_econ_health.png", _[[third tab (‘Economy health’).]])
308 ),
309 h = 250,
310 show_instantly = true,
311 obj_name = "switch_ware_stat_tab_to_third",
312 obj_title = _"Switch to the third tab in the ware statistics menu window.",
313- obj_body = rt(
314+ obj_body = (
315 p(_[[The first two tabs show you the production and consumption of any ware. You can toggle them by simply clicking on them.]]) ..
316- paragraphdivider() ..
317- listitem_bullet(_[[When you have seen enough, switch to the third tab.]])
318+ li(_[[When you have seen enough, switch to the third tab.]])
319 )
320 }
321
322 ware_stats3 = {
323 title = _"Ware Statistics",
324- body = rt(
325+ body = (
326 p(_[[In this tab, you can see the difference between production and consumption, called ‘economy health’. You can see at one glance which one of those two is higher for the selected ware, that means whether the amount increases or decreases.]]) ..
327 p(_[[Now try this out. You can also compare it with the two previous tabs.]]) ..
328- paragraphdivider() ..
329- listitem_bullet(_[[Click on the last tab when I should continue.]])
330+ li(_[[Click on the last tab when I should continue.]])
331 ),
332 h = 250,
333 show_instantly = true,
334 obj_name = "switch_ware_stat_tab_to_forth",
335 obj_title = _"Switch to the last tab in the ware statistics menu window.",
336- obj_body = rt(
337+ obj_body = (
338 p(_[[The third tab shows you the economy health of the ware. When the value is positive, this means your stock is growing.]]) ..
339- paragraphdivider() ..
340- listitem_bullet(_[[When you have seen enough, switch to the fourth tab.]])
341+ li(_[[When you have seen enough, switch to the fourth tab.]])
342 )
343 }
344
345 ware_stats4 = {
346 title = _"Ware Statistics",
347- body = rt(
348+ body = (
349 p(_[[In the last tab, you can also see your absolute stock. It will increase when the economy health is positive, and decrease otherwise. Compare the two graphs!]]) ..
350 p(_[[The last two tabs are good indicators to see whether shortages are about to come. Don’t forget to check them regularly!]]) ..
351- paragraphdivider() ..
352- listitem_bullet(_[[Close this window when you’re done.]])
353+ li(_[[Close this window when you’re done.]])
354 ),
355 h = 250,
356 show_instantly = true,
357 obj_name = "close_ware_stats",
358 obj_title = _"Close the ware statistics window.",
359- obj_body = rt(
360+ obj_body = (
361 p(_[[The stock tab shows you how many wares you have. Compare the information from the four tabs to understand the correlation.]]) ..
362- paragraphdivider() ..
363- listitem_bullet(_[[When you have finished, close the ware statistics window.]])
364+ li(_[[When you have finished, close the ware statistics window.]])
365 ),
366 }
367
368 reopen_ware_stats1 = {
369 title = _"You closed the ware statistics window!",
370- body = rt(
371+ body = (
372 p(_[[You have closed the ware statistics menu window, but I have not yet finished with my explanation. Would you please reopen it and choose the third tab?]])
373 ),
374 show_instantly = true,
375@@ -336,17 +309,16 @@
376 reopen_ware_stats1_obj = {
377 obj_name = "open_ware_stats_menu_again1",
378 obj_title = _"Open the ware statistics window again.",
379- obj_body = rt(
380+ obj_body = (
381 p(_[[You closed the ware statistics menu window before I finished telling you everything about it. If you already know everything, please feel free to leave this tutorial at any time.]]) ..
382- paragraphdivider() ..
383 -- TRANSLATORS: "it" refers to the ware statistics window.
384- listitem_bullet(_[[Otherwise, please reopen it and choose the third tab.]])
385+ li(_[[Otherwise, please reopen it and choose the third tab.]])
386 )
387 }
388
389 reopen_ware_stats2 = {
390 title = _"You closed the ware statistics window!",
391- body = rt(
392+ body = (
393 p(_[[You have closed the ware statistics menu window, but I have not yet finished with my explanation. Would you please reopen it and choose the fourth tab?]])
394 ),
395 show_instantly = true,
396@@ -357,39 +329,35 @@
397 reopen_ware_stats2_obj = {
398 obj_name = "open_ware_stats_menu_again2",
399 obj_title = _"Open the ware statistics window again.",
400- obj_body = rt(
401+ obj_body = (
402 p(_[[You closed the ware statistics menu window before I finished telling you everything about it. If you already know everything, please feel free to leave this tutorial at any time.]]) ..
403- paragraphdivider() ..
404 -- TRANSLATORS: "it" refers to the ware statistics window.
405- listitem_bullet(_[[Otherwise, please reopen it and choose the fourth tab.]])
406+ li(_[[Otherwise, please reopen it and choose the fourth tab.]])
407 )
408 }
409
410 economy_settings1 = {
411 position = "topright",
412 title = _"Economy options",
413- body = rt(
414+ body = (
415 p(_[[I’ve shown you our stock menu window, where you could see which wares are at the warehouses. You remember?]]) ..
416- p(_[[Now I’ll tell you how you can determine how many wares you want to have. The menu window for this purpose can be accessed via any flag and is called ‘Configure economy’.]])) ..
417- -- Yup, that's indeed the correct icon
418- rt("image=images/wui/stats/genstats_nrwares.png",p(_[[This is the icon.]])) ..
419- rt(
420- paragraphdivider() ..
421- listitem_bullet(_[[Open this window.]])
422+ p(_[[Now I’ll tell you how you can determine how many wares you want to have. The menu window for this purpose can be accessed via any flag and is called ‘Configure economy’.]]) ..
423+ -- Yup, that's indeed the correct icon
424+ li_image("images/wui/stats/genstats_nrwares.png", _[[This is the icon.]]) ..
425+ li(_[[Open this window.]])
426 ),
427 h = 350,
428 obj_name = "open_economy_settings",
429 obj_title = _"Open the ‘Configure economy’ window.",
430- obj_body = rt(
431- paragraphdivider() ..
432- listitem_bullet(_[[Open the ‘Configure economy’ window.]]) ..
433- listitem_arrow(_[[The window can be accessed by clicking on any flag you own.]])
434+ obj_body = (
435+ li(_[[Open the ‘Configure economy’ window.]]) ..
436+ li_arrow(_[[The window can be accessed by clicking on any flag you own.]])
437 )
438 }
439
440 economy_settings2 = {
441 title = _"Economy options",
442- body = rt(
443+ body = (
444 p(_[[This window looks similar to the stock window, but it has additional buttons at the bottom.]]) ..
445 p(_[[You first have to select one or more wares (you can also left-click and drag). Then you can set the desired target quantity for the selected wares.]]) ..
446 p(_[[Most buildings will only produce something when the stock level in your warehouses falls below the target quantity, so you should indicate the reserve you want to stockpile.]]) ..
447@@ -401,21 +369,19 @@
448
449 economy_settings3 = {
450 title = _"Economy options",
451- body = rt(
452+ body = (
453 p(_[[By changing the target quantity, you can therefore decide which wares/tools your resources (in this case: iron) should be turned into or whether you would like to save your iron and wait until you know what you will need it for.]]) ..
454 p(_[[Only buildings that consume wares care about this setting. Buildings that produce wares for free (e.g. your farms or wells) will always keep working.]]) ..
455 p(_[[Now let’s try it out: the current target quantity for marble columns is 10. Increase it to be prepared in case you will have to build up your fortifications quickly.]]) ..
456- paragraphdivider() ..
457- listitem_bullet(_[[Set the target quantity for marble columns to 20 and wait for your stonemason to produce them.]])
458+ li(_[[Set the target quantity for marble columns to 20 and wait for your stonemason to produce them.]])
459 ),
460 obj_name = "produce_marble_columns",
461 obj_title = _"Produce 20 marble columns.",
462- obj_body = rt(
463+ obj_body = (
464 p(_[[Sometimes, you will need many wares at the same time quickly – faster than they can be produced. In this case, it is good to have enough on reserve.]]) ..
465- paragraphdivider() ..
466- listitem_bullet(_[[To be prepared for additional fortifications, you should produce 20 marble columns.]]) ..
467- listitem_arrow(_[[Your stonemason will not produce marble columns when they are not needed. You have to increase the target quantity.]]) ..
468- listitem_arrow(_[[To do so, click on any flag and choose ‘Configure economy’. In this menu window, you can decide how many wares of each type you wish to have in stock.]])
469+ li(_[[To be prepared for additional fortifications, you should produce 20 marble columns.]]) ..
470+ li_arrow(_[[Your stonemason will not produce marble columns when they are not needed. You have to increase the target quantity.]]) ..
471+ li_arrow(_[[To do so, click on any flag and choose ‘Configure economy’. In this menu window, you can decide how many wares of each type you wish to have in stock.]])
472 )
473 }
474
475@@ -423,34 +389,32 @@
476 field = warehouse_field,
477 position = "topright",
478 title = _"Warehouse Preferences",
479- body = rt(
480+ body = (
481 h1(_[[Bring the marble columns to the front line]]) ..
482 p(_[[The production of marble columns is working fine now, but it would be great if they were stored where we need them.]]) ..
483 p(_[[Normally, produced wares are brought to the closest warehouse if they are not needed elsewhere. In this case, this means our headquarters. But we would like to have them in the warehouse near our fortresses.]]) ..
484 p(_[[Every warehouse has four buttons to set the preference. If you move your mouse pointer over them, you will see tooltips that explain what the buttons do.]]) ..
485- paragraphdivider() ..
486- listitem_bullet(_[[Bring all the marble columns to the warehouse near the front line.]]) ..
487- listitem_arrow(_[[To achieve this, you will have to do two things. First, set a preference for marble columns in the desired warehouse. All marble columns produced in the future will be brought there if possible.]]) ..
488- listitem_arrow(_[[Then, to move the marble columns out of your headquarters, you will have to click on the remove button there.]])
489+ li(_[[Bring all the marble columns to the warehouse near the front line.]]) ..
490+ li_arrow(_[[To achieve this, you will have to do two things. First, set a preference for marble columns in the desired warehouse. All marble columns produced in the future will be brought there if possible.]]) ..
491+ li_arrow(_[[Then, to move the marble columns out of your headquarters, you will have to click on the remove button there.]])
492 ),
493 obj_name = "bring_marble_columns_to_front",
494 obj_title = _"Bring 20 marble columns to the front line.",
495- obj_body = economy_settings3.obj_body .. rt(
496+ obj_body = economy_settings3.obj_body .. (
497 p(_[[To decide where your wares get stored, you can use the preference buttons in the warehouses.]]) ..
498- listitem_bullet(_[[Bring all the marble columns to the warehouse near the front line.]]) ..
499- listitem_arrow(_[[To achieve this, you will have to do two things. First, set a preference for marble columns in the desired warehouse. All marble columns produced in the future will be brought there if possible.]]) ..
500- listitem_arrow(_[[Then, to move the marble columns out of your headquarters, you will have to click on the remove button there.]])
501+ li(_[[Bring all the marble columns to the warehouse near the front line.]]) ..
502+ li_arrow(_[[To achieve this, you will have to do two things. First, set a preference for marble columns in the desired warehouse. All marble columns produced in the future will be brought there if possible.]]) ..
503+ li_arrow(_[[Then, to move the marble columns out of your headquarters, you will have to click on the remove button there.]])
504 )
505 }
506
507 conclusion = {
508 title = _"Borders Secured",
509- body = rt(
510+ body =
511 h1(_[[We’re safe now]]) ..
512 p(_[[Great. We now have enough marble columns so that in case of an aggressor, we can build up our fortifications. But I do not think that that will be necessary. So far, no enemy has shown up.]]) ..
513 p(_[[I hope I could teach you how you can control the economy in Widelands. There are many options and they can be confusing at first. Even if you’ve only understood a few concepts, you mustn’t give up. Try them out in some games, become familiar with them and experience the possibilities. Then, return to this tutorial and learn the rest!]]) ..
514 p([[]]) ..
515- p(_[[This was the last tutorial I had prepared for you. I’ve now taught you everything I know. There are still secrets hidden in this world even I don’t know about. I will now search for a quiet place to spend my sunset years. If you have still questions, the Widelands community will surely help you. You can find it at:]])
516- ) ..
517- rt("text-align=center", "<p font-size=24 font-decoration=underline>http://www.widelands.org</p>")
518+ p(_[[This was the last tutorial I had prepared for you. I’ve now taught you everything I know. There are still secrets hidden in this world even I don’t know about. I will now search for a quiet place to spend my sunset years. If you have still questions, the Widelands community will surely help you. You can find it at:]]) ..
519+ h1(p("align=center", u("widelands.org")))
520 }
521
522=== modified file 'data/scripting/richtext.lua'
523--- data/scripting/richtext.lua 2018-01-07 18:04:57 +0000
524+++ data/scripting/richtext.lua 2018-01-20 11:37:48 +0000
525@@ -442,3 +442,19 @@
526 div("width=100%", font("size=13 color=D1D1D1", header .. " ") ..
527 font("size=12", text))
528 end
529+
530+-- RST
531+-- .. function:: join_sentences(sentence1, sentence2)
532+--
533+-- Joins 2 sentences together. Use this rather than manually concatenating
534+-- a blank space, because some languages don't use blank spaces.
535+--
536+-- :arg sentence1: text of the first sentence
537+-- :arg sentence2: text of the second sentence
538+-- :returns: two concatenated sentences with a localized sentence joiner.
539+--
540+function join_sentences(sentence1, sentence2)
541+ -- TRANSLATORS: Put 2 sentences one after the other.
542+ -- TRANSLATORS: Languages using Chinese script probably want to lose the blank space here.
543+ return pgettext("sentence_separator", "%s %s"):bformat(sentence1, sentence2)
544+end

Subscribers

People subscribed via source and target branches

to status/vote changes: