From 283aba4dd3a94c197cd54cabac0edd5e0c6ef05f Mon Sep 17 00:00:00 2001 From: Jaap Marsman Date: Wed, 26 Oct 2022 20:27:50 +0800 Subject: [PATCH] worked on overall variables and results screen --- godot/ObservationWindow.gd | 1 + godot/Results.gd | 17 +++++++++++++++++ godot/global_ints.gd | 10 +++++++++- godot/main_screen.tscn | 26 ++++++++++++++++++++++++-- 4 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 godot/Results.gd diff --git a/godot/ObservationWindow.gd b/godot/ObservationWindow.gd index a325ed2..2d56129 100644 --- a/godot/ObservationWindow.gd +++ b/godot/ObservationWindow.gd @@ -26,6 +26,7 @@ func _on_TwentySecondTimer_timeout(): print("We're completely done - no intervals remain") # So I should end the observation and move to the Results window. $"TwentySecondTimer".stop() + $"../Results".visible = true if global_ints.locked_observations_intervals_remaining > 1: on_interval_moment() diff --git a/godot/Results.gd b/godot/Results.gd new file mode 100644 index 0000000..e69ea5f --- /dev/null +++ b/godot/Results.gd @@ -0,0 +1,17 @@ +extends CanvasLayer + + +func _ready(): + pass # Replace with function body. + + +#func _process(delta): +# pass + + +func _on_SaveReport_pressed(): + pass # Replace with function body. + + +func _on_BackMainMenu_pressed(): + pass # Replace with function body. diff --git a/godot/global_ints.gd b/godot/global_ints.gd index a05a59f..773012e 100644 --- a/godot/global_ints.gd +++ b/godot/global_ints.gd @@ -4,7 +4,7 @@ extends Node var timer_duration : int = 4 -var observation_minutes : int = 15 +var observation_minutes : int = 1 var observed_person_name : String @@ -32,3 +32,11 @@ var three_explanation = "The pupil is distracting other pupils or talking to the var four_explanation = "The pupil is walking through the class" var five_explanation = "The pupil is otherwise distracted and not on task" var six_explanation = "No answer was selected for this round" + +var total_behaviours : int +var one_behaviour_score : int +var two_behaviour_score : int +var three_behaviour_score : int +var four_behaviour_score: int +var five_behaviour_score : int +var six_behaviour_score : int diff --git a/godot/main_screen.tscn b/godot/main_screen.tscn index e903876..8ef1c12 100644 --- a/godot/main_screen.tscn +++ b/godot/main_screen.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=15 format=2] +[gd_scene load_steps=17 format=2] [ext_resource path="res://wb_theme.tres" type="Theme" id=1] [ext_resource path="res://main_screen.gd" type="Script" id=2] @@ -8,6 +8,7 @@ [ext_resource path="res://Assets/fonts/NotoSansDisplay-Bold.ttf" type="DynamicFontData" id=6] [ext_resource path="res://ObservationWindow.gd" type="Script" id=7] [ext_resource path="res://EditScreen.gd" type="Script" id=8] +[ext_resource path="res://Results.gd" type="Script" id=9] [sub_resource type="StyleBoxFlat" id=2] bg_color = Color( 0.952941, 0.933333, 0.847059, 1 ) @@ -34,6 +35,9 @@ bg_color = Color( 1, 1, 1, 1 ) corner_radius_top_left = 50 corner_radius_top_right = 50 +[sub_resource type="StyleBoxFlat" id=8] +bg_color = Color( 1, 1, 1, 1 ) + [node name="AppWindow" type="CanvasLayer"] script = ExtResource( 2 ) @@ -669,7 +673,6 @@ margin_bottom = 679.0 text = "OK" [node name="ObservationWindow" type="CanvasLayer" parent="."] -visible = false script = ExtResource( 7 ) [node name="Panel" type="Panel" parent="ObservationWindow"] @@ -769,11 +772,28 @@ text = "ObservationsTotal" [node name="Results" type="CanvasLayer" parent="."] visible = false +script = ExtResource( 9 ) [node name="Panel" type="Panel" parent="Results"] anchor_right = 1.0 anchor_bottom = 1.0 +margin_top = -157.0 theme = ExtResource( 1 ) +custom_styles/panel = SubResource( 8 ) + +[node name="SaveReport" type="Button" parent="Results/Panel"] +margin_left = 1045.0 +margin_top = 835.0 +margin_right = 1274.0 +margin_bottom = 869.0 +text = "Save Report as PNG" + +[node name="BackMainMenu" type="Button" parent="Results/Panel"] +margin_left = 14.0 +margin_top = 828.0 +margin_right = 158.0 +margin_bottom = 862.0 +text = "Restart" [connection signal="pressed" from="StartScreen/InstructionPanel/MinuteBox/MinuteMinus" to="." method="_on_MinuteMinus_pressed"] [connection signal="pressed" from="StartScreen/InstructionPanel/MinuteBox/MinutePlus" to="." method="_on_MinutePlus_pressed"] @@ -785,3 +805,5 @@ theme = ExtResource( 1 ) [connection signal="pressed" from="EditScreen/Panel/CancelButton" to="EditScreen" method="_on_CancelButton_pressed"] [connection signal="pressed" from="EditScreen/Panel/OKButton" to="EditScreen" method="_on_OKButton_pressed"] [connection signal="timeout" from="ObservationWindow/TwentySecondTimer" to="ObservationWindow" method="_on_TwentySecondTimer_timeout"] +[connection signal="pressed" from="Results/Panel/SaveReport" to="Results" method="_on_SaveReport_pressed"] +[connection signal="pressed" from="Results/Panel/BackMainMenu" to="Results" method="_on_BackMainMenu_pressed"]