diff --git a/PanoPainter.vcxproj b/PanoPainter.vcxproj index 667d395..85f4df0 100644 --- a/PanoPainter.vcxproj +++ b/PanoPainter.vcxproj @@ -352,6 +352,7 @@ + @@ -478,6 +479,7 @@ + diff --git a/PanoPainter.vcxproj.filters b/PanoPainter.vcxproj.filters index 5e0ede5..d359561 100644 --- a/PanoPainter.vcxproj.filters +++ b/PanoPainter.vcxproj.filters @@ -366,6 +366,9 @@ libs\glad + + Source Files + @@ -608,6 +611,9 @@ Header Files\ui + + Header Files + diff --git a/PanoPainter.xcodeproj/project.pbxproj b/PanoPainter.xcodeproj/project.pbxproj index deedb4e..fa5c59f 100644 --- a/PanoPainter.xcodeproj/project.pbxproj +++ b/PanoPainter.xcodeproj/project.pbxproj @@ -156,6 +156,8 @@ AD7FB09222470DE5005913AB /* app_vr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD7FB09122470DE2005913AB /* app_vr.cpp */; }; AD7FB09322470DE5005913AB /* app_vr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD7FB09122470DE2005913AB /* app_vr.cpp */; }; AD83A0D323268B6F005B0871 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD83A0D223268B6F005B0871 /* MobileCoreServices.framework */; }; + AD83A0D9232A7906005B0871 /* node_input_box.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD83A0D7232A7905005B0871 /* node_input_box.cpp */; }; + AD83A0DA232A793A005B0871 /* node_input_box.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD83A0D7232A7905005B0871 /* node_input_box.cpp */; }; ADA2A57822BE8D8E00C6B6C9 /* node_tool_bucket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ADA2A57622BE8D8E00C6B6C9 /* node_tool_bucket.cpp */; }; ADA2A57922BE8D8E00C6B6C9 /* node_tool_bucket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ADA2A57622BE8D8E00C6B6C9 /* node_tool_bucket.cpp */; }; ADA3ABF6222C8C370083B825 /* node_panel_quick.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ADA3ABF4222C8C350083B825 /* node_panel_quick.cpp */; }; @@ -462,6 +464,8 @@ AD7FB08E22470C75005913AB /* node_panel_floating.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = node_panel_floating.cpp; sourceTree = ""; }; AD7FB09122470DE2005913AB /* app_vr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = app_vr.cpp; sourceTree = ""; }; AD83A0D223268B6F005B0871 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk/System/Library/Frameworks/MobileCoreServices.framework; sourceTree = DEVELOPER_DIR; }; + AD83A0D7232A7905005B0871 /* node_input_box.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = node_input_box.cpp; sourceTree = ""; }; + AD83A0D8232A7906005B0871 /* node_input_box.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = node_input_box.h; sourceTree = ""; }; AD8CF71F1E913F0500083FFD /* log.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = log.cpp; sourceTree = ""; }; AD8CF7201E913F0500083FFD /* log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = log.h; sourceTree = ""; }; AD95AEC31E41EDEC002DD03A /* font.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = font.cpp; sourceTree = ""; }; @@ -728,6 +732,8 @@ AD1063621EC7ADFA002A525F /* node_image_texture.h */, AD1063631EC7ADFA002A525F /* node_image.cpp */, AD1063641EC7ADFA002A525F /* node_image.h */, + AD83A0D7232A7905005B0871 /* node_input_box.cpp */, + AD83A0D8232A7906005B0871 /* node_input_box.h */, AD1063651EC7ADFA002A525F /* node_message_box.cpp */, AD1063661EC7ADFA002A525F /* node_message_box.h */, AD1063671EC7ADFA002A525F /* node_panel_brush.cpp */, @@ -1478,6 +1484,7 @@ AD0E5CC01ECC72AD00C35669 /* node_icon.cpp in Sources */, AD0E5CC11ECC72AD00C35669 /* node_image_texture.cpp in Sources */, ADF4F7762263920400422C7C /* settings.cpp in Sources */, + AD83A0DA232A793A005B0871 /* node_input_box.cpp in Sources */, AD0E5CBD1ECC72AD00C35669 /* node_checkbox.cpp in Sources */, ADBC8C581FAFD05A0094B339 /* node_dialog_cloud.cpp in Sources */, AD7FB086223E8A43005913AB /* YGLayout.cpp in Sources */, @@ -1512,6 +1519,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + AD83A0D9232A7906005B0871 /* node_input_box.cpp in Sources */, AD7FB07B223E8A42005913AB /* log.cpp in Sources */, AD74030F1FB9D0D3004ACFCC /* node_combobox.cpp in Sources */, ADBC8C571FAFD05A0094B339 /* node_dialog_cloud.cpp in Sources */, diff --git a/PanoPainter/GameViewController.h b/PanoPainter/GameViewController.h index 41f69f9..5fe26ce 100644 --- a/PanoPainter/GameViewController.h +++ b/PanoPainter/GameViewController.h @@ -34,6 +34,7 @@ - (void)async_swap; - (void)pick_photo:(std::function) callback; - (void)pick_file:(NSArray*)types then:(std::function)callback; +- (void)pick_file_save:(std::string)path; - (void)registerForKeyboardNotifications; - (void)unregisterForKeyboardNotifications; - (void)crash; diff --git a/PanoPainter/GameViewController.m b/PanoPainter/GameViewController.m index 259641e..0efca1a 100644 --- a/PanoPainter/GameViewController.m +++ b/PanoPainter/GameViewController.m @@ -180,18 +180,28 @@ std::recursive_mutex lock_mutex; (__bridge CFStringRef)ext, NULL); [UTIs addObject:typeForExt]; } - + GameFilePicker *picker = [[GameFilePicker alloc] initWithDocumentTypes:UTIs inMode:UIDocumentPickerModeImport]; picker.delegate = self; picker->callback = callback; [self presentViewController:picker animated:YES completion:NULL]; } +- (void)pick_file_save:(std::string)path +{ + NSURL* url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:path.c_str()]]; + GameFilePicker *picker = [[GameFilePicker alloc] initWithURL:url inMode:UIDocumentPickerModeMoveToService]; + picker.delegate = self; + [self presentViewController:picker animated:YES completion:NULL]; +} -(void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url { NSString *chosenImage = [url path]; GameFilePicker* p = static_cast(controller); - std::string path = [chosenImage cStringUsingEncoding:NSUTF8StringEncoding]; - p->callback(path); + if (p->callback) + { + std::string path = [chosenImage cStringUsingEncoding:NSUTF8StringEncoding]; + p->callback(path); + } [controller dismissViewControllerAnimated:YES completion:NULL]; } -(void)documentPickerWasCancelled:(UIDocumentPickerViewController *)controller diff --git a/data/layout.xml b/data/layout.xml index 869673c..a827bdf 100644 --- a/data/layout.xml +++ b/data/layout.xml @@ -873,7 +873,28 @@ - + + + + + + + + + + + + + + +