add disable autologon on a per character basis

add automatic notes population on empty notes
adjust mare command help text
This commit is contained in:
Stanley Dimant
2024-10-30 10:13:22 +01:00
parent f6df371339
commit c66b58d156
11 changed files with 90 additions and 13 deletions

View File

@@ -36,7 +36,13 @@ public sealed class CommandManagerService : IDisposable
_mareConfigService = mareConfigService;
_commandManager.AddHandler(_commandName, new CommandInfo(OnCommand)
{
HelpMessage = "Opens the Mare Synchronos UI"
HelpMessage = "Opens the Mare Synchronos UI" + Environment.NewLine + Environment.NewLine +
"Additionally possible commands:" + Environment.NewLine +
"\t /mare toggle - Disconnects from Mare, if connected. Connects to Mare, if disconnected" + Environment.NewLine +
"\t /mare toggle on|off - Connects or disconnects to Mare respectively" + Environment.NewLine +
"\t /mare gpose - Opens the GPose MCDF import window (only works in GPose)" + Environment.NewLine +
"\t /mare analyze - Opens the Mare Character Data Analysis window" + Environment.NewLine +
"\t /mare settings - Opens the Mare Settings window"
});
}
@@ -59,6 +65,9 @@ public sealed class CommandManagerService : IDisposable
return;
}
if (!_mareConfigService.Current.HasValidSetup())
return;
if (string.Equals(splitArgs[0], "toggle", StringComparison.OrdinalIgnoreCase))
{
if (_apiController.ServerState == WebAPI.SignalR.Utils.ServerState.Disconnecting)
@@ -109,5 +118,9 @@ public sealed class CommandManagerService : IDisposable
{
_mediator.Publish(new UiToggleMessage(typeof(DataAnalysisUi)));
}
else if (string.Equals(splitArgs[0], "settings", StringComparison.OrdinalIgnoreCase))
{
_mediator.Publish(new UiToggleMessage(typeof(SettingsUi)));
}
}
}

View File

@@ -39,7 +39,6 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
private readonly List<string> _notUpdatedCharas = [];
private bool _sentBetweenAreas = false;
public DalamudUtilService(ILogger<DalamudUtilService> logger, IClientState clientState, IObjectTable objectTable, IFramework framework,
IGameGui gameGui, ICondition condition, IDataManager gameData, ITargetManager targetManager,
BlockedCharacterHandler blockedCharacterHandler, MareMediator mediator, PerformanceCollectorService performanceCollector)

View File

@@ -17,6 +17,7 @@ public class ServerConfigurationManager
{
private readonly ServerConfigService _configService;
private readonly DalamudUtilService _dalamudUtil;
private readonly MareConfigService _mareConfigService;
private readonly ILogger<ServerConfigurationManager> _logger;
private readonly MareMediator _mareMediator;
private readonly NotesConfigService _notesConfig;
@@ -24,6 +25,7 @@ public class ServerConfigurationManager
public ServerConfigurationManager(ILogger<ServerConfigurationManager> logger, ServerConfigService configService,
ServerTagConfigService serverTagConfig, NotesConfigService notesConfig, DalamudUtilService dalamudUtil,
MareConfigService mareConfigService,
MareMediator mareMediator)
{
_logger = logger;
@@ -31,6 +33,7 @@ public class ServerConfigurationManager
_serverTagConfig = serverTagConfig;
_notesConfig = notesConfig;
_dalamudUtil = dalamudUtil;
_mareConfigService = mareConfigService;
_mareMediator = mareMediator;
EnsureMainExists();
}
@@ -438,6 +441,15 @@ public class ServerConfigurationManager
_notesConfig.Save();
}
internal void AutoPopulateNoteForUid(string uid, string note)
{
if (!_mareConfigService.Current.AutoPopulateEmptyNotesFromCharaName
|| GetNoteForUid(uid) != null)
return;
SetNoteForUid(uid, note, save: true);
}
private ServerNotesStorage CurrentNotesStorage()
{
TryCreateCurrentNotesStorage();