Add a command line for multimonitor toogle (#2254)

* Update DalamudCommands.cs

Added a /xlmulti command for toggling multimonitor.

Using Dalamud local build encounters Assertion Failure with Umbra plugin enabled. Otherwise works fine.

* Update DalamudCommands.cs

replaced /xlmulti with /xltogglemultimonitor to be more explicit

---------

Co-authored-by: Fractal <Fractal@FRACTAL>
This commit is contained in:
Tupae 2025-04-22 16:34:36 +02:00 committed by GitHub
parent aea62732e5
commit cf5a6f2635
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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<DalamudConfiguration>.Get();
var chatGui = Service<ChatGui>.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);
}
}