diff --git a/UI/shop_station_button.gd b/UI/shop_station_button.gd index 682900e..d74ca16 100644 --- a/UI/shop_station_button.gd +++ b/UI/shop_station_button.gd @@ -10,7 +10,6 @@ extends Panel @export var button: Button -# Called when the node enters the scene tree for the first time. func _ready() -> void: name_label.text = station_name cost_label.text = str(cost) + "$" diff --git a/UI/shop_station_panel.tscn b/UI/shop_station_panel.tscn index e3a1b2b..2dc9368 100644 --- a/UI/shop_station_panel.tscn +++ b/UI/shop_station_panel.tscn @@ -35,6 +35,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +action_mode = 0 icon = ExtResource("2_e1k4i") icon_alignment = 1 expand_icon = true diff --git a/UI/shop_ui.gd b/UI/shop_ui.gd index 05cdae3..9386b0b 100644 --- a/UI/shop_ui.gd +++ b/UI/shop_ui.gd @@ -19,7 +19,7 @@ func _ready() -> void: controller.button_pressed.connect(_on_controller_button_pressed) if other_controller: other_controller.button_pressed.connect(_on_other_controller_button_pressed) - + Signals.station_bought.connect(_on_station_bought) viewport = get_parent().get_parent() as XRToolsViewport2DIn3D if not viewport: push_error("Shop UI could not find XRToolsViewport2DIn3D grand parent") @@ -76,6 +76,10 @@ func _on_other_controller_button_pressed(button_name: String) -> void: enabled = false +func _on_station_bought(instance) -> void: + enabled = false + + func detect_hand_from_xr_ancestor() -> void: controller = XRHelpers.get_xr_controller(self) if not controller: