From 60351f81997edba595b5ee87b94da09034f490ac Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Wed, 31 Jan 2024 14:02:23 +0100 Subject: [PATCH] add db path candidates --- godot/global.gd | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/godot/global.gd b/godot/global.gd index e9528ea..ee74620 100644 --- a/godot/global.gd +++ b/godot/global.gd @@ -21,7 +21,16 @@ func _ready(): var err = config.load(config_path) if err == OK: var db_path = config.get_value("general", "db_path") - load_db(db_path) + var db_success = load_db(db_path) + if not db_success: + # HACK: File picker on Android is broken + const possible_cfg_paths = ["/foo/bar/logue.cfg"] + for possible_path in possible_cfg_paths: + if FileAccess.file_exists(possible_path): + db_success = load_db(possible_path) + if db_success: + break + func switch_state(new: State): var old = current_state