Page 1 of 1

New GUI element: select-a-signal

Posted: Thu Dec 01, 2016 4:06 am
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.

Re: New GUI element: select-a-signal

Posted: Thu Dec 01, 2016 6:31 am
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.

Re: New GUI element: select-a-signal

Posted: Thu Dec 01, 2016 8:07 pm
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.

Re: New GUI element: select-a-signal

Posted: Thu Dec 01, 2016 10:09 pm
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.

Re: New GUI element: select-a-signal

Posted: Fri Dec 02, 2016 12:23 am
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.

Re: New GUI element: select-a-signal

Posted: Fri Dec 02, 2016 12:29 am
by Nexela
That would be one of the best additions to .15!

Re: New GUI element: select-a-signal

Posted: Fri Dec 02, 2016 2:55 am
by Mooncat
We really need a FFF about all the changes on the GUI system once they are implemented. :lol: #cantwaitfortheupdate

Re: New GUI element: select-a-signal

Posted: Fri Dec 02, 2016 11:43 pm
by Earendel
+1

This would allow me to work around different issue.

Re: New GUI element: select-a-signal

Posted: Tue Jan 24, 2017 7:33 pm
by CmdrKeen
is there any update on the status of this?

Re: New GUI element: select-a-signal

Posted: Wed Feb 01, 2017 10:24 pm
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

Re: New GUI element: select-a-signal

Posted: Sat Apr 22, 2017 5:54 pm
by CmdrKeen
Apparently the feature is implemented.