more update to StandaloneFileBrowser

This commit is contained in:
minenice55 2024-01-27 16:44:17 -05:00
parent 5b80f29f6f
commit a713e5f210
17 changed files with 392 additions and 325 deletions

View file

@ -1,8 +1,7 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 7609f7b6787a54496aa41a3053fcc76a guid: 8a8e6577c9e32f04c85e89a8f43e92fa
timeCreated: 1483902788
licenseType: Pro
MonoImporter: MonoImporter:
externalObjects: {}
serializedVersion: 2 serializedVersion: 2
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: ddc4e7b83981f244ba9a26b88c18cb67 guid: cb2d899d659d1184bb966272a336be62
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}

View file

@ -1,17 +1,18 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: b8c465928f1784a3fac8dc3766f7201c guid: b8c465928f1784a3fac8dc3766f7201c
timeCreated: 1538230728
licenseType: Free
PluginImporter: PluginImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
iconMap: {} iconMap: {}
executionOrder: {} executionOrder: {}
defineConstraints: []
isPreloaded: 0 isPreloaded: 0
isOverridable: 0 isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData: platformData:
- first: - first:
'': Any : Any
second: second:
enabled: 0 enabled: 0
settings: settings:
@ -77,7 +78,7 @@ PluginImporter:
second: second:
enabled: 1 enabled: 1
settings: settings:
CPU: x86_64 CPU: AnyCPU
- first: - first:
Standalone: LinuxUniversal Standalone: LinuxUniversal
second: second:

View file

@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: 74fab40b825d7954582ce1cf75b15184
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude Win: 0
Exclude Win64: 0
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,17 +1,18 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: e60958662eed5413d86143a0a69b731e guid: e60958662eed5413d86143a0a69b731e
timeCreated: 1491979494
licenseType: Pro
PluginImporter: PluginImporter:
externalObjects: {}
serializedVersion: 2 serializedVersion: 2
iconMap: {} iconMap: {}
executionOrder: {} executionOrder: {}
defineConstraints: []
isPreloaded: 0 isPreloaded: 0
isOverridable: 0 isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData: platformData:
data: - first:
first: : Any
'': Any
second: second:
enabled: 0 enabled: 0
settings: settings:
@ -27,113 +28,97 @@ PluginImporter:
Exclude Win: 0 Exclude Win: 0
Exclude Win64: 0 Exclude Win64: 0
Exclude iOS: 1 Exclude iOS: 1
data: - first:
first: : Editor
'': Editor
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
OS: AnyOS OS: AnyOS
data: - first:
first:
Android: Android Android: Android
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: ARMv7 CPU: ARMv7
data: - first:
first:
Any: Any:
second: second:
enabled: 0 enabled: 0
settings: {} settings: {}
data: - first:
first:
Editor: Editor Editor: Editor
second: second:
enabled: 1 enabled: 1
settings: settings:
DefaultValueInitialized: true DefaultValueInitialized: true
data: - first:
first:
Facebook: Win Facebook: Win
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
data: - first:
first:
Facebook: Win64 Facebook: Win64
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
data: - first:
first:
Standalone: Linux Standalone: Linux
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
data: - first:
first:
Standalone: Linux64 Standalone: Linux64
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
data: - first:
first:
Standalone: LinuxUniversal Standalone: LinuxUniversal
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
data: - first:
first:
Standalone: OSXIntel Standalone: OSXIntel
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
data: - first:
first:
Standalone: OSXIntel64 Standalone: OSXIntel64
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
data: - first:
first:
Standalone: OSXUniversal Standalone: OSXUniversal
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
data: - first:
first:
Standalone: Win Standalone: Win
second: second:
enabled: 1 enabled: 1
settings: settings:
CPU: AnyCPU CPU: AnyCPU
data: - first:
first:
Standalone: Win64 Standalone: Win64
second: second:
enabled: 1 enabled: 1
settings: settings:
CPU: AnyCPU CPU: AnyCPU
data: - first:
first:
Windows Store Apps: WindowsStoreApps Windows Store Apps: WindowsStoreApps
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
data: - first:
first:
iPhone: iOS iPhone: iOS
second: second:
enabled: 0 enabled: 0

View file

@ -5,11 +5,14 @@ PluginImporter:
serializedVersion: 2 serializedVersion: 2
iconMap: {} iconMap: {}
executionOrder: {} executionOrder: {}
defineConstraints: []
isPreloaded: 0 isPreloaded: 0
isOverridable: 0 isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData: platformData:
- first: - first:
'': Any : Any
second: second:
enabled: 0 enabled: 0
settings: settings:
@ -61,7 +64,7 @@ PluginImporter:
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: x86_64 CPU: AnyCPU
- first: - first:
Standalone: LinuxUniversal Standalone: LinuxUniversal
second: second:

View file

@ -1,17 +1,18 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 7d459a96865cc4aaab657012c6dc4833 guid: 7d459a96865cc4aaab657012c6dc4833
timeCreated: 1491979494
licenseType: Pro
PluginImporter: PluginImporter:
externalObjects: {}
serializedVersion: 2 serializedVersion: 2
iconMap: {} iconMap: {}
executionOrder: {} executionOrder: {}
defineConstraints: []
isPreloaded: 0 isPreloaded: 0
isOverridable: 0 isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData: platformData:
data: - first:
first: : Any
'': Any
second: second:
enabled: 0 enabled: 0
settings: settings:
@ -27,113 +28,97 @@ PluginImporter:
Exclude Win: 0 Exclude Win: 0
Exclude Win64: 0 Exclude Win64: 0
Exclude iOS: 1 Exclude iOS: 1
data: - first:
first: : Editor
'': Editor
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
OS: AnyOS OS: AnyOS
data: - first:
first:
Android: Android Android: Android
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: ARMv7 CPU: ARMv7
data: - first:
first:
Any: Any:
second: second:
enabled: 0 enabled: 0
settings: {} settings: {}
data: - first:
first:
Editor: Editor Editor: Editor
second: second:
enabled: 1 enabled: 1
settings: settings:
DefaultValueInitialized: true DefaultValueInitialized: true
data: - first:
first:
Facebook: Win Facebook: Win
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
data: - first:
first:
Facebook: Win64 Facebook: Win64
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
data: - first:
first:
Standalone: Linux Standalone: Linux
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
data: - first:
first:
Standalone: Linux64 Standalone: Linux64
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
data: - first:
first:
Standalone: LinuxUniversal Standalone: LinuxUniversal
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
data: - first:
first:
Standalone: OSXIntel Standalone: OSXIntel
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
data: - first:
first:
Standalone: OSXIntel64 Standalone: OSXIntel64
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
data: - first:
first:
Standalone: OSXUniversal Standalone: OSXUniversal
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
data: - first:
first:
Standalone: Win Standalone: Win
second: second:
enabled: 1 enabled: 1
settings: settings:
CPU: AnyCPU CPU: AnyCPU
data: - first:
first:
Standalone: Win64 Standalone: Win64
second: second:
enabled: 1 enabled: 1
settings: settings:
CPU: AnyCPU CPU: AnyCPU
data: - first:
first:
Windows Store Apps: WindowsStoreApps Windows Store Apps: WindowsStoreApps
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
data: - first:
first:
iPhone: iOS iPhone: iOS
second: second:
enabled: 0 enabled: 0

View file

@ -0,0 +1,14 @@
{
"name": "SFB.Runtime",
"rootNamespace": "",
"references": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ce432116effeafc4083f70bdcfcfaebb
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,8 +1,7 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 3c708be74128e4ced9b79eaaf80e8443 guid: 6ac7447aa2a17e641bf4918306b8234e
timeCreated: 1483902788
licenseType: Pro
MonoImporter: MonoImporter:
externalObjects: {}
serializedVersion: 2 serializedVersion: 2
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0

View file

@ -1,8 +1,7 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 2650af8de2cda46b99b1bc7cf5d30ca5 guid: 105f81a0406213b48a08543579184a2d
timeCreated: 1483902788
licenseType: Pro
MonoImporter: MonoImporter:
externalObjects: {}
serializedVersion: 2 serializedVersion: 2
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0

View file

@ -1,3 +1,11 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 5d3a668018554b8a89c3fe12de72b60c guid: 14ff0babaa1ef21468471738e2650b65
timeCreated: 1538067919 MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,8 +1,7 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: bcb49ddb0ed5644fda9c3b055cafa27a guid: b499e1a326c0d0d4d92d6b2f2378361d
timeCreated: 1483902788
licenseType: Pro
MonoImporter: MonoImporter:
externalObjects: {}
serializedVersion: 2 serializedVersion: 2
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0

View file

@ -4,7 +4,7 @@ using System;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using Ookii.Dialogs; using Ookii.Dialogs.WinForms;
namespace SFB { namespace SFB {
// For fullscreen support // For fullscreen support
@ -24,6 +24,8 @@ namespace SFB {
public string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) { public string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) {
var fd = new VistaOpenFileDialog(); var fd = new VistaOpenFileDialog();
fd.Title = title; fd.Title = title;
fd.InitialDirectory = directory;
fd.Multiselect = multiselect;
if (extensions != null) { if (extensions != null) {
fd.Filter = GetFilterFromFileExtensionList(extensions); fd.Filter = GetFilterFromFileExtensionList(extensions);
fd.FilterIndex = 1; fd.FilterIndex = 1;
@ -31,10 +33,6 @@ namespace SFB {
else { else {
fd.Filter = string.Empty; fd.Filter = string.Empty;
} }
fd.Multiselect = multiselect;
if (!string.IsNullOrEmpty(directory)) {
fd.FileName = GetDirectoryPath(directory);
}
var res = fd.ShowDialog(new WindowWrapper(GetActiveWindow())); var res = fd.ShowDialog(new WindowWrapper(GetActiveWindow()));
var filenames = res == DialogResult.OK ? fd.FileNames : new string[0]; var filenames = res == DialogResult.OK ? fd.FileNames : new string[0];
fd.Dispose(); fd.Dispose();
@ -48,11 +46,10 @@ namespace SFB {
public string[] OpenFolderPanel(string title, string directory, bool multiselect) { public string[] OpenFolderPanel(string title, string directory, bool multiselect) {
var fd = new VistaFolderBrowserDialog(); var fd = new VistaFolderBrowserDialog();
fd.Description = title; fd.Description = title;
if (!string.IsNullOrEmpty(directory)) { fd.RootFolder = Environment.SpecialFolder.MyComputer;
fd.SelectedPath = GetDirectoryPath(directory); fd.SelectedPath = directory;
}
var res = fd.ShowDialog(new WindowWrapper(GetActiveWindow())); var res = fd.ShowDialog(new WindowWrapper(GetActiveWindow()));
var filenames = res == DialogResult.OK ? new []{ fd.SelectedPath } : new string[0]; var filenames = res == DialogResult.OK ? new[] { fd.SelectedPath } : new string[0];
fd.Dispose(); fd.Dispose();
return filenames; return filenames;
} }
@ -64,18 +61,8 @@ namespace SFB {
public string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) { public string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) {
var fd = new VistaSaveFileDialog(); var fd = new VistaSaveFileDialog();
fd.Title = title; fd.Title = title;
fd.InitialDirectory = directory;
var finalFilename = ""; fd.FileName = defaultName;
if (!string.IsNullOrEmpty(directory)) {
finalFilename = GetDirectoryPath(directory);
}
if (!string.IsNullOrEmpty(defaultName)) {
finalFilename += defaultName;
}
fd.FileName = finalFilename;
if (extensions != null) { if (extensions != null) {
fd.Filter = GetFilterFromFileExtensionList(extensions); fd.Filter = GetFilterFromFileExtensionList(extensions);
fd.FilterIndex = 1; fd.FilterIndex = 1;
@ -100,9 +87,10 @@ namespace SFB {
// .NET Framework FileDialog Filter format // .NET Framework FileDialog Filter format
// https://msdn.microsoft.com/en-us/library/microsoft.win32.filedialog.filter // https://msdn.microsoft.com/en-us/library/microsoft.win32.filedialog.filter
private static string GetFilterFromFileExtensionList(ExtensionFilter[] extensions) { private static string GetFilterFromFileExtensionList(ExtensionFilter[] extensions) {
if (extensions == null) return "";
var filterString = ""; var filterString = "";
foreach (var filter in extensions) { foreach (var filter in extensions) {
filterString += filter.Name + "("; filterString += filter.Name + " (";
foreach (var ext in filter.Extensions) { foreach (var ext in filter.Extensions) {
filterString += "*." + ext + ","; filterString += "*." + ext + ",";
@ -120,17 +108,6 @@ namespace SFB {
filterString = filterString.Remove(filterString.Length - 1); filterString = filterString.Remove(filterString.Length - 1);
return filterString; return filterString;
} }
private static string GetDirectoryPath(string directory) {
var directoryPath = Path.GetFullPath(directory);
if (!directoryPath.EndsWith("\\")) {
directoryPath += "\\";
}
if (Path.GetPathRoot(directoryPath) == directoryPath) {
return directory;
}
return Path.GetDirectoryName(directoryPath) + Path.DirectorySeparatorChar;
}
} }
} }

View file

@ -1,8 +1,7 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 194e247414a78461d83ae606c1b96917 guid: b0b56749f8dd99840b6a2d81dc5a336d
timeCreated: 1483902788
licenseType: Pro
MonoImporter: MonoImporter:
externalObjects: {}
serializedVersion: 2 serializedVersion: 2
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0