From 722dca31a7fb360fc42341ec793ff6b22da89807 Mon Sep 17 00:00:00 2001 From: Nitwel Date: Thu, 2 May 2024 11:02:47 +0200 Subject: [PATCH 1/4] improve mini view --- app/content/entities/timer/timer.tscn | 8 ++++---- app/content/entities/weather/weather.tscn | 2 +- app/content/system/dot/dot.tscn | 2 ++ app/content/system/house/mini/mini_wall.tres | 2 +- app/content/system/house/mini/miniature.gd | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/content/entities/timer/timer.tscn b/app/content/entities/timer/timer.tscn index 1f256929..1eba5492 100644 --- a/app/content/entities/timer/timer.tscn +++ b/app/content/entities/timer/timer.tscn @@ -10,7 +10,7 @@ [sub_resource type="BoxShape3D" id="BoxShape3D_3qyo4"] size = Vector3(0.32, 0.16, 0.02) -[sub_resource type="ShaderMaterial" id="ShaderMaterial_mq5r1"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_h0yvw"] resource_local_to_scene = true render_priority = 10 shader = ExtResource("6_40cd1") @@ -25,7 +25,7 @@ shader_parameter/corner_radius = 0.8 shader_parameter/roughness = 0.3 shader_parameter/grain_amount = 0.02 -[sub_resource type="QuadMesh" id="QuadMesh_x7s0p"] +[sub_resource type="QuadMesh" id="QuadMesh_a23j8"] size = Vector2(0.32, 0.16) [node name="Timer" type="StaticBody3D" groups=["entity"]] @@ -78,7 +78,7 @@ label = "stop" icon = true [node name="Panel" parent="." instance=ExtResource("5_j3gsb")] -material_override = SubResource("ShaderMaterial_mq5r1") -mesh = SubResource("QuadMesh_x7s0p") +material_override = SubResource("ShaderMaterial_h0yvw") +mesh = SubResource("QuadMesh_a23j8") size = Vector2(0.32, 0.16) corner_radius = 0.8 diff --git a/app/content/entities/weather/weather.tscn b/app/content/entities/weather/weather.tscn index b49b3a3a..1123a291 100644 --- a/app/content/entities/weather/weather.tscn +++ b/app/content/entities/weather/weather.tscn @@ -30427,7 +30427,7 @@ pixel_size = 0.001 render_priority = 15 sprite_frames = SubResource("SpriteFrames_71wxj") animation = &"sleet" -frame_progress = 0.23404 +frame_progress = 0.689981 [node name="WeatherLabel" type="Label3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.05, 0.02, 0) diff --git a/app/content/system/dot/dot.tscn b/app/content/system/dot/dot.tscn index 5d307ed4..58ceac57 100644 --- a/app/content/system/dot/dot.tscn +++ b/app/content/system/dot/dot.tscn @@ -20,6 +20,8 @@ shape = SubResource("SphereShape3D_3wgjq") [node name="Label3D" type="Label3D" parent="."] pixel_size = 0.002 billboard = 1 +render_priority = 15 +outline_render_priority = 14 text = "lightbulb" font = ExtResource("4_504vw") font_size = 100 diff --git a/app/content/system/house/mini/mini_wall.tres b/app/content/system/house/mini/mini_wall.tres index c2f5e4d9..1ae9ebb9 100644 --- a/app/content/system/house/mini/mini_wall.tres +++ b/app/content/system/house/mini/mini_wall.tres @@ -4,7 +4,7 @@ [ext_resource type="Texture2D" uid="uid://bbuq4wn7e5o2q" path="res://content/system/house/mini/temp_gradient.tres" id="2_3lwi8"] [resource] -render_priority = 10 +render_priority = 9 shader = ExtResource("1_sbr3e") shader_parameter/data = PackedFloat32Array() shader_parameter/data_size = 0 diff --git a/app/content/system/house/mini/miniature.gd b/app/content/system/house/mini/miniature.gd index 70d0e26b..b35e403b 100644 --- a/app/content/system/house/mini/miniature.gd +++ b/app/content/system/house/mini/miniature.gd @@ -31,7 +31,7 @@ var base_scale = { HeatmapType.HUMIDITY: Vector2(0.0, 100.0) } var selected_scale = R.state(Vector2(0.0, 1.0)) -var opacity = R.state(30) +var opacity = R.state(70) var heatmap_type = R.state(HeatmapType.NONE) var small = R.state(false) @@ -106,7 +106,7 @@ func _ready(): camera_position.y *= 0.5 camera_direction.y=0 - var target_position=camera_position + camera_direction.normalized() * 0.2 + var target_position=camera_position + camera_direction.normalized() * 0.5 var new_position=target_position - center * 0.1 tween.tween_property(small_node, "scale", Vector3(0.1, 0.1, 0.1), 0.5) From feea2a40b1308aebf81392543cfb0df0f3cd7d63 Mon Sep 17 00:00:00 2001 From: Nitwel Date: Thu, 2 May 2024 19:35:47 +0200 Subject: [PATCH 2/4] allow for taking screenshots --- app/assets/environment.tres | 2 +- app/content/entities/entity.gd | 2 +- app/content/entities/light/light.gd | 5 ++++- app/content/main.gd | 29 +++++++++++++++++++++++++++++ app/project.godot | 4 ++++ 5 files changed, 39 insertions(+), 3 deletions(-) diff --git a/app/assets/environment.tres b/app/assets/environment.tres index 1655b282..bb3fb959 100644 --- a/app/assets/environment.tres +++ b/app/assets/environment.tres @@ -7,7 +7,7 @@ sky_material = SubResource("ProceduralSkyMaterial_i4xao") [resource] background_mode = 1 -background_color = Color(1, 1, 1, 1) +background_color = Color(0.441, 0.962033, 0.98, 1) sky = SubResource("Sky_vhymk") ambient_light_source = 2 ambient_light_color = Color(1, 1, 1, 1) diff --git a/app/content/entities/entity.gd b/app/content/entities/entity.gd index 57356500..a3e408f5 100644 --- a/app/content/entities/entity.gd +++ b/app/content/entities/entity.gd @@ -1,6 +1,6 @@ extends StaticBody3D -var entity_id: String +@export var entity_id: String var icon = R.state("question_mark") var icon_color = R.state(Color(1, 1, 1, 1)) diff --git a/app/content/entities/light/light.gd b/app/content/entities/light/light.gd index c14c9d90..b0f876ca 100644 --- a/app/content/entities/light/light.gd +++ b/app/content/entities/light/light.gd @@ -23,6 +23,9 @@ var color_supported = false # Called when the node enters the scene tree for the first time. func _ready(): super() + + if HomeApi.has_connected() == false: + await HomeApi.on_connect icon.value = "lightbulb" var stateInfo = await HomeApi.get_state(entity_id) @@ -126,4 +129,4 @@ func quick_action(): _toggle() func _toggle(): - HomeApi.set_state(entity_id, "off" if active.value else "on") \ No newline at end of file + HomeApi.set_state(entity_id, "off" if active.value else "on") diff --git a/app/content/main.gd b/app/content/main.gd index 5732423d..b7636916 100644 --- a/app/content/main.gd +++ b/app/content/main.gd @@ -47,6 +47,9 @@ func _ready(): toggle_menu() elif action.name == "by_button": House.body.mini_view.small.value=!House.body.mini_view.small.value + elif action.name == "ax_button": + if take_screenshot(): + EventSystem.notify("Screenshot taken", EventNotify.Type.INFO) ) EventSystem.on_focus_in.connect(func(event): @@ -115,6 +118,9 @@ func _input(event): if event is InputEventKey and Input.is_key_pressed(KEY_F10): var vp = get_viewport() vp.debug_draw = (vp.debug_draw + 1) % 5 + + if event is InputEventKey and Input.is_key_pressed(KEY_F2): + take_screenshot() if event is InputEventKey and Input.is_key_pressed(KEY_M): toggle_menu() @@ -138,3 +144,26 @@ func vector_key_mapping(key_positive_x: int, key_negative_x: int, key_positive_y vec = vec.normalized() return vec + +func take_screenshot(): + var vp = get_viewport() + var texture = vp.get_texture() + var image = texture.get_image() + + var file_name = "%s.png" % Time.get_datetime_string_from_system().replace(":", "-") + + if image == null: + return false + + if OS.get_name() == "Android": + var path = OS.get_system_dir(OS.SYSTEM_DIR_PICTURES, false) + "/immersive-home/" + file_name + + if not FileAccess.file_exists(path): + var dir = path.get_base_dir() + DirAccess.open("user://").make_dir_recursive(dir) + + image.save_png(path) + else: + image.save_png("user://screenshots/%s.png" % Time.get_datetime_string_from_system().replace(":", "-")) + + return true \ No newline at end of file diff --git a/app/project.godot b/app/project.godot index a53401f0..bf264539 100644 --- a/app/project.godot +++ b/app/project.godot @@ -29,6 +29,10 @@ EventSystem="*res://lib/globals/event_system.gd" House="*res://lib/globals/house_body.gd" Request="*res://lib/globals/request.gd" +[display] + +window/vsync/vsync_mode=0 + [editor_plugins] enabled=PackedStringArray("res://addons/godot-xr-tools/plugin.cfg") From 2e996f2e118397042bfb8998b171b59362dd9801 Mon Sep 17 00:00:00 2001 From: Nitwel Date: Fri, 3 May 2024 12:45:17 +0200 Subject: [PATCH 3/4] small changes --- app/assets/design.afdesign | 4 ++-- app/lib/stores/store.gd | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/assets/design.afdesign b/app/assets/design.afdesign index c6367784..c83e41b2 100644 --- a/app/assets/design.afdesign +++ b/app/assets/design.afdesign @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b117dc5a7537a60ff341010636802131c9aa3b80982130e63d5d94902c002d07 -size 13505995 +oid sha256:2b7e5cb00328c9b9d8076a826c368d012628edadf108d078167620945c4742b0 +size 32849426 diff --git a/app/lib/stores/store.gd b/app/lib/stores/store.gd index a85e1a07..ff902863 100644 --- a/app/lib/stores/store.gd +++ b/app/lib/stores/store.gd @@ -66,6 +66,22 @@ func save_local(path=_save_path): var json_text = JSON.stringify(data) save_file.store_line(json_text) + # var path2 = OS.get_system_dir(OS.SYSTEM_DIR_DOCUMENTS, false) + "/immersive-home/" + path.split("/")[- 1] + # path2 = path2.replace("/Android/data/org.godotengine.immersivehome/files", "") + + # print(path2) + + # if not FileAccess.file_exists(path2): + # var dir = path2.get_base_dir() + # DirAccess.open("user://").make_dir_recursive(dir) + + # var save_file2 = FileAccess.open(path2, FileAccess.WRITE) + + # if save_file2 == null: + # return false + + # save_file2.store_line(json_text) + on_saved.emit() return true From b37b682da3aa096ee5706c5ead4d6153f074faa4 Mon Sep 17 00:00:00 2001 From: Nitwel Date: Fri, 3 May 2024 12:53:27 +0200 Subject: [PATCH 4/4] bump release version --- app/export_presets.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/export_presets.cfg b/app/export_presets.cfg index 7ccfc033..bb8ed777 100644 --- a/app/export_presets.cfg +++ b/app/export_presets.cfg @@ -245,13 +245,13 @@ custom_template/release="" gradle_build/use_gradle_build=true gradle_build/export_format=0 gradle_build/min_sdk="" -gradle_build/target_sdk="" +gradle_build/target_sdk="32" architectures/armeabi-v7a=false architectures/arm64-v8a=true architectures/x86=false architectures/x86_64=false -version/code=15 -version/name="v0.5.0" +version/code=16 +version/name="v0.6.0" package/unique_name="de.nitwel.$genname" package/name="Immersive Home" package/signed=true