Users now need to re-accept the TOS if they only accepted an old version.
This commit is contained in:
@@ -8,6 +8,6 @@ public static class ConfigurationExtensions
|
|||||||
{
|
{
|
||||||
return configuration.AcceptedAgreement && configuration.InitialScanComplete
|
return configuration.AcceptedAgreement && configuration.InitialScanComplete
|
||||||
&& !string.IsNullOrEmpty(configuration.CacheFolder)
|
&& !string.IsNullOrEmpty(configuration.CacheFolder)
|
||||||
&& Directory.Exists(configuration.CacheFolder);
|
&& Directory.Exists(configuration.CacheFolder) && configuration.AcceptedTOSVersion == configuration.ExpectedTOSVersion;
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -7,6 +7,8 @@ namespace MareSynchronos.MareConfiguration.Configurations;
|
|||||||
[Serializable]
|
[Serializable]
|
||||||
public class MareConfig : IMareConfiguration
|
public class MareConfig : IMareConfiguration
|
||||||
{
|
{
|
||||||
|
public int ExpectedTOSVersion = 1;
|
||||||
|
public int AcceptedTOSVersion { get; set; } = 0;
|
||||||
public bool AcceptedAgreement { get; set; } = false;
|
public bool AcceptedAgreement { get; set; } = false;
|
||||||
public string CacheFolder { get; set; } = string.Empty;
|
public string CacheFolder { get; set; } = string.Empty;
|
||||||
public bool DisableOptionalPluginWarnings { get; set; } = false;
|
public bool DisableOptionalPluginWarnings { get; set; } = false;
|
||||||
|
@@ -106,7 +106,7 @@ public partial class IntroUi : WindowMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
if (_uiShared.IsInGpose) return;
|
if (_uiShared.IsInGpose) return;
|
||||||
|
|
||||||
if (!_configService.Current.AcceptedAgreement && !_readFirstPage)
|
if ((!_configService.Current.AcceptedAgreement || _configService.Current.AcceptedTOSVersion != _configService.Current.ExpectedTOSVersion) && !_readFirstPage)
|
||||||
{
|
{
|
||||||
_uiShared.BigText("Welcome to Snowcloak");
|
_uiShared.BigText("Welcome to Snowcloak");
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
@@ -125,7 +125,7 @@ public partial class IntroUi : WindowMediatorSubscriberBase
|
|||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
_timeoutTask = Task.Run(async () =>
|
_timeoutTask = Task.Run(async () =>
|
||||||
{
|
{
|
||||||
for (int i = 10; i > 0; i--)
|
for (int i = 45; i > 0; i--)
|
||||||
{
|
{
|
||||||
_timeoutLabel = $"'I agree' button will be available in {i}s";
|
_timeoutLabel = $"'I agree' button will be available in {i}s";
|
||||||
await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
|
await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
|
||||||
@@ -136,7 +136,7 @@ public partial class IntroUi : WindowMediatorSubscriberBase
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!_configService.Current.AcceptedAgreement && _readFirstPage)
|
else if ((!_configService.Current.AcceptedAgreement || _configService.Current.AcceptedTOSVersion != _configService.Current.ExpectedTOSVersion) && _readFirstPage)
|
||||||
{
|
{
|
||||||
using (_uiShared.UidFont.Push())
|
using (_uiShared.UidFont.Push())
|
||||||
{
|
{
|
||||||
@@ -189,6 +189,7 @@ public partial class IntroUi : WindowMediatorSubscriberBase
|
|||||||
if (ImGui.Button("I agree##toSetup"))
|
if (ImGui.Button("I agree##toSetup"))
|
||||||
{
|
{
|
||||||
_configService.Current.AcceptedAgreement = true;
|
_configService.Current.AcceptedAgreement = true;
|
||||||
|
_configService.Current.AcceptedTOSVersion = _configService.Current.ExpectedTOSVersion;
|
||||||
_configService.Save();
|
_configService.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -197,7 +198,7 @@ public partial class IntroUi : WindowMediatorSubscriberBase
|
|||||||
UiSharedService.TextWrapped(_timeoutLabel);
|
UiSharedService.TextWrapped(_timeoutLabel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_configService.Current.AcceptedAgreement
|
else if ((!_configService.Current.AcceptedAgreement || _configService.Current.AcceptedTOSVersion != _configService.Current.ExpectedTOSVersion)
|
||||||
&& (string.IsNullOrEmpty(_configService.Current.CacheFolder)
|
&& (string.IsNullOrEmpty(_configService.Current.CacheFolder)
|
||||||
|| !_configService.Current.InitialScanComplete
|
|| !_configService.Current.InitialScanComplete
|
||||||
|| !Directory.Exists(_configService.Current.CacheFolder)))
|
|| !Directory.Exists(_configService.Current.CacheFolder)))
|
||||||
|
Reference in New Issue
Block a user