Make "sprite-button-with-numbers" available to mod guis.

Post Reply
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Make "sprite-button-with-numbers" available to mod guis.

Post by eradicator »

In an attempt to make a gui that looks vanilla-like i noticed that the type of sprite-button that also shows numbers is not available to mods. It's the button type that's used for the inventory/production/power statistics that shows a sprite and some numbers/strings. Would be awesome if that was made available, either with built-in number conversion (i.e. "100000" becomes "100k") or preferbly with the ability to set arbitrary strings.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Make "sprite-button-with-numbers" available to mod guis.

Post by eradicator »

Any news on this?

I've since managed to somewhat mimic the slot-buttons, but i can't get the numeric label to correctly align with the bottom right corner. As soon as the player changes UI scale in the game options it disaligns because i'm using absolute width/height numbers to push the number to the bottom corner:
modded_slot_button.png
modded_slot_button.png (7.19 KiB) Viewed 1123 times
So any answers/help would be greatly appreciated. Especially if i'm just missing something/doing it wrong.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Implemented mod requests”