Skip to content

Commit

Permalink
The game ran
Browse files Browse the repository at this point in the history
Do not be afraid about the errors at the start
  • Loading branch information
theludovyc committed Sep 7, 2024
1 parent 2e8b1fc commit be23667
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions addons/rakugo_game_template/rakugo_game_template.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
@tool
extends EditorPlugin

func init_setting_if_empty(setting_path:String, setting_value:Variant):
if ProjectSettings.get_setting(setting_path, "").is_empty():
ProjectSettings.set_setting(setting_path, setting_value)

func _enter_tree():
add_autoload_singleton("AppSettings", "res://addons/rakugo_game_template/Autoloads/AppSettings.gd")
Expand All @@ -9,11 +12,9 @@ func _enter_tree():
add_autoload_singleton("UISoundManager", "res://addons/rakugo_game_template/Autoloads/UISoundManager/UISoundManager.tscn")
add_autoload_singleton("Transitions", "res://addons/rakugo_game_template/Autoloads/Transitions/transitions.tscn")

if ProjectSettings.get_setting(RGT_Globals.loading_scene_setting_path, "").is_empty():
ProjectSettings.set_setting(RGT_Globals.loading_scene_setting_path, "res://scenes/LoadingScreen/LoadingScreen.tscn")

RGT_Globals.main_menu_setting = "res://scenes/MainMenu/MainMenu.tscn"
RGT_Globals.first_game_scene_setting = "res://scenes/Game/game.tscn"
init_setting_if_empty(RGT_Globals.loading_scene_setting_path, "res://scenes/LoadingScreen/LoadingScreen.tscn")
init_setting_if_empty(RGT_Globals.main_menu_setting_path, "res://scenes/MainMenu/MainMenu.tscn")
init_setting_if_empty(RGT_Globals.first_game_scene_setting_path, "res://scenes/Game/game.tscn")

func _exit_tree():
remove_autoload_singleton("AppSettings")
Expand Down
4 changes: 2 additions & 2 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ boot_splash/image="res://boot_splash.png"
config/icon="res://icon.png"
boot_splash/minimum_display_time=2000
addons/rakugo_game_template/loading_scene_path="res://Scene/Menu/LoadingScreen.tscn"
addons/rakugo_game_template/main_menu_path="res://scenes/MainMenu/MainMenu.tscn"
addons/rakugo_game_template/first_game_scene_path="res://scenes/Game/game.tscn"
addons/rakugo_game_template/main_menu_path="res://Scene/Menu/MainMenu.tscn"
addons/rakugo_game_template/first_game_scene_path="res://theLudovyc/Game2D.tscn"

[autoload]

Expand Down

0 comments on commit be23667

Please sign in to comment.