Skip to content

Commit

Permalink
Merge pull request #190 from endlessm/prepare-data-model
Browse files Browse the repository at this point in the history
Prepare data model for UI decoupling
  • Loading branch information
manuq authored Aug 9, 2024
2 parents 55acc2d + e7debbb commit b11b95e
Show file tree
Hide file tree
Showing 36 changed files with 550 additions and 14 deletions.
16 changes: 16 additions & 0 deletions addons/block_code/blocks/communication/add_node_to_group.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://bpvefei72nh3a"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_5qal7"]

[resource]
script = ExtResource("1_5qal7")
name = &"add_node_to_group"
description = "Add the node into the group"
category = "Communication | Groups"
type = 2
variant_type = 0
display_template = "Add {node: OBJECT} to group {group: STRING}"
code_template = "{node}.add_to_group({group})"
defaults = {}
signal_name = ""
scope = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/communication/add_to_group.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://bvrmau8atjx1x"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_bcm71"]

[resource]
script = ExtResource("1_bcm71")
name = &"add_to_group"
type = 2
variant_type = 0
display_template = "Add to group {group: STRING}"
code_template = "add_to_group({group})"
description = "Add this node into the group"
category = "Communication | Groups"
defaults = {}
signal_name = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/communication/call_method_group.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://c15vtdfihdxb8"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_mlm68"]

[resource]
script = ExtResource("1_mlm68")
name = &"call_method_group"
type = 2
variant_type = 0
display_template = "Call method {method_name: STRING} in group {group: STRING}"
code_template = "get_tree().call_group({group}, {method_name})"
description = "Calls the method/function on each member of the given group"
category = "Communication | Methods"
defaults = {}
signal_name = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/communication/call_method_node.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://c04j5flmimjvf"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_pg363"]

[resource]
script = ExtResource("1_pg363")
name = &"call_method_node"
type = 2
variant_type = 0
display_template = "Call method {method_name: STRING} on node {node: OBJECT}"
code_template = "{node}.call({method_name})"
description = "Calls the method/function of the given node"
category = "Communication | Methods"
defaults = {}
signal_name = ""
16 changes: 16 additions & 0 deletions addons/block_code/blocks/communication/define_method.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://7r2b2griss3i"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_6e473"]

[resource]
script = ExtResource("1_6e473")
name = &"define_method"
description = "Define a method/function with following code_templates"
category = "Communication | Methods"
type = 1
variant_type = 0
display_template = "Define method {method_name: NIL}"
code_template = "func {method_name}():"
defaults = {}
signal_name = ""
scope = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/communication/is_in_group.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://q4cnstftvsiu"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_tjyq5"]

[resource]
script = ExtResource("1_tjyq5")
name = &"is_in_group"
description = "Is this node in the group"
category = "Communication | Groups"
type = 3
variant_type = 1
display_template = "Is in group {group: STRING}"
code_template = "is_in_group({group})"
defaults = {}
signal_name = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/communication/is_node_in_group.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://bbtdxeey74x67"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_5krrs"]

[resource]
script = ExtResource("1_5krrs")
name = &"is_node_in_group"
description = "Is the node in the group"
category = "Communication | Groups"
type = 3
variant_type = 1
display_template = "Is {node: OBJECT} in group {group: STRING}"
code_template = "{node}.is_in_group({group})"
defaults = {}
signal_name = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/communication/remove_from_group.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://dgenw5wyqorvq"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_cdwef"]

[resource]
script = ExtResource("1_cdwef")
name = &"remove_from_group"
type = 2
variant_type = 0
display_template = "Remove from group {group: STRING}"
code_template = "remove_from_group({group})"
description = "Remove this node from the group"
category = "Communication | Groups"
defaults = {}
signal_name = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/communication/remove_node_from_group.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://b2dwk77hnri8y"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_pec24"]

[resource]
script = ExtResource("1_pec24")
name = &"remove_node_from_group"
type = 2
variant_type = 0
display_template = "Remove {node: OBJECT} from group {group: STRING}"
code_template = "{node}.remove_from_group({group})"
description = "Remove the node from the group"
category = "Communication | Groups"
defaults = {}
signal_name = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/lifecycle/physics_process.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://bxl7n4tkf1mvd"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_s0hq0"]

[resource]
script = ExtResource("1_s0hq0")
name = &"physics_process"
type = 1
variant_type = 0
display_template = "On Physics Process"
code_template = "func _physics_process(delta):"
description = "The following will be executed during the \"physics\" processing step of the main loop"
category = "Lifecycle"
defaults = {}
signal_name = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/lifecycle/process.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://chioedvp50013"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_pmina"]

[resource]
script = ExtResource("1_pmina")
name = &"process"
type = 1
variant_type = 0
display_template = "On Process"
code_template = "func _process(delta):"
description = "The following will be executed during the processing step of the main loop"
category = "Lifecycle"
defaults = {}
signal_name = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/lifecycle/queue_free.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://4hj5b3xaiuy8"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_75fle"]

[resource]
script = ExtResource("1_75fle")
name = &"queue_free"
type = 2
variant_type = 0
display_template = "Queue Free"
code_template = "queue_free()"
description = "Queues this node to be deleted at the end of the current frame"
category = "Lifecycle"
defaults = {}
signal_name = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/lifecycle/ready.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://dgwfoepoejlom"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_vk0xk"]

[resource]
script = ExtResource("1_vk0xk")
name = &"ready"
type = 1
variant_type = 0
display_template = "On Ready"
code_template = "func _ready():"
description = "The following will be executed when the node is \"ready\""
category = "Lifecycle"
defaults = {}
signal_name = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/log/concat.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://cb6ux0amdhhlw"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_lstbo"]

[resource]
script = ExtResource("1_lstbo")
name = &"concat"
description = ""
category = "Log"
type = 3
variant_type = 4
display_template = "{string1: STRING} + {string2: STRING}"
code_template = "{string1} + {string2}"
defaults = {}
signal_name = ""
16 changes: 16 additions & 0 deletions addons/block_code/blocks/log/print.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://barxsapb8tl0r"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_0lih2"]

[resource]
script = ExtResource("1_0lih2")
name = &"print"
description = "Print the text to output"
category = "Log"
type = 2
variant_type = 0
display_template = "Print {text: STRING}"
code_template = "print({text})"
defaults = {}
signal_name = ""
scope = ""
16 changes: 16 additions & 0 deletions addons/block_code/blocks/logic/and.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://d0g11cp3ff81i"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="2_lxlcw"]

[resource]
script = ExtResource("2_lxlcw")
name = &"and"
description = ""
category = "Logic | Boolean"
type = 3
variant_type = 1
display_template = "{bool1: BOOL} and {bool2: BOOL}"
code_template = "{bool1} and {bool2}"
defaults = {}
signal_name = ""
scope = ""
24 changes: 24 additions & 0 deletions addons/block_code/blocks/logic/compare.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[gd_resource type="Resource" load_steps=4 format=3 uid="uid://pr5wnn3ltkbo"]

[ext_resource type="Script" path="res://addons/block_code/ui/block_canvas/option_data.gd" id="1_hcv2h"]
[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_wp40r"]

[sub_resource type="Resource" id="Resource_ie4sg"]
script = ExtResource("1_hcv2h")
selected = 0
items = ["==", ">", "<", ">=", "<=", "!="]

[resource]
script = ExtResource("1_wp40r")
name = &"compare"
description = ""
category = "Logic | Comparison"
type = 3
variant_type = 1
display_template = "{float1: FLOAT} {op: OPTION} {float2: FLOAT}"
code_template = "{float1} {op} {float2}"
defaults = {
"op": SubResource("Resource_ie4sg")
}
signal_name = ""
scope = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/logic/else.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://dpgx8j3veifgl"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_x816c"]

[resource]
script = ExtResource("1_x816c")
name = &"else"
type = 4
variant_type = 0
display_template = "Else"
code_template = "else:"
description = ""
category = "Logic | Conditionals"
defaults = {}
signal_name = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/logic/else_if.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://by53vmmn3wtny"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_kgjks"]

[resource]
script = ExtResource("1_kgjks")
name = &"else_if"
type = 4
variant_type = 0
display_template = "Else if {condition: BOOL}"
code_template = "elif {condition}:"
description = ""
category = "Logic | Conditionals"
defaults = {}
signal_name = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/logic/if.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://cxvoo3jassq8c"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_c6ly3"]

[resource]
script = ExtResource("1_c6ly3")
name = &"if"
type = 4
variant_type = 0
display_template = "If {condition: BOOL}"
code_template = "if {condition}:"
description = ""
category = "Logic | Conditionals"
defaults = {}
signal_name = ""
16 changes: 16 additions & 0 deletions addons/block_code/blocks/logic/not.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://d6asv53q6ok8"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_6igv6"]

[resource]
script = ExtResource("1_6igv6")
name = &"not"
description = ""
category = "Logic | Boolean"
type = 3
variant_type = 1
display_template = "Not {bool: BOOL}"
code_template = "not {bool}"
defaults = {}
signal_name = ""
scope = ""
16 changes: 16 additions & 0 deletions addons/block_code/blocks/logic/or.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://cyu2tntoqf85m"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_oets3"]

[resource]
script = ExtResource("1_oets3")
name = &"or"
description = ""
category = "Logic | Boolean"
type = 3
variant_type = 1
display_template = "{bool1: BOOL} or {bool2: BOOL}"
code_template = "{bool1} or {bool2}"
defaults = {}
signal_name = ""
scope = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/loops/break.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://dwteydig4c6hi"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_4rhsl"]

[resource]
script = ExtResource("1_4rhsl")
name = &"break"
type = 2
variant_type = 0
display_template = "Break"
code_template = "break"
description = ""
category = "Loops"
defaults = {}
signal_name = ""
15 changes: 15 additions & 0 deletions addons/block_code/blocks/loops/continue.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://srm0bee85n0d"]

[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_junev"]

[resource]
script = ExtResource("1_junev")
name = &"continue"
type = 2
variant_type = 0
display_template = "Continue"
code_template = "continue"
description = ""
category = "Loops"
defaults = {}
signal_name = ""
Loading

0 comments on commit b11b95e

Please sign in to comment.