Fixes database connections
This commit is contained in:
@@ -17,7 +17,7 @@ const possible_logins: = {
|
||||
@export var device_id : int
|
||||
|
||||
|
||||
func _init():
|
||||
func init_OS_language() -> void:
|
||||
# Gets the OS language and checks if it is supported
|
||||
var osLanguage = OS.get_locale_language();
|
||||
if osLanguage and osLanguage in DirAccess.open("res://language_resources").get_directories():
|
||||
|
||||
@@ -35,8 +35,8 @@ var words_path: = base_path + language + "/words/"
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
language = UserDataManager.get_device_settings().language
|
||||
db_path = db_path
|
||||
pass
|
||||
# db_path = db_path
|
||||
#_import_words_csv()
|
||||
#_import_look_and_learn_data()
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ func _ready():
|
||||
|
||||
|
||||
func login(language : String, teacher : String, password : String, device_id : int) -> bool:
|
||||
|
||||
if teacher not in DeviceSettings.possible_logins or password != DeviceSettings.possible_logins[teacher]:
|
||||
return false
|
||||
|
||||
@@ -34,7 +33,8 @@ func login(language : String, teacher : String, password : String, device_id : i
|
||||
return false
|
||||
|
||||
# Handles device settings
|
||||
_device_settings.language = language
|
||||
if _device_settings.language != language:
|
||||
_device_settings.language = language
|
||||
_device_settings.teacher = teacher
|
||||
_device_settings.device_id = device_id
|
||||
_save_device_settings()
|
||||
@@ -69,6 +69,7 @@ func _load_device_settings() -> void:
|
||||
_device_settings = load(get_device_settings_path())
|
||||
if not _device_settings:
|
||||
_device_settings = DeviceSettings.new()
|
||||
_device_settings.init_OS_language()
|
||||
_save_device_settings()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user