I'm looking for a way to spawn a GUI piece when an entity is clicked.
Ways I thought of:
hotkey for mouse-1, and then see what is below the cursor(but I can't do that, see what is under the cursor)
create any entity that creates a GUI, detect that with player.opened and destroy the gui from the entity(but I can't do that, delete the 'chest'-gui)
anyone an idea?
entity that fires event when clicked
Re: entity that fires event when clicked
The normal way is to put an item with type="selection-tool" in your cursor. See "Test mode" mod for example.
Re: entity that fires event when clicked
You can check player.selected.matjojo wrote:hotkey for mouse-1, and then see what is below the cursor(but I can't do that, see what is under the cursor)
I do that except I bind all my custom inputs for gui to shift-E.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
Re: entity that fires event when clicked
Some examplematjojo wrote:I'm looking for a way to spawn a GUI piece when an entity is clicked.
Ways I thought of:
hotkey for mouse-1, and then see what is below the cursor(but I can't do that, see what is under the cursor)
create any entity that creates a GUI, detect that with player.opened and destroy the gui from the entity(but I can't do that, delete the 'chest'-gui)
anyone an idea?
https://mods.factorio.com/mods/devilwar ... tinguisher
Re: entity that fires event when clicked
DaveMcW wrote:The normal way is to put an item with type="selection-tool" in your cursor. See "Test mode" mod for example.
Nah, that is not it. Not a clicked item but a clicked entity. Thanks anyway.
Re: entity that fires event when clicked
That should work, thanks a lot!Adil wrote:You can check player.selected.matjojo wrote:hotkey for mouse-1, and then see what is below the cursor(but I can't do that, see what is under the cursor)
I do that except I bind all my custom inputs for gui to shift-E.
Re: entity that fires event when clicked
Nah, that is not it. This is an weapon type item, and that is not really what I'm looking for. Thanks anyway.darkfrei wrote:Some examplematjojo wrote:I'm looking for a way to spawn a GUI piece when an entity is clicked.
Ways I thought of:
hotkey for mouse-1, and then see what is below the cursor(but I can't do that, see what is under the cursor)
create any entity that creates a GUI, detect that with player.opened and destroy the gui from the entity(but I can't do that, delete the 'chest'-gui)
anyone an idea?
https://mods.factorio.com/mods/devilwar ... tinguisher