Skip to content

Commit 7da328d

Browse files
committed
Add some build constants.
1 parent b909ec2 commit 7da328d

File tree

4 files changed

+62
-0
lines changed

4 files changed

+62
-0
lines changed

addons/vsk_version/build_constants.gd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2018-present. This file is part of V-Sekai https://v-sekai.org/.
2+
# SaracenOne & K. S. Ernest (Fire) Lee & Lyuma & MMMaellon & Contributors
3+
# build_constants.gd
4+
# SPDX-License-Identifier: MIT
5+
6+
# Set by the build system, do not modify!
7+
8+
const BUILD_LABEL = "DEVELOPER_BUILD"
9+
const BUILD_DATE_STR = "Build Date"
10+
const BUILD_UNIX_TIME = -1

addons/vsk_version/plugin.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[plugin]
2+
name="VSK Version"
3+
description="Singleton for accessing information about the current build version."
4+
author="Saracen"
5+
version="1.0"
6+
installs=true
7+
script="vsk_version_plugin.gd"

addons/vsk_version/vsk_version.gd

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2018-present. This file is part of V-Sekai https://v-sekai.org/.
2+
# SaracenOne & K. S. Ernest (Fire) Lee & Lyuma & MMMaellon & Contributors
3+
# vsk_version.gd
4+
# SPDX-License-Identifier: MIT
5+
6+
@tool
7+
extends Node
8+
9+
const build_constants_const = preload("build_constants.gd")
10+
11+
12+
static func get_build_label() -> String:
13+
return build_constants_const.BUILD_DATE_STR + "\n" + build_constants_const.BUILD_LABEL
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright (c) 2018-present. This file is part of V-Sekai https://v-sekai.org/.
2+
# SaracenOne & K. S. Ernest (Fire) Lee & Lyuma & MMMaellon & Contributors
3+
# vsk_version_plugin.gd
4+
# SPDX-License-Identifier: MIT
5+
6+
@tool
7+
extends EditorPlugin
8+
9+
var editor_interface: EditorInterface = null
10+
11+
12+
func _init():
13+
print("Initialising VSKVersion plugin")
14+
15+
16+
func _notification(p_notification: int):
17+
match p_notification:
18+
NOTIFICATION_PREDELETE:
19+
print("Destroying VSKVersion plugin")
20+
21+
22+
func _get_plugin_name() -> String:
23+
return "VSKVersion"
24+
25+
26+
func _enter_tree() -> void:
27+
editor_interface = get_editor_interface()
28+
add_autoload_singleton("VSKVersion", "res://addons/vsk_version/vsk_version.gd")
29+
30+
31+
func _exit_tree() -> void:
32+
remove_autoload_singleton("VSKVersion")

0 commit comments

Comments
 (0)