|
@@ -2,6 +2,7 @@ class_name Hub
|
|
|
extends Node2D
|
|
|
# User interface to create liners
|
|
|
|
|
|
+
|
|
|
signal hub_finished
|
|
|
signal input_list_updated
|
|
|
|
|
@@ -9,7 +10,9 @@ const ACTION_PLAYER_PREFIX = "p"
|
|
|
const ACTION_LEFT_SUFFIX = "_left"
|
|
|
const ACTION_RIGHT_SUFFIX = "_right"
|
|
|
const MAX_PLAYERS = 8
|
|
|
-const TXT_FORMAT_INPUT_LINE = "Player %d > left : %s | right : %s"
|
|
|
+
|
|
|
+export var format_player_control = "Player %d > left : %s | right : %s"
|
|
|
+export var format_mouse_button = "MB %s"
|
|
|
|
|
|
export (Array, Color) var playerColors = [
|
|
|
Color.red,
|
|
@@ -76,7 +79,7 @@ func _update_input_list_text():
|
|
|
var values = [k]
|
|
|
values.append(_get_label_from_action_name(_playerActionsLeft[k]))
|
|
|
values.append(_get_label_from_action_name(_playerActionsRight[k]))
|
|
|
- input_text_array.append(TXT_FORMAT_INPUT_LINE % values)
|
|
|
+ input_text_array.append(format_player_control % values)
|
|
|
_input_list_text = input_text_array.join("\n")
|
|
|
emit_signal("input_list_updated", _input_list_text)
|
|
|
|
|
@@ -85,7 +88,7 @@ func _get_label_from_action_name(action:String):
|
|
|
var input_label_array = PoolStringArray()
|
|
|
for event in InputMap.get_action_list(action):
|
|
|
if event is InputEventMouseButton:
|
|
|
- input_label_array.append("MB%s" % event.button_index)
|
|
|
+ input_label_array.append(format_mouse_button % event.button_index)
|
|
|
else:
|
|
|
input_label_array.append(event.as_text())
|
|
|
return input_label_array.join(", ")
|