gui2: Make GUI_LINE and GUI_POINT public macros

This detaches them from the GUI2 button definition.
This commit is contained in:
Iris Morelle 2021-03-20 01:54:09 -03:00
parent 605fe2eb6b
commit 3cbe0a5ef7
2 changed files with 30 additions and 32 deletions

View file

@ -117,6 +117,22 @@
255 #endarg
"185, 158, 75, {ALPHA}" #enddef
#define GUI_LINE X1 Y1 X2 Y2 COLOR
[line]
x1 = {X1}
y1 = {Y1}
x2 = {X2}
y2 = {Y2}
thickness = 1
color = {COLOR}
[/line]
#enddef
#define GUI_POINT X Y COLOR
{GUI_LINE {X} {Y} {X} {Y} {COLOR}}
#enddef
# Draws the background for a selected cell in a listbox. For now there's one
# version for both tiny and normal gui.
#define GUI__LISTBOX_SELECTED_CELL

View file

@ -21,22 +21,6 @@
[/text]
#enddef
#define _GUI_LINE X1 Y1 X2 Y2 COLOR
[line]
x1 = {X1}
y1 = {Y1}
x2 = {X2}
y2 = {Y2}
thickness = 1
color = {COLOR}
[/line]
#enddef
#define _GUI_POINT X Y COLOR
{_GUI_LINE {X} {Y} {X} {Y} {COLOR}}
#enddef
#define _GUI_STATE BACKGROUND_IMAGE BORDER_COLOR BORDER_COLOR_DARK HIGHLIGHT_LINE_COLOR IPF
#
# Background
@ -54,37 +38,37 @@
# Dark background borders
#
{_GUI_LINE 0 1 0 "(height - 2)" "1, 10, 16, 255"}
{_GUI_LINE 2 1 "(width - 2)" 1 "1, 10, 16, 255"}
{_GUI_LINE 1 "(height - 1)" "(width - 2)" "(height - 1)" "1, 10, 16, 255"}
{_GUI_LINE "(width - 2)" 1 "(width - 2)" "(height - 1)" "1, 10, 16, 255"}
{GUI_LINE 0 1 0 "(height - 2)" "1, 10, 16, 255"}
{GUI_LINE 2 1 "(width - 2)" 1 "1, 10, 16, 255"}
{GUI_LINE 1 "(height - 1)" "(width - 2)" "(height - 1)" "1, 10, 16, 255"}
{GUI_LINE "(width - 2)" 1 "(width - 2)" "(height - 1)" "1, 10, 16, 255"}
#
# Gold colored borders
#
{_GUI_LINE 2 0 "(width - 2)" 0 {BORDER_COLOR}}
{_GUI_LINE "(width - 1)" 1 "(width - 1)" "(height - 3)" {BORDER_COLOR}}
{GUI_LINE 2 0 "(width - 2)" 0 {BORDER_COLOR}}
{GUI_LINE "(width - 1)" 1 "(width - 1)" "(height - 3)" {BORDER_COLOR}}
{_GUI_LINE 1 1 1 "(height - 3)" {BORDER_COLOR_DARK}}
{_GUI_LINE 2 "(height - 2)" "(width - 2)" "(height - 2)" {BORDER_COLOR_DARK}}
{GUI_LINE 1 1 1 "(height - 3)" {BORDER_COLOR_DARK}}
{GUI_LINE 2 "(height - 2)" "(width - 2)" "(height - 2)" {BORDER_COLOR_DARK}}
#
# Blue tint lines on the top and right
#
{_GUI_LINE 3 2 "(width - 3)" 2 {HIGHLIGHT_LINE_COLOR}}
{_GUI_LINE "(width - 3)" 2 "(width - 3)" "(height - 4)" {HIGHLIGHT_LINE_COLOR}}
{GUI_LINE 3 2 "(width - 3)" 2 {HIGHLIGHT_LINE_COLOR}}
{GUI_LINE "(width - 3)" 2 "(width - 3)" "(height - 4)" {HIGHLIGHT_LINE_COLOR}}
#
# Round the corners
#
{_GUI_POINT 2 1 {BORDER_COLOR_DARK}}
{_GUI_POINT 2 "(height - 3)" {BORDER_COLOR_DARK}}
{GUI_POINT 2 1 {BORDER_COLOR_DARK}}
{GUI_POINT 2 "(height - 3)" {BORDER_COLOR_DARK}}
{_GUI_POINT "(width - 2)" 1 {BORDER_COLOR}}
{_GUI_POINT "(width - 2)" "(height - 3)" {BORDER_COLOR}}
{GUI_POINT "(width - 2)" 1 {BORDER_COLOR}}
{GUI_POINT "(width - 2)" "(height - 3)" {BORDER_COLOR}}
#enddef
#define _GUI_RESOLUTION RESOLUTION MIN_WIDTH DEFAULT_WIDTH HEIGHT EXTRA_WIDTH EXTRA_HEIGHT FONT_SIZE IPF ALPHA
@ -330,8 +314,6 @@
[/button_definition]
#undef _GUI_BUTTON_TEXT
#undef _GUI_POINT
#undef _GUI_LINE
#undef _GUI_STATE
#undef _GUI_RESOLUTION
#undef _GUI_RESOLUTION_ICON_ONLY