CORE/splash.gd

46 lines
1.3 KiB
GDScript3
Raw Normal View History

######################################
# THE CORE FRAMEWORK #
# MADE BY THE STAROPENSOURCE PROJECT #
# AND CONTRIBUTERS (THANK YOU!) #
# #
# COPYRIGHT 2023 THE STAROPENSOURCE #
# PROJECT AND CONTRIBUTERS #
# #
# LICENSED UNDER THE GNU GENERAL #
# PUBLIC LICENSE VERSION 3 (ONLY) #
######################################
2023-06-29 17:22:13 +02:00
extends Node
# CORE modules
var core = null
var logger = null
2023-06-29 17:22:13 +02:00
# Config
var config_enabled = null
var config_image = null
var config_image_size = null
var config_color = null
# Makes the splash screen pretty
2023-06-29 17:22:13 +02:00
func apply_config() -> void:
if core.protection_mode: return
$Background.color = config_color
$Background/Image.texture = ResourceLoader.load(config_image)
$Background/Image.size = Vector2i(config_image_size,config_image_size)
if config_enabled:
display()
else:
$Background.visible = false
2023-06-29 17:22:13 +02:00
# The next two functions are very self explanitory
2023-06-29 17:22:13 +02:00
func display() -> void:
if core.protection_mode: return
logger.info("CORE/splash.gd","Displaying splash screen")
get_tree().root.move_child($"/root/CORE/",0)
2023-06-29 17:22:13 +02:00
$Background.visible = true
func dissolve() -> void:
if core.protection_mode: return
logger.info("CORE/splash.gd","Dissolving splash screen")
2023-06-29 17:22:13 +02:00
$Background.visible = false