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

refactor: Mod information file export #832

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Alystrasz
Copy link
Contributor

Two refactor changes here (one per commit):

  • Deduplication of enabledmods.json path (moved to header file);
  • Export of enabledmods.json creation logic into new ExportModsConfigurationToFile method (with associated documentation).

@github-actions github-actions bot added needs testing Changes from the PR still need to be tested needs code review Changes from PR still need to be reviewed in code labels Dec 2, 2024
Copy link

@NachosChipeados NachosChipeados left a comment

Choose a reason for hiding this comment

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

Works fine, playerd an entire match with no issues

@GeckoEidechse GeckoEidechse added almost ready to merge Apart from any small remaining other issues addressed by other labels, this would be ready to merge and removed needs testing Changes from the PR still need to be tested labels Dec 2, 2024
@@ -628,6 +619,28 @@ void ModManager::SearchFilesystemForMods()
std::sort(m_LoadedMods.begin(), m_LoadedMods.end(), [](Mod& a, Mod& b) { return a.LoadPriority < b.LoadPriority; });
}

void ModManager::ExportModsConfigurationToFile()
{
m_EnabledModsCfg.SetObject();
Copy link
Member

Choose a reason for hiding this comment

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

Does m_EnabledModsCfg.SetObject(); have to be set again here?

(I don't think I fully understand what that line does... ^^)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It resets the state of the m_EnabledModsCfg object (same as dict = {} in js for instance)

@GeckoEidechse
Copy link
Member

(on Holiday for a few days, maybe someone else could take care of code review to get this merged?)

Copy link

@NachosChipeados NachosChipeados left a comment

Choose a reason for hiding this comment

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

Code also looks good, manually verified there were no extra changes 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
almost ready to merge Apart from any small remaining other issues addressed by other labels, this would be ready to merge needs code review Changes from PR still need to be reviewed in code
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants