wesnoth/data/gui/themes/default/widgets/button_story_screen.cfg
Subhraman Sarkar 6b8c2e15e7 theme update for modern and rename themes
include new definitions and updated versions of existing definitions
"default/classic" and "modern" has been renamed to "Parchment" and "Celes" to avoid confusion
2025-01-09 09:02:42 +05:30

360 lines
7.3 KiB
INI

#textdomain wesnoth-lib
## Specialized buttons definitions used in the story screen
# Modified version of _GUI_RESOLUTION_MINIMAL that uses
# the original size of the image
#define _GUI_RESOLUTION_ORIGINAL_SIZE RESOLUTION IMAGE
[resolution]
{RESOLUTION}
#
# NOTE: there's a very weird bug where if this is not set, during very specific story screens
# (you can currently observe it in HttT), the button will be greately reduced in width. This
# effect will *only* appear on certain screens consistently, and it will go away and reappear
# when nevigating to and from that screen. This is also observed with the default button only
# if *no labe is set*. If a label is set the issue will not appear. For the default button, it
# appears as if it's being reset to min_width, but the bug will stil appear here if this value
# is set to 0. In that case, though, the observed width will not be 0. We can work around this
# by setting min values, but at some point it should be looked into.
#
# See https://github.com/wesnoth/wesnoth/pull/8510#issuecomment-2130657988
# - vultraz, 2024-05-25
#
min_width = 128
min_height = 128
default_width = 128
default_height = 128
max_width = 0
max_height = 0
[state_enabled]
[draw]
[image]
name = {IMAGE} + ".png"
[/image]
[/draw]
[/state_enabled]
[state_disabled]
[draw]
[image]
name = {IMAGE} + ".png~GS()"
[/image]
[/draw]
[/state_disabled]
[state_pressed]
[draw]
[image]
name = {IMAGE} + ".png~BLEND(255,63,0,0.7)"
[/image]
[/draw]
[/state_pressed]
[state_focused]
[draw]
[image]
name = {IMAGE} + ".png~BLEND(255,255,0,0.2)"
[/image]
[/draw]
[/state_focused]
[/resolution]
#enddef
# Modified version of _GUI_DEFINITION_MINIMAL that uses
# the original size of the image
#define _GUI_DEFINITION_ORIGINAL_SIZE ID DESCRIPTION IMAGE
[button_definition]
id = {ID}
description = {DESCRIPTION}
{_GUI_RESOLUTION_ORIGINAL_SIZE () ({IMAGE})}
[/button_definition]
#enddef
### Text helper macro, from button_default.cfg
#define _GUI_BUTTON_TEXT FONT_STYLE FONT_COLOR FONT_FAMILY
[text]
# relative positioning of text so that it doesn't overlap with the preceding image
x = "(max(iw + 5, width / 2 - text_width / 2))"
y = {GUI__TEXT_VERTICALLY_CENTRED}
w = "(text_width)"
h = "(text_height)"
font_size = 20
font_style = {FONT_STYLE}
font_family = {FONT_FAMILY}
color = "{FONT_COLOR},200"
text = "(text)"
text_markup = "(text_markup)"
outline = true
actions = "( set_var('tw', text_width) )"
# w will specify the maximum area in which the text is fit.
# This allows us to truncate that area.
maximum_width = "(width - (iw * 2) - 5)"
[/text]
#enddef
#define _GUI_BUTTON_TEXT_ONLY FONT_SIZE FONT_STYLE FONT_COLOR
[text]
# relative positioning of text so that it doesn't overlap with the preceding image
x = "(width-text_width)"
y = {GUI__TEXT_VERTICALLY_CENTRED}
w = "(text_width)"
h = "(text_height)"
font_size = {FONT_SIZE}
font_style = {FONT_STYLE}
font_family = script
color = {FONT_COLOR}
text = "(text)"
text_markup = true
outline = true
actions = "([set_var('tw', text_width), set_var('th', text_height)])"
[/text]
#enddef
# Modified version of _GUI_DEFINITION_MINIMAL that
# shows header text with decorations
# to the left and right side. Used in story_viewer.
# Uses BLEND to generate active/clicked versions
# of the images used on-the-fly.
#define _GUI_RESOLUTION_HEADER RESOLUTION ACTIVE_TINT PRESS_TINT
[resolution]
{RESOLUTION}
min_width = 250
min_height = 50
default_width = 250
default_height = 50
max_width = 0
max_height = 0
[state_enabled]
[draw]
[image]
x = 0
y = "(max((height - image_height - 2) / 2, 0))"
name = "misc/dots.png"
actions = "( [set_var('iw', image_width), set_var('iy', clip_y)] )"
[/image]
{_GUI_BUTTON_TEXT () ("215, 215, 215") ()}
[image]
x = "(width - image_width)"
y = "(max((height - image_height - 2) / 2, 0))"
name = "misc/dots.png~FL()"
[/image]
[/draw]
[/state_enabled]
[state_disabled]
[draw]
[image]
x = 0
y = "(max((height - image_height - 2) / 2, 0))"
name = "misc/dots.png"
actions = "( [set_var('iw', image_width), set_var('iy', clip_y)] )"
[/image]
{_GUI_BUTTON_TEXT () ("128, 128, 128") ()}
[image]
x = "(width - image_width)"
y = "(max((height - image_height - 2) / 2, 0))"
name = "misc/dots.png~FL()"
[/image]
[/draw]
[/state_disabled]
[state_pressed]
[draw]
[image]
x = 0
y = "(max((height - image_height - 2) / 2, 0))"
name = "misc/dots.png~BLEND({PRESS_TINT},0.7)"
actions = "( [set_var('iw', image_width), set_var('iy', clip_y)] )"
[/image]
{_GUI_BUTTON_TEXT () ({PRESS_TINT}) ()}
[image]
x = "(width - image_width)"
y = "(max((height - image_height - 2) / 2, 0))"
name = "misc/dots.png~FL()~BLEND({PRESS_TINT},0.7)"
[/image]
[/draw]
[/state_pressed]
[state_focused]
[draw]
[image]
x = 0
y = "(max((height - image_height - 2) / 2, 0))"
name = "misc/dots.png~BLEND({ACTIVE_TINT},0.4)"
actions = "( [set_var('iw', image_width), set_var('iy', clip_y)] )"
[/image]
{_GUI_BUTTON_TEXT () ({ACTIVE_TINT}) ()}
[image]
x = "(width - image_width)"
y = "(max((height - image_height - 2) / 2, 0))"
name = "misc/dots.png~FL()~BLEND({ACTIVE_TINT},0.4)"
[/image]
[/draw]
[/state_focused]
[/resolution]
#enddef
#define _GUI_RESOLUTION_TEXT_ONLY RESOLUTION ACTIVE_TINT PRESS_TINT
[resolution]
{RESOLUTION}
min_width = 128
min_height = 32
default_width = 250
default_height = 32
max_width = 0
max_height = 0
[state_enabled]
[draw]
{_GUI_BUTTON_TEXT_ONLY 22 ("italic") ("255, 255, 255, 255")}
[/draw]
[/state_enabled]
[state_disabled]
[draw]
{_GUI_BUTTON_TEXT_ONLY 22 ("italic") ("128, 128, 128, 255")}
[/draw]
[/state_disabled]
[state_pressed]
[draw]
{_GUI_BUTTON_TEXT_ONLY 22 ("italic") ("{PRESS_TINT},200")}
[/draw]
[/state_pressed]
[state_focused]
[draw]
{_GUI_BUTTON_TEXT_ONLY 22 ("italic") ("{ACTIVE_TINT},200")}
[/draw]
[/state_focused]
[/resolution]
#enddef
#define _GUI_DEFINITION_HEADER ID DESCRIPTION ACTIVE_TINT PRESS_TINT
[button_definition]
id = {ID}
description = {DESCRIPTION}
{_GUI_RESOLUTION_HEADER () ({ACTIVE_TINT}) ({PRESS_TINT})}
[/button_definition]
#enddef
#define _GUI_DEFINITION_TEXT_ONLY ID DESCRIPTION ACTIVE_TINT PRESS_TINT
[button_definition]
id = {ID}
description = {DESCRIPTION}
{_GUI_RESOLUTION_TEXT_ONLY () ({ACTIVE_TINT}) ({PRESS_TINT})}
[/button_definition]
#enddef
# Big decorated buttons for story screen
{_GUI_DEFINITION_ORIGINAL_SIZE
"right_arrow_story"
"Big right ornate arrow for story"
"misc/ornate_big_arrow_decor_right"
}
{_GUI_DEFINITION_ORIGINAL_SIZE
"left_arrow_story"
"Big right ornate arrow for story"
"misc/ornate_big_arrow_decor_left"
}
{_GUI_DEFINITION_HEADER
"header_story_skip"
"Header with decorations for story, skip button"
"150,0,0"
"200,0,0"
}
{_GUI_DEFINITION_TEXT_ONLY
"story_text"
"text only skip button"
"255,100,100"
"200,0,0"
}
#undef _GUI_DEFINITION_ORIGINAL_SIZE
#undef _GUI_DEFINITION_HEADER
#undef _GUI_RESOLUTION_ORIGINAL_SIZE
#undef _GUI_RESOLUTION_HEADER
#undef _GUI_BUTTON_TEXT