1#textdomain wesnoth-lib
2###
3### Definition of the window to display various possible attack results
4###
5
6#define _GUI_SPACER_ROW
7	[row]
8		grow_factor = 0
9
10		[column]
11			[spacer]
12				height = 15
13			[/spacer]
14		[/column]
15
16	[/row]
17#enddef
18
19#define _GUI_DOUBLE_SPACER_ROW
20	[row]
21		grow_factor = 0
22
23		[column]
24			[spacer]
25				height = 15
26			[/spacer]
27		[/column]
28
29		[column]
30			[spacer]
31				height = 15
32			[/spacer]
33		[/column]
34
35	[/row]
36#enddef
37
38#define _GUI_DATA_ROW _ID_PREFIX _ID _LABEL
39
40#arg _DEFINITON
41"default_small"#endarg
42
43#arg _GROW_FACTOR
440#endarg
45
46	[row]
47		grow_factor = {_GROW_FACTOR}
48
49		[column]
50			border = "left,right,top"
51			border_size = 5
52			horizontal_alignment = "left"
53
54			[label]
55				id = {_ID_PREFIX} + "_" + {_ID} + "_label"
56				definition = {_DEFINITON}
57
58				label = {_LABEL}
59
60				use_markup = true
61			[/label]
62		[/column]
63
64		[column]
65			border = "left,right,top"
66			border_size = 5
67			horizontal_alignment = "left"
68
69			[label]
70				id = {_ID_PREFIX} + "_" + {_ID}
71				definition = "default_small"
72
73				use_markup = true
74			[/label]
75		[/column]
76
77	[/row]
78#enddef
79
80#define _GUI_DATA_PANEL _ID_PREFIX
81	[grid]
82		{_GUI_DATA_ROW ({_ID_PREFIX}) "base_damage"         ( _ "Base damage")}
83		{_GUI_DATA_ROW ({_ID_PREFIX}) "resis"               ()}
84		{_GUI_DATA_ROW ({_ID_PREFIX}) "tod_modifier"        ( _ "Time of day modifier")}
85		{_GUI_DATA_ROW ({_ID_PREFIX}) "leadership_modifier" ( _ "Leadership bonus")}
86		{_GUI_DATA_ROW ({_ID_PREFIX}) "slowed_modifier"     ( _ "Slowed penalty") _GROW_FACTOR=1}
87
88		{_GUI_DOUBLE_SPACER_ROW}
89
90		{_GUI_DATA_ROW ({_ID_PREFIX}) "total_damage" ("<b>" + _ "Total damage" + "</b>") _DEFINITON="default"}
91
92		{_GUI_DOUBLE_SPACER_ROW}
93
94		{_GUI_DATA_ROW ({_ID_PREFIX}) "chance_to_hit"    ( _ "Chance to hit")}
95		{_GUI_DATA_ROW ({_ID_PREFIX}) "chance_unscathed" ( _ "Chance of being unscathed")}
96	[/grid]
97#enddef
98
99#define _GUI_HP_GRAPH _ID_PREFIX
100	[drawing]
101		id = {_ID_PREFIX} + "_hp_graph"
102		definition = "default"
103
104		width = 270
105		height = 170
106
107		[draw]
108
109			[rectangle]
110				x = 0
111				y = 0
112				w = "(width)"
113				h = "(height)"
114				fill_color = {GUI__BACKGROUND_COLOR_DISABLED}
115				border_thickness = 2
116				border_color = {GUI__FONT_COLOR_DISABLED__DEFAULT}
117			[/rectangle]
118
119			[rectangle]
120				x = "(hp_column_width)"
121				y = 0
122				w = 2
123				h = "(height - 2)"
124				fill_color = {GUI__FONT_COLOR_DISABLED__DEFAULT}
125			[/rectangle]
126
127			[rectangle]
128				x = "(width - chance_column_width - 2)"
129				y = 0
130				w = 2
131				h = "(height - 2)"
132				fill_color = {GUI__FONT_COLOR_DISABLED__DEFAULT}
133			[/rectangle]
134
135		[/draw]
136
137	[/drawing]
138#enddef
139
140#define _GUI_DATA_COLUMN _HEADER _ID_PREFIX
141	[grid]
142		linked_group = "main_column"
143
144		[row]
145			grow_factor = 0
146
147			[column]
148				border = "all"
149				border_size = 5
150				horizontal_alignment = "center"
151
152				[label]
153					label = {_HEADER}
154					definition = "default_large"
155				[/label]
156			[/column]
157
158		[/row]
159
160		[row]
161			grow_factor = 1
162
163			[column]
164				horizontal_grow = true
165				vertical_grow = true
166
167				{_GUI_DATA_PANEL ({_ID_PREFIX})}
168			[/column]
169
170		[/row]
171
172		{_GUI_SPACER_ROW}
173
174		[row]
175			grow_factor = 0
176
177			[column]
178				grow_factor = 1
179				border = "all"
180				border_size = 5
181				horizontal_alignment = "center"
182
183				[label]
184					definition = "default_small"
185					label = _ "Expected Battle Result (HP)"
186				[/label]
187			[/column]
188
189		[/row]
190
191		[row]
192			grow_factor = 0
193
194			[column]
195				grow_factor = 1
196				border = "all"
197				border_size = 5
198				horizontal_alignment = "center"
199
200				{_GUI_HP_GRAPH ({_ID_PREFIX})}
201			[/column]
202
203		[/row]
204
205	[/grid]
206#enddef
207
208[window]
209	id = "attack_predictions"
210	description = "Statistics dialog."
211
212	[resolution]
213		definition = "default"
214
215		automatic_placement = true
216		vertical_placement = "center"
217		horizontal_placement = "center"
218
219		#maximum_height = 400
220
221		[linked_group]
222			id = "main_column"
223			fixed_width = true
224		[/linked_group]
225
226		[tooltip]
227			id = "tooltip"
228		[/tooltip]
229
230		[helptip]
231			id = "tooltip"
232		[/helptip]
233
234		[grid]
235
236			[row]
237
238				[column]
239					grow_factor = 1
240
241					border = "all"
242					border_size = 5
243					horizontal_alignment = "left"
244
245					[label]
246						id = "title"
247						definition = "title"
248
249						label = _ "Damage Calculations"
250					[/label]
251
252				[/column]
253
254			[/row]
255
256			[row]
257				grow_factor = 0
258
259				[column]
260					horizontal_grow = true
261					vertical_grow = true
262
263					[grid]
264
265						[row]
266
267							[column]
268								grow_factor = 1
269								horizontal_grow = true
270								vertical_grow = true
271
272								{_GUI_DATA_COLUMN ( _ "Attacker") ("attacker")}
273							[/column]
274
275							{GUI_VERTICAL_SPACER_LINE}
276
277							[column]
278								grow_factor = 1
279								horizontal_grow = true
280								vertical_grow = true
281
282								{_GUI_DATA_COLUMN ( _ "Defender") ("defender")}
283							[/column]
284
285						[/row]
286
287					[/grid]
288
289				[/column]
290
291			[/row]
292
293
294			[row]
295				grow_factor = 0
296
297				[column]
298					border = "all"
299					border_size = 5
300					horizontal_alignment = "right"
301
302					[button]
303						id = "cancel"
304						label = _ "Close"
305					[/button]
306
307				[/column]
308
309			[/row]
310
311		[/grid]
312
313	[/resolution]
314
315[/window]
316
317#undef _GUI_SPACER_ROW
318#undef _GUI_DOUBLE_SPACER_ROW
319#undef _GUI_DATA_ROW
320#undef _GUI_DATA_COLUMN
321#undef _GUI_DATA_PANEL
322#undef _GUI_HP_GRAPH
323