Skip to content

Commit 0990d13

Browse files
committed
Fixed WaitForSaveDialog no longer working on Android (fixed #107)
1 parent 9847eb4 commit 0990d13

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

Plugins/SimpleFileBrowser/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= Simple File Browser (v1.7.3) =
1+
= Simple File Browser (v1.7.4) =
22

33
Documentation: https://github.com/yasirkula/UnitySimpleFileBrowser
44
FAQ: https://github.com/yasirkula/UnitySimpleFileBrowser#faq

Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2895,21 +2895,23 @@ public static IEnumerator WaitForSaveDialog( PickMode pickMode, bool allowMultiS
28952895
string initialPath = null, string initialFilename = null,
28962896
string title = "Save", string saveButtonText = "Save" )
28972897
{
2898-
if( !ShowSaveDialog( null, null, pickMode, allowMultiSelection, initialPath, initialFilename, title, saveButtonText ) )
2898+
bool? result = null;
2899+
if( !ShowSaveDialog( ( paths ) => result = true, () => result = false, pickMode, allowMultiSelection, initialPath, initialFilename, title, saveButtonText ) )
28992900
yield break;
29002901

2901-
while( Instance.gameObject.activeSelf )
2902+
while( !result.HasValue )
29022903
yield return null;
29032904
}
29042905

29052906
public static IEnumerator WaitForLoadDialog( PickMode pickMode, bool allowMultiSelection = false,
29062907
string initialPath = null, string initialFilename = null,
29072908
string title = "Load", string loadButtonText = "Select" )
29082909
{
2909-
if( !ShowLoadDialog( null, null, pickMode, allowMultiSelection, initialPath, initialFilename, title, loadButtonText ) )
2910+
bool? result = null;
2911+
if( !ShowLoadDialog( ( paths ) => result = true, () => result = false, pickMode, allowMultiSelection, initialPath, initialFilename, title, loadButtonText ) )
29102912
yield break;
29112913

2912-
while( Instance.gameObject.activeSelf )
2914+
while( !result.HasValue )
29132915
yield return null;
29142916
}
29152917

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.yasirkula.simplefilebrowser",
33
"displayName": "Simple File Browser",
4-
"version": "1.7.3",
4+
"version": "1.7.4",
55
"documentationUrl": "https://github.com/yasirkula/UnitySimpleFileBrowser",
66
"changelogUrl": "https://github.com/yasirkula/UnitySimpleFileBrowser/releases",
77
"licensesUrl": "https://github.com/yasirkula/UnitySimpleFileBrowser/blob/master/LICENSE.txt",

0 commit comments

Comments
 (0)