Merge lp:~widelands-dev/widelands/toolbar-dropdown-scripting-review-only into lp:widelands

Proposed by GunChleoc on 2019-06-01
Status: Merged
Merged at revision: 9174
Proposed branch: lp:~widelands-dev/widelands/toolbar-dropdown-scripting-review-only
Merge into: lp:widelands
Prerequisite: lp:~widelands-dev/widelands/fix-dropdowns
Diff against target: 2476 lines (+966/-608)
10 files modified
data/campaigns/tutorial01_basic_control.wmf/elemental (+1/-1)
data/campaigns/tutorial01_basic_control.wmf/scripting/helper_functions_demonstration.lua (+12/-0)
data/campaigns/tutorial01_basic_control.wmf/scripting/mission_thread.lua (+124/-75)
data/campaigns/tutorial01_basic_control.wmf/scripting/texts.lua (+403/-244)
data/campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua (+38/-47)
data/campaigns/tutorial04_economy.wmf/scripting/texts.lua (+288/-229)
data/scripting/editor/editor_help.lua (+1/-1)
data/scripting/messages.lua (+78/-5)
data/scripting/richtext.lua (+11/-4)
data/scripting/richtext_scenarios.lua (+10/-2)
To merge this branch: bzr merge lp:~widelands-dev/widelands/toolbar-dropdown-scripting-review-only
Reviewer Review Type Date Requested Status
Widelands Developers 2019-06-01 Pending
Review via email: mp+368228@code.launchpad.net

Description of the change

DO NOT MERGE, THIS WILL BREAK THE TUTORIALS!

Split off tutorial and scripting changes from

https://code.launchpad.net/~widelands-dev/widelands/toolbar-dropdown-menus

for easier review.

Use this merge request for reviewing the scripting changes, and the other branch's merge request for reviewing the C++ changes. When the review is done, merge the other branch and delete this one.

To post a comment you must log in.
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5118. State: failed. Details: https://travis-ci.org/widelands/widelands/builds/540142919.
Appveyor build 4900. State: failed. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_toolbar_dropdown_scripting_review_only-4900.

Klaus Halfmann (klaus-halfmann) wrote :

Gun: now this got merged, what kind of accident was this?

GunChleoc (gunchleoc) wrote :

I think it's just Launchpad or Bunnybot getting confused because of the unmerged prerequisite in their messages. The code in trunk is fine - the new UI test got added. which means that the correct branch was merged.

clang-format separated some translators' comments from their strings though, so I'll have to fix trunk for that.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/campaigns/tutorial01_basic_control.wmf/elemental'
2--- data/campaigns/tutorial01_basic_control.wmf/elemental 2014-10-28 09:24:36 +0000
3+++ data/campaigns/tutorial01_basic_control.wmf/elemental 2019-06-01 15:39:16 +0000
4@@ -6,5 +6,5 @@
5 map_h="64"
6 nr_players="1"
7 name=_"Basic Control"
8-author="Winterwind,SirVer,Nasenbaer,wl-zocker"
9+author="Winterwind,SirVer,Nasenbaer,wl-zocker,GunChleoc"
10 descr=_"In this tutorial, you will learn how to navigate in Widelands and how to build buildings and roads."
11
12=== modified file 'data/campaigns/tutorial01_basic_control.wmf/scripting/helper_functions_demonstration.lua'
13--- data/campaigns/tutorial01_basic_control.wmf/scripting/helper_functions_demonstration.lua 2016-12-28 22:11:45 +0000
14+++ data/campaigns/tutorial01_basic_control.wmf/scripting/helper_functions_demonstration.lua 2019-06-01 15:39:16 +0000
15@@ -68,6 +68,18 @@
16 blocker:lift_blocks()
17 end
18
19+
20+function select_item_from_dropdown(name, item)
21+ local blocker = UserInputDisabler:new()
22+
23+ wl.ui.MapView().dropdowns[name]:highlight_item(item)
24+ sleep(5000)
25+ wl.ui.MapView().dropdowns[name]:select()
26+ sleep(3000)
27+
28+ blocker:lift_blocks()
29+end
30+
31 -- Make sure the user is in road building mode starting from the given flag
32 function enter_road_building_mode(flag)
33 local mv = wl.ui.MapView()
34
35=== modified file 'data/campaigns/tutorial01_basic_control.wmf/scripting/mission_thread.lua'
36--- data/campaigns/tutorial01_basic_control.wmf/scripting/mission_thread.lua 2017-06-25 12:53:48 +0000
37+++ data/campaigns/tutorial01_basic_control.wmf/scripting/mission_thread.lua 2019-06-01 15:39:16 +0000
38@@ -2,17 +2,61 @@
39 -- Mission thread
40 -- ================
41
42+local objective_to_explain_objectives = add_campaign_objective(obj_initial_close_objectives_window)
43+
44+local function wait_for_quarry_road_connection(field, cs, objective)
45+ -- Wait till the construction site is connected to the headquarters
46+ sleep(10 * wl.Game().desired_speed)
47+ while not field.immovable or field.brn.immovable.debug_economy ~= sf.brn.immovable.debug_economy do
48+ if not field.immovable then
49+ campaign_message_box(quarry_illegally_destroyed)
50+ scroll_to_field(field)
51+ mouse_to_field(field)
52+
53+ cs = nil
54+ immovable_is_legal = function(i)
55+ -- only allow quarry and flag at this position because the road building below relies on this
56+ if (i.fields[1] == field) or (i.fields[1] == field.brn) then
57+ cs = allow_constructionsite(i, {"barbarians_quarry"})
58+ return cs
59+ elseif(i.descr.type_name == "flag") or (i.descr.type_name == "road") then
60+ register_immovable_as_allowed(i)
61+ return true
62+ else return false end
63+ end
64+
65+ -- Wait for a new constructionsite to be placed
66+ while not cs do sleep(200) end
67+ register_immovable_as_allowed(cs)
68+ else
69+ campaign_message_box(quarry_not_connected)
70+ end
71+ sleep(60*1000)
72+ end
73+ set_objective_done(objective, 0)
74+ register_immovable_as_allowed(cs)
75+end
76+
77 function starting_infos()
78+ -- So that the player cannot build anything here
79+ map:place_immovable("debris00", second_quarry_field, "world")
80 reveal_concentric(plr, sf, 13, true, 80)
81- map:place_immovable("debris00",second_quarry_field, "world")
82- -- so that the player cannot build anything here
83-
84 sleep(1000)
85
86- message_box_objective(plr, initial_message_01)
87+ -- Welcome and teach objectives
88+ local o = campaign_message_with_objective(initial_message_01, obj_initial_close_story_window)
89+ set_objective_done(o, 100)
90+
91+ wl.ui.MapView().buttons.objectives:click()
92+ while not wl.ui.MapView().windows.objectives do sleep(100) end
93+ while wl.ui.MapView().windows.objectives do sleep(100) end
94 sleep(500)
95
96- local o = message_box_objective(plr, initial_message_02)
97+ -- Teach building spaces
98+ campaign_message_box(initial_message_02, 200)
99+ select_item_from_dropdown("dropdown_menu_showhide", 1)
100+ select_item_from_dropdown("dropdown_menu_showhide", 1)
101+ local o = campaign_message_with_objective(initial_message_03, obj_initial_toggle_building_spaces)
102
103 -- Wait for buildhelp to come on
104 while not wl.ui.MapView().buildhelp do
105@@ -30,7 +74,7 @@
106 -- We take control, everything that we build is legal
107 immovable_is_legal = function(i) return true end
108
109- message_box_objective(plr, lumberjack_message_01)
110+ campaign_message_box(lumberjack_message_01)
111
112 local blocker = UserInputDisabler:new()
113 close_windows()
114@@ -38,7 +82,7 @@
115 scroll_to_field(first_lumberjack_field)
116 mouse_to_field(first_lumberjack_field)
117 sleep(500)
118- message_box_objective(plr, lumberjack_message_02)
119+ campaign_message_box(lumberjack_message_02)
120 sleep(500)
121
122 click_on_field(first_lumberjack_field)
123@@ -48,16 +92,16 @@
124 sleep(500)
125
126 if wl.ui.MapView().is_building_road then
127- message_box_objective(plr, lumberjack_message_03a)
128+ campaign_message_box(lumberjack_message_03a)
129 else
130 enter_road_building_mode(first_lumberjack_field.brn.immovable)
131- message_box_objective(plr, lumberjack_message_03b)
132+ campaign_message_box(lumberjack_message_03b)
133 end
134 sleep(500)
135
136 click_on_field(sf.brn)
137
138- message_box_objective(plr, lumberjack_message_04)
139+ campaign_message_box(lumberjack_message_04)
140
141 register_immovable_as_allowed(first_lumberjack_field.immovable) -- hut + flag
142
143@@ -72,7 +116,7 @@
144
145 if not (f.immovable and f.immovable.descr.type_name == "flag") then
146 -- only show this if the user has not already built a flag
147- local o = message_box_objective(plr, lumberjack_message_05)
148+ local o = campaign_message_with_objective(lumberjack_message_05, obj_lumberjack_place_flag)
149
150 local blocker = UserInputDisabler:new()
151 close_windows()
152@@ -85,27 +129,35 @@
153
154 -- Wait for flag
155 while not (f.immovable and f.immovable.descr.type_name == "flag") do sleep(300) end
156- set_objective_done(o, 300)
157-
158- message_box_objective(plr, lumberjack_message_06)
159+ set_objective_done(o, 16 * 1000)
160 else
161 -- if the flag is already built, show the player a different message box
162- message_box_objective(plr, flag_built)
163+ campaign_message_box(lumberjack_message_06, 3 * 1000)
164 end
165
166- sleep(30*1000) -- let the player experiment a bit with the speed
167- message_box_objective(plr, construction_site_window)
168+ local o = campaign_message_with_objective(lumberjack_message_07, obj_lumberjack_progress)
169+ scroll_to_field(first_lumberjack_field)
170+ mouse_to_field(first_lumberjack_field)
171+
172+ while not wl.ui.MapView().windows.building_window do sleep(100) end
173+ while wl.ui.MapView().windows.building_window do sleep(100) end
174+ set_objective_done(o)
175+
176+ campaign_message_box(lumberjack_message_08)
177+ wl.ui.MapView().dropdowns["dropdown_menu_gamespeed"]:open()
178+
179+ sleep(20*1000) -- let the player experiment a bit with the window
180
181 while #plr:get_buildings("barbarians_lumberjacks_hut") < 1 do sleep(300) end
182
183- message_box_objective(plr, lumberjack_message_07)
184+ campaign_message_box(lumberjack_message_09)
185
186 learn_to_move()
187 end
188
189 function learn_to_move()
190 -- Teaching the user how to scroll on the map
191- local o = message_box_objective(plr, inform_about_rocks)
192+ local o = campaign_message_with_objective(tell_about_keyboard_move, obj_moving_keyboard)
193
194 function _wait_for_move()
195 local center_map_pixel = wl.ui.MapView().center_map_pixel
196@@ -118,12 +170,17 @@
197 _wait_for_move()
198 set_objective_done(o)
199
200- o = message_box_objective(plr, tell_about_right_drag_move)
201+ o = campaign_message_with_objective(tell_about_right_drag_move, obj_moving_right_drag)
202
203 _wait_for_move()
204 set_objective_done(o)
205
206- o = message_box_objective(plr, tell_about_minimap)
207+ -- Teach the minimap
208+ campaign_message_box(tell_about_minimap_1)
209+
210+ -- Open the minimap
211+ select_item_from_dropdown("dropdown_menu_mapview", 1)
212+ o = campaign_message_with_objective(tell_about_minimap_2, obj_moving_minimap)
213
214 -- Wait until the minimap has been opened and closed again
215 while not wl.ui.MapView().windows.minimap do sleep(100) end
216@@ -131,7 +188,7 @@
217
218 set_objective_done(o, 500)
219
220- message_box_objective(plr, congratulate_and_on_to_quarry)
221+ campaign_message_box(congratulate_and_on_to_quarry)
222
223 build_a_quarry()
224 end
225@@ -140,7 +197,7 @@
226 sleep(200)
227
228 -- Teaching how to build a quarry and the nits and knacks of road building.
229- local o = message_box_objective(plr, order_quarry_recap_how_to_build)
230+ local o = campaign_message_with_objective(order_quarry_recap_how_to_build, obj_build_a_quarry)
231
232 local cs = nil
233 immovable_is_legal = function(i)
234@@ -174,12 +231,12 @@
235
236 immovable_is_legal = function() return true end
237
238- sleep(3000) -- give the game some time to enter road building mode
239+ sleep(wl.Game().desired_speed) -- give the game some time to enter road building mode
240 if wl.ui.MapView().is_building_road then
241- message_box_objective(plr, talk_about_roadbuilding_00a)
242+ campaign_message_box(talk_about_roadbuilding_00a)
243 else
244 -- show the user how to enter road building mode manually
245- message_box_objective(plr, talk_about_roadbuilding_00b)
246+ campaign_message_box(talk_about_roadbuilding_00b)
247 click_on_field(first_quarry_field.brn)
248 click_on_panel(wl.ui.MapView().windows.field_action.buttons.build_road, 300)
249 end
250@@ -195,7 +252,7 @@
251
252 _rip_road()
253
254- message_box_objective(plr, talk_about_roadbuilding_01)
255+ campaign_message_box(talk_about_roadbuilding_01)
256 -- Showoff direct roadbuilding
257 click_on_field(first_quarry_field.brn)
258 click_on_panel(wl.ui.MapView().windows.field_action.buttons.build_road, 300)
259@@ -207,7 +264,7 @@
260
261 blocker:lift_blocks()
262
263- local o = message_box_objective(plr, talk_about_roadbuilding_02)
264+ local o = campaign_message_with_objective(talk_about_roadbuilding_02, obj_build_road_to_quarry)
265
266 -- The player is allowed to build roads and flags at will
267 immovable_is_legal = function(i)
268@@ -217,13 +274,7 @@
269 else return false end
270 end
271
272- -- Wait till the construction site is connected to the headquarters
273- sleep(20*1000)
274- while first_quarry_field.brn.immovable.debug_economy ~= sf.brn.immovable.debug_economy do
275- message_box_objective(plr,quarry_not_connected)
276- sleep(60*1000)
277- if not first_quarry_field.immovable then message_box_objective(plr,quarry_illegally_destroyed) return end
278- end
279+ wait_for_quarry_road_connection(first_quarry_field, cs, o)
280
281 second_quarry()
282
283@@ -231,7 +282,6 @@
284 census_and_statistics()
285
286 while #plr:get_buildings("barbarians_quarry") < 2 do sleep(1400) end
287- set_objective_done(o, 0)
288
289 messages()
290 end
291@@ -239,9 +289,11 @@
292 function second_quarry()
293 sleep(2000)
294
295- local o = message_box_objective(plr, build_second_quarry)
296+ local o = campaign_message_with_objective(build_second_quarry, obj_build_the_second_quarry)
297+ -- Remove this immovable (debris)
298 second_quarry_field.immovable:remove()
299- -- remove this immovable (debris)
300+ scroll_to_field(first_quarry_field)
301+ mouse_to_field(second_quarry_field)
302
303 local cs = nil
304 immovable_is_legal = function(i)
305@@ -257,18 +309,9 @@
306 -- Wait for the constructionsite to be placed
307 while not cs do sleep(200) end
308
309- sleep(60*1000)
310- while second_quarry_field.brn.immovable.debug_economy ~= sf.brn.immovable.debug_economy do
311- message_box_objective(plr,quarry_not_connected)
312- sleep(60*1000)
313- if not second_quarry_field.immovable then message_box_objective(plr,quarry_illegally_destroyed) return end
314- end
315-
316- set_objective_done(o, 0)
317- register_immovable_as_allowed(cs)
318+ wait_for_quarry_road_connection(second_quarry_field, cs, o)
319 end
320
321-
322 function census_and_statistics()
323 sleep(15000)
324
325@@ -280,40 +323,45 @@
326
327 wl.ui.MapView():abort_road_building()
328
329- message_box_objective(plr, census_and_statistics_00)
330-
331- click_on_field(first_quarry_field.bln)
332- click_on_panel(wl.ui.MapView().windows.field_action.tabs.watch)
333- click_on_panel(wl.ui.MapView().windows.field_action.buttons.census)
334- sleep(300)
335- click_on_field(first_quarry_field.brn)
336- click_on_panel(wl.ui.MapView().windows.field_action.tabs.watch)
337- click_on_panel(wl.ui.MapView().windows.field_action.buttons.statistics)
338-
339- message_box_objective(plr, census_and_statistics_01)
340+ campaign_message_box(census_and_statistics_00)
341+
342+ select_item_from_dropdown("dropdown_menu_showhide", 2)
343+ sleep(200)
344
345 blocker:lift_blocks()
346+
347+ local o = campaign_message_with_objective(census_and_statistics_01, obj_show_statistics)
348+
349+ -- Wait for statistics to come on
350+ while not wl.ui.MapView().statistics do sleep(200) end
351+ set_objective_done(o, 5 * wl.Game().desired_speed)
352+
353+ if (#plr:get_buildings("barbarians_quarry") < 2) then
354+ campaign_message_box(census_and_statistics_02, 200)
355+ end
356 end
357
358 function messages()
359 -- Teach the player about receiving messages
360 sleep(10)
361+ local old_gamespeed = wl.Game().desired_speed
362+ wl.Game().desired_speed = 1000
363
364 send_message(plr, teaching_about_messages.title, teaching_about_messages.body, teaching_about_messages, {heading = teaching_about_messages.heading})
365- local o = add_campaign_objective(teaching_about_messages)
366+ local o = add_campaign_objective(obj_archive_all_messages)
367
368 while #plr.inbox > 0 do sleep(200) end
369 set_objective_done(o, 500)
370
371- local o = message_box_objective(plr, closing_msg_window_00)
372+ local o = campaign_message_with_objective(closing_msg_window_00, obj_close_message_window)
373
374 -- Wait for messages window to close
375 while wl.ui.MapView().windows.messages do sleep(300) end
376- set_objective_done(o, 0)
377-
378- message_box_objective(plr, closing_msg_window_01)
379-
380- sleep(800)
381+ set_objective_done(o, 300)
382+
383+ campaign_message_box(closing_msg_window_01, 800)
384+
385+ if (wl.Game().desired_speed == 1000) then wl.Game().desired_speed = old_gamespeed end
386
387 destroy_quarries()
388 end
389@@ -336,10 +384,7 @@
390 -- Wait for messages to arrive
391 while count_quarry_messages() < 2 do sleep(300) end
392
393- local o = message_box_objective(plr, destroy_quarries_message)
394-
395- -- From now on, the player can build whatever he wants
396- terminate_bad_boy_sentinel = true
397+ local o = campaign_message_with_objective(destroy_quarries_message, obj_destroy_quarries)
398
399 while #plr:get_buildings("barbarians_quarry") > 0 do sleep(200) end
400 set_objective_done(o)
401@@ -351,7 +396,10 @@
402 -- Teach about expanding the territory
403 sleep(10)
404
405- local o = message_box_objective(plr, introduce_expansion)
406+ -- From now on, the player can build whatever he wants
407+ terminate_bad_boy_sentinel = true
408+
409+ local o = campaign_message_with_objective(introduce_expansion, obj_expand_territory)
410
411 -- wait until there are soldiers inside so that the player sees the expansion
412 local soldier_inside = false
413@@ -371,19 +419,20 @@
414 sleep(500)
415 end
416
417- set_objective_done(o)
418- message_box_objective(plr, military_building_finished)
419+ set_objective_done(o, 4 * wl.Game().desired_speed)
420+ campaign_message_box(military_building_finished)
421
422 conclusion()
423 end
424
425 function conclusion()
426+ set_objective_done(objective_to_explain_objectives)
427+
428 sleep(5000) -- to give the player time to see his expanded area
429
430 -- Conclude the tutorial with final words and information
431 -- on how to quit
432- message_box_objective(plr, conclude_tutorial)
433-
434+ campaign_message_box(conclude_tutorial)
435 end
436
437 run(bad_boy_sentry)
438
439=== modified file 'data/campaigns/tutorial01_basic_control.wmf/scripting/texts.lua'
440--- data/campaigns/tutorial01_basic_control.wmf/scripting/texts.lua 2019-02-03 12:02:57 +0000
441+++ data/campaigns/tutorial01_basic_control.wmf/scripting/texts.lua 2019-06-01 15:39:16 +0000
442@@ -2,15 +2,14 @@
443 -- Texts for the tutorial mission
444 -- =======================================================================
445
446--- =========================
447--- Some formating functions
448--- =========================
449-
450 include "scripting/richtext_scenarios.lua"
451
452--- =============
453--- Texts below
454--- =============
455+-- ================
456+-- General messages
457+-- ================
458+
459+local close_story_window_instructions = _[[Click on the ‘OK’ button or press the ‘Enter ⏎’ key on the keyboard to close this window.]]
460+
461 scold_player = {
462 title = _"Nice And Easy Does It All the Time",
463 body = (
464@@ -21,50 +20,93 @@
465 show_instantly = true
466 }
467
468+-- Teaching basic UI controls
469+
470+-- ==============
471+-- Starting Infos
472+-- ==============
473+
474+obj_initial_close_story_window = {
475+ name = "initial_close_story_window",
476+ title=_"Close this window",
477+ number = 1,
478+ body = objective_text(_"Close this window",
479+ li(close_story_window_instructions)
480+ )
481+}
482 initial_message_01 = {
483 title = _"Welcome to the Widelands Tutorial!",
484 body = (
485 h1(_"Welcome to Widelands!") ..
486- p(_[[Widelands is a slow-paced build-up strategy game with an emphasis on construction rather than destruction. This tutorial will guide you through the basics of the game.]]) ..
487- li(_[[Dismiss this box by left-clicking on the button below.]])
488- ),
489- h = 300,
490- w = 400
491-}
492+ li_image("images/logos/wl-ico-64.png",
493+ _[[Widelands is a slow-paced build-up strategy game with an emphasis on construction rather than destruction. This tutorial will guide you through the basics of the game.]]) ..
494+ li_arrow(_[[You will be guided through this tutorial by objectives]]) ..
495+ li(_[[Follow the intructions in the objective below so that I can show you where to find them.]])
496+ )
497+}
498+
499+obj_initial_close_objectives_window = {
500+ name = "obj_initial_close_objectives_window",
501+ title=_"Objectives and how to close this window",
502+ number = 1,
503+ body = objective_text(_"Closing this window",
504+ p(_[[This is the ‘Objectives’ window. You can return to this window for instructions at any time.]]) ..
505+ li_image("images/wui/menus/objectives.png", _[[ You can open and close this window by clicking on the ‘Objectives’ button in the toolbar on the bottom of the screen.]]) ..
506+ li_arrow(_[[Like any other window, you can also close the ‘Objectives’ window by right-clicking on it.]]) ..
507+ li_arrow(_[[When you have accomplished an objective, it will disappear from the list above.]]) ..
508+ li(_[[Try it out.]])
509+ )
510+}
511+
512+obj_initial_toggle_building_spaces = {
513+ name = "initial_toggle_building_spaces",
514+ title=_"Show building spaces",
515+ number = 1,
516+ body = objective_text(_"Show building spaces",
517+ p(_[[We need to find a nice place for the lumberjack’s hut. To make this easier, we can activate ‘Show Building Spaces’. There are two ways you can do this:]]) ..
518+ li_image("images/wui/menus/showhide.png", _[[Press the Space bar to toggle them, or select ‘Show Building Spaces’ in the ‘Show / Hide’ menu.]]) ..
519+ li(_[[Show the building spaces now.]])
520+ )
521+}
522+
523 initial_message_02 = {
524- title = _"Diving In",
525- position = "topright",
526- field = sf,
527- body = (
528- h1(_"Let’s dive right in!") ..
529- p(_[[There are three different tribes in Widelands: the Barbarians, the Empire and the Atlanteans. All tribes have a different economy, strength and weaknesses, but the general gameplay is the same for all. We will play the Barbarians for now.]]) ..
530- p(_[[You will usually start the game with one headquarters. This is the big building with the blue flag in front of it. The headquarters is a warehouse that stores wares, workers and soldiers. Some wares are needed for building houses, others for making other wares. Obviously, the wares in the headquarters will not last forever, so you must make sure to replace them. The most important wares in the early game are the basic construction wares: logs and granite. Let’s make sure that we do not run out of logs. For this, we need a lumberjack and a hut for him to stay in.]]) ..
531- p(_[[We need to find a nice place for the lumberjack’s hut. To make this easier, we can activate ‘Show building spaces’. There are two ways you can do this:]]) ..
532- li_arrow(_[[Press the Space bar to toggle them, or]]) ..
533- -- TRANSLATORS: List item. Has an image of the button next to it.
534- li_image("images/wui/menus/menu_toggle_buildhelp.png", _[[click the ‘Show building spaces’ button on the bottom of the screen.]]) ..
535- li(_[[Left-click the ‘OK’ button to close this box and then try it.]])
536- ),
537- obj_name = "enable_buildhelp",
538- obj_title = _"Enable the showing of building spaces",
539- obj_body = (
540- h1(_"Show Building Spaces") ..
541- p(_[[It is easier to understand what type of buildings can be built on which field when the symbols for the building spaces are enabled.]]) ..
542- li_arrow(_[[Press the Space bar to toggle them, or]]) ..
543- -- TRANSLATORS: List item. Has an image of the button next to it.
544- li_image("images/wui/menus/menu_toggle_buildhelp.png", _[[click the ‘Show building spaces’ button on the bottom of the screen.]]) ..
545- li(_[[Right-click on this window now and then give it a try.]])
546- )
547-}
548+ title = _"Building Spaces",
549+ position = "topright",
550+ field = sf,
551+ body = (
552+ h1(_"Let’s dive right in!") ..
553+ li_image("tribes/images/barbarians/icon.png",
554+ _[[There are four different tribes in Widelands: the Barbarians, the Empire, the Atlanteans and the Frisians. All tribes have a different economy, strength and weaknesses, but the general gameplay is the same for all. We will play the Barbarians for now.]]) ..
555+ li_object("barbarians_headquarters", _[[You will usually start the game with one headquarters. This is the big building with the blue flag in front of it. The headquarters is a warehouse that stores wares, workers and soldiers. Some wares are needed for building houses, others for making other wares. Obviously, the wares in the headquarters will not last forever, so you must make sure to replace them. The most important wares in the early game are the basic construction wares: logs and granite. Let’s make sure that we do not run out of logs. For this, we need a lumberjack and a hut for him to stay in.]], plr.color) ..
556+ p(_[[We need to find a nice place for the lumberjack’s hut. To make this easier, we can activate ‘Show Building Spaces’.]]) ..
557+ li(_[[Left-click the ‘OK’ button to close this window so that I can show you how.]]) ..
558+ li_arrow(_[[Note that you cannot close this window by right-clicking on it. I have blocked this so that you will not close it by accident and miss important information.]])
559+ )
560+}
561+
562+initial_message_03 = {
563+ title = _"Building Spaces",
564+ position = "topright",
565+ field = sf,
566+ body = (
567+ h1(_"Let’s dive right in!") ..
568+ li_object("barbarians_lumberjacks_hut", _[[Now that I have shown you how to show and hide the building spaces, please switch them on again so that we can place our first building.]], plr.color)
569+ )
570+}
571+
572+-- ==========
573+-- Lumberjack
574+-- ==========
575
576 lumberjack_message_01 = {
577 title = _"Lumberjack’s Spot",
578 position = "topright",
579 field = first_lumberjack_field,
580 body = (
581- p(_[[There you go. I will explain about all those symbols in a minute. First, let me show you how to make a lumberjack’s hut and how to connect it with a road. There is a sweet spot for a lumberjack right next to those trees. I’ll describe the steps I will take and then ask you to click on the ‘OK’ button for me to demonstrate.]])
582+ li_object("barbarians_lumberjacks_hut",
583+ _[[There you go. I will explain about all those symbols in a minute. First, let me show you how to make a lumberjack’s hut and how to connect it with a road. There is a sweet spot for a lumberjack right next to those trees. I’ll describe the steps I will take and then ask you to click on the ‘OK’ button for me to demonstrate.]], plr.color)
584 ),
585- h = 300,
586+ h = 250,
587 w = 350
588 }
589
590@@ -72,20 +114,23 @@
591 title = _"Building the Lumberjack",
592 position = "topright",
593 body = (
594- p(_[[First, I’ll left-click on the symbol where I want the lumberjack’s hut to be built. A window will appear where I can choose between buildings. Because I’ll click a yellow house symbol – which means that its field can house medium and small buildings – I am presented with all the medium buildings that I can build. The lumberjack’s hut is a small building, so I will go on to select the small buildings tab. Then I’ll choose the lumberjack’s hut.]]) ..
595+ li_object("barbarians_lumberjacks_hut",
596+ _[[First, I’ll left-click on the symbol where I want the lumberjack’s hut to be built. A window will appear where I can choose between buildings. Because I’ll click a yellow house symbol – which means that its field can house medium and small buildings – I am presented with all the medium buildings that I can build. The lumberjack’s hut is a small building, so I will go on to select the small buildings tab. Then I’ll choose the lumberjack’s hut.]], plr.color) ..
597 li(_[[Click the ‘OK’ button to watch me. I’ll go really slowly: I will click – then select the tab – and finally I’ll choose the building.]])
598 ),
599- h = 300
600+ h = 300,
601+ w = 350
602 }
603
604 lumberjack_message_03a = {
605 title = _"Building a Connecting Road",
606 position = "topright",
607 body = (
608- p(_[[That won’t do yet. I still need to connect the lumberjack’s hut to the rest of my road network. After ordering the construction site, I was automatically put into road building mode, so all I have to do is click on the blue flag in front of my headquarters.]])
609+ li_image("images/wui/fieldaction/menu_tab_buildroad.png", _[[That won’t do yet. I still need to connect the lumberjack’s hut to the rest of my road network. After ordering the construction site, I was automatically put into road building mode, so all I have to do is click on the blue flag in front of my headquarters.]]) ..
610+ li(close_story_window_instructions)
611 ),
612 show_instantly = true,
613- h = 300,
614+ h = 200,
615 w = 350
616 }
617
618@@ -93,10 +138,12 @@
619 title = _"Building a Connecting Road",
620 position = "topright",
621 body = (
622- p(_[[That won’t do yet. I still need to connect the lumberjack’s hut to the rest of my road network. You have disabled the option ‘Start building road after placing a flag’ (to change that, choose ‘Options’ in the Widelands main menu). Therefore, I have entered the road building mode manually. I will tell you later how to do that. To build the road, all I have to do now is click on the blue flag in front of my headquarters.]])
623+ li_image("images/wui/fieldaction/menu_tab_buildroad.png",
624+ _[[That won’t do yet. I still need to connect the lumberjack’s hut to the rest of my road network. You have disabled the option ‘Start building road after placing a flag’ (to change that, choose ‘Options’ in the Widelands main menu). Therefore, I have entered the road building mode manually. I will tell you later how to do that. To build the road, all I have to do now is click on the blue flag in front of my headquarters.]]) ..
625+ li(close_story_window_instructions)
626 ),
627 show_instantly = true,
628- h = 300,
629+ h = 250,
630 w = 350
631 }
632
633@@ -104,169 +151,230 @@
634 title = _"Waiting for the Lumberjack to Go Up",
635 position = "topright",
636 body = (
637- p(_[[Now watch closely while a builder leaves the headquarters and goes to the construction site. Also, a carrier will take position in between the two blue flags and carry wares from one blue flag to the other.]])
638+ li_object("barbarians_builder",
639+ _[[Now watch closely while a builder leaves the headquarters and goes to the construction site. Also, a carrier will take position in between the two blue flags and carry wares from one blue flag to the other.]], plr.color) ..
640+ li(close_story_window_instructions)
641+ ),
642+ h = 200,
643+ w = 350
644+}
645+
646+obj_lumberjack_place_flag = {
647+ name = "obj_lumberjack_place_flag",
648+ title=_"Build a flag to divide the road to the lumberjack",
649+ number = 1,
650+ body = objective_text(_"Build a Flag on the Road",
651+ p(_[[The shorter your road segments are, the faster your wares will be transported. You should therefore make sure that your roads have as many flags as possible.]]) ..
652+ li(_[[Build a blue flag now in the middle of the road that connects your headquarters to your lumberjack’s hut.]]) ..
653+ li_image("images/wui/fieldaction/menu_build_flag.png",_[[To build the flag, click on the yellow flag symbol in between the two blue flags we just placed and then click on the build flag symbol.]])
654 ),
655 h = 300,
656 w = 350
657 }
658-
659 lumberjack_message_05 = {
660 title = _"Placing Another Flag",
661 position = "topright",
662 body = (
663- p(_[[Nice how they are working, isn’t it? But the poor carrier has a very long way to go. We can make it easier for him (and more efficient for us) by placing another blue flag on the road.]]) ..
664- li(_[[You try it this time: click on the yellow flag symbol in between the two blue flags we just placed and then click on the]]) ..
665- li_image("images/wui/fieldaction/menu_build_flag.png", _"build flag symbol.")
666+ li_object("barbarians_carrier",
667+ _[[Nice how they are working, isn’t it? But the poor carrier has a very long way to go. We can make it easier for him (and more efficient for us) by placing another blue flag on the road. You try it this time.]], plr.color)
668 ),
669- h = 300,
670- obj_name = "build_flag_on_road_to_lumberjack",
671- obj_title = _"Build a flag to divide the road to the lumberjack",
672- obj_body = (
673- h1(_"Build a Flag on the Road") ..
674- p(_[[The shorter your road segments are, the faster your wares will be transported. You should therefore make sure that your roads have as many flags as possible.]]) ..
675- li(_[[Build a blue flag now in the middle of the road that connects your headquarters to your lumberjack’s hut.]])
676- )
677+ h = 450,
678+ w = 350
679 }
680
681 lumberjack_message_06 = {
682- title = _"Waiting For the Hut to be Finished",
683- position = "topright",
684- body = (
685- p(_[[Well done! Let’s wait till the hut is finished.]]) ..
686- p(_[[If you want things to go faster, simply use the Page Up key on your keyboard to increase the game speed. You can use Page Down to make the game slower again.]])
687- ),
688- h = 300,
689- w = 350
690-}
691-
692-flag_built = {
693- title = _"Waiting for the Hut to be Finished",
694- position = "topright",
695- body = (
696- p(_[[I wanted to teach you how to build new flags, but it seems you have already found out on your own. Well done!]]) ..
697+ title = _"Waiting for the Lumberjack to Go Up",
698+ position = "topright",
699+ body = (
700+ li_image("images/wui/fieldaction/menu_tab_buildroad.png",
701+ _[[I wanted to teach you how to build new flags, but it seems you have already found out on your own. Well done!]]) ..
702 p(_[[Now you have split the road in two parts with a carrier each. This means less work for him and higher efficiency for us. You should therefore always place as many flags as possible on your roads.]]) ..
703- p(_[[Now we only have to wait till the hut is finished.]]) ..
704- p(_[[If you want things to go faster, simply use the Page Up key on your keyboard to increase the game speed. You can use Page Down to make the game slower again.]])
705+ li(close_story_window_instructions)
706 ),
707- h = 350
708+ h = 250,
709+ w = 350
710 }
711
712-construction_site_window = {
713+obj_lumberjack_progress = {
714+ name = "obj_lumberjack_progress",
715+ title=_"Let’s see the progress",
716+ number = 1,
717+ body = objective_text(_"Let’s see the progress",
718+ li(_[[Click on the construction site to have a look at it, then close it again when you have seen enough.]]) ..
719+ li_arrow(_[[To close the construction site’s window, simply right-click on it.]])
720+ ),
721+ h = 300,
722+ w = 350
723+}
724+lumberjack_message_07 = {
725 title = _"The Construction Site",
726- body = (
727- h1(_"Let's see the progress") ..
728- p(_[[If you click on the construction site, a window will open. You can see the wares that are still missing grayed out. You can also see the progress of this construction site.]]) ..
729- -- The player doesn't know about the statistics yet. First things first.
730- p(_[[To close the window, simply right-click on it. All windows in Widelands can be closed that way, except the ones with instructions, like this one. Try it out!]])
731- ),
732- h = 300,
733- w = 350
734-}
735-
736-lumberjack_message_07 = {
737+ position = "topright",
738+ body = (
739+ h1(_"Let’s see the progress") ..
740+ li_object("barbarians_builder", _[[If you click on the construction site, a window will open. You can see the wares that are still missing grayed out. You can also see the progress of this construction site.]], plr.color)
741+ ),
742+ h = 450,
743+ w = 350
744+}
745+
746+lumberjack_message_08 = {
747+ title = _"Waiting for the Lumberjack to Go Up",
748+ position = "topright",
749+ body = (
750+ p(_[[Well done! Let’s wait till the hut is finished.]]) ..
751+ li_image("images/wui/menus/gamespeed.png",
752+ _[[If you want things to go faster, simply use the Page Up key on your keyboard to increase the game speed. You can use Page Down to make the game slower again.]])
753+ ),
754+ h = 200,
755+ w = 350
756+}
757+
758+lumberjack_message_09 = {
759 title = _"The Lumberjack’s Hut is Done",
760 position = "topright",
761 body = (
762- p(_[[Excellent. The lumberjack’s hut is done. A lumberjack will now move in and start chopping down trees, so our log income is secured for now. Now on to the granite.]])
763+ li_object("barbarians_lumberjacks_hut", _[[Excellent. The lumberjack’s hut is done. A lumberjack will now move in and start chopping down trees, so our log income is secured for now. Now on to the granite.]], plr.color)
764 ),
765- h = 300,
766+ h = 200,
767 w = 350
768 }
769
770-inform_about_rocks = {
771+-- ==================
772+-- Moving the mapview
773+-- ==================
774+
775+local moving_view_instructions =
776+ h2(_"Moving Your View") ..
777+ p(_[[Moving your view is essential to get a complete overview of your whole economy. There are three ways to move your view in Widelands.]]) ..
778+ li_arrow(_[[The first one is to use the cursor keys on your keyboard.]]) ..
779+ li_arrow(_[[The second one is the more common and faster one: press-and-hold the right mouse button anywhere on the map, then move your mouse around and you’ll see the view scroll.]]) ..
780+ li_arrow(_[[The third one is to use the minimap. It is especially useful for traveling big distances.]])
781+
782+
783+obj_moving_keyboard = {
784+ name = "move_view_with_cursor_keys",
785+ title=_"Move your view with the cursor keys",
786+ number = 1,
787+ body = objective_text(_"Move your view with the cursor keys",
788+ li(_[[There are three ways to move your view. The first one is using the cursor keys on your keyboard. Go ahead and try this out.]]) .. moving_view_instructions
789+ ),
790+}
791+tell_about_keyboard_move = {
792 title = _"Some Rocks Were Found",
793 body = (
794 h1(_"Getting a Quarry Up") ..
795- p(_[[Granite can be mined in granite mines, but the easier way is to build a quarry next to some rocks lying around. As it happens, there is a pile of them just to the west (left) of your headquarters. I will teach you now how to move your view over there.]]) ..
796- li(_[[There are three ways to move your view. The first one is using the cursor keys on your keyboard. Go ahead and try this out.]]) ..
797- li(_[[Click the ‘OK’ button and then move the view using the cursor keys.]])
798+ li_object("greenland_rocks6",
799+ _[[Granite can be mined in granite mines, but the easier way is to build a quarry next to some rocks lying around. As it happens, there is a pile of them just to the west (left) of your headquarters. I will teach you now how to move your view over there.]])
800 ),
801- h = 350,
802- obj_name = "move_view_with_cursor_keys",
803- obj_title = _"Move your view with the cursor keys",
804- obj_body = (
805- h1(_"Moving Your View") ..
806- p(_[[Moving your view is essential to get a complete overview of your whole economy. There are three ways to move your view in Widelands.]]) ..
807- li(_[[The first one is to use the cursor keys on your keyboard.]]) ..
808- li(_[[The second one is the more common and faster one: press-and-hold the right mouse button anywhere on the map, then move your mouse around and you’ll see the view scroll.]]) ..
809- li(_[[The third one is to use the minimap. It is especially useful for traveling big distances.]])
810- )
811+ h = 450,
812 }
813
814+obj_moving_right_drag = {
815+ name = "move_view_with_mouse",
816+ title=_"Move your view with the mouse",
817+ number = 1,
818+ body = objective_text(_"Move your view with the mouse",
819+ li(_[[Simply right-click-and-hold anywhere on the map, then drag the mouse and instead of the cursor, the view will be moved. Try it.]]) .. moving_view_instructions
820+ ),
821+}
822 tell_about_right_drag_move = {
823- title = _"Other Ways to Move the View",
824+ title = _"Moving Your View",
825 body = (
826- p(_[[Excellent. Now there is a faster way to move, using the mouse instead:]]) ..
827- li(_[[Simply right-click-and-hold anywhere on the map, then drag the mouse and instead of the cursor, the view will be moved. Try it.]])
828+ h1(_"Other Ways to Move the View") ..
829+ li_image("images/ui_basic/cursor_click.png",
830+ _[[Excellent. Now there is a faster way to move, using the mouse instead.]])
831 ),
832- h = 300,
833- w = 350,
834- obj_name = "move_view_with_mouse",
835- obj_title = _"Move your view with the mouse",
836- obj_body = inform_about_rocks.obj_body,
837+ h = 450,
838 }
839
840-tell_about_minimap = {
841- title = _"Use the minimap",
842- body = (
843- p(_[[Very good. And now about the minimap. You can open it by clicking on the]]) ..
844- li_image("images/wui/menus/menu_toggle_minimap.png", _[[minimap button at the bottom of the screen or simply by using the keyboard shortcut ‘m’.]]) ..
845- p(_[[The minimap shows the complete map in miniature. You can directly jump to any field by left-clicking on it. You can also toggle buildings, roads, flags and player indicators on and off inside the minimap.]]) ..
846- li(_[[Try it out. Open the minimap, click on a few buttons and try moving around. Close it when you have experimented enough.]])
847- ),
848- h = 350,
849- obj_name = "use_minimap",
850- obj_title = _"Learn to use the minimap",
851- obj_body = (
852- li(_[[Open the minimap by using the third button from the left on the bottom of your screen or the ‘m’ key.]]) ..
853+obj_moving_minimap = {
854+ name = "use_minimap",
855+ title=_"Learn to use the minimap",
856+ number = 1,
857+ body = objective_text(_"Learn to use the minimap",
858+ li(_[[Try moving around by clicking on the minimap]]) ..
859 li(_[[Play around a bit with the different overlays (roads, flags, etc.)]]) ..
860- li(_[[Close the minimap when you are ready to continue by using the same button or ‘m’ again. Of course, a right-click also works.]])
861- )
862+ li(_[[When you are ready to continue, close the minimap by selecting ‘Hide Minimap’ in the ‘Map View’ menu or by pressing ‘m’. Of course, a right-click also works.]])
863+ ),
864+}
865+tell_about_minimap_1 = {
866+ title = _"Moving Your View",
867+ body = (
868+ h1(_"Using the Minimap") ..
869+ li_image("images/wui/menus/toggle_minimap.png",
870+ p(_[[Very good. And now about the minimap. ]]) ..
871+ -- TRANSLATORS it = the minimap
872+ p(_[[You can open it by selecting the ‘Show Minimap’ entry in the ‘Map View’ menu at the bottom of the screen or simply by using the keyboard shortcut ‘m’.]])) ..
873+ -- TRANSLATORS it = the minimap
874+ li_arrow(_[[I will open it for you.]])
875+ ),
876+ w = 350,
877+ h = 250,
878+}
879+
880+tell_about_minimap_2 = {
881+ title = _"Moving Your View",
882+ body = (
883+ h1(_"Using the Minimap") ..
884+ li_image("images/wui/menus/toggle_minimap.png",
885+ _([[The minimap shows the complete map in miniature. ]]
886+ .. [[You can directly jump to any field by left-clicking on it. ]]
887+ .. [[You can also toggle buildings, roads, flags and player indicators on and off inside the minimap.]]))
888+ ),
889+ h = 450,
890 }
891
892 congratulate_and_on_to_quarry = {
893 title = _"Onward to the Quarry",
894- body = p(_[[Great. Now about that quarry…]]),
895+ body = li_object("greenland_rocks6",_[[Great. Now about that quarry…]]),
896 h = 200,
897 w = 250
898 }
899
900+-- ======
901+-- Quarry
902+-- ======
903+
904+obj_build_a_quarry = {
905+ name = "build_a_quarry",
906+ title=_"Build a quarry next to the rocks",
907+ number = 1,
908+ body = objective_text(_"Build a Quarry",
909+ li(_[[There are some rocks to the west of your headquarters. Build a quarry right next to them.]]) ..
910+ li_image("images/wui/overlays/small.png", _[[The quarry is a small building like the lumberjack’s hut. You can therefore build it on any field that shows a red, yellow or green house when the building spaces symbols are enabled (Press Space for that).]]) ..
911+ li_arrow(_[[Just click on any house symbol next to the rocks, select the small buildings tab in the window that opens up, then click on the quarry symbol.]])
912+ ),
913+}
914 order_quarry_recap_how_to_build = {
915 field = first_quarry_field,
916 position = "topright",
917 title = _"How to Build a Quarry",
918 body = (
919- p(_[[Build a quarry next to those rocks here. Remember how I did it earlier?]]) ..
920- p(_[[Make sure that you are showing the building spaces, then just click on the space where you want the building to be, choose it from the window that appears, and it is placed. Maybe this is a good time to explain about all those building space symbols we activated earlier.]]) ..
921- p(_[[You can build four things on fields in Widelands: flags, small houses, medium houses and big houses. But not every field can hold everything. The build space symbols ease recognition:]]) ..
922+ li_object("barbarians_quarry",
923+ p(_[[Build a quarry next to those rocks here. Remember how I did it earlier?]]) ..
924+ p(_[[Make sure that you are showing the building spaces, then just click on the space where you want the building to be, choose it from the window that appears, and it is placed. Maybe this is a good time to explain about all those building space symbols we activated earlier.]]) ..
925+ p(_[[You can build four things on fields in Widelands: flags, small houses, medium houses and big houses. But not every field can hold everything. The build space symbols ease recognition:]]), plr.color) ..
926 li_image("images/wui/overlays/big.png", _[[Everything can be built on the green house symbol.]]) ..
927 li_image("images/wui/overlays/medium.png", _[[Everything except for big buildings can be built on a yellow house symbol.]]) ..
928 li_image("images/wui/overlays/small.png", _[[Red building symbols can only hold small buildings and flags.]]) ..
929 li_image("images/wui/overlays/set_flag.png", _[[And finally, the yellow flag symbol only allows for flags.]]) ..
930- p(_[[If you place something on a field, the surrounding fields might have less space for holding buildings, so choose your fields wisely.]]) ..
931- li(_[[Now go ahead, try it. The quarry is a small building, so if you click on a medium or big building symbol, you will have to select the small buildings tab first to find it. Go on, check it out!]])
932- ),
933- obj_name = "build_a_quarry",
934- obj_title = _"Build a quarry next to the rocks",
935- obj_body = (
936- h1(_"Build a Quarry") ..
937- li(_[[There are some rocks to the west of your headquarters. Build a quarry right next to them.]]) ..
938- li(_[[The quarry is a small building like the lumberjack’s hut. You can therefore build it on any field that shows a red, yellow or green house when the building spaces symbols are enabled (Press Space for that).]]) ..
939- li(_[[Just click on any house symbol next to the rocks, select the small buildings tab in the window that opens up, then click on the quarry symbol.]])
940+ p(_[[If you place something on a field, the surrounding fields might have less space for holding buildings, so choose your fields wisely.]])
941 )
942 }
943
944+local explain_abort_roadbuilding = li_image("images/wui/menu_abort.png", _[[If you decide you do not want to build a road at this time, you can cancel road building by clicking on the starting flag of the road and selecting the abort symbol.]])
945+
946 talk_about_roadbuilding_00a = {
947 position = "topright",
948 field = wl.Game().map:get_field(9,12),
949 title = _"Road Building",
950 body = (
951- p(_[[Excellent! Directly after placing the building, you have been switched into road building mode. The new road will start at the flag in front of your newly placed construction site. You can enter road building mode for any flag by left-clicking on a flag and selecting]]) ..
952- li_image("images/wui/fieldaction/menu_build_way.png", _[[the road building symbol.]]) ..
953- p(_[[If you decide you do not want to build a road at this time, you can cancel road building by clicking on the starting flag of the road and selecting]]) ..
954- li_image("images/wui/menu_abort.png", _[[the abort symbol.]]) ..
955+ li_image("images/wui/fieldaction/menu_tab_buildroad.png", _[[Excellent! Directly after placing the building, you have been switched into road building mode. The new road will start at the flag in front of your newly placed construction site.]]) ..
956+ li_image("images/wui/fieldaction/menu_build_way.png", _[[You can enter road building mode for any flag by left-clicking on a flag and selecting the road building symbol.]]) ..
957+ explain_abort_roadbuilding ..
958 p(_[[Now, about this road. Remember: we are already in road building mode since you just ordered the quarry. You can either make it longer by one field at a time by left-clicking multiple times on neighboring fields for perfect control over the route the road takes, like so:]])
959 ),
960+ h = 300,
961 show_instantly = true
962 }
963
964@@ -275,12 +383,11 @@
965 field = road_building_field,
966 title = _"Road Building",
967 body = (
968- p(_[[Excellent! To enter road building mode for any flag, left-click on a flag and select]]) ..
969- li_image("images/wui/fieldaction/menu_build_way.png", _[[the road building symbol.]]) ..
970- p(_[[If you decide that you do not want to build a road at this time, you can cancel road building by clicking on the starting flag of the road and selecting]]) ..
971- li_image("images/wui/menu_abort.png", _[[the abort symbol.]]) ..
972+ li_image("images/wui/fieldaction/menu_build_way.png", _[[ Excellent! To enter road building mode for any flag, left-click on a flag and select the road building symbol.]]) ..
973+ explain_abort_roadbuilding ..
974 p(_[[Now, about this road. I’ll enter the road building mode and then make it longer by one field at a time by left-clicking multiple times on neighboring fields for perfect control over the route the road takes, like so:]])
975 ),
976+ h = 300,
977 show_instantly = true
978 }
979
980@@ -288,38 +395,38 @@
981 position = "topright",
982 field = road_building_field,
983 title = _"Road Building",
984- body = p(_[[Or, you can directly click the flag where the road should end, like so:]]),
985+ body = li_object("barbarians_flag", _[[Or, you can directly click the flag where the road should end, like so:]], plr.color),
986 h = 200,
987 w = 250
988 }
989
990+obj_build_road_to_quarry = {
991+ name = "build_road_to_quarry",
992+ title=_"Connect the quarry to the headquarters",
993+ number = 1,
994+ body = objective_text(_"Connect Your Construction Site",
995+ li(_[[Connect your quarry construction site to your headquarters with a road. You would have been put directly into road building mode after ordering a new site. But now, you aren’t.]]) ..
996+ li_arrow(_[[To build a completely new road, just click on the flag in front of your construction site, click on the build road icon and then click on the flag in front of your headquarters. Wait for the completion of the quarry.]]) ..
997+ li_arrow(_[[If you hold Ctrl or Shift+Ctrl while you finish the road, flags are placed automatically.]])
998+ ),
999+}
1000 talk_about_roadbuilding_02 = {
1001 position = "topright",
1002 title = _"Road Building",
1003 body = (
1004- p(_[[One more thing: around the field where your road would end, you can see different markers. They have the following meaning:]]) ..
1005+ li_image("images/wui/fieldaction/menu_tab_buildroad.png", _[[One more thing: around the field where your road would end, you can see different markers. They have the following meaning:]]) ..
1006 li_image("images/wui/overlays/roadb_green.png", _[[The terrain is flat here. Your carriers will be very swift on this terrain.]]) ..
1007 li_image("images/wui/overlays/roadb_yellow.png", _[[There is a small slope to climb to reach this field. This means that your workers will be faster walking downhill than they will be walking uphill.]]) ..
1008 li_image("images/wui/overlays/roadb_red.png", _[[The connection between the fields is extremely steep. The speed increase in one direction is huge while the slowdown in the other is also substantial.]]) ..
1009- p(_[[Keep the slopes in mind while placing roads and use them to your advantage. Also, try to keep roads as short as possible and always remember to place as many flags as you can on road segments to share the load better.]]) ..
1010- li_arrow(_[[If you hold Ctrl or Shift+Ctrl while you finish the road, flags are placed automatically.]]) ..
1011- li(_[[Now please rebuild the road between your quarry and your headquarters.]])
1012+ p(_[[Keep the slopes in mind while placing roads and use them to your advantage. Also, try to keep roads as short as possible and always remember to place as many flags as you can on road segments to share the load better.]])
1013 ),
1014- h = 450,
1015- obj_name = "build_road_to_quarry",
1016- obj_title = _"Connect the quarry to the headquarters",
1017- obj_body = (
1018- h1(_"Connect Your Construction Site") ..
1019- p(_[[Connect your quarry construction site to your headquarters with a road. You would have been put directly into road building mode after ordering a new site. But now, you aren’t.]]) ..
1020- li_arrow(_[[To build a completely new road, just click on the flag in front of your construction site, click on the build road icon and then click on the flag in front of your headquarters. Wait for the completion of the quarry.]]) ..
1021- li_arrow(_[[If you hold Ctrl or Shift+Ctrl while you finish the road, flags are placed automatically.]])
1022- )
1023+ h = 450
1024 }
1025
1026 quarry_not_connected = {
1027 title = _"Quarry not Connected",
1028 body = (
1029- p(_[[Your workers do not like to walk across country. You have to build a road from your headquarters to the construction site so that carriers can transport wares. The simplest way is to click on the construction site’s flag, choose ‘Build road’, and then click on the destination flag (the one in front of your headquarters), just like I’ve demonstrated.]])
1030+ li_object("barbarians_carrier", _[[Your workers do not like to walk across country. You have to build a road from your headquarters to the construction site so that carriers can transport wares. The simplest way is to click on the construction site’s flag, choose ‘Build road’, and then click on the destination flag (the one in front of your headquarters), just like I’ve demonstrated.]], plr.color)
1031 ),
1032 w = 350,
1033 h = 250
1034@@ -328,87 +435,125 @@
1035 quarry_illegally_destroyed = {
1036 title = _"You Destroyed the Construction Site!",
1037 body = (
1038- p(_[[It seems like you destroyed a construction site for a quarry we wanted to build. Since we need the granite, I suggest you reload the game from a previous savegame. Luckily, these are created from time to time. To do so, you have to go back to the main menu and choose ‘Single Player’ → ‘Load Game’. And please be a bit more careful next time.]])
1039+ li_object("barbarians_quarry", _[[It seems like you destroyed a construction site for a quarry we wanted to build. Luckily, we still have enough logs left this time, so you can simply build another one.]], plr.color) ..
1040+ li_arrow(_[[You can also reload the game from a previous savegame. Luckily, these are created from time to time. To do so, you will have to go back to the main menu and choose ‘Single Player’ → ‘Load Game’. And please be a bit more careful next time.]])
1041 ),
1042 w = 350,
1043 h = 250
1044 }
1045
1046+obj_build_the_second_quarry = {
1047+ name = "build_the_second_quarry",
1048+ title=_"Build another quarry",
1049+ number = 1,
1050+ body = objective_text(_"Build another quarry",
1051+ li(_[[Build a second quarry near the rocks and connect it to your road network.]]) ..
1052+ li_arrow(_[[You can connect the new road to any flag of your existing road network. You can create junctions everywhere, not only in front of buildings.]])
1053+ ),
1054+}
1055 build_second_quarry = {
1056 position = "topright",
1057 title = _"Build a second quarry",
1058 body = (
1059- p(_[[When there are many rocks, you can consider building another quarry. This will make the granite production faster.]]) ..
1060- li(_[[Build a second quarry near the rocks and connect it to your road network.]])
1061- ),
1062- obj_name = "build_the_second_quarry",
1063- obj_title = _"Build another quarry",
1064- obj_body = (
1065- h1(_"Build another quarry") ..
1066- p(_[[Build a second quarry next to the rocks. Do not forget to connect it to another flag.]]) ..
1067- li(_[[You can connect the new road to any flag of your existing road network. You can create junctions everywhere, not only in front of buildings.]])
1068- ),
1069- h = 300,
1070- w = 350
1071+ li_object("barbarians_quarry", _[[When there are many rocks, you can consider building another quarry. This will make the granite production faster.]], plr.color)
1072+ ),
1073+ h = 300
1074 }
1075
1076+-- ===================
1077+-- Census & Statistics
1078+-- ===================
1079+
1080 census_and_statistics_00 = {
1081 title = _"Census and Statistics",
1082 body = (
1083- p(_[[While we wait, I’ll quickly show you another useful feature. All construction sites look the same, and some buildings look alike. It is sometimes hard to tell them apart. Widelands offers a feature to show label texts over the buildings. They are called the ‘census’ and you can toggle them via the ‘c’ key or via the button on the ‘Watch’ tab of any field.]]) ..
1084- p(_[[Similar to this are the building statistics, which are also toggled via a button on the ‘Watch’ tab of any field. The hotkey for it is ‘s’. This will display information about the productivity of buildings or the progress of construction sites.]]) ..
1085- p(_[[Let me quickly enable these two for you. Remember: ‘c’ and ‘s’ are the keys. Alternatively, you can click on any field without a building on it, select the watch tab and then click on the corresponding buttons.]])
1086+ li_image("images/wui/menus/toggle_census.png", _[[While we wait, I’ll quickly show you another useful feature. All construction sites look the same, and some buildings look alike. It is sometimes hard to tell them apart. Widelands offers a feature to show label texts over the buildings. They are called the ‘census’.]]) ..
1087+ li_arrow(_[[In order to show or hide the building census labels, you can select the ‘Show Census’ / ‘Hide Census’ entry from the ‘Show / Hide’ menu on the bottom, or press the ‘c’ key on the keyboard.]]) ..
1088+ p(_[[Let me enable the census for you.]])
1089+ ),
1090+ position = "topright",
1091+ h = 300,
1092+ w = 350
1093+}
1094+
1095+obj_show_statistics = {
1096+ name = "show_statistics",
1097+ title=_"Show the building statistics",
1098+ number = 1,
1099+ body = objective_text(_"Show the building statistics",
1100+ li(_[[Show the building statistics labels, so that we can check the progress of our quarry construction more easily.]]) ..
1101+ li_arrow(_[[In order to show or hide the building statistics labels, you can select the ‘Show Statistics’ entry from the ‘Show / Hide’ menu on the bottom, or press the ‘s’ key on the keyboard.]])
1102 )
1103 }
1104-
1105 census_and_statistics_01 = {
1106 title = _"Census and Statistics",
1107- body = (p(_[[Now we know what’s going on. Let’s wait for the quarries to finish.]])),
1108- h = 200,
1109+ body = (
1110+ li_image("images/wui/menus/toggle_statistics.png",
1111+ p(_[[Now, wouldn’t it be nice to check on our quarries’ progress without having to open their windows?]]) ..
1112+ p(_[[In addition to the buildings’ census, you can also activate statictics labels on them. This will display information about the productivity of buildings or the progress of construction sites.]]))
1113+ ),
1114+ position = "topright",
1115+ h = 400,
1116+ w = 350
1117+}
1118+
1119+census_and_statistics_02 = {
1120+ title = _"Census and Statistics",
1121+ body = (
1122+ li_object("barbarians_quarry", _[[Now we know what’s going on. Let’s wait for the quarries to finish.]], plr.color)
1123+ ),
1124+ position = "topright",
1125+ h = 150,
1126 w = 250
1127 }
1128
1129+-- ========
1130+-- Messages
1131+-- ========
1132+
1133+obj_archive_all_messages = {
1134+ name = "archive_all_messages",
1135+ title=_"Archive all messages in your inbox",
1136+ number = 1,
1137+ body = objective_text(_"Archive Your Inbox Messages",
1138+ li(_[[Archive all your messages in your inbox now.]]) ..
1139+ li_image("images/wui/messages/message_archive.png", _[[Keep clicking the ‘Archive selected message’ button until all messages have been archived and the list is empty.]]) ..
1140+ li_arrow(_[[Once you have archived a message, another message will be selected automatically from the list.]]) ..
1141+ li_arrow(_[[You can also hold down the Ctrl or Shift key to select multiple messages, or press Ctrl + A to select them all.]]) ..
1142+ li_arrow(_[[You can toggle the message window by pressing ‘n’ or clicking the second button from the right at the very bottom of the screen. The newest message will be marked for you automatically.]]) ..
1143+ li_arrow(_[[The message window is central to fully controlling your tribe’s fortune. However, you will get a lot of messages in a real game. To keep your head straight, you should try to keep the inbox empty.]])
1144+ )
1145+}
1146 teaching_about_messages = {
1147 popup = true,
1148 title = _"Messages",
1149 heading = _"Introducing Messages",
1150 body = (
1151- p(_[[Hi, it’s me again! This time, I have sent you a message. Messages are sent to you by Widelands to inform you about important events: empty mines, attacks on your tribe, won or lost military buildings, resources found…]]) ..
1152+ li_image("images/wui/menus/message_new.png",_[[Hi, it’s me again! This time, I have sent you a message. Messages are sent to you by Widelands to inform you about important events: empty mines, attacks on your tribe, won or lost military buildings, resources found…]]) ..
1153 p(_[[The message window can be toggled by the second button from the right at the bottom of the screen. This button will also change appearance whenever new messages are available, but there is also a bell sound played whenever you receive a new message.]]) ..
1154- p(_[[You have two messages at the moment. This one, which you are currently reading, and the one that informed you that a new headquarters was added to your economy. Let’s learn how to archive messages: first, select the message that you wish to archive by clicking on it in the list. Then, click the]]) ..
1155- li_image("images/wui/messages/message_archive.png", _[[‘Archive selected message’ button to move it into your archive.]]) ..
1156- p(_[[Once you have archived a message, another message will be selected automatically from the list.]]) ..
1157- li_arrow(_[[You can also hold down the Ctrl or Shift key to select multiple messages, or press Ctrl + A to select them all.]]) ..
1158- li(_[[Archive all messages that you currently have in your inbox, including this one.]])
1159- ),
1160- obj_name = "archive_all_messages",
1161- obj_title = _"Archive all messages in your inbox",
1162- obj_body = (
1163- h1(_"Archive Your Inbox Messages") ..
1164- p(_[[The message window is central to fully controlling your tribe’s fortune. However, you will get a lot of messages in a real game. To keep your head straight, you should try to keep the inbox empty.]]) ..
1165- li(_[[Archive all your messages in your inbox now.]]) ..
1166- li_arrow(_[[To do so, open the message window by pressing ‘n’ or clicking the second button from the right at the very bottom of the screen. The newest message will be marked for you automatically. Keep clicking the ‘Archive selected message’ button until all messages have been archived and the list is empty.]]) ..
1167- li_arrow(_[[You can also hold down the Ctrl or Shift key to select multiple messages, or press Ctrl + A to select them all.]])
1168+ p(_[[You have two messages at the moment. This one, which you are currently reading, and the one that informed you that a new headquarters was added to your economy. Let’s learn how to archive messages:]]) ..
1169+ new_objectives(obj_archive_all_messages)
1170 )
1171 }
1172
1173+obj_close_message_window = {
1174+ name = "close_message_window",
1175+ title=_"Close the messages window",
1176+ number = 1,
1177+ body = objective_text(_"Close the Messages Window",
1178+ p(_[[All windows in Widelands can be closed by right-clicking into them. Some windows can also be toggled with the buttons and menus at the very bottom of the screen.]]) ..
1179+ li(_[[Close the messages window now by right-clicking into it.]])
1180+ )
1181+}
1182 closing_msg_window_00 = {
1183 position = "topright",
1184 field = first_quarry_field,
1185 title = _"Closing Windows",
1186 body = (
1187- p(_[[Excellent. Do you remember how to close windows? You simply have to right-click on them. This will work with all windows except for story message windows like this one. Go ahead and try it.]]) ..
1188- li(_[[First, close this window by pressing the button below, then right-click into the messages window to close it.]])
1189+ li_image("images/wui/menus/message_old.png",_[[Excellent. Do you remember how to close windows? You simply have to right-click on them. This will work with all windows except for story message windows like this one. Go ahead and try it.]])
1190 ),
1191- h = 300,
1192- w = 350,
1193- obj_name = "close_message_window",
1194- obj_title = _"Close the messages window",
1195- obj_body = (
1196- h1(_"Close the Messages Window") ..
1197- p(_[[All windows in Widelands can be closed by right-clicking into them. Some windows can also be toggled with the buttons at the very bottom of the screen.]]) ..
1198- li(_[[Close the messages window now by right-clicking into it.]])
1199- )
1200+ h = 400,
1201+ w = 350
1202 }
1203
1204 closing_msg_window_01 = {
1205@@ -416,71 +561,85 @@
1206 field = first_quarry_field,
1207 title = _"Closing Windows",
1208 body = (
1209- p(_[[Well done! Let’s see how messages work in a real game, shall we? For this, I’ll take all rocks away from the poor stonemasons in the quarries. They will then send a message each that they can’t find any in their work areas the next time they try to do some work.]])
1210+ li_object("barbarians_quarry", _[[Well done! Let’s see how messages work in a real game, shall we? For this, I’ll take all rocks away from the poor stonemasons in the quarries. They will then send a message each that they can’t find any in their work areas the next time they try to do some work.]], plr.color)
1211 ),
1212- h = 300,
1213+ h = 250,
1214 w = 350
1215 }
1216
1217+obj_destroy_quarries = {
1218+ name = "destroy_quarries",
1219+ title=_"Destroy the two quarries",
1220+ number = 1,
1221+ body = objective_text(_"Destroy the Quarries",
1222+ li(_[[Since our quarries are useless now, you can destroy them and reuse the space later on.]]) ..
1223+ p(_[[There are two different ways of destroying a building: burning down and dismantling. Try them both out on your quarries.]]) ..
1224+ li_image("images/wui/buildings/menu_bld_bulldoze.png", _[[Burning down the quarry: This is the fastest way of clearing the space. While the worker abandons the building, the wares are lost.]]) ..
1225+ li_image("images/wui/buildings/menu_bld_dismantle.png", _[[Dismantling the quarry: A builder will walk from the headquarters to dismantle the quarry piece by piece. Thereby, you regain some of the resources you used for the construction.]])
1226+ )
1227+}
1228 destroy_quarries_message = {
1229 position = "topright",
1230 title = _"Messages Arrived!",
1231 body = (
1232- p(_[[You received some messages. See how the button at the bottom of the screen has changed appearance? You can destroy the quarries now as they are no longer of any use and just blocking space. To do so, there are two possibilities:]]) ..
1233- li_image("images/wui/buildings/menu_bld_bulldoze.png", _[[Burning down the quarry: this is the fastest way of clearing the space. While the worker abandons the building, the wares are lost.]]) ..
1234- li_image("images/wui/buildings/menu_bld_dismantle.png", _[[Dismantling the quarry: a builder will walk from the headquarters to dismantle the quarry piece by piece. Thereby, you regain some of the resources you used for the construction.]])
1235+ li_image("images/wui/menus/message_new.png", _[[You received some messages. See how the button at the bottom of the screen has changed appearance?]])
1236 ),
1237- h = 300,
1238- obj_name = "destroy_quarries",
1239- obj_title = _"Destroy the two quarries",
1240- obj_body = (
1241- p(_[[Since our quarries are useless now, you can destroy them and reuse the space later on.]]) ..
1242- li_arrow(_[[There are two different ways of destroying a building: burning down and dismantling. Try them both out on your quarries.]]) ..
1243- li_image("images/wui/buildings/menu_bld_bulldoze.png", _[[Burning down the quarry: This is the fastest way of clearing the space. While the worker abandons the building, the wares are lost.]]) ..
1244- li_image("images/wui/buildings/menu_bld_dismantle.png", _[[Dismantling the quarry: A builder will walk from the headquarters to dismantle the quarry piece by piece. Thereby, you regain some of the resources you used for the construction.]])
1245+ h = 400,
1246+ w = 350
1247+}
1248+
1249+-- =========
1250+-- Expansion
1251+-- =========
1252+
1253+obj_expand_territory = {
1254+ name = "expand_territory",
1255+ title=_"Expand your territory",
1256+ number = 1,
1257+ body = objective_text(_"Make your Territory Grow",
1258+ li(_[[Build a military building on your border.]]) ..
1259+ li_arrow(_[[In Widelands, it is necessary to build many buildings, which take up a lot of space. To expand your territory, you have to build military buildings next to your border. Every tribe has several military buildings.]]) ..
1260+ li_arrow(_[[The Barbarians have four different military buildings you can build: the sentry (small), the barrier and the tower (both medium) and the fortress (big). Just choose the one you like most.]]) ..
1261+ li_arrow(_[[The sentry is the only military site that fits on a small building plot. If your lumberjack has cleared enough space, you can also build another military building.]]) ..
1262+ li_arrow(_[[Remember that big buildings (green icon) cannot be built on small (red) or medium (yellow) building plots, but buildings can be built on a building plot that provides more space than they need. You should always keep that in mind when you search for a suitable place.]])
1263 )
1264 }
1265-
1266 introduce_expansion = {
1267 title = _"Expanding Your Territory!",
1268 body = (
1269- p(_[[There is one more thing I’d like to teach you now: Expanding your territory. The place that we started with around our headquarters is barely enough for a basic building infrastructure, and we do not have access to mountains, which we need to mine minerals and coal. So, we have to expand our territory.]]) ..
1270- p(_[[Expanding is as simple as building a military building at the edge of your territory. The Barbarians have a selection of different military buildings: sentries, barriers, towers, fortresses and citadels. The bigger the building, the more expensive it is to build, but the more land it will conquer around itself and the more soldiers can be stationed there. The buildings also vary in their vision range: buildings with a tower see farther than others.]]) ..
1271- p(_[[As soon as a military building is manned, it will extend your land. I will tell your more about military buildings in another tutorial.]]) ..
1272- li(_[[Let’s try it out now: build a military building on your border.]]) ..
1273- li_arrow(_[[The sentry is the only military site that fits on a small building plot. If your lumberjack has cleared enough space, you can also build another military building.]])
1274- ),
1275- obj_name = "expand_territory",
1276- obj_title = _"Expand your territory",
1277- obj_body = (
1278- h1(_"Make your territory grow") ..
1279- p(_[[In Widelands, it is necessary to build many buildings, which take up a lot of space. To expand your territory, you have to build military buildings next to your border. Every tribe has several military buildings.]]) ..
1280- li(_[[The Barbarians have four different military buildings you can build: the sentry (small), the barrier and the tower (both medium) and the fortress (big). Just choose the one you like most.]]) ..
1281- li_arrow(_[[Remember that big buildings (green icon) cannot be built on small (red) or medium (yellow) building plots, but buildings can be built on a building plot that provides more space than they need. You should always keep that in mind when you search for a suitable place.]])
1282+ li_object("barbarians_sentry",
1283+ p(_[[There is one more thing I’d like to teach you now: Expanding your territory. The place that we started with around our headquarters is barely enough for a basic building infrastructure, and we do not have access to mountains, which we need to mine minerals and coal. So, we have to expand our territory.]]) ..
1284+ p(_[[Expanding is as simple as building a military building at the edge of your territory. The Barbarians have a selection of different military buildings: sentries, barriers, towers, fortresses and citadels. The bigger the building, the more expensive it is to build, but the more land it will conquer around itself and the more soldiers can be stationed there. The buildings also vary in their vision range: buildings with a tower see farther than others.]]) ..
1285+ p(_[[As soon as a military building is manned, it will extend your land. I will tell you more about military buildings in another tutorial.]]), plr.color)
1286 )
1287 }
1288
1289-
1290 military_building_finished = {
1291 title = _"Military Site Occupied",
1292 body = (
1293 h1(_"Your territory has just grown!") ..
1294- p(_[[Great. Do you see how your territory has grown since your soldiers entered your new military building?]]) ..
1295- p(_[[Every military building has a certain conquer area – the more expensive the building, the more land it conquers.]])
1296+ li_object("barbarians_tower",
1297+ p(_[[Great. Do you see how your territory has grown since your soldiers entered your new military building?]]) ..
1298+ p(_[[Every military building has a certain conquer area – the more expensive the building, the more land it conquers.]]), plr.color)
1299 ),
1300 h = 300,
1301 w = 350
1302 }
1303
1304+-- ==========
1305+-- Conclusion
1306+-- ==========
1307+
1308 conclude_tutorial = {
1309 title = _"Conclusion",
1310 body = (
1311 h1(_"Conclusion") ..
1312- p(_[[This concludes the first tutorial. In order to learn more about the game, I suggest to play one of the other tutorials. Each of them covers a different topic.]]) ..
1313- p(_[[However, since you now know how to control Widelands, you can also start a game (or continue this one) and discover more by yourself.]]) ..
1314- p(_[[To leave this game and return to the main menu, click on the]]) ..
1315- li_image("images/wui/menus/menu_options_menu.png", _[[‘Main Menu’ button on the very left at the bottom of the screen. Then click the]]) ..
1316- li_image("images/wui/menus/menu_exit_game.png", _[[‘Exit Game’ button.]]) ..
1317+ li_image("images/logos/wl-ico-64.png",
1318+ p(_[[This concludes the first tutorial. In order to learn more about the game, I suggest to play one of the other tutorials. Each of them covers a different topic.]]) ..
1319+ p(_[[However, since you now know how to control Widelands, you can also start a game (or continue this one) and discover more by yourself.]])) ..
1320+ p(_[[To leave this game and return to the main menu:]]) ..
1321+ li_image("images/wui/menus/main_menu.png", _[[Click on the ‘Main Menu’ button on the very left at the bottom of the screen.]]) ..
1322+ li_image("images/wui/menus/exit.png", _[[Then click on the ‘Exit Game’ entry.]]) ..
1323 p(_[[Thanks for playing this tutorial. Enjoy Widelands and remember to visit us at]]) ..
1324 h1(p("align=center", u("widelands.org")))
1325 ),
1326
1327=== modified file 'data/campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua'
1328--- data/campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua 2018-07-07 10:53:30 +0000
1329+++ data/campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua 2019-06-01 15:39:16 +0000
1330@@ -10,8 +10,8 @@
1331
1332 sleep(1000)
1333
1334- message_box_objective(plr, intro1)
1335- message_box_objective(plr, intro2)
1336+ campaign_message_box(intro1)
1337+ campaign_message_box(intro2)
1338
1339 burn_tavern_down()
1340 end
1341@@ -19,15 +19,19 @@
1342 function wait_for_window_and_tab_or_complain(
1343 window_name,
1344 tab_name,
1345- objective, complain_msg
1346-)
1347+ complain_msg,
1348+ objective)
1349+
1350+ local obj_open_window = add_campaign_objective(objective)
1351+ obj_open_window.visible = false
1352+
1353 while true do
1354 -- This waits for the window to be opened.
1355 if not mv.windows[window_name] then
1356- objective.visible = true
1357- message_box_objective(plr, complain_msg)
1358+ obj_open_window.visible = true
1359+ campaign_message_box(complain_msg)
1360 while not mv.windows[window_name] do sleep(200) end
1361- objective.visible = false
1362+ obj_open_window.visible = false
1363 end
1364
1365 -- But it might be closed at any point in time. If it is open and the
1366@@ -39,21 +43,20 @@
1367 end
1368 sleep(200)
1369 end
1370+ set_objective_done(obj_open_window)
1371 end
1372
1373 function encyclopedia_tutorial()
1374 sleep(100*1000)
1375- local o = message_box_objective(plr, ware_encyclopedia) -- where to get help
1376+ local o = campaign_message_with_objective(ware_encyclopedia, obj_open_encyclopedia) -- where to get help
1377 while not mv.windows.encyclopedia do sleep(200) end
1378 set_objective_done(o, wl.Game().real_speed)
1379
1380- o = message_box_objective(plr, explain_encyclopedia) -- what information is available
1381- local o2 = add_campaign_objective(reopen_encyclopedia_obj)
1382- o2.visible = false
1383+ o = campaign_message_with_objective(explain_encyclopedia, obj_lookup_wares) -- what information is available
1384 wait_for_window_and_tab_or_complain(
1385 "encyclopedia",
1386 "encyclopedia_wares",
1387- o2, reopen_encyclopedia
1388+ reopen_encyclopedia, obj_reopen_encyclopedia
1389 )
1390 while mv.windows.encyclopedia do sleep(200) end
1391 set_objective_done(o, wl.Game().real_speed)
1392@@ -65,44 +68,38 @@
1393 sleep(1000)
1394 tavern_field.immovable:destroy()
1395 sleep(1000)
1396- message_box_objective(plr, tavern_burnt_down)
1397+ campaign_message_box(tavern_burnt_down)
1398 sleep(500)
1399- local o = message_box_objective(plr, building_stat)
1400+ local o = campaign_message_with_objective(building_stats, obj_open_building_stats)
1401+ wl.ui.MapView().dropdowns["dropdown_menu_statistics"]:open()
1402+
1403 while not mv.windows.building_statistics do sleep(100) end
1404 set_objective_done(o, wl.Game().real_speed)
1405
1406- o = message_box_objective(plr,explain_building_stat)
1407- -- We cannot create several objectives with the same name. Therefore, we create o2 here once and change its visibility
1408- local o2 = add_campaign_objective(reopen_building_stat_obj)
1409- o2.visible = false
1410+ o = campaign_message_with_objective(explain_building_stats, obj_check_taverns)
1411 wait_for_window_and_tab_or_complain(
1412 "building_statistics",
1413 "building_stats_medium",
1414- o2, reopen_building_stat
1415+ reopen_building_stats, obj_reopen_building_stats
1416 )
1417 while mv.windows.building_statistics do sleep(100) end
1418 set_objective_done(o, 0)
1419
1420- o = message_box_objective(plr, inventory1)
1421+ o = campaign_message_with_objective(inventory1, obj_open_inventory)
1422 while not mv.windows.stock_menu do sleep(200) end
1423 set_objective_done(o, wl.Game().real_speed)
1424
1425- o = message_box_objective(plr, inventory2)
1426- -- We cannot create several objectives with the same name. Therefore, we
1427- -- create o2 here once and change its visibility
1428- o2 = add_campaign_objective(reopen_stock_menu_obj)
1429- o2.visible = false
1430-
1431+ o = campaign_message_with_objective(inventory2, obj_switch_stock_tab)
1432 wait_for_window_and_tab_or_complain(
1433 "stock_menu",
1434 "wares_in_warehouses",
1435- o2, reopen_stock_menu
1436+ reopen_stock_menu, obj_reopen_stock_menu
1437 )
1438 set_objective_done(o, 0)
1439- message_box_objective(plr, inventory3)
1440+ campaign_message_box(inventory3)
1441
1442 sleep(2000)
1443- o = message_box_objective(plr, build_taverns)
1444+ o = campaign_message_with_objective(build_taverns, obj_build_taverns)
1445
1446 encyclopedia_tutorial()
1447
1448@@ -113,44 +110,38 @@
1449 end
1450
1451 function plan_the_future()
1452- message_box_objective(plr, building_priority_settings)
1453+ campaign_message_box(building_priority_settings)
1454 sleep(30*1000) -- give the user time to try it out
1455
1456- local o = message_box_objective(plr, ware_stats1)
1457+ local o = campaign_message_with_objective(ware_stats1, obj_open_ware_stats)
1458 while not mv.windows.ware_statistics do sleep(200) end
1459 set_objective_done(o, 0)
1460
1461- o = message_box_objective(plr, ware_stats2)
1462- local o2 = add_campaign_objective(reopen_ware_stats1_obj)
1463- o2.visible = false
1464-
1465+ o = campaign_message_with_objective(ware_stats2, obj_switch_ware_stats_tab_to_third)
1466 wait_for_window_and_tab_or_complain(
1467 "ware_statistics",
1468 "economy_health",
1469- o2, reopen_ware_stats1
1470+ reopen_ware_stats1, obj_reopen_ware_stats1
1471 )
1472 set_objective_done(o, 0)
1473
1474- o = message_box_objective(plr, ware_stats3)
1475- o2 = add_campaign_objective(reopen_ware_stats2_obj)
1476- o2.visible = false
1477-
1478+ o = campaign_message_with_objective(ware_stats3, obj_switch_ware_stats_tab_to_fourth)
1479 wait_for_window_and_tab_or_complain(
1480 "ware_statistics",
1481 "stock",
1482- o2, reopen_ware_stats2
1483+ reopen_ware_stats2, obj_reopen_ware_stats2
1484 )
1485 set_objective_done(o, 0)
1486
1487- o = message_box_objective(plr, ware_stats4)
1488+ o = campaign_message_with_objective(ware_stats4, obj_close_ware_stats)
1489 while mv.windows.ware_statistics do sleep(500) end
1490 set_objective_done(o)
1491
1492- o = message_box_objective(plr, economy_settings1)
1493+ o = campaign_message_with_objective(economy_settings1, obj_open_economy_settings)
1494 while not mv.windows.economy_options do sleep(200) end
1495 set_objective_done(o, 0)
1496- message_box_objective(plr, economy_settings2)
1497- o = message_box_objective(plr, economy_settings3)
1498+ campaign_message_box(economy_settings2)
1499+ o = campaign_message_with_objective(economy_settings3, obj_produce_marble_columns)
1500
1501 while sf.brn.immovable.economy:ware_target_quantity("marble_column") ~= 20 do
1502 sleep(200)
1503@@ -159,7 +150,7 @@
1504 set_objective_done(o)
1505
1506 -- new objective all has to be transported to the front
1507- o = message_box_objective(plr, warehouse_preference_settings)
1508+ o = campaign_message_with_objective(warehouse_preference_settings, obj_bring_marble_columns_to_front)
1509
1510 local enough_wares = false
1511 while not enough_wares do
1512@@ -178,7 +169,7 @@
1513 end
1514
1515 function conclude()
1516- message_box_objective(plr, conclusion)
1517+ campaign_message_box(conclusion)
1518 end
1519
1520 run(introduction)
1521
1522=== modified file 'data/campaigns/tutorial04_economy.wmf/scripting/texts.lua'
1523--- data/campaigns/tutorial04_economy.wmf/scripting/texts.lua 2018-09-12 15:58:07 +0000
1524+++ data/campaigns/tutorial04_economy.wmf/scripting/texts.lua 2019-06-01 15:39:16 +0000
1525@@ -8,7 +8,6 @@
1526
1527 include "scripting/richtext_scenarios.lua"
1528
1529-
1530 -- =============
1531 -- Texts below
1532 -- =============
1533@@ -17,7 +16,7 @@
1534 title = _"Your Economy and its Settings",
1535 body = (
1536 h1(_[[Economy]]) ..
1537- p(_[[Welcome back. In this tutorial, I’ll tell you what you can do to check how well your economy works.]]) ..
1538+ li_image("images/wui/stats/genstats_nrwares.png", _[[Welcome back. In this tutorial, I’ll tell you what you can do to check how well your economy works.]]) ..
1539 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.]]) ..
1540 p(_[[This is what I’ll show you in this tutorial: what actions can you take to define those general conditions?]])
1541 ),
1542@@ -29,49 +28,65 @@
1543 field = field_near_border,
1544 title = _"A Peaceful Land",
1545 body = (
1546- 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.]]) ..
1547- 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.]]) ..
1548- p(_[[You had not been prepared for war, and you have to hurry now to build up an army.]])
1549+ li_object("empire_fortress",
1550+ 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.]]) ..
1551+ 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 fortresses.]]) ..
1552+ p(_[[You had not been prepared for war, and you have to hurry now to build up an army.]]), plr.color)
1553 ),
1554 h = 300
1555 }
1556
1557 tavern_burnt_down = {
1558 position = "topright",
1559- title = _"The Tavern is Burning!",
1560+ title = _"An accident",
1561 body = (
1562- h1(_[[An accident]]) ..
1563- 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.]])
1564+ h1(_[[The Tavern is Burning!]]) ..
1565+ li_object("destroyed_building",
1566+ _[[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.]], plr.color)
1567 ),
1568 w = 300,
1569 h = 250
1570 }
1571
1572-building_stat = {
1573+obj_open_building_stats = {
1574+ name = "open_building_stats",
1575+ title=_"Open the building statistics window",
1576+ number = 1,
1577+ body = objective_text(_"Open the building statistics window",
1578+ li(_[[Open the building statistics window for an overview over the buildings you have.]]) ..
1579+ li_image("images/wui/menus/statistics.png", _[[First, you will have to open the ‘Statistics’ menu at the bottom of the screen.]]) ..
1580+ li_image("images/wui/menus/statistics_buildings.png", _[[Afterwards, choose ‘Buildings’.]]) ..
1581+ li_arrow(_[[You can also use the hotkey ‘b’.]])
1582+ )
1583+}
1584+building_stats = {
1585 position = "topright",
1586 title = _"Building statistics",
1587 body = (
1588 h1(_[[Check out your taverns]]) ..
1589- p(_[[At first, we should find out how many taverns we currently have. Widelands offers you a window where you can easily check this.]]) ..
1590- 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.]]) ..
1591- li_image("images/wui/menus/menu_building_stats.png", _[[Afterwards, choose the ‘Building statistics’.]]) ..
1592- li(_[[Open the building statistics window.]]) ..
1593- li_arrow(_[[You can also use the hotkey ‘b’.]])
1594- ),
1595- h = 350,
1596- obj_name = "open_building_stat",
1597- obj_title = _"Open the building statistics window",
1598- obj_body =
1599- li_image("images/wui/menus/menu_building_stats.png", _[[The building statistics window gives you an overview over the buildings you have.]]) ..
1600- -- TRANSLATORS: "it" refers to the building statistics window
1601- li(_[[Open it. You can access it from the statistics menu.]]) ..
1602- 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.]])
1603+ p(_[[At first, we should find out how many taverns we currently have. Widelands offers you a window where you can easily check this.]])
1604+ )
1605 }
1606
1607-explain_building_stat = {
1608+obj_check_taverns = {
1609+ name = "check_taverns",
1610+ title=_"Look up how many taverns you have",
1611+ number = 1,
1612+ body = objective_text(_"Look up how many taverns you have",
1613+ p(_[[We want to know whether we still have taverns.]]) ..
1614+ li_image("images/wui/fieldaction/menu_tab_buildmedium.png",
1615+ _[[Choose the ‘Medium buildings’ tab in the building statistics window.]]) ..
1616+ li(_[[Look up how many taverns you have.]]) ..
1617+ 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.]]) ..
1618+ li(_[[Close the building statistics window when you are done.]])
1619+ )
1620+}
1621+explain_building_stats = {
1622+ position = "topright",
1623 title = _"Building Statistics",
1624 body = (
1625- p(_[[This is the building statistics window. It shows you all buildings you can own, sorted by their size.]]) ..
1626+ li_image("images/wui/menus/statistics_buildings.png",
1627+ _[[This is the building statistics window. It shows you all buildings you can own, sorted by their size.]]) ..
1628 p(_[[Let me now explain what all those numbers mean:]]) ..
1629 li(_[[‘2/1’ below the quarry: This means that you have two quarries, plus another one which is under construction.]]) ..
1630 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.]]) ..
1631@@ -79,149 +94,170 @@
1632 li_arrow(_[[In both cases, the color (green - yellow - red) signals you how good the value is.]]) ..
1633 li(_[[If you click on a building, you can scroll through the buildings of the selected type.]]) ..
1634 li(_[[If you don’t have any building of a particular building type, it will be shown greyed out.]]) ..
1635- h2(_[[Now it’s your turn]]) ..
1636- 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.]])
1637+ p(_[[This is enough explanation for now. Now try it out yourself.]])
1638 ),
1639- obj_name = "check_taverns",
1640- obj_title = _"Look up how many taverns you have",
1641- obj_body = (
1642- li(_[[Choose the ‘Medium buildings’ tab in the building statistics window.]]) ..
1643- li(_[[Look up how many taverns you have.]]) ..
1644- 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.]]) ..
1645- li(_[[Close the building statistics window when you are done.]])
1646- )
1647+ h = 500,
1648 }
1649
1650-reopen_building_stat = {
1651+reopen_building_stats = {
1652 title = _"You closed the building statistics window!",
1653 body = (
1654- 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?]])
1655+ li_image("images/wui/menus/statistics_buildings.png",
1656+ _[[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?]])
1657 ),
1658 show_instantly = true,
1659 w = 300,
1660 h = 250
1661 }
1662
1663-reopen_building_stat_obj = {
1664- obj_name = "open_building_stat_again",
1665- obj_title = _"Open the building statistics window again",
1666- obj_body = (
1667- p(_[[You closed the building statistics window, although you have not yet looked up the number of taverns.]]) ..
1668+obj_reopen_building_stats = {
1669+ name = "reopen_building_stats",
1670+ title = _"Open the building statistics window again",
1671+ number = 1,
1672+ body = objective_text(_"Open the building statistics window again",
1673+ li_image("images/wui/menus/statistics_buildings.png",
1674+ _[[You closed the building statistics window, although you have not yet looked up the number of taverns.]]) ..
1675 -- TRANSLATORS: "it" refers to the building statistics window.
1676 li(_[[Please reopen it and choose the second tab (medium buildings).]])
1677- ),
1678- h = 250
1679+ )
1680 }
1681
1682+obj_open_inventory = {
1683+ name = "open_inventory",
1684+ title=_"Open your stock window",
1685+ number = 1,
1686+ body = objective_text(_"Open your stock window",
1687+ p(_[[The stock window gives you an overview over the wares you currently have.]]) ..
1688+ li_image("images/wui/menus/statistics.png", _[[First, you will have to open the ‘Statistics’ menu at the bottom of the screen.]]) ..
1689+ li_image("images/wui/menus/statistics_stock.png", _[[Afterwards, choose ‘Stock’.]]) ..
1690+ li_arrow(_[[You can also use the hotkey ‘i’ (as in ‘inventory’) to access this window quickly.]])
1691+ )
1692+}
1693 inventory1 = {
1694 position = "topright",
1695 title = _"Stock",
1696 body = (
1697 h1(_[[Check for rations]]) ..
1698- 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.]]) ..
1699- li_image("images/wui/menus/menu_stock.png", _[[Click on the ‘Stock’ button.]]) ..
1700- li_arrow(_[[You can also use the hotkey ‘i’ (as in ‘inventory’) to access this window quickly.]])
1701- ),
1702- h = 300,
1703- obj_name = "open_inventory",
1704- obj_title = _"Open your stock window",
1705- obj_body = (
1706- p(_[[The stock menu window gives you an overview over the wares you currently have.]]) ..
1707- -- TRANSLATORS: "it" refers to the stock menu window
1708- li(_[[Open it. You can access it from the statistics menu.]]) ..
1709- 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.]])
1710+ li_image(wl.Game():get_ware_description("ration").icon_name,
1711+ _[[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.]])
1712 )
1713 }
1714
1715+obj_switch_stock_tab = {
1716+ name = "switch_stock_tab",
1717+ title=_"Examine the first two tabs in the stock window",
1718+ number = 1,
1719+ body = objective_text(_"Examine the first two tabs in the stock window",
1720+ p(_[[Have a look at the first two tabs in the stock window. They show all the wares and workers you have.]]) ..
1721+ li_image("images/wui/stats/menu_tab_wares_warehouse.png",
1722+ _[[When you have seen enough, switch to the third tab (‘Wares in warehouses’).]])
1723+ )
1724+}
1725 inventory2 = {
1726+ position = "topright",
1727 title = _"Stock",
1728 body = (
1729- 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.]]) ..
1730+ li_image("images/wui/buildings/menu_tab_wares.png",
1731+ _[[The stock 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.]]) ..
1732 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.]]) ..
1733- p(_[[The second tab shows you all your workers, again those on roads and in buildings summed up.]]) ..
1734- p(_[[Now have a look at these two tabs. When you click on the]]) ..
1735- li_image("images/wui/stats/menu_tab_wares_warehouse.png", _[[third tab (‘Wares in warehouses’), I’ll continue.]])
1736- ),
1737- h = 350,
1738- show_instantly = true,
1739- obj_name = "switch_stock_tab",
1740- obj_title = _"Switch to the third tab in the stock menu window",
1741- obj_body = (
1742- p(_[[Have a look at the first two tabs in the stock menu window. They show all the wares and workers you have.]]) ..
1743- li(_[[When you have seen enough, switch to the third tab.]])
1744- ),
1745+ li_image("images/wui/buildings/menu_tab_workers.png",
1746+ _[[The second tab shows you all your workers, again those on roads and in buildings summed up.]])
1747+ ),
1748+ show_instantly = true
1749 }
1750
1751 inventory3 = {
1752+position = "topright",
1753 title = _"Stock",
1754 body = (
1755- 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.]]) ..
1756- p(_[[The fourth tab shows the same thing for workers.]]) ..
1757+ li_image("images/wui/stats/menu_tab_wares_warehouse.png",
1758+ _[[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.]]) ..
1759+ li_image("images/wui/stats/menu_tab_workers_warehouse.png", _[[The fourth tab shows the same thing for workers.]]) ..
1760 p(_[[The third tab tells you that there are no rations left in your headquarters – that’s not good!]])
1761 ),
1762 show_instantly = true,
1763- h = 300
1764+ h = 250
1765 }
1766
1767 reopen_stock_menu = {
1768 title = _"You closed the stock window!",
1769 body = (
1770- 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?]])
1771+ li_image("images/wui/menus/statistics_stock.png",
1772+ _[[You have closed the stock window, but I have not yet finished with my explanation. Would you please reopen it and choose the third tab?]])
1773 ),
1774 show_instantly = true,
1775 w = 300,
1776 h = 250
1777 }
1778
1779-reopen_stock_menu_obj = {
1780- obj_name = "open_stock_menu_again",
1781- obj_title = _"Open the stock window again",
1782- obj_body = (
1783- 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.]]) ..
1784- -- TRANSLATORS: "it" refers to the stock menu window.
1785+obj_reopen_stock_menu = {
1786+ name = "open_stock_menu_again",
1787+ title = _"Open the stock window again",
1788+ number = 1,
1789+ body = objective_text(_"Open the stock window again",
1790+ li_image("images/wui/menus/statistics_stock.png",
1791+ _[[You closed the stock window before I finished telling you everything about it. If you already know everything, please feel free to leave this tutorial at any time.]]) ..
1792+ -- TRANSLATORS: "it" refers to the "Stock" window.
1793 li(_[[Otherwise, please reopen it and choose the third tab.]])
1794- ),
1795- h = 250
1796+ )
1797 }
1798
1799+obj_build_taverns = {
1800+ name = "build_taverns",
1801+ title=_"Build new taverns",
1802+ number = 1,
1803+ body = objective_text(_"Build new taverns",
1804+ li(_[[Build at least two taverns.]]) ..
1805+ li_arrow(_[[As long as we don’t produce rations, our miners won’t dig for ore. And without iron, we cannot forge a single helm.]])
1806+ )
1807+}
1808 build_taverns = {
1809 position = "topright",
1810 title = _"New taverns",
1811 body = (
1812 h1(_[[We need new taverns]]) ..
1813- 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.]]) ..
1814- li(_[[Build at least two taverns.]])
1815- ),
1816- h = 300,
1817- obj_name = "build_taverns",
1818- obj_title = _"Build new taverns",
1819- obj_body = (
1820- p(_[[To make our mines work, we need rations again – the more, the better.]]) ..
1821- li(_[[Build at least two taverns.]])
1822+ li_object("empire_tavern",
1823+ _[[Now that you have an overview, you should act. I think we should build more than one tavern – two or three are better.]],
1824+ plr.color)
1825 )
1826 }
1827
1828-ware_encyclopedia = {
1829- title = _"Encyclopedia",
1830- body = (
1831- h1(_[[How to get help]]) ..
1832- p(_[[Of course, it is difficult to remember all of my remarks and advice. For example, you might ask yourself: ‘Why do we need rations to get soldiers?’]]) ..
1833- p(_[[When you’ve played a lot, you will know all these things by heart. But until then or if you’re unsure about your tribe’s needs and abilities and how its buildings and workers operate, you can look it up easily in our tribe-specific in-game help and encyclopedia.]]) ..
1834- p(_[[This encyclopedia can be accessed via the help button at the bottom right.]])..
1835- li_image("images/ui_basic/menu_help.png", _[[Please open the in-game help, and I’ll explain its contents to you.]])
1836- ),
1837- h = 350,
1838- show_instantly = true,
1839- obj_name = "open_encyclopedia",
1840- obj_title = _"Open the in-game help window",
1841- obj_body = (
1842+obj_open_encyclopedia = {
1843+ name = "open_encyclopedia",
1844+ title=_"Open the in-game help window",
1845+ number = 1,
1846+ body = objective_text(_"Open the in-game help window",
1847 li_image("images/ui_basic/menu_help.png", _[[The encyclopedia window contains the in-game help and an encyclopedia of the tribe you’re currently playing.]]) ..
1848 -- TRANSLATORS: "it" refers to the encyclopedia window
1849 li(_[[Open it. You can access it via the button at the bottom of the screen.]]) ..
1850 li_arrow(_[[Alternatively, you can access it directly with the ‘F1’ key.]])
1851+ )
1852+}
1853+ware_encyclopedia = {
1854+ title = _"Encyclopedia",
1855+ body = (
1856+ h1(_[[How to get help]]) ..
1857+ li_object("empire_soldier",
1858+ _[[Of course, it is difficult to remember all of my remarks and advice. For example, you might ask yourself: ‘Why do we need rations to get soldiers?’]], plr.color) ..
1859+ p(_[[When you’ve played a lot, you will know all these things by heart. But until then or if you’re unsure about your tribe’s needs and abilities and how its buildings and workers operate, you can look it up easily in our tribe-specific in-game help and encyclopedia.]])
1860 ),
1861+ h = 450,
1862+ show_instantly = true,
1863 }
1864
1865+obj_lookup_wares = {
1866+ name = "lookup_wares",
1867+ title=_"Look up which wares are needed to recruit soldiers",
1868+ number = 1,
1869+ body = objective_text(_"Look up which wares are needed to recruit soldiers",
1870+ p(_[[A soldier needs a wooden spear and a helmet – from there on out, you can search backwards to find the wares and the buildings you need to supply your barracks where the soldier is recruited. When you are finished, just close the encyclopedia window.]]) ..
1871+ li(_[[Use the encyclopedia to find out how to create new soldiers.]]) ..
1872+ li_arrow(_[[Choose the ‘Wares’ tab in the encyclopedia window.]]) ..
1873+ li_arrow(_[[Look up what is needed to produce a helmet and what is needed to produce a wooden spear.]]) ..
1874+ li_arrow(_[[If you want, you may further look up what is needed to produce the wares you just looked up.]]) ..
1875+ li(_[[Close the encyclopedia window when you are done.]])
1876+ )
1877+}
1878 explain_encyclopedia = {
1879 position = "topright",
1880 title = _"Encyclopedia details",
1881@@ -232,140 +268,143 @@
1882 div("width=100%", div("float=left padding_r=18 padding_t=15 padding_b=15 padding_l=4",p(img("images/wui/buildings/menu_tab_wares.png"))) .. p(_[[The ‘Wares’ tab shows information about the wares that your tribe needs, including a short help text, a list of buildings that produce each ware, the needed wares to produce it and where the ware is consumed.]])) ..
1883 div("width=100%", div("float=left padding_r=16",p(img("images/wui/buildings/menu_tab_workers.png"))) .. p(_[[The ‘Workers’ tab shows information about your tribe’s workers in a similar manner to the wares in the second tab.]])) ..
1884 div("width=100%", div("float=left padding_r=18 padding_t=5 padding_l=4",p(img("images/wui/stats/genstats_nrbuildings.png"))) .. p(_[[The ‘Buildings’ tab contains all the necessary information about the buildings of your tribe.]])) ..
1885- li_image("tribes/immovables/field_harvested/idle_00.png", _[[Finally, the ‘Immovables’ tab shows information about the specific immovables that your tribe’s workers can place on the map.]]) ..
1886- li(_[[Now use the encyclopedia to find out how to create new soldiers.]]) ..
1887- li_arrow(_[[A soldier needs a wooden spear and a helmet – from there on out, you can search backwards to find the wares and the buildings you need to supply your barracks where the soldier is recruited. When you are finished, just close the encyclopedia window.]])
1888+ div("width=100%", div("float=left padding_r=18 padding_t=5 padding_l=4",p(img("tribes/immovables/field_ripe/idle_00.png"))) .. p(_[[Finally, the ‘Immovables’ tab shows information about the specific immovables that your tribe’s workers can place on the map.]]))
1889 ),
1890- h = 450,
1891+ h = 500,
1892 show_instantly = true,
1893- obj_name = "check_wares",
1894- obj_title = _"Look up which wares are needed to recruit soldiers",
1895- obj_body = (
1896- li(_[[Choose the ‘Wares’ tab in the encyclopedia window.]]) ..
1897- li(_[[Look up what is needed to produce a helmet and what is needed to produce a wooden spear.]]) ..
1898- li_arrow(_[[If you want, you may further look up what is needed to produce the wares you just looked up.]]) ..
1899- li(_[[Close the encyclopedia window when you are done.]])
1900- )
1901 }
1902
1903 reopen_encyclopedia = {
1904 title = _"You closed the encyclopedia!",
1905 body = (
1906- p(_[[You have closed the encyclopedia window, but I didn’t notice that you were trying to find out which wares are needed to recruit a soldier. Would you please reopen it and do so?]])
1907+ li_image("images/ui_basic/menu_help.png",
1908+ _[[You have closed the encyclopedia window, but I didn’t notice that you were trying to find out which wares are needed to recruit a soldier. Would you please reopen it and do so?]])
1909 ),
1910 show_instantly = true,
1911 w = 300,
1912 h = 250
1913 }
1914
1915-reopen_encyclopedia_obj = {
1916- obj_name = "open_encyclopedia_again",
1917- obj_title = _"Open the encyclopedia window again",
1918- obj_body = (
1919- p(_[[You closed the encyclopedia window without searching for the information we need. If you already know everything, please feel free to leave this tutorial at any time.]]) ..
1920+obj_reopen_encyclopedia = {
1921+ name = "reopen_encyclopedia",
1922+ title = _"Open the encyclopedia window again",
1923+ number = 1,
1924+ body = objective_text(_"Open the encyclopedia window again",
1925+ li_image("images/ui_basic/menu_help.png",
1926+ _[[You closed the encyclopedia window without searching for the information we need. If you already know everything, please feel free to leave this tutorial at any time.]]) ..
1927 li(_[[Otherwise, please reopen the encyclopedia window and choose the second tab.]])
1928- ),
1929- h = 250
1930+ )
1931 }
1932-
1933 building_priority_settings = {
1934 position = "topright",
1935 title = _"Priority Settings",
1936 body = (
1937 h1(_[[Send the wares where they’re needed]]) ..
1938- p(_[[Great. Our taverns have now been built up and are supplying us with rations.]]) ..
1939- 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’.]]) ..
1940- p(_[[When you click on the red dot (low priority), the corresponding ware gets delivered less frequently. Green means that as many wares as possible should be delivered to this building, maybe because it produces something important.]]) ..
1941- p(_[[In our situation, you might want to work the bakeries as fast as possible because they supply our taverns, so you could set water to the highest priority for them. The other buildings (for example the donkey farm) would then get less water, but the bakery could work faster.]])
1942+ li_object("empire_marblemine", p(_[[Great. Our taverns have now been built up and are supplying us with rations.]]) ..
1943+ 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’.]]) ..
1944+ p(_[[When you click on the red dot (low priority), the corresponding ware gets delivered less frequently. Green means that as many wares as possible should be delivered to this building, maybe because it produces something important.]]) ..
1945+ p(_[[In our situation, you might want to work the bakeries as fast as possible because they supply our taverns, so you could set water to the highest priority for them. The other buildings (for example the donkey farm) would then get less water, but the bakery could work faster.]]), plr.color)
1946 -- we cannot check whether the user does this, so no objective
1947 -- see bug https://bugs.launchpad.net/widelands/+bug/1380288
1948 )
1949 }
1950
1951+obj_open_ware_stats = {
1952+ name = "open_ware_stats",
1953+ title = _"Open the ware statistics window",
1954+ number = 1,
1955+ body = objective_text(_"Open the ware statistics window",
1956+ li(_[[Select the ‘Wares’ entry from the ‘Statistics’ menu.]])
1957+ )
1958+}
1959 ware_stats1 = {
1960- position = "top",
1961 title = _"Ware Statistics",
1962 body = (
1963- p(_[[In the statistics menu, there is also a]]) ..
1964- li_image("images/wui/menus/menu_ware_stats.png", _[[‘Ware statistics’ button.]]) ..
1965- -- TRANSLATORS: "it" refers to the ware statistics button
1966- li(_[[Click on it.]])
1967+ li_image("images/wui/menus/statistics_wares.png", _[[Let’s have a look at how our wares production is doing.]])
1968 ),
1969- w = 200,
1970- h = 200,
1971- obj_name = "open_ware_stat",
1972- obj_title = _"Open the ware statistics window",
1973- obj_body = (
1974- li(_[[Open the ‘Ware statistics’ window, accessed via the statistics menu.]])
1975+ h = 250
1976+}
1977+
1978+obj_switch_ware_stats_tab_to_third = {
1979+ name = "switch_ware_stats_tab_to_third",
1980+ title = _"Examine your ware production and consumption",
1981+ number = 1,
1982+ body = objective_text(_"Examine your ware production and consumption",
1983+ p(_[[The first two tabs show you the production and consumption of any ware. You can toggle them by simply clicking on them.]]) ..
1984+ li(_[[When you have seen enough, switch to the third tab (‘Economy health’).]])
1985 )
1986 }
1987-
1988 ware_stats2 = {
1989+ position = "topright",
1990 title = _"Ware Statistics",
1991 body = (
1992- 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.]]) ..
1993- li(_[[I’ll continue as soon as you click on the]]) ..
1994- li_image("images/wui/stats/menu_tab_wares_econ_health.png", _[[third tab (‘Economy health’).]])
1995+ p(_[[In this window, you can select wares to see how their production or consumption has changed over time. Try it out with some wares.]]) ..
1996+ li_image("images/wui/stats/menu_tab_wares_econ_health.png", _[[I’ll continue as soon as you click on the third tab (‘Economy health’).]])
1997 ),
1998- h = 250,
1999- show_instantly = true,
2000- obj_name = "switch_ware_stat_tab_to_third",
2001- obj_title = _"Switch to the third tab in the ware statistics menu window",
2002- obj_body = (
2003- p(_[[The first two tabs show you the production and consumption of any ware. You can toggle them by simply clicking on them.]]) ..
2004- li(_[[When you have seen enough, switch to the third tab.]])
2005+ h = 350,
2006+ show_instantly = true
2007+}
2008+
2009+obj_switch_ware_stats_tab_to_fourth = {
2010+ name = "switch_ware_stats_tab_to_fourth",
2011+ title = _"Examine your economy’s health",
2012+ number = 1,
2013+ body = objective_text(_"Examine your economy’s health",
2014+ p(_[[The third tab shows you the economy health of the ware. When the value is positive, this means your stock is growing.]]) ..
2015+ p(_[[Now try this out. You can also compare it with the two previous tabs.]]) ..
2016+ li(_[[When you have seen enough, switch to the fourth tab (‘Stock’).]])
2017 )
2018 }
2019-
2020 ware_stats3 = {
2021+ position = "topright",
2022 title = _"Ware Statistics",
2023 body = (
2024- 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.]]) ..
2025- p(_[[Now try this out. You can also compare it with the two previous tabs.]]) ..
2026- li(_[[Click on the last tab when I should continue.]])
2027+ li_image("images/wui/stats/menu_tab_wares_econ_health.png",
2028+ _[[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.]])
2029 ),
2030- h = 250,
2031- show_instantly = true,
2032- obj_name = "switch_ware_stat_tab_to_forth",
2033- obj_title = _"Switch to the last tab in the ware statistics menu window",
2034- obj_body = (
2035- p(_[[The third tab shows you the economy health of the ware. When the value is positive, this means your stock is growing.]]) ..
2036- li(_[[When you have seen enough, switch to the fourth tab.]])
2037- )
2038+ h = 350,
2039+ show_instantly = true
2040 }
2041
2042+obj_close_ware_stats = {
2043+ name = "close_ware_stats",
2044+ title = _"Examine your stock",
2045+ number = 1,
2046+ body = objective_text(_"Examine your stock",
2047+ li_arrow(_[[The stock tab shows you how many wares you have. Compare the information from the four tabs to understand the correlation.]]) ..
2048+ li(_[[When you have finished, close the ware statistics window.]])
2049+ ),
2050+ h = 250
2051+}
2052 ware_stats4 = {
2053+ position = "topright",
2054 title = _"Ware Statistics",
2055 body = (
2056- 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!]]) ..
2057- p(_[[The last two tabs are good indicators to see whether shortages are about to come. Don’t forget to check them regularly!]]) ..
2058- li(_[[Close this window when you’re done.]])
2059- ),
2060- h = 250,
2061- show_instantly = true,
2062- obj_name = "close_ware_stats",
2063- obj_title = _"Close the ware statistics window",
2064- obj_body = (
2065- p(_[[The stock tab shows you how many wares you have. Compare the information from the four tabs to understand the correlation.]]) ..
2066- li(_[[When you have finished, close the ware statistics window.]])
2067- ),
2068+ li_image("images/wui/stats/menu_tab_wares_stock.png",
2069+ 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!]]) ..
2070+ p(_[[The last two tabs are good indicators to see whether shortages are about to come. Don’t forget to check them regularly!]]))
2071+ ),
2072+ show_instantly = true
2073 }
2074
2075 reopen_ware_stats1 = {
2076 title = _"You closed the ware statistics window!",
2077 body = (
2078- 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?]])
2079+ li_image("images/wui/menus/statistics_wares.png",
2080+ _[[You have closed the ware statistics window, but I have not yet finished with my explanation. Would you please reopen it and choose the third tab?]])
2081 ),
2082 show_instantly = true,
2083 w = 300,
2084 h = 250
2085 }
2086
2087-reopen_ware_stats1_obj = {
2088- obj_name = "open_ware_stats_menu_again1",
2089+obj_reopen_ware_stats1 = {
2090+ obj_name = "reopen_ware_stats1",
2091 obj_title = _"Open the ware statistics window again",
2092+ number = 1,
2093 obj_body = (
2094- 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.]]) ..
2095+ li_image("images/wui/menus/statistics_wares.png",
2096+ _[[You closed the ware statistics window before I finished telling you everything about it. If you already know everything, please feel free to leave this tutorial at any time.]]) ..
2097 -- TRANSLATORS: "it" refers to the ware statistics window.
2098 li(_[[Otherwise, please reopen it and choose the third tab.]])
2099 )
2100@@ -374,102 +413,122 @@
2101 reopen_ware_stats2 = {
2102 title = _"You closed the ware statistics window!",
2103 body = (
2104- 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?]])
2105+ li_image("images/wui/menus/statistics_wares.png",
2106+ _[[You have closed the ware statistics window, but I have not yet finished with my explanation. Would you please reopen it and choose the fourth tab?]])
2107 ),
2108 show_instantly = true,
2109 w = 300,
2110 h = 250
2111 }
2112
2113-reopen_ware_stats2_obj = {
2114- obj_name = "open_ware_stats_menu_again2",
2115- obj_title = _"Open the ware statistics window again",
2116- obj_body = (
2117- 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.]]) ..
2118+obj_reopen_ware_stats2 = {
2119+ name = "open_ware_stats_menu_again2",
2120+ title = _"Open the ware statistics window again",
2121+ number = 1,
2122+ body = (
2123+ li_image("images/wui/menus/statistics_wares.png",
2124+ _[[You closed the ware statistics window before I finished telling you everything about it. If you already know everything, please feel free to leave this tutorial at any time.]]) ..
2125 -- TRANSLATORS: "it" refers to the ware statistics window.
2126 li(_[[Otherwise, please reopen it and choose the fourth tab.]])
2127 )
2128 }
2129
2130+obj_open_economy_settings = {
2131+ name = "open_economy_settings",
2132+ title = _"Open the ‘Configure economy’ window",
2133+ number = 1,
2134+ body = objective_text(_"Open the ‘Configure economy’ window",
2135+ li(_[[Open the ‘Configure economy’ window.]]) ..
2136+ li_arrow(_[[The window can be accessed by clicking on any flag you own.]])
2137+ )
2138+}
2139 economy_settings1 = {
2140 position = "topright",
2141 title = _"Economy options",
2142 body = (
2143- p(_[[I’ve shown you our stock menu window, where you could see which wares are at the warehouses. You remember?]]) ..
2144- 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’.]]) ..
2145+ li_object("empire_flag",
2146+ p(_[[I’ve shown you our stock window, where you could see which wares are at the warehouses. You remember?]]) ..
2147+ p(_[[Now I’ll tell you how you can determine how many wares you want to have. The window for this purpose can be accessed via any flag and is called ‘Configure economy’.]]), plr.color) ..
2148 -- Yup, that's indeed the correct icon
2149- li_image("images/wui/stats/genstats_nrwares.png", _[[This is the icon.]]) ..
2150- li(_[[Open this window.]])
2151+ li_image("images/wui/stats/genstats_nrwares.png", _[[This is the icon.]])
2152 ),
2153- h = 350,
2154- obj_name = "open_economy_settings",
2155- obj_title = _"Open the ‘Configure economy’ window",
2156- obj_body = (
2157- li(_[[Open the ‘Configure economy’ window.]]) ..
2158- li_arrow(_[[The window can be accessed by clicking on any flag you own.]])
2159- )
2160+ h = 350
2161 }
2162
2163 economy_settings2 = {
2164+ position = "topright",
2165 title = _"Economy options",
2166 body = (
2167- p(_[[This window looks similar to the stock window, but it has additional buttons at the bottom.]]) ..
2168+ li_image("images/wui/stats/genstats_nrwares.png",
2169+ _[[This window looks similar to the stock window, but it has additional buttons at the bottom.]]) ..
2170 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.]]) ..
2171 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.]]) ..
2172- p(_[[An example: the default value for scythes is 1. If you build a farm, a carrier will take a scythe and become a farmer. Then there will be no scythes left, but the target quantity is 1, therefore your toolsmith will start producing another one.]]) ..
2173- p(_[[If you build two farms, only one of them will start working immediately. The second farm will have to wait for its worker, who will lack a scythe. If you had set the target quantity to 2 before, two scythes would have been available and both farms would have been able to start working right away.]])
2174- ),
2175- h = 450
2176+ li_image(wl.Game():get_ware_description("scythe").icon_name,
2177+ _[[An example: the default value for scythes is 1. If you build a farm, a carrier will take a scythe and become a farmer. Then there will be no scythes left, but the target quantity is 1, therefore your toolsmith will start producing another one.]]) ..
2178+ li_object("empire_farmer",
2179+ _[[If you build two farms, only one of them will start working immediately. The second farm will have to wait for its worker, who will lack a scythe. If you had set the target quantity to 2 before, two scythes would have been available and both farms would have been able to start working right away.]], plr.color)
2180+ )
2181 }
2182
2183+obj_produce_marble_columns = {
2184+ name = "produce_marble_columns",
2185+ title = _"Produce 20 marble columns",
2186+ number = 1,
2187+ body = objective_text(_"Produce 20 marble columns",
2188+ li(_[[To be prepared for additional fortifications, you should produce 20 marble columns.]]) ..
2189+ li_arrow(_[[Your stonemason will not produce marble columns when they are not needed. You have to increase the target quantity.]]) ..
2190+ li_arrow(_[[To do so, click on any flag and choose ‘Configure economy’. In this window, you can decide how many wares of each type you wish to have in stock.]]) ..
2191+ li_arrow(_[[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.]])
2192+ )
2193+}
2194 economy_settings3 = {
2195+ position = "topright",
2196 title = _"Economy options",
2197 body = (
2198- 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.]]) ..
2199+ li_image(wl.Game():get_ware_description("iron").icon_name,
2200+ _[[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.]]) ..
2201 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.]]) ..
2202- 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.]]) ..
2203- li(_[[Set the target quantity for marble columns to 20 and wait for your stonemason to produce them.]])
2204+ li_image(wl.Game():get_ware_description("marble_column").icon_name,
2205+ _[[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.]])
2206 ),
2207- obj_name = "produce_marble_columns",
2208- obj_title = _"Produce 20 marble columns",
2209- obj_body = (
2210- 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.]]) ..
2211- li(_[[To be prepared for additional fortifications, you should produce 20 marble columns.]]) ..
2212- li_arrow(_[[Your stonemason will not produce marble columns when they are not needed. You have to increase the target quantity.]]) ..
2213- 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.]])
2214+ h = 500,
2215+}
2216+
2217+obj_bring_marble_columns_to_front = {
2218+ name = "bring_marble_columns_to_front",
2219+ title = _"Bring 20 marble columns to the front line",
2220+ number = 1,
2221+ body = objective_text(_"Bring 20 marble columns to the front line",
2222+ li(_[[Bring all of the 20 marble columns to the warehouse near the front line.]]) ..
2223+ li_image("images/wui/buildings/stock_policy_button_prefer.png",
2224+ _[[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.]]) ..
2225+ li_image("images/wui/buildings/stock_policy_button_remove.png",
2226+ _[[Then, to move the marble columns out of your headquarters, you will have to click on the remove button there.]])
2227 )
2228 }
2229-
2230 warehouse_preference_settings = {
2231 field = warehouse_field,
2232 position = "topright",
2233 title = _"Warehouse Preferences",
2234 body = (
2235 h1(_[[Bring the marble columns to the front line]]) ..
2236- p(_[[The production of marble columns is working fine now, but it would be great if they were stored where we need them.]]) ..
2237- 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.]]) ..
2238- 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.]]) ..
2239- li(_[[Bring all of the 20 marble columns to the warehouse near the front line.]]) ..
2240- 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.]]) ..
2241- li_arrow(_[[Then, to move the marble columns out of your headquarters, you will have to click on the remove button there.]])
2242+ li_object("empire_warehouse",
2243+ p(_[[The production of marble columns is working fine now, but it would be great if they were stored where we need them.]]) ..
2244+ 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.]]) ..
2245+ 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.]]), plr.color)
2246 ),
2247- obj_name = "bring_marble_columns_to_front",
2248- obj_title = _"Bring 20 marble columns to the front line",
2249- obj_body = (
2250- p(_[[To decide where your wares get stored, you can use the preference buttons in the warehouses.]]) ..
2251- li(_[[Bring all of the 20 marble columns to the warehouse near the front line.]]) ..
2252- 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.]]) ..
2253- li_arrow(_[[Then, to move the marble columns out of your headquarters, you will have to click on the remove button there.]])
2254- )
2255+ h = 500
2256 }
2257
2258 conclusion = {
2259 title = _"Borders Secured",
2260 body =
2261 h1(_[[We’re safe now]]) ..
2262- 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.]]) ..
2263- 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!]]) ..
2264+ li_object("empire_fortress",
2265+ 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.]]) ..
2266+ 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!]]), plr.color) ..
2267 p([[]]) ..
2268 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:]]) ..
2269- h1(p("align=center", u("widelands.org")))
2270+ h1(p("align=center", u("widelands.org"))),
2271+ h = 450
2272 }
2273
2274=== modified file 'data/scripting/editor/editor_help.lua'
2275--- data/scripting/editor/editor_help.lua 2018-09-29 09:20:35 +0000
2276+++ data/scripting/editor/editor_help.lua 2019-06-01 15:39:16 +0000
2277@@ -79,7 +79,7 @@
2278 name = "terrains",
2279 -- TRANSLATORS Tab title: terrain help
2280 title = _"Terrains",
2281- icon = "images/wui/editor/editor_menu_tool_set_terrain.png",
2282+ icon = "images/wui/editor/tools/terrain.png",
2283 entries = get_terrains()
2284 },
2285 {
2286
2287=== modified file 'data/scripting/messages.lua'
2288--- data/scripting/messages.lua 2019-02-09 18:45:42 +0000
2289+++ data/scripting/messages.lua 2019-06-01 15:39:16 +0000
2290@@ -6,6 +6,7 @@
2291
2292 include "scripting/coroutine.lua"
2293 include "scripting/richtext.lua"
2294+include "scripting/richtext_scenarios.lua"
2295 include "scripting/table.lua"
2296 include "scripting/ui.lua"
2297
2298@@ -87,10 +88,57 @@
2299 -- :arg message: the message to be sent
2300 -- :arg sleeptime: ms spent sleeping after the message has been dismissed by the player
2301 --
2302+-- Besides the normal message arguments (see wl.Game.Player:message_box) the following ones can be used:
2303+--
2304+-- :arg position: A string that indicates at which border of the screen the message box shall appear. Can be "top", "bottom", "right", "left" or a combination (e.g. "topright"). Overrides posx and posy. Default: Center. If only one direction is indicated, the other one stays central.
2305+-- :arg scroll_back: If true, the view scrolls/jumps back to where it came from. If false, the new location stays on the screen when the message box is closed. Default: False.
2306+-- :arg show_instantly: If true, the message box is shown immediately. If false, this function will wait until the player leaves the roadbuilding mode. Use this with care because it can be very interruptive. Default: false.
2307+--
2308 function campaign_message_box(message, sleeptime)
2309- if not message.h then message.h = 400 end
2310- if not message.w then message.w = 450 end
2311- message_box(wl.Game().players[1], message.title, message.body, message)
2312+ message.show_instantly = message.show_instantly or false
2313+ message.scroll_back = message.scroll_back or false
2314+ message.h = message.h or 400
2315+ message.w = message.w or 450
2316+
2317+ if message.position then
2318+ if string.find(message.position,"top") then
2319+ -- Set it a bit lover than 0 to prevent overlap with game speed text
2320+ message.posy = 25
2321+ elseif string.find(message.position,"bottom") then
2322+ message.posy = 10000
2323+ end
2324+ if string.find(message.position,"left") then
2325+ message.posx = 0
2326+ elseif string.find(message.position,"right") then
2327+ message.posx = 10000
2328+ end
2329+ end
2330+
2331+ local center_pixel
2332+
2333+ if message.field then
2334+ -- This is necessary. Otherwise, we would scroll and then wait until the road is finished.
2335+ -- In this time, could user can scroll elsewhere, giving weird results.
2336+ if not message.show_instantly then
2337+ wait_for_roadbuilding()
2338+ end
2339+ center_pixel = scroll_to_field(message.field);
2340+ end
2341+
2342+ if message.show_instantly then
2343+ -- message_box takes care of this, but player:message_box does not
2344+ local user_input = wl.ui.get_user_input_allowed()
2345+ wl.ui.set_user_input_allowed(true)
2346+ wl.Game().players[1]:message_box(message.title, rt(message.body), message)
2347+ wl.ui.set_user_input_allowed(user_input)
2348+ else
2349+ message_box(wl.Game().players[1], message.title, message.body, message)
2350+ end
2351+
2352+ if (message.field and message.scroll_back) then
2353+ scroll_to_map_pixel(center_pixel);
2354+ end
2355+
2356 if sleeptime then sleep(sleeptime) end
2357 end
2358
2359@@ -112,6 +160,32 @@
2360 end
2361 end
2362
2363+
2364+-- RST
2365+-- .. function:: campaign_message_box(message, objective [,sleeptime])
2366+--
2367+-- Sets message.h and message.w if not set and calls
2368+-- message_box(player, title, body, parameters) for player 1.
2369+--
2370+-- Adds an objective to the scenario afterwards.
2371+--
2372+--
2373+-- :arg message: the message to be sent
2374+-- :arg objective: The objective to be added. If the variable obj_name exists, obj_name, obj_title and obj_body are used. Otherwise, it needs to have a name, title, and body.
2375+-- :arg sleeptime: ms spent sleeping after the message has been dismissed by the player
2376+--
2377+-- :returns: The new objective.
2378+--
2379+-- TODO(wl-zocker): This function should be used by all tutorials, campaigns and scenario maps
2380+function campaign_message_with_objective(message, objective, sleeptime)
2381+ -- TODO(GunChleoc): Once everybody is using this function, move new_objectives over from
2382+ -- richtext_scenarios and add this file to utils/buildcat.py
2383+ message.body = message.body .. new_objectives(objective)
2384+ campaign_message_box(message, sleeptime)
2385+ return add_campaign_objective(objective)
2386+end
2387+
2388+
2389 -- RST
2390 -- .. function:: set_objective_done(objective[, sleeptime])
2391 --
2392@@ -133,6 +207,7 @@
2393 -- RST
2394 -- .. function:: message_box_objective(player, message)
2395 --
2396+-- DEPRECATED, use campaign_message_with_objective instead.
2397 -- Calls message_box(player, message.title, message.body, message). Also adds an objective defined in obj_name, obj_title and obj_body.
2398 -- This method should gather all options that are used often to avoid reimplementation in every single scenario script.
2399 --
2400@@ -146,8 +221,6 @@
2401 -- :arg show_instantly: If true, the message box is shown immediately. If false, this function calls message_box(), which waits until the player leaves the roadbuilding mode. Use this with care because it can be very interruptive. Default: false.
2402 --
2403 -- :returns: the objective if defined, nil otherwise
2404-
2405--- TODO(wl-zocker): This function should be used by all tutorials, campaigns and scenario maps
2406 function message_box_objective(player, message)
2407 message.show_instantly = message.show_instantly or false
2408 message.scroll_back = message.scroll_back or false
2409
2410=== modified file 'data/scripting/richtext.lua'
2411--- data/scripting/richtext.lua 2018-09-29 09:20:35 +0000
2412+++ data/scripting/richtext.lua 2019-06-01 15:39:16 +0000
2413@@ -424,7 +424,7 @@
2414 end
2415
2416 -- RST
2417--- .. function:: li_object(name, text)
2418+-- .. function:: li_object(name, text[, playercolor])
2419 --
2420 -- Places a paragraph of text to the right of an image representing the given map object
2421 --
2422@@ -434,12 +434,19 @@
2423 -- :arg text: the text to be placed next to the image
2424 -- :type text: :class:`string`
2425 --
2426+-- :arg playercolor: a playercolor to be applied to the image, in hex notation
2427+-- :type playercolor: :class:`string`
2428+--
2429 -- :returns: the text wrapped in a paragraph and placed next to the image, the outer tag is a div.
2430
2431-function li_object(name, text)
2432+function li_object(name, text, playercolor)
2433+ local image = img_object(name)
2434+ if (playercolor ~= nil) then
2435+ image = img_object(name, "color=" .. playercolor)
2436+ end
2437 return
2438 div("width=100%",
2439- div("float=left padding_r=6", p(img_object(name))) ..
2440+ div("float=left padding_r=6", p(image)) ..
2441 p(text)
2442 )
2443 end
2444@@ -607,7 +614,7 @@
2445 -- h1("6699ff", _[[Colored header]]) ..
2446 -- p(_[[Normal paragraph, just with a bit more text to show how it looks like.]]) ..
2447 -- p("align=center", _[[A centered paragraph, just with a bit more text to show how it looks like.]]) ..
2448--- li_image("images/wui/menus/menu_toggle_menu.png", _[[An image with right aligned text. This is just text to show automatic line breaks and behavior in regard with images]]) ..
2449+-- li_image("images/wui/menus/statistics.png", _[[An image with right aligned text. This is just text to show automatic line breaks and behavior in regard with images]]) ..
2450 -- li(_[[A list item]]) ..
2451 -- li(font("color=6699ff bold=1", _[[Blue and bold]])) ..
2452 -- li_arrow(_[[A list item with an arrow]]) ..
2453
2454=== modified file 'data/scripting/richtext_scenarios.lua'
2455--- data/scripting/richtext_scenarios.lua 2019-05-12 10:35:21 +0000
2456+++ data/scripting/richtext_scenarios.lua 2019-06-01 15:39:16 +0000
2457@@ -87,9 +87,17 @@
2458 text = text .. obj.body
2459 sum = sum + obj.number
2460 end
2461- local objectives_header = _"New Objective"
2462+
2463+ local objectives_header = _"New Objective"
2464 if (sum > 1) then
2465 objectives_header = _"New Objectives"
2466 end
2467- return h1(objectives_header) .. text
2468+
2469+ return
2470+ div("width=100%",
2471+ vspace(18) ..
2472+ div("float=left padding_r=6", p(img("images/wui/menus/objectives.png"))) ..
2473+ p_font("", "size=18 bold=1 color=D1D1D1", vspace(6) .. objectives_header) ..
2474+ vspace(1) .. text
2475+ )
2476 end