Skip to content

Commit ea10b40

Browse files
committed
Update: Rough Draft of Credits
Changelog -> Changed redirect to options menu scene to my "CreditsOptionTest" scene to represent how we can use the credits button in the options. -> Added functionality of entering and exiting the credits menu -> Made a rough draft of the credits menu
1 parent 619060a commit ea10b40

5 files changed

Lines changed: 305 additions & 1 deletion

File tree

Scenes/UI/Options/Credits.tscn

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
[gd_scene load_steps=2 format=3 uid="uid://dgjmb0wllsj41"]
2+
3+
[ext_resource type="Script" uid="uid://drt21hext7pm2" path="res://Scenes/UI/Options/Scripts/CreditsMenu.cs" id="1_n36fd"]
4+
5+
[node name="Control" type="Control" node_paths=PackedStringArray("_returnButton")]
6+
process_mode = 3
7+
layout_mode = 3
8+
anchors_preset = 0
9+
offset_right = 40.0
10+
offset_bottom = 40.0
11+
script = ExtResource("1_n36fd")
12+
_returnButton = NodePath("CenterContainer/MarginContainer/ColorRect/MarginContainer/ColorRect/HBoxContainer4/Return Button")
13+
14+
[node name="ColorRect" type="ColorRect" parent="."]
15+
layout_mode = 0
16+
offset_right = 640.0
17+
offset_bottom = 358.0
18+
color = Color(0.241156, 0.241156, 0.241156, 1)
19+
20+
[node name="CenterContainer" type="CenterContainer" parent="."]
21+
layout_mode = 0
22+
offset_right = 40.0
23+
offset_bottom = 40.0
24+
25+
[node name="MarginContainer" type="MarginContainer" parent="CenterContainer"]
26+
layout_mode = 2
27+
28+
[node name="ColorRect" type="ColorRect" parent="CenterContainer/MarginContainer"]
29+
layout_mode = 2
30+
31+
[node name="MarginContainer" type="MarginContainer" parent="CenterContainer/MarginContainer/ColorRect"]
32+
layout_mode = 0
33+
offset_left = 8.0
34+
offset_top = -1.0
35+
offset_right = 48.0
36+
offset_bottom = 39.0
37+
scale = Vector2(14.6, 7.88)
38+
39+
[node name="ColorRect" type="ColorRect" parent="CenterContainer/MarginContainer/ColorRect/MarginContainer"]
40+
layout_mode = 2
41+
color = Color(0.306923, 0.306923, 0.306923, 1)
42+
43+
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/MarginContainer/ColorRect/MarginContainer/ColorRect"]
44+
layout_mode = 0
45+
offset_left = 15.5479
46+
offset_top = 2.28426
47+
offset_right = 70.5479
48+
offset_bottom = 42.2843
49+
scale = Vector2(0.150685, 0.248731)
50+
51+
[node name="Title" type="Label" parent="CenterContainer/MarginContainer/ColorRect/MarginContainer/ColorRect/VBoxContainer"]
52+
layout_mode = 2
53+
text = "Credits"
54+
55+
[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/MarginContainer/ColorRect/MarginContainer/ColorRect"]
56+
layout_mode = 0
57+
offset_left = 2.32877
58+
offset_top = 11.6751
59+
offset_right = 219.329
60+
offset_bottom = 164.675
61+
scale = Vector2(0.0566447, 0.0947541)
62+
63+
[node name="Label" type="Label" parent="CenterContainer/MarginContainer/ColorRect/MarginContainer/ColorRect/HBoxContainer"]
64+
layout_mode = 2
65+
text = "Programmers
66+
Jarod Spanger: Project Lead
67+
Connor Lowe
68+
Raul Mojarro
69+
Thomas Wessel
70+
Michael Quinn"
71+
horizontal_alignment = 1
72+
73+
[node name="HBoxContainer2" type="HBoxContainer" parent="CenterContainer/MarginContainer/ColorRect/MarginContainer/ColorRect"]
74+
layout_mode = 0
75+
offset_left = 18.0137
76+
offset_top = 12.3096
77+
offset_right = 99.0137
78+
offset_bottom = 113.31
79+
scale = Vector2(0.0602738, 0.102849)
80+
81+
[node name="Label" type="Label" parent="CenterContainer/MarginContainer/ColorRect/MarginContainer/ColorRect/HBoxContainer2"]
82+
layout_mode = 2
83+
text = "Artists
84+
Ares Atlas
85+
Evelyn Fu
86+
Emily Wen"
87+
horizontal_alignment = 1
88+
89+
[node name="HBoxContainer3" type="HBoxContainer" parent="CenterContainer/MarginContainer/ColorRect/MarginContainer/ColorRect"]
90+
layout_mode = 0
91+
offset_left = 26.1644
92+
offset_top = 11.802
93+
offset_right = 200.164
94+
offset_bottom = 86.802
95+
scale = Vector2(0.0544615, 0.10085)
96+
97+
[node name="Label" type="Label" parent="CenterContainer/MarginContainer/ColorRect/MarginContainer/ColorRect/HBoxContainer3"]
98+
layout_mode = 2
99+
text = "Sound
100+
Sam Meyer: Composer
101+
"
102+
103+
[node name="HBoxContainer4" type="HBoxContainer" parent="CenterContainer/MarginContainer/ColorRect/MarginContainer/ColorRect"]
104+
layout_mode = 0
105+
offset_left = 14.3836
106+
offset_top = 30.7107
107+
offset_right = 133.384
108+
offset_bottom = 70.7107
109+
scale = Vector2(0.101568, 0.177799)
110+
111+
[node name="Return Button" type="Button" parent="CenterContainer/MarginContainer/ColorRect/MarginContainer/ColorRect/HBoxContainer4"]
112+
layout_mode = 2
113+
text = "Return Button"
114+
flat = true
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
[gd_scene load_steps=3 format=3 uid="uid://fxio0pfqwmn6"]
2+
3+
[ext_resource type="Script" uid="uid://dkuui4eib1q3e" path="res://Scenes/UI/Options/Scripts/OptionsMenu.cs" id="1_bykv1"]
4+
[ext_resource type="Script" uid="uid://cery6g5ojnl16" path="res://Scenes/UI/Options/Scripts/LanguageSelection.cs" id="2_rqxu7"]
5+
6+
[node name="OptionsMenu" type="CanvasLayer" node_paths=PackedStringArray("_focused", "_volumeSlider", "_closeButton", "_controlsButton", "_creditsButton", "_highContrastToggle", "_howToPlayButton")]
7+
process_mode = 3
8+
script = ExtResource("1_bykv1")
9+
_focused = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HBoxContainer/CheckBox")
10+
_volumeSlider = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/Container/Volume")
11+
_closeButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/TitleButton")
12+
_controlsButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/ControlsButton")
13+
_creditsButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/CreditsButton")
14+
_highContrastToggle = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HBoxContainer/CheckBox")
15+
_howToPlayButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HowToPlayButton")
16+
17+
[node name="Control" type="Control" parent="."]
18+
layout_mode = 3
19+
anchors_preset = 15
20+
anchor_right = 1.0
21+
anchor_bottom = 1.0
22+
offset_top = -55.0
23+
grow_horizontal = 2
24+
grow_vertical = 2
25+
size_flags_horizontal = 3
26+
size_flags_vertical = 3
27+
28+
[node name="ColorRect" type="ColorRect" parent="Control"]
29+
layout_mode = 1
30+
anchors_preset = 15
31+
anchor_right = 1.0
32+
anchor_bottom = 1.0
33+
grow_horizontal = 2
34+
grow_vertical = 2
35+
color = Color(0.133, 0.133, 0.133, 1)
36+
37+
[node name="CenterContainer" type="CenterContainer" parent="Control"]
38+
layout_mode = 1
39+
anchors_preset = 15
40+
anchor_right = 1.0
41+
anchor_bottom = 1.0
42+
grow_horizontal = 2
43+
grow_vertical = 2
44+
45+
[node name="MarginContainer" type="MarginContainer" parent="Control/CenterContainer"]
46+
layout_mode = 2
47+
48+
[node name="ColorRect" type="ColorRect" parent="Control/CenterContainer/MarginContainer"]
49+
layout_mode = 2
50+
color = Color(0.24, 0.24, 0.24, 0.854902)
51+
52+
[node name="MarginContainer" type="MarginContainer" parent="Control/CenterContainer/MarginContainer"]
53+
layout_mode = 2
54+
theme_override_constants/margin_left = 0
55+
theme_override_constants/margin_top = 0
56+
theme_override_constants/margin_right = 0
57+
theme_override_constants/margin_bottom = 0
58+
59+
[node name="VBoxContainer" type="VBoxContainer" parent="Control/CenterContainer/MarginContainer/MarginContainer"]
60+
custom_minimum_size = Vector2(240, 0)
61+
layout_mode = 2
62+
size_flags_horizontal = 0
63+
theme_override_constants/separation = 16
64+
alignment = 1
65+
66+
[node name="Title" type="Label" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
67+
layout_mode = 2
68+
text = "TITLE_OPTIONS"
69+
horizontal_alignment = 1
70+
71+
[node name="HSeparator" type="HSeparator" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
72+
layout_mode = 2
73+
74+
[node name="HBoxContainer" type="HBoxContainer" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
75+
layout_mode = 2
76+
alignment = 1
77+
78+
[node name="CheckBox" type="CheckBox" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HBoxContainer"]
79+
layout_mode = 2
80+
81+
[node name="Label" type="Label" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HBoxContainer"]
82+
layout_mode = 2
83+
size_flags_horizontal = 8
84+
text = "OPTIONS_CONTRAST_LABEL"
85+
horizontal_alignment = 1
86+
87+
[node name="Container" type="VBoxContainer" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
88+
layout_mode = 2
89+
theme_override_constants/separation = 0
90+
91+
[node name="Label" type="Label" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/Container"]
92+
layout_mode = 2
93+
text = "OPTIONS_VOLUME_LABEL"
94+
horizontal_alignment = 1
95+
96+
[node name="Volume" type="HSlider" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/Container"]
97+
layout_mode = 2
98+
tooltip_text = "OPTIONS_VOLUME_LABEL"
99+
max_value = 1.0
100+
step = 0.01
101+
value = 1.0
102+
103+
[node name="LanguageSelection" type="OptionButton" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
104+
unique_name_in_owner = true
105+
layout_mode = 2
106+
item_count = 2
107+
popup/item_0/text = "English"
108+
popup/item_0/id = 0
109+
popup/item_1/text = "中文"
110+
popup/item_1/id = 1
111+
script = ExtResource("2_rqxu7")
112+
113+
[node name="ControlsButton" type="Button" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
114+
layout_mode = 2
115+
text = "TITLE_CONTROLS"
116+
117+
[node name="HowToPlayButton" type="Button" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
118+
layout_mode = 2
119+
text = "HOW_TO_PLAY"
120+
121+
[node name="TitleButton" type="Button" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
122+
layout_mode = 2
123+
text = "CONTROLS_RETURN_BUTTON"
124+
125+
[node name="CreditsButton" type="Button" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
126+
layout_mode = 2
127+
text = "CREDITS_BUTTON"
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using FunkEngine;
2+
using Godot;
3+
4+
public partial class CreditsMenu : Control, IFocusableMenu
5+
{
6+
public static readonly string LoadPath = "res://Scenes/UI/Options/Credits.tscn";
7+
8+
[Export]
9+
private Button _returnButton;
10+
11+
public IFocusableMenu Prev { get; set; }
12+
13+
public override void _Ready()
14+
{
15+
_returnButton.Pressed += ReturnToPrev;
16+
}
17+
18+
public void ResumeFocus()
19+
{
20+
ProcessMode = ProcessModeEnum.Inherit;
21+
_returnButton.GrabFocus();
22+
}
23+
24+
public void PauseFocus()
25+
{
26+
ProcessMode = ProcessModeEnum.Disabled;
27+
}
28+
29+
public void OpenMenu(IFocusableMenu prev)
30+
{
31+
Prev = prev;
32+
Prev.PauseFocus();
33+
_returnButton.GrabFocus();
34+
}
35+
36+
public void ReturnToPrev()
37+
{
38+
Prev.ResumeFocus();
39+
QueueFree();
40+
}
41+
42+
public override void _Input(InputEvent @event)
43+
{
44+
if (@event.IsActionPressed("ui_cancel"))
45+
{
46+
ReturnToPrev();
47+
GetViewport().SetInputAsHandled();
48+
}
49+
}
50+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uid://drt21hext7pm2

Scenes/UI/Options/Scripts/OptionsMenu.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
public partial class OptionsMenu : CanvasLayer, IFocusableMenu
55
{
6-
public static readonly string LoadPath = "res://Scenes/UI/Options/OptionsMenu.tscn";
6+
public static readonly string LoadPath = "res://Scenes/UI/Options/CreditsOptionTest.tscn";
77

88
public IFocusableMenu Prev { get; set; }
99

@@ -20,6 +20,9 @@ public partial class OptionsMenu : CanvasLayer, IFocusableMenu
2020
[Export]
2121
private Button _controlsButton;
2222

23+
[Export]
24+
private Button _creditsButton;
25+
2326
[Export]
2427
private CheckBox _highContrastToggle;
2528

@@ -44,6 +47,7 @@ public override void _Ready()
4447

4548
_closeButton.Pressed += ReturnToPrev;
4649
_controlsButton.Pressed += OpenControls;
50+
_creditsButton.Pressed += OpenCredits;
4751
_highContrastToggle.Toggled += HighContrastChanged;
4852
_howToPlayButton.Pressed += OpenHowToPlay;
4953
}
@@ -124,4 +128,12 @@ private void OpenHowToPlay()
124128
AddChild(howtoPlay);
125129
howtoPlay.OpenMenu(this);
126130
}
131+
132+
private void OpenCredits()
133+
{
134+
CreditsMenu creditsMenu = GD.Load<PackedScene>(CreditsMenu.LoadPath)
135+
.Instantiate<CreditsMenu>();
136+
AddChild(creditsMenu);
137+
creditsMenu.OpenMenu(this);
138+
}
127139
}

0 commit comments

Comments
 (0)