Skip to content

Commit

Permalink
Versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlizard committed Nov 29, 2023
1 parent 7e76700 commit 8535b09
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 15 deletions.
3 changes: 0 additions & 3 deletions Autoload/Constants.gd
Original file line number Diff line number Diff line change
@@ -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

Expand Down
9 changes: 9 additions & 0 deletions Autoload/Version.gd
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Scenes/AboutWindow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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

6 changes: 3 additions & 3 deletions Scenes/CurrentMap.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion Scenes/CustomSlabSystem.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Scenes/Main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion Scenes/WriteData.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions addons/IncludeOnExport/export.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
#
Expand Down
2 changes: 1 addition & 1 deletion addons/UnearthEditorPlugin/UnearthPlugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ extends EditorPlugin

func _ready():
# When loading up Godot, show version
print("Unearth v" + Constants.VERSION)
print("Unearth v" + Version.full)
2 changes: 1 addition & 1 deletion addons/UnearthEditorPlugin/plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ extends EditorPlugin

func _ready():
# When loading up Godot, show version
print("Unearth v" + Constants.VERSION)
print("Unearth v" + Version.full)
1 change: 1 addition & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 8535b09

Please sign in to comment.