1#textdomain wesnoth-lib
2###
3### Definition of the main screen for Wesnoth.
4###
5
6#define _GUI_BG_RATIO
7(
8    min(bg_hratio, bg_wratio)
9where
10	bg_hratio = height * 1.0 / image_original_height,
11	bg_wratio = width * 1.0 / image_original_width
12)
13#enddef
14
15#define _GUI_BG_Y
16    ((height - image_height)/2)
17#enddef
18
19#define _GUI_BG_X
20    ((width - image_width)/2)
21#enddef
22
23[window_definition]
24
25	id = "title_screen"
26	description = "The window definition for the title screen."
27
28	[resolution]
29
30		[background]
31
32			[draw]
33
34				[image]
35					w = "(width)"
36					h = "(height)"
37					x = 0
38					y = 0
39					name = "(background_image)"
40				[/image]
41
42				[image]
43					w = "(round(image_original_width * {_GUI_BG_RATIO}))"
44					h = "(round(image_original_height * {_GUI_BG_RATIO}))"
45					x = "(max(0, {_GUI_BG_X}))"
46					y = "(max(0, {_GUI_BG_Y}))"
47					name = "(title_image)"
48				[/image]
49
50			[/draw]
51
52		[/background]
53
54		[foreground]
55
56			[draw]
57
58			[/draw]
59
60		[/foreground]
61
62	[/resolution]
63
64[/window_definition]
65#undef _GUI_BG_RATIO
66#undef _GUI_BG_Y
67#undef _GUI_BG_X
68
69#define _GUI_H_SPACER WIDTH GROW_FACTOR
70	[column]
71
72		grow_factor = "{GROW_FACTOR}"
73
74		[spacer]
75			definition = "default"
76			width = "{WIDTH}"
77		[/spacer]
78
79	[/column]
80#enddef
81
82#define _GUI_V_SPACER HEIGHT
83	[column]
84
85		[spacer]
86			definition = "default"
87			height = {HEIGHT}
88		[/spacer]
89
90	[/column]
91#enddef
92
93#define _GUI_TIP_SECTION
94	[panel]
95		definition = "box_display"
96
97		[grid]
98
99			[row]
100
101				[column]
102
103					[multi_page]
104						id = "tips"
105						definition = "default"
106
107						[page_definition]
108
109							[row]
110								grow_factor = 1
111
112								[column]
113									border = "all"
114									border_size = 5
115									horizontal_grow = true
116									vertical_grow = true
117
118									[label]
119										id = "tip"
120										definition = "title_screen_tip"
121
122										wrap = true
123									[/label]
124
125								[/column]
126
127							[/row]
128
129							[row]
130
131								[column]
132									border = "all"
133									border_size = 5
134									horizontal_grow = true
135
136									[label]
137										id = "source"
138										definition = "title_screen_tip"
139
140										text_alignment = "right"
141										wrap = true
142									[/label]
143
144								[/column]
145
146							[/row]
147
148						[/page_definition]
149
150					[/multi_page]
151
152				[/column]
153
154			[/row]
155
156			[row]
157
158				[column]
159					horizontal_grow = true
160
161					[grid]
162
163						[row]
164
165							[column]
166								border = "all"
167								border_size = 5
168								horizontal_alignment = "left"
169
170								[button]
171									id = "help"
172									definition = "default"
173
174									label = _ "Help"
175									tooltip = _"Show Battle for Wesnoth help"
176								[/button]
177
178							[/column]
179
180							[column]
181								border = "all"
182								border_size = 5
183								grow_factor = 1
184								horizontal_alignment = "right"
185
186								[button]
187									id = "previous_tip"
188									definition = "default"
189
190									label = _ "Previous"
191									tooltip = _"Show previous tip of the day"
192								[/button]
193
194							[/column]
195
196							[column]
197								border = "all"
198								border_size = 5
199								horizontal_alignment = "right"
200
201								[button]
202									id = "next_tip"
203									definition = "default"
204
205									label = _ "Next"
206									tooltip = _"Show next tip of the day"
207								[/button]
208
209							[/column]
210
211						[/row]
212
213					[/grid]
214
215				[/column]
216
217			[/row]
218
219		[/grid]
220
221	[/panel]
222#enddef
223
224
225#define _GUI_BUTTON ID CAPTION TOOLTIP
226	[row]
227
228		[column]
229			border = "all"
230			border_size = 5
231			horizontal_grow = true
232			[button]
233				id = {ID}
234				definition = "large"
235
236				label = {CAPTION}
237				tooltip = {TOOLTIP}
238			[/button]
239
240		[/column]
241
242	[/row]
243
244#enddef
245
246#define _GUI_MENU_SECTION
247	[panel]
248		definition = "box_display"
249
250		[grid]
251			{_GUI_BUTTON "tutorial" _"Tutorial" _"Start a tutorial to familiarize yourself with the game"}
252			{_GUI_BUTTON "campaign" _"Campaigns" _"Start a new single player campaign"}
253			{_GUI_BUTTON "multiplayer" _"Multiplayer" _"Play multiplayer (hotseat, LAN, or Internet), or a single scenario against the AI"}
254			{_GUI_BUTTON "load" _"Load" _"Load a saved game"}
255			{_GUI_BUTTON "addons" _"Add-ons" _"Download usermade campaigns, eras, or map packs"}
256			{_GUI_BUTTON "cores" _"Cores" _"Select the game core data"}
257			{_GUI_BUTTON "editor" _"Map Editor" _"Start the map editor"}
258			{_GUI_BUTTON "language" _"Language" _"Change the language"}
259			{_GUI_BUTTON "preferences" _"Preferences" _"Configure the game’s settings"}
260			{_GUI_BUTTON "credits" _"Credits" _"View the credits"}
261			{_GUI_BUTTON "quit" _"Quit" _"Quit the game"}
262			# This debug feature doesn't need to be translated.
263			{_GUI_BUTTON "clock" "Clock" "Show debug clock"}
264		[/grid]
265
266	[/panel]
267#enddef
268
269[window]
270	id = "title_screen"
271	description = "The game's main menu."
272
273	[resolution]
274		definition = "title_screen"
275
276		{GUI_WINDOW_FULLSCREEN}
277
278		[tooltip]
279			id = "tooltip_large"
280		[/tooltip]
281
282		[helptip]
283			id = "tooltip_large"
284		[/helptip]
285
286		[grid]
287
288			[row]
289				grow_factor = 1
290
291				[column]
292
293					horizontal_grow = true
294					vertical_grow = true
295
296					[stacked_widget]
297
298						[layer]
299
300							[row]
301								grow_factor = 0
302
303								{_GUI_V_SPACER 30}
304
305							[/row]
306
307							[row]
308								grow_factor = 1
309
310								[column]
311									vertical_alignment = "top"
312
313									[image]
314										id = "logo-bg"
315										definition = "default"
316									[/image]
317
318								[/column]
319
320							[/row]
321
322						[/layer]
323
324						[layer]
325
326							[row]
327								grow_factor = 0
328
329								{_GUI_V_SPACER 30}
330
331							[/row]
332
333							[row]
334								grow_factor = 1
335
336								[column]
337									vertical_alignment = "top"
338
339									[image]
340										id = "logo"
341										definition = "default"
342									[/image]
343
344								[/column]
345
346							[/row]
347
348						[/layer]
349
350						[layer]
351
352							[row]
353
354								[column]
355									horizontal_alignment = "left"
356									vertical_alignment = "bottom"
357
358									[grid]
359
360										[row]
361
362											[column]
363												grow_factor = 0
364												horizontal_alignment = "left"
365												[spacer]
366													# Should be as large as the about button on the
367													# foreground layer.
368													width = 25
369													height = 25
370												[/spacer]
371											[/column]
372
373											{GUI_FILLER}
374
375										[/row]
376
377									[/grid]
378
379								[/column]
380
381							[/row]
382
383						[/layer]
384
385						[layer]
386
387							[row]
388								grow_factor = 5
389
390								{GUI_FILLER}
391
392								{GUI_FILLER}
393
394								{GUI_FILLER}
395
396								{_GUI_V_SPACER 20}
397
398								{GUI_FILLER}
399
400							[/row]
401
402							[row]
403
404								{_GUI_H_SPACER 17 1}
405
406								[column]
407									vertical_alignment = "bottom"
408									horizontal_alignment = "left"
409									{_GUI_TIP_SECTION}
410								[/column]
411
412								{_GUI_H_SPACER 0 3}
413
414								[column]
415									horizontal_alignment = "right"
416									vertical_alignment = "bottom"
417									{_GUI_MENU_SECTION}
418								[/column]
419
420								{_GUI_H_SPACER 17 1}
421
422							[/row]
423
424							[row]
425								grow_factor = 1
426
427								{GUI_FILLER}
428
429								{GUI_FILLER}
430
431								{GUI_FILLER}
432
433								#{_GUI_V_SPACER 22}
434								{GUI_FILLER}
435
436								{GUI_FILLER}
437
438							[/row]
439
440						[/layer]
441
442					[/stacked_widget]
443
444				[/column]
445
446			[/row]
447
448			[row]
449
450				[column]
451					horizontal_alignment = "left"
452					vertical_alignment = "bottom"
453
454					[grid]
455
456						[row]
457
458							[column]
459								grow_factor = 0
460								[button]
461									id = "about"
462									definition = "action_about"
463									tooltip = _ "Display the game version and build information"
464								[/button]
465							[/column]
466
467							[column]
468								grow_factor = 1
469								border = "left"
470								border_size = 5
471								[label]
472									id = "revision_number"
473									definition = "default_small"
474								[/label]
475							[/column]
476
477						[/row]
478
479					[/grid]
480
481				[/column]
482
483			[/row]
484
485
486		[/grid]
487
488	[/resolution]
489
490[/window]
491
492#undef _GUI_TIP_SECTION
493#undef _GUI_MENU_SECTION
494#undef _GUI_BUTTON
495#undef _GUI_H_SPACER
496#undef _GUI_V_SPACER
497