Skip to content

Conversation

@KABoissonneault
Copy link
Collaborator

Fixes #2487. Steam installs DF in a hidden folder by default on Linux, so it's pretty essential for these users.

image

image

I can find a DF installation in AppData just fine :)

image

@KABoissonneault KABoissonneault added this to the DFU 1.0.1 milestone Feb 14, 2024
@KABoissonneault
Copy link
Collaborator Author

On another subject, anyone knows why the path is limited to 43 characters? Can we increase that a bit, or does that break low resolutions?

@KABoissonneault
Copy link
Collaborator Author

This change should be a pretty quick review, and solves an important issue for Linux and Steam Deck users, and has no impact on the rest of the game.

@petchema
Copy link
Collaborator

I had the issue of ".." disappearing when toggling the "show hidden files" checkbox, at first I thought it could be because it's a hidden name, but it turns out the reason is that the ".." entry is handled specifically, and not inside RefreshFolders().
I can fix it by lifting that handling from FolderList_OnUseSelectedItem() to RefreshFolders(), hopefully this doesn't break anything?

diff --git a/Assets/Scripts/Game/UserInterface/FolderBrowser.cs b/Assets/Scripts/Game/UserInterface/FolderBrowser.cs
index 6eb38eced..cb0dbb66f 100644
--- a/Assets/Scripts/Game/UserInterface/FolderBrowser.cs
+++ b/Assets/Scripts/Game/UserInterface/FolderBrowser.cs
@@ -28,6 +28,8 @@ namespace DaggerfallWorkshop.Game.UserInterface
     /// </summary>
     public class FolderBrowser : Panel
     {
+        private const string parentDirectory = "..";
+
         int confirmButtonWidth = 35;
         int drivePanelWidth = 40;
         int pathPanelHeight = 12;
@@ -209,6 +211,11 @@ namespace DaggerfallWorkshop.Game.UserInterface
         {
             folders.Clear();
             folderList.ClearItems();
+
+            // Add return path
+            if (currentPath != drives[driveList.SelectedIndex])
+                folderList.AddItem(parentDirectory);
+
             try
             {
                 string[] directoryList = Directory.GetDirectories(currentPath);
@@ -332,7 +339,7 @@ namespace DaggerfallWorkshop.Game.UserInterface
 
             // Get new path
             string newPath = string.Empty;
-            if (folderList.SelectedItem == "..")
+            if (folderList.SelectedItem == parentDirectory)
             {
                 // Handle return path
                 DirectoryInfo info = new DirectoryInfo(currentPath);
@@ -351,14 +358,6 @@ namespace DaggerfallWorkshop.Game.UserInterface
                 currentPath = newPath;
                 RefreshFolders();
                 RaisePathChangedEvent();
-
-                // Add return path
-                if (currentPath != drives[driveList.SelectedIndex])
-                    folderList.AddItem("..", 0);
-
-                // Update scroller units
-                folderScroller.TotalUnits = folderList.Count;
-
                 UpdatePathText();
             }
         }

@KABoissonneault KABoissonneault merged commit 2adbdd9 into Interkarma:master Apr 5, 2024
@KABoissonneault KABoissonneault deleted the feat/show-hidden-folders branch April 5, 2024 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot Access Hidden Folders When Setting Daggerfall's Game Files Path

2 participants