Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Value sensor settings open during a save can't be closed after loading the save. #28

Closed
narc0tiq opened this issue Sep 12, 2015 · 3 comments
Labels
Milestone

Comments

@narc0tiq
Copy link
Owner

What the title says. If you save the game with a sensor settings GUI open (e.g., the play_time sensor settings), then later load that save, you will not be able to make the sensor settings GUI go away without console hax (/c game.local_player.gui.center.[sensor_name]_settings.destroy()).

This is very unfriendly and needs to stop now.

@narc0tiq narc0tiq added the bug label Sep 12, 2015
@narc0tiq narc0tiq added this to the 0.5 milestone Sep 12, 2015
@narc0tiq
Copy link
Owner Author

The whole thing is an artifact of how the evogui.on_click table gets built up (wherein attachments are made only when the GUI is created, and obviously after loading a save with the GUI already visible, it ain't getting created anymore). I'm surprised nobody other than jocker-il has reported this yet.

The fix is to have all on_click handlers registered permanently; where this involves a sensor name it should probably be done as part of ValueSensor.new (since the parts other than the sensor name are constants).

@Afforess
Copy link
Collaborator

I looked into this issue, and it seems a bit worse than even what you describe. Right now evogui.on_cllick is a global object that has event handlers for gui elements, and these handlers, when they are currently created, are player specific. So in Multiplayer, if 2 players each open settings up, whoever opened them last will have the event handler set, and the first player is screwed.

@narc0tiq
Copy link
Owner Author

Yeah, I definitely didn't know what I was doing when I wrote the EvoGUI event handlers, and trying to keep tacking on to them has led to some real nasties. I think something more like YARM's handlers would be better -- they expect to have to figure out which player they belong to, and all the other relevant parts.

Thanks for digging into it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants