diff --git a/class_selection_menu.gd b/class_selection_menu.gd index 123f1da..3fb8672 100644 --- a/class_selection_menu.gd +++ b/class_selection_menu.gd @@ -12,7 +12,7 @@ const WARRIOR_PORTRAIT = preload("res://assets/Icons/Warrior.png") const ROGUE_PORTRAIT = preload("res://assets/Icons/Schurke.png") const MAGE_PORTRAIT = preload("res://assets/Icons/Magier.png") -const CLASS_DATA = [ +var CLASS_DATA = [ { "key": "warrior", "name": "Krieger", diff --git a/main_menu.gd b/main_menu.gd index 4cf56b6..3763e0b 100644 --- a/main_menu.gd +++ b/main_menu.gd @@ -4,18 +4,22 @@ extends CanvasLayer signal start_game -@onready var main_panel = $MainPanel -@onready var settings_panel = $SettingsPanel -@onready var play_btn = $MainPanel/VBoxContainer/PlayBtn -@onready var settings_btn = $MainPanel/VBoxContainer/SettingsBtn -@onready var quit_btn = $MainPanel/VBoxContainer/QuitBtn +@onready var main_panel = $Background/MainPanel +@onready var settings_panel = $Background/SettingsPanel +@onready var play_btn = $Background/MainPanel/VBoxContainer/PlayBtn +@onready var settings_btn = $Background/MainPanel/VBoxContainer/SettingsBtn +@onready var quit_btn = $Background/MainPanel/VBoxContainer/QuitBtn +@onready var banner_image = $Background/MainPanel/BannerImage +@onready var fallback_title = $Background/MainPanel/FallbackTitle # Settings Controls -@onready var resolution_option = $SettingsPanel/VBoxContainer/ResolutionRow/ResolutionOption -@onready var window_mode_option = $SettingsPanel/VBoxContainer/WindowModeRow/WindowModeOption -@onready var vsync_check = $SettingsPanel/VBoxContainer/VsyncRow/VsyncCheck -@onready var msaa_option = $SettingsPanel/VBoxContainer/MSAARow/MSAAOption -@onready var back_btn = $SettingsPanel/VBoxContainer/BackBtn +@onready var resolution_option = $Background/SettingsPanel/VBoxContainer/ResolutionRow/ResolutionOption +@onready var window_mode_option = $Background/SettingsPanel/VBoxContainer/WindowModeRow/WindowModeOption +@onready var vsync_check = $Background/SettingsPanel/VBoxContainer/VsyncRow/VsyncCheck +@onready var msaa_option = $Background/SettingsPanel/VBoxContainer/MSAARow/MSAAOption +@onready var back_btn = $Background/SettingsPanel/VBoxContainer/BackBtn + +const BANNER_PATH = "res://assets/Icons/Banner.png" # Auflösungen const RESOLUTIONS = [ @@ -34,6 +38,15 @@ func _ready(): main_panel.visible = true 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) settings_btn.pressed.connect(_on_settings) quit_btn.pressed.connect(_on_quit) diff --git a/main_menu.tscn b/main_menu.tscn index f9048c2..0e0b46b 100644 --- a/main_menu.tscn +++ b/main_menu.tscn @@ -2,160 +2,204 @@ [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"] script = ExtResource("1_menu") -[node name="MainPanel" type="Panel" parent="."] -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -200.0 -offset_top = -180.0 -offset_right = 200.0 -offset_bottom = 180.0 -grow_horizontal = 2 -grow_vertical = 2 +[node name="Background" type="Panel" parent="."] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_bg") -[node name="VBoxContainer" type="VBoxContainer" parent="MainPanel"] +[node name="MainPanel" type="Control" parent="Background"] layout_mode = 1 anchors_preset = 15 anchor_right = 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"] -layout_mode = 2 -theme_override_font_sizes/font_size = 32 +[node name="BannerImage" type="TextureRect" 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 = 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" horizontal_alignment = 1 +vertical_alignment = 1 -[node name="Spacer" type="Control" parent="MainPanel/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 3 +[node name="VBoxContainer" type="VBoxContainer" parent="Background/MainPanel"] +layout_mode = 1 +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"] -custom_minimum_size = Vector2(0, 50) +[node name="PlayBtn" type="Button" parent="Background/MainPanel/VBoxContainer"] +custom_minimum_size = Vector2(0, 60) layout_mode = 2 -theme_override_font_sizes/font_size = 20 +theme_override_font_sizes/font_size = 24 text = "Spielen" -[node name="SettingsBtn" type="Button" parent="MainPanel/VBoxContainer"] -custom_minimum_size = Vector2(0, 50) -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"] +[node name="SettingsBtn" type="Button" parent="Background/MainPanel/VBoxContainer"] +custom_minimum_size = Vector2(0, 60) layout_mode = 2 theme_override_font_sizes/font_size = 24 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 -[node name="HSeparator" type="HSeparator" parent="SettingsPanel/VBoxContainer"] +[node name="HSeparator" type="HSeparator" parent="Background/SettingsPanel/VBoxContainer"] layout_mode = 2 -[node name="ResolutionRow" type="HBoxContainer" parent="SettingsPanel/VBoxContainer"] +[node name="ResolutionRow" type="HBoxContainer" parent="Background/SettingsPanel/VBoxContainer"] 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 size_flags_horizontal = 3 theme_override_font_sizes/font_size = 16 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) layout_mode = 2 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 -[node name="Label" type="Label" parent="SettingsPanel/VBoxContainer/WindowModeRow"] +[node name="Label" type="Label" parent="Background/SettingsPanel/VBoxContainer/WindowModeRow"] layout_mode = 2 size_flags_horizontal = 3 theme_override_font_sizes/font_size = 16 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) layout_mode = 2 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 -[node name="Label" type="Label" parent="SettingsPanel/VBoxContainer/VsyncRow"] +[node name="Label" type="Label" parent="Background/SettingsPanel/VBoxContainer/VsyncRow"] layout_mode = 2 size_flags_horizontal = 3 theme_override_font_sizes/font_size = 16 text = "VSync" -[node name="VsyncCheck" type="CheckBox" parent="SettingsPanel/VBoxContainer/VsyncRow"] +[node name="VsyncCheck" type="CheckBox" parent="Background/SettingsPanel/VBoxContainer/VsyncRow"] layout_mode = 2 text = "Aktiviert" -[node name="MSAARow" type="HBoxContainer" parent="SettingsPanel/VBoxContainer"] +[node name="MSAARow" type="HBoxContainer" parent="Background/SettingsPanel/VBoxContainer"] 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 size_flags_horizontal = 3 theme_override_font_sizes/font_size = 16 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) layout_mode = 2 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 size_flags_vertical = 3 -[node name="BackBtn" type="Button" parent="SettingsPanel/VBoxContainer"] -custom_minimum_size = Vector2(0, 45) +[node name="BackBtn" type="Button" parent="Background/SettingsPanel/VBoxContainer"] +custom_minimum_size = Vector2(0, 50) layout_mode = 2 theme_override_font_sizes/font_size = 18 text = "Zurück"