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

Minor bug fixes #16

Merged
merged 5 commits into from
Dec 23, 2023
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
2 changes: 1 addition & 1 deletion App/Scripts/InGameMenuController.gd
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ static func close_menu() -> void:
current_menu.queue_free()
Input.set_mouse_mode(saved_mouse_mode)
scene_tree.paused = false
if is_instance_valid(saved_focus_control):
if is_instance_valid(saved_focus_control) and saved_focus_control.is_inside_tree():
saved_focus_control.grab_focus()
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

[ext_resource type="Script" path="res://App/Scripts/UISoundController.gd" id="1_dmagn"]

[node name="UISoundControllerAutoload" type="Node"]
[node name="ProjectUISoundController" type="Node"]
script = ExtResource("1_dmagn")
2 changes: 2 additions & 0 deletions Extras/Scenes/FailureScreen/FailureScreen.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Panel" type="Panel" parent="Control"]
custom_minimum_size = Vector2(410, 240)
Expand Down
26 changes: 14 additions & 12 deletions Extras/Scenes/SuccessScreen/SuccessScreen.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 0.501961)

[node name="CenterContainer" type="Control" parent="."]
[node name="Control" type="Control" parent="."]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Panel" type="Panel" parent="CenterContainer"]
[node name="Panel" type="Panel" parent="Control"]
custom_minimum_size = Vector2(410, 240)
layout_mode = 1
anchors_preset = 8
Expand All @@ -40,7 +42,7 @@ offset_bottom = 120.0
grow_horizontal = 2
grow_vertical = 2

[node name="MarginContainer" type="MarginContainer" parent="CenterContainer/Panel"]
[node name="MarginContainer" type="MarginContainer" parent="Control/Panel"]
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
Expand All @@ -49,36 +51,36 @@ theme_override_constants/margin_top = 8
theme_override_constants/margin_right = 8
theme_override_constants/margin_bottom = 8

[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/Panel/MarginContainer"]
[node name="VBoxContainer" type="VBoxContainer" parent="Control/Panel/MarginContainer"]
layout_mode = 2
alignment = 1

[node name="Title" type="Label" parent="CenterContainer/Panel/MarginContainer/VBoxContainer"]
[node name="Title" type="Label" parent="Control/Panel/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
text = "You won!"
horizontal_alignment = 1
vertical_alignment = 1

[node name="ButtonsContainer" type="HBoxContainer" parent="CenterContainer/Panel/MarginContainer/VBoxContainer"]
[node name="ButtonsContainer" type="HBoxContainer" parent="Control/Panel/MarginContainer/VBoxContainer"]
layout_mode = 2
alignment = 1
script = ExtResource("3_rix3y")

[node name="ContinueButton" type="Button" parent="CenterContainer/Panel/MarginContainer/VBoxContainer/ButtonsContainer"]
[node name="ContinueButton" type="Button" parent="Control/Panel/MarginContainer/VBoxContainer/ButtonsContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(128, 40)
layout_mode = 2
text = "Continue"

[node name="MainMenuButton" type="Button" parent="CenterContainer/Panel/MarginContainer/VBoxContainer/ButtonsContainer"]
[node name="MainMenuButton" type="Button" parent="Control/Panel/MarginContainer/VBoxContainer/ButtonsContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(128, 40)
layout_mode = 2
text = "Main Menu"

[node name="ExitButton" type="Button" parent="CenterContainer/Panel/MarginContainer/VBoxContainer/ButtonsContainer"]
[node name="ExitButton" type="Button" parent="Control/Panel/MarginContainer/VBoxContainer/ButtonsContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(128, 40)
layout_mode = 2
Expand All @@ -95,8 +97,8 @@ dialog_text = "Quit the game?"
[node name="UISoundController" type="Node" parent="."]
script = ExtResource("3_smu5k")

[connection signal="pressed" from="CenterContainer/Panel/MarginContainer/VBoxContainer/ButtonsContainer/ContinueButton" to="." method="_on_continue_button_pressed"]
[connection signal="pressed" from="CenterContainer/Panel/MarginContainer/VBoxContainer/ButtonsContainer/MainMenuButton" to="." method="_on_main_menu_button_pressed"]
[connection signal="pressed" from="CenterContainer/Panel/MarginContainer/VBoxContainer/ButtonsContainer/ExitButton" to="." method="_on_exit_button_pressed"]
[connection signal="pressed" from="Control/Panel/MarginContainer/VBoxContainer/ButtonsContainer/ContinueButton" to="." method="_on_continue_button_pressed"]
[connection signal="pressed" from="Control/Panel/MarginContainer/VBoxContainer/ButtonsContainer/MainMenuButton" to="." method="_on_main_menu_button_pressed"]
[connection signal="pressed" from="Control/Panel/MarginContainer/VBoxContainer/ButtonsContainer/ExitButton" to="." method="_on_exit_button_pressed"]
[connection signal="confirmed" from="ConfirmMainMenu" to="." method="_on_confirm_main_menu_confirmed"]
[connection signal="confirmed" from="ConfirmExit" to="." method="_on_confirm_exit_confirmed"]
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,26 @@ The `Extras/` folder holds components that extend the core application.

### App vs. Extras

To begin with, use the `Extras/` folder, and make changes there. However, to start minimally, use just the `App/` folder. Compare [Features](#features) to decide.
`App/` contains the core features of the package. On first use, it's recommended to keep the `Extras/` folder, and make changes there. Features can be added and removed as needed.

To start minimally, use just the `App/` folder, and safely remove the `Extras/` folder by following the [minimal](#minimal) instructions.

Compare [features](#features) to decide which approach is best for your project.

#### Minimal

If you just want to use just the projects minimum `App/` folder:

1. Go to `Project > Project Settings… > General > Application > Run`.
2. Update `Main Scene` to `res://App/Scenes/InitApp/InitApp.tscn`.
3. Close the window.
4. Delete the `Extras/` folder.
3. Go to `Project > Project Settings… > Autoload`.
4. Remove autoloads that start with the path `res://Extras/...`.
1. `ProjectUiSoundController`
2. `ProjectLevelLoader`
3. `RuntimeLogger`
5. Close the window.
6. Delete the `Extras/` folder.
7. Reload the project.


The remaining instructions will apply the same for either folder you decide to use.
Expand Down Expand Up @@ -172,17 +182,17 @@ For an existing project, just copy over the `App/` folder (optionally the `Extra
1. Update the project’s main scene.


1. Go to Project > Project Settings… > General > Application > Run.
1. Go to `Project > Project Settings… > General > Application > Run`.
2. Update `Main Scene` to `res://…/InitApp.tscn`.
3. Close the window.


2. Update the project’s autoloads.


1. Go to Project > Project Settings… > Autoload.
1. Go to `Project > Project Settings… > Autoload`.
2. Add `res://App/Scripts/SceneLoader.gd`.
3. Optionally add `res://Extras/Scripts/RuntimeLogger.gd`.
3. Optionally enable `res://Extras/Scripts/RuntimeLogger.gd`.
4. Close the window.

3. Update the project’s name.
Expand Down
4 changes: 3 additions & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ config/icon="res://icon.png"
[autoload]

SceneLoader="*res://App/Scripts/SceneLoader.gd"
UISoundControllerAutoload="res://Extras/Scenes/UISoundController/UISoundControllerAutoload.tscn"
ProjectUiSoundController="res://Extras/Scenes/Autoloads/ProjectUISoundController.tscn"
ProjectLevelLoader="res://Extras/Scenes/Autoloads/ProjectLevelLoader.tscn"
RuntimeLogger="res://Extras/Scripts/RuntimeLogger.gd"

[display]

Expand Down