mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-11 16:57:43 +00:00
290 lines
6.3 KiB
INI
290 lines
6.3 KiB
INI
#
|
|
# 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.
|
|
#
|
|
#
|
|
# For now only TINY and NORMAL gui will be defined, once this works SMALL gui
|
|
# will be added, need to see which parts need to change for that. 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
|
|
"(if(text_width < width, (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.
|
|
#
|
|
# NOTE the extra bug in the formula system.
|
|
#define GUI__TEXT_VERTICALALLY_CENTRED
|
|
"(if(text_height < height, ((height - text_height) + 1) / 2, 0))"
|
|
#enddef
|
|
|
|
#define GUI__CENTERED_TEXT FONT_SIZE FONT_STYLE FONT_COLOUR
|
|
[text]
|
|
x = {GUI__TEXT_HORIZONTALLY_CENTRED}
|
|
y = {GUI__TEXT_VERTICALALLY_CENTRED}
|
|
w = "(text_width)"
|
|
h = "(text_height)"
|
|
font_size = {FONT_SIZE}
|
|
font_style = {FONT_STYLE}
|
|
colour = {FONT_COLOUR}
|
|
text = "(text)"
|
|
[/text]
|
|
#enddef
|
|
|
|
# This white colour is used for most texts.
|
|
#define GUI__FONT_COLOUR_ENABLED__DEFAULT
|
|
"221, 221, 221, 255"
|
|
#enddef
|
|
|
|
# This gray colour is used for most text when the widget is disabled.
|
|
#define GUI__FONT_COLOUR_DISABLED__DEFAULT
|
|
"128, 128, 128, 0"
|
|
#enddef
|
|
|
|
# This gold colour is used for the
|
|
# - title labels
|
|
# - button captions
|
|
# - checkbox captions
|
|
# - menu captions
|
|
#define GUI__FONT_COLOUR_ENABLED__TITLE
|
|
"188, 176, 136, 255"
|
|
#enddef
|
|
|
|
# This now uses the default disabled colour but should be tiny bit lighter.
|
|
#define GUI__FONT_COLOUR_DISABLED__TITLE
|
|
{GUI__FONT_COLOUR_DISABLED__DEFAULT}
|
|
#enddef
|
|
|
|
###############################################################################
|
|
### ###
|
|
### Macros for the tiny gui. ###
|
|
### ###
|
|
###############################################################################
|
|
|
|
#define GUI_TINY__RESOLUTION
|
|
window_width = 640
|
|
window_height = 480
|
|
#enddef
|
|
|
|
#define GUI_TINY__FONT_SIZE__SMALL
|
|
9
|
|
#enddef
|
|
|
|
#define GUI_TINY__FONT_SIZE__DEFAULT
|
|
10
|
|
#enddef
|
|
|
|
#define GUI_TINY__FONT_SIZE__LARGE
|
|
11
|
|
#enddef
|
|
|
|
#define GUI_TINY__FONT_SIZE__TITLE
|
|
11
|
|
#enddef
|
|
|
|
###############################################################################
|
|
### ###
|
|
### Macros for the normal gui. ###
|
|
### ###
|
|
###############################################################################
|
|
|
|
#define GUI_NORMAL__RESOLUTION
|
|
window_width = 0
|
|
window_height = 0
|
|
#enddef
|
|
|
|
#define GUI_NORMAL__FONT_SIZE__SMALL
|
|
12
|
|
#enddef
|
|
|
|
#define GUI_NORMAL__FONT_SIZE__DEFAULT
|
|
13
|
|
#enddef
|
|
|
|
#define GUI_NORMAL__FONT_SIZE__LARGE
|
|
18
|
|
#enddef
|
|
|
|
#define GUI_NORMAL__FONT_SIZE__TITLE
|
|
18
|
|
#enddef
|
|
|
|
###############################################################################
|
|
### ###
|
|
### Old test code should be deleted when no longer needed. ###
|
|
### ###
|
|
###############################################################################
|
|
|
|
#
|
|
#
|
|
##### Default settings
|
|
#
|
|
#
|
|
|
|
# normal colour "221, 221, 221, 255"
|
|
# label colour "107, 140, 255, 255"
|
|
#define FONT_COLOUR_ENABLED
|
|
"221, 221, 221, 255"
|
|
#enddef
|
|
|
|
#define FONT_COLOUR_DISABLED
|
|
"128, 128, 128, 0"
|
|
#enddef
|
|
|
|
|
|
#
|
|
#
|
|
#### settings per resolution
|
|
#
|
|
#
|
|
|
|
|
|
# Definition of the upper border of tiny-gui
|
|
#define RESOLUTION_TINY
|
|
window_width = 640
|
|
window_height = 480
|
|
#enddef
|
|
|
|
#define FONT_SIZE_TINY__SMALL
|
|
9
|
|
#enddef
|
|
|
|
#define FONT_SIZE_TINY__NORMAL
|
|
10
|
|
#enddef
|
|
|
|
#define FONT_SIZE_TINY__BIG
|
|
11
|
|
#enddef
|
|
|
|
# Definition of the upper border of small-gui
|
|
#define RESOLUTION_SMALL
|
|
window_width = 800
|
|
window_height = 480
|
|
#enddef
|
|
|
|
# Definition of the upper border of the normal gui
|
|
#define RESOLUTION_NORMAL
|
|
window_width = 1024
|
|
window_height = 768
|
|
#enddef
|
|
|
|
#define FONT_SIZE_NORMAL__SMALL
|
|
12
|
|
#enddef
|
|
|
|
#define FONT_SIZE_NORMAL__NORMAL
|
|
14
|
|
#enddef
|
|
|
|
# font used for the titles
|
|
#define FONT_SIZE_NORMAL__TITLE
|
|
18
|
|
#enddef
|
|
|
|
#define FONT_STYLE_NORMAL__TITLE
|
|
"bold"
|
|
#enddef
|
|
|
|
#define FONT_COLOUR_TITLE
|
|
"188, 176, 136, 255"
|
|
#enddef
|
|
|
|
#define FONT_SIZE_NORMAL__BIG
|
|
18
|
|
#enddef
|
|
|
|
# Definition of the upper border of the big gui
|
|
#define RESOLUTION_BIG
|
|
window_width = 1680
|
|
window_height = 1050
|
|
#enddef
|
|
|
|
# for guis bigger as big fall back to the default of 0 0
|
|
|
|
#
|
|
#
|
|
# Other helper macros
|
|
#
|
|
#
|
|
|
|
#define OUTER_RECT COLOUR_1 COLOUR_2
|
|
[line]
|
|
x1 = 0
|
|
y1 = 0
|
|
x2 = "(width - 1)"
|
|
y2 = 0
|
|
colour = {COLOUR_1}
|
|
thickness = 1
|
|
[/line]
|
|
|
|
[line]
|
|
x1 = "(width - 1)"
|
|
y1 = 0
|
|
x2 = "(width - 1)"
|
|
y2 = "(height - 1)"
|
|
colour = {COLOUR_1}
|
|
thickness = 1
|
|
[/line]
|
|
|
|
[line]
|
|
x1 = "(width - 1)"
|
|
y1 = "(height - 1)"
|
|
x2 = 0
|
|
y2 = "(height - 1)"
|
|
colour = {COLOUR_2}
|
|
thickness = 1
|
|
[/line]
|
|
|
|
[line]
|
|
x1 = 0
|
|
y1 = "(height - 1)"
|
|
x2 = 0
|
|
y2 = 0
|
|
colour = {COLOUR_2}
|
|
thickness = 1
|
|
[/line]
|
|
|
|
#enddef
|
|
|
|
# Make sure that if the text is to wide we don't get a negative
|
|
# number of huge positive number.
|
|
#define TEXT_H_CENTRE
|
|
"(if(text_width <= width, (width - text_width ) / 2, 0))"
|
|
#enddef
|
|
|
|
# Make sure that if the text is to wide we don't get a negative
|
|
# number of huge positive number.
|
|
#define TEXT_V_CENTRE
|
|
"(if(text_height <= height, (height - text_height) / 2, 0))"
|
|
#enddef
|
|
|
|
#define TEXT_DEFAULT_NORMAL
|
|
[text]
|
|
x = {TEXT_H_CENTRE}
|
|
y = {TEXT_V_CENTRE}
|
|
w = "(text_width)"
|
|
h = "(text_height)"
|
|
font_size = {FONT_SIZE_NORMAL__NORMAL}
|
|
colour = {FONT_COLOUR_ENABLED}
|
|
text = "(text)"
|
|
[/text]
|
|
#enddef
|