CORE/src/classes/config.gd
JeremyStarTM 08bda06760
Update default value of 'misc_stringify_show_type'
It's now 'false' instead of 'true' because it isn't required most of the time.
2024-05-07 20:25:43 +02:00

94 lines
4.1 KiB
GDScript

# CORE FRAMEWORK SOURCE FILE
# Copyright (c) 2024 The StarOpenSource Project & Contributors
# Licensed in the Public Domain
## The framework configuration
##
## Provides the default configuration for the CORE Framework.
extends Node
class_name CoreConfiguration
@export_category("Global")
## Controls CORE's functionality.[br]
## 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].
@export var headless: bool
## Puts the framework into development mode.[br]
## Unlocks experimental features.
@export var development: bool
## Allows or disallows custom modules.
@export var custom_modules: bool
## If [method Core.quit_safely] (and by extension [method Core.cleanup]) should be called when pressing the X.
@export var automatic_shutdown: bool
## Hides the window during engine shutdown. Useful when your game and the framework will take longer to cleanup.
@export var hide_window_on_shutdown: bool
@export_category("Logger")
## The minimum log level you want to be displayed.
@export var logger_level: CoreTypes.LoggerLevel
## Determines if the logger's output should be colored.
@export var logger_colored: bool
## Determines if the logger should check if running in verbose mode (see [method OS.is_stdout_verbose]).[br]
## Update [code]verbose_mode[/code] yourself accordingly if you've set this to [code]false[/code], or face messed up diagnostic log messages.[br]
## [b]Warning: [i]Updating this during runtime does nothing.[/i][/b]
@export var logger_detect_verbose_mode: bool
## The template for all log messages.[br]
## 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]
@export var logger_format: String
## Determines if identation should be provided if the logger encounters a newline.
@export var logger_newlines_override: bool
## The maximum amount of characters excluding the message before newlines are no longer idented. Set to [code]-1[/code] to disable this behaviour.
@export var logger_newlines_sizelimit: int
@export_category("Log UI")
## Enables or disables Log UI.
@export var logui_enabled: bool
## The Log UI background color. Set to [code]Color.TRANSPARENT[/code] for a transparent background.
@export var logui_background_color: Color
## What font size the graphical log should have.
@export var logui_font_size: int
@export_category("Miscellaneous")
## Shows or hides the type when calling [code]stringify_variables[/code].
@export var misc_stringify_show_type: bool
## Determines how [code]stringify_variables[/code] should display [class Color] variables.[br]
## Will display colors from [code]0[/code] to [code]255[/code] if [code]true[/code] or from [code]-1.0[/code] to [code]1.0[/code] if [code]false[/code].
@export var misc_stringify_color_range8: bool
## Determines if [class Array]s should be processed by [code]stringify_variables[/code].
@export var misc_stringify_array: bool
## Determines if [class Dictionary]s should be processed by [code]stringify_variables[/code].
@export var misc_stringify_dictionary: bool
@export_category("Easy Request Maker")
## Determines how unsecure requests should be handled.
@export var erm_unsecure_requests: CoreTypes.BlockadeLevel
# Populates configuration with default values
func _init() -> void:
# Global
headless = false
development = false
custom_modules = true
automatic_shutdown = true
hide_window_on_shutdown = true
# Logger
logger_level = CoreTypes.LoggerLevel.INFO
logger_colored = true
logger_detect_verbose_mode = true
logger_format = "%color%[%time%] [%level% %origin%] %message%"
logger_newlines_override = true
logger_newlines_sizelimit = 40
# Log UI
logui_enabled = true
logui_background_color = Color.BLACK # To disable the background, use Color.TRANSPARENT
logui_font_size = 14
# Misc
misc_stringify_show_type = false
misc_stringify_color_range8 = true
misc_stringify_array = true
misc_stringify_dictionary = true
# Easy Request Maker
erm_unsecure_requests = CoreTypes.BlockadeLevel.BLOCK