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

Proposed by GunChleoc
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 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.
Revision history for this message
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.

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

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

Revision history for this message
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
=== modified file 'data/campaigns/tutorial01_basic_control.wmf/elemental'
--- data/campaigns/tutorial01_basic_control.wmf/elemental 2014-10-28 09:24:36 +0000
+++ data/campaigns/tutorial01_basic_control.wmf/elemental 2019-06-01 15:39:16 +0000
@@ -6,5 +6,5 @@
6map_h="64"6map_h="64"
7nr_players="1"7nr_players="1"
8name=_"Basic Control"8name=_"Basic Control"
9author="Winterwind,SirVer,Nasenbaer,wl-zocker"9author="Winterwind,SirVer,Nasenbaer,wl-zocker,GunChleoc"
10descr=_"In this tutorial, you will learn how to navigate in Widelands and how to build buildings and roads."10descr=_"In this tutorial, you will learn how to navigate in Widelands and how to build buildings and roads."
1111
=== modified file 'data/campaigns/tutorial01_basic_control.wmf/scripting/helper_functions_demonstration.lua'
--- data/campaigns/tutorial01_basic_control.wmf/scripting/helper_functions_demonstration.lua 2016-12-28 22:11:45 +0000
+++ data/campaigns/tutorial01_basic_control.wmf/scripting/helper_functions_demonstration.lua 2019-06-01 15:39:16 +0000
@@ -68,6 +68,18 @@
68 blocker:lift_blocks()68 blocker:lift_blocks()
69end69end
7070
71
72function select_item_from_dropdown(name, item)
73 local blocker = UserInputDisabler:new()
74
75 wl.ui.MapView().dropdowns[name]:highlight_item(item)
76 sleep(5000)
77 wl.ui.MapView().dropdowns[name]:select()
78 sleep(3000)
79
80 blocker:lift_blocks()
81end
82
71-- Make sure the user is in road building mode starting from the given flag83-- Make sure the user is in road building mode starting from the given flag
72function enter_road_building_mode(flag)84function enter_road_building_mode(flag)
73 local mv = wl.ui.MapView()85 local mv = wl.ui.MapView()
7486
=== modified file 'data/campaigns/tutorial01_basic_control.wmf/scripting/mission_thread.lua'
--- data/campaigns/tutorial01_basic_control.wmf/scripting/mission_thread.lua 2017-06-25 12:53:48 +0000
+++ data/campaigns/tutorial01_basic_control.wmf/scripting/mission_thread.lua 2019-06-01 15:39:16 +0000
@@ -2,17 +2,61 @@
2-- Mission thread2-- Mission thread
3-- ================3-- ================
44
5local objective_to_explain_objectives = add_campaign_objective(obj_initial_close_objectives_window)
6
7local function wait_for_quarry_road_connection(field, cs, objective)
8 -- Wait till the construction site is connected to the headquarters
9 sleep(10 * wl.Game().desired_speed)
10 while not field.immovable or field.brn.immovable.debug_economy ~= sf.brn.immovable.debug_economy do
11 if not field.immovable then
12 campaign_message_box(quarry_illegally_destroyed)
13 scroll_to_field(field)
14 mouse_to_field(field)
15
16 cs = nil
17 immovable_is_legal = function(i)
18 -- only allow quarry and flag at this position because the road building below relies on this
19 if (i.fields[1] == field) or (i.fields[1] == field.brn) then
20 cs = allow_constructionsite(i, {"barbarians_quarry"})
21 return cs
22 elseif(i.descr.type_name == "flag") or (i.descr.type_name == "road") then
23 register_immovable_as_allowed(i)
24 return true
25 else return false end
26 end
27
28 -- Wait for a new constructionsite to be placed
29 while not cs do sleep(200) end
30 register_immovable_as_allowed(cs)
31 else
32 campaign_message_box(quarry_not_connected)
33 end
34 sleep(60*1000)
35 end
36 set_objective_done(objective, 0)
37 register_immovable_as_allowed(cs)
38end
39
5function starting_infos()40function starting_infos()
41 -- So that the player cannot build anything here
42 map:place_immovable("debris00", second_quarry_field, "world")
6 reveal_concentric(plr, sf, 13, true, 80)43 reveal_concentric(plr, sf, 13, true, 80)
7 map:place_immovable("debris00",second_quarry_field, "world")
8 -- so that the player cannot build anything here
9
10 sleep(1000)44 sleep(1000)
1145
12 message_box_objective(plr, initial_message_01)46 -- Welcome and teach objectives
47 local o = campaign_message_with_objective(initial_message_01, obj_initial_close_story_window)
48 set_objective_done(o, 100)
49
50 wl.ui.MapView().buttons.objectives:click()
51 while not wl.ui.MapView().windows.objectives do sleep(100) end
52 while wl.ui.MapView().windows.objectives do sleep(100) end
13 sleep(500)53 sleep(500)
1454
15 local o = message_box_objective(plr, initial_message_02)55 -- Teach building spaces
56 campaign_message_box(initial_message_02, 200)
57 select_item_from_dropdown("dropdown_menu_showhide", 1)
58 select_item_from_dropdown("dropdown_menu_showhide", 1)
59 local o = campaign_message_with_objective(initial_message_03, obj_initial_toggle_building_spaces)
1660
17 -- Wait for buildhelp to come on61 -- Wait for buildhelp to come on
18 while not wl.ui.MapView().buildhelp do62 while not wl.ui.MapView().buildhelp do
@@ -30,7 +74,7 @@
30 -- We take control, everything that we build is legal74 -- We take control, everything that we build is legal
31 immovable_is_legal = function(i) return true end75 immovable_is_legal = function(i) return true end
3276
33 message_box_objective(plr, lumberjack_message_01)77 campaign_message_box(lumberjack_message_01)
3478
35 local blocker = UserInputDisabler:new()79 local blocker = UserInputDisabler:new()
36 close_windows()80 close_windows()
@@ -38,7 +82,7 @@
38 scroll_to_field(first_lumberjack_field)82 scroll_to_field(first_lumberjack_field)
39 mouse_to_field(first_lumberjack_field)83 mouse_to_field(first_lumberjack_field)
40 sleep(500)84 sleep(500)
41 message_box_objective(plr, lumberjack_message_02)85 campaign_message_box(lumberjack_message_02)
42 sleep(500)86 sleep(500)
4387
44 click_on_field(first_lumberjack_field)88 click_on_field(first_lumberjack_field)
@@ -48,16 +92,16 @@
48 sleep(500)92 sleep(500)
4993
50 if wl.ui.MapView().is_building_road then94 if wl.ui.MapView().is_building_road then
51 message_box_objective(plr, lumberjack_message_03a)95 campaign_message_box(lumberjack_message_03a)
52 else96 else
53 enter_road_building_mode(first_lumberjack_field.brn.immovable)97 enter_road_building_mode(first_lumberjack_field.brn.immovable)
54 message_box_objective(plr, lumberjack_message_03b)98 campaign_message_box(lumberjack_message_03b)
55 end99 end
56 sleep(500)100 sleep(500)
57101
58 click_on_field(sf.brn)102 click_on_field(sf.brn)
59103
60 message_box_objective(plr, lumberjack_message_04)104 campaign_message_box(lumberjack_message_04)
61105
62 register_immovable_as_allowed(first_lumberjack_field.immovable) -- hut + flag106 register_immovable_as_allowed(first_lumberjack_field.immovable) -- hut + flag
63107
@@ -72,7 +116,7 @@
72116
73 if not (f.immovable and f.immovable.descr.type_name == "flag") then117 if not (f.immovable and f.immovable.descr.type_name == "flag") then
74 -- only show this if the user has not already built a flag118 -- only show this if the user has not already built a flag
75 local o = message_box_objective(plr, lumberjack_message_05)119 local o = campaign_message_with_objective(lumberjack_message_05, obj_lumberjack_place_flag)
76120
77 local blocker = UserInputDisabler:new()121 local blocker = UserInputDisabler:new()
78 close_windows()122 close_windows()
@@ -85,27 +129,35 @@
85129
86 -- Wait for flag130 -- Wait for flag
87 while not (f.immovable and f.immovable.descr.type_name == "flag") do sleep(300) end131 while not (f.immovable and f.immovable.descr.type_name == "flag") do sleep(300) end
88 set_objective_done(o, 300)132 set_objective_done(o, 16 * 1000)
89
90 message_box_objective(plr, lumberjack_message_06)
91 else133 else
92 -- if the flag is already built, show the player a different message box134 -- if the flag is already built, show the player a different message box
93 message_box_objective(plr, flag_built)135 campaign_message_box(lumberjack_message_06, 3 * 1000)
94 end136 end
95137
96 sleep(30*1000) -- let the player experiment a bit with the speed138 local o = campaign_message_with_objective(lumberjack_message_07, obj_lumberjack_progress)
97 message_box_objective(plr, construction_site_window)139 scroll_to_field(first_lumberjack_field)
140 mouse_to_field(first_lumberjack_field)
141
142 while not wl.ui.MapView().windows.building_window do sleep(100) end
143 while wl.ui.MapView().windows.building_window do sleep(100) end
144 set_objective_done(o)
145
146 campaign_message_box(lumberjack_message_08)
147 wl.ui.MapView().dropdowns["dropdown_menu_gamespeed"]:open()
148
149 sleep(20*1000) -- let the player experiment a bit with the window
98150
99 while #plr:get_buildings("barbarians_lumberjacks_hut") < 1 do sleep(300) end151 while #plr:get_buildings("barbarians_lumberjacks_hut") < 1 do sleep(300) end
100152
101 message_box_objective(plr, lumberjack_message_07)153 campaign_message_box(lumberjack_message_09)
102154
103 learn_to_move()155 learn_to_move()
104end156end
105157
106function learn_to_move()158function learn_to_move()
107 -- Teaching the user how to scroll on the map159 -- Teaching the user how to scroll on the map
108 local o = message_box_objective(plr, inform_about_rocks)160 local o = campaign_message_with_objective(tell_about_keyboard_move, obj_moving_keyboard)
109161
110 function _wait_for_move()162 function _wait_for_move()
111 local center_map_pixel = wl.ui.MapView().center_map_pixel163 local center_map_pixel = wl.ui.MapView().center_map_pixel
@@ -118,12 +170,17 @@
118 _wait_for_move()170 _wait_for_move()
119 set_objective_done(o)171 set_objective_done(o)
120172
121 o = message_box_objective(plr, tell_about_right_drag_move)173 o = campaign_message_with_objective(tell_about_right_drag_move, obj_moving_right_drag)
122174
123 _wait_for_move()175 _wait_for_move()
124 set_objective_done(o)176 set_objective_done(o)
125177
126 o = message_box_objective(plr, tell_about_minimap)178 -- Teach the minimap
179 campaign_message_box(tell_about_minimap_1)
180
181 -- Open the minimap
182 select_item_from_dropdown("dropdown_menu_mapview", 1)
183 o = campaign_message_with_objective(tell_about_minimap_2, obj_moving_minimap)
127184
128 -- Wait until the minimap has been opened and closed again185 -- Wait until the minimap has been opened and closed again
129 while not wl.ui.MapView().windows.minimap do sleep(100) end186 while not wl.ui.MapView().windows.minimap do sleep(100) end
@@ -131,7 +188,7 @@
131188
132 set_objective_done(o, 500)189 set_objective_done(o, 500)
133190
134 message_box_objective(plr, congratulate_and_on_to_quarry)191 campaign_message_box(congratulate_and_on_to_quarry)
135192
136 build_a_quarry()193 build_a_quarry()
137end194end
@@ -140,7 +197,7 @@
140 sleep(200)197 sleep(200)
141198
142 -- Teaching how to build a quarry and the nits and knacks of road building.199 -- Teaching how to build a quarry and the nits and knacks of road building.
143 local o = message_box_objective(plr, order_quarry_recap_how_to_build)200 local o = campaign_message_with_objective(order_quarry_recap_how_to_build, obj_build_a_quarry)
144201
145 local cs = nil202 local cs = nil
146 immovable_is_legal = function(i)203 immovable_is_legal = function(i)
@@ -174,12 +231,12 @@
174231
175 immovable_is_legal = function() return true end232 immovable_is_legal = function() return true end
176233
177 sleep(3000) -- give the game some time to enter road building mode234 sleep(wl.Game().desired_speed) -- give the game some time to enter road building mode
178 if wl.ui.MapView().is_building_road then235 if wl.ui.MapView().is_building_road then
179 message_box_objective(plr, talk_about_roadbuilding_00a)236 campaign_message_box(talk_about_roadbuilding_00a)
180 else237 else
181 -- show the user how to enter road building mode manually238 -- show the user how to enter road building mode manually
182 message_box_objective(plr, talk_about_roadbuilding_00b)239 campaign_message_box(talk_about_roadbuilding_00b)
183 click_on_field(first_quarry_field.brn)240 click_on_field(first_quarry_field.brn)
184 click_on_panel(wl.ui.MapView().windows.field_action.buttons.build_road, 300)241 click_on_panel(wl.ui.MapView().windows.field_action.buttons.build_road, 300)
185 end242 end
@@ -195,7 +252,7 @@
195252
196 _rip_road()253 _rip_road()
197254
198 message_box_objective(plr, talk_about_roadbuilding_01)255 campaign_message_box(talk_about_roadbuilding_01)
199 -- Showoff direct roadbuilding256 -- Showoff direct roadbuilding
200 click_on_field(first_quarry_field.brn)257 click_on_field(first_quarry_field.brn)
201 click_on_panel(wl.ui.MapView().windows.field_action.buttons.build_road, 300)258 click_on_panel(wl.ui.MapView().windows.field_action.buttons.build_road, 300)
@@ -207,7 +264,7 @@
207264
208 blocker:lift_blocks()265 blocker:lift_blocks()
209266
210 local o = message_box_objective(plr, talk_about_roadbuilding_02)267 local o = campaign_message_with_objective(talk_about_roadbuilding_02, obj_build_road_to_quarry)
211268
212 -- The player is allowed to build roads and flags at will269 -- The player is allowed to build roads and flags at will
213 immovable_is_legal = function(i)270 immovable_is_legal = function(i)
@@ -217,13 +274,7 @@
217 else return false end274 else return false end
218 end275 end
219276
220 -- Wait till the construction site is connected to the headquarters277 wait_for_quarry_road_connection(first_quarry_field, cs, o)
221 sleep(20*1000)
222 while first_quarry_field.brn.immovable.debug_economy ~= sf.brn.immovable.debug_economy do
223 message_box_objective(plr,quarry_not_connected)
224 sleep(60*1000)
225 if not first_quarry_field.immovable then message_box_objective(plr,quarry_illegally_destroyed) return end
226 end
227278
228 second_quarry()279 second_quarry()
229280
@@ -231,7 +282,6 @@
231 census_and_statistics()282 census_and_statistics()
232283
233 while #plr:get_buildings("barbarians_quarry") < 2 do sleep(1400) end284 while #plr:get_buildings("barbarians_quarry") < 2 do sleep(1400) end
234 set_objective_done(o, 0)
235285
236 messages()286 messages()
237end287end
@@ -239,9 +289,11 @@
239function second_quarry()289function second_quarry()
240 sleep(2000)290 sleep(2000)
241291
242 local o = message_box_objective(plr, build_second_quarry)292 local o = campaign_message_with_objective(build_second_quarry, obj_build_the_second_quarry)
293 -- Remove this immovable (debris)
243 second_quarry_field.immovable:remove()294 second_quarry_field.immovable:remove()
244 -- remove this immovable (debris)295 scroll_to_field(first_quarry_field)
296 mouse_to_field(second_quarry_field)
245297
246 local cs = nil298 local cs = nil
247 immovable_is_legal = function(i)299 immovable_is_legal = function(i)
@@ -257,18 +309,9 @@
257 -- Wait for the constructionsite to be placed309 -- Wait for the constructionsite to be placed
258 while not cs do sleep(200) end310 while not cs do sleep(200) end
259311
260 sleep(60*1000)312 wait_for_quarry_road_connection(second_quarry_field, cs, o)
261 while second_quarry_field.brn.immovable.debug_economy ~= sf.brn.immovable.debug_economy do
262 message_box_objective(plr,quarry_not_connected)
263 sleep(60*1000)
264 if not second_quarry_field.immovable then message_box_objective(plr,quarry_illegally_destroyed) return end
265 end
266
267 set_objective_done(o, 0)
268 register_immovable_as_allowed(cs)
269end313end
270314
271
272function census_and_statistics()315function census_and_statistics()
273 sleep(15000)316 sleep(15000)
274317
@@ -280,40 +323,45 @@
280323
281 wl.ui.MapView():abort_road_building()324 wl.ui.MapView():abort_road_building()
282325
283 message_box_objective(plr, census_and_statistics_00)326 campaign_message_box(census_and_statistics_00)
284327
285 click_on_field(first_quarry_field.bln)328 select_item_from_dropdown("dropdown_menu_showhide", 2)
286 click_on_panel(wl.ui.MapView().windows.field_action.tabs.watch)329 sleep(200)
287 click_on_panel(wl.ui.MapView().windows.field_action.buttons.census)
288 sleep(300)
289 click_on_field(first_quarry_field.brn)
290 click_on_panel(wl.ui.MapView().windows.field_action.tabs.watch)
291 click_on_panel(wl.ui.MapView().windows.field_action.buttons.statistics)
292
293 message_box_objective(plr, census_and_statistics_01)
294330
295 blocker:lift_blocks()331 blocker:lift_blocks()
332
333 local o = campaign_message_with_objective(census_and_statistics_01, obj_show_statistics)
334
335 -- Wait for statistics to come on
336 while not wl.ui.MapView().statistics do sleep(200) end
337 set_objective_done(o, 5 * wl.Game().desired_speed)
338
339 if (#plr:get_buildings("barbarians_quarry") < 2) then
340 campaign_message_box(census_and_statistics_02, 200)
341 end
296end342end
297343
298function messages()344function messages()
299 -- Teach the player about receiving messages345 -- Teach the player about receiving messages
300 sleep(10)346 sleep(10)
347 local old_gamespeed = wl.Game().desired_speed
348 wl.Game().desired_speed = 1000
301349
302 send_message(plr, teaching_about_messages.title, teaching_about_messages.body, teaching_about_messages, {heading = teaching_about_messages.heading})350 send_message(plr, teaching_about_messages.title, teaching_about_messages.body, teaching_about_messages, {heading = teaching_about_messages.heading})
303 local o = add_campaign_objective(teaching_about_messages)351 local o = add_campaign_objective(obj_archive_all_messages)
304352
305 while #plr.inbox > 0 do sleep(200) end353 while #plr.inbox > 0 do sleep(200) end
306 set_objective_done(o, 500)354 set_objective_done(o, 500)
307355
308 local o = message_box_objective(plr, closing_msg_window_00)356 local o = campaign_message_with_objective(closing_msg_window_00, obj_close_message_window)
309357
310 -- Wait for messages window to close358 -- Wait for messages window to close
311 while wl.ui.MapView().windows.messages do sleep(300) end359 while wl.ui.MapView().windows.messages do sleep(300) end
312 set_objective_done(o, 0)360 set_objective_done(o, 300)
313361
314 message_box_objective(plr, closing_msg_window_01)362 campaign_message_box(closing_msg_window_01, 800)
315363
316 sleep(800)364 if (wl.Game().desired_speed == 1000) then wl.Game().desired_speed = old_gamespeed end
317365
318 destroy_quarries()366 destroy_quarries()
319end367end
@@ -336,10 +384,7 @@
336 -- Wait for messages to arrive384 -- Wait for messages to arrive
337 while count_quarry_messages() < 2 do sleep(300) end385 while count_quarry_messages() < 2 do sleep(300) end
338386
339 local o = message_box_objective(plr, destroy_quarries_message)387 local o = campaign_message_with_objective(destroy_quarries_message, obj_destroy_quarries)
340
341 -- From now on, the player can build whatever he wants
342 terminate_bad_boy_sentinel = true
343388
344 while #plr:get_buildings("barbarians_quarry") > 0 do sleep(200) end389 while #plr:get_buildings("barbarians_quarry") > 0 do sleep(200) end
345 set_objective_done(o)390 set_objective_done(o)
@@ -351,7 +396,10 @@
351 -- Teach about expanding the territory396 -- Teach about expanding the territory
352 sleep(10)397 sleep(10)
353398
354 local o = message_box_objective(plr, introduce_expansion)399 -- From now on, the player can build whatever he wants
400 terminate_bad_boy_sentinel = true
401
402 local o = campaign_message_with_objective(introduce_expansion, obj_expand_territory)
355403
356 -- wait until there are soldiers inside so that the player sees the expansion404 -- wait until there are soldiers inside so that the player sees the expansion
357 local soldier_inside = false405 local soldier_inside = false
@@ -371,19 +419,20 @@
371 sleep(500)419 sleep(500)
372 end420 end
373421
374 set_objective_done(o)422 set_objective_done(o, 4 * wl.Game().desired_speed)
375 message_box_objective(plr, military_building_finished)423 campaign_message_box(military_building_finished)
376424
377 conclusion()425 conclusion()
378end426end
379427
380function conclusion()428function conclusion()
429 set_objective_done(objective_to_explain_objectives)
430
381 sleep(5000) -- to give the player time to see his expanded area431 sleep(5000) -- to give the player time to see his expanded area
382432
383 -- Conclude the tutorial with final words and information433 -- Conclude the tutorial with final words and information
384 -- on how to quit434 -- on how to quit
385 message_box_objective(plr, conclude_tutorial)435 campaign_message_box(conclude_tutorial)
386
387end436end
388437
389run(bad_boy_sentry)438run(bad_boy_sentry)
390439
=== modified file 'data/campaigns/tutorial01_basic_control.wmf/scripting/texts.lua'
--- data/campaigns/tutorial01_basic_control.wmf/scripting/texts.lua 2019-02-03 12:02:57 +0000
+++ data/campaigns/tutorial01_basic_control.wmf/scripting/texts.lua 2019-06-01 15:39:16 +0000
@@ -2,15 +2,14 @@
2-- Texts for the tutorial mission2-- Texts for the tutorial mission
3-- =======================================================================3-- =======================================================================
44
5-- =========================
6-- Some formating functions
7-- =========================
8
9include "scripting/richtext_scenarios.lua"5include "scripting/richtext_scenarios.lua"
106
11-- =============7-- ================
12-- Texts below8-- General messages
13-- =============9-- ================
10
11local close_story_window_instructions = _[[Click on the ‘OK’ button or press the ‘Enter ⏎’ key on the keyboard to close this window.]]
12
14scold_player = {13scold_player = {
15 title = _"Nice And Easy Does It All the Time",14 title = _"Nice And Easy Does It All the Time",
16 body = (15 body = (
@@ -21,50 +20,93 @@
21 show_instantly = true20 show_instantly = true
22}21}
2322
23-- Teaching basic UI controls
24
25-- ==============
26-- Starting Infos
27-- ==============
28
29obj_initial_close_story_window = {
30 name = "initial_close_story_window",
31 title=_"Close this window",
32 number = 1,
33 body = objective_text(_"Close this window",
34 li(close_story_window_instructions)
35 )
36}
24initial_message_01 = {37initial_message_01 = {
25 title = _"Welcome to the Widelands Tutorial!",38 title = _"Welcome to the Widelands Tutorial!",
26 body = (39 body = (
27 h1(_"Welcome to Widelands!") ..40 h1(_"Welcome to Widelands!") ..
28 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.]]) ..41 li_image("images/logos/wl-ico-64.png",
29 li(_[[Dismiss this box by left-clicking on the button below.]])42 _[[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.]]) ..
30 ),43 li_arrow(_[[You will be guided through this tutorial by objectives]]) ..
31 h = 300,44 li(_[[Follow the intructions in the objective below so that I can show you where to find them.]])
32 w = 40045 )
33}46}
47
48obj_initial_close_objectives_window = {
49 name = "obj_initial_close_objectives_window",
50 title=_"Objectives and how to close this window",
51 number = 1,
52 body = objective_text(_"Closing this window",
53 p(_[[This is the ‘Objectives’ window. You can return to this window for instructions at any time.]]) ..
54 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.]]) ..
55 li_arrow(_[[Like any other window, you can also close the ‘Objectives’ window by right-clicking on it.]]) ..
56 li_arrow(_[[When you have accomplished an objective, it will disappear from the list above.]]) ..
57 li(_[[Try it out.]])
58 )
59}
60
61obj_initial_toggle_building_spaces = {
62 name = "initial_toggle_building_spaces",
63 title=_"Show building spaces",
64 number = 1,
65 body = objective_text(_"Show building spaces",
66 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:]]) ..
67 li_image("images/wui/menus/showhide.png", _[[Press the Space bar to toggle them, or select ‘Show Building Spaces’ in the ‘Show / Hide’ menu.]]) ..
68 li(_[[Show the building spaces now.]])
69 )
70}
71
34initial_message_02 = {72initial_message_02 = {
35 title = _"Diving In",73 title = _"Building Spaces",
36 position = "topright",74 position = "topright",
37 field = sf,75 field = sf,
38 body = (76 body = (
39 h1(_"Let’s dive right in!") ..77 h1(_"Let’s dive right in!") ..
40 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.]]) ..78 li_image("tribes/images/barbarians/icon.png",
41 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.]]) ..79 _[[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.]]) ..
42 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:]]) ..80 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) ..
43 li_arrow(_[[Press the Space bar to toggle them, or]]) ..81 p(_[[We need to find a nice place for the lumberjack’s hut. To make this easier, we can activate ‘Show Building Spaces’.]]) ..
44 -- TRANSLATORS: List item. Has an image of the button next to it.82 li(_[[Left-click the ‘OK’ button to close this window so that I can show you how.]]) ..
45 li_image("images/wui/menus/menu_toggle_buildhelp.png", _[[click the ‘Show building spaces’ button on the bottom of the screen.]]) ..83 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.]])
46 li(_[[Left-click the ‘OK’ button to close this box and then try it.]])84 )
47 ),85}
48 obj_name = "enable_buildhelp",86
49 obj_title = _"Enable the showing of building spaces",87initial_message_03 = {
50 obj_body = (88 title = _"Building Spaces",
51 h1(_"Show Building Spaces") ..89 position = "topright",
52 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.]]) ..90 field = sf,
53 li_arrow(_[[Press the Space bar to toggle them, or]]) ..91 body = (
54 -- TRANSLATORS: List item. Has an image of the button next to it.92 h1(_"Let’s dive right in!") ..
55 li_image("images/wui/menus/menu_toggle_buildhelp.png", _[[click the ‘Show building spaces’ button on the bottom of the screen.]]) ..93 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)
56 li(_[[Right-click on this window now and then give it a try.]])94 )
57 )95}
58}96
97-- ==========
98-- Lumberjack
99-- ==========
59100
60lumberjack_message_01 = {101lumberjack_message_01 = {
61 title = _"Lumberjack’s Spot",102 title = _"Lumberjack’s Spot",
62 position = "topright",103 position = "topright",
63 field = first_lumberjack_field,104 field = first_lumberjack_field,
64 body = (105 body = (
65 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.]])106 li_object("barbarians_lumberjacks_hut",
107 _[[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)
66 ),108 ),
67 h = 300,109 h = 250,
68 w = 350110 w = 350
69}111}
70112
@@ -72,20 +114,23 @@
72 title = _"Building the Lumberjack",114 title = _"Building the Lumberjack",
73 position = "topright",115 position = "topright",
74 body = (116 body = (
75 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.]]) ..117 li_object("barbarians_lumberjacks_hut",
118 _[[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) ..
76 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.]])119 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.]])
77 ),120 ),
78 h = 300121 h = 300,
122 w = 350
79}123}
80124
81lumberjack_message_03a = {125lumberjack_message_03a = {
82 title = _"Building a Connecting Road",126 title = _"Building a Connecting Road",
83 position = "topright",127 position = "topright",
84 body = (128 body = (
85 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.]])129 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.]]) ..
130 li(close_story_window_instructions)
86 ),131 ),
87 show_instantly = true,132 show_instantly = true,
88 h = 300,133 h = 200,
89 w = 350134 w = 350
90}135}
91136
@@ -93,10 +138,12 @@
93 title = _"Building a Connecting Road",138 title = _"Building a Connecting Road",
94 position = "topright",139 position = "topright",
95 body = (140 body = (
96 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.]])141 li_image("images/wui/fieldaction/menu_tab_buildroad.png",
142 _[[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.]]) ..
143 li(close_story_window_instructions)
97 ),144 ),
98 show_instantly = true,145 show_instantly = true,
99 h = 300,146 h = 250,
100 w = 350147 w = 350
101}148}
102149
@@ -104,169 +151,230 @@
104 title = _"Waiting for the Lumberjack to Go Up",151 title = _"Waiting for the Lumberjack to Go Up",
105 position = "topright",152 position = "topright",
106 body = (153 body = (
107 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.]])154 li_object("barbarians_builder",
155 _[[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) ..
156 li(close_story_window_instructions)
157 ),
158 h = 200,
159 w = 350
160}
161
162obj_lumberjack_place_flag = {
163 name = "obj_lumberjack_place_flag",
164 title=_"Build a flag to divide the road to the lumberjack",
165 number = 1,
166 body = objective_text(_"Build a Flag on the Road",
167 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.]]) ..
168 li(_[[Build a blue flag now in the middle of the road that connects your headquarters to your lumberjack’s hut.]]) ..
169 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.]])
108 ),170 ),
109 h = 300,171 h = 300,
110 w = 350172 w = 350
111}173}
112
113lumberjack_message_05 = {174lumberjack_message_05 = {
114 title = _"Placing Another Flag",175 title = _"Placing Another Flag",
115 position = "topright",176 position = "topright",
116 body = (177 body = (
117 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.]]) ..178 li_object("barbarians_carrier",
118 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]]) ..179 _[[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)
119 li_image("images/wui/fieldaction/menu_build_flag.png", _"build flag symbol.")
120 ),180 ),
121 h = 300,181 h = 450,
122 obj_name = "build_flag_on_road_to_lumberjack",182 w = 350
123 obj_title = _"Build a flag to divide the road to the lumberjack",
124 obj_body = (
125 h1(_"Build a Flag on the Road") ..
126 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.]]) ..
127 li(_[[Build a blue flag now in the middle of the road that connects your headquarters to your lumberjack’s hut.]])
128 )
129}183}
130184
131lumberjack_message_06 = {185lumberjack_message_06 = {
132 title = _"Waiting For the Hut to be Finished",186 title = _"Waiting for the Lumberjack to Go Up",
133 position = "topright",187 position = "topright",
134 body = (188 body = (
135 p(_[[Well done! Let’s wait till the hut is finished.]]) ..189 li_image("images/wui/fieldaction/menu_tab_buildroad.png",
136 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.]])190 _[[I wanted to teach you how to build new flags, but it seems you have already found out on your own. Well done!]]) ..
137 ),
138 h = 300,
139 w = 350
140}
141
142flag_built = {
143 title = _"Waiting for the Hut to be Finished",
144 position = "topright",
145 body = (
146 p(_[[I wanted to teach you how to build new flags, but it seems you have already found out on your own. Well done!]]) ..
147 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.]]) ..191 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.]]) ..
148 p(_[[Now we only have to wait till the hut is finished.]]) ..192 li(close_story_window_instructions)
149 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.]])
150 ),193 ),
151 h = 350194 h = 250,
195 w = 350
152}196}
153197
154construction_site_window = {198obj_lumberjack_progress = {
199 name = "obj_lumberjack_progress",
200 title=_"Let’s see the progress",
201 number = 1,
202 body = objective_text(_"Let’s see the progress",
203 li(_[[Click on the construction site to have a look at it, then close it again when you have seen enough.]]) ..
204 li_arrow(_[[To close the construction site’s window, simply right-click on it.]])
205 ),
206 h = 300,
207 w = 350
208}
209lumberjack_message_07 = {
155 title = _"The Construction Site",210 title = _"The Construction Site",
156 body = (211 position = "topright",
157 h1(_"Let's see the progress") ..212 body = (
158 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.]]) ..213 h1(_"Let’s see the progress") ..
159 -- The player doesn't know about the statistics yet. First things first.214 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)
160 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!]])215 ),
161 ),216 h = 450,
162 h = 300,217 w = 350
163 w = 350218}
164}219
165220lumberjack_message_08 = {
166lumberjack_message_07 = {221 title = _"Waiting for the Lumberjack to Go Up",
222 position = "topright",
223 body = (
224 p(_[[Well done! Let’s wait till the hut is finished.]]) ..
225 li_image("images/wui/menus/gamespeed.png",
226 _[[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.]])
227 ),
228 h = 200,
229 w = 350
230}
231
232lumberjack_message_09 = {
167 title = _"The Lumberjack’s Hut is Done",233 title = _"The Lumberjack’s Hut is Done",
168 position = "topright",234 position = "topright",
169 body = (235 body = (
170 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.]])236 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)
171 ),237 ),
172 h = 300,238 h = 200,
173 w = 350239 w = 350
174}240}
175241
176inform_about_rocks = {242-- ==================
243-- Moving the mapview
244-- ==================
245
246local moving_view_instructions =
247 h2(_"Moving Your View") ..
248 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.]]) ..
249 li_arrow(_[[The first one is to use the cursor keys on your keyboard.]]) ..
250 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.]]) ..
251 li_arrow(_[[The third one is to use the minimap. It is especially useful for traveling big distances.]])
252
253
254obj_moving_keyboard = {
255 name = "move_view_with_cursor_keys",
256 title=_"Move your view with the cursor keys",
257 number = 1,
258 body = objective_text(_"Move your view with the cursor keys",
259 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
260 ),
261}
262tell_about_keyboard_move = {
177 title = _"Some Rocks Were Found",263 title = _"Some Rocks Were Found",
178 body = (264 body = (
179 h1(_"Getting a Quarry Up") ..265 h1(_"Getting a Quarry Up") ..
180 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.]]) ..266 li_object("greenland_rocks6",
181 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.]]) ..267 _[[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.]])
182 li(_[[Click the ‘OK’ button and then move the view using the cursor keys.]])
183 ),268 ),
184 h = 350,269 h = 450,
185 obj_name = "move_view_with_cursor_keys",
186 obj_title = _"Move your view with the cursor keys",
187 obj_body = (
188 h1(_"Moving Your View") ..
189 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.]]) ..
190 li(_[[The first one is to use the cursor keys on your keyboard.]]) ..
191 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.]]) ..
192 li(_[[The third one is to use the minimap. It is especially useful for traveling big distances.]])
193 )
194}270}
195271
272obj_moving_right_drag = {
273 name = "move_view_with_mouse",
274 title=_"Move your view with the mouse",
275 number = 1,
276 body = objective_text(_"Move your view with the mouse",
277 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
278 ),
279}
196tell_about_right_drag_move = {280tell_about_right_drag_move = {
197 title = _"Other Ways to Move the View",281 title = _"Moving Your View",
198 body = (282 body = (
199 p(_[[Excellent. Now there is a faster way to move, using the mouse instead:]]) ..283 h1(_"Other Ways to Move the View") ..
200 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.]])284 li_image("images/ui_basic/cursor_click.png",
285 _[[Excellent. Now there is a faster way to move, using the mouse instead.]])
201 ),286 ),
202 h = 300,287 h = 450,
203 w = 350,
204 obj_name = "move_view_with_mouse",
205 obj_title = _"Move your view with the mouse",
206 obj_body = inform_about_rocks.obj_body,
207}288}
208289
209tell_about_minimap = {290obj_moving_minimap = {
210 title = _"Use the minimap",291 name = "use_minimap",
211 body = (292 title=_"Learn to use the minimap",
212 p(_[[Very good. And now about the minimap. You can open it by clicking on the]]) ..293 number = 1,
213 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’.]]) ..294 body = objective_text(_"Learn to use the minimap",
214 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.]]) ..295 li(_[[Try moving around by clicking on the minimap]]) ..
215 li(_[[Try it out. Open the minimap, click on a few buttons and try moving around. Close it when you have experimented enough.]])
216 ),
217 h = 350,
218 obj_name = "use_minimap",
219 obj_title = _"Learn to use the minimap",
220 obj_body = (
221 li(_[[Open the minimap by using the third button from the left on the bottom of your screen or the ‘m’ key.]]) ..
222 li(_[[Play around a bit with the different overlays (roads, flags, etc.)]]) ..296 li(_[[Play around a bit with the different overlays (roads, flags, etc.)]]) ..
223 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.]])297 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.]])
224 )298 ),
299}
300tell_about_minimap_1 = {
301 title = _"Moving Your View",
302 body = (
303 h1(_"Using the Minimap") ..
304 li_image("images/wui/menus/toggle_minimap.png",
305 p(_[[Very good. And now about the minimap. ]]) ..
306 -- TRANSLATORS it = the minimap
307 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’.]])) ..
308 -- TRANSLATORS it = the minimap
309 li_arrow(_[[I will open it for you.]])
310 ),
311 w = 350,
312 h = 250,
313}
314
315tell_about_minimap_2 = {
316 title = _"Moving Your View",
317 body = (
318 h1(_"Using the Minimap") ..
319 li_image("images/wui/menus/toggle_minimap.png",
320 _([[The minimap shows the complete map in miniature. ]]
321 .. [[You can directly jump to any field by left-clicking on it. ]]
322 .. [[You can also toggle buildings, roads, flags and player indicators on and off inside the minimap.]]))
323 ),
324 h = 450,
225}325}
226326
227congratulate_and_on_to_quarry = {327congratulate_and_on_to_quarry = {
228 title = _"Onward to the Quarry",328 title = _"Onward to the Quarry",
229 body = p(_[[Great. Now about that quarry…]]),329 body = li_object("greenland_rocks6",_[[Great. Now about that quarry…]]),
230 h = 200,330 h = 200,
231 w = 250331 w = 250
232}332}
233333
334-- ======
335-- Quarry
336-- ======
337
338obj_build_a_quarry = {
339 name = "build_a_quarry",
340 title=_"Build a quarry next to the rocks",
341 number = 1,
342 body = objective_text(_"Build a Quarry",
343 li(_[[There are some rocks to the west of your headquarters. Build a quarry right next to them.]]) ..
344 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).]]) ..
345 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.]])
346 ),
347}
234order_quarry_recap_how_to_build = {348order_quarry_recap_how_to_build = {
235 field = first_quarry_field,349 field = first_quarry_field,
236 position = "topright",350 position = "topright",
237 title = _"How to Build a Quarry",351 title = _"How to Build a Quarry",
238 body = (352 body = (
239 p(_[[Build a quarry next to those rocks here. Remember how I did it earlier?]]) ..353 li_object("barbarians_quarry",
240 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.]]) ..354 p(_[[Build a quarry next to those rocks here. Remember how I did it earlier?]]) ..
241 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:]]) ..355 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.]]) ..
356 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) ..
242 li_image("images/wui/overlays/big.png", _[[Everything can be built on the green house symbol.]]) ..357 li_image("images/wui/overlays/big.png", _[[Everything can be built on the green house symbol.]]) ..
243 li_image("images/wui/overlays/medium.png", _[[Everything except for big buildings can be built on a yellow house symbol.]]) ..358 li_image("images/wui/overlays/medium.png", _[[Everything except for big buildings can be built on a yellow house symbol.]]) ..
244 li_image("images/wui/overlays/small.png", _[[Red building symbols can only hold small buildings and flags.]]) ..359 li_image("images/wui/overlays/small.png", _[[Red building symbols can only hold small buildings and flags.]]) ..
245 li_image("images/wui/overlays/set_flag.png", _[[And finally, the yellow flag symbol only allows for flags.]]) ..360 li_image("images/wui/overlays/set_flag.png", _[[And finally, the yellow flag symbol only allows for flags.]]) ..
246 p(_[[If you place something on a field, the surrounding fields might have less space for holding buildings, so choose your fields wisely.]]) ..361 p(_[[If you place something on a field, the surrounding fields might have less space for holding buildings, so choose your fields wisely.]])
247 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!]])
248 ),
249 obj_name = "build_a_quarry",
250 obj_title = _"Build a quarry next to the rocks",
251 obj_body = (
252 h1(_"Build a Quarry") ..
253 li(_[[There are some rocks to the west of your headquarters. Build a quarry right next to them.]]) ..
254 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).]]) ..
255 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.]])
256 )362 )
257}363}
258364
365local 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.]])
366
259talk_about_roadbuilding_00a = {367talk_about_roadbuilding_00a = {
260 position = "topright",368 position = "topright",
261 field = wl.Game().map:get_field(9,12),369 field = wl.Game().map:get_field(9,12),
262 title = _"Road Building",370 title = _"Road Building",
263 body = (371 body = (
264 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]]) ..372 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.]]) ..
265 li_image("images/wui/fieldaction/menu_build_way.png", _[[the road building symbol.]]) ..373 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.]]) ..
266 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]]) ..374 explain_abort_roadbuilding ..
267 li_image("images/wui/menu_abort.png", _[[the abort symbol.]]) ..
268 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:]])375 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:]])
269 ),376 ),
377 h = 300,
270 show_instantly = true378 show_instantly = true
271}379}
272380
@@ -275,12 +383,11 @@
275 field = road_building_field,383 field = road_building_field,
276 title = _"Road Building",384 title = _"Road Building",
277 body = (385 body = (
278 p(_[[Excellent! To enter road building mode for any flag, left-click on a flag and select]]) ..386 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.]]) ..
279 li_image("images/wui/fieldaction/menu_build_way.png", _[[the road building symbol.]]) ..387 explain_abort_roadbuilding ..
280 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]]) ..
281 li_image("images/wui/menu_abort.png", _[[the abort symbol.]]) ..
282 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:]])388 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:]])
283 ),389 ),
390 h = 300,
284 show_instantly = true391 show_instantly = true
285}392}
286393
@@ -288,38 +395,38 @@
288 position = "topright",395 position = "topright",
289 field = road_building_field,396 field = road_building_field,
290 title = _"Road Building",397 title = _"Road Building",
291 body = p(_[[Or, you can directly click the flag where the road should end, like so:]]),398 body = li_object("barbarians_flag", _[[Or, you can directly click the flag where the road should end, like so:]], plr.color),
292 h = 200,399 h = 200,
293 w = 250400 w = 250
294}401}
295402
403obj_build_road_to_quarry = {
404 name = "build_road_to_quarry",
405 title=_"Connect the quarry to the headquarters",
406 number = 1,
407 body = objective_text(_"Connect Your Construction Site",
408 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.]]) ..
409 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.]]) ..
410 li_arrow(_[[If you hold Ctrl or Shift+Ctrl while you finish the road, flags are placed automatically.]])
411 ),
412}
296talk_about_roadbuilding_02 = {413talk_about_roadbuilding_02 = {
297 position = "topright",414 position = "topright",
298 title = _"Road Building",415 title = _"Road Building",
299 body = (416 body = (
300 p(_[[One more thing: around the field where your road would end, you can see different markers. They have the following meaning:]]) ..417 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:]]) ..
301 li_image("images/wui/overlays/roadb_green.png", _[[The terrain is flat here. Your carriers will be very swift on this terrain.]]) ..418 li_image("images/wui/overlays/roadb_green.png", _[[The terrain is flat here. Your carriers will be very swift on this terrain.]]) ..
302 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.]]) ..419 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.]]) ..
303 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.]]) ..420 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.]]) ..
304 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.]]) ..421 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.]])
305 li_arrow(_[[If you hold Ctrl or Shift+Ctrl while you finish the road, flags are placed automatically.]]) ..
306 li(_[[Now please rebuild the road between your quarry and your headquarters.]])
307 ),422 ),
308 h = 450,423 h = 450
309 obj_name = "build_road_to_quarry",
310 obj_title = _"Connect the quarry to the headquarters",
311 obj_body = (
312 h1(_"Connect Your Construction Site") ..
313 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.]]) ..
314 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.]]) ..
315 li_arrow(_[[If you hold Ctrl or Shift+Ctrl while you finish the road, flags are placed automatically.]])
316 )
317}424}
318425
319quarry_not_connected = {426quarry_not_connected = {
320 title = _"Quarry not Connected",427 title = _"Quarry not Connected",
321 body = (428 body = (
322 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.]])429 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)
323 ),430 ),
324 w = 350,431 w = 350,
325 h = 250432 h = 250
@@ -328,87 +435,125 @@
328quarry_illegally_destroyed = {435quarry_illegally_destroyed = {
329 title = _"You Destroyed the Construction Site!",436 title = _"You Destroyed the Construction Site!",
330 body = (437 body = (
331 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.]])438 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) ..
439 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.]])
332 ),440 ),
333 w = 350,441 w = 350,
334 h = 250442 h = 250
335}443}
336444
445obj_build_the_second_quarry = {
446 name = "build_the_second_quarry",
447 title=_"Build another quarry",
448 number = 1,
449 body = objective_text(_"Build another quarry",
450 li(_[[Build a second quarry near the rocks and connect it to your road network.]]) ..
451 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.]])
452 ),
453}
337build_second_quarry = {454build_second_quarry = {
338 position = "topright",455 position = "topright",
339 title = _"Build a second quarry",456 title = _"Build a second quarry",
340 body = (457 body = (
341 p(_[[When there are many rocks, you can consider building another quarry. This will make the granite production faster.]]) ..458 li_object("barbarians_quarry", _[[When there are many rocks, you can consider building another quarry. This will make the granite production faster.]], plr.color)
342 li(_[[Build a second quarry near the rocks and connect it to your road network.]])459 ),
343 ),460 h = 300
344 obj_name = "build_the_second_quarry",
345 obj_title = _"Build another quarry",
346 obj_body = (
347 h1(_"Build another quarry") ..
348 p(_[[Build a second quarry next to the rocks. Do not forget to connect it to another flag.]]) ..
349 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.]])
350 ),
351 h = 300,
352 w = 350
353}461}
354462
463-- ===================
464-- Census & Statistics
465-- ===================
466
355census_and_statistics_00 = {467census_and_statistics_00 = {
356 title = _"Census and Statistics",468 title = _"Census and Statistics",
357 body = (469 body = (
358 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.]]) ..470 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’.]]) ..
359 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.]]) ..471 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.]]) ..
360 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.]])472 p(_[[Let me enable the census for you.]])
473 ),
474 position = "topright",
475 h = 300,
476 w = 350
477}
478
479obj_show_statistics = {
480 name = "show_statistics",
481 title=_"Show the building statistics",
482 number = 1,
483 body = objective_text(_"Show the building statistics",
484 li(_[[Show the building statistics labels, so that we can check the progress of our quarry construction more easily.]]) ..
485 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.]])
361 )486 )
362}487}
363
364census_and_statistics_01 = {488census_and_statistics_01 = {
365 title = _"Census and Statistics",489 title = _"Census and Statistics",
366 body = (p(_[[Now we know what’s going on. Let’s wait for the quarries to finish.]])),490 body = (
367 h = 200,491 li_image("images/wui/menus/toggle_statistics.png",
492 p(_[[Now, wouldn’t it be nice to check on our quarries’ progress without having to open their windows?]]) ..
493 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.]]))
494 ),
495 position = "topright",
496 h = 400,
497 w = 350
498}
499
500census_and_statistics_02 = {
501 title = _"Census and Statistics",
502 body = (
503 li_object("barbarians_quarry", _[[Now we know what’s going on. Let’s wait for the quarries to finish.]], plr.color)
504 ),
505 position = "topright",
506 h = 150,
368 w = 250507 w = 250
369}508}
370509
510-- ========
511-- Messages
512-- ========
513
514obj_archive_all_messages = {
515 name = "archive_all_messages",
516 title=_"Archive all messages in your inbox",
517 number = 1,
518 body = objective_text(_"Archive Your Inbox Messages",
519 li(_[[Archive all your messages in your inbox now.]]) ..
520 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.]]) ..
521 li_arrow(_[[Once you have archived a message, another message will be selected automatically from the list.]]) ..
522 li_arrow(_[[You can also hold down the Ctrl or Shift key to select multiple messages, or press Ctrl + A to select them all.]]) ..
523 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.]]) ..
524 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.]])
525 )
526}
371teaching_about_messages = {527teaching_about_messages = {
372 popup = true,528 popup = true,
373 title = _"Messages",529 title = _"Messages",
374 heading = _"Introducing Messages",530 heading = _"Introducing Messages",
375 body = (531 body = (
376 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…]]) ..532 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…]]) ..
377 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.]]) ..533 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.]]) ..
378 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]]) ..534 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:]]) ..
379 li_image("images/wui/messages/message_archive.png", _[[‘Archive selected message’ button to move it into your archive.]]) ..535 new_objectives(obj_archive_all_messages)
380 p(_[[Once you have archived a message, another message will be selected automatically from the list.]]) ..
381 li_arrow(_[[You can also hold down the Ctrl or Shift key to select multiple messages, or press Ctrl + A to select them all.]]) ..
382 li(_[[Archive all messages that you currently have in your inbox, including this one.]])
383 ),
384 obj_name = "archive_all_messages",
385 obj_title = _"Archive all messages in your inbox",
386 obj_body = (
387 h1(_"Archive Your Inbox Messages") ..
388 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.]]) ..
389 li(_[[Archive all your messages in your inbox now.]]) ..
390 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.]]) ..
391 li_arrow(_[[You can also hold down the Ctrl or Shift key to select multiple messages, or press Ctrl + A to select them all.]])
392 )536 )
393}537}
394538
539obj_close_message_window = {
540 name = "close_message_window",
541 title=_"Close the messages window",
542 number = 1,
543 body = objective_text(_"Close the Messages Window",
544 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.]]) ..
545 li(_[[Close the messages window now by right-clicking into it.]])
546 )
547}
395closing_msg_window_00 = {548closing_msg_window_00 = {
396 position = "topright",549 position = "topright",
397 field = first_quarry_field,550 field = first_quarry_field,
398 title = _"Closing Windows",551 title = _"Closing Windows",
399 body = (552 body = (
400 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.]]) ..553 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.]])
401 li(_[[First, close this window by pressing the button below, then right-click into the messages window to close it.]])
402 ),554 ),
403 h = 300,555 h = 400,
404 w = 350,556 w = 350
405 obj_name = "close_message_window",
406 obj_title = _"Close the messages window",
407 obj_body = (
408 h1(_"Close the Messages Window") ..
409 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.]]) ..
410 li(_[[Close the messages window now by right-clicking into it.]])
411 )
412}557}
413558
414closing_msg_window_01 = {559closing_msg_window_01 = {
@@ -416,71 +561,85 @@
416 field = first_quarry_field,561 field = first_quarry_field,
417 title = _"Closing Windows",562 title = _"Closing Windows",
418 body = (563 body = (
419 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.]])564 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)
420 ),565 ),
421 h = 300,566 h = 250,
422 w = 350567 w = 350
423}568}
424569
570obj_destroy_quarries = {
571 name = "destroy_quarries",
572 title=_"Destroy the two quarries",
573 number = 1,
574 body = objective_text(_"Destroy the Quarries",
575 li(_[[Since our quarries are useless now, you can destroy them and reuse the space later on.]]) ..
576 p(_[[There are two different ways of destroying a building: burning down and dismantling. Try them both out on your quarries.]]) ..
577 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.]]) ..
578 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.]])
579 )
580}
425destroy_quarries_message = {581destroy_quarries_message = {
426 position = "topright",582 position = "topright",
427 title = _"Messages Arrived!",583 title = _"Messages Arrived!",
428 body = (584 body = (
429 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:]]) ..585 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?]])
430 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.]]) ..
431 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.]])
432 ),586 ),
433 h = 300,587 h = 400,
434 obj_name = "destroy_quarries",588 w = 350
435 obj_title = _"Destroy the two quarries",589}
436 obj_body = (590
437 p(_[[Since our quarries are useless now, you can destroy them and reuse the space later on.]]) ..591-- =========
438 li_arrow(_[[There are two different ways of destroying a building: burning down and dismantling. Try them both out on your quarries.]]) ..592-- Expansion
439 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.]]) ..593-- =========
440 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.]])594
595obj_expand_territory = {
596 name = "expand_territory",
597 title=_"Expand your territory",
598 number = 1,
599 body = objective_text(_"Make your Territory Grow",
600 li(_[[Build a military building on your border.]]) ..
601 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.]]) ..
602 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.]]) ..
603 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.]]) ..
604 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.]])
441 )605 )
442}606}
443
444introduce_expansion = {607introduce_expansion = {
445 title = _"Expanding Your Territory!",608 title = _"Expanding Your Territory!",
446 body = (609 body = (
447 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.]]) ..610 li_object("barbarians_sentry",
448 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.]]) ..611 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.]]) ..
449 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.]]) ..612 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.]]) ..
450 li(_[[Let’s try it out now: build a military building on your border.]]) ..613 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)
451 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.]])
452 ),
453 obj_name = "expand_territory",
454 obj_title = _"Expand your territory",
455 obj_body = (
456 h1(_"Make your territory grow") ..
457 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.]]) ..
458 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.]]) ..
459 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.]])
460 )614 )
461}615}
462616
463
464military_building_finished = {617military_building_finished = {
465 title = _"Military Site Occupied",618 title = _"Military Site Occupied",
466 body = (619 body = (
467 h1(_"Your territory has just grown!") ..620 h1(_"Your territory has just grown!") ..
468 p(_[[Great. Do you see how your territory has grown since your soldiers entered your new military building?]]) ..621 li_object("barbarians_tower",
469 p(_[[Every military building has a certain conquer area – the more expensive the building, the more land it conquers.]])622 p(_[[Great. Do you see how your territory has grown since your soldiers entered your new military building?]]) ..
623 p(_[[Every military building has a certain conquer area – the more expensive the building, the more land it conquers.]]), plr.color)
470 ),624 ),
471 h = 300,625 h = 300,
472 w = 350626 w = 350
473}627}
474628
629-- ==========
630-- Conclusion
631-- ==========
632
475conclude_tutorial = {633conclude_tutorial = {
476 title = _"Conclusion",634 title = _"Conclusion",
477 body = (635 body = (
478 h1(_"Conclusion") ..636 h1(_"Conclusion") ..
479 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.]]) ..637 li_image("images/logos/wl-ico-64.png",
480 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.]]) ..638 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.]]) ..
481 p(_[[To leave this game and return to the main menu, click on the]]) ..639 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.]])) ..
482 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]]) ..640 p(_[[To leave this game and return to the main menu:]]) ..
483 li_image("images/wui/menus/menu_exit_game.png", _[[‘Exit Game’ button.]]) ..641 li_image("images/wui/menus/main_menu.png", _[[Click on the ‘Main Menu’ button on the very left at the bottom of the screen.]]) ..
642 li_image("images/wui/menus/exit.png", _[[Then click on the ‘Exit Game’ entry.]]) ..
484 p(_[[Thanks for playing this tutorial. Enjoy Widelands and remember to visit us at]]) ..643 p(_[[Thanks for playing this tutorial. Enjoy Widelands and remember to visit us at]]) ..
485 h1(p("align=center", u("widelands.org")))644 h1(p("align=center", u("widelands.org")))
486 ),645 ),
487646
=== modified file 'data/campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua'
--- data/campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua 2018-07-07 10:53:30 +0000
+++ data/campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua 2019-06-01 15:39:16 +0000
@@ -10,8 +10,8 @@
1010
11 sleep(1000)11 sleep(1000)
1212
13 message_box_objective(plr, intro1)13 campaign_message_box(intro1)
14 message_box_objective(plr, intro2)14 campaign_message_box(intro2)
1515
16 burn_tavern_down()16 burn_tavern_down()
17end17end
@@ -19,15 +19,19 @@
19function wait_for_window_and_tab_or_complain(19function wait_for_window_and_tab_or_complain(
20 window_name,20 window_name,
21 tab_name,21 tab_name,
22 objective, complain_msg22 complain_msg,
23)23 objective)
24
25 local obj_open_window = add_campaign_objective(objective)
26 obj_open_window.visible = false
27
24 while true do28 while true do
25 -- This waits for the window to be opened.29 -- This waits for the window to be opened.
26 if not mv.windows[window_name] then30 if not mv.windows[window_name] then
27 objective.visible = true31 obj_open_window.visible = true
28 message_box_objective(plr, complain_msg)32 campaign_message_box(complain_msg)
29 while not mv.windows[window_name] do sleep(200) end33 while not mv.windows[window_name] do sleep(200) end
30 objective.visible = false34 obj_open_window.visible = false
31 end35 end
3236
33 -- But it might be closed at any point in time. If it is open and the37 -- But it might be closed at any point in time. If it is open and the
@@ -39,21 +43,20 @@
39 end43 end
40 sleep(200)44 sleep(200)
41 end45 end
46 set_objective_done(obj_open_window)
42end47end
4348
44function encyclopedia_tutorial()49function encyclopedia_tutorial()
45 sleep(100*1000)50 sleep(100*1000)
46 local o = message_box_objective(plr, ware_encyclopedia) -- where to get help51 local o = campaign_message_with_objective(ware_encyclopedia, obj_open_encyclopedia) -- where to get help
47 while not mv.windows.encyclopedia do sleep(200) end52 while not mv.windows.encyclopedia do sleep(200) end
48 set_objective_done(o, wl.Game().real_speed)53 set_objective_done(o, wl.Game().real_speed)
4954
50 o = message_box_objective(plr, explain_encyclopedia) -- what information is available55 o = campaign_message_with_objective(explain_encyclopedia, obj_lookup_wares) -- what information is available
51 local o2 = add_campaign_objective(reopen_encyclopedia_obj)
52 o2.visible = false
53 wait_for_window_and_tab_or_complain(56 wait_for_window_and_tab_or_complain(
54 "encyclopedia",57 "encyclopedia",
55 "encyclopedia_wares",58 "encyclopedia_wares",
56 o2, reopen_encyclopedia59 reopen_encyclopedia, obj_reopen_encyclopedia
57 )60 )
58 while mv.windows.encyclopedia do sleep(200) end61 while mv.windows.encyclopedia do sleep(200) end
59 set_objective_done(o, wl.Game().real_speed)62 set_objective_done(o, wl.Game().real_speed)
@@ -65,44 +68,38 @@
65 sleep(1000)68 sleep(1000)
66 tavern_field.immovable:destroy()69 tavern_field.immovable:destroy()
67 sleep(1000)70 sleep(1000)
68 message_box_objective(plr, tavern_burnt_down)71 campaign_message_box(tavern_burnt_down)
69 sleep(500)72 sleep(500)
70 local o = message_box_objective(plr, building_stat)73 local o = campaign_message_with_objective(building_stats, obj_open_building_stats)
74 wl.ui.MapView().dropdowns["dropdown_menu_statistics"]:open()
75
71 while not mv.windows.building_statistics do sleep(100) end76 while not mv.windows.building_statistics do sleep(100) end
72 set_objective_done(o, wl.Game().real_speed)77 set_objective_done(o, wl.Game().real_speed)
7378
74 o = message_box_objective(plr,explain_building_stat)79 o = campaign_message_with_objective(explain_building_stats, obj_check_taverns)
75 -- We cannot create several objectives with the same name. Therefore, we create o2 here once and change its visibility
76 local o2 = add_campaign_objective(reopen_building_stat_obj)
77 o2.visible = false
78 wait_for_window_and_tab_or_complain(80 wait_for_window_and_tab_or_complain(
79 "building_statistics",81 "building_statistics",
80 "building_stats_medium",82 "building_stats_medium",
81 o2, reopen_building_stat83 reopen_building_stats, obj_reopen_building_stats
82 )84 )
83 while mv.windows.building_statistics do sleep(100) end85 while mv.windows.building_statistics do sleep(100) end
84 set_objective_done(o, 0)86 set_objective_done(o, 0)
8587
86 o = message_box_objective(plr, inventory1)88 o = campaign_message_with_objective(inventory1, obj_open_inventory)
87 while not mv.windows.stock_menu do sleep(200) end89 while not mv.windows.stock_menu do sleep(200) end
88 set_objective_done(o, wl.Game().real_speed)90 set_objective_done(o, wl.Game().real_speed)
8991
90 o = message_box_objective(plr, inventory2)92 o = campaign_message_with_objective(inventory2, obj_switch_stock_tab)
91 -- We cannot create several objectives with the same name. Therefore, we
92 -- create o2 here once and change its visibility
93 o2 = add_campaign_objective(reopen_stock_menu_obj)
94 o2.visible = false
95
96 wait_for_window_and_tab_or_complain(93 wait_for_window_and_tab_or_complain(
97 "stock_menu",94 "stock_menu",
98 "wares_in_warehouses",95 "wares_in_warehouses",
99 o2, reopen_stock_menu96 reopen_stock_menu, obj_reopen_stock_menu
100 )97 )
101 set_objective_done(o, 0)98 set_objective_done(o, 0)
102 message_box_objective(plr, inventory3)99 campaign_message_box(inventory3)
103100
104 sleep(2000)101 sleep(2000)
105 o = message_box_objective(plr, build_taverns)102 o = campaign_message_with_objective(build_taverns, obj_build_taverns)
106103
107 encyclopedia_tutorial()104 encyclopedia_tutorial()
108105
@@ -113,44 +110,38 @@
113end110end
114111
115function plan_the_future()112function plan_the_future()
116 message_box_objective(plr, building_priority_settings)113 campaign_message_box(building_priority_settings)
117 sleep(30*1000) -- give the user time to try it out114 sleep(30*1000) -- give the user time to try it out
118115
119 local o = message_box_objective(plr, ware_stats1)116 local o = campaign_message_with_objective(ware_stats1, obj_open_ware_stats)
120 while not mv.windows.ware_statistics do sleep(200) end117 while not mv.windows.ware_statistics do sleep(200) end
121 set_objective_done(o, 0)118 set_objective_done(o, 0)
122119
123 o = message_box_objective(plr, ware_stats2)120 o = campaign_message_with_objective(ware_stats2, obj_switch_ware_stats_tab_to_third)
124 local o2 = add_campaign_objective(reopen_ware_stats1_obj)
125 o2.visible = false
126
127 wait_for_window_and_tab_or_complain(121 wait_for_window_and_tab_or_complain(
128 "ware_statistics",122 "ware_statistics",
129 "economy_health",123 "economy_health",
130 o2, reopen_ware_stats1124 reopen_ware_stats1, obj_reopen_ware_stats1
131 )125 )
132 set_objective_done(o, 0)126 set_objective_done(o, 0)
133127
134 o = message_box_objective(plr, ware_stats3)128 o = campaign_message_with_objective(ware_stats3, obj_switch_ware_stats_tab_to_fourth)
135 o2 = add_campaign_objective(reopen_ware_stats2_obj)
136 o2.visible = false
137
138 wait_for_window_and_tab_or_complain(129 wait_for_window_and_tab_or_complain(
139 "ware_statistics",130 "ware_statistics",
140 "stock",131 "stock",
141 o2, reopen_ware_stats2132 reopen_ware_stats2, obj_reopen_ware_stats2
142 )133 )
143 set_objective_done(o, 0)134 set_objective_done(o, 0)
144135
145 o = message_box_objective(plr, ware_stats4)136 o = campaign_message_with_objective(ware_stats4, obj_close_ware_stats)
146 while mv.windows.ware_statistics do sleep(500) end137 while mv.windows.ware_statistics do sleep(500) end
147 set_objective_done(o)138 set_objective_done(o)
148139
149 o = message_box_objective(plr, economy_settings1)140 o = campaign_message_with_objective(economy_settings1, obj_open_economy_settings)
150 while not mv.windows.economy_options do sleep(200) end141 while not mv.windows.economy_options do sleep(200) end
151 set_objective_done(o, 0)142 set_objective_done(o, 0)
152 message_box_objective(plr, economy_settings2)143 campaign_message_box(economy_settings2)
153 o = message_box_objective(plr, economy_settings3)144 o = campaign_message_with_objective(economy_settings3, obj_produce_marble_columns)
154145
155 while sf.brn.immovable.economy:ware_target_quantity("marble_column") ~= 20 do146 while sf.brn.immovable.economy:ware_target_quantity("marble_column") ~= 20 do
156 sleep(200)147 sleep(200)
@@ -159,7 +150,7 @@
159 set_objective_done(o)150 set_objective_done(o)
160151
161 -- new objective all has to be transported to the front152 -- new objective all has to be transported to the front
162 o = message_box_objective(plr, warehouse_preference_settings)153 o = campaign_message_with_objective(warehouse_preference_settings, obj_bring_marble_columns_to_front)
163154
164 local enough_wares = false155 local enough_wares = false
165 while not enough_wares do156 while not enough_wares do
@@ -178,7 +169,7 @@
178end169end
179170
180function conclude()171function conclude()
181 message_box_objective(plr, conclusion)172 campaign_message_box(conclusion)
182end173end
183174
184run(introduction)175run(introduction)
185176
=== modified file 'data/campaigns/tutorial04_economy.wmf/scripting/texts.lua'
--- data/campaigns/tutorial04_economy.wmf/scripting/texts.lua 2018-09-12 15:58:07 +0000
+++ data/campaigns/tutorial04_economy.wmf/scripting/texts.lua 2019-06-01 15:39:16 +0000
@@ -8,7 +8,6 @@
88
9include "scripting/richtext_scenarios.lua"9include "scripting/richtext_scenarios.lua"
1010
11
12-- =============11-- =============
13-- Texts below12-- Texts below
14-- =============13-- =============
@@ -17,7 +16,7 @@
17 title = _"Your Economy and its Settings",16 title = _"Your Economy and its Settings",
18 body = (17 body = (
19 h1(_[[Economy]]) ..18 h1(_[[Economy]]) ..
20 p(_[[Welcome back. In this tutorial, I’ll tell you what you can do to check how well your economy works.]]) ..19 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.]]) ..
21 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.]]) ..20 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.]]) ..
22 p(_[[This is what I’ll show you in this tutorial: what actions can you take to define those general conditions?]])21 p(_[[This is what I’ll show you in this tutorial: what actions can you take to define those general conditions?]])
23 ),22 ),
@@ -29,49 +28,65 @@
29 field = field_near_border,28 field = field_near_border,
30 title = _"A Peaceful Land",29 title = _"A Peaceful Land",
31 body = (30 body = (
32 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.]]) ..31 li_object("empire_fortress",
33 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.]]) ..32 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.]]) ..
34 p(_[[You had not been prepared for war, and you have to hurry now to build up an army.]])33 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.]]) ..
34 p(_[[You had not been prepared for war, and you have to hurry now to build up an army.]]), plr.color)
35 ),35 ),
36 h = 30036 h = 300
37}37}
3838
39tavern_burnt_down = {39tavern_burnt_down = {
40 position = "topright",40 position = "topright",
41 title = _"The Tavern is Burning!",41 title = _"An accident",
42 body = (42 body = (
43 h1(_[[An accident]]) ..43 h1(_[[The Tavern is Burning!]]) ..
44 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.]])44 li_object("destroyed_building",
45 _[[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)
45 ),46 ),
46 w = 300,47 w = 300,
47 h = 25048 h = 250
48}49}
4950
50building_stat = {51obj_open_building_stats = {
52 name = "open_building_stats",
53 title=_"Open the building statistics window",
54 number = 1,
55 body = objective_text(_"Open the building statistics window",
56 li(_[[Open the building statistics window for an overview over the buildings you have.]]) ..
57 li_image("images/wui/menus/statistics.png", _[[First, you will have to open the ‘Statistics’ menu at the bottom of the screen.]]) ..
58 li_image("images/wui/menus/statistics_buildings.png", _[[Afterwards, choose ‘Buildings’.]]) ..
59 li_arrow(_[[You can also use the hotkey ‘b’.]])
60 )
61}
62building_stats = {
51 position = "topright",63 position = "topright",
52 title = _"Building statistics",64 title = _"Building statistics",
53 body = (65 body = (
54 h1(_[[Check out your taverns]]) ..66 h1(_[[Check out your taverns]]) ..
55 p(_[[At first, we should find out how many taverns we currently have. Widelands offers you a window where you can easily check this.]]) ..67 p(_[[At first, we should find out how many taverns we currently have. Widelands offers you a window where you can easily check this.]])
56 li_image("images/wui/menus/menu_toggle_menu.png", _[[First, you will have to open the statistics menu (you can find the corresponding button at the bottom). We will need this menu several times.]]) ..68 )
57 li_image("images/wui/menus/menu_building_stats.png", _[[Afterwards, choose the ‘Building statistics’.]]) ..
58 li(_[[Open the building statistics window.]]) ..
59 li_arrow(_[[You can also use the hotkey ‘b’.]])
60 ),
61 h = 350,
62 obj_name = "open_building_stat",
63 obj_title = _"Open the building statistics window",
64 obj_body =
65 li_image("images/wui/menus/menu_building_stats.png", _[[The building statistics window gives you an overview over the buildings you have.]]) ..
66 -- TRANSLATORS: "it" refers to the building statistics window
67 li(_[[Open it. You can access it from the statistics menu.]]) ..
68 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.]])
69}69}
7070
71explain_building_stat = {71obj_check_taverns = {
72 name = "check_taverns",
73 title=_"Look up how many taverns you have",
74 number = 1,
75 body = objective_text(_"Look up how many taverns you have",
76 p(_[[We want to know whether we still have taverns.]]) ..
77 li_image("images/wui/fieldaction/menu_tab_buildmedium.png",
78 _[[Choose the ‘Medium buildings’ tab in the building statistics window.]]) ..
79 li(_[[Look up how many taverns you have.]]) ..
80 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.]]) ..
81 li(_[[Close the building statistics window when you are done.]])
82 )
83}
84explain_building_stats = {
85 position = "topright",
72 title = _"Building Statistics",86 title = _"Building Statistics",
73 body = (87 body = (
74 p(_[[This is the building statistics window. It shows you all buildings you can own, sorted by their size.]]) ..88 li_image("images/wui/menus/statistics_buildings.png",
89 _[[This is the building statistics window. It shows you all buildings you can own, sorted by their size.]]) ..
75 p(_[[Let me now explain what all those numbers mean:]]) ..90 p(_[[Let me now explain what all those numbers mean:]]) ..
76 li(_[[‘2/1’ below the quarry: This means that you have two quarries, plus another one which is under construction.]]) ..91 li(_[[‘2/1’ below the quarry: This means that you have two quarries, plus another one which is under construction.]]) ..
77 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.]]) ..92 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.]]) ..
@@ -79,149 +94,170 @@
79 li_arrow(_[[In both cases, the color (green - yellow - red) signals you how good the value is.]]) ..94 li_arrow(_[[In both cases, the color (green - yellow - red) signals you how good the value is.]]) ..
80 li(_[[If you click on a building, you can scroll through the buildings of the selected type.]]) ..95 li(_[[If you click on a building, you can scroll through the buildings of the selected type.]]) ..
81 li(_[[If you don’t have any building of a particular building type, it will be shown greyed out.]]) ..96 li(_[[If you don’t have any building of a particular building type, it will be shown greyed out.]]) ..
82 h2(_[[Now it’s your turn]]) ..97 p(_[[This is enough explanation for now. Now try it out yourself.]])
83 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.]])
84 ),98 ),
85 obj_name = "check_taverns",99 h = 500,
86 obj_title = _"Look up how many taverns you have",
87 obj_body = (
88 li(_[[Choose the ‘Medium buildings’ tab in the building statistics window.]]) ..
89 li(_[[Look up how many taverns you have.]]) ..
90 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.]]) ..
91 li(_[[Close the building statistics window when you are done.]])
92 )
93}100}
94101
95reopen_building_stat = {102reopen_building_stats = {
96 title = _"You closed the building statistics window!",103 title = _"You closed the building statistics window!",
97 body = (104 body = (
98 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?]])105 li_image("images/wui/menus/statistics_buildings.png",
106 _[[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?]])
99 ),107 ),
100 show_instantly = true,108 show_instantly = true,
101 w = 300,109 w = 300,
102 h = 250110 h = 250
103}111}
104112
105reopen_building_stat_obj = {113obj_reopen_building_stats = {
106 obj_name = "open_building_stat_again",114 name = "reopen_building_stats",
107 obj_title = _"Open the building statistics window again",115 title = _"Open the building statistics window again",
108 obj_body = (116 number = 1,
109 p(_[[You closed the building statistics window, although you have not yet looked up the number of taverns.]]) ..117 body = objective_text(_"Open the building statistics window again",
118 li_image("images/wui/menus/statistics_buildings.png",
119 _[[You closed the building statistics window, although you have not yet looked up the number of taverns.]]) ..
110 -- TRANSLATORS: "it" refers to the building statistics window.120 -- TRANSLATORS: "it" refers to the building statistics window.
111 li(_[[Please reopen it and choose the second tab (medium buildings).]])121 li(_[[Please reopen it and choose the second tab (medium buildings).]])
112 ),122 )
113 h = 250
114}123}
115124
125obj_open_inventory = {
126 name = "open_inventory",
127 title=_"Open your stock window",
128 number = 1,
129 body = objective_text(_"Open your stock window",
130 p(_[[The stock window gives you an overview over the wares you currently have.]]) ..
131 li_image("images/wui/menus/statistics.png", _[[First, you will have to open the ‘Statistics’ menu at the bottom of the screen.]]) ..
132 li_image("images/wui/menus/statistics_stock.png", _[[Afterwards, choose ‘Stock’.]]) ..
133 li_arrow(_[[You can also use the hotkey ‘i’ (as in ‘inventory’) to access this window quickly.]])
134 )
135}
116inventory1 = {136inventory1 = {
117 position = "topright",137 position = "topright",
118 title = _"Stock",138 title = _"Stock",
119 body = (139 body = (
120 h1(_[[Check for rations]]) ..140 h1(_[[Check for rations]]) ..
121 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.]]) ..141 li_image(wl.Game():get_ware_description("ration").icon_name,
122 li_image("images/wui/menus/menu_stock.png", _[[Click on the ‘Stock’ button.]]) ..142 _[[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.]])
123 li_arrow(_[[You can also use the hotkey ‘i’ (as in ‘inventory’) to access this window quickly.]])
124 ),
125 h = 300,
126 obj_name = "open_inventory",
127 obj_title = _"Open your stock window",
128 obj_body = (
129 p(_[[The stock menu window gives you an overview over the wares you currently have.]]) ..
130 -- TRANSLATORS: "it" refers to the stock menu window
131 li(_[[Open it. You can access it from the statistics menu.]]) ..
132 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.]])
133 )143 )
134}144}
135145
146obj_switch_stock_tab = {
147 name = "switch_stock_tab",
148 title=_"Examine the first two tabs in the stock window",
149 number = 1,
150 body = objective_text(_"Examine the first two tabs in the stock window",
151 p(_[[Have a look at the first two tabs in the stock window. They show all the wares and workers you have.]]) ..
152 li_image("images/wui/stats/menu_tab_wares_warehouse.png",
153 _[[When you have seen enough, switch to the third tab (‘Wares in warehouses’).]])
154 )
155}
136inventory2 = {156inventory2 = {
157 position = "topright",
137 title = _"Stock",158 title = _"Stock",
138 body = (159 body = (
139 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.]]) ..160 li_image("images/wui/buildings/menu_tab_wares.png",
161 _[[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.]]) ..
140 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.]]) ..162 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.]]) ..
141 p(_[[The second tab shows you all your workers, again those on roads and in buildings summed up.]]) ..163 li_image("images/wui/buildings/menu_tab_workers.png",
142 p(_[[Now have a look at these two tabs. When you click on the]]) ..164 _[[The second tab shows you all your workers, again those on roads and in buildings summed up.]])
143 li_image("images/wui/stats/menu_tab_wares_warehouse.png", _[[third tab (‘Wares in warehouses’), I’ll continue.]])165 ),
144 ),166 show_instantly = true
145 h = 350,
146 show_instantly = true,
147 obj_name = "switch_stock_tab",
148 obj_title = _"Switch to the third tab in the stock menu window",
149 obj_body = (
150 p(_[[Have a look at the first two tabs in the stock menu window. They show all the wares and workers you have.]]) ..
151 li(_[[When you have seen enough, switch to the third tab.]])
152 ),
153}167}
154168
155inventory3 = {169inventory3 = {
170position = "topright",
156 title = _"Stock",171 title = _"Stock",
157 body = (172 body = (
158 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.]]) ..173 li_image("images/wui/stats/menu_tab_wares_warehouse.png",
159 p(_[[The fourth tab shows the same thing for workers.]]) ..174 _[[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.]]) ..
175 li_image("images/wui/stats/menu_tab_workers_warehouse.png", _[[The fourth tab shows the same thing for workers.]]) ..
160 p(_[[The third tab tells you that there are no rations left in your headquarters – that’s not good!]])176 p(_[[The third tab tells you that there are no rations left in your headquarters – that’s not good!]])
161 ),177 ),
162 show_instantly = true,178 show_instantly = true,
163 h = 300179 h = 250
164}180}
165181
166reopen_stock_menu = {182reopen_stock_menu = {
167 title = _"You closed the stock window!",183 title = _"You closed the stock window!",
168 body = (184 body = (
169 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?]])185 li_image("images/wui/menus/statistics_stock.png",
186 _[[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?]])
170 ),187 ),
171 show_instantly = true,188 show_instantly = true,
172 w = 300,189 w = 300,
173 h = 250190 h = 250
174}191}
175192
176reopen_stock_menu_obj = {193obj_reopen_stock_menu = {
177 obj_name = "open_stock_menu_again",194 name = "open_stock_menu_again",
178 obj_title = _"Open the stock window again",195 title = _"Open the stock window again",
179 obj_body = (196 number = 1,
180 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.]]) ..197 body = objective_text(_"Open the stock window again",
181 -- TRANSLATORS: "it" refers to the stock menu window.198 li_image("images/wui/menus/statistics_stock.png",
199 _[[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.]]) ..
200 -- TRANSLATORS: "it" refers to the "Stock" window.
182 li(_[[Otherwise, please reopen it and choose the third tab.]])201 li(_[[Otherwise, please reopen it and choose the third tab.]])
183 ),202 )
184 h = 250
185}203}
186204
205obj_build_taverns = {
206 name = "build_taverns",
207 title=_"Build new taverns",
208 number = 1,
209 body = objective_text(_"Build new taverns",
210 li(_[[Build at least two taverns.]]) ..
211 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.]])
212 )
213}
187build_taverns = {214build_taverns = {
188 position = "topright",215 position = "topright",
189 title = _"New taverns",216 title = _"New taverns",
190 body = (217 body = (
191 h1(_[[We need new taverns]]) ..218 h1(_[[We need new taverns]]) ..
192 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.]]) ..219 li_object("empire_tavern",
193 li(_[[Build at least two taverns.]])220 _[[Now that you have an overview, you should act. I think we should build more than one tavern – two or three are better.]],
194 ),221 plr.color)
195 h = 300,
196 obj_name = "build_taverns",
197 obj_title = _"Build new taverns",
198 obj_body = (
199 p(_[[To make our mines work, we need rations again – the more, the better.]]) ..
200 li(_[[Build at least two taverns.]])
201 )222 )
202}223}
203224
204ware_encyclopedia = {225obj_open_encyclopedia = {
205 title = _"Encyclopedia",226 name = "open_encyclopedia",
206 body = (227 title=_"Open the in-game help window",
207 h1(_[[How to get help]]) ..228 number = 1,
208 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?’]]) ..229 body = objective_text(_"Open the in-game help window",
209 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.]]) ..
210 p(_[[This encyclopedia can be accessed via the help button at the bottom right.]])..
211 li_image("images/ui_basic/menu_help.png", _[[Please open the in-game help, and I’ll explain its contents to you.]])
212 ),
213 h = 350,
214 show_instantly = true,
215 obj_name = "open_encyclopedia",
216 obj_title = _"Open the in-game help window",
217 obj_body = (
218 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.]]) ..230 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.]]) ..
219 -- TRANSLATORS: "it" refers to the encyclopedia window231 -- TRANSLATORS: "it" refers to the encyclopedia window
220 li(_[[Open it. You can access it via the button at the bottom of the screen.]]) ..232 li(_[[Open it. You can access it via the button at the bottom of the screen.]]) ..
221 li_arrow(_[[Alternatively, you can access it directly with the ‘F1’ key.]])233 li_arrow(_[[Alternatively, you can access it directly with the ‘F1’ key.]])
234 )
235}
236ware_encyclopedia = {
237 title = _"Encyclopedia",
238 body = (
239 h1(_[[How to get help]]) ..
240 li_object("empire_soldier",
241 _[[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) ..
242 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.]])
222 ),243 ),
244 h = 450,
245 show_instantly = true,
223}246}
224247
248obj_lookup_wares = {
249 name = "lookup_wares",
250 title=_"Look up which wares are needed to recruit soldiers",
251 number = 1,
252 body = objective_text(_"Look up which wares are needed to recruit soldiers",
253 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.]]) ..
254 li(_[[Use the encyclopedia to find out how to create new soldiers.]]) ..
255 li_arrow(_[[Choose the ‘Wares’ tab in the encyclopedia window.]]) ..
256 li_arrow(_[[Look up what is needed to produce a helmet and what is needed to produce a wooden spear.]]) ..
257 li_arrow(_[[If you want, you may further look up what is needed to produce the wares you just looked up.]]) ..
258 li(_[[Close the encyclopedia window when you are done.]])
259 )
260}
225explain_encyclopedia = {261explain_encyclopedia = {
226 position = "topright",262 position = "topright",
227 title = _"Encyclopedia details",263 title = _"Encyclopedia details",
@@ -232,140 +268,143 @@
232 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.]])) ..268 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.]])) ..
233 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.]])) ..269 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.]])) ..
234 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.]])) ..270 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.]])) ..
235 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.]]) ..271 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.]]))
236 li(_[[Now use the encyclopedia to find out how to create new soldiers.]]) ..
237 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.]])
238 ),272 ),
239 h = 450,273 h = 500,
240 show_instantly = true,274 show_instantly = true,
241 obj_name = "check_wares",
242 obj_title = _"Look up which wares are needed to recruit soldiers",
243 obj_body = (
244 li(_[[Choose the ‘Wares’ tab in the encyclopedia window.]]) ..
245 li(_[[Look up what is needed to produce a helmet and what is needed to produce a wooden spear.]]) ..
246 li_arrow(_[[If you want, you may further look up what is needed to produce the wares you just looked up.]]) ..
247 li(_[[Close the encyclopedia window when you are done.]])
248 )
249}275}
250276
251reopen_encyclopedia = {277reopen_encyclopedia = {
252 title = _"You closed the encyclopedia!",278 title = _"You closed the encyclopedia!",
253 body = (279 body = (
254 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?]])280 li_image("images/ui_basic/menu_help.png",
281 _[[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?]])
255 ),282 ),
256 show_instantly = true,283 show_instantly = true,
257 w = 300,284 w = 300,
258 h = 250285 h = 250
259}286}
260287
261reopen_encyclopedia_obj = {288obj_reopen_encyclopedia = {
262 obj_name = "open_encyclopedia_again",289 name = "reopen_encyclopedia",
263 obj_title = _"Open the encyclopedia window again",290 title = _"Open the encyclopedia window again",
264 obj_body = (291 number = 1,
265 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.]]) ..292 body = objective_text(_"Open the encyclopedia window again",
293 li_image("images/ui_basic/menu_help.png",
294 _[[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.]]) ..
266 li(_[[Otherwise, please reopen the encyclopedia window and choose the second tab.]])295 li(_[[Otherwise, please reopen the encyclopedia window and choose the second tab.]])
267 ),296 )
268 h = 250
269}297}
270
271building_priority_settings = {298building_priority_settings = {
272 position = "topright",299 position = "topright",
273 title = _"Priority Settings",300 title = _"Priority Settings",
274 body = (301 body = (
275 h1(_[[Send the wares where they’re needed]]) ..302 h1(_[[Send the wares where they’re needed]]) ..
276 p(_[[Great. Our taverns have now been built up and are supplying us with rations.]]) ..303 li_object("empire_marblemine", p(_[[Great. Our taverns have now been built up and are supplying us with rations.]]) ..
277 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’.]]) ..304 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’.]]) ..
278 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.]]) ..305 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.]]) ..
279 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.]])306 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)
280 -- we cannot check whether the user does this, so no objective307 -- we cannot check whether the user does this, so no objective
281 -- see bug https://bugs.launchpad.net/widelands/+bug/1380288308 -- see bug https://bugs.launchpad.net/widelands/+bug/1380288
282 )309 )
283}310}
284311
312obj_open_ware_stats = {
313 name = "open_ware_stats",
314 title = _"Open the ware statistics window",
315 number = 1,
316 body = objective_text(_"Open the ware statistics window",
317 li(_[[Select the ‘Wares’ entry from the ‘Statistics’ menu.]])
318 )
319}
285ware_stats1 = {320ware_stats1 = {
286 position = "top",
287 title = _"Ware Statistics",321 title = _"Ware Statistics",
288 body = (322 body = (
289 p(_[[In the statistics menu, there is also a]]) ..323 li_image("images/wui/menus/statistics_wares.png", _[[Let’s have a look at how our wares production is doing.]])
290 li_image("images/wui/menus/menu_ware_stats.png", _[[‘Ware statistics’ button.]]) ..
291 -- TRANSLATORS: "it" refers to the ware statistics button
292 li(_[[Click on it.]])
293 ),324 ),
294 w = 200,325 h = 250
295 h = 200,326}
296 obj_name = "open_ware_stat",327
297 obj_title = _"Open the ware statistics window",328obj_switch_ware_stats_tab_to_third = {
298 obj_body = (329 name = "switch_ware_stats_tab_to_third",
299 li(_[[Open the ‘Ware statistics’ window, accessed via the statistics menu.]])330 title = _"Examine your ware production and consumption",
331 number = 1,
332 body = objective_text(_"Examine your ware production and consumption",
333 p(_[[The first two tabs show you the production and consumption of any ware. You can toggle them by simply clicking on them.]]) ..
334 li(_[[When you have seen enough, switch to the third tab (‘Economy health’).]])
300 )335 )
301}336}
302
303ware_stats2 = {337ware_stats2 = {
338 position = "topright",
304 title = _"Ware Statistics",339 title = _"Ware Statistics",
305 body = (340 body = (
306 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.]]) ..341 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.]]) ..
307 li(_[[I’ll continue as soon as you click on the]]) ..342 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’).]])
308 li_image("images/wui/stats/menu_tab_wares_econ_health.png", _[[third tab (‘Economy health’).]])
309 ),343 ),
310 h = 250,344 h = 350,
311 show_instantly = true,345 show_instantly = true
312 obj_name = "switch_ware_stat_tab_to_third",346}
313 obj_title = _"Switch to the third tab in the ware statistics menu window",347
314 obj_body = (348obj_switch_ware_stats_tab_to_fourth = {
315 p(_[[The first two tabs show you the production and consumption of any ware. You can toggle them by simply clicking on them.]]) ..349 name = "switch_ware_stats_tab_to_fourth",
316 li(_[[When you have seen enough, switch to the third tab.]])350 title = _"Examine your economy’s health",
351 number = 1,
352 body = objective_text(_"Examine your economy’s health",
353 p(_[[The third tab shows you the economy health of the ware. When the value is positive, this means your stock is growing.]]) ..
354 p(_[[Now try this out. You can also compare it with the two previous tabs.]]) ..
355 li(_[[When you have seen enough, switch to the fourth tab (‘Stock’).]])
317 )356 )
318}357}
319
320ware_stats3 = {358ware_stats3 = {
359 position = "topright",
321 title = _"Ware Statistics",360 title = _"Ware Statistics",
322 body = (361 body = (
323 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.]]) ..362 li_image("images/wui/stats/menu_tab_wares_econ_health.png",
324 p(_[[Now try this out. You can also compare it with the two previous tabs.]]) ..363 _[[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.]])
325 li(_[[Click on the last tab when I should continue.]])
326 ),364 ),
327 h = 250,365 h = 350,
328 show_instantly = true,366 show_instantly = true
329 obj_name = "switch_ware_stat_tab_to_forth",
330 obj_title = _"Switch to the last tab in the ware statistics menu window",
331 obj_body = (
332 p(_[[The third tab shows you the economy health of the ware. When the value is positive, this means your stock is growing.]]) ..
333 li(_[[When you have seen enough, switch to the fourth tab.]])
334 )
335}367}
336368
369obj_close_ware_stats = {
370 name = "close_ware_stats",
371 title = _"Examine your stock",
372 number = 1,
373 body = objective_text(_"Examine your stock",
374 li_arrow(_[[The stock tab shows you how many wares you have. Compare the information from the four tabs to understand the correlation.]]) ..
375 li(_[[When you have finished, close the ware statistics window.]])
376 ),
377 h = 250
378}
337ware_stats4 = {379ware_stats4 = {
380 position = "topright",
338 title = _"Ware Statistics",381 title = _"Ware Statistics",
339 body = (382 body = (
340 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!]]) ..383 li_image("images/wui/stats/menu_tab_wares_stock.png",
341 p(_[[The last two tabs are good indicators to see whether shortages are about to come. Don’t forget to check them regularly!]]) ..384 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!]]) ..
342 li(_[[Close this window when you’re done.]])385 p(_[[The last two tabs are good indicators to see whether shortages are about to come. Don’t forget to check them regularly!]]))
343 ),386 ),
344 h = 250,387 show_instantly = true
345 show_instantly = true,
346 obj_name = "close_ware_stats",
347 obj_title = _"Close the ware statistics window",
348 obj_body = (
349 p(_[[The stock tab shows you how many wares you have. Compare the information from the four tabs to understand the correlation.]]) ..
350 li(_[[When you have finished, close the ware statistics window.]])
351 ),
352}388}
353389
354reopen_ware_stats1 = {390reopen_ware_stats1 = {
355 title = _"You closed the ware statistics window!",391 title = _"You closed the ware statistics window!",
356 body = (392 body = (
357 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?]])393 li_image("images/wui/menus/statistics_wares.png",
394 _[[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?]])
358 ),395 ),
359 show_instantly = true,396 show_instantly = true,
360 w = 300,397 w = 300,
361 h = 250398 h = 250
362}399}
363400
364reopen_ware_stats1_obj = {401obj_reopen_ware_stats1 = {
365 obj_name = "open_ware_stats_menu_again1",402 obj_name = "reopen_ware_stats1",
366 obj_title = _"Open the ware statistics window again",403 obj_title = _"Open the ware statistics window again",
404 number = 1,
367 obj_body = (405 obj_body = (
368 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.]]) ..406 li_image("images/wui/menus/statistics_wares.png",
407 _[[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.]]) ..
369 -- TRANSLATORS: "it" refers to the ware statistics window.408 -- TRANSLATORS: "it" refers to the ware statistics window.
370 li(_[[Otherwise, please reopen it and choose the third tab.]])409 li(_[[Otherwise, please reopen it and choose the third tab.]])
371 )410 )
@@ -374,102 +413,122 @@
374reopen_ware_stats2 = {413reopen_ware_stats2 = {
375 title = _"You closed the ware statistics window!",414 title = _"You closed the ware statistics window!",
376 body = (415 body = (
377 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?]])416 li_image("images/wui/menus/statistics_wares.png",
417 _[[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?]])
378 ),418 ),
379 show_instantly = true,419 show_instantly = true,
380 w = 300,420 w = 300,
381 h = 250421 h = 250
382}422}
383423
384reopen_ware_stats2_obj = {424obj_reopen_ware_stats2 = {
385 obj_name = "open_ware_stats_menu_again2",425 name = "open_ware_stats_menu_again2",
386 obj_title = _"Open the ware statistics window again",426 title = _"Open the ware statistics window again",
387 obj_body = (427 number = 1,
388 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.]]) ..428 body = (
429 li_image("images/wui/menus/statistics_wares.png",
430 _[[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.]]) ..
389 -- TRANSLATORS: "it" refers to the ware statistics window.431 -- TRANSLATORS: "it" refers to the ware statistics window.
390 li(_[[Otherwise, please reopen it and choose the fourth tab.]])432 li(_[[Otherwise, please reopen it and choose the fourth tab.]])
391 )433 )
392}434}
393435
436obj_open_economy_settings = {
437 name = "open_economy_settings",
438 title = _"Open the ‘Configure economy’ window",
439 number = 1,
440 body = objective_text(_"Open the ‘Configure economy’ window",
441 li(_[[Open the ‘Configure economy’ window.]]) ..
442 li_arrow(_[[The window can be accessed by clicking on any flag you own.]])
443 )
444}
394economy_settings1 = {445economy_settings1 = {
395 position = "topright",446 position = "topright",
396 title = _"Economy options",447 title = _"Economy options",
397 body = (448 body = (
398 p(_[[I’ve shown you our stock menu window, where you could see which wares are at the warehouses. You remember?]]) ..449 li_object("empire_flag",
399 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’.]]) ..450 p(_[[I’ve shown you our stock window, where you could see which wares are at the warehouses. You remember?]]) ..
451 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) ..
400 -- Yup, that's indeed the correct icon452 -- Yup, that's indeed the correct icon
401 li_image("images/wui/stats/genstats_nrwares.png", _[[This is the icon.]]) ..453 li_image("images/wui/stats/genstats_nrwares.png", _[[This is the icon.]])
402 li(_[[Open this window.]])
403 ),454 ),
404 h = 350,455 h = 350
405 obj_name = "open_economy_settings",
406 obj_title = _"Open the ‘Configure economy’ window",
407 obj_body = (
408 li(_[[Open the ‘Configure economy’ window.]]) ..
409 li_arrow(_[[The window can be accessed by clicking on any flag you own.]])
410 )
411}456}
412457
413economy_settings2 = {458economy_settings2 = {
459 position = "topright",
414 title = _"Economy options",460 title = _"Economy options",
415 body = (461 body = (
416 p(_[[This window looks similar to the stock window, but it has additional buttons at the bottom.]]) ..462 li_image("images/wui/stats/genstats_nrwares.png",
463 _[[This window looks similar to the stock window, but it has additional buttons at the bottom.]]) ..
417 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.]]) ..464 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.]]) ..
418 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.]]) ..465 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.]]) ..
419 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.]]) ..466 li_image(wl.Game():get_ware_description("scythe").icon_name,
420 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.]])467 _[[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.]]) ..
421 ),468 li_object("empire_farmer",
422 h = 450469 _[[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)
470 )
423}471}
424472
473obj_produce_marble_columns = {
474 name = "produce_marble_columns",
475 title = _"Produce 20 marble columns",
476 number = 1,
477 body = objective_text(_"Produce 20 marble columns",
478 li(_[[To be prepared for additional fortifications, you should produce 20 marble columns.]]) ..
479 li_arrow(_[[Your stonemason will not produce marble columns when they are not needed. You have to increase the target quantity.]]) ..
480 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.]]) ..
481 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.]])
482 )
483}
425economy_settings3 = {484economy_settings3 = {
485 position = "topright",
426 title = _"Economy options",486 title = _"Economy options",
427 body = (487 body = (
428 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.]]) ..488 li_image(wl.Game():get_ware_description("iron").icon_name,
489 _[[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.]]) ..
429 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.]]) ..490 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.]]) ..
430 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.]]) ..491 li_image(wl.Game():get_ware_description("marble_column").icon_name,
431 li(_[[Set the target quantity for marble columns to 20 and wait for your stonemason to produce them.]])492 _[[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.]])
432 ),493 ),
433 obj_name = "produce_marble_columns",494 h = 500,
434 obj_title = _"Produce 20 marble columns",495}
435 obj_body = (496
436 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.]]) ..497obj_bring_marble_columns_to_front = {
437 li(_[[To be prepared for additional fortifications, you should produce 20 marble columns.]]) ..498 name = "bring_marble_columns_to_front",
438 li_arrow(_[[Your stonemason will not produce marble columns when they are not needed. You have to increase the target quantity.]]) ..499 title = _"Bring 20 marble columns to the front line",
439 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.]])500 number = 1,
501 body = objective_text(_"Bring 20 marble columns to the front line",
502 li(_[[Bring all of the 20 marble columns to the warehouse near the front line.]]) ..
503 li_image("images/wui/buildings/stock_policy_button_prefer.png",
504 _[[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.]]) ..
505 li_image("images/wui/buildings/stock_policy_button_remove.png",
506 _[[Then, to move the marble columns out of your headquarters, you will have to click on the remove button there.]])
440 )507 )
441}508}
442
443warehouse_preference_settings = {509warehouse_preference_settings = {
444 field = warehouse_field,510 field = warehouse_field,
445 position = "topright",511 position = "topright",
446 title = _"Warehouse Preferences",512 title = _"Warehouse Preferences",
447 body = (513 body = (
448 h1(_[[Bring the marble columns to the front line]]) ..514 h1(_[[Bring the marble columns to the front line]]) ..
449 p(_[[The production of marble columns is working fine now, but it would be great if they were stored where we need them.]]) ..515 li_object("empire_warehouse",
450 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.]]) ..516 p(_[[The production of marble columns is working fine now, but it would be great if they were stored where we need them.]]) ..
451 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.]]) ..517 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.]]) ..
452 li(_[[Bring all of the 20 marble columns to the warehouse near the front line.]]) ..518 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)
453 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.]]) ..
454 li_arrow(_[[Then, to move the marble columns out of your headquarters, you will have to click on the remove button there.]])
455 ),519 ),
456 obj_name = "bring_marble_columns_to_front",520 h = 500
457 obj_title = _"Bring 20 marble columns to the front line",
458 obj_body = (
459 p(_[[To decide where your wares get stored, you can use the preference buttons in the warehouses.]]) ..
460 li(_[[Bring all of the 20 marble columns to the warehouse near the front line.]]) ..
461 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.]]) ..
462 li_arrow(_[[Then, to move the marble columns out of your headquarters, you will have to click on the remove button there.]])
463 )
464}521}
465522
466conclusion = {523conclusion = {
467 title = _"Borders Secured",524 title = _"Borders Secured",
468 body =525 body =
469 h1(_[[We’re safe now]]) ..526 h1(_[[We’re safe now]]) ..
470 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.]]) ..527 li_object("empire_fortress",
471 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!]]) ..528 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.]]) ..
529 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) ..
472 p([[]]) ..530 p([[]]) ..
473 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:]]) ..531 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:]]) ..
474 h1(p("align=center", u("widelands.org")))532 h1(p("align=center", u("widelands.org"))),
533 h = 450
475}534}
476535
=== modified file 'data/scripting/editor/editor_help.lua'
--- data/scripting/editor/editor_help.lua 2018-09-29 09:20:35 +0000
+++ data/scripting/editor/editor_help.lua 2019-06-01 15:39:16 +0000
@@ -79,7 +79,7 @@
79 name = "terrains",79 name = "terrains",
80 -- TRANSLATORS Tab title: terrain help80 -- TRANSLATORS Tab title: terrain help
81 title = _"Terrains",81 title = _"Terrains",
82 icon = "images/wui/editor/editor_menu_tool_set_terrain.png",82 icon = "images/wui/editor/tools/terrain.png",
83 entries = get_terrains()83 entries = get_terrains()
84 },84 },
85 {85 {
8686
=== modified file 'data/scripting/messages.lua'
--- data/scripting/messages.lua 2019-02-09 18:45:42 +0000
+++ data/scripting/messages.lua 2019-06-01 15:39:16 +0000
@@ -6,6 +6,7 @@
66
7include "scripting/coroutine.lua"7include "scripting/coroutine.lua"
8include "scripting/richtext.lua"8include "scripting/richtext.lua"
9include "scripting/richtext_scenarios.lua"
9include "scripting/table.lua"10include "scripting/table.lua"
10include "scripting/ui.lua"11include "scripting/ui.lua"
1112
@@ -87,10 +88,57 @@
87-- :arg message: the message to be sent88-- :arg message: the message to be sent
88-- :arg sleeptime: ms spent sleeping after the message has been dismissed by the player89-- :arg sleeptime: ms spent sleeping after the message has been dismissed by the player
89--90--
91-- Besides the normal message arguments (see wl.Game.Player:message_box) the following ones can be used:
92--
93-- :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.
94-- :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.
95-- :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.
96--
90function campaign_message_box(message, sleeptime)97function campaign_message_box(message, sleeptime)
91 if not message.h then message.h = 400 end98 message.show_instantly = message.show_instantly or false
92 if not message.w then message.w = 450 end99 message.scroll_back = message.scroll_back or false
93 message_box(wl.Game().players[1], message.title, message.body, message)100 message.h = message.h or 400
101 message.w = message.w or 450
102
103 if message.position then
104 if string.find(message.position,"top") then
105 -- Set it a bit lover than 0 to prevent overlap with game speed text
106 message.posy = 25
107 elseif string.find(message.position,"bottom") then
108 message.posy = 10000
109 end
110 if string.find(message.position,"left") then
111 message.posx = 0
112 elseif string.find(message.position,"right") then
113 message.posx = 10000
114 end
115 end
116
117 local center_pixel
118
119 if message.field then
120 -- This is necessary. Otherwise, we would scroll and then wait until the road is finished.
121 -- In this time, could user can scroll elsewhere, giving weird results.
122 if not message.show_instantly then
123 wait_for_roadbuilding()
124 end
125 center_pixel = scroll_to_field(message.field);
126 end
127
128 if message.show_instantly then
129 -- message_box takes care of this, but player:message_box does not
130 local user_input = wl.ui.get_user_input_allowed()
131 wl.ui.set_user_input_allowed(true)
132 wl.Game().players[1]:message_box(message.title, rt(message.body), message)
133 wl.ui.set_user_input_allowed(user_input)
134 else
135 message_box(wl.Game().players[1], message.title, message.body, message)
136 end
137
138 if (message.field and message.scroll_back) then
139 scroll_to_map_pixel(center_pixel);
140 end
141
94 if sleeptime then sleep(sleeptime) end142 if sleeptime then sleep(sleeptime) end
95end143end
96144
@@ -112,6 +160,32 @@
112 end160 end
113end161end
114162
163
164-- RST
165-- .. function:: campaign_message_box(message, objective [,sleeptime])
166--
167-- Sets message.h and message.w if not set and calls
168-- message_box(player, title, body, parameters) for player 1.
169--
170-- Adds an objective to the scenario afterwards.
171--
172--
173-- :arg message: the message to be sent
174-- :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.
175-- :arg sleeptime: ms spent sleeping after the message has been dismissed by the player
176--
177-- :returns: The new objective.
178--
179-- TODO(wl-zocker): This function should be used by all tutorials, campaigns and scenario maps
180function campaign_message_with_objective(message, objective, sleeptime)
181 -- TODO(GunChleoc): Once everybody is using this function, move new_objectives over from
182 -- richtext_scenarios and add this file to utils/buildcat.py
183 message.body = message.body .. new_objectives(objective)
184 campaign_message_box(message, sleeptime)
185 return add_campaign_objective(objective)
186end
187
188
115-- RST189-- RST
116-- .. function:: set_objective_done(objective[, sleeptime])190-- .. function:: set_objective_done(objective[, sleeptime])
117--191--
@@ -133,6 +207,7 @@
133-- RST207-- RST
134-- .. function:: message_box_objective(player, message)208-- .. function:: message_box_objective(player, message)
135--209--
210-- DEPRECATED, use campaign_message_with_objective instead.
136-- Calls message_box(player, message.title, message.body, message). Also adds an objective defined in obj_name, obj_title and obj_body.211-- Calls message_box(player, message.title, message.body, message). Also adds an objective defined in obj_name, obj_title and obj_body.
137-- This method should gather all options that are used often to avoid reimplementation in every single scenario script.212-- This method should gather all options that are used often to avoid reimplementation in every single scenario script.
138--213--
@@ -146,8 +221,6 @@
146-- :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.221-- :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.
147--222--
148-- :returns: the objective if defined, nil otherwise223-- :returns: the objective if defined, nil otherwise
149
150-- TODO(wl-zocker): This function should be used by all tutorials, campaigns and scenario maps
151function message_box_objective(player, message)224function message_box_objective(player, message)
152 message.show_instantly = message.show_instantly or false225 message.show_instantly = message.show_instantly or false
153 message.scroll_back = message.scroll_back or false226 message.scroll_back = message.scroll_back or false
154227
=== modified file 'data/scripting/richtext.lua'
--- data/scripting/richtext.lua 2018-09-29 09:20:35 +0000
+++ data/scripting/richtext.lua 2019-06-01 15:39:16 +0000
@@ -424,7 +424,7 @@
424end424end
425425
426-- RST426-- RST
427-- .. function:: li_object(name, text)427-- .. function:: li_object(name, text[, playercolor])
428--428--
429-- Places a paragraph of text to the right of an image representing the given map object429-- Places a paragraph of text to the right of an image representing the given map object
430--430--
@@ -434,12 +434,19 @@
434-- :arg text: the text to be placed next to the image434-- :arg text: the text to be placed next to the image
435-- :type text: :class:`string`435-- :type text: :class:`string`
436--436--
437-- :arg playercolor: a playercolor to be applied to the image, in hex notation
438-- :type playercolor: :class:`string`
439--
437-- :returns: the text wrapped in a paragraph and placed next to the image, the outer tag is a div.440-- :returns: the text wrapped in a paragraph and placed next to the image, the outer tag is a div.
438441
439function li_object(name, text)442function li_object(name, text, playercolor)
443 local image = img_object(name)
444 if (playercolor ~= nil) then
445 image = img_object(name, "color=" .. playercolor)
446 end
440 return447 return
441 div("width=100%",448 div("width=100%",
442 div("float=left padding_r=6", p(img_object(name))) ..449 div("float=left padding_r=6", p(image)) ..
443 p(text)450 p(text)
444 )451 )
445end452end
@@ -607,7 +614,7 @@
607-- h1("6699ff", _[[Colored header]]) ..614-- h1("6699ff", _[[Colored header]]) ..
608-- p(_[[Normal paragraph, just with a bit more text to show how it looks like.]]) ..615-- p(_[[Normal paragraph, just with a bit more text to show how it looks like.]]) ..
609-- p("align=center", _[[A centered paragraph, just with a bit more text to show how it looks like.]]) ..616-- p("align=center", _[[A centered paragraph, just with a bit more text to show how it looks like.]]) ..
610-- 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]]) ..617-- 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]]) ..
611-- li(_[[A list item]]) ..618-- li(_[[A list item]]) ..
612-- li(font("color=6699ff bold=1", _[[Blue and bold]])) ..619-- li(font("color=6699ff bold=1", _[[Blue and bold]])) ..
613-- li_arrow(_[[A list item with an arrow]]) ..620-- li_arrow(_[[A list item with an arrow]]) ..
614621
=== modified file 'data/scripting/richtext_scenarios.lua'
--- data/scripting/richtext_scenarios.lua 2019-05-12 10:35:21 +0000
+++ data/scripting/richtext_scenarios.lua 2019-06-01 15:39:16 +0000
@@ -87,9 +87,17 @@
87 text = text .. obj.body87 text = text .. obj.body
88 sum = sum + obj.number88 sum = sum + obj.number
89 end89 end
90 local objectives_header = _"New Objective"90
91 local objectives_header = _"New Objective"
91 if (sum > 1) then92 if (sum > 1) then
92 objectives_header = _"New Objectives"93 objectives_header = _"New Objectives"
93 end94 end
94 return h1(objectives_header) .. text95
96 return
97 div("width=100%",
98 vspace(18) ..
99 div("float=left padding_r=6", p(img("images/wui/menus/objectives.png"))) ..
100 p_font("", "size=18 bold=1 color=D1D1D1", vspace(6) .. objectives_header) ..
101 vspace(1) .. text
102 )
95end103end

Subscribers

People subscribed via source and target branches

to status/vote changes: