Bläddra i källkod

Fix last two bindings in input_mapping demo

Also connect the signal from script, as it makes it easier to understand
than by having to check the connected signals via the GUI.
Rémi Verschelde 9 år sedan
förälder
incheckning
a6d3c8816e
2 ändrade filer med 3 tillägg och 1 borttagningar
  1. 3 1
      gui/input_mapping/controls.gd
  2. BIN
      gui/input_mapping/controls.scn

+ 3 - 1
gui/input_mapping/controls.gd

@@ -51,4 +51,6 @@ func _ready():
 		# We assume that the key binding that we want is the first one (0), if there are several
 		input_event = InputMap.get_action_list(action)[0]
 		# See note at the beginning of the script
-		get_node("bindings").get_node(action).get_node("Button").set_text(OS.get_scancode_string(input_event.scancode))
+		var button = get_node("bindings").get_node(action).get_node("Button")
+		button.set_text(OS.get_scancode_string(input_event.scancode))
+		button.connect("pressed", self, "wait_for_input", [action])

BIN
gui/input_mapping/controls.scn