diff --git a/ovr-utils/addons/openvr_overlay/overlay_init.gd b/ovr-utils/addons/openvr_overlay/overlay_init.gd index 284d7f7..358a644 100644 --- a/ovr-utils/addons/openvr_overlay/overlay_init.gd +++ b/ovr-utils/addons/openvr_overlay/overlay_init.gd @@ -11,7 +11,7 @@ var trackers = { } func _init() -> void: - OS.window_minimized = true +# OS.window_minimized = true ovr_config = preload("res://addons/godot-openvr/OpenVRConfig.gdns").new() ovr_config.set_application_type(2) # Set to OVERLAY MODE = 2, NORMAL MODE = 1 ovr_config.set_tracking_universe(1) # Set to SEATED MODE = 0, STANDING MODE = 1, RAW MODE = 2 diff --git a/ovr-utils/overlay_scripts/main_menu.gd b/ovr-utils/overlay_scripts/main_menu.gd index 26d9636..0dd56f1 100644 --- a/ovr-utils/overlay_scripts/main_menu.gd +++ b/ovr-utils/overlay_scripts/main_menu.gd @@ -31,3 +31,11 @@ func _on_ShowOverlays_toggled(state: bool) -> void: func _on_AddOverlay_toggled(state: bool) -> void: $MarginContainer/VSplitContainer/Control/AddMenu.visible = state + +func _on_QuitToggle_toggled(state: bool) -> void: + $MarginContainer/VSplitContainer/MainBar/QuitToggle/Quit.visible = state + + +func _on_Quit_pressed() -> void: + Settings.save_settings() + get_tree().quit() diff --git a/ovr-utils/styles/menu.theme b/ovr-utils/styles/menu.theme index ee47e54..61f2e97 100644 Binary files a/ovr-utils/styles/menu.theme and b/ovr-utils/styles/menu.theme differ diff --git a/ovr-utils/ui/MainOverlay.tscn b/ovr-utils/ui/MainOverlay.tscn index 3559139..18dce9b 100644 --- a/ovr-utils/ui/MainOverlay.tscn +++ b/ovr-utils/ui/MainOverlay.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://overlay_scripts/main_menu.gd" type="Script" id=1] [ext_resource path="res://styles/menu.theme" type="Theme" id=2] @@ -7,6 +7,7 @@ [ext_resource path="res://icons/move.svg" type="Texture" id=5] [ext_resource path="res://icons/list.svg" type="Texture" id=6] [ext_resource path="res://ui/ListOverlayItem.tscn" type="PackedScene" id=7] +[ext_resource path="res://icons/close.svg" type="Texture" id=8] [node name="MainOverlay" type="Control"] anchor_right = 1.0 @@ -76,22 +77,43 @@ focus_mode = 0 toggle_mode = true icon = ExtResource( 6 ) -[node name="GrabMode" type="Button" parent="MarginContainer/VSplitContainer/MainBar"] +[node name="AddOverlay" type="Button" parent="MarginContainer/VSplitContainer/MainBar"] margin_left = 180.0 margin_right = 356.0 margin_bottom = 191.0 focus_mode = 0 toggle_mode = true -icon = ExtResource( 5 ) +icon = ExtResource( 4 ) -[node name="AddOverlay" type="Button" parent="MarginContainer/VSplitContainer/MainBar"] +[node name="GrabMode" type="Button" parent="MarginContainer/VSplitContainer/MainBar"] margin_left = 360.0 margin_right = 536.0 margin_bottom = 191.0 focus_mode = 0 toggle_mode = true -icon = ExtResource( 4 ) +icon = ExtResource( 5 ) + +[node name="QuitToggle" type="Button" parent="MarginContainer/VSplitContainer/MainBar"] +margin_left = 540.0 +margin_right = 716.0 +margin_bottom = 191.0 +toggle_mode = true +icon = ExtResource( 8 ) + +[node name="Quit" type="Button" parent="MarginContainer/VSplitContainer/MainBar/QuitToggle"] +visible = false +margin_left = -4.0 +margin_top = -199.0 +margin_right = 915.0 +margin_bottom = -8.0 +text = "Really quit?" +icon = ExtResource( 8 ) +__meta__ = { +"_edit_use_anchors_": false +} [connection signal="toggled" from="MarginContainer/VSplitContainer/MainBar/ShowOverlays" to="." method="_on_ShowOverlays_toggled"] -[connection signal="toggled" from="MarginContainer/VSplitContainer/MainBar/GrabMode" to="." method="_on_GrabMode_toggled"] [connection signal="toggled" from="MarginContainer/VSplitContainer/MainBar/AddOverlay" to="." method="_on_AddOverlay_toggled"] +[connection signal="toggled" from="MarginContainer/VSplitContainer/MainBar/GrabMode" to="." method="_on_GrabMode_toggled"] +[connection signal="toggled" from="MarginContainer/VSplitContainer/MainBar/QuitToggle" to="." method="_on_QuitToggle_toggled"] +[connection signal="pressed" from="MarginContainer/VSplitContainer/MainBar/QuitToggle/Quit" to="." method="_on_Quit_pressed"]