Code: Select all
<style> = {
default_background = Sprite,
hovered_background = Sprite,
clicked_background = Sprite,
disabled_background = Sprite
}
Code: Select all
<style> = {
default_graphical_set = GraphicalSet,
hovered_graphical_set = GraphicalSet,
clicked_graphical_set = GraphicalSet,
disabled_graphical_set = GraphicalSet
}
Code: Select all
Sprite {
filename = ...,
width = ...,
height = ...,
x = ...,
y = ...,
priority = ...,
shift = ...,
tint = ...,
etc.
}
Code: Select all
MonolithGraphicalSet = {
type = "monolith",
monolith_image = Sprite,
etc.
I'd like to see this interface unified. In particular, I would like the following specific changes:
- Give checkbox_styles a full complement of *_graphical_set keys and capabilities.
- For compatibility, you may want to retain *_background as well, where it behaves as a monolith and takes precedence over *_graphical_set if present, at least for a few versions. Unless you don't care, then whatever.
Unifying (and documenting, officially) the interface could potentially simplify style code and could certainly cause less confusion. Also adding support for graphical sets to checkboxes gives them a lot of extra power, specifically support for "composition" lets you make check graphics independent of element size, and also share the same border graphics with your buttons, potentially reducing the number (and specificity) of graphics you may have to create for custom GUIs.
Note, however, though, that one of the major motivations for this request is to compensate for a few shortcomings elsewhere, in particular limitations to the current capabilities of buttons for displaying images that necessitate using checkboxes instead, which are too complex to list as a rationale here.
This request applies to any other GUI elements (not entity/item/etc prototype icons, those are sufficiently simple as-is) that are also currently using Sprites instead of GraphicalSets.
PS: As a bonus, give label_styles a background_graphical_set!