Update initialize-core.md

This commit is contained in:
JeremyStar™ 2024-03-22 22:30:19 +01:00
parent 439556ff4b
commit 717ce7d9fc
5 changed files with 19 additions and 19 deletions

View file

@ -3,12 +3,12 @@
importer="font_data_dynamic"
type="FontFile"
uid="uid://bvg3rkn8w7apl"
path="res://.godot/imported/Bold.ttf-ab518348487b0af32a3bf04bad1329bc.fontdata"
path="res://.godot/imported/Bold.ttf-6bb1550eec6255af8f843b07ff368846.fontdata"
[deps]
source_file="res://docs/static/dist/FiraCode/Bold.ttf"
dest_files=["res://.godot/imported/Bold.ttf-ab518348487b0af32a3bf04bad1329bc.fontdata"]
source_file="res://dist/FiraCode/Bold.ttf"
dest_files=["res://.godot/imported/Bold.ttf-6bb1550eec6255af8f843b07ff368846.fontdata"]
[params]

View file

@ -3,12 +3,12 @@
importer="font_data_dynamic"
type="FontFile"
uid="uid://b1pxod4r5puw8"
path="res://.godot/imported/Medium.ttf-59b027cf923d1808848708fe911fbecd.fontdata"
path="res://.godot/imported/Medium.ttf-436fd36bcf9a8c06f77a7861f6e4be0b.fontdata"
[deps]
source_file="res://docs/static/dist/FiraCode/Medium.ttf"
dest_files=["res://.godot/imported/Medium.ttf-59b027cf923d1808848708fe911fbecd.fontdata"]
source_file="res://dist/FiraCode/Medium.ttf"
dest_files=["res://.godot/imported/Medium.ttf-436fd36bcf9a8c06f77a7861f6e4be0b.fontdata"]
[params]

View file

@ -3,12 +3,12 @@
importer="font_data_dynamic"
type="FontFile"
uid="uid://dmyes0lwt4sgw"
path="res://.godot/imported/Regular.ttf-2558edcdc38a3fc7826c41c3a4184518.fontdata"
path="res://.godot/imported/Regular.ttf-ca914d4917efa068dc5cfcc7083586ad.fontdata"
[deps]
source_file="res://docs/static/dist/FiraCode/Regular.ttf"
dest_files=["res://.godot/imported/Regular.ttf-2558edcdc38a3fc7826c41c3a4184518.fontdata"]
source_file="res://dist/FiraCode/Regular.ttf"
dest_files=["res://.godot/imported/Regular.ttf-ca914d4917efa068dc5cfcc7083586ad.fontdata"]
[params]

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://o1vm4b2o5j6"
path="res://.godot/imported/core.png-14d81fc9b3dc0a24eb68b48b67e98124.ctex"
path="res://.godot/imported/core.png-e89ff2d52965299afbd8a6c20096578d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/static/dist/core.png"
dest_files=["res://.godot/imported/core.png-14d81fc9b3dc0a24eb68b48b67e98124.ctex"]
source_file="res://dist/core.png"
dest_files=["res://.godot/imported/core.png-e89ff2d52965299afbd8a6c20096578d.ctex"]
[params]

View file

@ -13,8 +13,8 @@ extends Node
# CORE Object
var core: Core
# CORE Logger
## Will be defined before _ready() is called
@onready var logger: CoreBaseModule = core.logger
## Gets a so called "logger instance". It basically saves you a argument on each log call.
@onready var logger: CoreLoggerInstance = core.logger.get_instance("path/to/script.gd")
func _init() -> void:
# Create new CoreConfiguration
@ -30,16 +30,16 @@ func _ready() -> void:
# Initialize CORE completely
await get_tree().process_frame # to avoid "setting up nodes" error
get_tree().root.add_child(core) # add CORE Object to SceneTree
await get_tree().process_frame # wait for CORE to initialize completely
await core.complete_init() # wait for CORE to initialize completely
# >>> Your code should start executing here <<<<
# Print "Hello World!" to console with all possible 'LoggerLevel''s
for type in CoreTypes.LoggerLevel:
if type == "NONE": continue # Exclude "NONE" logger level
type = StringName(type.to_lower()) # Convert to StringName
logger.call(type, "/path/to/script.gd", "Hello World!") # Call it
if type == "NONE": continue # Exclude "NONE" logger level
type = StringName(type.to_lower()) # Convert to StringName
logger.call(type, "Hello World!") # Call it
# Test crash
logger.crash("/path/to/script.gd", "This is a test crash.")
logger.crash("This is a test crash.")
```