refactor(ui): route logging through IPluginLogProxy

F12.2 step 5a — UI cluster (~40 sites in 6 files):
ChatLogWindow, DbViewer, Popout, SettingsTabs/{DataManagement,
FontsAndColours, ThemeAndLayout}. Plugin.Log.X(...) → Plugin.LogProxy.X(...).
No behaviour change; the proxy delegates 1:1 to the original IPluginLog.
This commit is contained in:
2026-05-13 08:22:12 +02:00
parent dca5de4085
commit 63cad62c89
6 changed files with 44 additions and 40 deletions
+14 -14
View File
@@ -277,7 +277,7 @@ public sealed class ChatLogWindow : Window
|| !GameFunctions.Chat.IsChannelOrExistingLinkshell(targetChannel.Value)
)
{
Plugin.Log.Warning(
Plugin.LogProxy.Warning(
$"Channel was set to an invalid value '{targetChannel}', ignoring"
);
return;
@@ -331,11 +331,11 @@ public sealed class ChatLogWindow : Window
{
case "hide":
CurrentHideState = HideState.User;
Plugin.Log.Verbose("HideState: → User (chat hide command)");
Plugin.LogProxy.Verbose("HideState: → User (chat hide command)");
break;
case "show":
CurrentHideState = HideState.None;
Plugin.Log.Verbose("HideState: → None (chat show command)");
Plugin.LogProxy.Verbose("HideState: → None (chat show command)");
break;
case "toggle":
CurrentHideState = CurrentHideState switch
@@ -345,7 +345,7 @@ public sealed class ChatLogWindow : Window
HideState.None => HideState.User,
_ => CurrentHideState,
};
Plugin.Log.Verbose($"HideState: → {CurrentHideState} (chat toggle command)");
Plugin.LogProxy.Verbose($"HideState: → {CurrentHideState} (chat toggle command)");
break;
}
}
@@ -469,14 +469,14 @@ public sealed class ChatLogWindow : Window
if (Plugin.Config.HideInBattle && CurrentHideState == HideState.None && Plugin.InBattle)
{
CurrentHideState = HideState.Battle;
Plugin.Log.Verbose("HideState: None → Battle");
Plugin.LogProxy.Verbose("HideState: None → Battle");
}
// If the chat is hidden because of battle, we reset it here
if (CurrentHideState is HideState.Battle && !Plugin.InBattle)
{
CurrentHideState = HideState.None;
Plugin.Log.Verbose("HideState: Battle → None");
Plugin.LogProxy.Verbose("HideState: Battle → None");
}
// if the chat has no hide state and in a cutscene, set the hide state to cutscene
@@ -489,7 +489,7 @@ public sealed class ChatLogWindow : Window
if (Plugin.Functions.Chat.CheckHideFlags())
{
CurrentHideState = HideState.Cutscene;
Plugin.Log.Verbose("HideState: None → Cutscene");
Plugin.LogProxy.Verbose("HideState: None → Cutscene");
}
}
@@ -500,7 +500,7 @@ public sealed class ChatLogWindow : Window
&& !Plugin.GposeActive
)
{
Plugin.Log.Verbose($"HideState: {CurrentHideState} → None (cutscene/gpose ended)");
Plugin.LogProxy.Verbose($"HideState: {CurrentHideState} → None (cutscene/gpose ended)");
CurrentHideState = HideState.None;
}
@@ -508,14 +508,14 @@ public sealed class ChatLogWindow : Window
if (CurrentHideState == HideState.Cutscene && Activate)
{
CurrentHideState = HideState.CutsceneOverride;
Plugin.Log.Verbose("HideState: Cutscene → CutsceneOverride (user activate)");
Plugin.LogProxy.Verbose("HideState: Cutscene → CutsceneOverride (user activate)");
}
// if the user hid the chat and is now activating chat, reset the hide state
if (CurrentHideState == HideState.User && Activate)
{
CurrentHideState = HideState.None;
Plugin.Log.Verbose("HideState: User → None (activate)");
Plugin.LogProxy.Verbose("HideState: User → None (activate)");
}
if (
@@ -633,7 +633,7 @@ public sealed class ChatLogWindow : Window
}
catch (Exception ex)
{
Plugin.Log.Error(ex, "Error drawing Chat Log window");
Plugin.LogProxy.Error(ex, "Error drawing Chat Log window");
if (!NotifiedDrawFailure)
{
Plugin.Notification.AddNotification(
@@ -1608,7 +1608,7 @@ public sealed class ChatLogWindow : Window
}
catch (Exception ex)
{
Plugin.Log.Warning(ex, "Error drawing chat log");
Plugin.LogProxy.Warning(ex, "Error drawing chat log");
}
}
@@ -2059,7 +2059,7 @@ public sealed class ChatLogWindow : Window
{
Plugin.Config.SeenPopOutHeaderHint = true;
Plugin.SaveConfig();
Plugin.Log.Debug("v0.6.1 pop-out header hint dismissed");
Plugin.LogProxy.Debug("v0.6.1 pop-out header hint dismissed");
if (openSettings)
Plugin.SettingsWindow.Toggle();
}
@@ -2672,7 +2672,7 @@ public sealed class ChatLogWindow : Window
var viewport = ImGui.GetMainViewport();
var safePos = viewport.WorkPos + SafeDefaultOffset;
Position = safePos;
Plugin.Log.Info(
Plugin.LogProxy.Info(
$"[Window-Recovery] {source}: snapping main window from {LastWindowPos} (size {LastWindowSize}) to {safePos}."
);