GUI2/Toggle Panel: switched to procedural border drawing for semi-transparent message variant

[ci skip]

This matches the regular toggle panel now.
This commit is contained in:
Charles Dang 2018-02-23 15:45:02 +11:00
parent ca4b7dccff
commit 894cc6a3cc

View File

@ -3,76 +3,31 @@
### Definition of the toggle panel for the wml_message.
###
#define _GUI__LISTBOX_SELECTED_CELL LINE_OFFSET_SIDE LINE_OFFSET_TOTAL LINE_HEIGHT BACKGROUND_OFFSET IPF
#define _GUI__LISTBOX_SELECTED_CELL IPF
# corners are 10x10
[image]
[rectangle]
x = 0
y = 0
name = "dialogs/selection-border-topleft.png{IPF}"
[/image]
w = "(width)"
h = "(height)"
border_thickness = 1
border_color = {GUI__BORDER_COLOR_BRIGHT ALPHA=166} # 65%
[/rectangle]
[image]
x = "(width - {LINE_OFFSET_SIDE})"
y = 0
name = "dialogs/selection-border-topright.png{IPF}"
[/image]
[image]
x = 0
y = "(height - {LINE_OFFSET_SIDE})"
name = "dialogs/selection-border-botleft.png{IPF}"
[/image]
[image]
x = "(width - {LINE_OFFSET_SIDE})"
y = "(height - {LINE_OFFSET_SIDE})"
name = "dialogs/selection-border-botright.png{IPF}"
[/image]
# since the lines are already quite long scale them instead of stretching
# the height of the lines is 3 pixels.
[image]
x = {LINE_OFFSET_SIDE}
y = 0
w = "(if(width < offset, 0, width - offset) where offset = {LINE_OFFSET_TOTAL})"
name = "dialogs/selection-border-top.png{IPF}"
[/image]
[image]
x = {LINE_OFFSET_SIDE}
y = "(height - {LINE_HEIGHT})"
w = "(if(width < offset, 0, width - offset) where offset = {LINE_OFFSET_TOTAL})"
name = "dialogs/selection-border-bottom.png{IPF}"
[/image]
[image]
x = 0
y = {LINE_OFFSET_SIDE}
h = "(if(height < offset, 0, height - offset) where offset = {LINE_OFFSET_TOTAL})"
name = "dialogs/selection-border-left.png{IPF}"
[/image]
[image]
x = "(width - {LINE_HEIGHT})"
y = {LINE_OFFSET_SIDE}
h = "(if(height < offset, 0, height - offset) where offset = {LINE_OFFSET_TOTAL})"
name = "dialogs/selection-border-right.png{IPF}"
[/image]
#main background 320 x 67
[image]
x = {LINE_HEIGHT}
y = {LINE_HEIGHT}
w = "(if(width < offset, 0, width - offset) where offset = {BACKGROUND_OFFSET})"
h = "(if(height < offset, 0, height - offset) where offset = {BACKGROUND_OFFSET})"
x = 1
y = 1
w = "(width - 2)"
h = "(height - 2)"
name = "dialogs/selection-background.png{IPF}"
[/image]
#enddef
#define _GUI_RESOLUTION RESOLUTION LINE_OFFSET_SIDE LINE_OFFSET_TOTAL LINE_HEIGHT BACKGROUND_OFFSET
#define _GUI_RESOLUTION RESOLUTION
[resolution]
{RESOLUTION}
@ -119,7 +74,7 @@
[enabled]
[draw]
{_GUI__LISTBOX_SELECTED_CELL ({LINE_OFFSET_SIDE}) ({LINE_OFFSET_TOTAL}) ({LINE_HEIGHT}) ({BACKGROUND_OFFSET}) ("~O(65%)")}
{_GUI__LISTBOX_SELECTED_CELL ("~O(65%)")}
[/draw]
[/enabled]
@ -127,7 +82,7 @@
[disabled]
[draw]
{_GUI__LISTBOX_SELECTED_CELL ({LINE_OFFSET_SIDE}) ({LINE_OFFSET_TOTAL}) ({LINE_HEIGHT}) ({BACKGROUND_OFFSET}) ("~O(65%)~GS()")}
{_GUI__LISTBOX_SELECTED_CELL ("~O(65%)~GS()")}
[/draw]
[/disabled]
@ -135,7 +90,7 @@
[focused]
[draw]
{_GUI__LISTBOX_SELECTED_CELL ({LINE_OFFSET_SIDE}) ({LINE_OFFSET_TOTAL}) ({LINE_HEIGHT}) ({BACKGROUND_OFFSET}) ("~O(65%)")}
{_GUI__LISTBOX_SELECTED_CELL ("~O(65%)")}
[/draw]
[/focused]
@ -149,7 +104,7 @@
id = "wml_message"
description = "Toggle panel for the wml_message."
{_GUI_RESOLUTION () 10 20 3 6 }
{_GUI_RESOLUTION ()}
[/toggle_panel_definition]