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

clear folder if the -o folder if needed #309

Merged
merged 4 commits into from
Oct 18, 2024

Conversation

BryanAldrich
Copy link

if -o is set, and that folder isn't the current folder, then clear it (minus a few specific files).

May want to double check my logic. I believe it is right.

Also included is an additional load call to load from the .exe folder, the current/working folder and the output folder. The reason for this is so I get the templates from base Pandora, Nemsis configurations from other mods, but my ActiveMods.txt gets deployed to my custom output path.

Also, i noticed that FNIS.esp was completely deleted. I know nothing here requires it, but do other mods? or is that a huge question that would depend.

Thanks!

…nt folder, or working folder.

create the missing output directory if it does not already exist.
Copy link
Owner

@Monitor221hz Monitor221hz left a comment

Choose a reason for hiding this comment

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

Looks good, just one thing. can you change the type of the first parameter of the LoadModFolder function in EngineViewModel into a Hashset<IModInfo> and make the appropriate changes in the calling code? Would reduce the lookup time for duplicate mods as the amount of total mods increase in size.

@Monitor221hz
Copy link
Owner

After the change is made I'll merge it soon. Before this, there are a couple of critical fixes that I need to merge and test. Thank you for your work.

@BryanAldrich
Copy link
Author

The HashSet change is easy enough, have to convert it a couple lines later, however, it will mean that if there are multiple versions of the same code, then each will show in the list. Do you want only the latest version showing?

@Monitor221hz
Copy link
Owner

The HashSet change is easy enough, have to convert it a couple lines later, however, it will mean that if there are multiple versions of the same code, then each will show in the list. Do you want only the latest version showing?

No, the Equals and GetHashCode functions were implemented to ensure that different versions of the same mod will still show. The reasoning behind this is that the user will replace the mod if they want to use the latest version of the patch. It doesn't matter at this point in development anyway though, because Nemesis patches don't have a version field.

@BryanAldrich
Copy link
Author

Well, that is exactly what it will do. I wish Vortex/MO2(?) had a proper way to let you delete files as they only let you override files. Probably should handle 0-byte/blank/invalid XML files somewhere (Precision Creatures current release has 2 busted XML files in it).

Added the copy for FNIS.esp to go with your other PR.

@Monitor221hz Monitor221hz merged commit ffa8444 into Monitor221hz:main Oct 18, 2024
1 check passed
@Monitor221hz
Copy link
Owner

Monitor221hz commented Oct 18, 2024

So, I misunderstood what this code is meant to do. I assumed it was supposed to clear the output metadata ("ActiveMods.txt") files in a single run, but right now it's straight up deleting Nemesis_Engine and Pandora_Engine contents when the output argument is active, which makes the rest of the patching process throw an exception because the mod folders no longer exist. Then on the following runs, the engine does not read anything except the default mods because all the other mods have been deleted.

It also nuked my testing environment of behavior patches numbering about a hundred when I ran it. But then again, it's partly my own fault for not looking at the code closely enough.

If this is intended behavior, please take some time to look through the output code to see what files are needed. The behavior mod folders should only be getting read, because the output hkx go into a different directory on export anyway.

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.

2 participants