Page 1 of 1

Allow setting number on choose-elem-button

Posted: Sun Nov 24, 2024 3:01 pm
by Sharparam
Currently there is no way to display a number/label on a choose-elem-button. This is needed e.g. for making a custom combinator GUI where you can select signals and they also have a count associated with them which needs to be displayed (just like a vanilla constant combinator).

Currently you can work around this issue by making your own label inside the button, but this is a hack and it's far from ideal (the text is sometimes truncated when too long for example, something that doesn't happen with vanilla GUI buttons).

(This is related to viewtopic.php?f=28&t=122689 but for the opposite case basically.)

Re: Allow setting number on choose-elem-button

Posted: Fri Apr 25, 2025 1:08 pm
by DaradBur
Seconded, this would help not having to have two distinct cases for circuit conditions.

Re: Allow setting number on choose-elem-button

Posted: Fri Apr 25, 2025 1:55 pm
by Rseding91
This is unfortunately not that simple. There is no "choose elem and number" GUI/Widget for virtually any of the elem types. So, we would need to write all of them, with tests - in order for this to become a thing. That's a ton of GUI work that someone would have to sign up for - and so far nobody has shown interest.

Re: Allow setting number on choose-elem-button

Posted: Fri Apr 25, 2025 2:28 pm
by Sharparam
Rseding91 wrote: Fri Apr 25, 2025 1:55 pm There is no "choose elem and number" GUI/Widget for virtually any of the elem types.
Is this referring to the picker dialog shown to the user when clicking the button?

Getting that functionality would be very nice as well (because currently the one used by the game itself and the one available to mod developers are different and the mod one lacks a lot of features like being able to hide virtual signals (but there's a separate thread for that).)

But I don't feel like that's a required feature if it means making the primary feature discussed in this thread be delayed indefinitely. If mods can just manually set the number to be displayed on a corner label like the base game is able to do, that will be sufficient for many usecases (and we can continue to use a separate number field for players to input the number, like we already have to do).

Surely just exposing a label like that (without the whole picker dialog rework) would be much easier to do?