Skip to content

Commit 88362ec

Browse files
committed
Removes future feature dependency.
1 parent d15205a commit 88362ec

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

addons/maaacks_game_template/docs/GameSceneSetup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ In that case, the following nodes can be safely removed:
3434

3535
The single level scene can then be added directly to the `SubViewport`, another container, or the root node.
3636

37-
To manage the win and lose screens and transitioning to other scenes, add a `Node` and attach the `win_lose_manager.gd` script. Inspect the node to attach the win / lose screens. The `game_won()` or `game_lost()` will then need to be called when gameplay conditions are met.
37+
To manage the win and lose screens and transitioning to other scenes, add a `Node` and attach the `win_lose_manager.gd` script. Inspect the node to attach the win / lose screens and paths. The `game_won()` or `game_lost()` will then need to be called when gameplay conditions are met.
3838

3939
## Background Music
4040
`BackgroundMusicPlayer`'s are `AudioStreamPlayer`'s with `autoplay` set to `true` and `audio_bus` set to "Music". These will automatically be recognized by the `ProjectMusicController` with the default settings, and allow for blending between tracks.

addons/maaacks_game_template/extras/scripts/win_lose_manager.gd

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
extends Node
22

33
## Path to a main menu scene.
4-
## Will attempt to read from AppConfig if left empty.
5-
@export_file("*.tscn") var main_menu_scene_path : String
4+
@export_file("*.tscn") var main_menu_scene : String
65
## Optional path to an ending scene.
7-
## Will attempt to read from AppConfig if left empty.
8-
@export_file("*.tscn") var ending_scene_path : String
6+
@export_file("*.tscn") var ending_scene : String
97
## Optional screen to be shown after the game is won.
108
@export var game_won_scene : PackedScene
119
## Optional screen to be shown after the game is lost.
@@ -15,22 +13,12 @@ func _try_connecting_signal_to_node(node : Node, signal_name : String, callable
1513
if node.has_signal(signal_name) and not node.is_connected(signal_name, callable):
1614
node.connect(signal_name, callable)
1715

18-
func get_main_menu_scene_path() -> String:
19-
if main_menu_scene_path.is_empty():
20-
return AppConfig.main_menu_scene_path
21-
return main_menu_scene_path
22-
2316
func _load_main_menu() -> void:
24-
SceneLoader.load_scene(get_main_menu_scene_path())
25-
26-
func get_ending_scene_path() -> String:
27-
if ending_scene_path.is_empty():
28-
return AppConfig.ending_scene_path
29-
return ending_scene_path
17+
SceneLoader.load_scene(main_menu_scene)
3018

3119
func _load_ending() -> void:
32-
if not get_ending_scene_path().is_empty():
33-
SceneLoader.load_scene(get_ending_scene_path())
20+
if ending_scene:
21+
SceneLoader.load_scene(ending_scene)
3422
else:
3523
_load_main_menu()
3624

0 commit comments

Comments
 (0)