This issue happens with the mod Remote view item transfer(RVIT) and some mods that add to or replace entity GUIs.
In this report i will use Project Cybersyn(CS) as a mod that adds guis as i have not been able to replicate this issue with a trivial example.
To reproduce the issue:
1. Load the save file
2. Open remote view and open the Cybernetic combinator
3. Following error occures: "Gui element with name cybersyn-combinator already present in the parent element."
The relevant information about RVIT is that whenever any entity is opened in remote view (and the player is within reach), it changes the player's controller, thereby closing the gui, and then reopens the said entity.
For illustration purposes, i've added a print statement at the very beginning of each respective event's function
As you can see, the first "opened" event fires only for RVIT, while CS has an extra "opened" event at the end
[2.0.45] on_gui_opened and on_gui_closed events fire in incorrect order
[2.0.45] on_gui_opened and on_gui_closed events fire in incorrect order
- Attachments
-
- factorio-current.log
- (9.84 KiB) Downloaded 6 times
Re: [2.0.45] on_gui_opened and on_gui_closed events fire in incorrect order
Thanks for the report however, they are. The mod code is faulty and the following is happening:
on_gui_opened happens -> the mod closes the GUI -> on_gui_closed is called -> the mod opens a GUI -> on_gui_opened happens
Except the first on_gui_opened mod code is not finished from the first entry point yet and it runs into the error.
on_gui_opened happens -> the mod closes the GUI -> on_gui_closed is called -> the mod opens a GUI -> on_gui_opened happens
Except the first on_gui_opened mod code is not finished from the first entry point yet and it runs into the error.
If you want to get ahold of me I'm almost always on Discord.
Re: [2.0.45] on_gui_opened and on_gui_closed events fire in incorrect order
Thank you for explaining it, it was very non obvious why it was happening