Make a sprite button display the number 0

Post Reply
User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 232
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Make a sprite button display the number 0

Post by Therenas »

Currently, a sprite button can show a number in it's bottom right corner, by setting the number attribute on the gui element. However, when setting it to 0, the button displays nothing. I propose that there should be a way for the button to display 0, as it is useful in certain scenarios.

For example, when you use the button to show the amount of an item being produced, you might want to show that there is currently 0 items being produced. If the button doesn't show a number at all, the user might be confused as to why, and might think that the number is simply missing, instead of deducing that it has to be 0. It would be much nicer if it said 0 on the button.

Now the ability to show nothing should be preserved of course. This might be resolved by passing nil as the value for the number attribute to indicate no number should be displayed (not sure if that is feasible) or by having a boolean flag such as show_number to indicate the intent of the modder.

Boodals
Fast Inserter
Fast Inserter
Posts: 129
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: Make a sprite button display the number 0

Post by Boodals »

I implemented this a while ago (I have source access), and it was accepted into the latest version of 0.17.

User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 232
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Re: Make a sprite button display the number 0

Post by Therenas »

Awesome, thanks!

Post Reply

Return to “Implemented mod requests”