From f57f6acb9a03321a3cecdd9d962d7227244af050 Mon Sep 17 00:00:00 2001 From: hpham474 Date: Mon, 22 Nov 2021 22:23:57 -0600 Subject: [PATCH 1/3] Completed Credits Scene --- godot_ship/scenes/Credits.tscn | 135 ++++++++++++++++++++++++++++----- 1 file changed, 114 insertions(+), 21 deletions(-) diff --git a/godot_ship/scenes/Credits.tscn b/godot_ship/scenes/Credits.tscn index 161d504..1a68115 100644 --- a/godot_ship/scenes/Credits.tscn +++ b/godot_ship/scenes/Credits.tscn @@ -24,6 +24,22 @@ __meta__ = { "_edit_use_anchors_": false } +[node name="Back" type="Button" parent="."] +margin_left = 16.0 +margin_top = 16.0 +margin_right = 83.0 +margin_bottom = 40.0 +focus_neighbour_left = NodePath(".") +focus_neighbour_top = NodePath(".") +focus_neighbour_right = NodePath("../Sliders/SFX Setting/SFX Slider") +focus_neighbour_bottom = NodePath("../Buttons/Light") +focus_next = NodePath("../Sliders/SFX Setting/SFX Slider") +focus_previous = NodePath(".") +text = "Back" +__meta__ = { +"_edit_use_anchors_": false +} + [node name="Credits Label" type="Label" parent="."] anchor_left = 0.5 anchor_right = 0.5 @@ -41,12 +57,14 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Programmer" type="Label" parent="."] -margin_right = 248.0 -margin_bottom = 16.0 +[node name="Developmental Team" type="Label" parent="."] +margin_left = 64.0 +margin_top = 104.0 +margin_right = 576.0 +margin_bottom = 120.0 custom_fonts/font = SubResource( 2 ) -text = "Lead Programmer:" -align = 2 +text = "Developmental Team" +align = 1 valign = 1 __meta__ = { "_edit_use_anchors_": false @@ -54,9 +72,9 @@ __meta__ = { [node name="Programmer Titles" type="VBoxContainer" parent="."] margin_left = 64.0 -margin_top = 104.0 +margin_top = 120.0 margin_right = 312.0 -margin_bottom = 180.0 +margin_bottom = 196.0 __meta__ = { "_edit_use_anchors_": false } @@ -110,9 +128,9 @@ __meta__ = { [node name="Programmer Name" type="VBoxContainer" parent="."] margin_left = 328.0 -margin_top = 104.0 +margin_top = 120.0 margin_right = 576.0 -margin_bottom = 180.0 +margin_bottom = 196.0 __meta__ = { "_edit_use_anchors_": false } @@ -160,18 +178,93 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Back" type="Button" parent="."] -margin_left = 16.0 -margin_top = 16.0 -margin_right = 83.0 -margin_bottom = 40.0 -focus_neighbour_left = NodePath(".") -focus_neighbour_top = NodePath(".") -focus_neighbour_right = NodePath("../Sliders/SFX Setting/SFX Slider") -focus_neighbour_bottom = NodePath("../Buttons/Light") -focus_next = NodePath("../Sliders/SFX Setting/SFX Slider") -focus_previous = NodePath(".") -text = "Back" +[node name="Assets" type="Label" parent="."] +margin_left = 64.0 +margin_top = 208.0 +margin_right = 576.0 +margin_bottom = 224.0 +custom_fonts/font = SubResource( 2 ) +text = "Assets" +align = 1 +valign = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Assets Titles" type="VBoxContainer" parent="."] +margin_left = 64.0 +margin_top = 224.0 +margin_right = 312.0 +margin_bottom = 288.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="BGM" type="Label" parent="Assets Titles"] +margin_right = 248.0 +margin_bottom = 35.0 +custom_fonts/font = SubResource( 2 ) +text = "Background Music: +" +align = 2 +valign = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="SFX" type="Label" parent="Assets Titles"] +margin_top = 39.0 +margin_right = 248.0 +margin_bottom = 55.0 +custom_fonts/font = SubResource( 2 ) +text = "SFX Sounds:" +align = 2 +valign = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Assets Credits" type="VBoxContainer" parent="."] +margin_left = 328.0 +margin_top = 225.0 +margin_right = 576.0 +margin_bottom = 299.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Composer" type="Label" parent="Assets Credits"] +margin_right = 248.0 +margin_bottom = 35.0 +custom_fonts/font = SubResource( 2 ) +text = "\"Captain Scurvy\" Kevin + MacLeod (incompetech.com)" +valign = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="SFX creators" type="Label" parent="Assets Credits"] +margin_top = 39.0 +margin_right = 248.0 +margin_bottom = 74.0 +custom_fonts/font = SubResource( 2 ) +text = "Creator Assets +Free Sounds Library" +valign = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Engine" type="Label" parent="."] +margin_left = 64.0 +margin_top = 312.0 +margin_right = 576.0 +margin_bottom = 328.0 +custom_fonts/font = SubResource( 2 ) +text = "Created Using Godot Engine" +align = 1 +valign = 1 __meta__ = { "_edit_use_anchors_": false } From 50ad9a25391707ceaef217ced42f420e5ea7febc Mon Sep 17 00:00:00 2001 From: hpham474 Date: Mon, 22 Nov 2021 22:35:28 -0600 Subject: [PATCH 2/3] Added button to go in and out of credits --- godot_ship/scenes/Credits.tscn | 4 ++-- godot_ship/scenes/Title Screen.tscn | 9 +++++++- godot_ship/script/Main.gd | 5 +++++ godot_ship/script/credits/Credits.gd | 22 +++++++++++++++++++ .../script/title screen/Title Screen.gd | 5 +++++ 5 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 godot_ship/script/credits/Credits.gd diff --git a/godot_ship/scenes/Credits.tscn b/godot_ship/scenes/Credits.tscn index 1a68115..cc16b06 100644 --- a/godot_ship/scenes/Credits.tscn +++ b/godot_ship/scenes/Credits.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=6 format=2] [ext_resource path="res://assets/font/Minecraft.ttf" type="DynamicFontData" id=1] -[ext_resource path="res://script/options/Options.gd" type="Script" id=2] +[ext_resource path="res://script/credits/Credits.gd" type="Script" id=2] [ext_resource path="res://light_theme.tres" type="Theme" id=3] [sub_resource type="DynamicFont" id=1] @@ -269,4 +269,4 @@ __meta__ = { "_edit_use_anchors_": false } -[connection signal="pressed" from="Back" to="." method="_on_Button_pressed"] +[connection signal="pressed" from="Back" to="." method="_on_Back_pressed"] diff --git a/godot_ship/scenes/Title Screen.tscn b/godot_ship/scenes/Title Screen.tscn index 2750f97..8f04e9f 100644 --- a/godot_ship/scenes/Title Screen.tscn +++ b/godot_ship/scenes/Title Screen.tscn @@ -50,10 +50,16 @@ margin_right = 160.0 margin_bottom = 80.0 text = "Options" -[node name="Quit" type="Button" parent="VBoxContainer"] +[node name="Credits" type="Button" parent="VBoxContainer"] margin_top = 84.0 margin_right = 160.0 margin_bottom = 108.0 +text = "Credits" + +[node name="Quit" type="Button" parent="VBoxContainer"] +margin_top = 112.0 +margin_right = 160.0 +margin_bottom = 136.0 focus_neighbour_bottom = NodePath("../Singleplayer") text = "Quit" @@ -82,4 +88,5 @@ __meta__ = { [connection signal="pressed" from="VBoxContainer/Singleplayer" to="." method="_on_Singleplayer_pressed"] [connection signal="pressed" from="VBoxContainer/Multiplayer" to="." method="_on_Multiplayer_pressed"] [connection signal="pressed" from="VBoxContainer/Options" to="." method="_on_Options_pressed"] +[connection signal="pressed" from="VBoxContainer/Credits" to="." method="_on_Credits_pressed"] [connection signal="pressed" from="VBoxContainer/Quit" to="." method="_on_Quit_pressed"] diff --git a/godot_ship/script/Main.gd b/godot_ship/script/Main.gd index 0820385..20c47ef 100644 --- a/godot_ship/script/Main.gd +++ b/godot_ship/script/Main.gd @@ -4,6 +4,7 @@ extends Control onready var Title_Screen = preload("res://scenes/Title Screen.tscn") onready var Game = preload("res://scenes/Game/Game.tscn" ) onready var Options = preload("res://scenes/Options.tscn" ) +onready var Credits = preload("res://scenes/Credits.tscn" ) onready var Debug_Menu = preload("res://scenes/Debug Menu.tscn" ) # Themes @@ -71,6 +72,10 @@ func _on_scene_start(scene): instance = Options.instance() add_child (instance) return true + "Credits": + instance = Credits.instance() + add_child (instance) + return true "Title": instance = Title_Screen.instance() add_child (instance) diff --git a/godot_ship/script/credits/Credits.gd b/godot_ship/script/credits/Credits.gd new file mode 100644 index 0000000..fdd48eb --- /dev/null +++ b/godot_ship/script/credits/Credits.gd @@ -0,0 +1,22 @@ +extends Control + + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass + + +func _on_Back_pressed(): + AudioBus.emit_signal("button_clicked") + queue_free() + pass # Replace with function body. diff --git a/godot_ship/script/title screen/Title Screen.gd b/godot_ship/script/title screen/Title Screen.gd index 0f8308a..4111b75 100644 --- a/godot_ship/script/title screen/Title Screen.gd +++ b/godot_ship/script/title screen/Title Screen.gd @@ -25,6 +25,11 @@ func _on_Options_pressed(): MessageBus.emit_signal("change_scene", "Options") queue_free() +func _on_Credits_pressed(): + AudioBus.emit_signal("button_clicked") + MessageBus.emit_signal("change_scene", "Credits") + queue_free() + func _on_Quit_pressed(): AudioBus.emit_signal("button_clicked") MessageBus.emit_signal("quit") From 6ea3da7205b407f469c785d22d2d99430baceaeb Mon Sep 17 00:00:00 2001 From: hpham474 Date: Mon, 22 Nov 2021 22:39:42 -0600 Subject: [PATCH 3/3] Themes now work on credits page --- godot_ship/script/credits/Credits.gd | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/godot_ship/script/credits/Credits.gd b/godot_ship/script/credits/Credits.gd index fdd48eb..5fcd343 100644 --- a/godot_ship/script/credits/Credits.gd +++ b/godot_ship/script/credits/Credits.gd @@ -1,22 +1,21 @@ extends Control - -# Declare member variables here. Examples: -# var a = 2 -# var b = "text" - +var light_theme = load("res://light_theme.tres") +var dark_theme = load("res://dark_theme.tres") # Called when the node enters the scene tree for the first time. func _ready(): - pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass - + var _errno = 0; + _errno += OptionsController.connect("change_theme", self, "_on_change_theme") + _on_change_theme(OptionsController.get_theme()) func _on_Back_pressed(): AudioBus.emit_signal("button_clicked") queue_free() pass # Replace with function body. + +func _on_change_theme(theme): + if theme == "light": + self.set_theme(light_theme) + elif theme == "dark": + self.set_theme(dark_theme)