feat(config): bump schema to v20 with style-refactor visibility fields
Adds MainWindowOpen, SettingsWindowOpen, MaxParallelPopouts (channel popout pool size), TellAutoOpenMode (Off/Sidebar/TopTab/Popout) and SidebarAutoSwitchThresholdPx. Migration is additive — field initializers fill defaults for v19 configs, the Plugin.cs schema gate bumps the version stamp after load. UpdateFrom gets explicit sync statements for all five so settings-save edits do not drop them.
This commit is contained in:
@@ -35,7 +35,7 @@ public class ConfigKeyBind
|
|||||||
[Serializable]
|
[Serializable]
|
||||||
public class Configuration : IPluginConfiguration
|
public class Configuration : IPluginConfiguration
|
||||||
{
|
{
|
||||||
private const int LatestVersion = 19;
|
private const int LatestVersion = 20;
|
||||||
|
|
||||||
public int Version { get; set; } = LatestVersion;
|
public int Version { get; set; } = LatestVersion;
|
||||||
|
|
||||||
@@ -252,6 +252,15 @@ public class Configuration : IPluginConfiguration
|
|||||||
public ConfigKeyBind? ChatTabForward;
|
public ConfigKeyBind? ChatTabForward;
|
||||||
public ConfigKeyBind? ChatTabBackward;
|
public ConfigKeyBind? ChatTabBackward;
|
||||||
|
|
||||||
|
// v20 fields: window visibility state, channel popout pool size and
|
||||||
|
// sidebar auto-switch threshold. All initializers double as the
|
||||||
|
// migration defaults for configs loaded at v19 or earlier.
|
||||||
|
public bool MainWindowOpen = true;
|
||||||
|
public bool SettingsWindowOpen;
|
||||||
|
public int MaxParallelPopouts = 8;
|
||||||
|
public TellAutoOpenMode TellAutoOpenMode = TellAutoOpenMode.Sidebar;
|
||||||
|
public int SidebarAutoSwitchThresholdPx = 800;
|
||||||
|
|
||||||
public void UpdateFrom(Configuration other, bool backToOriginal)
|
public void UpdateFrom(Configuration other, bool backToOriginal)
|
||||||
{
|
{
|
||||||
if (backToOriginal)
|
if (backToOriginal)
|
||||||
@@ -392,9 +401,24 @@ public class Configuration : IPluginConfiguration
|
|||||||
|
|
||||||
WorldSuffixMode = other.WorldSuffixMode;
|
WorldSuffixMode = other.WorldSuffixMode;
|
||||||
NameFormMode = other.NameFormMode;
|
NameFormMode = other.NameFormMode;
|
||||||
|
|
||||||
|
MainWindowOpen = other.MainWindowOpen;
|
||||||
|
SettingsWindowOpen = other.SettingsWindowOpen;
|
||||||
|
MaxParallelPopouts = other.MaxParallelPopouts;
|
||||||
|
TellAutoOpenMode = other.TellAutoOpenMode;
|
||||||
|
SidebarAutoSwitchThresholdPx = other.SidebarAutoSwitchThresholdPx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public enum TellAutoOpenMode
|
||||||
|
{
|
||||||
|
Off,
|
||||||
|
Sidebar,
|
||||||
|
TopTab,
|
||||||
|
Popout,
|
||||||
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public enum UnreadMode
|
public enum UnreadMode
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -200,11 +200,12 @@ public sealed class Plugin : IAsyncDalamudPlugin
|
|||||||
// do not touch either static, so the brief null-window is safe.
|
// do not touch either static, so the brief null-window is safe.
|
||||||
|
|
||||||
// Schema gate: v1.4.x+ requires config v16+. Users on older schemas
|
// Schema gate: v1.4.x+ requires config v16+. Users on older schemas
|
||||||
// must install v1.4.2 first to run the migration chain. v19 adds the
|
// must install v1.4.2 first to run the migration chain. v19 added the
|
||||||
// top-level CustomSoundVolume, WindowOpacityInactive, WorldSuffixMode
|
// top-level CustomSoundVolume, WindowOpacityInactive, WorldSuffixMode
|
||||||
// and NameFormMode fields — all additive with defaults, so v16-v18
|
// and NameFormMode fields; v20 adds MainWindowOpen, SettingsWindowOpen,
|
||||||
// configs load cleanly and get their Version stamp bumped after the
|
// MaxParallelPopouts, TellAutoOpenMode and SidebarAutoSwitchThresholdPx
|
||||||
// gate.
|
// — all additive with defaults, so v16-v19 configs load cleanly and
|
||||||
|
// get their Version stamp bumped after the gate.
|
||||||
if (Config.Version < 16)
|
if (Config.Version < 16)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException(
|
throw new InvalidOperationException(
|
||||||
@@ -212,7 +213,7 @@ public sealed class Plugin : IAsyncDalamudPlugin
|
|||||||
+ "Please install v1.4.2 first to migrate the configuration, then upgrade to v1.4.10."
|
+ "Please install v1.4.2 first to migrate the configuration, then upgrade to v1.4.10."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Config.Version = 19;
|
Config.Version = 20;
|
||||||
|
|
||||||
// Unpinned TempTabs are session-only and dropped on every load. Pinned
|
// Unpinned TempTabs are session-only and dropped on every load. Pinned
|
||||||
// TempTabs survive reload — Jin's tester feedback (v1.4.7).
|
// TempTabs survive reload — Jin's tester feedback (v1.4.7).
|
||||||
|
|||||||
Reference in New Issue
Block a user