mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-11 17:38:38 +00:00
* open dialog at default configs directory
This commit is contained in:
parent
3a57269510
commit
fdd30413c4
@ -42,13 +42,14 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||||||
@objc func openPreset(_ sender: Any?) {
|
@objc func openPreset(_ sender: Any?) {
|
||||||
let dialog = NSOpenPanel();
|
let dialog = NSOpenPanel();
|
||||||
|
|
||||||
dialog.title = "Choose a items.json file";
|
dialog.title = "Choose a items.json file"
|
||||||
dialog.showsResizeIndicator = true;
|
dialog.showsResizeIndicator = true
|
||||||
dialog.showsHiddenFiles = true;
|
dialog.showsHiddenFiles = true
|
||||||
dialog.canChooseDirectories = false;
|
dialog.canChooseDirectories = false
|
||||||
dialog.canCreateDirectories = false;
|
dialog.canCreateDirectories = false
|
||||||
dialog.allowsMultipleSelection = false;
|
dialog.allowsMultipleSelection = false
|
||||||
dialog.allowedFileTypes = ["json"];
|
dialog.allowedFileTypes = ["json"]
|
||||||
|
dialog.directoryURL = NSURL.fileURL(withPath: NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true).first!.appending("/MTMR"), isDirectory: true)
|
||||||
|
|
||||||
if (dialog.runModal() == NSApplication.ModalResponse.OK) {
|
if (dialog.runModal() == NSApplication.ModalResponse.OK) {
|
||||||
let result = dialog.url
|
let result = dialog.url
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user