-
-
Notifications
You must be signed in to change notification settings - Fork 988
/
_initial.cfg
392 lines (309 loc) · 8.48 KB
/
_initial.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
#textdomain wesnoth-lib
#
# Contains the macros for the default widgets.
# - Global GUI macros get the GUI prefix.
# - Local (pre file) GUI macros get the _GUI prefix and should be undefined at
# the end of the file.
#
#
# Later there will also be definitions for larger screens, mainly for using the
# extra width better.
###############################################################################
### ###
### Generic macros usable for all resolutions. ###
### ###
###############################################################################
# Centers the text horizontally.
#
# If the text is too wide it returns the left side.
# Rounding happens to the left side.
#define GUI__TEXT_HORIZONTALLY_CENTRED
"(max((width - text_width) / 2, 0))" #enddef
# Centers the text vertically.
#
# If the text is too high it returns the top side.
# Rounding happens to the bottom side.
#define GUI__TEXT_VERTICALLY_CENTRED
"(max((height - text_height) / 2, 0))" #enddef
#define GUI__CENTERED_TEXT FONT_SIZE FONT_STYLE FONT_COLOR
[text]
x = {GUI__TEXT_HORIZONTALLY_CENTRED}
y = {GUI__TEXT_VERTICALLY_CENTRED}
w = "(text_width)"
h = "(text_height)"
font_size = {FONT_SIZE}
font_style = {FONT_STYLE}
color = {FONT_COLOR}
text = "(text)"
text_markup = "(text_markup)"
[/text]
#enddef
#define GUI__LEFT_TEXT FONT_SIZE FONT_STYLE FONT_COLOR
[text]
x = 5
y = {GUI__TEXT_VERTICALLY_CENTRED}
w = "(text_width)"
h = "(text_height)"
font_size = {FONT_SIZE}
font_style = {FONT_STYLE}
color = {FONT_COLOR}
text = "(text)"
text_markup = "(text_markup)"
[/text]
#enddef
# This white color is used for most texts.
#define GUI__FONT_COLOR_ENABLED__DEFAULT
#arg ALPHA
255 #endarg
"215, 215, 215, {ALPHA}" #enddef
# This gray color is used for most text when the widget is disabled.
#define GUI__FONT_COLOR_DISABLED__DEFAULT
#arg ALPHA
255 #endarg
"128, 128, 128, {ALPHA}" #enddef
#define GUI__FONT_COLOR_DISABLED_DARK__DEFAULT
#arg ALPHA
255 #endarg
"96, 96, 96, {ALPHA}" #enddef
# This gold color is used for the
# - title labels
# - button captions
# - checkbox captions
# - menu captions
#define GUI__FONT_COLOR_ENABLED__TITLE
#arg ALPHA
255#endarg
"186, 172, 125, {ALPHA}" #enddef
# This now uses the default disabled color but should be tiny bit lighter.
#define GUI__FONT_COLOR_DISABLED__TITLE
#arg ALPHA
255 #endarg
{GUI__FONT_COLOR_DISABLED__DEFAULT ALPHA={ALPHA}} #enddef
# This color is used as background in the listbox.
#define GUI__BACKGROUND_COLOR_ENABLED
#arg ALPHA
89 #endarg
"0, 0, 0, {ALPHA}" #enddef
#define GUI__BACKGROUND_COLOR_DISABLED
#arg ALPHA
64 #endarg
"64, 64, 64, {ALPHA}" #enddef
#define GUI__BORDER_COLOR_DARK
#arg ALPHA
255 #endarg
"114, 79, 46, {ALPHA}" #enddef
#define GUI__BORDER_COLOR
#arg ALPHA
255 #endarg
"162, 127, 68, {ALPHA}" #enddef
#define GUI__BORDER_COLOR_BRIGHT
#arg ALPHA
255 #endarg
"185, 158, 75, {ALPHA}" #enddef
# Draws the background for a selected cell in a listbox. For now there's one
# version for both tiny and normal gui.
#define GUI__LISTBOX_SELECTED_CELL
[rectangle]
x = 0
y = 0
w = "(width)"
h = "(height)"
border_thickness = 1
border_color = {GUI__BORDER_COLOR_BRIGHT}
[/rectangle]
[image]
x = 1
y = 1
w = "(width - 2)"
h = "(height - 2)"
name = "dialogs/selection-background.png"
[/image]
#enddef
# Forces a widget to be of a certain size.
# Depending of the flags of the parent widget the item will grow
#
# WIDTH Minimum width for the widget.
# HEIGHT Minimum height for the widget.
# WIDGET The widget to add into the item.
#
# eg instead of
# [label]
# # Note Foo has trailing spaces to force extra width.
# label = "
# Foo
# "
# [label]
# you can do:
#
# {GUI_FORCE_WIDGET_MINIMUM_SIZE 150 75 (
# [label]
# label = "Foo"
# [label]
# )}
#
#define GUI_FORCE_WIDGET_MINIMUM_SIZE WIDTH HEIGHT WIDGET
[stacked_widget]
definition = "default"
[layer]
[row]
grow_factor = 1
[column]
grow_factor = 1
horizontal_grow = true
vertical_grow = true
[spacer]
definition = "default"
width = "{WIDTH}"
height = "{HEIGHT}"
[/spacer]
[/column]
[/row]
[/layer]
[layer]
[row]
grow_factor = 1
[column]
grow_factor = 1
horizontal_grow = true
vertical_grow = true
{WIDGET}
[/column]
[/row]
[/layer]
[/stacked_widget]
#enddef
# Forces a widget to be of a certain size and blocks it from growing.
#
# WIDTH Width for the widget.
# HEIGHT Height for the widget.
# WIDGET The widget to add to the item.
#
#define GUI_FORCE_WIDGET_SIZE WIDTH HEIGHT WIDGET
[size_lock]
definition = "default"
width = "{WIDTH}"
height = "{HEIGHT}"
[widget]
{WIDGET}
[/widget]
[/size_lock]
#enddef
#define GUI_WINDOW_FULLSCREEN
automatic_placement = false
x = 0
y = 0
width = "(screen_width)"
height = "(screen_height)"
#enddef
#define GUI_WINDOW_FIXED_SIZE_CENTERED WIDTH HEIGHT
automatic_placement = false
width = "(min(screen_width, {WIDTH}))"
height = "(min(screen_height, {HEIGHT}))"
x = "(floor((screen_width - window_width) / 2))"
y = "(floor((screen_height - window_height) / 2))"
#enddef
#define GUI_CENTERED_IMAGE
x = "(max(pos, 0) where pos = floor((width - image_width) / 2))"
y = "(max(pos, 0) where pos = floor((height - image_height) / 2))"
w = "(min(width, image_original_width))"
h = "(min(height, image_original_height))"
#enddef
#define GUI_HORIZONTAL_SPACER_LINE
[row]
grow_factor = 0
[column]
grow_factor = 1
border = "all"
border_size = 10
horizontal_grow = true
[drawing]
definition = "default"
width = (width)
height = 1
[draw]
[line]
x1 = 0
y1 = 0
x2 = (width - 1)
y2 = 0
color = {GUI__BORDER_COLOR_DARK}
thickness = 1
[/line]
[/draw]
[/drawing]
[/column]
[/row]
#enddef
#define GUI_VERTICAL_SPACER_LINE
[column]
border = "all"
border_size = 10
vertical_grow = true
[drawing]
definition = "default"
width = 1
height = (height)
[draw]
[line]
x1 = 0
y1 = 1
x2 = 0
y2 = (height - 1)
color = {GUI__BORDER_COLOR_DARK}
thickness = 1
[/line]
[/draw]
[/drawing]
[/column]
#enddef
#define DEFAULT_BLUR
[pre_commit]
[blur]
depth = 5
[/blur]
[/pre_commit]
#enddef
#define FILTER_TEXT_BOX_HINT
hint_text = _ "Search"
hint_image = "icons/action/zoomdefault_25.png~FL(horiz)"
#enddef
# The following is a more-or-less arbitrary resolution, larger than 1024x768
# in both dimensions, at which to switch over from the traditional
# everything-is-fixed-size layout to one that scales proportionally to
# the screen_pitch_microns.
#define GUI_BIG_RESOLUTION
window_width = 1200
window_height = 900
#enddef
# The magic number 265 in the below formula is the pixel pitch in microns
# corresponding to 96 dpi, which the old layout seems to have been based on.
# The extra factor of 2/3 in the formula is a fudge factor based on the guess
# that the old fonts took up approximately 1.5 pixels per point size at 96
# dpi. It came out looking pretty decent on my 90-micron monitor.
#define GUI_SCALE_RESOLUTION SIZE
(max({SIZE}, floor({SIZE} * 265 * 2 / (3 * screen_pitch_microns))))
#enddef
#define GUI_WINDOW_PERC_FIXED_SIZE_CENTERED PERC_W PERC_H WIDTH HEIGHT
automatic_placement = false
width = "(max(min(screen_width, {WIDTH} ), min(screen_width * {PERC_W} / 100, {GUI_SCALE_RESOLUTION {WIDTH} })))"
height = "(max(min(screen_height, {HEIGHT}), min(screen_height * {PERC_H} / 100, {GUI_SCALE_RESOLUTION {HEIGHT}})))"
x = "(floor((screen_width - window_width) / 2))"
y = "(floor((screen_height - window_height) / 2))"
#enddef
###############################################################################
### ###
### Macros for the normal gui. ###
### ###
###############################################################################
#define GUI_FONT_SIZE_TINY
13 #enddef
#define GUI_FONT_SIZE_SMALL
15 #enddef
#define GUI_FONT_SIZE_DEFAULT
17 #enddef
#define GUI_FONT_SIZE_LARGE
20 #enddef
#define GUI_FONT_SIZE_TITLE
22 #enddef
#define GUI_FONT_SIZE_HUGE
36 #enddef