Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Origin/43 credit scene #55

Merged
merged 3 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions addons/EasyMenus/Scenes/main_menu.tscn
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[gd_scene load_steps=5 format=3 uid="uid://dq6tvhqcy2aps"]
[gd_scene load_steps=7 format=3 uid="uid://dq6tvhqcy2aps"]

[ext_resource type="Script" path="res://addons/EasyMenus/Scripts/main_menu_controller.gd" id="1_lbw7r"]
[ext_resource type="Texture2D" uid="uid://dqch5ju7j5ixv" path="res://images/title/title.png" id="2_02aw4"]
[ext_resource type="PackedScene" uid="uid://qlskttl1wjr7" path="res://addons/EasyMenus/Scenes/options_menu.tscn" id="2_pwqpr"]
[ext_resource type="PackedScene" uid="uid://px6a2dg8cawb" path="res://addons/modular-settings-menu/scenes/settings.tscn" id="3_slls3"]
[ext_resource type="PackedScene" uid="uid://kl1rhxon4i4u" path="res://scenes/credits.tscn" id="4_jno7n"]
[ext_resource type="Script" path="res://scenes/credits.gd" id="5_3v0kb"]

[node name="MainMenu" type="Control"]
layout_mode = 3
Expand All @@ -14,7 +16,14 @@ grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_lbw7r")

[node name="Credits" parent="." instance=ExtResource("4_jno7n")]
unique_name_in_owner = true
visible = false
layout_mode = 1
script = ExtResource("5_3v0kb")

[node name="Title" type="Sprite2D" parent="."]
unique_name_in_owner = true
self_modulate = Color(1, 1, 1, 0.92549)
position = Vector2(960, 260)
scale = Vector2(0.36, 0.36)
Expand All @@ -41,17 +50,28 @@ metadata/_edit_group_ = true
unique_name_in_owner = true
layout_mode = 2
focus_neighbor_top = NodePath("../HBoxContainer/QuitButton")
focus_neighbor_bottom = NodePath("../HBoxContainer/OptionsButton")
focus_next = NodePath("../HBoxContainer/OptionsButton")
focus_neighbor_bottom = NodePath("../OptionsButton")
focus_next = NodePath("../OptionsButton")
focus_previous = NodePath("../HBoxContainer/QuitButton")
theme_override_font_sizes/font_size = 30
text = "Start"

[node name="OptionsButton" type="Button" parent="Content"]
custom_minimum_size = Vector2(205, 0)
layout_mode = 2
size_flags_horizontal = 3
focus_neighbor_top = NodePath("../StartGameButton")
focus_neighbor_bottom = NodePath("../HBoxContainer/QuitButton")
focus_next = NodePath("../HBoxContainer/QuitButton")
focus_previous = NodePath("../StartGameButton")
theme_override_font_sizes/font_size = 30
text = "Options"

[node name="HBoxContainer" type="HBoxContainer" parent="Content"]
custom_minimum_size = Vector2(420, 0)
layout_mode = 2

[node name="OptionsButton" type="Button" parent="Content/HBoxContainer"]
[node name="CreditsButton" type="Button" parent="Content/HBoxContainer"]
custom_minimum_size = Vector2(205, 0)
layout_mode = 2
size_flags_horizontal = 3
Expand All @@ -60,16 +80,16 @@ focus_neighbor_bottom = NodePath("../QuitButton")
focus_next = NodePath("../QuitButton")
focus_previous = NodePath("../../StartGameButton")
theme_override_font_sizes/font_size = 30
text = "Options"
text = "Credits"

[node name="QuitButton" type="Button" parent="Content/HBoxContainer"]
custom_minimum_size = Vector2(205, 0)
layout_mode = 2
size_flags_horizontal = 3
focus_neighbor_top = NodePath("../OptionsButton")
focus_neighbor_top = NodePath("../../OptionsButton")
focus_neighbor_bottom = NodePath("../../StartGameButton")
focus_next = NodePath("../../StartGameButton")
focus_previous = NodePath("../OptionsButton")
focus_previous = NodePath("../../OptionsButton")
theme_override_font_sizes/font_size = 30
text = "Quit"

Expand All @@ -84,8 +104,10 @@ visible = false
layout_mode = 1
MenuPanelRef = NodePath("..")

[connection signal="close" from="Credits" to="." method="close_credits"]
[connection signal="pressed" from="Content/StartGameButton" to="." method="_on_start_game_button_pressed"]
[connection signal="pressed" from="Content/HBoxContainer/OptionsButton" to="." method="open_options"]
[connection signal="pressed" from="Content/OptionsButton" to="." method="open_options"]
[connection signal="pressed" from="Content/HBoxContainer/CreditsButton" to="." method="open_credits"]
[connection signal="pressed" from="Content/HBoxContainer/QuitButton" to="." method="quit"]
[connection signal="close" from="OptionsMenu" to="." method="close_options"]
[connection signal="settings_menu_closed" from="Settings" to="." method="close_options"]
17 changes: 16 additions & 1 deletion addons/EasyMenus/Scripts/main_menu_controller.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ signal start_game_pressed

@onready var start_game_button: Button = $%StartGameButton
@onready var options_menu: Control = $%Settings
@onready var credits: Control = $%Credits
@onready var content: Control = $%Content
@onready var title: = $%Title

func _ready():
start_game_button.grab_focus()
Expand All @@ -14,14 +16,27 @@ func quit():
func open_options():
options_menu.show()
content.hide()
title.hide()
#options_menu.on_open()

func close_options():
content.show();
title.show()
start_game_button.grab_focus()
options_menu.hide()


func open_credits():
credits.show()
content.hide()

func close_credits():
content.show()
credits.hide()

func _on_start_game_button_pressed():
emit_signal("start_game_pressed")
get_tree().change_scene_to_file("res://scenes/Main.tscn")


func _on_credits_button_pressed() -> void:
pass # Replace with function body.
5 changes: 5 additions & 0 deletions addons/modular-settings-menu/scenes/settings.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ grow_vertical = 2
mouse_filter = 1
script = ExtResource("1_crapp")

[node name="ShapeCast2D" type="ColorRect" parent="."]
self_modulate = Color(0.0745098, 0.0745098, 0.0745098, 0.290196)
offset_right = 1920.0
offset_bottom = 1080.0

[node name="SettingsPanel" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 8
Expand Down
1 change: 1 addition & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,4 @@ input_sprint={

renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"
textures/vram_compression/import_etc2_astc=true
15 changes: 15 additions & 0 deletions scenes/credits.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
extends Control
signal close

# Emits close signal and saves the options
func go_back():
emit_signal("close")

# Called from outside initializes the options menu
func on_open():
print("Open credits")

func _input(event):
if event.is_action_pressed("ui_cancel") && visible:
accept_event()
go_back()
172 changes: 172 additions & 0 deletions scenes/credits.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
[gd_scene load_steps=3 format=3 uid="uid://kl1rhxon4i4u"]

[ext_resource type="Script" path="res://addons/EasyMenus/Scripts/follow_focus_center.gd" id="2_gkstp"]

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_x77mt"]

[node name="Credits" type="Control"]
self_modulate = Color(0, 0, 0, 1)
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="ShapeCast2D" type="ColorRect" parent="."]
self_modulate = Color(0.0745098, 0.0745098, 0.0745098, 0.290196)
layout_mode = 0
offset_right = 1920.0
offset_bottom = 1080.0

[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 460.0
offset_top = 529.0
offset_right = -460.0
offset_bottom = -51.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 25
theme_override_constants/margin_top = 25
theme_override_constants/margin_right = 25
theme_override_constants/margin_bottom = 25

[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer"]
layout_mode = 2
script = ExtResource("2_gkstp")
transition_time = 0.15

[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 15

[node name="OptionsTitle" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 45
text = "Credits"
horizontal_alignment = 1

[node name="HSeparator" type="HSeparator" parent="MarginContainer/ScrollContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 10

[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/ScrollContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/margin_left = 100
theme_override_constants/margin_right = 100

[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer"]
layout_mode = 2

[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer"]
layout_mode = 2

[node name="Part" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer2"]
layout_mode = 2
size_flags_horizontal = 3
text = "Story"

[node name="Guys" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer2"]
layout_mode = 2
text = "Lukas, Daniel, David & Alex"
horizontal_alignment = 2

[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer"]
layout_mode = 2

[node name="Part" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "Gamedesign"

[node name="Guys" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "Lukas, Daniel, David, Alex & DallE"
horizontal_alignment = 2

[node name="HBoxContainer3" type="HBoxContainer" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer"]
layout_mode = 2

[node name="Part" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer3"]
layout_mode = 2
size_flags_horizontal = 3
text = "Game name"

[node name="Guys" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer3"]
layout_mode = 2
text = "ChatGPT"
horizontal_alignment = 2

[node name="HBoxContainer4" type="HBoxContainer" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer"]
layout_mode = 2

[node name="Part" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer4"]
layout_mode = 2
size_flags_horizontal = 3
text = "Sounddesign"
horizontal_alignment = 3

[node name="Guys" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer4"]
layout_mode = 2
text = "Lukas & Alex"
horizontal_alignment = 2

[node name="HBoxContainer5" type="HBoxContainer" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer"]
layout_mode = 2

[node name="Part" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer5"]
layout_mode = 2
size_flags_horizontal = 3
text = "Code"

[node name="Guys" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer5"]
layout_mode = 2
text = "Lukas, Daniel, David, Alex & Nico"
horizontal_alignment = 2

[node name="HBoxContainer6" type="HBoxContainer" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer"]
layout_mode = 2

[node name="Part" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer6"]
layout_mode = 2
size_flags_horizontal = 3
text = "Menus"
horizontal_alignment = 3

[node name="Guys" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer6"]
layout_mode = 2
text = "Random Plugins & Nico"
horizontal_alignment = 2

[node name="HBoxContainer7" type="HBoxContainer" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer"]
layout_mode = 2

[node name="Part" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer7"]
layout_mode = 2
size_flags_horizontal = 3
text = "Luna Keeper "

[node name="Guys" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer7"]
layout_mode = 2
text = "Daniel & Kim"
horizontal_alignment = 2

[node name="HSeparator3" type="HSeparator" parent="MarginContainer/ScrollContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 50
theme_override_styles/separator = SubResource("StyleBoxEmpty_x77mt")

[node name="BackButton" type="Button" parent="MarginContainer/ScrollContainer/VBoxContainer"]
custom_minimum_size = Vector2(350, 0)
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 8
theme_override_font_sizes/font_size = 25
text = "Back"

[connection signal="pressed" from="MarginContainer/ScrollContainer/VBoxContainer/BackButton" to="." method="go_back"]