#textdomain wesnoth-lib
###
### Definition of the window select which unit to attack
###

#define _GUI_BIG_ATTACKER_PANEL
[grid]
	id = "attacker"
	linked_group = "unit"

	[row]

		[column]
			border = "all"
			border_size = 5

			[image]
				id = "attacker_portrait"
			[/image]

		[/column]

		[column]
			grow_factor = 1
			horizontal_grow = "true"

			border = "all"
			border_size = 5

			[label]
				id = "attacker_name"
				definition = "alignment"
			[/label]

		[/column]

	[/row]

[/grid]
#enddef

#define _GUI_BIG_DEFENDER_PANEL
[grid]
	id = "defender"
	linked_group = "unit"

	[row]

		[column]
			grow_factor = 1
			horizontal_grow = "true"

			border = "all"
			border_size = 5

			[label]
				id = "defender_name"
				definition = "alignment"

				text_alignment = "right"
			[/label]

		[/column]

		[column]
			border = "all"
			border_size = 5

			[image]
				id = "defender_portrait"
			[/image]

		[/column]

	[/row]

[/grid]
#enddef

#define _GUI_BIG_UNIT_PANEL
[grid]

	[row]

		[column]
			{_GUI_BIG_ATTACKER_PANEL}
		[/column]

		[column]
			{_GUI_BIG_DEFENDER_PANEL}
		[/column]

	[/row]

[/grid]
#enddef

#define _GUI_BIG_WEAPON_PANEL
[grid]

	[row]

		[column]
			horizontal_grow = "true"

			[listbox]
				id = "weapon_list"
				definition = "default"

				[list_definition]

					[row]

						[column]
							vertical_grow = "true"
							horizontal_grow = "true"

							[toggle_panel]
								definition = "default"

								return_value_id = "ok"
								[grid]

									[row]

										[column]
											grow_factor = 1
											horizontal_grow = "true"

											border = "all"
											border_size = 5

											[label]
												id = "attacker_weapon"
												definition = "alignment"
												linked_group = "weapon"
											[/label]

										[/column]

										[column]
											grow_factor = 1
											horizontal_grow = "true"

											border = "all"
											border_size = 5

											[label]
												id = "defender_weapon"
												definition = "alignment"
												linked_group = "weapon"

												text_alignment = "right"
											[/label]

										[/column]

									[/row]

								[/grid]

							[/toggle_panel]

						[/column]

					[/row]

				[/list_definition]

			[/listbox]

		[/column]

	[/row]

[/grid]
#enddef

#define _GUI_BUTTON_ROW
[grid]

	[row]

		[column]
			grow_factor = 1

			border = "all"
			border_size = 5
			horizontal_alignment = "right"

			[button]
				id = "ok"
				definition = "default"

				label = _ "Attack"
			[/button]

		[/column]

		[column]
			border = "all"
			border_size = 5

			[button]
				id = "cancel"
				definition = "default"

				label = _ "Cancel"
			[/button]

		[/column]

	[/row]

[/grid]
#enddef

[window]
	id = "unit_attack"
	description = "Unit attack dialog."

	[resolution]
		definition = "default"

		automatic_placement = "true"
		vertical_placement = "center"
		horizontal_placement = "center"

		# Both unit panels are the same width.
		[linked_group]
			id = "unit"
			fixed_width = "true"
		[/linked_group]

		# All weapons share the same size, regardless whether attacker or
		# defender.
		[linked_group]
			id = "weapon"
			fixed_width = "true"
		[/linked_group]

		[tooltip]
			id = "tooltip_large"
		[/tooltip]

		[helptip]
			id = "tooltip_large"
		[/helptip]

		[grid]

			[row]

				[column]
					grow_factor = 1

					border = "all"
					border_size = 5
					horizontal_alignment = "left"
					[label]
						definition = "title"

						label = _ "Attack enemy"
					[/label]

				[/column]

			[/row]

			[row]

				[column]
					horizontal_grow = "true"
					{_GUI_BIG_UNIT_PANEL}
				[/column]

			[/row]

			[row]

				[column]
					horizontal_grow = "true"
					{_GUI_BIG_WEAPON_PANEL}
				[/column]

			[/row]

			[row]

				[column]
					horizontal_grow = "true"
					{_GUI_BUTTON_ROW}
				[/column]

			[/row]

		[/grid]

	[/resolution]

[/window]

#undef _GUI_BIG_ATTACKER_PANEL
#undef _GUI_BIG_DEFENDER_PANEL
#undef _GUI_BIG_UNIT_PANEL
#undef _GUI_BIG_WEAPON_PANEL
#undef _GUI_BUTTON_ROW

