Added checkbox to show hidden folders during Daggerfall setup#2584
Merged
KABoissonneault merged 2 commits intoInterkarma:masterfrom Apr 5, 2024
Merged
Conversation
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? |
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. |
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(). 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();
}
} |
petchema
approved these changes
Mar 31, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2487. Steam installs DF in a hidden folder by default on Linux, so it's pretty essential for these users.
I can find a DF installation in AppData just fine :)