For a sprite button, I can have it overlay a number (for count), by adding a "number = 100" to the LuaGuiElement.
However, with Space Age, there are icons like this (this is the signal display from a combinator):
How do I get the quality overlay for a sprite (or a sprite button)? There is a workaround using a "choose-elem-button" which allows using "item-with-quality" and then in turn use that to display an item with the quality overlay but that can not display a number.
Is there a way to draw a sprite-button that looks like the button in the constant combinator? If not, is it possible to add some additional attributes to sprite-button (and probably also sprite) that allows for the quality overlay?
Display quality overlay on a sprite and sprite-button
Re: Display quality overlay on a sprite and sprite-button
[ replying to my own post first]
At this point, I can get the hovers over the icons to work (by using the elem_tooltip attribute):
However, the icons still do not show the quality information:
In the filter selector at the botttom, the icons have a quality marker (this is a table of choose-elem-buttons which display the quality). In the top, the elements (sprite-button) are all plain, even though the tooltips show the quality correctly (see the hover).
The question is still on how to get the quality marker on the sprite buttons.
At this point, I can get the hovers over the icons to work (by using the elem_tooltip attribute):
Code: Select all
button.elem_tooltip = {
type = 'item-with-quality',
name = signal_name,
quality = signal.signal.quality,
}
In the filter selector at the botttom, the icons have a quality marker (this is a table of choose-elem-buttons which display the quality). In the top, the elements (sprite-button) are all plain, even though the tooltips show the quality correctly (see the hover).
The question is still on how to get the quality marker on the sprite buttons.