diff --git a/Dalamud/Interface/Internal/DalamudCommands.cs b/Dalamud/Interface/Internal/DalamudCommands.cs index 636f71bfa..a3b28d4a8 100644 --- a/Dalamud/Interface/Internal/DalamudCommands.cs +++ b/Dalamud/Interface/Internal/DalamudCommands.cs @@ -152,6 +152,11 @@ internal class DalamudCommands : IServiceType "DalamudCopyLogHelp", "Copy the dalamud.log file to your clipboard."), }); + // Add the new command handler for toggling multi-monitor option + commandManager.AddHandler("/xltogglemultimonitor", new CommandInfo(this.OnToggleMultiMonitorCommand) + { + HelpMessage = Loc.Localize("DalamudToggleMultiMonitorHelp", "Toggle multi-monitor windows."), + }); } private void OnUnloadCommand(string command, string arguments) @@ -416,4 +421,19 @@ internal class DalamudCommands : IServiceType : Loc.Localize("DalamudLogCopyFailure", "Could not copy log file to clipboard."); chatGui.Print(message); } + + private void OnToggleMultiMonitorCommand(string command, string arguments) + { + var configuration = Service.Get(); + var chatGui = Service.Get(); + + configuration.IsDisableViewport = !configuration.IsDisableViewport; + configuration.QueueSave(); + + var message = configuration.IsDisableViewport + ? Loc.Localize("DalamudMultiMonitorDisabled", "Multi-monitor windows disabled.") + : Loc.Localize("DalamudMultiMonitorEnabled", "Multi-monitor windows enabled."); + + chatGui.Print(message); + } }