mirror of
https://github.com/hobbesjaap/time-sampling-form.git
synced 2025-04-18 13:35:42 +00:00
worked on UI some more
This commit is contained in:
parent
2532525817
commit
67daccb6cc
@ -1,13 +0,0 @@
|
||||
extends Panel
|
||||
|
||||
|
||||
func _on_OkButton_pressed() -> void:
|
||||
if $"%NameLine".text and $"NameContainer/ObserverLine".text and $"NameContainer/ObservedActivity".text != "":
|
||||
$"%InstructionPanel".show()
|
||||
$"%NameChangePanel".hide()
|
||||
global_ints.observed_person_name = $"%NameLine".text
|
||||
global_ints.observer_person_name = $"NameContainer/ObserverLine".text
|
||||
global_ints.observed_activity = $"NameContainer/ObservedActivity".text
|
||||
else:
|
||||
$"%ObservedNameLabel".hide()
|
||||
$"%WarningLabel".show()
|
@ -1 +0,0 @@
|
||||
uid://b4r3eb67qd13n
|
@ -6,9 +6,8 @@ var csv_url = "https://raw.githubusercontent.com/hobbesjaap/time-sampling-form/m
|
||||
var update_text_url = "https://raw.githubusercontent.com/hobbesjaap/time-sampling-form/main/updater/update_text.md"
|
||||
var update_text : String
|
||||
var text_buffer : String
|
||||
var os_list : Array = ["Linux", "Windows", "macOS", "OSX"]
|
||||
var os_list : Array = ["Linux", "Windows", "macOS", "OSX", "UWP", "X11", "FreeBSD", "NetBSD", "OpenBSD", "BSD"]
|
||||
|
||||
@onready var date_time_display = $"%CurrentTime"
|
||||
@onready var minute_label = $"StartScreen/InstructionPanel/MinuteBox/MinuteLabel"
|
||||
@onready var styleBox_highlight : StyleBoxFlat = $"%OneInstrPanel".get_theme_stylebox("panel").duplicate()
|
||||
@onready var styleBox_orig : StyleBoxFlat = $"%TwoNamesPanel".get_theme_stylebox("panel").duplicate()
|
||||
@ -89,6 +88,7 @@ func update_date() -> void:
|
||||
global_ints.date = Time.get_datetime_dict_from_system()
|
||||
global_ints.ddmmyyyy = str(global_ints.date.day, "-", global_ints.date.month, "-", global_ints.date.year)
|
||||
|
||||
|
||||
func set_app_window_size() -> void:
|
||||
var desktop_x : int = DisplayServer.screen_get_size(DisplayServer.window_get_current_screen()).x
|
||||
var desktop_y : int = DisplayServer.screen_get_size(DisplayServer.window_get_current_screen()).y
|
||||
@ -104,6 +104,7 @@ func set_app_window_size() -> void:
|
||||
@warning_ignore("integer_division")
|
||||
DisplayServer.window_set_position(Vector2i(int(desktop_x/6), int(desktop_y/6)))
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
#DisplayServer.window_set_min_size(Vector2i(1280, 720))
|
||||
if os_list.has(OS.get_name()):
|
||||
@ -119,6 +120,7 @@ func _ready() -> void:
|
||||
$"Results".hide()
|
||||
$"EditScreen".hide()
|
||||
$"%UpdatePanel".hide()
|
||||
state_changed_check()
|
||||
update_date()
|
||||
set_language()
|
||||
check_for_updates()
|
||||
@ -162,15 +164,9 @@ func state_changed_check() -> void:
|
||||
|
||||
|
||||
func _process(_delta) -> void:
|
||||
state_changed_check()
|
||||
check_time_var += 1
|
||||
|
||||
if check_time_var == 10:
|
||||
check_time_var = 0
|
||||
if global_ints.date.minute < 10:
|
||||
date_time_display.text = str(global_ints.date.hour, ":0", global_ints.date.minute)
|
||||
if global_ints.date.minute >= 10:
|
||||
date_time_display.text = str(global_ints.date.hour, ":", global_ints.date.minute)
|
||||
# When I refactor, this should move OUT of the process-delta bit
|
||||
# state_changed_check()
|
||||
pass
|
||||
|
||||
|
||||
func _on_MinuteMinus_pressed() -> void:
|
||||
@ -191,14 +187,16 @@ func _on_Manual_pressed() -> void:
|
||||
|
||||
func _on_PupilName_pressed() -> void:
|
||||
$"%NameLine".text = global_ints.observed_person_name
|
||||
$"%InstructionPanel".visible = false
|
||||
$"%NameChangePanel".visible = true
|
||||
$"%InstructionPanel".hide()
|
||||
$"%NameChangePanel".show()
|
||||
state_changed_check()
|
||||
|
||||
|
||||
func _on_Start_pressed() -> void:
|
||||
$"StartScreen".visible = false
|
||||
refresh_descriptors()
|
||||
$"ObservationWindow".visible = true
|
||||
$"ObservationWindow".show()
|
||||
state_changed_check()
|
||||
$"%BehaviourOne".text = global_ints.one_acronym
|
||||
$"%BehaviourTwo".text = global_ints.two_acronym
|
||||
$"%BehaviourThree".text = global_ints.three_acronym
|
||||
@ -233,11 +231,12 @@ func _on_Start_pressed() -> void:
|
||||
|
||||
func _on_ChangeItems_pressed() -> void:
|
||||
$"EditScreen".show()
|
||||
|
||||
state_changed_check()
|
||||
|
||||
func _on_InsOkButton_pressed() -> void:
|
||||
$"%InstructionScreen".hide()
|
||||
$"%NameChangePanel".show()
|
||||
state_changed_check()
|
||||
|
||||
|
||||
func _on_MinuteMinus_button_down() -> void:
|
||||
@ -254,3 +253,16 @@ func _on_GoToUpdate_pressed() -> void:
|
||||
|
||||
func _on_IgnoreUpdate_pressed() -> void:
|
||||
$"%UpdatePanel".hide()
|
||||
|
||||
|
||||
func _on_ok_button_pressed() -> void:
|
||||
if $"%NameLine".text and $"%ObserverLine".text and $"%ObservedActivity".text != "":
|
||||
$"%InstructionPanel".show()
|
||||
$"%NameChangePanel".hide()
|
||||
state_changed_check()
|
||||
global_ints.observed_person_name = $"%NameLine".text
|
||||
global_ints.observer_person_name = $"%ObserverLine".text
|
||||
global_ints.observed_activity = $"%ObservedActivity".text
|
||||
else:
|
||||
$"%ObservedNameLabel".hide()
|
||||
$"%WarningLabel".show()
|
||||
|
@ -1,8 +1,7 @@
|
||||
[gd_scene load_steps=29 format=3 uid="uid://b1pk005at7x26"]
|
||||
[gd_scene load_steps=27 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="Script" uid="uid://b4r3eb67qd13n" path="res://NameChangePanel.gd" id="4"]
|
||||
[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"]
|
||||
@ -24,15 +23,6 @@ bg_color = Color(1, 1, 1, 1)
|
||||
bg_color = Color(1, 1, 1, 1)
|
||||
shadow_offset = Vector2(0, 4)
|
||||
|
||||
[sub_resource type="FontFile" id="4"]
|
||||
fallbacks = Array[Font]([ExtResource("5")])
|
||||
cache/0/16/0/ascent = 0.0
|
||||
cache/0/16/0/descent = 0.0
|
||||
cache/0/16/0/underline_position = 0.0
|
||||
cache/0/16/0/underline_thickness = 0.0
|
||||
cache/0/16/0/scale = 1.0
|
||||
cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0)
|
||||
|
||||
[sub_resource type="FontFile" id="5"]
|
||||
fallbacks = Array[Font]([ExtResource("6")])
|
||||
cache/0/16/0/ascent = 0.0
|
||||
@ -1255,18 +1245,6 @@ size_flags_horizontal = 3
|
||||
theme = ExtResource("1")
|
||||
text = "+"
|
||||
|
||||
[node name="CurrentTime" type="Label" parent="StartScreen/InstructionPanel"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_left = 1067.0
|
||||
offset_top = 620.0
|
||||
offset_right = 1146.0
|
||||
offset_bottom = 643.0
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_fonts/font = SubResource("4")
|
||||
text = "99:99"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="MinuteExplanation" type="Label" parent="StartScreen/InstructionPanel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
@ -1487,7 +1465,6 @@ offset_top = -289.0
|
||||
offset_right = 640.0
|
||||
offset_bottom = 359.0
|
||||
theme_override_styles/panel = SubResource("1")
|
||||
script = ExtResource("4")
|
||||
|
||||
[node name="NameContainer" type="VBoxContainer" parent="StartScreen/NameChangePanel"]
|
||||
layout_mode = 0
|
||||
@ -1546,6 +1523,7 @@ text = "OK"
|
||||
|
||||
[node name="InstructionScreen" type="Panel" parent="StartScreen"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
@ -1558,7 +1536,6 @@ offset_bottom = 359.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_styles/panel = SubResource("1")
|
||||
script = ExtResource("4")
|
||||
|
||||
[node name="InstructionContainer" type="VBoxContainer" parent="StartScreen/InstructionScreen"]
|
||||
layout_mode = 1
|
||||
@ -1672,7 +1649,6 @@ text = "UPD_TEXT2"
|
||||
|
||||
[node name="EditScreen" type="CanvasLayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
script = ExtResource("8")
|
||||
|
||||
[node name="Panel" type="Panel" parent="EditScreen"]
|
||||
@ -1682,15 +1658,18 @@ anchor_bottom = 1.0
|
||||
theme = ExtResource("1")
|
||||
|
||||
[node name="GridObservations" type="GridContainer" parent="EditScreen/Panel"]
|
||||
layout_mode = 0
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -518.5
|
||||
offset_left = -445.0
|
||||
offset_top = -57.0
|
||||
offset_right = 518.5
|
||||
offset_bottom = 129.0
|
||||
offset_right = 560.0
|
||||
offset_bottom = 141.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
columns = 3
|
||||
|
||||
[node name="AcronymLabel" type="Label" parent="EditScreen/Panel/GridObservations"]
|
||||
@ -1812,28 +1791,27 @@ size_flags_horizontal = 3
|
||||
theme = ExtResource("1")
|
||||
text = "The pupil is otherwise distracted and not on task"
|
||||
|
||||
[node name="CancelButton" type="Button" parent="EditScreen/Panel"]
|
||||
layout_mode = 0
|
||||
offset_left = 520.0
|
||||
offset_top = 645.0
|
||||
offset_right = 597.0
|
||||
offset_bottom = 679.0
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="EditScreen/Panel"]
|
||||
layout_mode = 1
|
||||
offset_left = 474.0
|
||||
offset_top = 516.0
|
||||
offset_right = 882.0
|
||||
offset_bottom = 560.0
|
||||
alignment = 1
|
||||
|
||||
[node name="CancelButton" type="Button" parent="EditScreen/Panel/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "BUT_CANCEL"
|
||||
|
||||
[node name="OKButton" type="Button" parent="EditScreen/Panel"]
|
||||
layout_mode = 0
|
||||
offset_left = 616.0
|
||||
offset_top = 645.0
|
||||
offset_right = 656.0
|
||||
offset_bottom = 679.0
|
||||
[node name="OKButton" type="Button" parent="EditScreen/Panel/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "OK"
|
||||
|
||||
[node name="ClearAll" type="Button" parent="EditScreen/Panel"]
|
||||
layout_mode = 0
|
||||
offset_left = 952.0
|
||||
offset_top = 615.0
|
||||
offset_right = 1051.0
|
||||
offset_bottom = 649.0
|
||||
[node name="ClearAll" type="Button" parent="EditScreen/Panel/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "BUT_CLEAR"
|
||||
|
||||
[node name="ObservationWindow" type="CanvasLayer" parent="."]
|
||||
@ -2348,13 +2326,13 @@ horizontal_alignment = 1
|
||||
[connection signal="pressed" from="StartScreen/InstructionPanel/BottomButtons/ChangeItems" to="." method="_on_ChangeItems_pressed"]
|
||||
[connection signal="pressed" from="StartScreen/InstructionPanel/BottomButtons/PupilName" to="." method="_on_PupilName_pressed"]
|
||||
[connection signal="pressed" from="StartScreen/InstructionPanel/BottomButtons/Start" to="." method="_on_Start_pressed"]
|
||||
[connection signal="pressed" from="StartScreen/NameChangePanel/NameContainer/OkButton" to="StartScreen/NameChangePanel" method="_on_OkButton_pressed"]
|
||||
[connection signal="pressed" from="StartScreen/NameChangePanel/NameContainer/OkButton" to="." method="_on_ok_button_pressed"]
|
||||
[connection signal="pressed" from="StartScreen/InstructionScreen/InstructionContainer/InsOkButton" to="." method="_on_InsOkButton_pressed"]
|
||||
[connection signal="pressed" from="StartScreen/UpdatePanel/BottomButtons/GoToUpdate" to="." method="_on_GoToUpdate_pressed"]
|
||||
[connection signal="pressed" from="StartScreen/UpdatePanel/BottomButtons/IgnoreUpdate" to="." method="_on_IgnoreUpdate_pressed"]
|
||||
[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="pressed" from="EditScreen/Panel/ClearAll" to="EditScreen" method="_on_ClearAll_pressed"]
|
||||
[connection signal="pressed" from="EditScreen/Panel/HBoxContainer/CancelButton" to="EditScreen" method="_on_CancelButton_pressed"]
|
||||
[connection signal="pressed" from="EditScreen/Panel/HBoxContainer/OKButton" to="EditScreen" method="_on_OKButton_pressed"]
|
||||
[connection signal="pressed" from="EditScreen/Panel/HBoxContainer/ClearAll" to="EditScreen" method="_on_ClearAll_pressed"]
|
||||
[connection signal="pressed" from="ObservationWindow/Panel/BehaviourButtons/BehaviourOne" to="ObservationWindow" method="_on_BehaviourOne_pressed"]
|
||||
[connection signal="pressed" from="ObservationWindow/Panel/BehaviourButtons/BehaviourTwo" to="ObservationWindow" method="_on_BehaviourTwo_pressed"]
|
||||
[connection signal="pressed" from="ObservationWindow/Panel/BehaviourButtons/BehaviourThree" to="ObservationWindow" method="_on_BehaviourThree_pressed"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user