feat(config): migration v14 → v15, removed legacy theme fields and Appearance bindings
This commit is contained in:
@@ -34,7 +34,7 @@ public class ConfigKeyBind
|
|||||||
[Serializable]
|
[Serializable]
|
||||||
public class Configuration : IPluginConfiguration
|
public class Configuration : IPluginConfiguration
|
||||||
{
|
{
|
||||||
private const int LatestVersion = 14;
|
private const int LatestVersion = 15;
|
||||||
|
|
||||||
public int Version { get; set; } = LatestVersion;
|
public int Version { get; set; } = LatestVersion;
|
||||||
|
|
||||||
@@ -80,19 +80,6 @@ public class Configuration : IPluginConfiguration
|
|||||||
// ChatTwo users skip it because the v6→v7 migration sets the flag.
|
// ChatTwo users skip it because the v6→v7 migration sets the flag.
|
||||||
public bool FirstRunCompleted;
|
public bool FirstRunCompleted;
|
||||||
|
|
||||||
// Hellion Chat global ImGui theme — applied to every plugin window in
|
|
||||||
// Plugin.Draw. Default ON; users who prefer the upstream Dalamud look
|
|
||||||
// can flip this off in the Privacy tab.
|
|
||||||
[Obsolete("Replaced by Theme slug + WindowOpacity in v14")]
|
|
||||||
public bool HellionThemeEnabled = true;
|
|
||||||
|
|
||||||
// Window background opacity, 0.5–1.0. Lower values make the plugin
|
|
||||||
// panes more glass-like so the game shines through. Default 0.5
|
|
||||||
// matches the maintainer's daily-driver preference; users who want
|
|
||||||
// a less translucent look bump it up in Aussehen → Theme.
|
|
||||||
[Obsolete("Replaced by WindowOpacity in v14")]
|
|
||||||
public float HellionThemeWindowOpacity = 0.5f;
|
|
||||||
|
|
||||||
// Use the bundled Exo 2 font (OFL-1.1) for the regular plugin font
|
// Use the bundled Exo 2 font (OFL-1.1) for the regular plugin font
|
||||||
// instead of whatever GlobalFontV2.FontId points at. Default ON so a
|
// instead of whatever GlobalFontV2.FontId points at. Default ON so a
|
||||||
// fresh install gets the Hellion typography out-of-the-box; flip OFF
|
// fresh install gets the Hellion typography out-of-the-box; flip OFF
|
||||||
@@ -336,10 +323,6 @@ public class Configuration : IPluginConfiguration
|
|||||||
RetentionLastRunAt = other.RetentionLastRunAt;
|
RetentionLastRunAt = other.RetentionLastRunAt;
|
||||||
|
|
||||||
FirstRunCompleted = other.FirstRunCompleted;
|
FirstRunCompleted = other.FirstRunCompleted;
|
||||||
#pragma warning disable CS0612, CS0618 // Obsolete-Felder bleiben bis v1.2.0 als JSON-Safety-Net erhalten
|
|
||||||
HellionThemeEnabled = other.HellionThemeEnabled;
|
|
||||||
HellionThemeWindowOpacity = other.HellionThemeWindowOpacity;
|
|
||||||
#pragma warning restore CS0612, CS0618
|
|
||||||
UseHellionFont = other.UseHellionFont;
|
UseHellionFont = other.UseHellionFont;
|
||||||
|
|
||||||
// v1.1.0 theme engine fields
|
// v1.1.0 theme engine fields
|
||||||
|
|||||||
+16
-3
@@ -247,9 +247,8 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
if (Config.Version < 14)
|
if (Config.Version < 14)
|
||||||
{
|
{
|
||||||
Config.Theme = "hellion-arctic";
|
Config.Theme = "hellion-arctic";
|
||||||
#pragma warning disable CS0612, CS0618 // Obsolete: HellionThemeWindowOpacity bleibt readable bis v1.2.0
|
// v1.2.0: alter Opacity-Wert wird nicht mehr migriert (Field entfernt).
|
||||||
Config.WindowOpacity = Config.HellionThemeWindowOpacity;
|
// User die direkt v13 → v15 springen bekommen den Default 0.85.
|
||||||
#pragma warning restore CS0612, CS0618
|
|
||||||
Config.ReduceMotion = false;
|
Config.ReduceMotion = false;
|
||||||
Config.UseCompactDensity = false;
|
Config.UseCompactDensity = false;
|
||||||
Config.ShowThemeQuickPicker = false;
|
Config.ShowThemeQuickPicker = false;
|
||||||
@@ -260,6 +259,20 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
"pick chat2-classic in Settings → Themes for the upstream look");
|
"pick chat2-classic in Settings → Themes for the upstream look");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Config.Version < 15)
|
||||||
|
{
|
||||||
|
// v1.2.0 — keine Datenmigration nötig. Removal der deprecated
|
||||||
|
// Theme-Felder ist reine Schema-Bereinigung (System.Text.Json
|
||||||
|
// ignoriert unbekannte Felder im JSON, daher kein Crash bei
|
||||||
|
// Configs die noch HellionThemeEnabled/HellionThemeWindowOpacity
|
||||||
|
// serialisiert haben — die Werte verfallen einfach).
|
||||||
|
Config.Version = 15;
|
||||||
|
SaveConfig();
|
||||||
|
Log.Information(
|
||||||
|
"Migrated config v14 → v15: legacy theme fields removed " +
|
||||||
|
"(HellionThemeEnabled, HellionThemeWindowOpacity)");
|
||||||
|
}
|
||||||
|
|
||||||
// Hellion v1.0.0 default tab layout. Five thematically separated
|
// Hellion v1.0.0 default tab layout. Five thematically separated
|
||||||
// tabs: General catches the immediate-surroundings public chat
|
// tabs: General catches the immediate-surroundings public chat
|
||||||
// (Say/Yell/Shout) only; System absorbs the rest of the technical
|
// (Say/Yell/Shout) only; System absorbs the rest of the technical
|
||||||
|
|||||||
@@ -45,32 +45,11 @@ internal sealed class Appearance : ISettingsTab
|
|||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
||||||
{
|
{
|
||||||
// v1.1.0 — Diese Settings-UI wird in Phase J durch den dedizierten
|
// v1.2.0 — Legacy HellionThemeEnabled/HellionThemeWindowOpacity-Bindings
|
||||||
// Themes-Tab ersetzt. Bis dahin bleiben die alten Toggles erhalten,
|
// entfernt. Theme-Auswahl + globale Window-Opacity leben jetzt in
|
||||||
// damit die Settings-Seite kompiliert; sie schreiben in die mit
|
// Settings → Themes (eingeführt mit v1.1.0). Hier verbleibt nur der
|
||||||
// [Obsolete] markierten Felder, die bis v1.2.0 als JSON-Safety-Net
|
// klassische OverrideStyle-Toggle plus der Bestand-WindowAlpha-Slider
|
||||||
// bestehen bleiben. Das pragma unterdrückt die CS0612-Warnungen
|
// für das Chat-Log-Fenster.
|
||||||
// gezielt für diesen Übergangs-Block.
|
|
||||||
#pragma warning disable CS0612, CS0618
|
|
||||||
ImGui.Checkbox(HellionStrings.Theme_Enabled_Name, ref Mutable.HellionThemeEnabled);
|
|
||||||
ImGuiUtil.HelpMarker(HellionStrings.Theme_Enabled_Description);
|
|
||||||
|
|
||||||
// Clamp 0.5–1.0 stays consistent with Privacy.cs which already
|
|
||||||
// shipped this slider; lower values would let chat windows
|
|
||||||
// disappear behind game UI.
|
|
||||||
using (ImRaii.Disabled(!Mutable.HellionThemeEnabled))
|
|
||||||
{
|
|
||||||
ImGui.SetNextItemWidth(200f * ImGuiHelpers.GlobalScale);
|
|
||||||
var opacity = Mutable.HellionThemeWindowOpacity;
|
|
||||||
if (ImGui.SliderFloat($"{HellionStrings.Theme_WindowOpacity_Label}##theme-opacity", ref opacity, 0.5f, 1.0f, "%.2f"))
|
|
||||||
{
|
|
||||||
Mutable.HellionThemeWindowOpacity = Math.Clamp(opacity, 0.5f, 1.0f);
|
|
||||||
}
|
|
||||||
ImGuiUtil.HelpMarker(HellionStrings.Theme_WindowOpacity_Help);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_OverrideStyle_Name, ref Mutable.OverrideStyle);
|
ImGui.Checkbox(Language.Options_OverrideStyle_Name, ref Mutable.OverrideStyle);
|
||||||
ImGuiUtil.HelpMarker(Language.Options_OverrideStyle_Name_Desc);
|
ImGuiUtil.HelpMarker(Language.Options_OverrideStyle_Name_Desc);
|
||||||
|
|
||||||
@@ -79,16 +58,7 @@ internal sealed class Appearance : ISettingsTab
|
|||||||
DrawStyleCombo();
|
DrawStyleCombo();
|
||||||
}
|
}
|
||||||
|
|
||||||
// The Bestand-Slider WindowAlpha targets the chat log window's
|
ImGuiUtil.DragFloatVertical(Language.Options_WindowOpacity_Name, ref Mutable.WindowAlpha, .25f, 0f, 100f, $"{Mutable.WindowAlpha:N2}%%", ImGuiSliderFlags.AlwaysClamp);
|
||||||
// background only. The Hellion theme opacity above already covers
|
|
||||||
// every plugin window globally, so the two sliders fight each
|
|
||||||
// other when the theme is active. Disable the legacy slider in
|
|
||||||
// that case to make Hellion theme the single source of truth.
|
|
||||||
using (ImRaii.Disabled(Mutable.HellionThemeEnabled))
|
|
||||||
{
|
|
||||||
ImGuiUtil.DragFloatVertical(Language.Options_WindowOpacity_Name, ref Mutable.WindowAlpha, .25f, 0f, 100f, $"{Mutable.WindowAlpha:N2}%%", ImGuiSliderFlags.AlwaysClamp);
|
|
||||||
}
|
|
||||||
#pragma warning restore CS0612, CS0618
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user