mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-08 15:28:42 +00:00

CC: issue #4543 (N.B. This is a monolithic mega-commit because of a bunch of experimental phase changes that necessitated constant changes to both engine code and UI WML.) This redesigns the campaign selection dialog implementing a campaign-defined background image that changes depending on the selected campaign, specified by the [campaign] background= attribute; adding a menu button for selecting the RNG mechanism in use (default RNG vs. predictable RNG a.k.a. "save random seed"); and finally, adding a menu button for selecting the campaign difficulty without having to go through the campaign difficulty selection dialog. A huge amount of changes to the UI WML were required for this to say the least. This also adds the following new widget definitions: * toggle_button: listbox_header_centered, listbox_header_bg, listbox_header_centered_bg * panel: panel_listbox_bg, campaign_menu_bg As a side effect, two private methods in gui2::dialogs::campaign_selection() are no longer const-qualified. No idea why they were const-qualified in the first place, but it interferred with some of the new code in a major way.
237 lines
3.9 KiB
INI
237 lines
3.9 KiB
INI
#textdomain wesnoth-lib
|
|
###
|
|
### Definition of the default toggle button.
|
|
### Since for this class 'default' is a bit hard we now use the checkbox as default.
|
|
###
|
|
|
|
#define _GUI_TEXT HORIZONTAL_POSITION FONT_SIZE FONT_COLOR
|
|
[text]
|
|
x = {HORIZONTAL_POSITION}
|
|
y = {GUI__TEXT_VERTICALLY_CENTRED}
|
|
w = "(width)"
|
|
h = "(text_height)"
|
|
font_size = {FONT_SIZE}
|
|
color = {FONT_COLOR}
|
|
text = "(text)"
|
|
[/text]
|
|
#enddef
|
|
|
|
#define _GUI_RESOLUTION RESOLUTION WIDTH HEIGHT FONT_SIZE
|
|
#arg HORIZONTAL_POSITION
|
|
5 #endarg
|
|
|
|
[resolution]
|
|
|
|
{RESOLUTION}
|
|
|
|
min_width = {WIDTH}
|
|
min_height = {HEIGHT}
|
|
|
|
default_width = {WIDTH}
|
|
default_height = {HEIGHT}
|
|
|
|
max_width = 0
|
|
max_height = {HEIGHT}
|
|
|
|
text_extra_width = 0
|
|
text_font_size = {FONT_SIZE}
|
|
|
|
[state]
|
|
[enabled]
|
|
|
|
[draw]
|
|
|
|
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__TITLE}) }
|
|
|
|
[/draw]
|
|
|
|
[/enabled]
|
|
|
|
[disabled]
|
|
|
|
[draw]
|
|
|
|
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_DISABLED__TITLE}) }
|
|
|
|
[/draw]
|
|
|
|
[/disabled]
|
|
|
|
[focused]
|
|
|
|
[draw]
|
|
|
|
[rectangle]
|
|
x = 0
|
|
y = 0
|
|
w = "(width)"
|
|
h = "(height)"
|
|
fill_color = "255, 255, 255, 76"
|
|
[/rectangle]
|
|
|
|
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__TITLE}) }
|
|
|
|
[/draw]
|
|
|
|
[/focused]
|
|
[/state]
|
|
|
|
###
|
|
### Down
|
|
###
|
|
|
|
[state]
|
|
[enabled]
|
|
|
|
[draw]
|
|
|
|
[rectangle]
|
|
x = 0
|
|
y = 0
|
|
w = "(width)"
|
|
h = "(height)"
|
|
fill_color = "255, 255, 255, 25"
|
|
[/rectangle]
|
|
|
|
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__TITLE}) }
|
|
|
|
[image]
|
|
x = "(width - 15)"
|
|
y = "(height / 3)"
|
|
name = "buttons/sliders/slider_arrow_blue.png"
|
|
[/image]
|
|
[/draw]
|
|
|
|
[/enabled]
|
|
|
|
[disabled]
|
|
|
|
[draw]
|
|
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_DISABLED__TITLE}) }
|
|
|
|
[image]
|
|
x = "(width - 15)"
|
|
y = "(height / 3)"
|
|
name = "buttons/sliders/slider_arrow_blue.png~GS()"
|
|
[/image]
|
|
|
|
[/draw]
|
|
|
|
[/disabled]
|
|
|
|
[focused]
|
|
|
|
[draw]
|
|
|
|
[rectangle]
|
|
x = 0
|
|
y = 0
|
|
w = "(width)"
|
|
h = "(height)"
|
|
fill_color = "255, 255, 255, 76"
|
|
[/rectangle]
|
|
|
|
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__TITLE}) }
|
|
|
|
[image]
|
|
x = "(width - 15)"
|
|
y = "(height / 3)"
|
|
name = "buttons/sliders/slider_arrow_blue.png"
|
|
[/image]
|
|
|
|
[/draw]
|
|
|
|
[/focused]
|
|
[/state]
|
|
|
|
###
|
|
### Up
|
|
###
|
|
[state]
|
|
[enabled]
|
|
|
|
[draw]
|
|
|
|
[rectangle]
|
|
x = 0
|
|
y = 0
|
|
w = "(width)"
|
|
h = "(height)"
|
|
fill_color = "255, 255, 255, 25"
|
|
[/rectangle]
|
|
|
|
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__TITLE}) }
|
|
|
|
[image]
|
|
x = "(width - 15)"
|
|
y = "(height / 3)"
|
|
name = "buttons/sliders/slider_arrow_blue.png~ROTATE(180)"
|
|
[/image]
|
|
[/draw]
|
|
|
|
[/enabled]
|
|
|
|
[disabled]
|
|
|
|
[draw]
|
|
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_DISABLED__TITLE}) }
|
|
|
|
[image]
|
|
x = "(width - 15)"
|
|
y = "(height / 3)"
|
|
name = "buttons/sliders/slider_arrow_blue.png~ROTATE(180)~GS()"
|
|
[/image]
|
|
|
|
[/draw]
|
|
|
|
[/disabled]
|
|
|
|
[focused]
|
|
|
|
[draw]
|
|
|
|
[rectangle]
|
|
x = 0
|
|
y = 0
|
|
w = "(width)"
|
|
h = "(height)"
|
|
fill_color = "255, 255, 255, 76"
|
|
[/rectangle]
|
|
|
|
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__TITLE}) }
|
|
|
|
[image]
|
|
x = "(width - 15)"
|
|
y = "(height / 3)"
|
|
name = "buttons/sliders/slider_arrow_blue.png~ROTATE(180)"
|
|
[/image]
|
|
|
|
[/draw]
|
|
|
|
[/focused]
|
|
[/state]
|
|
|
|
[/resolution]
|
|
#enddef
|
|
|
|
[toggle_button_definition]
|
|
|
|
id = "listbox_header"
|
|
description = "Checkbox."
|
|
|
|
{_GUI_RESOLUTION () 30 20 ({GUI_FONT_SIZE_SMALL}) }
|
|
|
|
[/toggle_button_definition]
|
|
|
|
[toggle_button_definition]
|
|
|
|
id = "listbox_header_centered"
|
|
description = "Checkbox, centered."
|
|
|
|
{_GUI_RESOLUTION () 30 20 ({GUI_FONT_SIZE_SMALL}) HORIZONTAL_POSITION={GUI__TEXT_HORIZONTALLY_CENTRED}}
|
|
|
|
[/toggle_button_definition]
|
|
|
|
#undef _GUI_TEXT
|
|
#undef _GUI_RESOLUTION
|