Reject and warn about cloud-synced base directories

This commit is contained in:
Exter-N 2025-08-31 06:42:45 +02:00
parent d59be1e660
commit 2cf60b78cd
3 changed files with 25 additions and 5 deletions

View file

@ -14,6 +14,7 @@ using OtterGui.Text;
using OtterGui.Widgets;
using Penumbra.Api;
using Penumbra.Collections;
using Penumbra.Interop;
using Penumbra.Interop.Hooks.PostProcessing;
using Penumbra.Interop.Services;
using Penumbra.Mods.Manager;
@ -59,6 +60,9 @@ public class SettingsTab : ITab, IUiService
private readonly TagButtons _sharedTags = new();
private string _lastCloudSyncTestedPath = string.Empty;
private bool _lastCloudSyncTestResult = false;
public SettingsTab(IDalamudPluginInterface pluginInterface, Configuration config, FontReloader fontReloader, TutorialService tutorial,
Penumbra penumbra, FileDialogService fileDialog, ModManager modManager, ModFileSystemSelector selector,
CharacterUtility characterUtility, ResidentResourceManager residentResources, ModExportManager modExportManager, HttpApi httpApi,
@ -208,6 +212,15 @@ public class SettingsTab : ITab, IUiService
if (IsSubPathOf(gameDir, newName))
return ("Path is not allowed to be inside your game folder.", false);
if (_lastCloudSyncTestedPath != newName)
{
_lastCloudSyncTestResult = CloudApi.IsCloudSynced(newName);
_lastCloudSyncTestedPath = newName;
}
if (_lastCloudSyncTestResult)
return ("Path is not allowed to be cloud-synced.", false);
return selected
? ($"Press Enter or Click Here to Save (Current Directory: {old})", true)
: ($"Click Here to Save (Current Directory: {old})", true);