feat: added results UI to flatscreen
This commit is contained in:
parent
ab226045a5
commit
f952452b2e
2 changed files with 89 additions and 4 deletions
62
flatscreen-project/scenes/results_ui.tscn
Normal file
62
flatscreen-project/scenes/results_ui.tscn
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://kk4ecpjc4puc"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://btcmnw6q6g0h0" path="res://objects/pinned_photo.tscn" id="1_iugs1"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_lm1ej"]
|
||||
script/source = "extends Node
|
||||
|
||||
func set_conclusion(method : int, motive : int, murderer : int) -> void:
|
||||
%Method.clue = method
|
||||
%Motive.clue = motive
|
||||
%Murderer.clue = murderer
|
||||
|
||||
func _ready() -> void:
|
||||
%Method.input_pickable = false
|
||||
%Motive.input_pickable = false
|
||||
%Murderer.input_pickable = false
|
||||
"
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_iugs1"]
|
||||
font_size = 40
|
||||
|
||||
[node name="ResultsUI" type="Node"]
|
||||
script = SubResource("GDScript_lm1ej")
|
||||
|
||||
[node name="YourConclusionLabel" type="Label" parent="."]
|
||||
offset_left = 230.0
|
||||
offset_top = 147.0
|
||||
offset_right = 543.0
|
||||
offset_bottom = 202.0
|
||||
text = "Your Conclusion"
|
||||
label_settings = SubResource("LabelSettings_iugs1")
|
||||
|
||||
[node name="Method" parent="." instance=ExtResource("1_iugs1")]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(559, 313)
|
||||
|
||||
[node name="Motive" parent="." instance=ExtResource("1_iugs1")]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(936, 379)
|
||||
|
||||
[node name="Murderer" parent="." instance=ExtResource("1_iugs1")]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(1316, 306)
|
||||
|
||||
[node name="Label2" type="Label" parent="."]
|
||||
offset_left = 347.0
|
||||
offset_top = 599.0
|
||||
offset_right = 660.0
|
||||
offset_bottom = 654.0
|
||||
text = "The Truth"
|
||||
label_settings = SubResource("LabelSettings_iugs1")
|
||||
|
||||
[node name="MethodActual" parent="." instance=ExtResource("1_iugs1")]
|
||||
position = Vector2(559, 734)
|
||||
clue = 0
|
||||
|
||||
[node name="MotiveActual" parent="." instance=ExtResource("1_iugs1")]
|
||||
position = Vector2(933, 720)
|
||||
clue = 8
|
||||
|
||||
[node name="MurdererActual" parent="." instance=ExtResource("1_iugs1")]
|
||||
position = Vector2(1316, 727)
|
||||
|
|
@ -1,10 +1,23 @@
|
|||
[gd_scene load_steps=15 format=3 uid="uid://o3ri154wpbrx"]
|
||||
[gd_scene load_steps=17 format=3 uid="uid://o3ri154wpbrx"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://btcmnw6q6g0h0" path="res://objects/pinned_photo.tscn" id="1_7cefc"]
|
||||
[ext_resource type="PackedScene" uid="uid://kk4ecpjc4puc" path="res://scenes/results_ui.tscn" id="1_thvsl"]
|
||||
[ext_resource type="PackedScene" uid="uid://qmb60kjx6yoe" path="res://objects/victim_file.tscn" id="2_vo7lu"]
|
||||
[ext_resource type="PackedScene" uid="uid://drcl138k0gym0" path="res://objects/witness_report.tscn" id="3_wjago"]
|
||||
[ext_resource type="PackedScene" uid="uid://cjyr1b0fxfofx" path="res://objects/case_file.tscn" id="4_cnvne"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_thvsl"]
|
||||
script/source = "extends Node2D
|
||||
|
||||
@export var conclusion_screen : PackedScene = null
|
||||
|
||||
func notify_conclusion_sent(method : int, motive : int, murderer : int) -> void:
|
||||
var instance := conclusion_screen.instantiate()
|
||||
instance.set_conclusion(method, motive, murderer)
|
||||
get_parent().add_child(instance)
|
||||
self.queue_free()
|
||||
"
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_usqe2"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_usqe2"]
|
||||
|
|
@ -33,7 +46,7 @@ func _pressed() -> void:
|
|||
ServerNode.get_singleton().send_conclusion(%WeaponSlot.get_current_clue(), %MotiveSlot.get_current_clue(), %MurdererSlot.get_current_clue())
|
||||
else:
|
||||
print(\"Conclusion: \", %WeaponSlot.get_current_clue(), \", \", %MotiveSlot.get_current_clue(), \", \", %MurdererSlot.get_current_clue())
|
||||
|
||||
owner.notify_conclusion_sent(%WeaponSlot.get_current_clue(), %MotiveSlot.get_current_clue(), %MurdererSlot.get_current_clue())
|
||||
func update_can_send():
|
||||
self.disabled = not (%WeaponSlot.is_filled() and %MotiveSlot.is_filled() and %MurdererSlot.is_filled())
|
||||
|
||||
|
|
@ -53,7 +66,9 @@ colors = PackedColorArray(0, 0, 0, 1)
|
|||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_c1nar"]
|
||||
gradient = SubResource("Gradient_thvsl")
|
||||
|
||||
[node name="FlatscreenRoot" type="Node2D"]
|
||||
[node name="Workspace" type="Node2D"]
|
||||
script = SubResource("GDScript_thvsl")
|
||||
conclusion_screen = ExtResource("1_thvsl")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
anchor_mode = 0
|
||||
|
|
@ -132,9 +147,17 @@ texture = SubResource("GradientTexture1D_c1nar")
|
|||
|
||||
[node name="PinnedPhoto" parent="PhotosParent" instance=ExtResource("1_7cefc")]
|
||||
position = Vector2(479, 904)
|
||||
clue = 0
|
||||
|
||||
[node name="PinnedPhoto2" parent="PhotosParent" instance=ExtResource("1_7cefc")]
|
||||
position = Vector2(785, 905)
|
||||
clue = 1
|
||||
|
||||
[node name="PinnedPhoto3" parent="PhotosParent" instance=ExtResource("1_7cefc")]
|
||||
position = Vector2(1080, 891)
|
||||
|
||||
[node name="PhotoInbox" type="PhotoInbox" parent="PhotosParent"]
|
||||
position = Vector2(1679, 900)
|
||||
position = Vector2(1717, 889)
|
||||
photo_scene = ExtResource("1_7cefc")
|
||||
|
||||
[node name="VictimFile" parent="." node_paths=PackedStringArray("open_position") instance=ExtResource("2_vo7lu")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue