Update syncshell chat.
All checks were successful
Build and Update Repo / build-and-update-repo (push) Successful in 1m12s
All checks were successful
Build and Update Repo / build-and-update-repo (push) Successful in 1m12s
Update /ss to /ps Remove whitespaces from sending in syncshell chat.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Dalamud.Game.Command;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Utility;
|
||||
using MareSynchronos.FileCache;
|
||||
using MareSynchronos.MareConfiguration;
|
||||
using MareSynchronos.MareConfiguration.Models;
|
||||
@@ -17,7 +18,7 @@ public sealed class CommandManagerService : IDisposable
|
||||
private const string _commandName = "/sync";
|
||||
private const string _commandName2 = "/clubpenguin";
|
||||
|
||||
private const string _ssCommandPrefix = "/ss";
|
||||
private const string _psCommandPrefix = "/ps";
|
||||
|
||||
private readonly ApiController _apiController;
|
||||
private readonly ICommandManager _commandManager;
|
||||
@@ -52,7 +53,7 @@ public sealed class CommandManagerService : IDisposable
|
||||
// Lazy registration of all possible /ss# commands which tbf is what the game does for linkshells anyway
|
||||
for (int i = 1; i <= ChatService.CommandMaxNumber; ++i)
|
||||
{
|
||||
_commandManager.AddHandler($"{_ssCommandPrefix}{i}", new CommandInfo(OnChatCommand)
|
||||
_commandManager.AddHandler($"{_psCommandPrefix}{i}", new CommandInfo(OnChatCommand)
|
||||
{
|
||||
ShowInHelp = false
|
||||
});
|
||||
@@ -65,7 +66,7 @@ public sealed class CommandManagerService : IDisposable
|
||||
_commandManager.RemoveHandler(_commandName2);
|
||||
|
||||
for (int i = 1; i <= ChatService.CommandMaxNumber; ++i)
|
||||
_commandManager.RemoveHandler($"{_ssCommandPrefix}{i}");
|
||||
_commandManager.RemoveHandler($"{_psCommandPrefix}{i}");
|
||||
}
|
||||
|
||||
private void OnCommand(string command, string args)
|
||||
@@ -139,9 +140,9 @@ public sealed class CommandManagerService : IDisposable
|
||||
if (_mareConfigService.Current.DisableSyncshellChat)
|
||||
return;
|
||||
|
||||
int shellNumber = int.Parse(command[_ssCommandPrefix.Length..]);
|
||||
int shellNumber = int.Parse(command[_psCommandPrefix.Length..]);
|
||||
|
||||
if (args.Length == 0)
|
||||
if (args.Length == 0 || args.IsNullOrWhitespace())
|
||||
{
|
||||
_chatService.SwitchChatShell(shellNumber);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user