mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-28 05:25:07 +00:00

This is mainly about shifting WML macro inclusions into a where clause, especially when they appear multiple times in a specific formula.
149 lines
2.8 KiB
INI
149 lines
2.8 KiB
INI
#textdomain wesnoth-lib
|
|
###
|
|
### Definition of a slider.
|
|
###
|
|
|
|
#define _GUI_STATE IMAGE_SUFFIX GROOVE_SELECTED_COLOR GROOVE_UNSELECTED_COLOR TEXT_COLOR RIGHT_OFFSET FONT_SIZE
|
|
[draw]
|
|
|
|
#
|
|
# Groove
|
|
#
|
|
|
|
[line]
|
|
x1 = 0
|
|
y1 = "(height / 2)"
|
|
x2 = "(positioner_offset - 1)"
|
|
y2 = "(height / 2)"
|
|
|
|
color = {GROOVE_SELECTED_COLOR}
|
|
thickness = 1
|
|
[/line]
|
|
|
|
[line]
|
|
x1 = "(positioner_offset)"
|
|
y1 = "(height / 2)"
|
|
x2 = "(width - right_offset + 1 where right_offset = {RIGHT_OFFSET})"
|
|
y2 = "(height / 2)"
|
|
|
|
color = {GROOVE_UNSELECTED_COLOR}
|
|
thickness = 1
|
|
[/line]
|
|
|
|
#
|
|
# Text
|
|
#
|
|
|
|
[text]
|
|
x = "(width - right_offset + 7 where right_offset = {RIGHT_OFFSET})"
|
|
y = {GUI__TEXT_VERTICALLY_CENTRED}
|
|
w = "{RIGHT_OFFSET}"
|
|
h = "(height)"
|
|
|
|
font_size = {FONT_SIZE}
|
|
color = {TEXT_COLOR}
|
|
text = "(text)"
|
|
[/text]
|
|
|
|
#
|
|
# Slider
|
|
#
|
|
|
|
[image]
|
|
x = "(positioner_offset)"
|
|
y = "(if (image_height < height, (height - image_height) / 2, 0))"
|
|
name = "buttons/sliders/slider{IMAGE_SUFFIX}"
|
|
[/image]
|
|
|
|
[/draw]
|
|
#enddef
|
|
|
|
#define _GUI_RESOLUTION RESOLUTION MIN_WIDTH DEFAULT_WIDTH HEIGHT POSITIONER_LENGTH RIGHT_OFFSET FONT_SIZE
|
|
|
|
[resolution]
|
|
|
|
{RESOLUTION}
|
|
|
|
min_width = {MIN_WIDTH}
|
|
min_height = {HEIGHT}
|
|
|
|
default_width = {DEFAULT_WIDTH}
|
|
default_height = {HEIGHT}
|
|
|
|
max_width = 0
|
|
max_height = {HEIGHT}
|
|
|
|
minimum_positioner_length = {POSITIONER_LENGTH}
|
|
maximum_positioner_length = {POSITIONER_LENGTH}
|
|
|
|
left_offset = 0
|
|
right_offset = {RIGHT_OFFSET}
|
|
|
|
text_font_size = {FONT_SIZE}
|
|
|
|
[state_enabled]
|
|
{_GUI_STATE
|
|
".png"
|
|
({GUI__BORDER_COLOR})
|
|
({GUI__BORDER_COLOR_DARK})
|
|
({GUI__FONT_COLOR_ENABLED__DEFAULT})
|
|
({RIGHT_OFFSET})
|
|
({FONT_SIZE})
|
|
}
|
|
[/state_enabled]
|
|
|
|
[state_disabled]
|
|
{_GUI_STATE
|
|
".png~GS()"
|
|
({GUI__FONT_COLOR_DISABLED__DEFAULT})
|
|
({GUI__FONT_COLOR_DISABLED_DARK__DEFAULT})
|
|
({GUI__FONT_COLOR_DISABLED__DEFAULT})
|
|
({RIGHT_OFFSET})
|
|
({FONT_SIZE})
|
|
}
|
|
[/state_disabled]
|
|
|
|
[state_pressed]
|
|
{_GUI_STATE
|
|
"-pressed.png"
|
|
({GUI__BORDER_COLOR})
|
|
({GUI__BORDER_COLOR_DARK})
|
|
({GUI__FONT_COLOR_ENABLED__DEFAULT})
|
|
({RIGHT_OFFSET})
|
|
({FONT_SIZE})
|
|
}
|
|
[/state_pressed]
|
|
|
|
[state_focused]
|
|
{_GUI_STATE
|
|
"-active.png"
|
|
({GUI__BORDER_COLOR})
|
|
({GUI__BORDER_COLOR_DARK})
|
|
({GUI__FONT_COLOR_ENABLED__DEFAULT})
|
|
({RIGHT_OFFSET})
|
|
({FONT_SIZE})
|
|
}
|
|
[/state_focused]
|
|
|
|
[/resolution]
|
|
#enddef
|
|
|
|
[slider_definition]
|
|
id = "default"
|
|
description = "A slider with it's value on the right hand side."
|
|
|
|
{_GUI_RESOLUTION () 150 250 22 16 50 ({GUI_FONT_SIZE_DEFAULT}) }
|
|
|
|
[/slider_definition]
|
|
|
|
[slider_definition]
|
|
id = "short"
|
|
description = "A slider with it's value on the right hand side."
|
|
|
|
{_GUI_RESOLUTION () 50 150 22 16 50 ({GUI_FONT_SIZE_SMALL}) }
|
|
|
|
[/slider_definition]
|
|
|
|
#undef _GUI_STATE
|
|
#undef _GUI_RESOLUTION
|