From ec0a7871663767d6aa3bbeffbded6071fb46755f Mon Sep 17 00:00:00 2001 From: Rekku Date: Thu, 12 Sep 2024 16:48:16 +0100 Subject: [PATCH] cfg parser update 1 --- tools/configurator/scripts/GlobalsTab.gd | 6 +++++- tools/configurator/scripts/data_handler.gd | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/configurator/scripts/GlobalsTab.gd b/tools/configurator/scripts/GlobalsTab.gd index ea7458a0..a2ce70d2 100644 --- a/tools/configurator/scripts/GlobalsTab.gd +++ b/tools/configurator/scripts/GlobalsTab.gd @@ -41,4 +41,8 @@ func disable_global(button: Button) -> void: change_global(result) func change_global(parameters: Array) -> void: - print (parameters) + parameters.push_front("build_preset_config") + class_functions.logger("d", "Running: %s" % var_to_str(parameters)) + var result: Dictionary + result = await class_functions.run_thread_command(class_functions.wrapper_command, parameters, false) + class_functions.logger("d", "Exit code: %s" % result["exit_code"]) diff --git a/tools/configurator/scripts/data_handler.gd b/tools/configurator/scripts/data_handler.gd index d196ffc6..1e5cd77f 100644 --- a/tools/configurator/scripts/data_handler.gd +++ b/tools/configurator/scripts/data_handler.gd @@ -318,7 +318,7 @@ func write_cfg_file(file_path: String, lines: Array, changes: Dictionary) -> voi func change_cfg_value(file_path: String, key: String, section: String, new_value: String) -> Array: var lines: Array = read_cfg_file(file_path) - var args: Array =[key, section, new_value] + var parameters: Array =[key, section] var changes: Dictionary = {} if section in changes: changes[section][key] = new_value @@ -326,4 +326,4 @@ func change_cfg_value(file_path: String, key: String, section: String, new_value changes[section] = {key: new_value} class_functions.logger("d", "No Change: Key: %s Section %s New Value: %s" % [key, section, new_value]) write_cfg_file(file_path, lines, changes) - return args + return parameters