mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Actually respect remember state flag
This commit is contained in:
parent
0bddf30577
commit
a925e37ceb
2 changed files with 21 additions and 5 deletions
|
|
@ -64,16 +64,28 @@ internal class Profile
|
|||
this.IsEnabled = false;
|
||||
Log.Verbose("{Guid} set disabled because always disable", this.modelV1.Guid);
|
||||
}
|
||||
}
|
||||
else if (this.modelV1.IsEnabled)
|
||||
{
|
||||
this.IsEnabled = true;
|
||||
Log.Verbose("{Guid} set enabled because remember", this.modelV1.Guid);
|
||||
else if (this.modelV1.StartupPolicy == ProfileModelV1.ProfileStartupPolicy.RememberState)
|
||||
{
|
||||
this.IsEnabled = this.modelV1.IsEnabled;
|
||||
Log.Verbose("{Guid} set enabled because remember", this.modelV1.Guid);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(this.modelV1.StartupPolicy));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Verbose("{Guid} not enabled", this.modelV1.Guid);
|
||||
}
|
||||
|
||||
Log.Verbose("Init profile {Guid} ({Name}) enabled:{Enabled} policy:{Policy} plugins:{NumPlugins} will be enabled:{Status}",
|
||||
this.modelV1.Guid,
|
||||
this.modelV1.Name,
|
||||
this.modelV1.IsEnabled,
|
||||
this.modelV1.StartupPolicy,
|
||||
this.modelV1.Plugins.Count,
|
||||
this.IsEnabled);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -193,6 +193,10 @@ internal class ProfileManager : IServiceType
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException("Unsupported profile model version");
|
||||
}
|
||||
|
||||
this.config.SavedProfiles!.Add(newModel);
|
||||
this.config.QueueSave();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue