Display quality overlay on a sprite and sprite-button

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
hgschmie
Inserter
Inserter
Posts: 41
Joined: Tue Feb 06, 2024 5:18 am
Contact:

Display quality overlay on a sprite and sprite-button

Post by hgschmie »

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):
Screenshot 2024-11-23 at 16.59.28.png
Screenshot 2024-11-23 at 16.59.28.png (20.92 KiB) Viewed 99 times
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?
User avatar
hgschmie
Inserter
Inserter
Posts: 41
Joined: Tue Feb 06, 2024 5:18 am
Contact:

Re: Display quality overlay on a sprite and sprite-button

Post by hgschmie »

[ 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):

Code: Select all

button.elem_tooltip = {
  type = 'item-with-quality',
  name = signal_name,
  quality = signal.signal.quality,
}
However, the icons still do not show the quality information:
Screenshot 2024-11-23 at 22.37.11.png
Screenshot 2024-11-23 at 22.37.11.png (127.29 KiB) Viewed 41 times
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.
Post Reply

Return to “Modding interface requests”