Skip to content

Commit

Permalink
GUI2/Toggle Panel: switched to procedural border drawing for semi-tra…
Browse files Browse the repository at this point in the history
…nsparent message variant

[ci skip]

This matches the regular toggle panel now.
  • Loading branch information
Vultraz committed Feb 23, 2018
1 parent ca4b7dc commit 894cc6a
Showing 1 changed file with 16 additions and 61 deletions.
77 changes: 16 additions & 61 deletions data/gui/widget/toggle_panel_wml_message.cfg
Expand Up @@ -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)"

[image]
x = "(width - {LINE_OFFSET_SIDE})"
y = 0
name = "dialogs/selection-border-topright.png{IPF}"
[/image]
border_thickness = 1
border_color = {GUI__BORDER_COLOR_BRIGHT ALPHA=166} # 65%

[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]
[/rectangle]

#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}
Expand Down Expand Up @@ -119,23 +74,23 @@
[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]

[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]

[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]
Expand All @@ -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]

Expand Down

0 comments on commit 894cc6a

Please sign in to comment.