mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-28 19:39:19 +01:00
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:
parent
aea62732e5
commit
cf5a6f2635
1 changed files with 20 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue