feat : mobile input controller
This commit is contained in:
+13
-2
@@ -202,6 +202,7 @@ func _process(delta):
|
||||
var mesh_cache: Array[MeshInstance3D] = []
|
||||
var original_scales: Array[Vector3] = []
|
||||
var prompt_container: Node3D
|
||||
var _prompt_key_label: Label = null # cached ref for live refresh
|
||||
@onready var SettingsManager = get_node_or_null("/root/SettingsManager")
|
||||
|
||||
func _update_prompt_label():
|
||||
@@ -245,13 +246,23 @@ func _ready():
|
||||
prompt_container.visible = false
|
||||
var key_label = prompt_container.get_node_or_null("KeyLabel")
|
||||
if key_label:
|
||||
_prompt_key_label = key_label
|
||||
var shortcut_text = "G"
|
||||
if SettingsManager and SettingsManager.has_method("get_control_text"):
|
||||
shortcut_text = SettingsManager.get_control_text("tekton_grab")
|
||||
if SettingsManager and SettingsManager.has_method("get_action_display"):
|
||||
shortcut_text = SettingsManager.get_action_display("tekton_grab")
|
||||
key_label.text = "[ " + str(shortcut_text) + " ]"
|
||||
# Listen for controller mode change to refresh live
|
||||
if SettingsManager and not SettingsManager.settings_applied.is_connected(_on_settings_refresh):
|
||||
SettingsManager.settings_applied.connect(_on_settings_refresh)
|
||||
else:
|
||||
push_warning("[Tekton] 'InteractionPrompt' node missing. UI will not appear.")
|
||||
|
||||
func _on_settings_refresh():
|
||||
"""Called when settings_applied fires - refresh the interaction prompt key label."""
|
||||
if _prompt_key_label and SettingsManager:
|
||||
var shortcut_text = SettingsManager.get_action_display("tekton_grab")
|
||||
_prompt_key_label.text = "[ " + shortcut_text + " ]"
|
||||
|
||||
func _cache_meshes(node: Node):
|
||||
if node is MeshInstance3D:
|
||||
mesh_cache.append(node)
|
||||
|
||||
Reference in New Issue
Block a user