From 949ee9f1605f095fc5bf2075865d9dd7b37e8304 Mon Sep 17 00:00:00 2001 From: rainlizard Date: Wed, 29 Nov 2023 23:46:13 +1100 Subject: [PATCH] messages --- Autoload/Columnset.gd | 8 ++++---- Autoload/Slabset.gd | 10 +++++----- Scenes/SlabsetWindow.gd | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Autoload/Columnset.gd b/Autoload/Columnset.gd index 6431c809..7043eb7e 100644 --- a/Autoload/Columnset.gd +++ b/Autoload/Columnset.gd @@ -27,7 +27,7 @@ func load_default_columnset(): var filePath = oGame.get_precise_filepath(oGame.DK_FXDATA_DIRECTORY, "COLUMNSET.CFG") if filePath != "": # Load columnset.cfg file - import_cfg_columnset(filePath, true) + import_cfg_columnset(filePath, true, false) else: # Load slabs.clm file load_default_original_columnset() @@ -78,13 +78,13 @@ func store_default_data(): default_data["floorTexture"] = floorTexture.duplicate(true) -func import_cfg_columnset(filePath, fullExport): +func import_cfg_columnset(filePath, fullExport, showMessages): var oMessage = Nodelist.list["oMessage"] var cfg = ConfigFile.new() var err = cfg.load(filePath) if err != OK: - oMessage.quick("Failed to load config file: " + str(filePath)) + if showMessages == true: oMessage.quick("Failed to load config file: " + str(filePath)) return for section in cfg.get_sections(): @@ -99,7 +99,7 @@ func import_cfg_columnset(filePath, fullExport): orientation[columnIndex] = cfg.get_value(section, "Orientation", 0) cubes[columnIndex] = cfg.get_value(section, "Cubes", [0,0,0,0, 0,0,0,0]) - oMessage.quick("Merged: " + str(filePath)) + if showMessages == true: oMessage.quick("Merged: " + str(filePath)) diff --git a/Autoload/Slabset.gd b/Autoload/Slabset.gd index 5ea1d922..7ae201eb 100644 --- a/Autoload/Slabset.gd +++ b/Autoload/Slabset.gd @@ -46,7 +46,7 @@ func load_default_slabset(): var filePath = oGame.get_precise_filepath(oGame.DK_FXDATA_DIRECTORY, "SLABSET.CFG") if filePath != "": # Load slabset.cfg file - import_cfg_slabset(filePath, true) + import_cfg_slabset(filePath, true, false) else: # Load slabs.dat and slabs.tng files load_default_original_slabset() @@ -96,15 +96,15 @@ func store_default_data(): default_data["tng"] = tng.duplicate(true) -func import_cfg_slabset(filePath, fullImport): +func import_cfg_slabset(filePath, fullImport, showMessages): var processed_string = preprocess_cfg_file(filePath) if processed_string == null: - oMessage.quick("Failed to open file: " + str(filePath)) + if showMessages == true: oMessage.quick("Failed to open file: " + str(filePath)) return var cfg = ConfigFile.new() var err = cfg.parse(processed_string) if err != OK: - oMessage.quick("Failed to parse config file") + if showMessages == true: oMessage.quick("Failed to parse config file") return resize_dat_and_tng_based_on_cfg(cfg) @@ -141,7 +141,7 @@ func import_cfg_slabset(filePath, fullImport): "ThingType": getObject[obj.THING_TYPE] = int(value) #int(Things.reverse_data_structure_name.get(value, 0)) "Subtype": getObject[obj.THING_SUBTYPE] = int(value) "EffectRange": getObject[obj.EFFECT_RANGE] = int(value) - oMessage.quick("Merged: " + str(filePath)) + if showMessages == true: oMessage.quick("Merged: " + str(filePath)) func resize_dat_and_tng_based_on_cfg(cfg): # Determine maximum needed size for dat and tng arrays diff --git a/Scenes/SlabsetWindow.gd b/Scenes/SlabsetWindow.gd index 135f421f..15cc041b 100644 --- a/Scenes/SlabsetWindow.gd +++ b/Scenes/SlabsetWindow.gd @@ -264,7 +264,7 @@ func _on_ExportSlabsetCfgDialog_file_selected(filePath): func _on_ImportSlabsetCfgDialog_file_selected(filePath): var fullImport = oExportImportSlabsFullCheckBox.pressed - Slabset.import_cfg_slabset(filePath, fullImport) + Slabset.import_cfg_slabset(filePath, fullImport, true) update_columns_ui() update_objects_ui() @@ -274,7 +274,7 @@ func _on_ExportColumnsetCfgDialog_file_selected(filePath): func _on_ImportColumnsetCfgDialog_file_selected(filePath): var fullImport = oExportImportColumnsFullCheckBox.pressed - Columnset.import_cfg_columnset(filePath, fullImport) + Columnset.import_cfg_columnset(filePath, fullImport, true) # Update columnset visuals here oColumnsetVoxelView.refresh_entire_view()