From 3b4a64ac241403fad4d66224aa5e5dc92172e394 Mon Sep 17 00:00:00 2001 From: hobbesjaap Date: Sun, 13 Apr 2025 19:26:03 +0800 Subject: [PATCH] added ability to use numeric keys to select behaviours - started on adding four sampling modes --- godot/Assets/kenney_icons/tile_0051.png | Bin 0 -> 186 bytes godot/Assets/kenney_icons/tile_0052.png | Bin 0 -> 190 bytes godot/Assets/kenney_icons/tile_0053.png | Bin 0 -> 186 bytes godot/Assets/kenney_icons/tile_0054.png | Bin 0 -> 183 bytes godot/Assets/kenney_icons/tile_0055.png | Bin 0 -> 188 bytes godot/ObservationWindow.gd | 23 +++++++++ godot/main_screen.tscn | 61 +++++++++++++++++++++++- godot/project.godot | 28 +++++++++++ 8 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 godot/Assets/kenney_icons/tile_0051.png create mode 100644 godot/Assets/kenney_icons/tile_0052.png create mode 100644 godot/Assets/kenney_icons/tile_0053.png create mode 100644 godot/Assets/kenney_icons/tile_0054.png create mode 100644 godot/Assets/kenney_icons/tile_0055.png diff --git a/godot/Assets/kenney_icons/tile_0051.png b/godot/Assets/kenney_icons/tile_0051.png new file mode 100644 index 0000000000000000000000000000000000000000..9080177480888974e84986429e42b81cd26f4e6b GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFC`HA31vQDC;4C7DE|Bi6*6hHtrA?Pft(QBOFF%W@b#%94Qj*N|B7) bMc5dQtBP-GX;ZfYn#kbk>gTe~DWM4fURN}; literal 0 HcmV?d00001 diff --git a/godot/Assets/kenney_icons/tile_0052.png b/godot/Assets/kenney_icons/tile_0052.png new file mode 100644 index 0000000000000000000000000000000000000000..cb6298bb6e72c74104faf6e6637d3791b98b34e9 GIT binary patch literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFC`HA91~Kg!NE?V55;t>;fJ^31Hq)$ literal 0 HcmV?d00001 diff --git a/godot/Assets/kenney_icons/tile_0053.png b/godot/Assets/kenney_icons/tile_0053.png new file mode 100644 index 0000000000000000000000000000000000000000..9812e85877bfdb1df57d8bb18c0376dec06d024b GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFjH{0mIV0)GdMiEkp|?rdAc};a9mGLXlM=);7CYF zU^RAX>`4$87f%;ZKH}X-Nclq b$-}^~AXwaNi&0!T&_o7LS3j3^P6jH{0mIV0)GdMiEkp|>Ad%8G=a9mGLXlM=);7CYF zU^RAX>`4$87f%;ZKH}~Ku%=vboFyt=akR{0C{aUga7~l literal 0 HcmV?d00001 diff --git a/godot/Assets/kenney_icons/tile_0055.png b/godot/Assets/kenney_icons/tile_0055.png new file mode 100644 index 0000000000000000000000000000000000000000..ee87662ffd7fb31dea04f1bff3c0461c4cdd9231 GIT binary patch literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFjH{0mIV0)GdMiEkp|>=c)B=-a9mGLXlM=);7CYF zU^RAX>`4$87f%;ZKH}zyD828KDz;%fU#BfWuUGI+ZBxvX void: $"%ObservationWindow".hide() $"../Results".show() state_changed_check() + + +func _input(event) -> void: + if event.is_action_pressed("BehaviourOne"): + print("One") + if toggle_observation == true: + _on_BehaviourOne_pressed() + if event.is_action_pressed("BehaviourTwo"): + print("Two") + if toggle_observation == true: + _on_BehaviourTwo_pressed() + if event.is_action_pressed("BehaviourThree"): + print("Three") + if toggle_observation == true: + _on_BehaviourThree_pressed() + if event.is_action_pressed("BehaviourFour"): + print("Four") + if toggle_observation == true: + _on_BehaviourFour_pressed() + if event.is_action_pressed("BehaviourFive"): + print("Five") + if toggle_observation == true: + _on_BehaviourFive_pressed() diff --git a/godot/main_screen.tscn b/godot/main_screen.tscn index 4bd8d37..05b77bc 100644 --- a/godot/main_screen.tscn +++ b/godot/main_screen.tscn @@ -1,14 +1,19 @@ -[gd_scene load_steps=27 format=3 uid="uid://b1pk005at7x26"] +[gd_scene load_steps=32 format=3 uid="uid://b1pk005at7x26"] [ext_resource type="Theme" uid="uid://bki1nuccpiu3o" path="res://wb_theme.tres" id="1"] [ext_resource type="Script" uid="uid://rbmcgn3hetrs" path="res://main_screen.gd" id="2"] [ext_resource type="FontFile" uid="uid://df4eo3bryf8la" path="res://Assets/fonts/noto_sans_display.ttf" id="5"] [ext_resource type="FontFile" uid="uid://darkh8o8rieli" path="res://Assets/fonts/noto_sans_display_bold.ttf" id="6"] [ext_resource type="Script" uid="uid://hff4wu52flpd" path="res://ObservationWindow.gd" id="7"] +[ext_resource type="Texture2D" uid="uid://bodi3735281l4" path="res://Assets/kenney_icons/tile_0051.png" id="7_sqqhh"] [ext_resource type="Script" uid="uid://psov4nxn77wr" path="res://EditScreen.gd" id="8"] +[ext_resource type="Texture2D" uid="uid://doxpjidlik2uj" path="res://Assets/kenney_icons/tile_0052.png" id="8_qx06n"] [ext_resource type="Script" uid="uid://dhhlom5skgqeq" path="res://Results.gd" id="9"] +[ext_resource type="Texture2D" uid="uid://ci8gphiokiks" path="res://Assets/kenney_icons/tile_0053.png" id="9_q556m"] [ext_resource type="Script" uid="uid://dflvmgvxwqrrf" path="res://TimerBar.gd" id="10"] +[ext_resource type="Texture2D" uid="uid://bdyc4eqj77uk6" path="res://Assets/kenney_icons/tile_0054.png" id="10_0dp34"] [ext_resource type="Script" uid="uid://t1pvqg6e78j" path="res://ProgressBar.gd" id="11"] +[ext_resource type="Texture2D" uid="uid://hef804u8xrs" path="res://Assets/kenney_icons/tile_0055.png" id="11_kypv5"] [ext_resource type="Texture2D" uid="uid://yf4ormoh8hes" path="res://Assets/icons/main_icon.png" id="12"] [ext_resource type="Texture2D" uid="uid://bq56uvokwfppt" path="res://Assets/icons/noun-manual-241665.svg" id="12_p3r6q"] [ext_resource type="Texture2D" uid="uid://lafpc8rl5lg0" path="res://Assets/icons/noun-input-field-104354.svg" id="12_vtqql"] @@ -1200,6 +1205,7 @@ unique_name_in_owner = true unique_name_in_owner = true [node name="StartScreen" type="CanvasLayer" parent="."] +visible = false [node name="InstructionPanel" type="Panel" parent="StartScreen"] unique_name_in_owner = true @@ -1479,7 +1485,6 @@ text = "The pupil is otherwise distracted and not on task" [node name="NameChangePanel" type="Panel" parent="StartScreen"] unique_name_in_owner = true -visible = false anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 @@ -1544,6 +1549,20 @@ unique_name_in_owner = true layout_mode = 2 theme = ExtResource("1") +[node name="ObservationType" type="MenuButton" parent="StartScreen/NameChangePanel/NameContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Text" +item_count = 4 +popup/item_0/text = "Whole Interval (PI)" +popup/item_0/id = 0 +popup/item_1/text = "Partial Interval (PI)" +popup/item_1/id = 1 +popup/item_2/text = "Momentary Time Sampling (MTS)" +popup/item_2/id = 2 +popup/item_3/text = "Predominant Activity Sampling (PAS)" +popup/item_3/id = 3 + [node name="OkButton" type="Button" parent="StartScreen/NameChangePanel/NameContainer"] layout_mode = 2 theme = ExtResource("1") @@ -1897,6 +1916,44 @@ layout_mode = 2 size_flags_horizontal = 3 text = "Acronym1" +[node name="BehaviourShortcuts" type="HBoxContainer" parent="ObservationWindow/Panel"] +layout_mode = 0 +offset_left = 240.0 +offset_top = 295.0 +offset_right = 1146.0 +offset_bottom = 335.0 +theme_override_constants/separation = 165 + +[node name="KeyOne" type="TextureButton" parent="ObservationWindow/Panel/BehaviourShortcuts"] +layout_mode = 2 +disabled = true +texture_normal = ExtResource("7_sqqhh") +stretch_mode = 5 + +[node name="KeyTwo" type="TextureButton" parent="ObservationWindow/Panel/BehaviourShortcuts"] +layout_mode = 2 +disabled = true +texture_normal = ExtResource("8_qx06n") +stretch_mode = 5 + +[node name="KeyThree" type="TextureButton" parent="ObservationWindow/Panel/BehaviourShortcuts"] +layout_mode = 2 +disabled = true +texture_normal = ExtResource("9_q556m") +stretch_mode = 5 + +[node name="KeyFour" type="TextureButton" parent="ObservationWindow/Panel/BehaviourShortcuts"] +layout_mode = 2 +disabled = true +texture_normal = ExtResource("10_0dp34") +stretch_mode = 5 + +[node name="KeyFive" type="TextureButton" parent="ObservationWindow/Panel/BehaviourShortcuts"] +layout_mode = 2 +disabled = true +texture_normal = ExtResource("11_kypv5") +stretch_mode = 5 + [node name="BehaviourTitles" type="HBoxContainer" parent="ObservationWindow/Panel"] layout_mode = 0 offset_left = 240.0 diff --git a/godot/project.godot b/godot/project.godot index 2a91b57..0122a63 100644 --- a/godot/project.godot +++ b/godot/project.godot @@ -43,6 +43,34 @@ import/fbx/enabled=false common/drop_mouse_on_gui_input_disabled=true +[input] + +BehaviourOne={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":49,"key_label":0,"unicode":49,"location":0,"echo":false,"script":null) +] +} +BehaviourTwo={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":50,"key_label":0,"unicode":50,"location":0,"echo":false,"script":null) +] +} +BehaviourThree={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":51,"key_label":0,"unicode":51,"location":0,"echo":false,"script":null) +] +} +BehaviourFour={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":52,"key_label":0,"unicode":52,"location":0,"echo":false,"script":null) +] +} +BehaviourFive={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":53,"key_label":0,"unicode":53,"location":0,"echo":false,"script":null) +] +} + [internationalization] locale/translations=PackedStringArray("res://translation.en.translation", "res://translation.nl.translation")