Skip to content

Add "Restore to defaults" button to (de)compiler settings window#2114

Merged
colinator27 merged 4 commits intoUnderminersTeam:masterfrom
CST1229:reset-ua-settings
Apr 29, 2025
Merged

Add "Restore to defaults" button to (de)compiler settings window#2114
colinator27 merged 4 commits intoUnderminersTeam:masterfrom
CST1229:reset-ua-settings

Conversation

@CST1229
Copy link
Copy Markdown
Contributor

@CST1229 CST1229 commented Apr 29, 2025

Resolves #2112

Description

exactly what it says on the tin
image

Caveats

There's no confirmation. IDK whether there should be one or not (it should be easy to add). Also, the way it resets the settings might be a bit hacky (because I don't feel like PropertyChanged-ing), but It seems to work.

Notes

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 29, 2025

@colinator27
Copy link
Copy Markdown
Member

colinator27 commented Apr 29, 2025

Maybe the settings could be rewritten at some point, but at least right now, the Settings constructor actually changes the global instance to be itself. That meant that all settings were accidentally being reverted when clicking the button, so I've fixed the code to not use that constructor.

Other than that, I think I'm good with no confirmation for now, because it's not that many settings to change if you do accidentally click it for some reason.

@colinator27
Copy link
Copy Markdown
Member

I also just rewrote the logic so that the decompiler settings instance is reused, rather than created from scratch. Otherwise, the updated settings may not go into effect until the next time a data file is loaded.

@colinator27 colinator27 merged commit 7c0fb3f into UnderminersTeam:master Apr 29, 2025
5 checks passed
@CST1229 CST1229 deleted the reset-ua-settings branch June 27, 2025 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore to default action button for compiler/decompiler settings

2 participants