Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions addons/flowkit/demos/quiz_game_example_scene.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[gd_scene format=3 uid="uid://djteo3tt3tmc5"]

[node name="QuizGameExampleScene" type="Control" unique_id=342433504]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="HoldsAnswers" type="VBoxContainer" parent="." unique_id=1861476995]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.2
anchor_top = 0.65
anchor_right = 0.8
anchor_bottom = 0.9
offset_right = 40.0
offset_bottom = 40.0

[node name="FirstAnswerButton" type="Button" parent="HoldsAnswers" unique_id=321524887]
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
text = "Answer text here"

[node name="DisplaysQuestion" type="Panel" parent="." unique_id=654895975]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.2
anchor_top = 0.1
anchor_right = 0.8
anchor_bottom = 0.55
offset_right = 40.0
offset_bottom = 40.0

[node name="QuestionText" type="RichTextLabel" parent="DisplaysQuestion" unique_id=221335647]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.05
anchor_top = 0.05
anchor_right = 0.95
anchor_bottom = 0.92
text = "Insert question text here"
horizontal_alignment = 1
2 changes: 1 addition & 1 deletion addons/flowkit/events/Timer/on_timeout.gd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func setup(node: Node, trigger_callback: Callable, _block_id: String = "") -> vo
var timer: Timer = node
timer.timeout.connect(exec_actions)
pass
var exec_actions: Callable

func on_timeout() -> void:
Expand Down
33 changes: 33 additions & 0 deletions addons/flowkit/events/UI/on_button_pressed.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
extends FKEvent

func get_description() -> String:
return "Executes a block of Actions in response to a button-press."

func get_id() -> String:
return "On Button Pressed"

func get_name() -> String:
return "On Button Pressed"

func get_supported_types() -> Array:
return ["Button"]

func is_signal_event() -> bool:
return true

func setup(target_node: Node, trigger_callback: Callable, instance_id: String = "") -> void:
button = target_node
button.pressed.connect(_on_button_pressed)
exec_actions = trigger_callback

var button: Button = null
var exec_actions: Callable

func _on_button_pressed() -> void:
exec_actions.call()

func teardown(target_node: Node, instance_id: String = "") -> void:
# Insert signal-DISconnection code here
button.pressed.disconnect(_on_button_pressed)
exec_actions = Callable()
pass
1 change: 1 addition & 0 deletions addons/flowkit/events/UI/on_button_pressed.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://gdcrkxekwcvn
59 changes: 59 additions & 0 deletions addons/flowkit/saved/event_sheet/7830454191141003914.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[gd_resource type="Resource" script_class="FKEventSheet" format=3 uid="uid://bude0li5knaft"]

[ext_resource type="Script" uid="uid://b1y3c8rnt2rcg" path="res://addons/flowkit/resources/fk_comment.gd" id="1_df7pu"]
[ext_resource type="Script" uid="uid://bxdhylwvr4osy" path="res://addons/flowkit/resources/event_block.gd" id="2_uoxok"]
[ext_resource type="Script" uid="uid://bwbi0utcwmxwf" path="res://addons/flowkit/resources/event_action.gd" id="3_j21vh"]
[ext_resource type="Script" uid="uid://bmaxurgrsv4ct" path="res://addons/flowkit/resources/event_condition.gd" id="4_emcdn"]
[ext_resource type="Script" path="res://addons/flowkit/resources/fk_group.gd" id="5_ulxaw"]
[ext_resource type="Script" uid="uid://bumsyiqkp46l1" path="res://addons/flowkit/resources/event_sheet.gd" id="6_rpy5k"]

[sub_resource type="Resource" id="Resource_df7pu"]
script = ExtResource("3_j21vh")
action_id = "set_window_mode"
target_node = NodePath("System")
inputs = {
"Mode": "windowed"
}

[sub_resource type="Resource" id="Resource_uoxok"]
script = ExtResource("3_j21vh")
action_id = "set_window_size"
target_node = NodePath("System")
inputs = {
"Height": "720",
"Width": "1280"
}

[sub_resource type="Resource" id="Resource_j21vh"]
script = ExtResource("2_uoxok")
block_id = "event_1770938702_2561723233"
event_id = "on_ready"
target_node = NodePath(".")
actions = Array[ExtResource("3_j21vh")]([SubResource("Resource_df7pu"), SubResource("Resource_uoxok")])

[sub_resource type="Resource" id="Resource_emcdn"]
script = ExtResource("3_j21vh")
action_id = "Print Message"
target_node = NodePath(".")
inputs = {
"color": "",
"message": "Response to button press"
}

[sub_resource type="Resource" id="Resource_ulxaw"]
script = ExtResource("2_uoxok")
block_id = "event_1770938646_2269187284"
event_id = "On Button Pressed"
target_node = NodePath("HoldsAnswers/FirstAnswerButton")
actions = Array[ExtResource("3_j21vh")]([SubResource("Resource_emcdn")])

[resource]
script = ExtResource("6_rpy5k")
events = Array[ExtResource("2_uoxok")]([SubResource("Resource_j21vh"), SubResource("Resource_ulxaw")])
item_order = Array[Dictionary]([{
"index": 0,
"type": "event"
}, {
"index": 1,
"type": "event"
}])