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
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/action_press.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://c10kcwopyvsey
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/action_release.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cod6y4xdwgl6a
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/center_window.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://c670sdy5puuum
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/change_scene.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bwhhnrvngidru
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/open_url.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://0etbx4ypgwo
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/reload_scene.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bfl8h6axko5ns
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/set_audio_bus_mute.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bmk2xjib5mwff
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/set_audio_bus_volume.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://wkug7um2ed8p
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/set_clipboard.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bb3axo5mbbc4l
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/set_max_fps.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cq2fb5tfe1cwd
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/set_mouse_captured.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dgr0swtw6lfvd
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/set_mouse_cursor.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bkhl0fi2n20to
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/set_mouse_visible.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dxshj285wbvps
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/set_time_scale.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://c2ca1mdxnw5h4
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/set_vsync.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://khybqre6qkvg
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/set_window_mode.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://b14mkunkodo0y
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/set_window_position.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dyyhovrjafl40
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/set_window_size.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dr8b3106qfpn6
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/set_window_title.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bsm0om0ifky8g
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/vibrate.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://0w1qnbvrfk4f
1 change: 1 addition & 0 deletions addons/flowkit/actions/System/warp_mouse.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://b3it25w1hryos
1 change: 1 addition & 0 deletions addons/flowkit/conditions/System/is_action_released.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://biicbuow4a5a6
1 change: 1 addition & 0 deletions addons/flowkit/conditions/System/is_audio_bus_muted.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://b1dfpy7xxsg2e
1 change: 1 addition & 0 deletions addons/flowkit/conditions/System/is_debug_build.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cxy876kvp5k8d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dy3xcpnasb2lj
1 change: 1 addition & 0 deletions addons/flowkit/conditions/System/is_fast_forward.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cxkfxb0h6ympk
1 change: 1 addition & 0 deletions addons/flowkit/conditions/System/is_fps_above.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://vfmm3dr06lm7
1 change: 1 addition & 0 deletions addons/flowkit/conditions/System/is_fps_below.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://brvhh5wd4s71h
1 change: 1 addition & 0 deletions addons/flowkit/conditions/System/is_key_pressed.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://b2xrb5fws0xna
1 change: 1 addition & 0 deletions addons/flowkit/conditions/System/is_mobile.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cw3n6py2ii23j
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://b86gmquj27did
1 change: 1 addition & 0 deletions addons/flowkit/conditions/System/is_mouse_captured.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://tjst2gdqpj22
1 change: 1 addition & 0 deletions addons/flowkit/conditions/System/is_mouse_visible.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cfc4ov8mg1t0w
1 change: 1 addition & 0 deletions addons/flowkit/conditions/System/is_platform.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://m3y1mg1m7387
1 change: 1 addition & 0 deletions addons/flowkit/conditions/System/is_slow_motion.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://igwkos73jilo
1 change: 1 addition & 0 deletions addons/flowkit/conditions/System/is_window_focused.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bfmn34wus56yx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://6xmyqa1naxxy
1 change: 1 addition & 0 deletions addons/flowkit/events/System/on_action_released.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bho10i1x72nog
1 change: 1 addition & 0 deletions addons/flowkit/events/System/on_key_pressed.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://c6qcnovg7h8hv
1 change: 1 addition & 0 deletions addons/flowkit/events/System/on_key_released.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://c1lhw2l7jhhf2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bub7x14ra70wf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dffgkvy33vxgm
1 change: 1 addition & 0 deletions addons/flowkit/events/System/on_physics_process.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://dvbmve2twc5jv
1 change: 1 addition & 0 deletions addons/flowkit/events/System/on_process.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://damyb216suue2
1 change: 1 addition & 0 deletions addons/flowkit/events/System/on_scene_ready.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cli02w1sre8fj
1 change: 1 addition & 0 deletions addons/flowkit/events/System/on_time_scale_changed.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://733tc0ya730s
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cso6d8nig7o0f
1 change: 1 addition & 0 deletions addons/flowkit/events/System/on_window_focus_gained.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://byu322vxcv7bt
1 change: 1 addition & 0 deletions addons/flowkit/events/System/on_window_focus_lost.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bdr2xea731a1i
78 changes: 78 additions & 0 deletions addons/flowkit/ui/editor.gd
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,10 @@ func _connect_comment_signals(comment) -> void:
comment.selected.connect(_on_comment_selected)
comment.delete_requested.connect(_on_comment_delete.bind(comment))
comment.data_changed.connect(_save_sheet)
comment.insert_comment_above_requested.connect(_on_comment_insert_above.bind(comment))
comment.insert_comment_below_requested.connect(_on_comment_insert_below.bind(comment))
comment.insert_event_above_requested.connect(_on_comment_insert_event_above.bind(comment))
comment.insert_event_below_requested.connect(_on_comment_insert_event_below.bind(comment))

func _create_group_block(data: FKGroupBlock) -> Control:
"""Create group block node from data."""
Expand Down Expand Up @@ -1178,10 +1182,15 @@ func _connect_group_signals(group) -> void:
group.condition_edit_requested.connect(_on_condition_edit_requested)
group.action_edit_requested.connect(_on_action_edit_requested)
group.insert_event_below_requested.connect(func(row): _on_row_insert_below(row, row))
group.insert_event_above_requested.connect(func(target): _on_comment_insert_event_above(target, target))
group.insert_comment_below_requested.connect(func(row): _on_row_insert_comment_below(row, row))
group.insert_comment_above_requested.connect(func(target): _on_comment_insert_above(target, target))
group.replace_event_requested.connect(func(row): _on_row_replace(row, row))
group.edit_event_requested.connect(func(row): _on_row_edit(row, row))
group.add_condition_requested.connect(func(row): _on_row_add_condition(row, row))
group.add_action_requested.connect(func(row): _on_row_add_action(row, row))
group.condition_dropped.connect(_on_condition_dropped)
group.action_dropped.connect(_on_action_dropped)

func _on_group_add_event_requested(group_node) -> void:
"""Handle request to add an event inside a group."""
Expand Down Expand Up @@ -1256,6 +1265,7 @@ func _on_add_group_button_pressed() -> void:

func _connect_event_row_signals(row) -> void:
row.insert_event_below_requested.connect(_on_row_insert_below.bind(row))
row.insert_comment_below_requested.connect(_on_row_insert_comment_below.bind(row))
row.replace_event_requested.connect(_on_row_replace.bind(row))
row.delete_event_requested.connect(_on_row_delete.bind(row))
row.edit_event_requested.connect(_on_row_edit.bind(row))
Expand Down Expand Up @@ -1416,6 +1426,45 @@ func _on_comment_delete(comment) -> void:
comment.queue_free()
_save_sheet()

func _on_comment_insert_above(signal_node, bound_comment) -> void:
"""Insert a new comment above the specified comment."""
_insert_comment_relative_to(bound_comment, 0)

func _on_comment_insert_below(signal_node, bound_comment) -> void:
"""Insert a new comment below the specified comment."""
_insert_comment_relative_to(bound_comment, 1)

func _on_comment_insert_event_above(signal_node, bound_comment) -> void:
"""Insert a new event above the specified comment."""
pending_target_row = bound_comment
_start_add_workflow("event_above_target", bound_comment)

func _on_comment_insert_event_below(signal_node, bound_comment) -> void:
"""Insert a new event below the specified comment."""
pending_target_row = bound_comment
_start_add_workflow("event", bound_comment)

func _on_row_insert_comment_below(signal_row, bound_row) -> void:
"""Insert a new comment below the specified event row."""
_insert_comment_relative_to(bound_row, 1)

func _insert_comment_relative_to(target_block, offset: int) -> void:
"""Insert a new comment relative to a target block (0 = above, 1 = below)."""
_push_undo_state()

var data = FKCommentBlock.new()
data.text = ""

var comment = _create_comment_block(data)
blocks_container.add_child(comment)

# Calculate insert position
var insert_idx = target_block.get_index() + offset
blocks_container.move_child(comment, insert_idx)

_show_content_state()
_save_sheet()

func _on_condition_selected_in_row(condition_node) -> void:
"""Handle condition item selection."""
# Deselect previous row
Expand Down Expand Up @@ -1503,6 +1552,8 @@ func _on_event_selected(node_path: String, event_id: String, inputs: Array) -> v
_replace_event({})
elif pending_block_type == "event_in_group":
_finalize_event_in_group({})
elif pending_block_type == "event_above_target":
_finalize_event_above_target({})
else:
_finalize_event_creation({})

Expand Down Expand Up @@ -1543,6 +1594,8 @@ func _on_expressions_confirmed(_node_path: String, _id: String, expressions: Dic
_finalize_event_creation(expressions)
"event_in_group":
_finalize_event_in_group(expressions)
"event_above_target":
_finalize_event_above_target(expressions)
"condition":
_finalize_condition_creation(expressions)
"action":
Expand Down Expand Up @@ -1585,6 +1638,31 @@ func _finalize_event_creation(inputs: Dictionary) -> void:
_save_sheet()


func _finalize_event_above_target(inputs: Dictionary) -> void:
"""Create and add event row above the target (GDevelop-style)."""
# Push undo state before adding event
_push_undo_state()

# Generate new block_id for new events (pass empty string to auto-generate)
var data = FKEventBlock.new("", pending_id, pending_node_path)
data.inputs = inputs
data.conditions = [] as Array[FKEventCondition]
data.actions = [] as Array[FKEventAction]

var row = _create_event_row(data)

if pending_target_row:
var insert_idx = pending_target_row.get_index() # Insert at same position (above)
blocks_container.add_child(row)
blocks_container.move_child(row, insert_idx)
else:
blocks_container.add_child(row)

_show_content_state()
_reset_workflow()
_save_sheet()


func _finalize_event_in_group(inputs: Dictionary) -> void:
"""Create and add event inside a group."""
if not pending_target_group:
Expand Down
28 changes: 24 additions & 4 deletions addons/flowkit/ui/workspace/comment.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ extends MarginContainer
signal selected(comment_node)
signal delete_requested
signal data_changed
signal insert_comment_above_requested(comment_node)
signal insert_comment_below_requested(comment_node)
signal insert_event_above_requested(comment_node)
signal insert_event_below_requested(comment_node)

var comment_data: FKCommentBlock
var is_selected: bool = false
Expand Down Expand Up @@ -170,15 +174,31 @@ func _gui_input(event: InputEvent) -> void:

func _show_context_menu(pos: Vector2) -> void:
var menu = PopupMenu.new()
menu.add_item("Insert Event Above", 10)
menu.add_item("Insert Event Below", 11)
menu.add_separator()
menu.add_item("Insert Comment Above", 12)
menu.add_item("Insert Comment Below", 13)
menu.add_separator()
menu.add_item("Edit Comment", 1)
menu.add_separator()
menu.add_item("Delete Comment", 0)
add_child(menu)
menu.position = Vector2i(pos)
menu.popup()
menu.id_pressed.connect(func(id):
if id == 0:
delete_requested.emit()
elif id == 1:
_set_edit_mode()
match id:
0:
delete_requested.emit()
1:
_set_edit_mode()
10:
insert_event_above_requested.emit(self)
11:
insert_event_below_requested.emit(self)
12:
insert_comment_above_requested.emit(self)
13:
insert_comment_below_requested.emit(self)
menu.queue_free()
)
5 changes: 5 additions & 0 deletions addons/flowkit/ui/workspace/event_row.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
extends MarginContainer

signal insert_event_below_requested(event_row)
signal insert_comment_below_requested(event_row)
signal replace_event_requested(event_row)
signal delete_event_requested(event_row)
signal edit_event_requested(event_row)
Expand Down Expand Up @@ -100,6 +101,8 @@ func _on_gui_input(event: InputEvent) -> void:
if context_menu:
context_menu.clear()
context_menu.add_item("Add Event Below", 0)
context_menu.add_item("Add Comment Below", 4)
context_menu.add_separator()
context_menu.add_item("Replace Event", 1)
context_menu.add_item("Edit Event", 2)
context_menu.add_separator()
Expand Down Expand Up @@ -156,6 +159,8 @@ func _on_context_menu_id_pressed(id: int) -> void:
edit_event_requested.emit(self)
3: # Delete Event
delete_event_requested.emit(self)
4: # Add Comment Below
insert_comment_below_requested.emit(self)

func set_event_data(data: FKEventBlock) -> void:
event_data = data
Expand Down
Loading