Merge branch 'master' of https://bitbucket.org/omigamedev/new_engine
* 'master' of https://bitbucket.org/omigamedev/new_engine: add text input popup
This commit is contained in:
@@ -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<GameFilePicker*>(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
|
||||
|
||||
Reference in New Issue
Block a user