CORE/src/classes/config.gd

80 lines
3.6 KiB
GDScript3
Raw Normal View History

# CORE FRAMEWORK SOURCE FILE
# Copyright (c) 2024 The StarOpenSource Project & Contributors
# Licensed under the GNU General Public License v3
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
## The default configuration file for the CORE Framework.
##
## The [code]%CoreConfiguration[/code] class holds the Framework's settings.
## The default configuration is designed to not interfere with the developer experience
## and your project without any customization.
2024-02-04 21:36:30 +01:00
extends Node
class_name CoreConfiguration
@export_category("Global")
## Controls CORE's functionality.
## Renders GUI-related modules useless when set to [code]false[/code], which is the recommended behaviour on servers. For CORE's full functionality, set this to [code]true[/code].
2024-02-04 21:36:30 +01:00
@export var headless: bool
## Allows debugging functionality if set to [code]true[/code], or not if set to [code]false[/code].[br]
## [br]
## Note: This will not enable the development mode automaticall, only if you're developing on CORE itself.
@export var debugging: bool
## Allows or disallows custom modules.
@export var custom_modules: bool
2024-02-04 21:36:30 +01:00
@export_category("Logger")
## I don't have to explain this, do I?
2024-02-04 21:36:30 +01:00
@export var logger_level: CoreTypes.LoggerLevel
## Toggles colored output. Set to [code]false[/code] if you don't want that.
2024-02-04 21:36:30 +01:00
@export var logger_colored: bool
## The format string the logger will operate on. Available placeholders are: [code]%time%[/code], [code]%time_ms%[/code], [code]%level%[/code], [code]%color%[/code], [code]%message%[/code], [code]%source%[/code], [code]%source_raw%[/code], [code]%function%[/code] and [code]%line%[/code]
2024-02-04 21:36:30 +01:00
@export var logger_format: String
## This example should make it clear, what this does:
## [codeblock]
## logger_newlines_override = true:
## [09:47:00] [INFO Test.gd:69] This is a test message...
## with a newline!
## logger_newlines_override = false:
## [09:47:00] [INFO Test.gd:69] This is a test message...
## with a newline!
## [/codeblock]
2024-02-04 21:36:30 +01:00
@export var logger_newlines_override: bool
## The maximum amount of characters than can appear before [code]%message%[/code] before newlines won't be overriden. Setting this variable to [code]-1[/code] disables this behaviour.
2024-02-04 21:36:30 +01:00
@export var logger_newlines_sizelimit: int
@export_category("LogUI")
## Determines if [code]LogUI[/code] should be visible or not.
@export var logui_enabled: bool
## The color the [code]LogUI[/code] background will have. Set to [code]Color.TRANSPARENT[/code] for a transparent background.
2024-02-04 21:36:30 +01:00
@export var logui_background_color: Color
## What size the graphical log should have.
2024-02-04 21:36:30 +01:00
@export var logui_font_size: int
# Default settings
func _init() -> void:
# Global
headless = false
debugging = false
custom_modules = false
2024-02-04 21:36:30 +01:00
# Logger
logger_level = CoreTypes.LoggerLevel.INFO
logger_colored = true
logger_format = "%color%[%time%] [%level% %source%:%line%] %message%"
logger_newlines_override = true
logger_newlines_sizelimit = 40
# LogUI
logui_enabled = true
logui_background_color = Color.BLACK # To disable the background, use Color.TRANSPARENT
2024-02-04 21:36:30 +01:00
logui_font_size = 14