-
-
Notifications
You must be signed in to change notification settings - Fork 990
/
button_default.cfg
223 lines (157 loc) · 4.17 KB
/
button_default.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
#textdomain wesnoth-lib
###
### Definition of the default button.
###
#define _GUI_BORDER_COLOR_ALPHA ALPHA
"162, 127, 68, {ALPHA}" #enddef
#define _GUI_BORDER_COLOR_DARK_ALPHA ALPHA
"114, 79, 46, {ALPHA}" #enddef
#define _GUI_POINT X Y COLOR
[line]
x1 = {X}
y1 = {Y}
x2 = {X}
y2 = {Y}
thickness = 1
color = {COLOR}
[/line]
#enddef
#define _GUI_STATE BACKGROUND_IMAGE BORDER_COLOR BORDER_COLOR_DARK HIGHLIGHT_LINE_COLOR IPF
[image]
w = "(width)"
h = "(height)"
name = "buttons/button_normal/{BACKGROUND_IMAGE}.png{IPF}"
[/image]
[rectangle]
x = 0
y = 0
w = "(width)"
h = "(height)"
border_thickness = 1
border_color = {BORDER_COLOR}
[/rectangle]
[rectangle]
x = 1
y = 1
w = "(width - 2)"
h = "(height - 2)"
border_thickness = 1
border_color = "1, 10, 16, 255"
[/rectangle]
#
# Darken borders along the left and bottom
#
[line]
x1 = 0
y1 = 0
x2 = 0
y2 = "(height - 1)"
thickness = 1
color = {BORDER_COLOR_DARK}
[/line]
[line]
x1 = 0
y1 = "(height - 1)"
x2 = "(width - 1)"
y2 = "(height - 1)"
thickness = 1
color = {BORDER_COLOR_DARK}
[/line]
#
# Tint lines on the top and right
#
[line]
x1 = 3
y1 = 2
x2 = "(width - 3)"
y2 = 2
thickness = 1
color = {HIGHLIGHT_LINE_COLOR}
[/line]
[line]
x1 = "(width - 3)"
y1 = 2
x2 = "(width - 3)"
y2 = "(height - 4)"
thickness = 1
color = {HIGHLIGHT_LINE_COLOR}
[/line]
#
# Round the corners
#
{_GUI_POINT 0 0 ("0, 0, 0, 0")}
{_GUI_POINT 0 "(height - 1)" ("0, 0, 0, 0")}
{_GUI_POINT "(width - 1)" 0 ("0, 0, 0, 0")}
{_GUI_POINT "(width - 1)" "(height - 1)" ("0, 0, 0, 0")}
{_GUI_POINT 1 1 {BORDER_COLOR }}
{_GUI_POINT 1 "(height - 2)" {BORDER_COLOR_DARK}}
{_GUI_POINT "(width - 2)" 1 {BORDER_COLOR }}
{_GUI_POINT "(width - 2)" "(height - 2)" {BORDER_COLOR_DARK}}
#enddef
#define _GUI_RESOLUTION RESOLUTION MIN_WIDTH DEFAULT_WIDTH HEIGHT EXTRA_WIDTH EXTRA_HEIGHT FONT_SIZE IPF ALPHA
[resolution]
{RESOLUTION}
min_width = {MIN_WIDTH}
min_height = {HEIGHT}
default_width = {DEFAULT_WIDTH}
default_height = {HEIGHT}
max_width = 0
max_height = {HEIGHT}
text_extra_width = {EXTRA_WIDTH}
text_extra_height = {EXTRA_HEIGHT}
text_font_size = {FONT_SIZE}
[state_enabled]
[draw]
{_GUI_STATE "background"
({_GUI_BORDER_COLOR_ALPHA {ALPHA}})
({_GUI_BORDER_COLOR_DARK_ALPHA {ALPHA}}) ("21, 79, 109, 255") {IPF}}
{GUI__CENTERED_TEXT ({FONT_SIZE}) () ({GUI__FONT_COLOR_ENABLED__TITLE})}
[/draw]
[/state_enabled]
[state_disabled]
[draw]
{_GUI_STATE "background"
("128, 128, 128, {ALPHA}") # Same as GUI__FONT_COLOR_DISABLED__DEFAULT, but with an alpha componant
("89, 89, 89, {ALPHA}")
("1, 10, 16, 255") "~GS(){IPF}"}
{GUI__CENTERED_TEXT ({FONT_SIZE}) () ({GUI__FONT_COLOR_DISABLED__TITLE})}
[/draw]
[/state_disabled]
[state_pressed]
[draw]
{_GUI_STATE "background-pressed"
({_GUI_BORDER_COLOR_ALPHA {ALPHA}})
({_GUI_BORDER_COLOR_DARK_ALPHA {ALPHA}}) ("1, 10, 16, 255") {IPF}}
{GUI__CENTERED_TEXT ({FONT_SIZE}) () ({GUI__FONT_COLOR_ENABLED__TITLE})}
[/draw]
[/state_pressed]
[state_focused]
[draw]
{_GUI_STATE "background-active"
({_GUI_BORDER_COLOR_ALPHA {ALPHA}})
({_GUI_BORDER_COLOR_DARK_ALPHA {ALPHA}}) ("12, 108, 157, 255") {IPF}}
{GUI__CENTERED_TEXT ({FONT_SIZE}) () ({GUI__FONT_COLOR_ENABLED__TITLE})}
[/draw]
[/state_focused]
[/resolution]
#enddef
[button_definition]
id = "default"
description = "Default button"
{_GUI_RESOLUTION () 40 112 26 13 4 ({GUI_NORMAL__FONT_SIZE__SMALL}) () 255}
[/button_definition]
[button_definition]
id = "large"
description = "Large button"
{_GUI_RESOLUTION () 40 116 30 13 4 ({GUI_NORMAL__FONT_SIZE__SMALL}) () 255}
[/button_definition]
[button_definition]
id = "transparent"
description = "Default transparent button"
{_GUI_RESOLUTION () 40 112 26 13 4 ({GUI_NORMAL__FONT_SIZE__SMALL}) "~O(65%)" 165}
[/button_definition]
#undef _GUI_BORDER_COLOR_ALPHA
#undef _GUI_BORDER_COLOR_DARK_ALPHA
#undef _GUI_POINT
#undef _GUI_STATE
#undef _GUI_RESOLUTION