Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving to non-mod files in Mods/ messes up the main menu #766

Open
underscoreevelyn opened this issue May 6, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@underscoreevelyn
Copy link

My mods and Everest install are up to date

Yes

I have recreated the bug with only Everest OR a minimum number of mods enabled

Yes

Describe the bug

Writing to non-mod files in Mods/, notably blacklist.txt and modoptionsorder.txt, duplicates the cursor on the main menu. This generally behaves poorly and can crash the game.

Steps to reproduce

  1. Navigate to the main menu. Other screens like the title screen and the mod options menu also work.
  2. Write to an existing file in Mods/. If saving the file would create that file, it doesn't work for some reason. You can do it multiple times to get even more cursors.
  3. Pressing confirm selects all the selected options at once, which can look weird or crash the game.

https://youtu.be/ZPZTfoG9Tls

Expected behavior

Don't do that.

Operating System

Linux

Everest Version

4771

Mods required to reproduce

No response

Additional context

log_20240506_164755.txt

@underscoreevelyn underscoreevelyn added the bug Something isn't working label May 6, 2024
@underscoreevelyn
Copy link
Author

This behavior is caused by creating two filesystem events in the same frame, which CAN happen when writing to files but doesn't ALWAYS happen. An easier way to trigger it is to just create multiple files at once, i.e. touch Mods/{a,b}.txt.

Handling two auto loads in a single frame on the main menu eventually calls OuiMainMenu.CreateButtons twice, which bugs it out and causes it to add a bunch of orphaned MenuButtons to the scene.

Please also enjoy this funny, slightly cursed one liner that fixes the problem from a mod:

On.Celeste.OuiMainMenu.CreateButtons += static (orig, self) => { orig(self); self.Scene.OnEndOfFrame += () => { foreach (var button in self.Scene.Entities.FindAll<MenuButton>()) if (!self.Buttons.Contains(button)) button.RemoveSelf(); }; };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant