WIP: reinstate some DEMO features
This commit is contained in:
parent
089a849883
commit
dcde689111
16
src/main.gd
16
src/main.gd
|
|
@ -52,8 +52,14 @@ func _process(_delta: float) -> void:
|
||||||
currently_loading_room = ""
|
currently_loading_room = ""
|
||||||
room_loaded.emit()
|
room_loaded.emit()
|
||||||
|
|
||||||
if Input.is_action_just_pressed("ui_menu") and in_game:
|
if Input.is_action_just_pressed("reset_demo") and (OS.has_feature("demo") or true):
|
||||||
toggle_pause_menu()
|
State.stage_list = [self]
|
||||||
|
_return_to_menu()
|
||||||
|
|
||||||
|
func _unhandled_input(event: InputEvent) -> void:
|
||||||
|
if event is InputEvent and in_game:
|
||||||
|
if event.is_action_pressed("ui_menu"):
|
||||||
|
toggle_pause_menu()
|
||||||
|
|
||||||
func toggle_pause_menu():
|
func toggle_pause_menu():
|
||||||
if not get_tree().paused:
|
if not get_tree().paused:
|
||||||
|
|
@ -121,5 +127,11 @@ func get_room_path_from_id(id: State.rooms) -> String:
|
||||||
_:
|
_:
|
||||||
return ending_path
|
return ending_path
|
||||||
|
|
||||||
|
func start_demo():
|
||||||
|
#FIXME this causes the room to reload
|
||||||
|
#load_save(SaveGame.new())
|
||||||
|
current_room.start_room()
|
||||||
|
in_game = true
|
||||||
|
|
||||||
func pause_mode_changed():
|
func pause_mode_changed():
|
||||||
print(get_tree().paused)
|
print(get_tree().paused)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue