Hauptmenü Dark Fantasy Redesign + CLASS_DATA const fix

- main_menu.tscn: Vollbild dunkler Hintergrund, Banner-Slot oben,
  Buttons zentriert, Einstellungen als styled Overlay-Panel
- main_menu.gd: Banner automatisch geladen wenn Banner.png vorhanden,
  sonst Fallback-Titeltext; @onready-Pfade auf neue Struktur angepasst
- class_selection_menu.gd: CLASS_DATA von const auf var geändert

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Andre 2026-03-19 22:46:04 +01:00
parent cbf50b56bf
commit aa4b998e8a
3 changed files with 153 additions and 96 deletions

View file

@ -12,7 +12,7 @@ const WARRIOR_PORTRAIT = preload("res://assets/Icons/Warrior.png")
const ROGUE_PORTRAIT = preload("res://assets/Icons/Schurke.png") const ROGUE_PORTRAIT = preload("res://assets/Icons/Schurke.png")
const MAGE_PORTRAIT = preload("res://assets/Icons/Magier.png") const MAGE_PORTRAIT = preload("res://assets/Icons/Magier.png")
const CLASS_DATA = [ var CLASS_DATA = [
{ {
"key": "warrior", "key": "warrior",
"name": "Krieger", "name": "Krieger",

View file

@ -4,18 +4,22 @@ extends CanvasLayer
signal start_game signal start_game
@onready var main_panel = $MainPanel @onready var main_panel = $Background/MainPanel
@onready var settings_panel = $SettingsPanel @onready var settings_panel = $Background/SettingsPanel
@onready var play_btn = $MainPanel/VBoxContainer/PlayBtn @onready var play_btn = $Background/MainPanel/VBoxContainer/PlayBtn
@onready var settings_btn = $MainPanel/VBoxContainer/SettingsBtn @onready var settings_btn = $Background/MainPanel/VBoxContainer/SettingsBtn
@onready var quit_btn = $MainPanel/VBoxContainer/QuitBtn @onready var quit_btn = $Background/MainPanel/VBoxContainer/QuitBtn
@onready var banner_image = $Background/MainPanel/BannerImage
@onready var fallback_title = $Background/MainPanel/FallbackTitle
# Settings Controls # Settings Controls
@onready var resolution_option = $SettingsPanel/VBoxContainer/ResolutionRow/ResolutionOption @onready var resolution_option = $Background/SettingsPanel/VBoxContainer/ResolutionRow/ResolutionOption
@onready var window_mode_option = $SettingsPanel/VBoxContainer/WindowModeRow/WindowModeOption @onready var window_mode_option = $Background/SettingsPanel/VBoxContainer/WindowModeRow/WindowModeOption
@onready var vsync_check = $SettingsPanel/VBoxContainer/VsyncRow/VsyncCheck @onready var vsync_check = $Background/SettingsPanel/VBoxContainer/VsyncRow/VsyncCheck
@onready var msaa_option = $SettingsPanel/VBoxContainer/MSAARow/MSAAOption @onready var msaa_option = $Background/SettingsPanel/VBoxContainer/MSAARow/MSAAOption
@onready var back_btn = $SettingsPanel/VBoxContainer/BackBtn @onready var back_btn = $Background/SettingsPanel/VBoxContainer/BackBtn
const BANNER_PATH = "res://assets/Icons/Banner.png"
# Auflösungen # Auflösungen
const RESOLUTIONS = [ const RESOLUTIONS = [
@ -34,6 +38,15 @@ func _ready():
main_panel.visible = true main_panel.visible = true
settings_panel.visible = false settings_panel.visible = false
# Banner laden wenn vorhanden, sonst Fallback-Titel zeigen
if ResourceLoader.exists(BANNER_PATH):
banner_image.texture = load(BANNER_PATH)
banner_image.visible = true
fallback_title.visible = false
else:
banner_image.visible = false
fallback_title.visible = true
play_btn.pressed.connect(_on_play) play_btn.pressed.connect(_on_play)
settings_btn.pressed.connect(_on_settings) settings_btn.pressed.connect(_on_settings)
quit_btn.pressed.connect(_on_quit) quit_btn.pressed.connect(_on_quit)

View file

@ -2,160 +2,204 @@
[ext_resource type="Script" path="res://main_menu.gd" id="1_menu"] [ext_resource type="Script" path="res://main_menu.gd" id="1_menu"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bg"]
bg_color = Color(0.04, 0.04, 0.07, 1.0)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_settings"]
bg_color = Color(0.07, 0.06, 0.11, 0.97)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.25, 0.20, 0.35, 1.0)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[node name="MainMenu" type="CanvasLayer"] [node name="MainMenu" type="CanvasLayer"]
script = ExtResource("1_menu") script = ExtResource("1_menu")
[node name="MainPanel" type="Panel" parent="."] [node name="Background" type="Panel" parent="."]
anchors_preset = 8 layout_mode = 3
anchor_left = 0.5 anchors_preset = 15
anchor_top = 0.5 anchor_right = 1.0
anchor_right = 0.5 anchor_bottom = 1.0
anchor_bottom = 0.5 theme_override_styles/panel = SubResource("StyleBoxFlat_bg")
offset_left = -200.0
offset_top = -180.0
offset_right = 200.0
offset_bottom = 180.0
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainer" type="VBoxContainer" parent="MainPanel"] [node name="MainPanel" type="Control" parent="Background"]
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
offset_left = 30.0
offset_top = 30.0
offset_right = -30.0
offset_bottom = -30.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 20
[node name="Title" type="Label" parent="MainPanel/VBoxContainer"] [node name="BannerImage" type="TextureRect" parent="Background/MainPanel"]
layout_mode = 2 layout_mode = 1
theme_override_font_sizes/font_size = 32 anchors_preset = -1
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 0.0
offset_top = 60.0
offset_bottom = 300.0
expand_mode = 1
stretch_mode = 6
[node name="FallbackTitle" type="Label" parent="Background/MainPanel"]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 0.0
offset_top = 80.0
offset_bottom = 200.0
theme_override_font_sizes/font_size = 72
text = "DungeonCrawler" text = "DungeonCrawler"
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1
[node name="Spacer" type="Control" parent="MainPanel/VBoxContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="Background/MainPanel"]
layout_mode = 2 layout_mode = 1
size_flags_vertical = 3 anchors_preset = -1
anchor_left = 0.35
anchor_top = 0.45
anchor_right = 0.65
anchor_bottom = 0.88
theme_override_constants/separation = 18
[node name="PlayBtn" type="Button" parent="MainPanel/VBoxContainer"] [node name="PlayBtn" type="Button" parent="Background/MainPanel/VBoxContainer"]
custom_minimum_size = Vector2(0, 50) custom_minimum_size = Vector2(0, 60)
layout_mode = 2 layout_mode = 2
theme_override_font_sizes/font_size = 20 theme_override_font_sizes/font_size = 24
text = "Spielen" text = "Spielen"
[node name="SettingsBtn" type="Button" parent="MainPanel/VBoxContainer"] [node name="SettingsBtn" type="Button" parent="Background/MainPanel/VBoxContainer"]
custom_minimum_size = Vector2(0, 50) custom_minimum_size = Vector2(0, 60)
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "Einstellungen"
[node name="QuitBtn" type="Button" parent="MainPanel/VBoxContainer"]
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "Beenden"
[node name="SettingsPanel" type="Panel" parent="."]
visible = false
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -250.0
offset_top = -220.0
offset_right = 250.0
offset_bottom = 220.0
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainer" type="VBoxContainer" parent="SettingsPanel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 20.0
offset_top = 20.0
offset_right = -20.0
offset_bottom = -20.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 15
[node name="Title" type="Label" parent="SettingsPanel/VBoxContainer"]
layout_mode = 2 layout_mode = 2
theme_override_font_sizes/font_size = 24 theme_override_font_sizes/font_size = 24
text = "Einstellungen" text = "Einstellungen"
[node name="QuitBtn" type="Button" parent="Background/MainPanel/VBoxContainer"]
custom_minimum_size = Vector2(0, 60)
layout_mode = 2
theme_override_font_sizes/font_size = 24
text = "Beenden"
[node name="VersionLabel" type="Label" parent="Background/MainPanel"]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.0
anchor_top = 1.0
anchor_right = 0.0
anchor_bottom = 1.0
offset_left = 16.0
offset_top = -28.0
offset_right = 200.0
offset_bottom = -8.0
theme_override_font_sizes/font_size = 12
text = "v0.1 Alpha"
modulate = Color(0.5, 0.5, 0.5, 1.0)
[node name="SettingsPanel" type="Panel" parent="Background"]
visible = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -280.0
offset_top = -260.0
offset_right = 280.0
offset_bottom = 260.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_settings")
[node name="VBoxContainer" type="VBoxContainer" parent="Background/SettingsPanel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 24.0
offset_top = 24.0
offset_right = -24.0
offset_bottom = -24.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 18
[node name="Title" type="Label" parent="Background/SettingsPanel/VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 26
text = "Einstellungen"
horizontal_alignment = 1 horizontal_alignment = 1
[node name="HSeparator" type="HSeparator" parent="SettingsPanel/VBoxContainer"] [node name="HSeparator" type="HSeparator" parent="Background/SettingsPanel/VBoxContainer"]
layout_mode = 2 layout_mode = 2
[node name="ResolutionRow" type="HBoxContainer" parent="SettingsPanel/VBoxContainer"] [node name="ResolutionRow" type="HBoxContainer" parent="Background/SettingsPanel/VBoxContainer"]
layout_mode = 2 layout_mode = 2
[node name="Label" type="Label" parent="SettingsPanel/VBoxContainer/ResolutionRow"] [node name="Label" type="Label" parent="Background/SettingsPanel/VBoxContainer/ResolutionRow"]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
theme_override_font_sizes/font_size = 16 theme_override_font_sizes/font_size = 16
text = "Auflösung" text = "Auflösung"
[node name="ResolutionOption" type="OptionButton" parent="SettingsPanel/VBoxContainer/ResolutionRow"] [node name="ResolutionOption" type="OptionButton" parent="Background/SettingsPanel/VBoxContainer/ResolutionRow"]
custom_minimum_size = Vector2(200, 0) custom_minimum_size = Vector2(200, 0)
layout_mode = 2 layout_mode = 2
theme_override_font_sizes/font_size = 14 theme_override_font_sizes/font_size = 14
[node name="WindowModeRow" type="HBoxContainer" parent="SettingsPanel/VBoxContainer"] [node name="WindowModeRow" type="HBoxContainer" parent="Background/SettingsPanel/VBoxContainer"]
layout_mode = 2 layout_mode = 2
[node name="Label" type="Label" parent="SettingsPanel/VBoxContainer/WindowModeRow"] [node name="Label" type="Label" parent="Background/SettingsPanel/VBoxContainer/WindowModeRow"]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
theme_override_font_sizes/font_size = 16 theme_override_font_sizes/font_size = 16
text = "Fenstermodus" text = "Fenstermodus"
[node name="WindowModeOption" type="OptionButton" parent="SettingsPanel/VBoxContainer/WindowModeRow"] [node name="WindowModeOption" type="OptionButton" parent="Background/SettingsPanel/VBoxContainer/WindowModeRow"]
custom_minimum_size = Vector2(200, 0) custom_minimum_size = Vector2(200, 0)
layout_mode = 2 layout_mode = 2
theme_override_font_sizes/font_size = 14 theme_override_font_sizes/font_size = 14
[node name="VsyncRow" type="HBoxContainer" parent="SettingsPanel/VBoxContainer"] [node name="VsyncRow" type="HBoxContainer" parent="Background/SettingsPanel/VBoxContainer"]
layout_mode = 2 layout_mode = 2
[node name="Label" type="Label" parent="SettingsPanel/VBoxContainer/VsyncRow"] [node name="Label" type="Label" parent="Background/SettingsPanel/VBoxContainer/VsyncRow"]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
theme_override_font_sizes/font_size = 16 theme_override_font_sizes/font_size = 16
text = "VSync" text = "VSync"
[node name="VsyncCheck" type="CheckBox" parent="SettingsPanel/VBoxContainer/VsyncRow"] [node name="VsyncCheck" type="CheckBox" parent="Background/SettingsPanel/VBoxContainer/VsyncRow"]
layout_mode = 2 layout_mode = 2
text = "Aktiviert" text = "Aktiviert"
[node name="MSAARow" type="HBoxContainer" parent="SettingsPanel/VBoxContainer"] [node name="MSAARow" type="HBoxContainer" parent="Background/SettingsPanel/VBoxContainer"]
layout_mode = 2 layout_mode = 2
[node name="Label" type="Label" parent="SettingsPanel/VBoxContainer/MSAARow"] [node name="Label" type="Label" parent="Background/SettingsPanel/VBoxContainer/MSAARow"]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
theme_override_font_sizes/font_size = 16 theme_override_font_sizes/font_size = 16
text = "Anti-Aliasing" text = "Anti-Aliasing"
[node name="MSAAOption" type="OptionButton" parent="SettingsPanel/VBoxContainer/MSAARow"] [node name="MSAAOption" type="OptionButton" parent="Background/SettingsPanel/VBoxContainer/MSAARow"]
custom_minimum_size = Vector2(200, 0) custom_minimum_size = Vector2(200, 0)
layout_mode = 2 layout_mode = 2
theme_override_font_sizes/font_size = 14 theme_override_font_sizes/font_size = 14
[node name="Spacer" type="Control" parent="SettingsPanel/VBoxContainer"] [node name="Spacer" type="Control" parent="Background/SettingsPanel/VBoxContainer"]
layout_mode = 2 layout_mode = 2
size_flags_vertical = 3 size_flags_vertical = 3
[node name="BackBtn" type="Button" parent="SettingsPanel/VBoxContainer"] [node name="BackBtn" type="Button" parent="Background/SettingsPanel/VBoxContainer"]
custom_minimum_size = Vector2(0, 45) custom_minimum_size = Vector2(0, 50)
layout_mode = 2 layout_mode = 2
theme_override_font_sizes/font_size = 18 theme_override_font_sizes/font_size = 18
text = "Zurück" text = "Zurück"