Skip to content

Commit

Permalink
Catch SaveConfig errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheep-y committed May 10, 2020
1 parent f0374c6 commit aafe9d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
9 changes: 6 additions & 3 deletions MainGUI/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,19 @@ private void LoadSettings () {

internal LoaderSettings Settings => ModBridge.GetSettings();

internal void SaveSettings () {
internal void SaveSettings () { try {
ModBridge.SaveSettings();
}
} catch ( Exception ex ) {
GUI.Prompt( AppAction.NONE, PromptFlag.ERROR,
new ApplicationException( "Cannot save settings. Check Anti-virus and make sure Mods folder is writable.", ex ) );
} }

internal void SetLogLevel ( SourceLevels level ) {
var settings = Settings;
if ( settings.LogLevel == level ) return;
ModLoader.SetLogLevel( level );
settings.LogLevel = level;
ModBridge.SaveSettings();
SaveSettings();
}

// Parse command line arguments.
Expand Down
9 changes: 5 additions & 4 deletions MainGUI/Resources/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ Modnix Changelog
* Fix: mod_info with Version field are now parsed correctly.
* Fix: A mod's requirement(s) on itself are now ignored.
* Fix: LoadIndex and LogLevel may be overrode together in modnix config, instead of index over level.
* Fix: Config write error now popup a prompt, instead of crashing mod manager.
* Mod: "assemblies" api now returns null when mod is not found.
* Mod: api( "assemblies", "modnix" ) no longer returns ppml assembly.
* Mod: Loader log now tries to capture game crashs originating from the scope of CLR.
* Mod: Loader log now warns on unresolved assemblies.
* Mod: Loader now logs mscorlib version and end of phases at verbose level.
* Mod: Requires and Disables are now resolved together in each resolve loop, instead of only Requires.
* Mod: Multiple requires on the same mod are now processed as "or" instead of "and".
* Mod: Flags and Actions in mod_info (intended for Modnix 3) now trigger a notice in Manager and log.
* Mod: A mod that try to mod_info.Disables itself now triggers a warning, same for Avoids/Requires.
* Log: A mod that try to disable itself by mod_info now triggers a warning.
* Log: Loader log now tries to capture game crashs originating from the scope of CLR.
* Log: Loader log now warns on unresolved assemblies.
* Log: Loader now logs mscorlib version and end of phases at verbose level.

# Version 2.3.1, 2020-05-03

Expand Down

0 comments on commit aafe9d3

Please sign in to comment.