diff --git a/ovr-utils/ListOverlayItem.tscn b/ovr-utils/ListOverlayItem.tscn index 7edaec1..e26ee29 100644 --- a/ovr-utils/ListOverlayItem.tscn +++ b/ovr-utils/ListOverlayItem.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://styles/menu.theme" type="Theme" id=1] [ext_resource path="res://icons/visible.svg" type="Texture" id=2] @@ -8,6 +8,10 @@ [ext_resource path="res://icons/reset.svg" type="Texture" id=6] [ext_resource path="res://icons/size.svg" type="Texture" id=7] [ext_resource path="res://icons/hand_r.svg" type="Texture" id=8] +[ext_resource path="res://textures/icon.png" type="Texture" id=9] + +[sub_resource type="DynamicFont" id=1] +size = 1 [node name="ListOverlayItem" type="PanelContainer"] margin_top = 1727.0 @@ -35,25 +39,27 @@ margin_bottom = 199.0 alignment = 2 [node name="Remove" type="Button" parent="HBoxContainer"] -margin_left = 1006.0 -margin_right = 1182.0 +margin_left = 948.0 +margin_right = 1124.0 margin_bottom = 191.0 toggle_mode = true icon = ExtResource( 5 ) [node name="Reset" type="Button" parent="HBoxContainer"] -margin_left = 1186.0 -margin_right = 1362.0 +margin_left = 1128.0 +margin_right = 1304.0 margin_bottom = 191.0 icon = ExtResource( 6 ) [node name="Target" type="OptionButton" parent="HBoxContainer"] -margin_left = 1366.0 +margin_left = 1308.0 margin_right = 1492.0 margin_bottom = 191.0 -text = "H" -items = [ "H", null, false, 0, null, "L", ExtResource( 8 ), false, 1, null, "R", ExtResource( 8 ), false, 2, null, "W", null, false, 3, null ] -selected = 0 +custom_fonts/font = SubResource( 1 ) +text = "Left" +icon = ExtResource( 8 ) +items = [ "Head", ExtResource( 9 ), false, 0, null, "Left", ExtResource( 8 ), false, 1, null, "Right", ExtResource( 8 ), false, 2, null, "World", ExtResource( 4 ), false, 3, null ] +selected = 1 [node name="Size" type="Button" parent="HBoxContainer"] margin_left = 1496.0 diff --git a/ovr-utils/addons/openvr_overlay/interaction/overlay_interaction.gd b/ovr-utils/addons/openvr_overlay/interaction/overlay_interaction.gd index b578945..e8881e4 100644 --- a/ovr-utils/addons/openvr_overlay/interaction/overlay_interaction.gd +++ b/ovr-utils/addons/openvr_overlay/interaction/overlay_interaction.gd @@ -53,7 +53,7 @@ func _trigger_off(): func _on_OverlayArea_entered(body: Node) -> void: - if body.get_node("../../..") != self or pause_triggers: + if body.get_node("../../..") != self or pause_triggers or !get_parent().overlay_visible: return touch_state = true active_controller = body.get_parent().name @@ -62,7 +62,7 @@ func _on_OverlayArea_entered(body: Node) -> void: func _on_OverlayArea_exited(body: Node) -> void: - if body.get_node("../../..") != self or pause_triggers: + if body.get_node("../../..") != self or pause_triggers or !get_parent().overlay_visible: return # TODO revert to other controller if both were touching (edge case) active_controller = "" diff --git a/ovr-utils/addons/openvr_overlay/overlay_instance.gd b/ovr-utils/addons/openvr_overlay/overlay_instance.gd index 775bff0..1b73fff 100644 --- a/ovr-utils/addons/openvr_overlay/overlay_instance.gd +++ b/ovr-utils/addons/openvr_overlay/overlay_instance.gd @@ -26,6 +26,7 @@ var _offsets:Dictionary = { var current_target: String = "world" setget _set_current_target# most of the time the actual target, but will fall back var fallback = ["left", "right", "head"] # TODO setget that updates tracking (not important) var interaction_handler: Node +var overlay_visible := true setget set_overlay_visible var _tracker_id: int = 0 @@ -139,6 +140,10 @@ func update_current_target(): update_tracker_id() +func set_overlay_visible(state: bool): + overlay_visible = state + $OverlayViewport.overlay_visible = state + func _tracker_changed(tracker_name: String, type: int, id: int): update_current_target() diff --git a/ovr-utils/menu.theme b/ovr-utils/menu.theme deleted file mode 100644 index 3dc901e..0000000 Binary files a/ovr-utils/menu.theme and /dev/null differ diff --git a/ovr-utils/overlay_list_item.gd b/ovr-utils/overlay_list_item.gd index d61ce43..e910cd1 100644 --- a/ovr-utils/overlay_list_item.gd +++ b/ovr-utils/overlay_list_item.gd @@ -10,7 +10,7 @@ func _ready() -> void: func _on_Visibility_toggled(state: bool) -> void: - overlay.get_node("OverlayViewport").overlay_visible = state + overlay.overlay_visible = state if state: $HBoxContainer/Visibility.icon = preload("res://icons/visible.svg") else: diff --git a/ovr-utils/styles/menu.theme b/ovr-utils/styles/menu.theme index 5c40ceb..636bed5 100644 Binary files a/ovr-utils/styles/menu.theme and b/ovr-utils/styles/menu.theme differ