File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ signal tab_selected(index: int)
3636@warning_ignore ("unused_signal" )
3737signal layout_changed
3838
39+ var current_sdk : int = - 1
40+
3941const savedata_path = "user://savedata.tres"
4042var savedata : SaveData :
4143 set (new_value ):
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ func _ready() -> void:
1212 Configs .layout_changed .connect (update_layout )
1313 update_layout ()
1414 update_theme ()
15+ var version = JavaClassWrapper .wrap ("android.os.Build$VERSION" )
16+ if version : Configs .current_sdk = version .SDK_INT
1517
1618func update_theme () -> void :
1719 var stylebox := StyleBoxFlat .new ()
Original file line number Diff line number Diff line change @@ -182,7 +182,11 @@ static func open_xml_import_dialog(completion_callback: Callable) -> void:
182182# On web, the completion callback can't use the full file path.
183183static func _open_import_dialog (extensions : PackedStringArray ,
184184completion_callback : Callable , multi_select := false ) -> void :
185- if not OS .request_permission ("android.permission.READ_MEDIA_IMAGES" ):
185+ var permission := "android.permission.READ_MEDIA_IMAGES"
186+ if Configs .current_sdk < 33 :
187+ permission = "android.permission.READ_EXTERNAL_STORAGE"
188+
189+ if not OS .request_permission (permission ):
186190 return
187191
188192 var extensions_with_dots := PackedStringArray ()
You can’t perform that action at this time.
0 commit comments