WIP: Something

This commit is contained in:
Nikolai Rodionov 2025-02-18 18:31:27 +01:00
parent 16b06ba642
commit 396b28dba1
No known key found for this signature in database
GPG Key ID: 0639A45505F3BFA6
4 changed files with 55 additions and 20 deletions

View File

@ -3,10 +3,11 @@ extends EntryPoint
# -- A path to the config file for setting up the dedicated server
var config_file_path: String = ""
@export var main_menu: MainMenu = null
# -- Called when the node enters the scene tree for the first time.
func _ready() -> void:
parse_args()
if OS.has_feature("dedicated_server") or DisplayServer.get_name() == "headless":
var err := start_dedicated_server()
if err != OK:
@ -28,5 +29,7 @@ func start_dedicated_server() -> Error:
push_error("Dedicated server is not yet implemented")
return ERR_METHOD_NOT_FOUND
# -- When not dedicated server, just start the full game and load menu
func start_game() -> Error:
# -- Draw the main menu
return OK

View File

@ -1,9 +1,18 @@
[gd_scene load_steps=2 format=3 uid="uid://0hsqnr1kunv5"]
[gd_scene load_steps=3 format=3 uid="uid://0hsqnr1kunv5"]
[ext_resource type="Script" path="res://src/entrypoint.gd" id="1_ce80t"]
[ext_resource type="Script" path="res://src/interfaces/main_menu/main_menu.gd" id="2_nmo60"]
[node name="Entrypoint" type="EntryPoint"]
[node name="Entrypoint" type="EntryPoint" node_paths=PackedStringArray("main_menu")]
script = ExtResource("1_ce80t")
main_menu = NodePath("MainMenu")
[node name="LevelPlaceholder" type="Node3D" parent="."]
editor_description = "This node should be used for storing the map that is currently loaded"
[node name="MainMenu" type="Control" parent="."]
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
script = ExtResource("2_nmo60")

View File

@ -0,0 +1,11 @@
class_name MainMenu extends Control
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

View File

@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=3 uid="uid://dt7rhpcor1wh7"]
[ext_resource type="Script" path="res://src/interfaces/main_menu/main_menu.gd" id="1_dfg40"]
[node name="MainMenu" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_dfg40")