New GUI element: select-a-signal

CmdrKeen
Long Handed Inserter
Long Handed Inserter
Posts: 98
Joined: Tue Sep 29, 2015 9:03 pm
Contact:

New GUI element: select-a-signal

Post by CmdrKeen »

http://lua-api.factorio.com/latest/LuaGuiElement.html

The select a signal dialog is not currently accessible to modders and I'm hoping to get that changed

The element itself would operate similar to either the sprite-button, or more preferably the button used in the combinator windows.

On clicking it, the modal dialog would appear and the gui_on_click event would be generated when the window closes.

When the window closes, the selected signal would be updated to a variable stored in the GUIelement class. If no signal was selected, the variable is not updated.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1197
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: New GUI element: select-a-signal

Post by Mooncat »

It would be better if there is GUI type "virtual-signal-slot", which will show a slot button. Users can select virtual signal after clicking the button, just like selecting signal for the combinators. This way, we modders don't need to deal with the signal selection window. But a new event may be needed for getting the selected signal, maybe on_gui_virtual_signal_selected.

Similarly, another GUI type "item-filter-slot" can also be implemented like this. 8-)

If you are looking for customized signal selection window, you can always do that by iterating game.virtual_signal_prototypes and drawing sprite button for each signal.
CmdrKeen
Long Handed Inserter
Long Handed Inserter
Posts: 98
Joined: Tue Sep 29, 2015 9:03 pm
Contact:

Re: New GUI element: select-a-signal

Post by CmdrKeen »

Mooncat wrote:It would be better if there is GUI type "virtual-signal-slot", which will show a slot button. Users can select virtual signal after clicking the button, just like selecting signal for the combinators. This way, we modders don't need to deal with the signal selection window. But a new event may be needed for getting the selected signal, maybe on_gui_virtual_signal_selected.
I imagine the data would be stored via a new variable in the GUIelement class, and raise the on_gui_clicked event after the select a signal window was closed.

I'm looking at making the window myself, but unfortunately I need to iterate items and fluids as well as virtual signals.

making the item-filter-slot accessiable in a similar fashion would also be nice.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14913
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: New GUI element: select-a-signal

Post by Rseding91 »

What I might be able to do is give access to the "choose-X" widgets we have.

Specifically we have the following dedicated widget types we use:
  • ChooseEntityButton
  • ChooseItemButton
  • ChooseSignalButton
Where each of them allows selecting one of the associated types through the normal pop-over GUI. They're used for signals, filters, and such.
If you want to get ahold of me I'm almost always on Discord.
CmdrKeen
Long Handed Inserter
Long Handed Inserter
Posts: 98
Joined: Tue Sep 29, 2015 9:03 pm
Contact:

Re: New GUI element: select-a-signal

Post by CmdrKeen »

Rseding91 wrote:What I might be able to do is give access to the "choose-X" widgets we have.

Specifically we have the following dedicated widget types we use:

ChooseEntityButton
ChooseItemButton
ChooseSignalButton


Where each of them allows selecting one of the associated types through the normal pop-over GUI. They're used for signals, filters, and such.
that would work perfectly.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: New GUI element: select-a-signal

Post by Nexela »

That would be one of the best additions to .15!
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1197
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: New GUI element: select-a-signal

Post by Mooncat »

We really need a FFF about all the changes on the GUI system once they are implemented. :lol: #cantwaitfortheupdate
User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 716
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: New GUI element: select-a-signal

Post by Earendel »

+1

This would allow me to work around different issue.
CmdrKeen
Long Handed Inserter
Long Handed Inserter
Posts: 98
Joined: Tue Sep 29, 2015 9:03 pm
Contact:

Re: New GUI element: select-a-signal

Post by CmdrKeen »

is there any update on the status of this?
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: New GUI element: select-a-signal

Post by aubergine18 »

+1 to this:
Rseding91 wrote:What I might be able to do is give access to the "choose-X" widgets we have.
  • ChooseEntityButton
  • ChooseItemButton
  • ChooseSignalButton
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
CmdrKeen
Long Handed Inserter
Long Handed Inserter
Posts: 98
Joined: Tue Sep 29, 2015 9:03 pm
Contact:

Re: New GUI element: select-a-signal

Post by CmdrKeen »

Apparently the feature is implemented.
Post Reply

Return to “Implemented mod requests”