Partially fix the active controller

This commit is contained in:
CactiChameleon9 2022-08-14 11:24:48 +01:00
parent 47f59a7a6d
commit a7256d56ed
4 changed files with 17 additions and 3 deletions

View File

@ -11,7 +11,8 @@ func _process(_delta):
func the_pausing(): func the_pausing():
# iterate through the children, allowing only the current active node to run # iterate through the children, allowing only the current active node to run
for i in len(get_children()): for i in len(get_children()):
get_child(i).pause_mode = 0 if i == current_active else 1 if get_child(i).has_signal("scene_finished"): # only change if active var should exist
get_child(i).active = true if i == current_active else false
func the_connecting(): func the_connecting():
@ -23,7 +24,7 @@ func the_connecting():
if (get_child(i).has_signal("scene_finished") and if (get_child(i).has_signal("scene_finished") and
get_child(i).get_signal_connection_list("scene_finished") == []): get_child(i).get_signal_connection_list("scene_finished") == []):
get_child(i).connect("scene_finished", self, child_finished()) get_child(i).connect("scene_finished", self, "child_finished")
# connect the failed signal if it exists and # connect the failed signal if it exists and
@ -31,7 +32,7 @@ func the_connecting():
if (get_child(i).has_signal("scene_failed") and if (get_child(i).has_signal("scene_failed") and
get_child(i).get_signal_connection_list("scene_failed") == []): get_child(i).get_signal_connection_list("scene_failed") == []):
get_child(i).connect("scene_failed", self, child_failed()) get_child(i).connect("scene_failed", self, "child_failed")
func child_finished(): func child_finished():

View File

@ -3,6 +3,7 @@ extends Node2D
signal scene_finished signal scene_finished
signal scene_failed signal scene_failed
var active : bool = false
var character = null setget new_character var character = null setget new_character
var movement_queue = [] var movement_queue = []
@ -78,5 +79,8 @@ func character_movement():
func _physics_process(_delta): func _physics_process(_delta):
if not active:
return
character_movement() character_movement()
character_movement_input() character_movement_input()

View File

@ -1,5 +1,10 @@
extends Control extends Control
signal scene_finished
signal scene_failed
var active : bool = false
const card_view_scene = preload("res://UI/CardView.tscn") const card_view_scene = preload("res://UI/CardView.tscn")
var character : Character = Character.new() setget update_cards_shown var character : Character = Character.new() setget update_cards_shown

View File

@ -1,6 +1,10 @@
extends Control extends Control
signal dice_selected (dice_value) signal dice_selected (dice_value)
signal scene_finished
signal scene_failed
var active : bool = false
const dice = preload("res://UI/Dice.tscn") const dice = preload("res://UI/Dice.tscn")