Merge lp:~widelands-dev/widelands/building-statistics-window-tut04 into lp:widelands

Proposed by wl-zocker
Status: Merged
Merged at revision: 7478
Proposed branch: lp:~widelands-dev/widelands/building-statistics-window-tut04
Merge into: lp:widelands
Diff against target: 148 lines (+74/-9)
3 files modified
campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua (+19/-3)
campaigns/tutorial04_economy.wmf/scripting/starting_conditions.lua (+3/-1)
campaigns/tutorial04_economy.wmf/scripting/texts.lua (+52/-5)
To merge this branch: bzr merge lp:~widelands-dev/widelands/building-statistics-window-tut04
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+261615@code.launchpad.net

Description of the change

Some changes to the fourth tutorial to take care of the new building statistics window (see bug 1399621).

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

I proofread the strings :)

Revision history for this message
wl-zocker (wl-zocker) wrote :

Thanks. I have a little question: Wikipedia states that there is no space around an em dash (http://en.wikipedia.org/wiki/Dash#Em_dash). How absolute is this rule or is it up to the writer?

Revision history for this message
GunChleoc (gunchleoc) wrote :

We are using an en dash with spaces, which is the European tradition rather than the American one. I'm fine with leaving it, because I don't want to break the strings again over this.

I added 1 comment to the code - please double-check that it works. As soon as somebody has tested everything, this is good to go. I don't have access to Linux ATM, so I can't do this myself.

Revision history for this message
wl-zocker (wl-zocker) wrote :

It works. I tried saving and loading from different points, no problem.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Thanks. Please go ahead and merge :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua'
2--- campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua 2015-05-31 13:45:13 +0000
3+++ campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua 2015-06-10 16:51:14 +0000
4@@ -19,9 +19,25 @@
5 message_box_objective(plr, tavern_burnt_down)
6 sleep(2000)
7 local o = message_box_objective(plr, building_stat)
8- -- wait for the window to open and close
9 while not mv.windows.building_statistics do sleep(100) end
10- -- we cannot check whether the user scrolled, so let's hope he does it
11+ sleep(500)
12+ o.done = true
13+
14+ o = message_box_objective(plr,explain_building_stat)
15+ -- We cannot create several objectives with the same name. Therefore, we create o2 here once and change its visibility
16+ local o2 = add_campaign_objective(reopen_building_stat_obj)
17+ o2.visible = false
18+ local medium_tab_active = false
19+ while not medium_tab_active do
20+ if not mv.windows.building_statistics then
21+ o2.visible = true
22+ message_box_objective(plr, reopen_building_stat)
23+ while not mv.windows.building_statistics do sleep(200) end
24+ o2.visible = false
25+ end
26+ if mv.windows.building_statistics.tabs["building_stats_medium"].active then medium_tab_active = true end
27+ sleep(200)
28+ end
29 while mv.windows.building_statistics do sleep(100) end
30 o.done = true
31
32@@ -32,7 +48,7 @@
33
34 o = message_box_objective(plr, inventory2)
35 -- We cannot create several objectives with the same name. Therefore, we create o2 here once and change its visibility
36- local o2 = add_campaign_objective(reopen_stock_menu_obj)
37+ o2 = add_campaign_objective(reopen_stock_menu_obj)
38 o2.visible = false
39 while not o.done do
40 if not mv.windows.stock_menu then
41
42=== modified file 'campaigns/tutorial04_economy.wmf/scripting/starting_conditions.lua'
43--- campaigns/tutorial04_economy.wmf/scripting/starting_conditions.lua 2014-10-17 08:38:24 +0000
44+++ campaigns/tutorial04_economy.wmf/scripting/starting_conditions.lua 2015-06-10 16:51:14 +0000
45@@ -2,7 +2,7 @@
46 -- Initialization
47 -- ===============
48
49-plr:forbid_buildings{"scouts_house"} -- otherwise, player could scout and attack the enemy when he should not
50+plr:forbid_buildings{"scouts_house"} -- otherwise, player could scout the wasteland
51
52 function init_player()
53 -- a headquarters without helms, lances, ores and coal
54@@ -138,6 +138,8 @@
55 {"fortress",71,66},
56 {"fortress",75,72}
57 )
58+ plr:place_building("quarry", map:get_field(87,36), true, true) -- a construction site
59+
60 plr:conquer(map:get_field(111,34),3) -- some remaining fields inside
61
62 connected_road(plr,map:get_field(97,54).immovable,"tr,tr|tr,tl")
63
64=== modified file 'campaigns/tutorial04_economy.wmf/scripting/texts.lua'
65--- campaigns/tutorial04_economy.wmf/scripting/texts.lua 2014-11-11 10:41:28 +0000
66+++ campaigns/tutorial04_economy.wmf/scripting/texts.lua 2015-06-10 16:51:14 +0000
67@@ -53,29 +53,76 @@
68 title = _"Building statistics",
69 body = rt(
70 h1(_[[Check out your taverns]]) ..
71- p(_[[At first, we should find out how many taverns we currently have. Widelands offers you a list where you can easily check this.]])
72+ p(_[[At first, we should find out how many taverns we currently have. Widelands offers you a window where you can easily check this.]])
73 ) ..
74 rt("image=pics/menu_toggle_menu.png",p(_[[First, you will have to open the statistics menu (you can find the corresponding button at the bottom). We will need this menu several times.]])) ..
75 rt("image=pics/menu_building_stats.png",p(_[[Afterwards, choose the ‘Building statistics’.]]) ..
76 paragraphdivider() ..
77 listitem_bullet(_[[Open the building statistics window.]]) ..
78- listitem_bullet(_[[When you have looked up the number of taverns, close it.]])
79+ listitem_arrow(_[[You can also use the hotkey ‘b’.]])
80 ),
81 h = 350,
82 obj_name = "open_building_stat",
83- obj_title = _"Look up your number of taverns in the building statistics window.",
84+ obj_title = _"Open the building statistics window.",
85 obj_body =
86 rt("image=pics/menu_building_stats.png", p(_[[The building statistics window gives you an overview over the buildings you have.]])) ..
87 rt(
88 paragraphdivider() ..
89 -- TRANSLATORS: "it" refers to the building statistics window
90 listitem_bullet(_[[Open it. You can access it from the statistics menu.]]) ..
91- listitem_arrow(_[[The statistics menu is accessed via the second button at the bottom. It provides several windows that give you information about the game.]]) ..
92- listitem_bullet(_[[Look up how many taverns you have (in the column ‘Owned’)]]) ..
93+ listitem_arrow(_[[The statistics menu is accessed via the second button at the bottom. It provides several windows that give you information about the game.]])
94+ )
95+}
96+
97+explain_building_stat = {
98+ title = _"Building Statistics",
99+ body = rt(
100+ p(_[[This is the building statistics window. It shows you all buildings you can own, sorted by their size.]]) ..
101+ p(_[[Let me now explain what all those numbers mean:]]) ..
102+ paragraphdivider() ..
103+ listitem_bullet(_[[‘2/1’ below the quarry: This means that you have two quarries, plus another one which is under construction.]]) ..
104+ listitem_bullet(_[[‘0%’: This indicates the average productivity of all buildings of that type. You have just started this game, therefore none of your buildings has done any work yet, but they are going to start working soon.]]) ..
105+ listitem_bullet(_[[‘2/4’ below your sentry: For military buildings, the stationed soldiers are shown instead of a productivity. You want to have four soldiers in your sentries, but only two soldiers are stationed in this kind of building. This leaves two vacant positions — we really need more soldiers.]]) ..
106+ listitem_arrow(_[[In both cases, the color (green - yellow - red) signals you how good the value is.]]) ..
107+ listitem_bullet(_[[If you click on a building, you can scroll through the buildings of the selected type.]]) ..
108+ listitem_bullet(_[[If you don’t have any building of a particular building type, it will be shown greyed out.]])
109+ ) ..
110+ rt(
111+ h2(_[[Now it’s your turn]]) ..
112+ 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.]])
113+ ),
114+ obj_name = "check_taverns",
115+ obj_title = _"Look up your number of taverns in the building statistics window.",
116+ obj_body = rt(
117+ listitem_bullet(_[[Choose the ‘Medium Buildings’ tab in the building statistics window.]]) ..
118+ listitem_bullet(_[[Look up how many taverns you have.]]) ..
119+ listitem_arrow(_[[Below every building, there are two lines. The first one shows the number of buildings you own and how many are under construction. The second line shows the average productivity if it is a production site or training site, or the stationed and desired soldiers in military buildings.]]) ..
120 listitem_bullet(_[[Close the building statistics window when you are done.]])
121 )
122 }
123
124+reopen_building_stat = {
125+ title = _"You closed the building statistics window!",
126+ body = rt(
127+ 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?]])
128+ ),
129+ show_instantly = true,
130+ w = 300,
131+ h = 250
132+}
133+
134+reopen_building_stat_obj = {
135+ obj_name = "open_building_stat_again",
136+ obj_title = _"Open the building statistics window again.",
137+ obj_body = rt(
138+ p(_[[You closed the building statistics window, although you have not yet looked up the number of taverns.]]) ..
139+ paragraphdivider() ..
140+ -- TRANSLATORS: "it" refers to the building statistics window.
141+ listitem_bullet(_[[Please reopen it and choose the second tab (medium buildings).]])
142+ ),
143+ h = 250
144+}
145+
146 inventory1 = {
147 position = "topright",
148 title = _"Stock",

Subscribers

People subscribed via source and target branches

to status/vote changes: