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,145 +1,130 @@
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: Exclude Android: 1
Exclude Android: 1 Exclude Editor: 0
Exclude Editor: 0 Exclude Linux: 1
Exclude Linux: 1 Exclude Linux64: 1
Exclude Linux64: 1 Exclude LinuxUniversal: 1
Exclude LinuxUniversal: 1 Exclude OSXIntel: 1
Exclude OSXIntel: 1 Exclude OSXIntel64: 1
Exclude OSXIntel64: 1 Exclude OSXUniversal: 1
Exclude OSXUniversal: 1 Exclude WebGL: 1
Exclude WebGL: 1 Exclude Win: 0
Exclude Win: 0 Exclude Win64: 0
Exclude Win64: 0 Exclude iOS: 1
Exclude iOS: 1 - first:
data: : Editor
first: second:
'': Editor enabled: 0
second: settings:
enabled: 0 CPU: AnyCPU
settings: OS: AnyOS
CPU: AnyCPU - first:
OS: AnyOS Android: Android
data: second:
first: enabled: 0
Android: Android settings:
second: CPU: ARMv7
enabled: 0 - first:
settings: Any:
CPU: ARMv7 second:
data: enabled: 0
first: settings: {}
Any: - first:
second: Editor: Editor
enabled: 0 second:
settings: {} enabled: 1
data: settings:
first: DefaultValueInitialized: true
Editor: Editor - first:
second: Facebook: Win
enabled: 1 second:
settings: enabled: 0
DefaultValueInitialized: true settings:
data: CPU: AnyCPU
first: - first:
Facebook: Win Facebook: Win64
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
data: - first:
first: Standalone: Linux
Facebook: Win64 second:
second: enabled: 0
enabled: 0 settings:
settings: CPU: None
CPU: AnyCPU - first:
data: Standalone: Linux64
first: second:
Standalone: Linux enabled: 0
second: settings:
enabled: 0 CPU: None
settings: - first:
CPU: None Standalone: LinuxUniversal
data: second:
first: enabled: 0
Standalone: Linux64 settings:
second: CPU: None
enabled: 0 - first:
settings: Standalone: OSXIntel
CPU: None second:
data: enabled: 0
first: settings:
Standalone: LinuxUniversal CPU: None
second: - first:
enabled: 0 Standalone: OSXIntel64
settings: second:
CPU: None enabled: 0
data: settings:
first: CPU: None
Standalone: OSXIntel - first:
second: Standalone: OSXUniversal
enabled: 0 second:
settings: enabled: 0
CPU: None settings:
data: CPU: None
first: - first:
Standalone: OSXIntel64 Standalone: Win
second: second:
enabled: 0 enabled: 1
settings: settings:
CPU: None CPU: AnyCPU
data: - first:
first: Standalone: Win64
Standalone: OSXUniversal second:
second: enabled: 1
enabled: 0 settings:
settings: CPU: AnyCPU
CPU: None - first:
data: Windows Store Apps: WindowsStoreApps
first: second:
Standalone: Win enabled: 0
second: settings:
enabled: 1 CPU: AnyCPU
settings: - first:
CPU: AnyCPU iPhone: iOS
data: second:
first: enabled: 0
Standalone: Win64 settings:
second: CompileFlags:
enabled: 1 FrameworkDependencies:
settings:
CPU: AnyCPU
data:
first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
data:
first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

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,145 +1,130 @@
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: Exclude Android: 1
Exclude Android: 1 Exclude Editor: 0
Exclude Editor: 0 Exclude Linux: 1
Exclude Linux: 1 Exclude Linux64: 1
Exclude Linux64: 1 Exclude LinuxUniversal: 1
Exclude LinuxUniversal: 1 Exclude OSXIntel: 1
Exclude OSXIntel: 1 Exclude OSXIntel64: 1
Exclude OSXIntel64: 1 Exclude OSXUniversal: 1
Exclude OSXUniversal: 1 Exclude WebGL: 1
Exclude WebGL: 1 Exclude Win: 0
Exclude Win: 0 Exclude Win64: 0
Exclude Win64: 0 Exclude iOS: 1
Exclude iOS: 1 - first:
data: : Editor
first: second:
'': Editor enabled: 0
second: settings:
enabled: 0 CPU: AnyCPU
settings: OS: AnyOS
CPU: AnyCPU - first:
OS: AnyOS Android: Android
data: second:
first: enabled: 0
Android: Android settings:
second: CPU: ARMv7
enabled: 0 - first:
settings: Any:
CPU: ARMv7 second:
data: enabled: 0
first: settings: {}
Any: - first:
second: Editor: Editor
enabled: 0 second:
settings: {} enabled: 1
data: settings:
first: DefaultValueInitialized: true
Editor: Editor - first:
second: Facebook: Win
enabled: 1 second:
settings: enabled: 0
DefaultValueInitialized: true settings:
data: CPU: AnyCPU
first: - first:
Facebook: Win Facebook: Win64
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
data: - first:
first: Standalone: Linux
Facebook: Win64 second:
second: enabled: 0
enabled: 0 settings:
settings: CPU: None
CPU: AnyCPU - first:
data: Standalone: Linux64
first: second:
Standalone: Linux enabled: 0
second: settings:
enabled: 0 CPU: None
settings: - first:
CPU: None Standalone: LinuxUniversal
data: second:
first: enabled: 0
Standalone: Linux64 settings:
second: CPU: None
enabled: 0 - first:
settings: Standalone: OSXIntel
CPU: None second:
data: enabled: 0
first: settings:
Standalone: LinuxUniversal CPU: None
second: - first:
enabled: 0 Standalone: OSXIntel64
settings: second:
CPU: None enabled: 0
data: settings:
first: CPU: None
Standalone: OSXIntel - first:
second: Standalone: OSXUniversal
enabled: 0 second:
settings: enabled: 0
CPU: None settings:
data: CPU: None
first: - first:
Standalone: OSXIntel64 Standalone: Win
second: second:
enabled: 0 enabled: 1
settings: settings:
CPU: None CPU: AnyCPU
data: - first:
first: Standalone: Win64
Standalone: OSXUniversal second:
second: enabled: 1
enabled: 0 settings:
settings: CPU: AnyCPU
CPU: None - first:
data: Windows Store Apps: WindowsStoreApps
first: second:
Standalone: Win enabled: 0
second: settings:
enabled: 1 CPU: AnyCPU
settings: - first:
CPU: AnyCPU iPhone: iOS
data: second:
first: enabled: 0
Standalone: Win64 settings:
second: CompileFlags:
enabled: 1 FrameworkDependencies:
settings:
CPU: AnyCPU
data:
first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
data:
first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

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,18 +108,7 @@ 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;
}
} }
} }
#endif #endif

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