Compare commits

...

15 commits
v0.3.1 ... main

49 changed files with 1124 additions and 106 deletions

35
docs/README.md Normal file
View file

@ -0,0 +1,35 @@
# WIP documentation
## Hierarchy
```
OverlayManager
- MyOverlayInstance
- [...]
- OverlayViewport
- Container
- MyOverlay
- [...]
- OverlayInteraction
- VR
- [colliders for vr trackers etc]
- Grabbable
- Clickable
- Touchable
```
## overlay interaction types
Each overlay instance has a OverlayInteraction node, which spawns the different interaction modules depending on what is defined in the OVERLAY_PROPERTIES.
The modules/interaction types are:
- Grabbable
- Touchable
- Clickable
These modules connect signals from different places to the interaction manager (`OverlayInteraction`)
Touchable connects collision signals to mouse inputs (potentially logic between to help prevent double presses)
Clickable connects vr button signals to mouse inputs
Grabbable connects vr button signals to grab logic, while telling the interaction manager to pause normal interaction

View file

@ -1,3 +1,6 @@
[gd_scene format=2]
[node name="Main" type="Node"]
__meta__ = {
"_editor_description_": "Everything is loaded using autoloads so this scene is just a dummy"
}

View file

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/gdvk/gdvk.gdns" type="Script" id=1]
[node name="GDVK" type="Node"]
script = ExtResource( 1 )

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,17 @@
[general]
singleton=false
load_once=true
symbol_prefix="gdvk_"
reloadable=true
[entry]
X11.64="res://addons/gdvk/bin/x11/libgdvk.so"
Windows.64="res://addons/gdvk/bin/win64/libgdvk.dll"
[dependencies]
X11.64=[ ]
Windows.64=[ ]
OSX.64=[ ]

View file

@ -0,0 +1,8 @@
[gd_resource type="NativeScript" load_steps=2 format=2]
[ext_resource path="res://addons/gdvk/gdvk.gdnlib" type="GDNativeLibrary" id=1]
[resource]
resource_name = "gdvk"
class_name = "GDVK"
library = ExtResource( 1 )

View file

@ -0,0 +1,10 @@
tool
extends EditorPlugin
func _enter_tree() -> void:
add_autoload_singleton("GDVK", "res://addons/gdvk/GDVK.tscn")
func _exit_tree() -> void:
remove_autoload_singleton("GDVK")

View file

@ -0,0 +1,9 @@
[plugin]
name="GDVK"
description="Godot virtual keyboard plugin
see https://github.com/CrispyPin/gdvk"
author="CrispyPin"
version="0.1.0"
script="gdvk_plugin.gd"

View file

@ -1,6 +0,0 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/openvr_overlay/interaction/overlay_cursor.gd" type="Script" id=1]
[node name="OverlayCursor" type="Node"]
script = ExtResource( 1 )

View file

@ -1,6 +0,0 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/openvr_overlay/interaction/overlay_grab.gd" type="Script" id=1]
[node name="OverlayGrab" type="Node"]
script = ExtResource( 1 )

View file

@ -22,7 +22,6 @@ script = ExtResource( 1 )
[node name="OverlayViewport" type="Viewport" parent="."]
size = Vector2( 2048, 2048 )
transparent_bg = true
handle_input_locally = false
hdr = false
disable_3d = true
usage = 0

View file

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/openvr_overlay/interaction/mod/clickable.gd" type="Script" id=1]
[node name="Clickable" type="Node"]
script = ExtResource( 1 )

View file

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/openvr_overlay/interaction/mod/grabbable.gd" type="Script" id=1]
[node name="Grabbable" type="Node"]
script = ExtResource( 1 )

View file

@ -0,0 +1,7 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/openvr_overlay/interaction/mod/clickable.gd" type="Script" id=1]
[node name="Touchable" type="Node"]
script = ExtResource( 1 )
is_touch = true

View file

@ -1,5 +1,6 @@
extends Node
export var is_touch := false
onready var viewport: Viewport = get_node("../../OverlayViewport")
onready var _i = get_parent()
@ -23,23 +24,27 @@ var cursor_nodes := {
"left": preload("res://addons/openvr_overlay/interaction/Cursor.tscn").instance(),
}
func _ready() -> void:
viewport.add_child(cursor_nodes.right)
viewport.add_child(cursor_nodes.left)
get_parent().connect("trigger_on", self, "_trigger_on")
get_parent().connect("trigger_off", self, "_trigger_off")
if is_touch:
get_parent().connect("touch_on", self, "_trigger_on")
get_parent().connect("touch_off", self, "_trigger_off")
else:
get_parent().connect("trigger_on", self, "_trigger_on")
get_parent().connect("trigger_off", self, "_trigger_off")
func _process(_delta: float) -> void:
cursor_pos.right= get_canvas_pos("right")
cursor_pos.left= get_canvas_pos("left")
func _process(delta: float) -> void:
cursor_pos.right = get_canvas_pos("right")
cursor_pos.left = get_canvas_pos("left")
_update_cursors()
_send_move_event()
# _send_move_event()
prev_pos = cursor_pos.duplicate(true)
#get canvas position of controller
# get canvas position of controller
func get_canvas_pos(controller) -> Vector2:
var controller_local_pos = _i._overlay_area.global_transform.xform_inv(\
_i.tracker_nodes[controller].translation)
@ -83,6 +88,7 @@ func _send_click_event(state: bool, controller: String):
click_event.pressed = state
click_event.button_index = 1
viewport.input(click_event)
# print("SENT EVENT ", click_event.position, " -- ", click_event.pressed)
func _trigger_on(controller):

View file

@ -42,7 +42,6 @@ onready var tracker_nodes = {
func _ready() -> void:
#add_child(_overlay_area)
_overlay_area = $OverlayArea
_overlay_area.get_node("AreaNear"). connect("area_entered", self, "_on_Near_entered")
_overlay_area.get_node("AreaNear"). connect("area_exited", self, "_on_Near_exited")
@ -52,24 +51,24 @@ func _ready() -> void:
get_parent().connect("width_changed", self, "_update_width")
get_parent().connect("offset_changed", self, "_update_offset")
get_parent().connect("target_changed", self, "_update_target")
get_parent().connect("path_changed", self, "_update_modules")
get_parent().connect("path_changed", self, "_update_target")
OverlayManager.connect("grab_mode_changed", self, "update_selection")
_update_width()
_update_offset()
_update_target()
call_deferred("_update_width")
call_deferred("_update_offset")
call_deferred("_update_target")
func _trigger_on(controller):
if state[controller].near:
state[controller].trigger = true
# print("TRIGGER ON ", controller)
emit_signal("trigger_on", controller)
func _trigger_off(controller):
state[controller].trigger = false
# print("TRIGGER OFF ", controller)
emit_signal("trigger_off", controller)
@ -79,6 +78,7 @@ func _on_Near_entered(body: Node) -> void:
var hand = body.get_groups()[0]
state[hand].near = true
update_selection()
# print("NEAR ON ", hand)
emit_signal("near_on")
@ -88,6 +88,7 @@ func _on_Near_exited(body: Node) -> void:
var hand = body.get_groups()[0]
state[hand].near = false
# print("NEAR OFF ", hand)
update_selection()
emit_signal("near_off")
@ -98,7 +99,8 @@ func _on_Touch_entered(body: Node) -> void:
var hand = body.get_groups()[0]
state[hand].touch = true
update_selection()
emit_signal("touch_on")
# print("TOUCH ON ", hand)
emit_signal("touch_on", hand)
func _on_Touch_exited(body: Node) -> void:
@ -106,9 +108,9 @@ func _on_Touch_exited(body: Node) -> void:
return
var hand = body.get_groups()[0]
state[hand].touch = false
update_selection()
emit_signal("touch_off")
# print("TOUCH OFF ", hand)
emit_signal("touch_off", hand)
func update_selection():
@ -151,28 +153,19 @@ func _update_target():
_overlay_area.get_node("AreaNear").collision_mask += int(t!="left")*16 # detect left hand
func _update_modules():
# this should be handled better, DRY
# grab module
var grab_module_exists: bool = get_node_or_null("OverlayGrab") != null
# called by overlay_instance after properties are loaded and before overlay scene enters the tree
func spawn_modules():
if get_parent().get_property("grabbable"):
var module = preload("res://addons/openvr_overlay/interaction/mod/Grabbable.tscn")
add_child(module.instance())
if get_parent().get_property("has_grab"):
if !grab_module_exists:
var module = preload("res://addons/openvr_overlay/OverlayGrab.tscn")
add_child(module.instance())
elif grab_module_exists:
get_node("OverlayGrab").queue_free()
# cursor module
var cursor_module_exists: bool = get_node_or_null("OverlayCursor") != null
if get_parent().get_property("has_cursor"):
if !cursor_module_exists:
var module = preload("res://addons/openvr_overlay/OverlayCursor.tscn")
add_child(module.instance())
elif cursor_module_exists:
get_node("OverlayCursor").queue_free()
if get_parent().get_property("clickable"):
var module = preload("res://addons/openvr_overlay/interaction/mod/Clickable.tscn")
add_child(module.instance())
if get_parent().get_property("touchable"):
var module = preload("res://addons/openvr_overlay/interaction/mod/Touchable.tscn")
add_child(module.instance())
func _on_RightHand_button_pressed(button: int) -> void:

View file

@ -4,10 +4,9 @@ extends Node
const OVERLAY_PROPERTIES_DEFAULT = {
"allow_delete": true,
"allow_hide": true,
# "interaction": true,
"has_cursor": false,
"has_touch": false,
"has_grab": true,
"clickable": false,
"touchable": false,
"grabbable": true,
}
var ovr_interface: ARVRInterface
@ -21,7 +20,6 @@ var trackers = {
}
func _init() -> void:
# OS.window_minimized = true
ovr_config.set_application_type(2) # Set to OVERLAY MODE
ovr_config.set_tracking_universe(1) # Set to SEATED MODE = 0, STANDING MODE = 1, RAW MODE = 2
@ -32,9 +30,14 @@ func _init() -> void:
func _ready() -> void:
OS.window_size = Vector2(16, 16)
OS.window_position = Vector2(32, 32)
OS.window_minimized = true
ARVRServer.connect("tracker_added", self, "_tracker_added")
ARVRServer.connect("tracker_removed", self, "_tracker_removed")
update_hand_ids()
#Input.set_use_accumulated_input(true)
func _tracker_added(tracker_name: String, type: int, id: int):

View file

@ -1,6 +1,6 @@
extends Spatial
signal path_changed
#signal path_changed
signal overlay_visible_changed
signal width_changed
signal alpha_changed
@ -28,7 +28,7 @@ var current_target: String = "world" setget _set_current_target
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 path := "res://special_overlays/MainOverlay.tscn" setget set_path
var path : String = "res://special_overlays/MainOverlay.tscn"# setget set_path
var path_invalid := false
var OVERLAY_PROPERTIES: Dictionary # defined in overlay root script (optional)
@ -37,6 +37,8 @@ var overlay_scene: Node
func _ready() -> void:
container = $OverlayViewport/Container
load_overlay()
current_target = target
ARVRServer.connect("tracker_added", self, "_tracker_changed")
@ -48,6 +50,24 @@ func _ready() -> void:
update_tracker_id()
call_deferred("update_offset")
func load_overlay() -> void:
path_invalid = false
var packed_overlay = load(path)
if not packed_overlay:
path_invalid = true
overlay_scene = load("res://special_overlays/UnknownType.tscn").instance()
else:
overlay_scene = packed_overlay.instance()
if overlay_scene.get("OVERLAY_PROPERTIES") != null:
OVERLAY_PROPERTIES = overlay_scene.OVERLAY_PROPERTIES
$OverlayInteraction.spawn_modules()
if container.get_child_count() > 0:
container.get_child(0).queue_free()
container.add_child(overlay_scene)
func update_tracker_id():
_tracker_id = -1
@ -61,7 +81,7 @@ func update_tracker_id():
if _tracker_id == -1:
# could not find controller, fallback
print("Missing controller ", current_target, " ", target, " ", fallback, " - ", name)
# print("Missing controller ", current_target, " ", target, " ", fallback, " - ", name)
_tracker_id = 63 # highest tracker id (unused, at origin)
@ -129,26 +149,6 @@ func set_width_in_meters(width: float) -> void:
emit_signal("width_changed")
func set_path(new: String) -> void:
path = new
path_invalid = false
var packed_overlay = load(path)
if not packed_overlay:
path_invalid = true
overlay_scene = load("res://special_overlays/UnknownType.tscn").instance()
else:
overlay_scene = packed_overlay.instance()
if overlay_scene.get("OVERLAY_PROPERTIES") != null:
OVERLAY_PROPERTIES = overlay_scene.OVERLAY_PROPERTIES
emit_signal("path_changed")
if container.get_child_count() > 0:
container.get_child(0).queue_free()
container.add_child(overlay_scene)
func set_alpha(val: float):
alpha = val
$VROverlayViewport/TextureRect.modulate.a = val
@ -168,8 +168,8 @@ func _notification(what: int) -> void:
emit_signal("offset_changed")
func get_property(name: String):
if OVERLAY_PROPERTIES.has(name):
return OVERLAY_PROPERTIES[name]
func get_property(p_name: String):
if OVERLAY_PROPERTIES.has(p_name):
return OVERLAY_PROPERTIES[p_name]
return OverlayInit.OVERLAY_PROPERTIES_DEFAULT[name]
return OverlayInit.OVERLAY_PROPERTIES_DEFAULT[p_name]

View file

@ -5,7 +5,7 @@ platform="Linux/X11"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
include_filter="*.json"
exclude_filter=""
export_path="../builds/linux/ovr-utils.x86_64"
script_export_mode=1

View file

@ -29,6 +29,7 @@ func add_overlay(name):
print("Adding overlay '", name, "'")
var instance = preload("res://addons/openvr_overlay/OverlayInstance.tscn").instance()
instance.name = name
instance.path = Settings.s.overlays[name].path
instance.add_child(preload("res://OverlaySettingsSync.tscn").instance())
add_child(instance)
emit_signal("added_overlay", name)

View file

@ -1,7 +1,7 @@
extends Control
const OVERLAY_PROPERTIES = {
"has_cursor": true,
"clickable": true,
}

View file

@ -0,0 +1,23 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://overlay_resources/keyboard/keyboard.theme" type="Theme" id=1]
[node name="Btn" type="Button"]
margin_top = 993.0
margin_right = 78.0
margin_bottom = 1054.0
rect_min_size = Vector2( 100, 100 )
rect_pivot_offset = Vector2( 50, 50 )
theme = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
text = "Key"
align = 1
__meta__ = {
"_edit_use_anchors_": false
}

View file

@ -0,0 +1,9 @@
[gd_scene format=2]
[node name="KeyRow" type="HBoxContainer"]
margin_right = 230.0
margin_bottom = 128.0
custom_constants/separation = 0
__meta__ = {
"_edit_use_anchors_": false
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,90 @@
extends Control
const OVERLAY_PROPERTIES = {
"touchable": true,
}
export var key_size := 100
export var key_row : PackedScene
export var key_button : PackedScene
export var row_container_path : NodePath
var row_container
var keymap := {}
var toggle_keys := []
func _ready():
row_container = get_node(row_container_path)
load_keys("res://overlay_resources/keyboard/layouts/layout_se.json")
func load_keys(fp: String):
var file = File.new()
file.open(fp, File.READ)
keymap = parse_json(file.get_as_text())
file.close()
apply_keys()
func apply_keys():
for row in keymap.rows:
var row_box = key_row.instance()
row_container.add_child(row_box)
for key in row.keys:
var btn = key_button.instance()
if not key.has("display"):
key.display = key.keycode
btn.get_node("Label").text = key.display
btn.name = key.keycode
btn.rect_min_size.x = key_size
btn.rect_min_size.y = key_size
if key.has("width"):
btn.rect_min_size.x *= key.width
if key.has("toggle") and key.toggle:
btn.toggle_mode = true
btn.connect("toggled", self, "key_toggled", [key.keycode])
toggle_keys.append(btn)
else:
btn.connect("button_down", self, "key_down", [key.keycode])
btn.connect("button_up", self, "key_up", [key.keycode])
row_box.add_child(btn)
# horizontal gaps
if key.has("gap"):
var gapbox = Control.new()
gapbox.rect_min_size.x = key.gap * key_size
gapbox.name = "Gap"
row_box.add_child(gapbox)
# vertical gaps
if row.has("gap") and row.gap > 0:
var gapbox = Control.new()
gapbox.rect_min_size.y = row.gap * key_size
gapbox.name = "Gap"
row_container.add_child(gapbox)
func key_toggled(state, code):
if state:
GDVK.key_down(code)
else:
GDVK.key_up(code)
func key_down(code):
GDVK.key_down(code)
func key_up(code):
GDVK.key_up(code)
# clear all modifier keys
for k in toggle_keys:
if k.pressed:
k.pressed = false

View file

@ -0,0 +1,372 @@
{
"rows": [
{
"gap": 0.5,
"keys": [
{
"keycode": "ESCAPE",
"display": "Esc",
"gap": 1
},
{
"keycode": "F1",
"display": "F1"
},
{
"keycode": "F2",
"display": "F2"
},
{
"keycode": "F3",
"display": "F3"
},
{
"keycode": "F4",
"display": "F4",
"gap": 0.5
},
{
"keycode": "F5",
"display": "F5"
},
{
"keycode": "F6",
"display": "F6"
},
{
"keycode": "F7",
"display": "F7"
},
{
"keycode": "F8",
"display": "F8",
"gap": 0.5
},
{
"keycode": "F9",
"display": "F9"
},
{
"keycode": "F10",
"display": "F10"
},
{
"keycode": "F11",
"display": "F11"
},
{
"keycode": "F12",
"display": "F12",
"gap": 0.5
},
{
"keycode": "PRINT",
"display": "Print\nScrn"
}
]
},
{
"keys": [
{
"keycode": "SECTION",
"display": "§"
},
{
"keycode": "1"
},
{
"keycode": "2"
},
{
"keycode": "3"
},
{
"keycode": "4"
},
{
"keycode": "5"
},
{
"keycode": "6"
},
{
"keycode": "7"
},
{
"keycode": "8"
},
{
"keycode": "9"
},
{
"keycode": "0"
},
{
"keycode": "PLUS",
"display": "+"
},
{
"keycode": "GRAVE",
"display": "`"
},
{
"keycode": "BACKSPACE",
"display": "Backspace",
"width": 2,
"gap": 0.5
},
{
"keycode": "INSERT",
"display": "Ins"
},
{
"keycode": "HOME",
"display": "Home"
},
{
"keycode": "PAGE_UP",
"display": "Page\nUp"
}
]
},
{
"keys": [
{
"keycode": "TAB",
"display": "->",
"width": 1.5
},
{
"keycode": "Q"
},
{
"keycode": "W"
},
{
"keycode": "E"
},
{
"keycode": "R"
},
{
"keycode": "T"
},
{
"keycode": "Y"
},
{
"keycode": "U"
},
{
"keycode": "I"
},
{
"keycode": "O"
},
{
"keycode": "P"
},
{
"keycode": "ARING",
"display": "Å"
},
{
"keycode": "DIAERSIS",
"display": "^\n¨ ~"
},
{
"keycode": "ENTER",
"display": "Enter",
"width": 1.5,
"gap": 0.5
},
{
"keycode": "DELETE",
"display": "Del"
},
{
"keycode": "END",
"display": "End"
},
{
"keycode": "PAGE_DOWN",
"display": "Page\nDown"
}
]
},
{
"keys": [
{
"keycode": "CAPSLOCK",
"display": "CAPS",
"width": 1.75
},
{
"keycode": "A"
},
{
"keycode": "S"
},
{
"keycode": "D"
},
{
"keycode": "F"
},
{
"keycode": "G"
},
{
"keycode": "H"
},
{
"keycode": "J"
},
{
"keycode": "K"
},
{
"keycode": "L"
},
{
"keycode": "ODIAERSIS",
"display": "Ö"
},
{
"keycode": "ADIAERSIS",
"display": "Ä"
},
{
"keycode": "APOSTROPHE",
"display": "*\n'"
},
{
"keycode": "ENTER",
"display": "Enter",
"width": 1.25
}
]
},
{
"keys": [
{
"keycode": "SHIFT_L",
"display": "Shift",
"toggle": true,
"width": 1.25
},
{
"keycode": "LESS",
"display": "> \n< |"
},
{
"keycode": "Z"
},
{
"keycode": "X"
},
{
"keycode": "C"
},
{
"keycode": "V"
},
{
"keycode": "B"
},
{
"keycode": "N"
},
{
"keycode": "M"
},
{
"keycode": "COMMA",
"display": ";\n,"
},
{
"keycode": "PERIOD",
"display": ":\n."
},
{
"keycode": "MINUS",
"display": "_\n-"
},
{
"keycode": "SHIFT_R",
"display": "Shift",
"toggle": true,
"width": 2.75,
"gap": 1.5
},
{
"keycode": "UP",
"display": "^"
}
]
},
{
"keys": [
{
"keycode": "CONTROL_L",
"display": "Ctrl",
"toggle": true,
"width": 1.5
},
{
"keycode": "SUPER",
"display": "Sup",
"toggle": true,
"width": 1.25
},
{
"keycode": "ALT",
"display": "Alt",
"toggle": true,
"width": 1.25
},
{
"keycode": "SPACE",
"display": "",
"width": 5.75
},
{
"keycode": "ALT_GR",
"display": "Alt Gr",
"toggle": true,
"width": 1.25
},
{
"keycode": "SUPER",
"display": "Sup",
"toggle": true,
"width": 1.25
},
{
"keycode": "MENU",
"display": "Menu",
"width": 1.25
},
{
"keycode": "CONTROL_R",
"display": "Ctrl",
"toggle": true,
"width": 1.5,
"gap": 0.5
},
{
"keycode": "LEFT",
"display": "\n<"
},
{
"keycode": "DOWN",
"display": "\nv"
},
{
"keycode": "RIGHT",
"display": "\n>"
}
]
}
]
}

View file

@ -0,0 +1,315 @@
{
"rows": [
{
"gap": 0.5,
"keys": [
{
"keycode": "ESCAPE",
"display": "Esc",
"gap": 1
},
{
"keycode": "F1",
"display": "F1"
},
{
"keycode": "F2",
"display": "F2"
},
{
"keycode": "F3",
"display": "F3"
},
{
"keycode": "F4",
"display": "F4",
"gap": 0.5
},
{
"keycode": "F5",
"display": "F5"
},
{
"keycode": "F6",
"display": "F6"
},
{
"keycode": "F7",
"display": "F7"
},
{
"keycode": "F8",
"display": "F8",
"gap": 0.5
},
{
"keycode": "F9",
"display": "F9"
},
{
"keycode": "F10",
"display": "F10"
},
{
"keycode": "F11",
"display": "F11"
},
{
"keycode": "F12",
"display": "F12"
}
]
},
{
"keys": [
{
"keycode": "ASCIITILDE",
"display": "~ `"
},
{
"keycode": "1"
},
{
"keycode": "2"
},
{
"keycode": "3"
},
{
"keycode": "4"
},
{
"keycode": "5"
},
{
"keycode": "6"
},
{
"keycode": "7"
},
{
"keycode": "8"
},
{
"keycode": "9"
},
{
"keycode": "0"
},
{
"keycode": "MINUS",
"display": "-"
},
{
"keycode": "EQUAL",
"display": "="
},
{
"keycode": "BACKSPACE",
"display": "<-",
"width": 2
}
]
},
{
"keys": [
{
"keycode": "TAB",
"display": "->",
"width": 1.5
},
{
"keycode": "Q"
},
{
"keycode": "W"
},
{
"keycode": "E"
},
{
"keycode": "R"
},
{
"keycode": "T"
},
{
"keycode": "Y"
},
{
"keycode": "U"
},
{
"keycode": "I"
},
{
"keycode": "O"
},
{
"keycode": "P"
},
{
"keycode": "BRACKETLEFT",
"display": "["
},
{
"keycode": "BRACKETRIGHT",
"display": "]"
},
{
"keycode": "BACKSLASH",
"display": "\\",
"width": 1.5
}
]
},
{
"keys": [
{
"keycode": "CAPSLOCK",
"display": "CAPS",
"width": 1.75
},
{
"keycode": "A"
},
{
"keycode": "S"
},
{
"keycode": "D"
},
{
"keycode": "F"
},
{
"keycode": "G"
},
{
"keycode": "H"
},
{
"keycode": "J"
},
{
"keycode": "K"
},
{
"keycode": "L"
},
{
"keycode": "SEMICOLON",
"display": ";"
},
{
"keycode": "QUOTELEFT",
"display": "`"
},
{
"keycode": "ENTER",
"display": "Enter",
"width": 2.25
}
]
},
{
"keys": [
{
"keycode": "SHIFT",
"display": "^",
"toggle": true,
"width": 2.25
},
{
"keycode": "Z"
},
{
"keycode": "X"
},
{
"keycode": "C"
},
{
"keycode": "V"
},
{
"keycode": "B"
},
{
"keycode": "N"
},
{
"keycode": "M"
},
{
"keycode": "COMMA",
"display": "<\n ,"
},
{
"keycode": "PERIOD",
"display": ">\n ."
},
{
"keycode": "SLASH",
"display": "?\n /"
},
{
"keycode": "SHIFT",
"display": "Shift",
"toggle": true,
"width": 2.75
}
]
},
{
"keys": [
{
"keycode": "CONTROL",
"display": "Ctrl",
"toggle": true,
"width": 1.5
},
{
"keycode": "SUPER",
"display": "Sup",
"toggle": true,
"width": 1.25
},
{
"keycode": "ALT",
"display": "Alt",
"toggle": true,
"width": 1.25
},
{
"keycode": "SPACE",
"display": "",
"width": 5.75
},
{
"keycode": "ALT",
"display": "Alt",
"toggle": true,
"width": 1.25
},
{
"keycode": "SUPER",
"display": "Sup",
"toggle": true,
"width": 1.25
},
{
"keycode": "MENU",
"display": "Menu",
"width": 1.5
},
{
"keycode": "CONTROL",
"display": "Ctrl",
"toggle": true,
"width": 1.5
}
]
}
]
}

View file

@ -3,8 +3,7 @@ extends Control
const OVERLAY_PROPERTIES = {
"allow_hide": false,
"allow_delete": false,
"has_cursor": true,
"has_grab": true,
"clickable": true,
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/stick.png-328b0dfe10d1d71101c4612bcd737746.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://overlay_resources/touch_stick/stick.png"
dest_files=[ "res://.import/stick.png-328b0dfe10d1d71101c4612bcd737746.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View file

@ -1,8 +1,8 @@
extends Control
const OVERLAY_PROPERTIES = {
"has_cursor": true,
"has_touch": true,
"clickable": true,
"touchable": true,
}
var grabber
@ -12,7 +12,7 @@ var oinst
func _ready() -> void:
oinst = get_viewport().get_parent()
clicker = get_viewport().get_node("../OverlayInteraction/OverlayCursor")
clicker = get_viewport().get_node("../OverlayInteraction/OverlayTouchCursor")
grabber = get_viewport().get_node("../OverlayInteraction/OverlayGrab")
for t in oinst.TARGETS:
$OptionButton.add_item(t)

View file

@ -10,7 +10,6 @@ var _needs_sync := true
func _ready() -> void:
p = get_parent()
call_deferred("load_all")
p.connect("path_changed", self, "_prop_changed")
p.connect("overlay_visible_changed", self, "_prop_changed")
p.connect("width_changed", self, "_prop_changed")
p.connect("alpha_changed", self, "_prop_changed")
@ -46,8 +45,8 @@ func load_all() -> void:
if Settings.s.overlays.has(p.name):
var new = Settings.s.overlays[p.name]
if new.has("path"):
p.path = new.path
#if new.has("path"):
# p.path = new.path
if new.has("visible"):
p.overlay_visible = new.visible
if new.has("width"):

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://overlay_scripts/battery.gd" type="Script" id=1]
[ext_resource path="res://overlay_resources/battery.gd" type="Script" id=1]
[ext_resource path="res://fonts/OpenSans-Regular.ttf" type="DynamicFontData" id=2]
[sub_resource type="StyleBoxEmpty" id=4]

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://overlay_scripts/time.gd" type="Script" id=1]
[ext_resource path="res://overlay_resources/time.gd" type="Script" id=1]
[ext_resource path="res://fonts/OpenSans-Regular.ttf" type="DynamicFontData" id=2]
[sub_resource type="StyleBoxFlat" id=1]

View file

@ -2,7 +2,7 @@
[ext_resource path="res://styles/menu.theme" type="Theme" id=1]
[ext_resource path="res://styles/file_menu.theme" type="Theme" id=2]
[ext_resource path="res://overlay_scripts/image_viewer.gd" type="Script" id=3]
[ext_resource path="res://overlay_resources/image_viewer.gd" type="Script" id=3]
[node name="ImageViewer" type="Control"]
anchor_right = 1.0

View file

@ -0,0 +1,55 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://overlay_resources/keyboard/keyboard.theme" type="Theme" id=1]
[ext_resource path="res://overlay_resources/keyboard/keyboard_overlay.gd" type="Script" id=2]
[ext_resource path="res://overlay_resources/keyboard/KeyRow.tscn" type="PackedScene" id=3]
[ext_resource path="res://overlay_resources/keyboard/KeyBtn.tscn" type="PackedScene" id=4]
[node name="Overlay" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
theme = ExtResource( 1 )
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
key_row = ExtResource( 3 )
key_button = ExtResource( 4 )
row_container_path = NodePath("CenterContainer/PanelContainer/RowContainer")
[node name="CenterContainer" type="CenterContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 8.0
margin_top = 8.0
margin_right = 8.0
margin_bottom = 8.0
size_flags_horizontal = 0
size_flags_vertical = 0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="PanelContainer" type="PanelContainer" parent="CenterContainer"]
margin_left = 1016.0
margin_top = 1016.0
margin_right = 1032.0
margin_bottom = 1032.0
size_flags_horizontal = 0
size_flags_vertical = 0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="RowContainer" type="VBoxContainer" parent="CenterContainer/PanelContainer"]
margin_left = 8.0
margin_top = 8.0
margin_right = 8.0
margin_bottom = 8.0
size_flags_horizontal = 0
size_flags_vertical = 0
custom_constants/separation = 0
alignment = 1
__meta__ = {
"_edit_use_anchors_": false
}

View file

@ -0,0 +1,20 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://overlay_resources/touch_stick/stick.png" type="Texture" id=1]
[node name="stick" type="TextureRect"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -128.0
margin_top = -128.0
margin_right = -30.0
margin_bottom = 128.0
mouse_filter = 2
texture = ExtResource( 1 )
expand = true
stretch_mode = 5
__meta__ = {
"_edit_use_anchors_": false
}

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=10 format=2]
[ext_resource path="res://overlay_scripts/ui_demo.gd" type="Script" id=1]
[ext_resource path="res://overlay_resources/ui_demo.gd" type="Script" id=1]
[ext_resource path="res://fonts/OpenSans-Regular.ttf" type="DynamicFontData" id=2]
[ext_resource path="res://fonts/OpenSans-Bold.ttf" type="DynamicFontData" id=3]
[ext_resource path="res://styles/menu.theme" type="Theme" id=4]
@ -12,6 +12,10 @@ font_data = ExtResource( 2 )
[sub_resource type="Theme" id=2]
default_font = SubResource( 1 )
[sub_resource type="DynamicFont" id=5]
size = 64
font_data = ExtResource( 3 )
[sub_resource type="StyleBoxFlat" id=3]
bg_color = Color( 0.419608, 0.419608, 0.419608, 1 )
border_width_left = 16
@ -23,10 +27,6 @@ corner_detail = 1
[sub_resource type="StyleBoxFlat" id=4]
[sub_resource type="DynamicFont" id=5]
size = 64
font_data = ExtResource( 3 )
[node name="Control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
@ -57,10 +57,10 @@ __meta__ = {
margin_left = 335.0
margin_right = 650.0
margin_bottom = 143.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_fonts/font = SubResource( 5 )
custom_styles/pressed = SubResource( 3 )
custom_styles/normal = SubResource( 4 )
custom_fonts/font = SubResource( 5 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Drag"
__meta__ = {
"_edit_use_anchors_": false
@ -86,6 +86,9 @@ margin_top = 242.452
margin_right = 1051.0
margin_bottom = 433.452
text = "aaaaa"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Button4" type="Button" parent="."]
margin_left = 650.0

View file

@ -22,9 +22,11 @@ Settings="*res://addons/settings-manager/Settings.tscn"
OverlayInit="*res://addons/openvr_overlay/overlay_init.gd"
OverlayInteractionRoot="*res://addons/openvr_overlay/OverlayInteractionRoot.tscn"
OverlayManager="*res://OverlayManager.tscn"
GDVK="*res://addons/gdvk/GDVK.tscn"
[debug]
gdscript/warnings/unused_signal=false
gdscript/warnings/return_value_discarded=false
[display]
@ -34,7 +36,7 @@ window/size/height=2048
[editor_plugins]
enabled=PoolStringArray( "res://addons/godot-openvr/plugin.cfg", "res://addons/openvr_overlay/plugin.cfg", "res://addons/ovr_utils/plugin.cfg", "res://addons/settings-manager/plugin.cfg" )
enabled=PoolStringArray( "res://addons/gdvk/plugin.cfg", "res://addons/godot-openvr/plugin.cfg", "res://addons/openvr_overlay/plugin.cfg", "res://addons/ovr_utils/plugin.cfg", "res://addons/settings-manager/plugin.cfg" )
[gdnative]

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=9 format=2]
[ext_resource path="res://overlay_scripts/main_menu.gd" type="Script" id=1]
[ext_resource path="res://overlay_resources/main_menu.gd" type="Script" id=1]
[ext_resource path="res://icons/move.svg" type="Texture" id=2]
[ext_resource path="res://icons/list.svg" type="Texture" id=3]
[ext_resource path="res://icons/close.svg" type="Texture" id=4]

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://styles/menu.theme" type="Theme" id=1]
[ext_resource path="res://overlay_scripts/unknown_type.gd" type="Script" id=2]
[ext_resource path="res://overlay_resources/unknown_type.gd" type="Script" id=2]
[node name="UnknownType" type="Control"]
anchor_right = 1.0

View file

@ -14,7 +14,6 @@ func _ready() -> void:
$BasicOptions/Label.text = overlay_name
name = overlay_name
overlay.connect("overlay_visible_changed", self, "_overlay_visible_changed")
overlay.connect("path_changed", self, "_update_warning")
func _apply_loaded():