improve mini view selection

This commit is contained in:
Nitwel 2024-04-18 12:10:20 +02:00
parent 3e62c1c9c2
commit 90cfe87ae8
5 changed files with 8 additions and 41 deletions

View File

@ -1,15 +0,0 @@
extends Node3D
@onready var menu_button = $Menu
@onready var mini_button = $Mini
@onready var clock = $Clock
@onready var main = $"/root/Main"
func _ready():
menu_button.on_button_down.connect(func():
main.toggle_menu()
)
mini_button.on_button_down.connect(func():
House.body.mini_view = !House.body.mini_view
)

View File

@ -1,23 +0,0 @@
[gd_scene load_steps=3 format=3 uid="uid://bexxngoxcegul"]
[ext_resource type="Script" path="res://content/system/armband/armband.gd" id="1_4tskg"]
[ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="1_egcvm"]
[node name="Armband" type="Node3D"]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
script = ExtResource("1_4tskg")
[node name="Menu" parent="." instance=ExtResource("1_egcvm")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.04, 0, 0.04)
label = "menu"
icon = true
[node name="Mini" parent="." instance=ExtResource("1_egcvm")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.02, 0, 0.04)
label = "view_comfy"
icon = true
[node name="Clock" type="Label3D" parent="."]
transform = Transform3D(1, 4.37114e-08, 4.37114e-08, -4.37114e-08, -4.37114e-08, 1, 4.37114e-08, -1, -4.37114e-08, 0, 0.02, -0.02)
pixel_size = 0.001
text = "10:00"

View File

@ -34,7 +34,7 @@ func _ready():
) )
func _on_click(_event: EventPointer): func _on_click(_event: EventPointer):
if entity.has_method("quick_action"): if entity.has_method("quick_action")&&miniature.entity_select.selection_active() == false:
entity.quick_action() entity.quick_action()
else: else:
miniature.entity_select.toggle(entity) miniature.entity_select.toggle(entity)
@ -61,7 +61,7 @@ func _on_touch_move(_event: EventTouch):
func _on_touch_leave(_event: EventTouch): func _on_touch_leave(_event: EventTouch):
if touch_ran: return if touch_ran: return
if entity.has_method("quick_action"): if entity.has_method("quick_action")&&miniature.entity_select.selection_active() == false:
entity.quick_action() entity.quick_action()
else: else:
miniature.entity_select.toggle(entity) miniature.entity_select.toggle(entity)

View File

@ -58,6 +58,9 @@ func _ready():
dots.add_child(dot) dots.add_child(dot)
) )
func selection_active():
return editing.value.size() > 0
func toggle(entity: Entity): func toggle(entity: Entity):
if active_type == null: if active_type == null:
active_type = entity.entity_id.split(".")[0] active_type = entity.entity_id.split(".")[0]

View File

@ -134,6 +134,7 @@ permissions/mount_format_filesystems=false
permissions/mount_unmount_filesystems=false permissions/mount_unmount_filesystems=false
permissions/nfc=false permissions/nfc=false
permissions/persistent_activity=false permissions/persistent_activity=false
permissions/post_notifications=false
permissions/process_outgoing_calls=false permissions/process_outgoing_calls=false
permissions/read_calendar=false permissions/read_calendar=false
permissions/read_call_log=false permissions/read_call_log=false
@ -244,7 +245,7 @@ custom_template/release=""
gradle_build/use_gradle_build=true gradle_build/use_gradle_build=true
gradle_build/export_format=0 gradle_build/export_format=0
gradle_build/min_sdk="" gradle_build/min_sdk=""
gradle_build/target_sdk="32" gradle_build/target_sdk=""
architectures/armeabi-v7a=false architectures/armeabi-v7a=false
architectures/arm64-v8a=true architectures/arm64-v8a=true
architectures/x86=false architectures/x86=false
@ -357,6 +358,7 @@ permissions/mount_format_filesystems=false
permissions/mount_unmount_filesystems=false permissions/mount_unmount_filesystems=false
permissions/nfc=false permissions/nfc=false
permissions/persistent_activity=false permissions/persistent_activity=false
permissions/post_notifications=false
permissions/process_outgoing_calls=false permissions/process_outgoing_calls=false
permissions/read_calendar=false permissions/read_calendar=false
permissions/read_call_log=false permissions/read_call_log=false