remove != OK

This commit is contained in:
Teatov 2025-08-04 00:20:54 +10:00
parent 728cc4452d
commit 012fae3b3a
3 changed files with 7 additions and 7 deletions

View File

@ -27,7 +27,7 @@ var _config := ConfigFile.new()
func _ready() -> void:
_load_custom_layouts(CUSTOM_LAYOUTS_PATH)
var err := _load_config()
if err != OK:
if err:
_set_defaults()
@ -71,7 +71,7 @@ func _load_config() -> Error:
print("\nloading layout config....")
var err := _config.load(CONFIG_PATH)
if err != OK:
if err:
push_error("failed to load layout config file: '%s'" % error_string(err))
print()
return FAILED
@ -121,7 +121,7 @@ func _save_config() -> Error:
var err := _config.save(CONFIG_PATH)
if err != OK:
if err:
push_error("failed to save config file: '%s'" % error_string(err))
return err
@ -131,7 +131,7 @@ func _save_config() -> Error:
func _load_custom_layouts(path: String) -> void:
if not DirAccess.dir_exists_absolute(path):
var dir_err := DirAccess.make_dir_absolute(path)
if dir_err != OK:
if dir_err:
push_error(
"error creating directory '%s': %s" % [path, error_string(dir_err)]
)
@ -140,7 +140,7 @@ func _load_custom_layouts(path: String) -> void:
var file_err := DirAccess.copy_absolute(
CUSTOM_LAYOUTS_README, path.path_join(CUSTOM_LAYOUTS_README.get_file())
)
if file_err != OK:
if file_err:
push_error(
(
"error copying file '%s': %s"

View File

@ -49,7 +49,7 @@ func _load_json_file(path: String) -> Variant:
var content := file.get_as_text()
var json := JSON.new()
var err := json.parse(content)
if err != OK:
if err:
push_error(
(
"%s: json parse error at line %s: %s"

View File

@ -201,7 +201,7 @@ func _init(data: Dictionary, file_name: String) -> void:
var data_keys := data[LAYOUTS][layout_name][LAYOUT] as Array
var err := _get_keymap_keys(data_keys, file_name)
if err != OK:
if err:
_has_errors = true
return
_rows = _deserialize_keys(data_keys)