Skip to content

Commit

Permalink
Add some build constants.
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed Sep 6, 2023
1 parent b909ec2 commit 7da328d
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
10 changes: 10 additions & 0 deletions addons/vsk_version/build_constants.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2018-present. This file is part of V-Sekai https://v-sekai.org/.
# SaracenOne & K. S. Ernest (Fire) Lee & Lyuma & MMMaellon & Contributors
# build_constants.gd
# SPDX-License-Identifier: MIT

# Set by the build system, do not modify!

const BUILD_LABEL = "DEVELOPER_BUILD"
const BUILD_DATE_STR = "Build Date"
const BUILD_UNIX_TIME = -1
7 changes: 7 additions & 0 deletions addons/vsk_version/plugin.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[plugin]
name="VSK Version"
description="Singleton for accessing information about the current build version."
author="Saracen"
version="1.0"
installs=true
script="vsk_version_plugin.gd"
13 changes: 13 additions & 0 deletions addons/vsk_version/vsk_version.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2018-present. This file is part of V-Sekai https://v-sekai.org/.
# SaracenOne & K. S. Ernest (Fire) Lee & Lyuma & MMMaellon & Contributors
# vsk_version.gd
# SPDX-License-Identifier: MIT

@tool
extends Node

const build_constants_const = preload("build_constants.gd")


static func get_build_label() -> String:
return build_constants_const.BUILD_DATE_STR + "\n" + build_constants_const.BUILD_LABEL
32 changes: 32 additions & 0 deletions addons/vsk_version/vsk_version_plugin.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (c) 2018-present. This file is part of V-Sekai https://v-sekai.org/.
# SaracenOne & K. S. Ernest (Fire) Lee & Lyuma & MMMaellon & Contributors
# vsk_version_plugin.gd
# SPDX-License-Identifier: MIT

@tool
extends EditorPlugin

var editor_interface: EditorInterface = null


func _init():
print("Initialising VSKVersion plugin")


func _notification(p_notification: int):
match p_notification:
NOTIFICATION_PREDELETE:
print("Destroying VSKVersion plugin")


func _get_plugin_name() -> String:
return "VSKVersion"


func _enter_tree() -> void:
editor_interface = get_editor_interface()
add_autoload_singleton("VSKVersion", "res://addons/vsk_version/vsk_version.gd")


func _exit_tree() -> void:
remove_autoload_singleton("VSKVersion")

0 comments on commit 7da328d

Please sign in to comment.