Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pandafluff #3

Open
wants to merge 3 commits into
base: pandafluff
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions data/gui/default/widget/button_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
[draw]

[image]
w = "(width)"
h = "(height)"
x = 3
y = 2
w = "(width - 6)"
h = "(height - 4)"
name = "buttons/{BASE_NAME}.png"
[/image]

Expand All @@ -42,8 +44,10 @@
[draw]

[image]
w = "(width)"
h = "(height)"
x = 3
y = 2
w = "(width - 6)"
h = "(height - 4)"
name = "buttons/{BASE_NAME}-disabled.png"
[/image]

Expand All @@ -58,8 +62,10 @@
[draw]

[image]
w = "(width)"
h = "(height)"
x = 3
y = 2
w = "(width - 6)"
h = "(height - 4)"
name = "buttons/{BASE_NAME}-pressed.png"
[/image]

Expand All @@ -74,8 +80,10 @@
[draw]

[image]
w = "(width)"
h = "(height)"
x = 3
y = 2
w = "(width - 6)"
h = "(height - 4)"
name = "buttons/{BASE_NAME}-active.png"
[/image]

Expand All @@ -91,23 +99,21 @@
[button_definition]

id = "default"
description = "Default button"
description = "Touch button"

# Tiny gui sizes haven't been tested yet so might need some tuning.
{_GUI_RESOLUTION ({GUI_TINY__RESOLUTION}) 20 54 11 6 2 ({GUI_TINY__FONT_SIZE__SMALL}) "button" }
{_GUI_RESOLUTION () 40 108 22 13 4 ({GUI_NORMAL__FONT_SIZE__SMALL}) "button" }
{_GUI_RESOLUTION () 114 114 44 0 22 ({GUI_NORMAL__FONT_SIZE__DEFAULT}) "button" }

[/button_definition]

[button_definition]

id = "transparent"
description = "Default transparent button"
description = "Touch transparent button"

# Tiny gui sizes haven't been tested yet so might need some tuning.
{_GUI_RESOLUTION ({GUI_TINY__RESOLUTION}) 20 54 11 6 2 ({GUI_TINY__FONT_SIZE__SMALL}) "button_transparent" }
{_GUI_RESOLUTION () 40 108 22 13 4 ({GUI_NORMAL__FONT_SIZE__SMALL}) "button_transparent" }
{_GUI_RESOLUTION () 114 114 44 0 22 ({GUI_NORMAL__FONT_SIZE__DEFAULT}) "button_transparent" }

[/button_definition]

#undef _GUI_RESOLUTION
#undef _GUI_RESOLUTION
152 changes: 152 additions & 0 deletions data/gui/default/widget/button_touch.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
#textdomain wesnoth-lib
###
### Definition of the default button.
###

#define _GUI_BUTTON_TEXT FONT_SIZE FONT_STYLE FONT_COLOR
[text]
x = {GUI__TEXT_HORIZONTALLY_CENTRED}
y = {GUI__TEXT_VERTICALLY_CENTRED}
w = "(text_width)"
h = "(text_height)"
font_size = {FONT_SIZE}
font_style = {FONT_STYLE}
colour = {FONT_COLOR}
text = "(text)"
[/text]
#enddef

#define _GUI_BUTTON_PRESSED_TEXT FONT_SIZE FONT_STYLE FONT_COLOR
[text]
x = "(if(text_width < width, ((width - text_width ) / 2) + 1, 0))"
y = "(if(text_height < height, ((height - text_height + 1) / 2) + 1, 0))"
w = "(text_width)"
h = "(text_height)"
font_size = {FONT_SIZE}
font_style = {FONT_STYLE}
colour = {FONT_COLOR}
text = "(text)"
[/text]
#enddef


#define _GUI_RESOLUTION RESOLUTION MIN_WIDTH DEFAULT_WIDTH HEIGHT EXTRA_WIDTH EXTRA_HEIGHT FONT_SIZE BASE_NAME
[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]

[image]
x = 3
y = 2
w = "(width - 6)"
h = "(height - 4)"
name = "buttons/{BASE_NAME}.png"
[/image]

{_GUI_BUTTON_TEXT ({FONT_SIZE}) () ({GUI__FONT_COLOR_ENABLED__TITLE})}

[/draw]

[/state_enabled]

[state_disabled]

[draw]

[image]
x = 3
y = 2
w = "(width - 6)"
h = "(height - 4)"
name = "buttons/{BASE_NAME}-disabled.png"
[/image]

{GUI__CENTERED_TEXT ({FONT_SIZE}) () ({GUI__FONT_COLOR_DISABLED__TITLE})}
[/draw]

[/state_disabled]

[state_pressed]

[draw]

[image]
x = 3
y = 2
w = "(width - 6)"
h = "(height - 4)"
name = "buttons/{BASE_NAME}-pressed.png"
[/image]

{_GUI_BUTTON_PRESSED_TEXT ({FONT_SIZE}) () ({GUI__FONT_COLOR_ENABLED__TITLE})}

[/draw]

[/state_pressed]

[state_focussed]

[draw]

[image]
x = 3
y = 2
w = "(width - 6)"
h = "(height - 4)"
name = "buttons/{BASE_NAME}-active.png"
[/image]

{GUI__CENTERED_TEXT ({FONT_SIZE}) () ({GUI__FONT_COLOR_ENABLED__TITLE})}

[/draw]

[/state_focussed]

[/resolution]
#enddef

[button_definition]
id = "touch_fixed"
description = "Touch button"
{_GUI_RESOLUTION () 114 114 44 0 0 ({GUI_NORMAL__FONT_SIZE__DEFAULT}) "button" }
[/button_definition]

[button_definition]
id = "touch_transparent_fixed"
description = "Touch transparent button"
{_GUI_RESOLUTION () 114 114 44 0 0 ({GUI_NORMAL__FONT_SIZE__DEFAULT}) "button_transparent" }
[/button_definition]

[button_definition]
id = "touch"
description = "Touch button"

{_GUI_RESOLUTION () 114 114 44 50 0 ({GUI_NORMAL__FONT_SIZE__DEFAULT}) "button" }
[/button_definition]

[button_definition]

id = "touch_transparent"
description = "Touch transparent button"
{_GUI_RESOLUTION () 114 114 44 50 0 ({GUI_NORMAL__FONT_SIZE__DEFAULT}) "button_transparent" }

[/button_definition]

#undef _GUI_RESOLUTION
6 changes: 3 additions & 3 deletions data/gui/default/window/game_load.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@
[/row]

[row]
grow_factor = 0
grow_factor = 1

[column]
grow_factor = 1
Expand All @@ -432,7 +432,7 @@

[button]
id = "ok"
definition = "default"
definition = "touch"

size_text = _ "OK"
label = _ "OK"
Expand All @@ -446,7 +446,7 @@

[button]
id = "cancel"
definition = "default"
definition = "touch"

label = _ "Cancel"
[/button]
Expand Down
2 changes: 1 addition & 1 deletion data/gui/default/window/title_screen.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@

[column]
border = "all"
border_size = 5
border_size = 0
horizontal_grow = "true"
[button]
id = {ID}
Expand Down
Loading