CORE/Test.gd

57 lines
1.9 KiB
GDScript3
Raw Normal View History

2024-03-03 18:53:09 +01:00
# CORE FRAMEWORK SOURCE FILE
# Copyright (c) 2024 The StarOpenSource Project & Contributors
# Licensed under the GNU Affero General Public License v3
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
## CORE testing playground
##
## This script is used to test CORE's behaviour during development.
## It's state should be reverted to how it was before committing (if modified).
2024-02-04 21:36:30 +01:00
extends Node
# CORE Configuration
var config: CoreConfiguration = CoreConfiguration.new()
# CORE Object
var core: Core
2024-03-03 19:07:59 +01:00
func _init() -> void:
2024-02-04 21:36:30 +01:00
configure_core()
# Initialize CORE with custom config
core = Core.new(config)
2024-03-03 19:07:59 +01:00
func _ready() -> void:
2024-02-04 21:36:30 +01:00
# Inject CORE
2024-03-03 19:07:59 +01:00
await get_tree().process_frame
2024-02-04 21:36:30 +01:00
add_child(core)
2024-03-03 19:07:59 +01:00
await get_tree().process_frame
2024-02-04 21:36:30 +01:00
# Print information about CORE
2024-03-05 21:32:13 +01:00
core.logger.info("Test.gd", await core.get_formatted_string("""Version information:
2024-02-10 21:21:18 +01:00
Release (semantic) = %release_semantic%
Release = %release%
Typerelease = %release_type%
Type = %type%
Type (technical) = %type_technical%
Development mode = %devmode%
Headless mode = %headless%
Custom module support = %custommodules%"""))
# Print hi
2024-03-05 21:32:13 +01:00
core.logger.info("Test.gd", "Hi there!")
2024-02-04 21:36:30 +01:00
# Update CORE configuration
func configure_core() -> void:
config.headless = false
2024-02-10 21:21:18 +01:00
config.debugging = true
2024-02-04 21:36:30 +01:00
config.logger_level = CoreTypes.LoggerLevel.DIAG