diff --git a/Autoload/Constants.gd b/Autoload/Constants.gd index 258c74c8..01de71c7 100644 --- a/Autoload/Constants.gd +++ b/Autoload/Constants.gd @@ -1,7 +1,4 @@ extends Node -const VERSION = "0.40" -const unearth_map_format_version:float = 1.05 - const TILE_SIZE = 96 const SUBTILE_SIZE = 32 diff --git a/Autoload/Version.gd b/Autoload/Version.gd new file mode 100644 index 00000000..8eefbc97 --- /dev/null +++ b/Autoload/Version.gd @@ -0,0 +1,9 @@ +extends Node + +var major_minor = "0.40" +var patch = "0000" +var full = "" +var unearth_map_format_version:float = 1.05 + +func _init(): + full = major_minor + "." + patch diff --git a/Scenes/AboutWindow.gd b/Scenes/AboutWindow.gd index ad632306..cd7bf864 100644 --- a/Scenes/AboutWindow.gd +++ b/Scenes/AboutWindow.gd @@ -15,5 +15,5 @@ func on_link_clicked(id): func _on_AboutWindow_about_to_show(): #if is_instance_valid(oMain) == false: return #oUnearthVerLabel.text = - window_title = 'Unearth v'+Constants.VERSION + window_title = 'Unearth v'+Version.full diff --git a/Scenes/CurrentMap.gd b/Scenes/CurrentMap.gd index 80f21884..c24299bd 100644 --- a/Scenes/CurrentMap.gd +++ b/Scenes/CurrentMap.gd @@ -34,17 +34,17 @@ enum { } func _init(): - OS.set_window_title('Unearth v'+Constants.VERSION) + OS.set_window_title('Unearth v'+Version.full) func _on_ButtonNewMap_pressed(): oOpenMap.open_map("") # This means "blank" map func set_path_and_title(newpath): if newpath != "": - OS.set_window_title(newpath + ' - Unearth v'+Constants.VERSION) + OS.set_window_title(newpath + ' - Unearth v'+Version.full) oMenu.add_recent(newpath) # Add saved maps to the recent menu else: - OS.set_window_title('Unearth v'+Constants.VERSION) + OS.set_window_title('Unearth v'+Version.full) path = newpath oGame.reconstruct_command_line() # Always update command line whenever the path changes diff --git a/Scenes/CustomSlabSystem.gd b/Scenes/CustomSlabSystem.gd index 1d09d71d..79dba086 100644 --- a/Scenes/CustomSlabSystem.gd +++ b/Scenes/CustomSlabSystem.gd @@ -90,7 +90,6 @@ func add_custom_slab(slab_dict): cfg.set_value(section,"floor"+str(i),slab_dict.floor_data[i]) cfg.save(Settings.unearthdata.plus_file("custom_slabs.cfg")) - print(Slabs.data) func remove_custom_slab(header_id): oPickSlabWindow.set_selection(null) diff --git a/Scenes/Main.gd b/Scenes/Main.gd index 58c7af07..675a6552 100644 --- a/Scenes/Main.gd +++ b/Scenes/Main.gd @@ -3,7 +3,7 @@ onready var oTextureCache = Nodelist.list["oTextureCache"] onready var oGenerateTerrain = Nodelist.list["oGenerateTerrain"] func _enter_tree(): - print("Unearth v"+Constants.VERSION) + print("Unearth v"+Version.full) Nodelist.start(self) func _ready(): diff --git a/Scenes/WriteData.gd b/Scenes/WriteData.gd index e114a892..fdb06ef7 100644 --- a/Scenes/WriteData.gd +++ b/Scenes/WriteData.gd @@ -20,7 +20,7 @@ var value # just so I don't have to initialize the var in every function func write_keeperfx_lof(buffer): var newString = "" newString += "; KeeperFX Level Overview File (LOF)" + "\n" - newString += "MAP_FORMAT_VERSION = " + str(Constants.unearth_map_format_version).pad_decimals(2) + "\n" + newString += "MAP_FORMAT_VERSION = " + str(Version.unearth_map_format_version).pad_decimals(2) + "\n" newString += "NAME_TEXT = " + str(oDataLof.NAME_TEXT) + "\n" newString += "NAME_ID = " + str(oDataLof.NAME_ID) + "\n" newString += "KIND = " + str(oDataLof.KIND) + "\n" diff --git a/addons/IncludeOnExport/export.gd b/addons/IncludeOnExport/export.gd index 6068ef72..2202b776 100644 --- a/addons/IncludeOnExport/export.gd +++ b/addons/IncludeOnExport/export.gd @@ -17,7 +17,7 @@ func _export_begin(features, is_debug, export_path, flags): _export_file_our_way(i) func _export_end(): - print("Unearth v" + Constants.VERSION) + print("Unearth v" + Version.full) # if OS.get_name() == "Windows": # zip_it_up(output_root_dir) @@ -80,9 +80,9 @@ func dir_contents(path): #func zip_it_up(folder_to_zip_up): # var createFileName # if theExportFeatures.has("Windows") == true: # On 3.5, it's capitalized "Windows", on 4.0 it's lowercase "windows" -# createFileName = "Unearth v" + Constants.VERSION + ".zip" +# createFileName = "Unearth v" + Version.full + ".zip" # else: -# createFileName = "UnearthLinux v" + Constants.VERSION + ".zip" +# createFileName = "UnearthLinux v" + Version.full + ".zip" # # var output_zip_filepath = folder_to_zip_up.get_base_dir().plus_file(createFileName) # diff --git a/addons/UnearthEditorPlugin/UnearthPlugin.gd b/addons/UnearthEditorPlugin/UnearthPlugin.gd index 7fcd5b75..89bdd5ad 100644 --- a/addons/UnearthEditorPlugin/UnearthPlugin.gd +++ b/addons/UnearthEditorPlugin/UnearthPlugin.gd @@ -3,4 +3,4 @@ extends EditorPlugin func _ready(): # When loading up Godot, show version - print("Unearth v" + Constants.VERSION) + print("Unearth v" + Version.full) diff --git a/addons/UnearthEditorPlugin/plugin.gd b/addons/UnearthEditorPlugin/plugin.gd index 7fcd5b75..89bdd5ad 100644 --- a/addons/UnearthEditorPlugin/plugin.gd +++ b/addons/UnearthEditorPlugin/plugin.gd @@ -3,4 +3,4 @@ extends EditorPlugin func _ready(): # When loading up Godot, show version - print("Unearth v" + Constants.VERSION) + print("Unearth v" + Version.full) diff --git a/project.godot b/project.godot index a1503b3e..be9f8b67 100644 --- a/project.godot +++ b/project.godot @@ -64,6 +64,7 @@ Filetypes="*res://Autoload/Filetypes.gd" M="*res://Autoload/M.gd" Slabset="*res://Autoload/Slabset.gd" Columnset="*res://Autoload/Columnset.gd" +Version="*res://Autoload/Version.gd" [debug]