Rework loading maps to be asynchronous, change debug menu so that its not completely pausing the game

This commit is contained in:
2025-09-26 14:05:05 -07:00
parent 578cde65cc
commit 9107b8c570
10 changed files with 164 additions and 95 deletions

View File

@@ -1,20 +1,12 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using Zennysoft.Game.Ma;
[Meta(typeof(IAutoNode))]
public partial class LoadingScreen : Control
{
public override void _Notification(int what) => this.Notify(what);
public override void _Process(double delta)
{
if (Input.IsActionJustPressed(GameInputs.Next))
{
}
if (Input.IsActionJustPressed(GameInputs.Previous))
{
}
}
[Node]
public ProgressBar ProgressBar { get; set; } = default!;
}

View File

@@ -1,12 +1,12 @@
[gd_scene load_steps=4 format=3 uid="uid://cpjlj7kxdhv16"]
[ext_resource type="Script" uid="uid://b07ueredevhr3" path="res://src/menu/LoadingScreen.cs" id="1_5uxhf"]
[ext_resource type="FontFile" uid="uid://cm8j5vcdop5x0" path="res://src/ui/fonts/Mrs-Eaves-OT-Roman_31443.ttf" id="2_xfkmi"]
[sub_resource type="LabelSettings" id="LabelSettings_6i7rn"]
font = ExtResource("2_xfkmi")
font_size = 100
font_color = Color(0.737255, 0.705882, 0.690196, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5uxhf"]
bg_color = Color(0.670689, 0.67069, 0.670689, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_xfkmi"]
bg_color = Color(0.146349, 0.723509, 0, 1)
[node name="LoadingScreen" type="Control"]
layout_mode = 3
@@ -28,7 +28,9 @@ grow_vertical = 2
[node name="CenterContainer" type="CenterContainer" parent="PanelContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="PanelContainer/CenterContainer"]
[node name="ProgressBar" type="ProgressBar" parent="PanelContainer/CenterContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(500, 50)
layout_mode = 2
text = "Loading..."
label_settings = SubResource("LabelSettings_6i7rn")
theme_override_styles/background = SubResource("StyleBoxFlat_5uxhf")
theme_override_styles/fill = SubResource("StyleBoxFlat_xfkmi")