From fd5863875341461aa43938b2fa3051c5780f2c53 Mon Sep 17 00:00:00 2001 From: blinry Date: Thu, 28 Jan 2021 12:08:12 +0100 Subject: [PATCH] Auto-forward to level select when run from editor --- project.godot | 2 +- scenes/game.gd | 1 + scenes/title.gd | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/project.godot b/project.godot index 9808e04..6d4a9d0 100644 --- a/project.godot +++ b/project.godot @@ -51,7 +51,7 @@ _global_script_class_icons={ [application] config/name="git-hydra" -run/main_scene="res://scenes/level_select.tscn" +run/main_scene="res://scenes/title.tscn" config/use_custom_user_dir=true boot_splash/bg_color=Color( 0, 0, 0, 1 ) diff --git a/scenes/game.gd b/scenes/game.gd index f4e9e84..2cb162f 100644 --- a/scenes/game.gd +++ b/scenes/game.gd @@ -10,6 +10,7 @@ var used_cards = false var current_chapter = 0 var current_level = 0 +var skipped_title = false var _file = "user://savegame.json" var state = {} diff --git a/scenes/title.gd b/scenes/title.gd index b488785..b4c76c9 100644 --- a/scenes/title.gd +++ b/scenes/title.gd @@ -1,7 +1,9 @@ extends Control func _ready(): - pass + if !OS.has_feature("standalone") and !game.skipped_title: + game.skipped_title = true + get_tree().change_scene("res://scenes/level_select.tscn") func quit(): get_tree().quit()