Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
feat(project) set to the corect version
Browse files Browse the repository at this point in the history
  • Loading branch information
Levrault committed Aug 20, 2021
1 parent d90963c commit ecdbe3a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ _global_script_class_icons={

[Info]

version="v1.2.0"
version="v1.1.0"
wiki="https://github.com/Levrault/levrault-dialogue-editor/wiki"
github="https://github.com/Levrault/levrault-dialogue-editor"
twitter="https://twitter.com/LFLangis"
Expand Down
14 changes: 7 additions & 7 deletions src/Autoload/Config.gd
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,16 @@ func sync_workspace_list_to_existing_file(loaded_settings) -> void:
func update_workspace_file_if_needed(loaded_settings: Dictionary, path: String) -> void:
var has_been_updated := false

# from 1.0.0-beta to 1.2.0
# from 1.0.0-beta to 1.1.0
if (
not loaded_settings.has("info")
or loaded_settings.info.version.empty()
or loaded_settings.path.has("resource")
or loaded_settings.path.has("path")
):
UpdateTool.migrate_workspace_v1_x_x_to_v1_2_0(loaded_settings, DEFAULT_VALUES)
UpdateTool.migrate_workspace_v1_x_x_to_v1_1_0(loaded_settings, DEFAULT_VALUES)
has_been_updated = true
print_debug("%s workspace file has been update to 1.2.0" % path)
print_debug("%s workspace file has been update to 1.1.0" % path)

if loaded_settings.info.version != ProjectSettings.get_setting("Info/version"):
UpdateTool.migrate_to_last_version_only(loaded_settings)
Expand All @@ -193,13 +193,13 @@ func update_workspace_file_if_needed(loaded_settings: Dictionary, path: String)
func update_editor_config_if_needed(loaded_settings: Dictionary) -> void:
var has_been_updated := false

# from 1.0.0-beta to 1.2.0
# from 1.0.0-beta to 1.1.0
if not loaded_settings.has("info") or loaded_settings.info.version.empty():
UpdateTool.migrate_editor_config_v1_x_x_to_v1_2_0(loaded_settings, DEFAULT_GLOBALS)
UpdateTool.migrate_editor_config_v1_x_x_to_v1_1_0(loaded_settings, DEFAULT_GLOBALS)
has_been_updated = true
print_debug("Editor file has been update to 1.2.0")
print_debug("Editor file has been update to 1.1.0")

# > 1.2.0
# > 1.1.0
if loaded_settings.info.version != ProjectSettings.get_setting("Info/version"):
UpdateTool.migrate_to_last_version_only(loaded_settings)

Expand Down
8 changes: 4 additions & 4 deletions src/Utils/UpdateTool.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ static func migrate_to_last_version_only(legacy: Dictionary) -> void:
# remove depreciated path.file
# remove depreciated path.resource
# remove window height, width and fullscreen
static func migrate_workspace_v1_x_x_to_v1_2_0(legacy: Dictionary, default_values: Dictionary) -> void:
static func migrate_workspace_v1_x_x_to_v1_1_0(legacy: Dictionary, default_values: Dictionary) -> void:
if not legacy.has("info"):
legacy["info"] = default_values.info.duplicate(true)
legacy["info"]["version"] = "v1.2.0"
legacy["info"]["version"] = "v1.1.0"

if legacy.path.has("file"):
legacy.path.erase("file")
Expand All @@ -29,10 +29,10 @@ static func migrate_workspace_v1_x_x_to_v1_2_0(legacy: Dictionary, default_value
# Save editor version inside the config file
# Add version editor
# Add has_name and has_portrait inside each link to workspace
static func migrate_editor_config_v1_x_x_to_v1_2_0(legacy: Dictionary, global_default: Dictionary) -> void:
static func migrate_editor_config_v1_x_x_to_v1_1_0(legacy: Dictionary, global_default: Dictionary) -> void:
if not legacy.has("info"):
legacy["info"] = global_default.info.duplicate(true)
legacy["info"]["version"] = "v1.2.0"
legacy["info"]["version"] = "v1.1.0"

for workspace in legacy.workspaces.list:
if workspace.get("has_portrait") == null:
Expand Down

0 comments on commit ecdbe3a

Please sign in to comment.