Spiritual Timekeeper Release 1.1.2.0


Two new things were added for 1.1.2.0:

  • Added version number to bottom-right of screen.
  • Fixed issue where ENTER and SPACEBAR didn't work to start the timer when the time was changed.

These were relatively minor things as far as usability goes, but there was a fair amount of refactoring that went on behind the scenes. The adding of the version number ended up being hugely time-consuming. While Godot stores its version number and you can easily update it in one spot, and all your project exports can use it - once you've exported a project, Godot the program can no longer see that information.

This resulted in exporting the information to a version.txt file so that every time it was updated, the program would pick it up and export the information to the file, so the project gets automatically updated. Unfortunately, by default, Godot doesn't export *.txt files. Fixing this didn't solve my problem, because the file was exported outside of the executable. The solution came by using the Resource Save/Load functionality. After a number of more complex versions, we ended up with this:

func get_version() -> String:
    var project_version = ""
    # Load version from resource if it exists
    if FileAccess.file_exists(version_file_path):
        var file = FileAccess.open(version_file_path, FileAccess.READ)
        project_version = file.get_var()
    
    # If we are running in the editor, this should update the latest version.
    var project_settings_version = ProjectSettings.get_setting("application/config/version")
    print_rich("Project Settings Version: %s" % [project_settings_version])
    print_rich("Saved Project Version: %s" % [project_version])
    
    # If we are in the editor and the project version is newer, update the resource
    if project_version != project_settings_version and project_settings_version != "":
        project_version = project_settings_version
        var file = FileAccess.open(version_file_path, FileAccess.WRITE)
        file.store_var(project_version)
    
    return "v%s" % project_version

The version number is now showing up in all the exported version.

Files

Spiritual Timekeeper - HTML5.zip Play in browser
59 days ago
Spiritual Timekeeper - Windows.zip 29 MB
59 days ago
Spiritual Timekeeper - Android.zip 24 MB
59 days ago
Spiritual Timekeeper - Linux.zip 22 MB
59 days ago
Spiritual Timekeeper - Mac.zip 51 MB
59 days ago

Get Spiritual Timekeeper

Leave a comment

Log in with itch.io to leave a comment.