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

Fix disabled mods deletion requiring the game to restart #10400

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

norax0
Copy link

@norax0 norax0 commented Jan 5, 2025

If your pull request is not translation or serverlist-related, read the list of requirements below and check each box:

  • I have read the contribution guidelines.
  • I have ensured that my code compiles, if applicable.
  • I have ensured that any new features in this PR function correctly in-game, if applicable.

literally what the title says,super simple change, it kinda just works.

@norax0 norax0 changed the title Fix disabled mods deletion requiring restart Fix disabled mods deletion requiring the game to restart Jan 5, 2025
@norax0 norax0 marked this pull request as draft January 5, 2025 11:36
this time i fixed a minor code syntax related "issue", and fixed the naming of the commit.
@norax0 norax0 marked this pull request as ready for review January 5, 2025 11:38
@MEEPofFaith
Copy link
Contributor

How do you tell if the mod was previously enabled?
What if I hit the disable button and then closed the menu?

@norax0
Copy link
Author

norax0 commented Jan 5, 2025

How do you tell if the mod was previously enabled? What if I hit the disable button and then closed the menu?

To tell if it's previously enabled, I just use the mod object (which you can find [here](https://github.com/Anuken/Mindustry/blob/
f07d150/core/src/mindustry/mod/Mods.java#L1090)). If that is somehow wrong, there would be way worse problems than this one since the whole game relies on it.

And if you hit the disable button and close the menu, it just asks you to restart the game as usual...

EDIT: I think I get what you said. Let me build it and test.

EDIT2: Just tested. It force restarts your game after a popup.

EDIT3: i can technically also make it not restart the game when i,for example install mods then delete those newly installed mods, where the content is not loaded yet.

@@ -432,7 +432,11 @@ public void removeMod(LoadedMod mod){
}
mods.remove(mod);
mod.dispose();

if(mod.state != ModState.disabled){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Statement requires indentation.

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.

3 participants