diff --git a/assets/materials/interface.tres b/assets/materials/interface.tres index 3af2e71..34ab9af 100644 --- a/assets/materials/interface.tres +++ b/assets/materials/interface.tres @@ -1,3 +1,4 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:55d5f30db336a8f8f7633743c23e41077d5c1a1b900c475a6d3811746eba3d1b -size 141 +[gd_resource type="StandardMaterial3D" format=3 uid="uid://bertj8bp8b5l1"] + +[resource] +albedo_color = Color(0.286275, 0.309804, 0.439216, 1) diff --git a/src/entities/light.gd b/content/entities/light/light.gd similarity index 100% rename from src/entities/light.gd rename to content/entities/light/light.gd diff --git a/scenes/entities/light.tscn b/content/entities/light/light.tscn similarity index 91% rename from scenes/entities/light.tscn rename to content/entities/light/light.tscn index 37de134..c8ee172 100644 --- a/scenes/entities/light.tscn +++ b/content/entities/light/light.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=6 format=3 uid="uid://cw86rc42dv2d8"] -[ext_resource type="Script" path="res://src/entities/light.gd" id="1_ykxy3"] +[ext_resource type="Script" path="res://content/entities/light/light.gd" id="1_ykxy3"] [ext_resource type="Texture2D" uid="uid://b72vsbcvqqxg7" path="res://assets/materials/swich_on.png" id="2_6gn2e"] [ext_resource type="Texture2D" uid="uid://cvc0o6dsktnvl" path="res://assets/materials/switch_off.png" id="3_qlm62"] diff --git a/src/entities/sensor.gd b/content/entities/sensor/sensor.gd similarity index 100% rename from src/entities/sensor.gd rename to content/entities/sensor/sensor.gd diff --git a/scenes/entities/sensor.tscn b/content/entities/sensor/sensor.tscn similarity index 81% rename from scenes/entities/sensor.tscn rename to content/entities/sensor/sensor.tscn index 1efb530..0cf6030 100644 --- a/scenes/entities/sensor.tscn +++ b/content/entities/sensor/sensor.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://xsiy71rsqulj"] -[ext_resource type="Script" path="res://src/entities/sensor.gd" id="1_57ac8"] +[ext_resource type="Script" path="res://content/entities/sensor/sensor.gd" id="1_57ac8"] [sub_resource type="SphereShape3D" id="SphereShape3D_r20gc"] radius = 0.1 diff --git a/src/entities/switch.gd b/content/entities/switch/switch.gd similarity index 100% rename from src/entities/switch.gd rename to content/entities/switch/switch.gd diff --git a/scenes/entities/switch.tscn b/content/entities/switch/switch.tscn similarity index 91% rename from scenes/entities/switch.tscn rename to content/entities/switch/switch.tscn index d99fce8..4babc8f 100644 --- a/scenes/entities/switch.tscn +++ b/content/entities/switch/switch.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=6 format=3 uid="uid://cscl5k7lhopj5"] -[ext_resource type="Script" path="res://src/entities/switch.gd" id="1_8ffhi"] +[ext_resource type="Script" path="res://content/entities/switch/switch.gd" id="1_8ffhi"] [ext_resource type="Texture2D" uid="uid://b72vsbcvqqxg7" path="res://assets/materials/swich_on.png" id="1_w68gw"] [ext_resource type="Texture2D" uid="uid://cvc0o6dsktnvl" path="res://assets/materials/switch_off.png" id="2_86ba1"] diff --git a/main.gd b/content/main.gd similarity index 100% rename from main.gd rename to content/main.gd diff --git a/main.tscn b/content/main.tscn similarity index 91% rename from main.tscn rename to content/main.tscn index e90b1f1..2979f54 100644 --- a/main.tscn +++ b/content/main.tscn @@ -1,13 +1,13 @@ [gd_scene load_steps=13 format=3 uid="uid://eecv28y6jxk4"] [ext_resource type="PackedScene" uid="uid://clc5dre31iskm" path="res://addons/godot-xr-tools/xr/start_xr.tscn" id="1_i4c04"] -[ext_resource type="Script" path="res://src/raycast.gd" id="1_tsqxc"] -[ext_resource type="Script" path="res://main.gd" id="1_uvrd4"] -[ext_resource type="Script" path="res://src/model.gd" id="2_7f1x4"] -[ext_resource type="PackedScene" uid="uid://c3kdssrmv84kv" path="res://scenes/menu.tscn" id="3_1tbp3"] +[ext_resource type="Script" path="res://content/raycast.gd" id="1_tsqxc"] +[ext_resource type="Script" path="res://content/main.gd" id="1_uvrd4"] +[ext_resource type="Script" path="res://content/model.gd" id="2_7f1x4"] +[ext_resource type="PackedScene" uid="uid://c3kdssrmv84kv" path="res://content/ui/menu/menu.tscn" id="3_1tbp3"] [ext_resource type="PackedScene" uid="uid://ctltchlf2j2r4" path="res://addons/xr-simulator/XRSimulator.tscn" id="5_3qc8g"] [ext_resource type="Material" uid="uid://bf5ina366dwm6" path="res://assets/materials/sky.material" id="5_wgwf8"] -[ext_resource type="PackedScene" uid="uid://cscl5k7lhopj5" path="res://scenes/entities/switch.tscn" id="8_uxmrb"] +[ext_resource type="PackedScene" uid="uid://cscl5k7lhopj5" path="res://content/entities/switch/switch.tscn" id="8_uxmrb"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_m58yb"] ao_enabled = true diff --git a/src/model.gd b/content/model.gd similarity index 100% rename from src/model.gd rename to content/model.gd diff --git a/src/raycast.gd b/content/raycast.gd similarity index 100% rename from src/raycast.gd rename to content/raycast.gd diff --git a/src/ui/device.gd b/content/ui/device/device.gd similarity index 100% rename from src/ui/device.gd rename to content/ui/device/device.gd diff --git a/scenes/device.tscn b/content/ui/device/device.tscn similarity index 89% rename from scenes/device.tscn rename to content/ui/device/device.tscn index c3e4958..3c8ea3a 100644 --- a/scenes/device.tscn +++ b/content/ui/device/device.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=3 uid="uid://dbe8slnyhro2n"] -[ext_resource type="Script" path="res://src/ui/device.gd" id="1_rbo86"] +[ext_resource type="Script" path="res://content/ui/device/device.gd" id="1_rbo86"] [sub_resource type="BoxMesh" id="BoxMesh_aa3i4"] size = Vector3(0.05, 0.01, 0.05) diff --git a/src/ui/entity.gd b/content/ui/entity/entity.gd similarity index 100% rename from src/ui/entity.gd rename to content/ui/entity/entity.gd diff --git a/scenes/entity.tscn b/content/ui/entity/entity.tscn similarity index 89% rename from scenes/entity.tscn rename to content/ui/entity/entity.tscn index e22a66b..a80a77d 100644 --- a/scenes/entity.tscn +++ b/content/ui/entity/entity.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=3 uid="uid://xo0o5nrfjl23"] -[ext_resource type="Script" path="res://src/ui/entity.gd" id="1_825oj"] +[ext_resource type="Script" path="res://content/ui/entity/entity.gd" id="1_825oj"] [sub_resource type="BoxMesh" id="BoxMesh_aa3i4"] size = Vector3(0.05, 0.01, 0.05) diff --git a/src/menu.gd b/content/ui/menu/menu.gd similarity index 87% rename from src/menu.gd rename to content/ui/menu/menu.gd index 5944239..aef98b7 100644 --- a/src/menu.gd +++ b/content/ui/menu/menu.gd @@ -1,10 +1,10 @@ extends Node3D -const Device = preload("res://scenes/device.tscn") -const Entity = preload("res://scenes/entity.tscn") -const Switch = preload("res://scenes/entities/switch.tscn") -const Light = preload("res://scenes/entities/light.tscn") -const Sensor = preload("res://scenes/entities/sensor.tscn") +const Device = preload("res://content/ui/device/device.tscn") +const Entity = preload("res://content/ui/entity/entity.tscn") +const Switch = preload("res://content/entities/switch/switch.tscn") +const Light = preload("res://content/entities/light/light.tscn") +const Sensor = preload("res://content/entities/sensor/sensor.tscn") @onready var devices_node = $Devices var devices diff --git a/scenes/menu.tscn b/content/ui/menu/menu.tscn similarity index 87% rename from scenes/menu.tscn rename to content/ui/menu/menu.tscn index 374f8fe..928c938 100644 --- a/scenes/menu.tscn +++ b/content/ui/menu/menu.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=3 uid="uid://c3kdssrmv84kv"] -[ext_resource type="Script" path="res://src/menu.gd" id="1_ng4u3"] +[ext_resource type="Script" path="res://content/ui/menu/menu.gd" id="1_ng4u3"] [ext_resource type="Material" uid="uid://bertj8bp8b5l1" path="res://assets/materials/interface.tres" id="2_nsukb"] [sub_resource type="PlaneMesh" id="PlaneMesh_6t3dn"] diff --git a/src/globals/home_adapters.gd b/lib/globals/home_adapters.gd similarity index 76% rename from src/globals/home_adapters.gd rename to lib/globals/home_adapters.gd index 11a4922..100a140 100644 --- a/src/globals/home_adapters.gd +++ b/lib/globals/home_adapters.gd @@ -1,6 +1,6 @@ extends Node -var Adapter = preload("res://src/home_adapters/adapter.gd") +var Adapter = preload("res://lib/home_adapters/adapter.gd") var adapter = Adapter.new(Adapter.ADAPTER_TYPES.HASS) var adapter_ws = Adapter.new(Adapter.ADAPTER_TYPES.HASS_WS) diff --git a/src/globals/request.gd b/lib/globals/request.gd similarity index 100% rename from src/globals/request.gd rename to lib/globals/request.gd diff --git a/src/home_adapters/adapter.gd b/lib/home_adapters/adapter.gd similarity index 86% rename from src/home_adapters/adapter.gd rename to lib/home_adapters/adapter.gd index e6de48a..acbe8df 100644 --- a/src/home_adapters/adapter.gd +++ b/lib/home_adapters/adapter.gd @@ -1,7 +1,7 @@ extends Node -const hass = preload("res://src/home_adapters/hass/hass.gd") -const hass_ws = preload("res://src/home_adapters/hass_ws/hass.gd") +const hass = preload("res://lib/home_adapters/hass/hass.gd") +const hass_ws = preload("res://lib/home_adapters/hass_ws/hass.gd") enum ADAPTER_TYPES { HASS, diff --git a/src/home_adapters/hass/hass.gd b/lib/home_adapters/hass/hass.gd similarity index 97% rename from src/home_adapters/hass/hass.gd rename to lib/home_adapters/hass/hass.gd index da4f49e..ca96a8a 100644 --- a/src/home_adapters/hass/hass.gd +++ b/lib/home_adapters/hass/hass.gd @@ -4,7 +4,7 @@ var url: String = "http://192.168.33.33:8123" var token: String = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIzZjQ0ZGM2N2Y3YzY0MDc1OGZlMWI2ZjJlNmIxZjRkNSIsImlhdCI6MTY5ODAxMDcyOCwiZXhwIjoyMDEzMzcwNzI4fQ.K6ydLUC-4Q7BNIRCU1nWlI2s6sg9UCiOu-Lpedw2zJc" var headers: PackedStringArray = PackedStringArray([]) -var devices_template = FileAccess.get_file_as_string("res://src/home_adapters/hass/templates/devices.j2") +var devices_template = FileAccess.get_file_as_string("res://lib/home_adapters/hass/templates/devices.j2") func _init(url := self.url, token := self.token): self.url = url diff --git a/src/home_adapters/hass/templates/devices.j2 b/lib/home_adapters/hass/templates/devices.j2 similarity index 100% rename from src/home_adapters/hass/templates/devices.j2 rename to lib/home_adapters/hass/templates/devices.j2 diff --git a/src/home_adapters/hass_ws/callback_map.gd b/lib/home_adapters/hass_ws/callback_map.gd similarity index 100% rename from src/home_adapters/hass_ws/callback_map.gd rename to lib/home_adapters/hass_ws/callback_map.gd diff --git a/src/home_adapters/hass_ws/hass.gd b/lib/home_adapters/hass_ws/hass.gd similarity index 98% rename from src/home_adapters/hass_ws/hass.gd rename to lib/home_adapters/hass_ws/hass.gd index e742fe9..d176ccc 100644 --- a/src/home_adapters/hass_ws/hass.gd +++ b/lib/home_adapters/hass_ws/hass.gd @@ -1,6 +1,6 @@ extends Node -var devices_template := FileAccess.get_file_as_string("res://src/home_adapters/hass/templates/devices.j2") +var devices_template := FileAccess.get_file_as_string("res://lib/home_adapters/hass/templates/devices.j2") var socket := WebSocketPeer.new() # in seconds var request_timeout := 10.0 diff --git a/src/home_adapters/hass_ws/templates/devices.j2 b/lib/home_adapters/hass_ws/templates/devices.j2 similarity index 100% rename from src/home_adapters/hass_ws/templates/devices.j2 rename to lib/home_adapters/hass_ws/templates/devices.j2 diff --git a/project.godot b/project.godot index b59c9a1..79aa4f7 100644 --- a/project.godot +++ b/project.godot @@ -11,15 +11,15 @@ config_version=5 [application] config/name="ImmersiveHome" -run/main_scene="res://main.tscn" +run/main_scene="res://content/main.tscn" config/features=PackedStringArray("4.1", "Mobile") config/icon="res://assets/logo.png" [autoload] XRToolsUserSettings="*res://addons/godot-xr-tools/user_settings/user_settings.gd" -Request="*res://src/globals/request.gd" -HomeAdapters="*res://src/globals/home_adapters.gd" +Request="*res://lib/globals/request.gd" +HomeAdapters="*res://lib/globals/home_adapters.gd" [editor_plugins]