Add shop closes on buying something
This commit is contained in:
@@ -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) + "$"
|
||||
|
||||
@@ -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
|
||||
|
||||
+5
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user