minor fixes and renamings for intro landing page

This commit is contained in:
Stanley Dimant
2022-06-22 01:28:42 +02:00
parent 9bf1a7cf36
commit 99e80aeb4d
6 changed files with 17 additions and 11 deletions

View File

@@ -22,9 +22,10 @@ namespace MareSynchronos
get => string.IsNullOrEmpty(_apiUri) ? ApiController.MainServiceUri : _apiUri; get => string.IsNullOrEmpty(_apiUri) ? ApiController.MainServiceUri : _apiUri;
set => _apiUri = value; set => _apiUri = value;
} }
public bool UseCustomService { get; set; }
public bool InitialScanComplete { get; set; } public bool UseCustomService { get; set; } = false;
public bool AcceptedAgreement { get; set; } public bool InitialScanComplete { get; set; } = false;
public bool AcceptedAgreement { get; set; } = false;
private int _maxParallelScan = 10; private int _maxParallelScan = 10;
public int MaxParallelScan public int MaxParallelScan
{ {

View File

@@ -55,7 +55,7 @@ namespace MareSynchronos.Managers
public void StartInitialScan() public void StartInitialScan()
{ {
_scanCancellationTokenSource = new CancellationTokenSource(); _scanCancellationTokenSource = new CancellationTokenSource();
_scanTask = StartFileScan(_scanCancellationTokenSource.Token); _scanTask = Task.Run(() => StartFileScan(_scanCancellationTokenSource.Token));
} }
private async Task StartFileScan(CancellationToken ct) private async Task StartFileScan(CancellationToken ct)
@@ -172,12 +172,12 @@ namespace MareSynchronos.Managers
_timerStopWatch?.Stop(); _timerStopWatch?.Stop();
if (_scanTask?.IsCompleted ?? false) if (_scanTask?.IsCompleted ?? false)
{ {
PluginLog.Warning("Scanning task is still running, not reinitiating."); PluginLog.Warning("Scanning task is still running, not re-initiating.");
return; return;
} }
PluginLog.Debug("Initiating periodic scan for mod changes"); PluginLog.Debug("Initiating periodic scan for mod changes");
_scanTask = StartFileScan(_scanCancellationTokenSource!.Token); Task.Run(() => _scanTask = StartFileScan(_scanCancellationTokenSource!.Token));
_timerStopWatch = Stopwatch.StartNew(); _timerStopWatch = Stopwatch.StartNew();
}; };

View File

@@ -100,6 +100,8 @@ namespace MareSynchronos
{ {
PluginLog.Debug("Client login"); PluginLog.Debug("Client login");
_pluginInterface.UiBuilder.Draw += Draw;
if (!_configuration.HasValidSetup) if (!_configuration.HasValidSetup)
{ {
_introUi.IsOpen = true; _introUi.IsOpen = true;
@@ -108,7 +110,6 @@ namespace MareSynchronos
else else
{ {
_introUi.IsOpen = false; _introUi.IsOpen = false;
_pluginInterface.UiBuilder.Draw += Draw;
} }
Task.Run(async () => Task.Run(async () =>

View File

@@ -63,6 +63,10 @@ namespace MareSynchronos.UI
"Note that you will have to have Penumbra as well as Glamourer installed to use this plugin."); "Note that you will have to have Penumbra as well as Glamourer installed to use this plugin.");
UIShared.TextWrapped("We will have to setup a few things first before you can start using this plugin. Click on next to continue."); UIShared.TextWrapped("We will have to setup a few things first before you can start using this plugin. Click on next to continue.");
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudYellow);
UIShared.TextWrapped("Note: Any modifications you have applied through anything but Penumbra cannot be shared and your character state on other clients " +
"might look broken because of this. If you want to use this plugin you will have to move your mods to Penumbra.");
ImGui.PopStyleColor();
if (!_uiShared.DrawOtherPluginState()) return; if (!_uiShared.DrawOtherPluginState()) return;
ImGui.Separator(); ImGui.Separator();
if (ImGui.Button("Next##toAgreement")) if (ImGui.Button("Next##toAgreement"))

View File

@@ -68,6 +68,7 @@ namespace MareSynchronos.UI
{ {
ImGui.Text("Scan not started"); ImGui.Text("Scan not started");
} }
else
{ {
ImGui.Text("Next scan in " + _fileCacheManager.TimeToNextScan.ToString(@"mm\:ss") + " minutes"); ImGui.Text("Next scan in " + _fileCacheManager.TimeToNextScan.ToString(@"mm\:ss") + " minutes");
} }

View File

@@ -109,12 +109,11 @@ namespace MareSynchronos.WebAPI
{ {
if (message is HttpClientHandler clientHandler) if (message is HttpClientHandler clientHandler)
clientHandler.ServerCertificateCustomValidationCallback += clientHandler.ServerCertificateCustomValidationCallback +=
(sender, certificate, chain, sslPolicyErrors) => true; (_, _, _, _) => true;
return message; return message;
}; };
#endif #endif
}).Build(); }).Build();
PluginLog.Debug("Heartbeat service built to: " + ApiUri);
await _heartbeatHub.StartAsync(cts.Token); await _heartbeatHub.StartAsync(cts.Token);
UID = await _heartbeatHub!.InvokeAsync<string>("Heartbeat"); UID = await _heartbeatHub!.InvokeAsync<string>("Heartbeat");
@@ -125,9 +124,9 @@ namespace MareSynchronos.WebAPI
await LoadInitialData(); await LoadInitialData();
Connected?.Invoke(this, EventArgs.Empty); Connected?.Invoke(this, EventArgs.Empty);
} }
catch (Exception ex) catch
{ {
PluginLog.Error(ex, "Error during Heartbeat initialization"); //PluginLog.Error(ex, "Error during Heartbeat initialization");
} }
_heartbeatHub.Closed += OnHeartbeatHubOnClosed; _heartbeatHub.Closed += OnHeartbeatHubOnClosed;