From 224f4c46c570805e93be1ae3a3d220e4a6741fbc Mon Sep 17 00:00:00 2001 From: User <> Date: Sun, 3 Sep 2017 14:13:21 +0200 Subject: [PATCH] added blocks, templates, unifcation, basic preview pane --- Project3.project.gmx | 175 +++ help.rtf | 4 + objects/Debug.object.gmx | 358 ++++++ objects/TypeParser.object.gmx | 233 ++++ objects/blueprint/AnchorTemplate.object.gmx | 106 ++ objects/blueprint/BlockTemplate.object.gmx | 178 +++ objects/blueprint/HigherOrderLink.object.gmx | 100 ++ objects/blueprint/InputTemplate.object.gmx | 23 + objects/blueprint/OneUse.object.gmx | 23 + objects/blueprint/OutputTemplate.object.gmx | 23 + objects/blueprint/ParameterLink.object.gmx | 74 ++ objects/generic/Draggable.object.gmx | 508 ++++++++ objects/generic/Error.object.gmx | 23 + objects/generic/MaximizeView.object.gmx | 226 ++++ .../MultitouchEventGenerator.object.gmx | 274 +++++ objects/generic/OrderedTree.object.gmx | 122 ++ objects/generic/scene/SceneNode.object.gmx | 685 +++++++++++ .../scene/SpritelessSceneNode.object.gmx | 328 +++++ objects/scene/PreviewPane.object.gmx | 237 ++++ objects/scene/blocks/Anchor.object.gmx | 311 +++++ objects/scene/blocks/Block.object.gmx | 1050 +++++++++++++++++ objects/scene/blocks/Connection.object.gmx | 289 +++++ .../scene/blocks/ConnectionDrain.object.gmx | 115 ++ objects/scene/blocks/ConnectionEnd.object.gmx | 798 +++++++++++++ .../scene/blocks/ConnectionSource.object.gmx | 115 ++ objects/scene/blocks/InputAnchor.object.gmx | 475 ++++++++ objects/scene/blocks/OutputAnchor.object.gmx | 539 +++++++++ .../types/ConcreteTypeInstance.object.gmx | 23 + .../scene/types/FreeTypeInstance.object.gmx | 23 + .../types/FunctionTypeInstance.object.gmx | 40 + .../scene/types/ParametricInstance.object.gmx | 107 ++ objects/scene/types/TraitInstance.object.gmx | 23 + .../scene/types/TypeCon1Instance.object.gmx | 172 +++ .../scene/types/TypeConInstance.object.gmx | 226 ++++ objects/types/ConcreteType.object.gmx | 64 + objects/types/FreeType.object.gmx | 64 + objects/types/FunctionType.object.gmx | 64 + objects/types/Parametric.object.gmx | 102 ++ objects/types/Trait.object.gmx | 89 ++ objects/types/Type.object.gmx | 89 ++ objects/types/TypeCon1Link.object.gmx | 64 + objects/types/TypeConLink.object.gmx | 123 ++ rooms/room0.room.gmx | 151 +++ scripts/blocks/blockFromTemplate.gml | 19 + scripts/blocks/createBlock.gml | 36 + scripts/blocks/createTypeInstance.gml | 36 + scripts/blocks/detachConnectionEnd.gml | 47 + scripts/blocks/getBlockCluster.gml | 41 + scripts/blocks/getConnectionsForCluster.gml | 20 + scripts/blocks/layoutCluster.gml | 27 + scripts/debug/sceneNodeToString.gml | 29 + scripts/debug/typesToDot.gml | 112 ++ scripts/generic/assert.gml | 13 + scripts/generic/assertInstanceof.gml | 17 + scripts/generic/cancelTouchEvent.gml | 9 + scripts/generic/delete.gml | 12 + scripts/generic/format.gml | 107 ++ scripts/generic/getInstObjName.gml | 36 + scripts/generic/hermite.gml | 17 + scripts/generic/instanceof.gml | 23 + scripts/generic/new.gml | 12 + scripts/generic/performAs.gml | 11 + scripts/generic/string_base.gml | 39 + scripts/graph/addLink.gml | 19 + scripts/graph/removeLink.gml | 21 + scripts/graph/replaceLink.gml | 26 + scripts/scene/layout.gml | 14 + scripts/scene/setMargin.gml | 20 + scripts/scene/setPadding.gml | 20 + scripts/set/ds_set_add.gml | 13 + scripts/set/ds_set_add_all.gml | 16 + scripts/set/ds_set_choose.gml | 18 + scripts/set/ds_set_clear.gml | 10 + scripts/set/ds_set_copy.gml | 11 + scripts/set/ds_set_create.gml | 10 + scripts/set/ds_set_delete.gml | 17 + scripts/set/ds_set_destroy.gml | 10 + scripts/set/ds_set_empty.gml | 11 + scripts/set/ds_set_exists.gml | 12 + scripts/set/ds_set_first.gml | 12 + scripts/set/ds_set_is_disjoint.gml | 20 + scripts/set/ds_set_is_equal.gml | 13 + scripts/set/ds_set_is_subset.gml | 20 + scripts/set/ds_set_last.gml | 12 + scripts/set/ds_set_next.gml | 12 + scripts/set/ds_set_previous.gml | 12 + scripts/set/ds_set_size.gml | 11 + scripts/treenode/addChild.gml | 13 + scripts/treenode/hasChild.gml | 13 + scripts/treenode/hasParentNode.gml | 17 + scripts/treenode/removeChild.gml | 13 + scripts/typing/copyType.gml | 38 + scripts/typing/freshTypes.gml | 117 ++ scripts/typing/getRandomType.gml | 32 + scripts/typing/removeType.gml | 31 + scripts/typing/setParameter.gml | 27 + scripts/typing/testUnify.gml | 111 ++ scripts/typing/unify.gml | 85 ++ scripts/typing/unifyAnchors.gml | 16 + sprites/images/pixel_0.png | Bin 0 -> 70 bytes sprites/mask/images/maskConnection_0.png | Bin 0 -> 162 bytes sprites/mask/maskConnection.sprite.gmx | 25 + sprites/pixel.sprite.gmx | 25 + .../placeholder/images/placeholderBlock_0.png | Bin 0 -> 162 bytes .../images/placeholderCircleType_0.png | Bin 0 -> 129 bytes .../placeholder/images/placeholderError_0.png | Bin 0 -> 143 bytes .../images/placeholderFunctionType_0.png | Bin 0 -> 133 bytes .../images/placeholderInputAnchorWhite_0.png | Bin 0 -> 97 bytes .../images/placeholderInputAnchor_0.png | Bin 0 -> 93 bytes .../images/placeholderJaggedLine_0.png | Bin 0 -> 166 bytes .../placeholder/images/placeholderLine_0.png | Bin 0 -> 113 bytes .../images/placeholderMonoType_0.png | Bin 0 -> 87 bytes .../images/placeholderOneUse_0.png | Bin 0 -> 81 bytes .../images/placeholderOrderLink_0.png | Bin 0 -> 108 bytes .../images/placeholderOutputAnchorWhite_0.png | Bin 0 -> 97 bytes .../images/placeholderOutputAnchor_0.png | Bin 0 -> 98 bytes .../placeholder/images/placeholderPane_0.png | Bin 0 -> 172 bytes .../images/placeholderParameter_0.png | Bin 0 -> 115 bytes .../images/placeholderParameter_1.png | Bin 0 -> 96 bytes .../images/placeholderParameter_2.png | Bin 0 -> 120 bytes .../images/placeholderParameter_3.png | Bin 0 -> 137 bytes .../images/placeholderParameter_4.png | Bin 0 -> 128 bytes .../images/placeholderParameter_5.png | Bin 0 -> 122 bytes .../images/placeholderParameter_6.png | Bin 0 -> 124 bytes .../images/placeholderParameter_7.png | Bin 0 -> 109 bytes .../images/placeholderParameter_8.png | Bin 0 -> 89 bytes .../images/placeholderParameter_9.png | Bin 0 -> 93 bytes .../images/placeholderTypeTrait_0.png | Bin 0 -> 111 bytes .../placeholder/images/placeholderType_0.png | Bin 0 -> 100 bytes .../images/placeholderVariableType_0.png | Bin 0 -> 125 bytes sprites/placeholder/images/placeholder_0.png | Bin 0 -> 157 bytes sprites/placeholder/placeholder.sprite.gmx | 25 + .../placeholder/placeholderBlock.sprite.gmx | 25 + .../placeholder/placeholderError.sprite.gmx | 25 + .../placeholderFunctionType.sprite.gmx | 25 + .../placeholderInputAnchor.sprite.gmx | 25 + .../placeholderInputAnchorWhite.sprite.gmx | 25 + .../placeholder/placeholderLine.sprite.gmx | 25 + .../placeholderMonoType.sprite.gmx | 25 + .../placeholder/placeholderOneUse.sprite.gmx | 25 + .../placeholderOrderLink.sprite.gmx | 25 + .../placeholderOutputAnchor.sprite.gmx | 25 + .../placeholderOutputAnchorWhite.sprite.gmx | 25 + .../placeholder/placeholderPane.sprite.gmx | 25 + .../placeholderParameter.sprite.gmx | 34 + .../placeholderTypeTrait.sprite.gmx | 25 + .../placeholderVariableType.sprite.gmx | 25 + 147 files changed, 10811 insertions(+) create mode 100644 Project3.project.gmx create mode 100644 help.rtf create mode 100644 objects/Debug.object.gmx create mode 100644 objects/TypeParser.object.gmx create mode 100644 objects/blueprint/AnchorTemplate.object.gmx create mode 100644 objects/blueprint/BlockTemplate.object.gmx create mode 100644 objects/blueprint/HigherOrderLink.object.gmx create mode 100644 objects/blueprint/InputTemplate.object.gmx create mode 100644 objects/blueprint/OneUse.object.gmx create mode 100644 objects/blueprint/OutputTemplate.object.gmx create mode 100644 objects/blueprint/ParameterLink.object.gmx create mode 100644 objects/generic/Draggable.object.gmx create mode 100644 objects/generic/Error.object.gmx create mode 100644 objects/generic/MaximizeView.object.gmx create mode 100644 objects/generic/MultitouchEventGenerator.object.gmx create mode 100644 objects/generic/OrderedTree.object.gmx create mode 100644 objects/generic/scene/SceneNode.object.gmx create mode 100644 objects/generic/scene/SpritelessSceneNode.object.gmx create mode 100644 objects/scene/PreviewPane.object.gmx create mode 100644 objects/scene/blocks/Anchor.object.gmx create mode 100644 objects/scene/blocks/Block.object.gmx create mode 100644 objects/scene/blocks/Connection.object.gmx create mode 100644 objects/scene/blocks/ConnectionDrain.object.gmx create mode 100644 objects/scene/blocks/ConnectionEnd.object.gmx create mode 100644 objects/scene/blocks/ConnectionSource.object.gmx create mode 100644 objects/scene/blocks/InputAnchor.object.gmx create mode 100644 objects/scene/blocks/OutputAnchor.object.gmx create mode 100644 objects/scene/types/ConcreteTypeInstance.object.gmx create mode 100644 objects/scene/types/FreeTypeInstance.object.gmx create mode 100644 objects/scene/types/FunctionTypeInstance.object.gmx create mode 100644 objects/scene/types/ParametricInstance.object.gmx create mode 100644 objects/scene/types/TraitInstance.object.gmx create mode 100644 objects/scene/types/TypeCon1Instance.object.gmx create mode 100644 objects/scene/types/TypeConInstance.object.gmx create mode 100644 objects/types/ConcreteType.object.gmx create mode 100644 objects/types/FreeType.object.gmx create mode 100644 objects/types/FunctionType.object.gmx create mode 100644 objects/types/Parametric.object.gmx create mode 100644 objects/types/Trait.object.gmx create mode 100644 objects/types/Type.object.gmx create mode 100644 objects/types/TypeCon1Link.object.gmx create mode 100644 objects/types/TypeConLink.object.gmx create mode 100644 rooms/room0.room.gmx create mode 100644 scripts/blocks/blockFromTemplate.gml create mode 100644 scripts/blocks/createBlock.gml create mode 100644 scripts/blocks/createTypeInstance.gml create mode 100644 scripts/blocks/detachConnectionEnd.gml create mode 100644 scripts/blocks/getBlockCluster.gml create mode 100644 scripts/blocks/getConnectionsForCluster.gml create mode 100644 scripts/blocks/layoutCluster.gml create mode 100644 scripts/debug/sceneNodeToString.gml create mode 100644 scripts/debug/typesToDot.gml create mode 100644 scripts/generic/assert.gml create mode 100644 scripts/generic/assertInstanceof.gml create mode 100644 scripts/generic/cancelTouchEvent.gml create mode 100644 scripts/generic/delete.gml create mode 100644 scripts/generic/format.gml create mode 100644 scripts/generic/getInstObjName.gml create mode 100644 scripts/generic/hermite.gml create mode 100644 scripts/generic/instanceof.gml create mode 100644 scripts/generic/new.gml create mode 100644 scripts/generic/performAs.gml create mode 100644 scripts/generic/string_base.gml create mode 100644 scripts/graph/addLink.gml create mode 100644 scripts/graph/removeLink.gml create mode 100644 scripts/graph/replaceLink.gml create mode 100644 scripts/scene/layout.gml create mode 100644 scripts/scene/setMargin.gml create mode 100644 scripts/scene/setPadding.gml create mode 100644 scripts/set/ds_set_add.gml create mode 100644 scripts/set/ds_set_add_all.gml create mode 100644 scripts/set/ds_set_choose.gml create mode 100644 scripts/set/ds_set_clear.gml create mode 100644 scripts/set/ds_set_copy.gml create mode 100644 scripts/set/ds_set_create.gml create mode 100644 scripts/set/ds_set_delete.gml create mode 100644 scripts/set/ds_set_destroy.gml create mode 100644 scripts/set/ds_set_empty.gml create mode 100644 scripts/set/ds_set_exists.gml create mode 100644 scripts/set/ds_set_first.gml create mode 100644 scripts/set/ds_set_is_disjoint.gml create mode 100644 scripts/set/ds_set_is_equal.gml create mode 100644 scripts/set/ds_set_is_subset.gml create mode 100644 scripts/set/ds_set_last.gml create mode 100644 scripts/set/ds_set_next.gml create mode 100644 scripts/set/ds_set_previous.gml create mode 100644 scripts/set/ds_set_size.gml create mode 100644 scripts/treenode/addChild.gml create mode 100644 scripts/treenode/hasChild.gml create mode 100644 scripts/treenode/hasParentNode.gml create mode 100644 scripts/treenode/removeChild.gml create mode 100644 scripts/typing/copyType.gml create mode 100644 scripts/typing/freshTypes.gml create mode 100644 scripts/typing/getRandomType.gml create mode 100644 scripts/typing/removeType.gml create mode 100644 scripts/typing/setParameter.gml create mode 100644 scripts/typing/testUnify.gml create mode 100644 scripts/typing/unify.gml create mode 100644 scripts/typing/unifyAnchors.gml create mode 100644 sprites/images/pixel_0.png create mode 100644 sprites/mask/images/maskConnection_0.png create mode 100644 sprites/mask/maskConnection.sprite.gmx create mode 100644 sprites/pixel.sprite.gmx create mode 100644 sprites/placeholder/images/placeholderBlock_0.png create mode 100644 sprites/placeholder/images/placeholderCircleType_0.png create mode 100644 sprites/placeholder/images/placeholderError_0.png create mode 100644 sprites/placeholder/images/placeholderFunctionType_0.png create mode 100644 sprites/placeholder/images/placeholderInputAnchorWhite_0.png create mode 100644 sprites/placeholder/images/placeholderInputAnchor_0.png create mode 100644 sprites/placeholder/images/placeholderJaggedLine_0.png create mode 100644 sprites/placeholder/images/placeholderLine_0.png create mode 100644 sprites/placeholder/images/placeholderMonoType_0.png create mode 100644 sprites/placeholder/images/placeholderOneUse_0.png create mode 100644 sprites/placeholder/images/placeholderOrderLink_0.png create mode 100644 sprites/placeholder/images/placeholderOutputAnchorWhite_0.png create mode 100644 sprites/placeholder/images/placeholderOutputAnchor_0.png create mode 100644 sprites/placeholder/images/placeholderPane_0.png create mode 100644 sprites/placeholder/images/placeholderParameter_0.png create mode 100644 sprites/placeholder/images/placeholderParameter_1.png create mode 100644 sprites/placeholder/images/placeholderParameter_2.png create mode 100644 sprites/placeholder/images/placeholderParameter_3.png create mode 100644 sprites/placeholder/images/placeholderParameter_4.png create mode 100644 sprites/placeholder/images/placeholderParameter_5.png create mode 100644 sprites/placeholder/images/placeholderParameter_6.png create mode 100644 sprites/placeholder/images/placeholderParameter_7.png create mode 100644 sprites/placeholder/images/placeholderParameter_8.png create mode 100644 sprites/placeholder/images/placeholderParameter_9.png create mode 100644 sprites/placeholder/images/placeholderTypeTrait_0.png create mode 100644 sprites/placeholder/images/placeholderType_0.png create mode 100644 sprites/placeholder/images/placeholderVariableType_0.png create mode 100644 sprites/placeholder/images/placeholder_0.png create mode 100644 sprites/placeholder/placeholder.sprite.gmx create mode 100644 sprites/placeholder/placeholderBlock.sprite.gmx create mode 100644 sprites/placeholder/placeholderError.sprite.gmx create mode 100644 sprites/placeholder/placeholderFunctionType.sprite.gmx create mode 100644 sprites/placeholder/placeholderInputAnchor.sprite.gmx create mode 100644 sprites/placeholder/placeholderInputAnchorWhite.sprite.gmx create mode 100644 sprites/placeholder/placeholderLine.sprite.gmx create mode 100644 sprites/placeholder/placeholderMonoType.sprite.gmx create mode 100644 sprites/placeholder/placeholderOneUse.sprite.gmx create mode 100644 sprites/placeholder/placeholderOrderLink.sprite.gmx create mode 100644 sprites/placeholder/placeholderOutputAnchor.sprite.gmx create mode 100644 sprites/placeholder/placeholderOutputAnchorWhite.sprite.gmx create mode 100644 sprites/placeholder/placeholderPane.sprite.gmx create mode 100644 sprites/placeholder/placeholderParameter.sprite.gmx create mode 100644 sprites/placeholder/placeholderTypeTrait.sprite.gmx create mode 100644 sprites/placeholder/placeholderVariableType.sprite.gmx diff --git a/Project3.project.gmx b/Project3.project.gmx new file mode 100644 index 0000000..d57226a --- /dev/null +++ b/Project3.project.gmx @@ -0,0 +1,175 @@ + + + + Configs\Default + + + + + sprites\pixel + + sprites\placeholder\placeholder + sprites\placeholder\placeholderBlock + sprites\placeholder\placeholderInputAnchor + sprites\placeholder\placeholderInputAnchorWhite + sprites\placeholder\placeholderOutputAnchor + sprites\placeholder\placeholderOutputAnchorWhite + sprites\placeholder\placeholderVariableType + sprites\placeholder\placeholderMonoType + sprites\placeholder\placeholderFunctionType + sprites\placeholder\placeholderTypeTrait + sprites\placeholder\placeholderParameter + sprites\placeholder\placeholderError + sprites\placeholder\placeholderLine + sprites\placeholder\placeholderOrderLink + sprites\placeholder\placeholderPane + sprites\placeholder\placeholderOneUse + + + sprites\mask\maskConnection + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + objects\generic\scene\SceneNode + objects\generic\scene\SpritelessSceneNode + + objects\generic\Draggable + objects\generic\Error + objects\generic\MaximizeView + objects\generic\MultitouchEventGenerator + objects\generic\OrderedTree + + + objects\types\ConcreteType + objects\types\FreeType + objects\types\FunctionType + objects\types\Parametric + objects\types\Trait + objects\types\Type + objects\types\TypeCon1Link + objects\types\TypeConLink + + + + objects\scene\types\ConcreteTypeInstance + objects\scene\types\FreeTypeInstance + objects\scene\types\FunctionTypeInstance + objects\scene\types\ParametricInstance + objects\scene\types\TraitInstance + objects\scene\types\TypeCon1Instance + objects\scene\types\TypeConInstance + + + objects\scene\blocks\Anchor + objects\scene\blocks\Block + objects\scene\blocks\Connection + objects\scene\blocks\ConnectionDrain + objects\scene\blocks\ConnectionEnd + objects\scene\blocks\ConnectionSource + objects\scene\blocks\InputAnchor + objects\scene\blocks\OutputAnchor + + objects\scene\PreviewPane + + + objects\blueprint\AnchorTemplate + objects\blueprint\BlockTemplate + objects\blueprint\HigherOrderLink + objects\blueprint\InputTemplate + objects\blueprint\OneUse + objects\blueprint\OutputTemplate + objects\blueprint\ParameterLink + + objects\Debug + objects\TypeParser + + + rooms\room0 + + + help.rtf + + + 0 + + 0 + + diff --git a/help.rtf b/help.rtf new file mode 100644 index 0000000..7a1cc0b --- /dev/null +++ b/help.rtf @@ -0,0 +1,4 @@ +{\rtf1\ansi\ansicpg1252\deff0\deflang1043{\fonttbl{\f0\fnil\fcharset0 Arial;}} +{\colortbl ;\red0\green0\blue0;} +\viewkind4\uc1\pard\cf1\fs24\par +} diff --git a/objects/Debug.object.gmx b/objects/Debug.object.gmx new file mode 100644 index 0000000..99606f7 --- /dev/null +++ b/objects/Debug.object.gmx @@ -0,0 +1,358 @@ + + + <undefined> + 0 + 0 + 0 + 0 + <undefined> + <undefined> + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Build object tree +objectList = ds_list_create(); +objectNames = ds_map_create(); +var objects = ds_priority_create(); + +for (var obj = 0; obj < 200; obj++) + if (object_exists(obj)) { + var prio = obj; + for (var parent = object_get_parent(obj); object_exists(parent); parent = object_get_parent(parent)) + prio = parent+prio/200; + + ds_priority_add(objects, obj, prio); + } + +repeat (ds_priority_size(objects)) { + var obj = ds_priority_delete_min(objects); + + ds_list_add(objectList, obj); + + var dep = 0; + for (var parent = object_get_parent(obj); object_exists(parent); parent = object_get_parent(parent)) + dep++; + + objectNames[?obj] = string_repeat(" ", dep)+object_get_name(obj); +} + +ds_priority_destroy(objects); + + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ds_list_destroy(objectList); +ds_map_destroy(objectNames); + + + + + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + visible + + + 0 + DEBUG + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Initialize DEBUG value +globalvar DEBUG; +DEBUG = false; + + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Draw instance counts +var objs = ds_map_create(); + +with (all) + if (ds_map_exists(objs, self.object_index)) + objs[?self.object_index]++; + else + objs[?self.object_index] = 1; + +str = ""; + +for (var i = 0; i < ds_list_size(objectList); i++) { + var obj = objectList[|i]; + if (ds_map_exists(objs, obj)) + str += objectNames[?obj]+": "+string(objs[?obj])+"#"; +} + +ds_map_destroy(objs); + +draw_text(x, y, str); + + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Draw sprites of invisible objects +with (all) + if (!self.visible && sprite_exists(self.sprite_index)) + draw_self(); + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///highlight ParameterLink endpoints +var col = draw_get_colour(); +draw_set_colour(c_red); + +with (ParameterLink) + if (collision_point(mouse_x, mouse_y, id, true, false) != noone) { + with (self.source) + draw_rectangle(bbox_left, bbox_top, bbox_right, bbox_bottom, true); + with (self.drain) + draw_rectangle(bbox_left, bbox_top, bbox_right, bbox_bottom, true); + } + +draw_set_colour(col); + + + + + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + DEBUG + + + 0 + !DEBUG + + + + + + + 1 + 331 + 0 + 0 + 0 + 0 + 1 + action_restart_game + + self + 0 + 0 + + + + + 1 + 408 + 0 + 0 + -1 + -1 + 1 + action_if + + self + 0 + 0 + + + 0 + keyboard_check(vk_control) + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///copy type DOT to clipboard +clipboard_set_text(typesToDot()); + + + + + + + + + 1 + 332 + 0 + 0 + 0 + 0 + 1 + action_end_game + + self + 0 + 0 + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/TypeParser.object.gmx b/objects/TypeParser.object.gmx new file mode 100644 index 0000000..4ee6c0d --- /dev/null +++ b/objects/TypeParser.object.gmx @@ -0,0 +1,233 @@ + + + <undefined> + 0 + -1 + 0 + 0 + <undefined> + <undefined> + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + typeMap + + + 0 + ds_map_create() + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Create built-in types +root = new(TypeConLink); + +//functor = new(Trait); +function = new(TypeCon1Link); +function.type = new(FunctionType); +addLink(root, function); + + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Destroy typeMap +ds_map_destroy(typeMap); + + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Create free types +var types = ds_map_create(); + +with (FunctionType) + if (id != other.function.type) + other.typeMap[?id] = other.function; + +with (Parametric) + if (self.object_index == Parametric) { + var type = new(FreeType); + types[?id] = new(TypeCon1Link); + types[?id].type = type; + } + +with (ParameterLink) { + if (!instanceof(self.source, Trait)) + other.typeMap[?self.drain] = types[?self.source]; +} + +with (ParameterLink) { + if (instanceof(self.source, Trait)) { + var t1 = types[?self.drain]; + var t2 = t1.type; + var t3 = t2.traits; + ds_set_add(t3, self.source); + } +} + +ds_map_destroy(types); + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Call User 2 for all block templates +with (BlockTemplate) { + event_user(2); +} + + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Call User 2 +event_user(2); + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Create preview blocks for all templates +with (BlockTemplate) { + var preview = blockFromTemplate(id); + addChild(PreviewPane.id, preview); +} + +layout(PreviewPane); + + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/blueprint/AnchorTemplate.object.gmx b/objects/blueprint/AnchorTemplate.object.gmx new file mode 100644 index 0000000..1abf8e2 --- /dev/null +++ b/objects/blueprint/AnchorTemplate.object.gmx @@ -0,0 +1,106 @@ + + + placeholder + 0 + 0 + 0 + 0 + <undefined> + <undefined> + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + con + + + 0 + noone + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Find type root and call User 2 recursively +var links = ds_priority_create(); +var block = noone; + +with (BlockTemplate) + if (place_meeting(self.x, self.y, other)) + block = id; + +with (HigherOrderLink) + if (place_meeting(self.x, self.y, block)) + if (instance_nearest(self.x, self.y, AnchorTemplate) == other.id) + ds_priority_add(links, id, self.x); + +if (ds_priority_empty(links)) + with (Type) + if (place_meeting(self.x, self.y, block)) + if (instance_nearest(self.x, self.y, AnchorTemplate) == other.id) + ds_priority_add(links, id, self.x); + +assert(!ds_priority_empty(links), "No type found for anchor "+getInstObjName(id)); + +var root = ds_priority_delete_min(links); +ds_priority_destroy(links); + +with (root) + event_user(2); + +if (instanceof(root, Type)) { + with (TypeParser) + other.con = self.typeMap[?root]; +} +else + self.con = root.con; + + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/blueprint/BlockTemplate.object.gmx b/objects/blueprint/BlockTemplate.object.gmx new file mode 100644 index 0000000..27f2ff9 --- /dev/null +++ b/objects/blueprint/BlockTemplate.object.gmx @@ -0,0 +1,178 @@ + + + placeholderBlock + 0 + 0 + 2 + 0 + <undefined> + <undefined> + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + inputs + + + 0 + ds_list_create() + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + outputs + + + 0 + ds_list_create() + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + allowedUses + + + 0 + 1 + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Count number of allowed uses of this template +var uses = 0; + +with (OneUse) { + if (place_meeting(x, y, other)) + uses++; +} + +if (uses > 0) + allowedUses = uses; + + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Find anchors, call User 2 recursively, attach inputs and outputs +var anchors = ds_priority_create(); + +with (InputTemplate) { + if (place_meeting(self.x, self.y, other)) + ds_priority_add(anchors, id, self.x); +} + +with (OutputTemplate) { + if (place_meeting(self.x, self.y, other)) + ds_priority_add(anchors, id, self.x); +} + +repeat (ds_priority_size(anchors)) { + var anchor = ds_priority_delete_min(anchors); + with (anchor) + event_user(2); + + with (TypeParser) + addLink(self.root, anchor.con); + + if (instanceof(anchor, InputTemplate)) + ds_list_add(self.inputs, anchor.con); + else + ds_list_add(self.outputs, anchor.con); +} + + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/blueprint/HigherOrderLink.object.gmx b/objects/blueprint/HigherOrderLink.object.gmx new file mode 100644 index 0000000..ff56140 --- /dev/null +++ b/objects/blueprint/HigherOrderLink.object.gmx @@ -0,0 +1,100 @@ + + + placeholderOrderLink + 0 + 0 + 1 + 0 + <undefined> + <undefined> + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + con + + + 0 + new(TypeConLink) + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Find con arguments, call User 2 recursively, build con +var links = ds_priority_create(); +var myCon = self.con; + +with (Type) + if (place_meeting(self.x, self.y, other)) + ds_priority_add(links, id, self.x); + +with (HigherOrderLink) + if (id != other.id && self.x > other.x && place_meeting(self.x, self.y, other)) + ds_priority_add(links, id, self.x); + +repeat (ds_priority_size(links)) { + with (ds_priority_delete_min(links)) { + event_user(2); + + if (instanceof(id, Type)) { + var t = id; + with (TypeParser) + addLink(myCon, self.typeMap[?t]); + } + else + addLink(other.con, self.con); + } +} + +ds_priority_destroy(links); + + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/blueprint/InputTemplate.object.gmx b/objects/blueprint/InputTemplate.object.gmx new file mode 100644 index 0000000..66103ee --- /dev/null +++ b/objects/blueprint/InputTemplate.object.gmx @@ -0,0 +1,23 @@ + + + placeholderInputAnchor + 0 + 0 + 0 + 0 + AnchorTemplate + <undefined> + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/blueprint/OneUse.object.gmx b/objects/blueprint/OneUse.object.gmx new file mode 100644 index 0000000..5f842d6 --- /dev/null +++ b/objects/blueprint/OneUse.object.gmx @@ -0,0 +1,23 @@ + + + placeholderOneUse + 0 + 0 + 0 + 0 + <undefined> + <undefined> + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/blueprint/OutputTemplate.object.gmx b/objects/blueprint/OutputTemplate.object.gmx new file mode 100644 index 0000000..5cddb79 --- /dev/null +++ b/objects/blueprint/OutputTemplate.object.gmx @@ -0,0 +1,23 @@ + + + placeholderOutputAnchor + 0 + 0 + 0 + 0 + AnchorTemplate + <undefined> + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/blueprint/ParameterLink.object.gmx b/objects/blueprint/ParameterLink.object.gmx new file mode 100644 index 0000000..4cfa07b --- /dev/null +++ b/objects/blueprint/ParameterLink.object.gmx @@ -0,0 +1,74 @@ + + + placeholderLine + 0 + 0 + 1 + 0 + <undefined> + <undefined> + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + source + + + 0 + collision_point(x, y, Parametric, false, true) + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + drain + + + 0 + collision_point(x+lengthdir_x(sprite_width, image_angle), y+lengthdir_y(sprite_width, image_angle), Parametric, false, true) + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/generic/Draggable.object.gmx b/objects/generic/Draggable.object.gmx new file mode 100644 index 0000000..99c6d2f --- /dev/null +++ b/objects/generic/Draggable.object.gmx @@ -0,0 +1,508 @@ + + + <undefined> + 0 + -1 + 0 + 0 + <undefined> + <undefined> + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + mid + + + 0 + -2 + + + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + touch_id + + + 0 + 0 + + + 4 + 4 + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + touch_id + + + 0 + mid + + + 4 + 0 + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + mid + + + 0 + -2 + + + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + touch_id + + + 0 + 0 + + + 4 + 4 + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + touch_id + + + 0 + mid + + + 4 + 0 + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + xoffset + + + 0 + touch_x-dx + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + yoffset + + + 0 + touch_y-dy + + + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + touch_id + + + 0 + 0 + + + 4 + 4 + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + mid + + + 0 + 0 + + + 4 + 1 + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + mid + + + 0 + touch_id + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + dx + + + 0 + touch_x-xoffset + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + dy + + + 0 + touch_y-yoffset + + + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/generic/Error.object.gmx b/objects/generic/Error.object.gmx new file mode 100644 index 0000000..698f84b --- /dev/null +++ b/objects/generic/Error.object.gmx @@ -0,0 +1,23 @@ + + + placeholderError + 0 + -1 + 0 + 0 + <undefined> + <undefined> + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/generic/MaximizeView.object.gmx b/objects/generic/MaximizeView.object.gmx new file mode 100644 index 0000000..17b8cfa --- /dev/null +++ b/objects/generic/MaximizeView.object.gmx @@ -0,0 +1,226 @@ + + + <undefined> + 0 + -1 + 0 + -1 + <undefined> + <undefined> + + + + 1 + 109 + 0 + -1 + 0 + -1 + 1 + action_move_to + + self + 0 + 0 + + + 0 + view_wview[0] + + + 0 + view_hview[0] + + + + + + + 1 + 408 + 0 + 0 + -1 + -1 + 1 + action_if + + self + 0 + 0 + + + 0 + window_get_width() > 0 and window_get_height() > 0 + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 109 + 0 + -1 + 0 + -1 + 1 + action_move_to + + self + 0 + 0 + + + 0 + window_get_width() + + + 0 + window_get_height() + + + + + 1 + 408 + 0 + 0 + -1 + -1 + 1 + action_if + + self + 0 + -1 + + + 0 + x == xprevious and y == yprevious + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Set view and application surface to the window size +view_wview[0] = x; +view_hview[0] = y; +view_wport[0] = x; +view_hport[0] = y; + +surface_resize(application_surface, x, y); + + + + + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + + + 1 + 109 + 0 + -1 + 0 + -1 + 1 + action_move_to + + self + 0 + 0 + + + 0 + window_get_width() + + + 0 + window_get_height() + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Set view and application surface to the window size +view_wview[0] = x; +view_hview[0] = y; +view_wport[0] = x; +view_hport[0] = y; + +surface_resize(application_surface, x, y); + + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/generic/MultitouchEventGenerator.object.gmx b/objects/generic/MultitouchEventGenerator.object.gmx new file mode 100644 index 0000000..09b6518 --- /dev/null +++ b/objects/generic/MultitouchEventGenerator.object.gmx @@ -0,0 +1,274 @@ + + + <undefined> + 0 + 0 + 0 + -1 + <undefined> + <undefined> + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + global.touch_id + + + 0 + -1 + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + global.touch_x + + + 0 + 0 + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + global.touch_y + + + 0 + 0 + + + + + 1 + 605 + 0 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + Remove if globalvar is deprecated and use global. qualifier in your project. + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Register touch_ variables as globalvars +globalvar touch_id, touch_x, touch_y; + + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Copy mouse_x, mouse_y to touch_x, touch_y +global.touch_x = mouse_x; +global.touch_y = mouse_y; + + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Fire mouse events for multiple mouse devices +for (var mid = 0; mid <= 4; mid++) { + global.touch_x = device_mouse_x(mid); + global.touch_y = device_mouse_y(mid); + + //Perform button press + global.touch_id = mid; + if (device_mouse_check_button_pressed(mid, mb_left)) + with (all) { + event_perform(ev_mouse, ev_global_left_press); + if (collision_point(device_mouse_x(mid), device_mouse_y(mid), id, true, false)) + event_perform(ev_mouse, ev_left_press); + } + + global.touch_id = mid; + if (device_mouse_check_button_pressed(mid, mb_right)) + with (all) { + event_perform(ev_mouse, ev_global_right_press); + if (collision_point(device_mouse_x(mid), device_mouse_y(mid), id, true, false)) + event_perform(ev_mouse, ev_right_press); + } + + global.touch_id = mid; + if (device_mouse_check_button_pressed(mid, mb_middle)) + with (all) { + event_perform(ev_mouse, ev_global_middle_press); + if (collision_point(device_mouse_x(mid), device_mouse_y(mid), id, true, false)) + event_perform(ev_mouse, ev_middle_press); + } + + //Perform button hold + global.touch_id = mid; + if (device_mouse_check_button(mid, mb_left)) + with (all) { + event_perform(ev_mouse, ev_global_left_button); + if (collision_point(device_mouse_x(mid), device_mouse_y(mid), id, true, false)) + event_perform(ev_mouse, ev_left_button); + } + + global.touch_id = mid; + if (device_mouse_check_button(mid, mb_right)) + with (all) { + event_perform(ev_mouse, ev_global_right_button); + if (collision_point(device_mouse_x(mid), device_mouse_y(mid), id, true, false)) + event_perform(ev_mouse, ev_right_button); + } + + global.touch_id = mid; + if (device_mouse_check_button(mid, mb_middle)) + with (all) { + event_perform(ev_mouse, ev_global_middle_button); + if (collision_point(device_mouse_x(mid), device_mouse_y(mid), id, true, false)) + event_perform(ev_mouse, ev_middle_button); + } + + //Perform button release + global.touch_id = mid; + if (device_mouse_check_button_released(mid, mb_left)) + with (all) { + event_perform(ev_mouse, ev_global_left_release); + if (collision_point(device_mouse_x(mid), device_mouse_y(mid), id, true, false)) + event_perform(ev_mouse, ev_left_release); + } + + global.touch_id = mid; + if (device_mouse_check_button_released(mid, mb_right)) + with (all) { + event_perform(ev_mouse, ev_global_right_release); + if (collision_point(device_mouse_x(mid), device_mouse_y(mid), id, true, false)) + event_perform(ev_mouse, ev_right_release); + } + + global.touch_id = mid; + if (device_mouse_check_button_released(mid, mb_middle)) + with (all) { + event_perform(ev_mouse, ev_global_middle_release); + if (collision_point(device_mouse_x(mid), device_mouse_y(mid), id, true, false)) + event_perform(ev_mouse, ev_middle_release); + } +} + +global.touch_id = -1; +global.touch_x = 0; +global.touch_y = 0; + + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/generic/OrderedTree.object.gmx b/objects/generic/OrderedTree.object.gmx new file mode 100644 index 0000000..a342fc5 --- /dev/null +++ b/objects/generic/OrderedTree.object.gmx @@ -0,0 +1,122 @@ + + + <undefined> + 0 + 0 + 0 + 0 + <undefined> + <undefined> + + + + 1 + 605 + 0 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + Defines the attributes `parent` and `children`. Children are implemented as an ordered list. + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + parent + + + 0 + noone + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + children + + + 0 + ds_list_create() + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Clear all children's parent and remove the children list +for (i = 0; i < ds_list_size(children); i++) + children[|i].parent = noone; + +ds_list_destroy(children); + + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/generic/scene/SceneNode.object.gmx b/objects/generic/scene/SceneNode.object.gmx new file mode 100644 index 0000000..ded414a --- /dev/null +++ b/objects/generic/scene/SceneNode.object.gmx @@ -0,0 +1,685 @@ + + + placeholder + 0 + -1 + 0 + 0 + OrderedTree + <undefined> + + + + 1 + 605 + 0 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + Base class for SceneNodes. Defines size, offset, margins, padding alignment. + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + width + + + 0 + sprite_width + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + height + + + 0 + sprite_height + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + xoffset + + + 0 + x + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + yoffset + + + 0 + y + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + halign + + + 0 + fa_left + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + valign + + + 0 + fa_top + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Destroy children and children list +while (!ds_list_empty(children)) + with (children[|0]) + instance_destroy(); + +ds_list_destroy(children); + +if (instance_exists(parent)) + removeChild(parent, id); + + + + + + + + + 1 + 605 + 0 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + Recalculate position event + + + + + 1 + 605 + 0 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + default implementation: set position from local offset and call children + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + -1 + + + 0 + parent + + + 0 + noone + + + 4 + 0 + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + visible + + + 0 + parent.visible + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Calculate absolute position from offsets +x = xoffset+paddingLeft; +y = yoffset+paddingTop; + +if (instance_exists(parent)) { + x += parent.x; + y += parent.y; + + switch (parent.halign) { + case fa_center: + x -= width/2; + break; + case fa_right: + x -= width; + break; + } + + switch (parent.valign) { + case fa_middle: + y += parent.height/2; + y -= height/2; + break; + case fa_bottom: + y += parent.height; + y -= height; + break; + } +} + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Call children +for (var i = 0; i < ds_list_size(children); i++) + with (children[|i]) { + event_user(1); + +/* switch (other.halign) { + case fa_center: + x += other.width/2; + break; + case fa_right: + x += other.width; + break; + } + + switch (other.valign) { + case fa_middle: + y += other.height/2; + break; + case fa_bottom: + y += other.height; + break; + }*/ + } + + + + + + + + + 1 + 605 + 0 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + Recalculate dimensions event + + + + + 1 + 605 + 0 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + default implementation: call children + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Call children +for (var i = 0; i < ds_list_size(children); i++) + with (children[|i]) + event_user(0); + + + + + + + + + 1 + 408 + 0 + 0 + -1 + -1 + 1 + action_if + + self + 0 + 0 + + + 0 + DEBUG + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Debug draw outline of SceneNode +var alp = draw_get_alpha(); +var col = draw_get_colour(); +var x2, y2; + +switch (halign) { +case fa_left: + x2 = x; + break; +case fa_center: + x2 = x-width/2; + break; +case fa_right: + x2 = x-width; + break; +default: + show_error("Unknown h-alignment "+string(halign)+" in "+object_get_name(object_index)+"@"+string(id)+".", true); +} + +switch (valign) { +case fa_top: + y2 = y; + break; +case fa_middle: + y2 = y-height/2; + break; +case fa_bottom: + y2 = y-height; + break; +default: + show_error("Unknown v-alignment "+string(valign)+" in "+object_get_name(object_index)+"@"+string(id)+".", true); +} + +draw_set_colour(make_colour_hsv(256/7.5*object_index, 255, 255)); +draw_set_alpha(0.3); +draw_rectangle(x2, y2, x2+width, y2+height, false); +draw_set_alpha(0.7); +draw_rectangle(x2, y2, x2+width, y2+height, true); + +if (instance_exists(parent)) + draw_line(x, y, parent.x, parent.y); + +draw_set_alpha(alp); +draw_set_colour(col); + + + + + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/generic/scene/SpritelessSceneNode.object.gmx b/objects/generic/scene/SpritelessSceneNode.object.gmx new file mode 100644 index 0000000..9398a67 --- /dev/null +++ b/objects/generic/scene/SpritelessSceneNode.object.gmx @@ -0,0 +1,328 @@ + + + pixel + 0 + -1 + 0 + 0 + SceneNode + <undefined> + + + + 1 + 605 + 0 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + For rectangular SceneNodes that have no sensible sprite but require mouse events. + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + width + + + 0 + sprite_width + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + height + + + 0 + sprite_height + + + + + 1 + 541 + 0 + 0 + 0 + -1 + 1 + action_sprite_set + + self + 0 + 0 + + + 5 + pixel + + + 0 + 0 + + + 0 + 1 + + + + + 1 + 542 + 0 + 0 + 0 + -1 + 1 + action_sprite_transform + + self + 0 + 0 + + + 0 + width + + + 0 + height + + + 0 + 0 + + + 4 + 0 + + + + + + + 1 + 605 + 0 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + override default implementation: set image scale to width and height + + + + + 1 + 542 + 0 + 0 + 0 + -1 + 1 + action_sprite_transform + + self + 0 + 0 + + + 0 + width + + + 0 + height + + + 0 + 0 + + + 4 + 0 + + + + + + + 1 + 605 + 0 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + override default implementation: only debug draw outline + + + + + 1 + 408 + 0 + 0 + -1 + -1 + 1 + action_if + + self + 0 + 0 + + + 0 + DEBUG + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Debug draw outline of SceneNode +var alp = draw_get_alpha(); +var col = draw_get_colour(); + +draw_set_colour(make_colour_hsv(256/7*object_index, 255, 255)); +draw_set_alpha(0.3); +draw_rectangle(x, y, x+width, y+height, false); +draw_set_alpha(0.7); +draw_rectangle(x, y, x+width, y+height, true); + +if (instance_exists(parent)) + draw_line(x, y, parent.x, parent.y); + +draw_set_alpha(alp); +draw_set_colour(col); + + + + + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/PreviewPane.object.gmx b/objects/scene/PreviewPane.object.gmx new file mode 100644 index 0000000..1c93d72 --- /dev/null +++ b/objects/scene/PreviewPane.object.gmx @@ -0,0 +1,237 @@ + + + placeholderPane + 0 + -1 + 2 + 0 + SceneNode + <undefined> + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + width + + + 0 + sprite_width + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + height + + + 0 + sprite_height + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + halign + + + 0 + fa_center + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + 20 + + + 0 + 0 + + + 0 + 20 + + + 0 + 0 + + + 0 + + + + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Layout blocks from top to bottom +var yoff = 0; +var lastMargin = 0; +var newWidth = 0; + +for (var i = 0; i < ds_list_size(self.children); i++) + with (self.children[|i]) { + self.xoffset = other.width/2; + self.yoffset = yoff+max(self.marginTop, lastMargin); + newWidth = max(self.width, newWidth); + yoff = self.yoffset+self.height; + lastMargin = self.marginBottom; + } + +/*self.width = max(newWidth, 20); +self.height = max(yoff+lastMargin, 60); +*/ + + + + + + 1 + 542 + 0 + 0 + 0 + -1 + 1 + action_sprite_transform + + self + 0 + 0 + + + 0 + width/sprite_get_width(sprite_index) + + + 0 + height/sprite_get_height(sprite_index) + + + 0 + 0 + + + 4 + 0 + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/blocks/Anchor.object.gmx b/objects/scene/blocks/Anchor.object.gmx new file mode 100644 index 0000000..d2e46c5 --- /dev/null +++ b/objects/scene/blocks/Anchor.object.gmx @@ -0,0 +1,311 @@ + + + placeholder + 0 + -1 + 0 + 0 + SceneNode + <undefined> + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + 0 + + + 0 + 10 + + + 0 + 0 + + + 0 + 10 + + + 0 + + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + halign + + + 0 + fa_center + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + freshType + + + 0 + noone + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + currentType + + + 0 + noone + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + line + + + 0 + noone + + + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + freshType + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + currentType + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Increase width if type is larger +width = max(sprite_width, children[|0].width); + + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/blocks/Block.object.gmx b/objects/scene/blocks/Block.object.gmx new file mode 100644 index 0000000..69e2ead --- /dev/null +++ b/objects/scene/blocks/Block.object.gmx @@ -0,0 +1,1050 @@ + + + placeholderBlock + 0 + -1 + 1 + 0 + SpritelessSceneNode + <undefined> + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + BASE_WIDTH + + + 0 + 0 + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + VERTICAL_SPACING + + + 0 + 20 + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + 40 + + + 0 + 10 + + + 0 + 40 + + + 0 + 10 + + + 0 + + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + height + + + 0 + 3*sprite_get_height(placeholderVariableType) + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + Draggable + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + template + + + 0 + noone + + + + + + + 1 + 408 + 0 + 0 + -1 + -1 + 1 + action_if + + self + 0 + 0 + + + 0 + hasParentNode(id, PreviewPane) + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Wash out if no blocks available +var blockCount = 0; +with (Block) + if (self.id != other.id && self.template == other.template) + blockCount++; + +if (blockCount >= self.template.allowedUses) + image_blend = c_red; +else + image_blend = c_white; + + + + + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + touch_id + + + 0 + mid + + + 4 + 0 + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + id + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + 1 + 403 + 0 + -1 + -1 + -1 + 1 + action_if_object + + self + -1 + 0 + + + 10 + PreviewPane + + + 0 + 0 + + + 0 + 0 + + + + + 1 + 203 + 0 + 0 + 0 + -1 + 1 + action_kill_object + + self + 0 + 0 + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + Draggable + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + Draggable + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + touch_id + + + 0 + mid + + + 4 + 0 + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + id + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + touch_id + + + 0 + 0 + + + 4 + 4 + + + + + 1 + 408 + 0 + 0 + -1 + -1 + 1 + action_if + + self + 0 + -1 + + + 0 + hasParentNode(id, PreviewPane) + + + + + 1 + 203 + 0 + 0 + 0 + -1 + 1 + action_kill_object + + self + 0 + 0 + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + Draggable + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + touch_id + + + 0 + 0 + + + 4 + 4 + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + 1 + 408 + 0 + 0 + -1 + -1 + 1 + action_if + + self + 0 + 0 + + + 0 + hasParentNode(id, PreviewPane) + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Create block from this template +var blockCount = 0; +with (Block) + if (self.id != other.id && self.template == other.template) + blockCount++; + +if (blockCount < self.template.allowedUses) { + var block = blockFromTemplate(self.template); + + with (block) { + self.dx = self.width/2; + self.dy = self.height/2; + self.mid = other.mid; + } +} + +self.mid = -2; + + + + + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Set offset of OutputAnchors +for (var i = 0; i < ds_list_size(children); i++) + if (instanceof(children[|i], OutputAnchor)) + children[|i].yoffset = height; + + + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///walk over inputs and outputs, determine offsets and block size +var topWidth = 0; +var bottomWidth = 0; +var topHeight = 0; +var bottomHeight = 0; + +for (var i = 0; i < ds_list_size(children); i++) { + if (instanceof(children[|i], InputAnchor)) { + with (children[|i]) { + topWidth += marginLeft; + event_user(0); + xoffset = topWidth+width/2; + topWidth += width; + topWidth += marginRight; + topHeight = max(topHeight, height); + } + } + if (instanceof(children[|i], OutputAnchor)) { + with (children[|i]) { + bottomWidth += marginLeft; + event_user(0); + xoffset = bottomWidth+width/2; + bottomWidth += width; + bottomWidth += marginRight; + bottomHeight = max(bottomHeight, height); + } + } +} + +var newWidth = max(topWidth, bottomWidth, BASE_WIDTH); +var newHeight = topHeight+VERTICAL_SPACING+bottomHeight; + +xoffset += (width-newWidth)/2; +yoffset += (height-newHeight)/2; + +width = newWidth; +height = newHeight; + + + +//center top if applicable +if (topWidth < width) { + var centeringOffset = (width-topWidth)/2; + + for (var i = 0; i < ds_list_size(children); i++) + if (instanceof(children[|i], InputAnchor)) + children[|i].xoffset += centeringOffset; +} + +//center bottom if applicable +if (bottomWidth < width) { + var centeringOffset = (width-bottomWidth)/2; + + for (var i = 0; i < ds_list_size(children); i++) + if (instanceof(children[|i], OutputAnchor)) + children[|i].xoffset += centeringOffset; +} + + + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Draw sprite +draw_sprite_stretched_ext(placeholderBlock, image_index, x, y, width, height, image_blend, image_alpha); + + + + + + + 1 + 408 + 0 + 0 + -1 + -1 + 1 + action_if + + self + 0 + 0 + + + 0 + DEBUG + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Draw debug sprite +draw_sprite_stretched(placeholderBlock, image_index, x, y, width, height); + + + + + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/blocks/Connection.object.gmx b/objects/scene/blocks/Connection.object.gmx new file mode 100644 index 0000000..637b454 --- /dev/null +++ b/objects/scene/blocks/Connection.object.gmx @@ -0,0 +1,289 @@ + + + placeholder + 0 + -1 + 0 + 0 + SceneNode + <undefined> + + + + 1 + 605 + 0 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + Vertical spline between two endpoints. + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + FADETIME + + + 0 + 3*1000000 + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + destroyTime + + + 0 + 0 + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Create source and drain endpoints +source = new(ConnectionSource); +drain = new(ConnectionDrain); + +addChild(id, source); +addChild(id, drain); + + + + + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + destroyTime + + + 0 + 0 + + + 4 + 2 + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + destroyTime + + + 0 + get_timer() + + + 4 + 3 + + + + + 1 + 203 + 0 + 0 + 0 + -1 + 1 + action_kill_object + + self + 0 + 0 + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + other + 0 + 0 + + + 1 + ///draw spline +var overshoot = max(200, abs(source.x-drain.x))+max(0, source.y-drain.y); + +if (destroyTime > get_timer()) + draw_set_alpha(min(1, (destroyTime-get_timer())/2000000)); + +draw_primitive_begin(pr_linestrip); +for (var t = 0; t <= 1; t += 1/40) + draw_vertex(hermite(source.x, 0, drain.x, 0, t), hermite(source.y, overshoot, drain.y, overshoot, t)); +draw_primitive_end(); + +draw_set_alpha(1); + + + + + + + 1 + 408 + 0 + 0 + -1 + -1 + 1 + action_if + + self + 0 + 0 + + + 0 + DEBUG + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///draw debug text +draw_text((source.x+drain.x)/2, (source.y+drain.y)/2, + "source: "+getInstObjName(source.target)+" "+string(source.x)+","+string(source.y)+"#"+ + "drain: "+getInstObjName(drain.target)+" "+string(drain.x)+","+string(drain.y)+"#"+ + "sourceTouch: "+string(source.mid)+", drainTouch: "+string(drain.mid)+"#" +); + + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/blocks/ConnectionDrain.object.gmx b/objects/scene/blocks/ConnectionDrain.object.gmx new file mode 100644 index 0000000..82e21f9 --- /dev/null +++ b/objects/scene/blocks/ConnectionDrain.object.gmx @@ -0,0 +1,115 @@ + + + placeholder + 0 + 0 + -1 + 0 + ConnectionEnd + maskConnection + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + touch_id + + + 0 + mid + + + 4 + 0 + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Snap to InputAnchor if possible +var nearest = instance_nearest(x, y, InputAnchor); + +if (place_meeting(x, y, nearest) && !hasParentNode(nearest, PreviewPane)) { + if (self.parent.source.target == noone) + self.target = nearest; + else + if (testUnify(nearest.currentType, self.parent.source.target.currentType)) + self.target = nearest; +} + +if (self.target != noone) { + with (self.target.line) { + self.drain.target = noone; + self.destroyTime = get_timer()+Connection.FADETIME; + } + + self.target.line = self.parent; + + if (self.parent.source.target != noone) + unifyAnchors(self.parent.source.target, self.target); + + layoutCluster(self.target.parent); +} +else + self.parent.destroyTime = get_timer()+1.5*Connection.FADETIME; + + + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/blocks/ConnectionEnd.object.gmx b/objects/scene/blocks/ConnectionEnd.object.gmx new file mode 100644 index 0000000..f074c9b --- /dev/null +++ b/objects/scene/blocks/ConnectionEnd.object.gmx @@ -0,0 +1,798 @@ + + + placeholder + 0 + 0 + -1 + 0 + SceneNode + maskConnection + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + Draggable + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + target + + + 0 + noone + + + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + -1 + + + 0 + target + + + 0 + noone + + + 4 + 0 + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + target.line + + + 0 + noone + + + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + -1 + + + 0 + target + + + 0 + noone + + + 4 + 0 + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + xoffset + + + 0 + target.x + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + yoffset + + + 0 + target.y + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + id + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + Draggable + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + Draggable + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + touch_id + + + 0 + mid + + + 4 + 0 + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + parent + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + Draggable + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + touch_id + + + 0 + 0 + + + 4 + 4 + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + parent.destroyTime + + + 0 + 0 + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + -1 + + + 0 + target + + + 0 + noone + + + 4 + 0 + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + id + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 408 + 0 + 0 + -1 + -1 + 1 + action_if + + self + 0 + 0 + + + 0 + DEBUG + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + visible + + + 0 + true + + + + + 1 + 421 + 3 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + visible + + + 0 + false + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/blocks/ConnectionSource.object.gmx b/objects/scene/blocks/ConnectionSource.object.gmx new file mode 100644 index 0000000..f6dc5da --- /dev/null +++ b/objects/scene/blocks/ConnectionSource.object.gmx @@ -0,0 +1,115 @@ + + + placeholder + 0 + 0 + -1 + 0 + ConnectionEnd + maskConnection + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + touch_id + + + 0 + mid + + + 4 + 0 + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Snap to OutputAnchor if possible +var nearest = instance_nearest(x, y, OutputAnchor); + +if (place_meeting(x, y, nearest) && !hasParentNode(nearest, PreviewPane)) { + if (self.parent.drain.target == noone) + self.target = nearest; + else + if (testUnify(nearest.currentType, self.parent.drain.target.currentType)) + self.target = nearest; +} + +if (self.target != noone) { + with (self.target.line) { + self.source.target = noone; + self.destroyTime = get_timer()+Connection.FADETIME; + } + + self.target.line = self.parent; + + if (self.parent.drain.target != noone) + unifyAnchors(self.target, self.parent.drain.target); + + layoutCluster(self.target.parent); +} +else + self.parent.destroyTime = get_timer()+1.5*Connection.FADETIME; + + + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/blocks/InputAnchor.object.gmx b/objects/scene/blocks/InputAnchor.object.gmx new file mode 100644 index 0000000..7bf1de5 --- /dev/null +++ b/objects/scene/blocks/InputAnchor.object.gmx @@ -0,0 +1,475 @@ + + + placeholderInputAnchorWhite + 0 + -1 + 0 + 0 + Anchor + <undefined> + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + -1 + + + 0 + line + + + 0 + noone + + + 4 + 0 + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + line.destroyTime + + + 0 + get_timer()+Connection.FADETIME + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + line.drain + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + self.line + + + 0 + noone + + + 4 + 0 + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Light up if compatible, unconnected line nearby +var nearest = noone; +var distance = 0; + +with (ConnectionDrain) + if (self.target == noone && self.parent.source.target != noone) { + var d = distance_to_object(other); + if (d < 100 && (nearest == noone || d < distance)) { + nearest = id; + distance = d; + } + } + +if (nearest != noone) { + if (testUnify(self.currentType, nearest.parent.source.target.currentType)) + self.image_blend = c_green; + else + self.image_blend = c_red; +} +else + self.image_blend = c_black; + + + + + + + 1 + 421 + 3 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 543 + 0 + 0 + 0 + -1 + 1 + action_sprite_color + + self + 0 + 0 + + + 13 + 0 + + + 0 + 1 + + + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + touch_id + + + 0 + 0 + + + 4 + 4 + + + + + 1 + 408 + 0 + 0 + -1 + -1 + 1 + action_if + + self + 0 + -1 + + + 0 + hasParentNode(id, PreviewPane) + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + line + + + 0 + noone + + + 4 + 0 + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Create connection +line = new(Connection); + +line.drain.target = id; + +with (line.source) { + xoffset = touch_x; + yoffset = touch_y; + event_perform(ev_mouse, ev_left_press); +} + + + + + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + height + + + 0 + children[|0].height + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/blocks/OutputAnchor.object.gmx b/objects/scene/blocks/OutputAnchor.object.gmx new file mode 100644 index 0000000..e3f3202 --- /dev/null +++ b/objects/scene/blocks/OutputAnchor.object.gmx @@ -0,0 +1,539 @@ + + + placeholderOutputAnchorWhite + 0 + -1 + 0 + 0 + Anchor + <undefined> + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + valign + + + 0 + fa_bottom + + + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + -1 + + + 0 + line + + + 0 + noone + + + 4 + 0 + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + line.destroyTime + + + 0 + get_timer()+Connection.FADETIME + + + + + 1 + 601 + 0 + 0 + 0 + -1 + 1 + action_execute_script + + self + 0 + 0 + + + 9 + + + + 0 + line.source + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + self.line + + + 0 + noone + + + 4 + 0 + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Light up if compatible, unconnected line nearby +var nearest = noone; +var distance = 0; + +with (ConnectionSource) + if (self.target == noone && self.parent.drain.target != noone) { + var d = distance_to_object(other); + if (d < 100 && (nearest == noone || d < distance)) { + nearest = id; + distance = d; + } + } + +if (nearest != noone) { + if (testUnify(self.currentType, nearest.parent.drain.target.currentType)) + self.image_blend = c_green; + else + self.image_blend = c_red; +} +else + self.image_blend = c_black; + + + + + + + 1 + 421 + 3 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 543 + 0 + 0 + 0 + -1 + 1 + action_sprite_color + + self + 0 + 0 + + + 13 + 0 + + + 0 + 1 + + + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + touch_id + + + 0 + 0 + + + 4 + 4 + + + + + 1 + 408 + 0 + 0 + -1 + -1 + 1 + action_if + + self + 0 + -1 + + + 0 + hasParentNode(id, PreviewPane) + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + 0 + + + 0 + line + + + 0 + noone + + + 4 + 0 + + + + + 1 + 422 + 1 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Create connection +line = new(Connection); + +line.source.target = id; + +with (line.drain) { + xoffset = touch_x; + yoffset = touch_y; + event_perform(ev_mouse, ev_left_press); +} + + + + + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + 424 + 2 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + height + + + 0 + children[|0].height + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + children[|0].yoffset + + + 0 + -children[|0].height + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/types/ConcreteTypeInstance.object.gmx b/objects/scene/types/ConcreteTypeInstance.object.gmx new file mode 100644 index 0000000..0a99a76 --- /dev/null +++ b/objects/scene/types/ConcreteTypeInstance.object.gmx @@ -0,0 +1,23 @@ + + + placeholderMonoType + 0 + -1 + 0 + 0 + TypeCon1Instance + <undefined> + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/types/FreeTypeInstance.object.gmx b/objects/scene/types/FreeTypeInstance.object.gmx new file mode 100644 index 0000000..8795ef5 --- /dev/null +++ b/objects/scene/types/FreeTypeInstance.object.gmx @@ -0,0 +1,23 @@ + + + placeholderVariableType + 0 + -1 + 0 + 0 + TypeCon1Instance + <undefined> + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/types/FunctionTypeInstance.object.gmx b/objects/scene/types/FunctionTypeInstance.object.gmx new file mode 100644 index 0000000..99735ae --- /dev/null +++ b/objects/scene/types/FunctionTypeInstance.object.gmx @@ -0,0 +1,40 @@ + + + placeholderFunctionType + 0 + -1 + 0 + 0 + TypeCon1Instance + <undefined> + + + + 1 + 500 + 0 + 0 + 0 + 0 + 2 + + draw_self(); + self + 0 + 0 + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/types/ParametricInstance.object.gmx b/objects/scene/types/ParametricInstance.object.gmx new file mode 100644 index 0000000..b4f6e9f --- /dev/null +++ b/objects/scene/types/ParametricInstance.object.gmx @@ -0,0 +1,107 @@ + + + placeholder + 0 + -1 + 0 + 0 + SceneNode + <undefined> + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + parameter + + + 0 + noone + + + + + + + 1 + 500 + 0 + 0 + 0 + 0 + 2 + + draw_self(); + self + 0 + 0 + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Draw parameter +with (parameter) + draw_sprite_ext(self.sprite_index, self.image_index, other.x, other.y, self.image_xscale, self.image_yscale, self.image_angle, self.image_blend, self.image_alpha); + +if (parameter == noone) + draw_sprite_stretched(placeholder, 0, x, y, sprite_width, sprite_height); + + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/types/TraitInstance.object.gmx b/objects/scene/types/TraitInstance.object.gmx new file mode 100644 index 0000000..401d0c1 --- /dev/null +++ b/objects/scene/types/TraitInstance.object.gmx @@ -0,0 +1,23 @@ + + + placeholderTypeTrait + 0 + -1 + 0 + 0 + ParametricInstance + <undefined> + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/types/TypeCon1Instance.object.gmx b/objects/scene/types/TypeCon1Instance.object.gmx new file mode 100644 index 0000000..47e6647 --- /dev/null +++ b/objects/scene/types/TypeCon1Instance.object.gmx @@ -0,0 +1,172 @@ + + + placeholder + 0 + -1 + 0 + 0 + ParametricInstance + <undefined> + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + type + + + 0 + noone + + + + + + + 1 + 605 + 0 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + override default + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///layout all children from left to right +var tempWidth = sprite_width; + +for (var i = 0; i < ds_list_size(children); i++) + with (children[|i]) { + tempWidth += self.marginLeft; + self.xoffset = tempWidth; + event_user(0); + tempWidth += self.width; + tempWidth += self.marginRight; + } + +self.width = tempWidth; + + + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + -1 + + + 0 + parent + + + 0 + noone + + + 4 + 0 + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + valign + + + 0 + parent.valign + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/scene/types/TypeConInstance.object.gmx b/objects/scene/types/TypeConInstance.object.gmx new file mode 100644 index 0000000..cde0a18 --- /dev/null +++ b/objects/scene/types/TypeConInstance.object.gmx @@ -0,0 +1,226 @@ + + + placeholder + 0 + -1 + 0 + 0 + SceneNode + <undefined> + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Set offsets of children +var tempOffset = 0; +var yoff; + +if (hasParentNode(id, InputAnchor)) + yoff = 3; +else + yoff = -3; + + +for (var i = 0; i < ds_list_size(children); i++) + with (children[|i]) { + self.xoffset = tempOffset; + self.yoffset = yoff; + tempOffset += self.width; + + } + + + + + + + 1 + 612 + 0 + 0 + -1 + -1 + 1 + action_if_variable + + self + 0 + -1 + + + 0 + parent + + + 0 + noone + + + 4 + 0 + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + valign + + + 0 + parent.valign + + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + + + 1 + 605 + 0 + 0 + 0 + 0 + 0 + + + self + 0 + 0 + + + 1 + override default + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///determine width and height +var tempWidth = 0, tempHeight = 0; + +for (var i = 0; i < ds_list_size(children); i++) + with (children[|i]) { + tempWidth += self.marginLeft; + event_user(0); + tempWidth += self.width; + tempWidth += self.marginRight; + tempHeight = max(tempHeight, self.height); + } + +self.width = tempWidth; +self.height = tempHeight+3; + + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Draw self at offset +var xCombiner, yCombiner; + +if (hasParentNode(id, InputAnchor)) { + xCombiner = x; + yCombiner = y; +} +else { + xCombiner = x; + yCombiner = y+height-3; +} + +draw_set_colour(c_white); +draw_rectangle(xCombiner, yCombiner, xCombiner+width, yCombiner+3, false); +draw_set_colour(c_black); +draw_rectangle(xCombiner, yCombiner, xCombiner+width, yCombiner+3, true); + + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/types/ConcreteType.object.gmx b/objects/types/ConcreteType.object.gmx new file mode 100644 index 0000000..23329c7 --- /dev/null +++ b/objects/types/ConcreteType.object.gmx @@ -0,0 +1,64 @@ + + + placeholderMonoType + 0 + 0 + 0 + 0 + Type + <undefined> + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + instance + + + 0 + ConcreteTypeInstance + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/types/FreeType.object.gmx b/objects/types/FreeType.object.gmx new file mode 100644 index 0000000..fad2a45 --- /dev/null +++ b/objects/types/FreeType.object.gmx @@ -0,0 +1,64 @@ + + + placeholderVariableType + 0 + 0 + 0 + 0 + Type + <undefined> + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + instance + + + 0 + FreeTypeInstance + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/types/FunctionType.object.gmx b/objects/types/FunctionType.object.gmx new file mode 100644 index 0000000..eea66f3 --- /dev/null +++ b/objects/types/FunctionType.object.gmx @@ -0,0 +1,64 @@ + + + placeholderFunctionType + 0 + 0 + 0 + 0 + ConcreteType + <undefined> + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + instance + + + 0 + FunctionTypeInstance + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/types/Parametric.object.gmx b/objects/types/Parametric.object.gmx new file mode 100644 index 0000000..e2e3e91 --- /dev/null +++ b/objects/types/Parametric.object.gmx @@ -0,0 +1,102 @@ + + + placeholderParameter + 0 + 0 + 0 + 0 + <undefined> + <undefined> + + + + 1 + 541 + 0 + 0 + 0 + -1 + 1 + action_sprite_set + + self + 0 + 0 + + + 5 + placeholderParameter + + + 0 + irandom_range(0, sprite_get_number(placeholderParameter)-1) + + + 0 + 0 + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + image_blend + + + 0 + make_colour_hsv(irandom(255), 255, 255) + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + instance + + + 0 + Error + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/types/Trait.object.gmx b/objects/types/Trait.object.gmx new file mode 100644 index 0000000..a2c0c84 --- /dev/null +++ b/objects/types/Trait.object.gmx @@ -0,0 +1,89 @@ + + + placeholderTypeTrait + 0 + 0 + 0 + 0 + Parametric + <undefined> + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + traits + + + 0 + ds_set_create() + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Destroy traits set +ds_set_destroy(traits); + + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/types/Type.object.gmx b/objects/types/Type.object.gmx new file mode 100644 index 0000000..efbd6ce --- /dev/null +++ b/objects/types/Type.object.gmx @@ -0,0 +1,89 @@ + + + placeholder + 0 + 0 + 0 + 0 + Parametric + <undefined> + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + traits + + + 0 + ds_set_create() + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Destroy traits set +ds_set_destroy(traits); + + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/types/TypeCon1Link.object.gmx b/objects/types/TypeCon1Link.object.gmx new file mode 100644 index 0000000..67b10e5 --- /dev/null +++ b/objects/types/TypeCon1Link.object.gmx @@ -0,0 +1,64 @@ + + + placeholder + 0 + 0 + 0 + 0 + TypeConLink + <undefined> + + + + 1 + 604 + 0 + 0 + 0 + 0 + 1 + action_inherited + + self + 0 + 0 + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + type + + + 0 + noone + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/types/TypeConLink.object.gmx b/objects/types/TypeConLink.object.gmx new file mode 100644 index 0000000..ba04434 --- /dev/null +++ b/objects/types/TypeConLink.object.gmx @@ -0,0 +1,123 @@ + + + placeholder + 0 + 0 + 0 + 0 + self + <undefined> + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + to + + + 0 + ds_list_create() + + + + + 1 + 611 + 6 + -1 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + from + + + 0 + ds_set_create() + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Check whether no links left +assert(ds_list_empty(to) && ds_set_empty(from), "'"+getInstObjName(id)+"' still connected."); + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Clear up `from` and `to` links +ds_set_destroy(from); +ds_list_destroy(to); + + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/rooms/room0.room.gmx b/rooms/room0.room.gmx new file mode 100644 index 0000000..e2bd63a --- /dev/null +++ b/rooms/room0.room.gmx @@ -0,0 +1,151 @@ + + + + 4000 + 4000 + 16 + 16 + 0 + 1000 + 0 + 12632256 + -1 + + -1 + -1 + -1 + + -1 + 980 + 600 + 0 + -1 + -1 + -1 + -1 + 0 + 0 + -1 + 0 + -75 + -95 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 0 + 1024 + 768 + 0 + 10 + 0.100000001490116 + diff --git a/scripts/blocks/blockFromTemplate.gml b/scripts/blocks/blockFromTemplate.gml new file mode 100644 index 0000000..2e285a3 --- /dev/null +++ b/scripts/blocks/blockFromTemplate.gml @@ -0,0 +1,19 @@ +///blockFromTemplate(template) +/** + * blockFromTemplate :: BlockTemplate -> Instance + * + * Creates a block from the given template. + * + * @param template the block tempalte to use + * @returns the id of the block instance + */ + +var template = argument0; + +assertInstanceof(template, BlockTemplate); + +var block = createBlock(template.inputs, template.outputs); +block.template = template; + +return block; + diff --git a/scripts/blocks/createBlock.gml b/scripts/blocks/createBlock.gml new file mode 100644 index 0000000..14b9539 --- /dev/null +++ b/scripts/blocks/createBlock.gml @@ -0,0 +1,36 @@ +///createBlock(inputTypes, outputTypes) +/** + * createBlock :: List Type -> List Type -> Instance + * + * Creates a block with the given types and returns the id of the block. + * + * @param inputTypes a list of input types + * @param outputTypes a list of output types + * @returns the id of the block instance + */ + +var inputTypes = argument0; +var outputTypes = argument1; +var block = new(Block); + +for (var i = 0; i < ds_list_size(inputTypes); i++) { + var anchor = new(InputAnchor); + anchor.freshType = new(TypeConLink); + addLink(anchor.freshType, inputTypes[|i]); + + addChild(block, anchor); +} + +for (var i = 0; i < ds_list_size(outputTypes); i++) { + var anchor = new(OutputAnchor); + anchor.freshType = new(TypeConLink); + addLink(anchor.freshType, outputTypes[|i]); + + addChild(block, anchor); +} + +freshTypes(block); +layout(block); + +return block; + diff --git a/scripts/blocks/createTypeInstance.gml b/scripts/blocks/createTypeInstance.gml new file mode 100644 index 0000000..28e9582 --- /dev/null +++ b/scripts/blocks/createTypeInstance.gml @@ -0,0 +1,36 @@ +///createTypeInstance(con) +/** + * createTypeInstance :: TypeConLink -> TypeConInstance + * + * Creates a visual type instance for a type. + * + * @param con the type for which to make a type instance + * @returns a type instance + */ + +var con = argument0; + +assertInstanceof(con, TypeConLink); + +var inst; + +if (instanceof(con, TypeCon1Link)) { + inst = new(con.type.instance); + inst.parameter = con.type; + + var traits = con.type.traits; + for (var trait = ds_set_first(traits); ds_set_exists(traits, trait); trait = ds_set_next(traits, trait)) { + var traitInst = new(TraitInstance); + traitInst.parameter = trait; + addChild(inst, traitInst); + } +} +else { + inst = new(TypeConInstance); + + for (var i = 0; i < ds_list_size(con.to); i++) + addChild(inst, createTypeInstance(con.to[|i])); +} + +return inst; + diff --git a/scripts/blocks/detachConnectionEnd.gml b/scripts/blocks/detachConnectionEnd.gml new file mode 100644 index 0000000..d8a1ef0 --- /dev/null +++ b/scripts/blocks/detachConnectionEnd.gml @@ -0,0 +1,47 @@ +///detachConnectionEnd(conn) +/** + * layoutCluster :: ConnectionEnd -> () + * + * Detaches a connection end from an anchor + * + * @param conn the end point to detach + */ + +var conn = argument0; + +if (conn.target == noone) + show_error("Connection not attached.", true); + +var targetBlock = conn.target.parent; +var otherEnd = noone; +var blocks = getBlockCluster(targetBlock); + +if (instanceof(conn, ConnectionSource)) + otherEnd = conn.parent.drain; +if (instanceof(conn, ConnectionDrain)) + otherEnd = conn.parent.source; + +if (otherEnd.target != noone) { + for (var block = ds_set_first(blocks); ds_set_exists(blocks, block); block = ds_set_next(blocks, block)) + freshTypes(block); + + conn.target.line = noone; + conn.target = noone; + + var lines = getConnectionsForCluster(blocks); + for (var line = ds_set_first(lines); ds_set_exists(lines, line); line = ds_set_next(lines, line)) + unifyAnchors(line.source.target, line.drain.target); + + layoutCluster(ds_set_first(blocks)); + for (var block = ds_set_first(blocks); ds_set_exists(blocks, block); block = ds_set_next(blocks, block)) + layout(block); + + ds_set_destroy(lines); +} +else { + conn.target.line = noone; + conn.target = noone; +} + +ds_set_destroy(blocks); + diff --git a/scripts/blocks/getBlockCluster.gml b/scripts/blocks/getBlockCluster.gml new file mode 100644 index 0000000..4cd9cf9 --- /dev/null +++ b/scripts/blocks/getBlockCluster.gml @@ -0,0 +1,41 @@ +///getBlockCluster(block) +/** + * getBlockCluster :: Block -> Set Block + * + * Returns a set of all blocks in the connected component. + * + * @param block a block within the cluster + */ + +var discovered = ds_set_create(); +var visited = ds_set_create(); +ds_set_add(discovered, argument0); + +while (!ds_set_empty(discovered)) { + var block = ds_set_first(discovered); + ds_set_delete(discovered, block); + ds_set_add(visited, block); + + for (var i = 0; i < ds_list_size(block.children); i++) + with (block.children[|i]) { + var otherEnd = noone; + + if (instanceof(id, OutputAnchor)) + if (self.line != noone) + var otherEnd = self.line.drain; + + if (instanceof(id, InputAnchor)) + if (self.line != noone) + var otherEnd = self.line.source; + + with (otherEnd) + if (self.target != noone) + if (!ds_set_exists(visited, self.target.parent)) + ds_set_add(discovered, self.target.parent); + } +} + +ds_set_destroy(discovered); + +return visited; + diff --git a/scripts/blocks/getConnectionsForCluster.gml b/scripts/blocks/getConnectionsForCluster.gml new file mode 100644 index 0000000..330d8b0 --- /dev/null +++ b/scripts/blocks/getConnectionsForCluster.gml @@ -0,0 +1,20 @@ +///getConnectionsForCluster(blocks) +/** + * getConnectionsForCluster :: Set Block -> Set Connection + * + * Returns a set of all connections connecting two blocks within the cluster of blocks. + * + * @param blocks a set of blocks + */ + +var blocks = argument0; +var connections = ds_set_create(); + +with (Connection) { + if (self.source.target != noone && self.drain.target != noone) + if (ds_set_exists(blocks, self.source.target.parent) && ds_set_exists(blocks, self.drain.target.parent)) + ds_set_add(connections, id); +} + +return connections; + diff --git a/scripts/blocks/layoutCluster.gml b/scripts/blocks/layoutCluster.gml new file mode 100644 index 0000000..1a2247f --- /dev/null +++ b/scripts/blocks/layoutCluster.gml @@ -0,0 +1,27 @@ +///layoutCluster(block) +/** + * layoutCluster :: Block -> () + * + * Performs layout() for all blocks in a cluster. + * + * @param block a block within the cluster + */ + +var blocks = getBlockCluster(argument0); + +for (var block = ds_set_first(blocks); ds_set_exists(blocks, block); block = ds_set_next(blocks, block)) + with (block) { + for (var i = 0; i < ds_list_size(children); i++) + if (instanceof(children[|i], Anchor)) { + var typeInst = children[|i].children[|0]; + + removeChild(children[|i], typeInst); + + delete(typeInst); + addChild(children[|i], createTypeInstance(children[|i].currentType.to[|0])); + } + + layout(id); + } +ds_set_destroy(blocks); + diff --git a/scripts/debug/sceneNodeToString.gml b/scripts/debug/sceneNodeToString.gml new file mode 100644 index 0000000..4095525 --- /dev/null +++ b/scripts/debug/sceneNodeToString.gml @@ -0,0 +1,29 @@ +///sceneNodeToString(id) +/** + * sceneNodeToString :: SceneNode -> String + * + * Returns the scene node with all its children as a string. + * + * @param id the scene node to convert to a string + * @returns the scene node as a string + */ + +var node = argument0; +var str = object_get_name(node.object_index)+"@"+string(node.id); + +/* +str += " parent: "+string(argument0.parent); +str += " x: "+string(argument0.x)+" y: "+string(argument0.y); +str += " dx: "+string(argument0.xoffset)+" dy: "+string(argument0.yoffset); +str += " width: "+string(argument0.width)+" height: "+string(argument0.height); +*/ + +for (var i = 0; i < ds_list_size(node.children); i++) { + if (is_real(node.children[|i]) && instance_exists(node.children[|i])) + str += string_replace_all("#"+sceneNodeToString(node.children[|i]), "#", "# "); + else + str += "# [error]: child is "+string(node.children[|i]); +} + +return str; + diff --git a/scripts/debug/typesToDot.gml b/scripts/debug/typesToDot.gml new file mode 100644 index 0000000..8027723 --- /dev/null +++ b/scripts/debug/typesToDot.gml @@ -0,0 +1,112 @@ +///typesToDot() +/** + * typesToDot :: () -> String + * + * Builds a DOT string for all types. + * + * @returns the DOT string representation of all types + */ + +var nl = chr(13)+chr(10); +var dq = '"'; +var str = "digraph {"; + +str += "{rank = same"+nl; +with (Block) { + str += format("i%i[shape=rectangle,style=dashed,label=%'%o%']%n", id, id); +} +if (DEBUG) + with (BlockTemplate) { + str += format("i%i[shape=rectangle,color=%'%c%',style=dashed,label=%'%o%']%n",id,self.image_blend,id); + } +str += "}"+nl; + +if (DEBUG) { + str += "{rank = same"+nl; + with (HigherOrderLink) { + str += format("i%i[shape=rectangle,color=darkgreen,style=dashed,label=%'%o%']%n", id, id); + } + with (AnchorTemplate) { + str += format("i%i[shape=rectangle,color=darkgreen,style=dashed,label=%'%o%']%n", id, id); + } + str += "}"+nl; +} + +with (Block) { + for (var i = 0; i < ds_list_size(self.children); i++) + if (instanceof(self.children[|i], Anchor)) { + str += format("i%i->i%i[style=dashed,label=%'curr%i%']%n", id, self.children[|i].currentType, i); + str += format("i%i->i%i[style=dashed,label=%'fresh%i%']%n", id, self.children[|i].freshType, i); + } +} + +if (DEBUG) { + with (BlockTemplate) { + for (var i = 0; i < ds_list_size(self.inputs); i++) + str += format("i%i->i%i[color=%'%c%',style=dashed,label=%'%o%']%n", id, self.inputs[|i], self.image_blend, id); + for (var i = 0; i < ds_list_size(self.outputs); i++) + str += format("i%i->i%i[color=%'%c%',style=dashed,label=%'%o%']%n", id, self.outputs[|i], self.image_blend, id); + + var coll = id; + with (AnchorTemplate) + if (place_meeting(self.x, self.y, coll)) + str += format("i%i->i%i[color=%'%c%',style=dashed]%n", coll, id, coll.image_blend); + } + + with (HigherOrderLink) + str += format("i%i->i%i[color=darkgreen,style=dashed]%n", id, self.con); + + with (AnchorTemplate) + str += format("i%i->i%i[color=darkgreen,style=dashed]%n", id, self.con); + + with (ParameterLink) + str += format("i%i->i%i[color=%'%c%',label=%'%o%']%n", self.source, self.drain, self.image_blend, id); +} + +with (TypeConLink) { + if (instanceof(id, TypeCon1Link)) { + str += format("i%i[shape=diamond,label=%'s-con%']%n", id); + str += format("i%i->i%i%n", id, self.type); + } + else { + str += format("i%i[shape=diamond,label=%'%i-con%']%n", id, ds_list_size(self.to)); + } + + for (var i = 0; i < ds_list_size(self.to); i++) { + var err = ""; + if (!ds_set_exists(self.to[|i].from, id)) + err = "color=red,"; + + str += format("i%i->i%i[%slabel=%'%i%']%n", id, self.to[|i], err, i); + } + + for (var from = ds_set_first(self.from); ds_set_exists(self.from, from); from = ds_set_next(self.from, from)) { + if (ds_list_find_index(from.to, id) == -1) + str += format("i%i->i%i[color=red,style=dashed]%n", from, id); + } +} + +with (Parametric) { + if (instanceof(id, FreeType)) + str += format("i%i[shape=ellipse,label=%'%o%']%n", id, id); + else if (instanceof(id, ConcreteType)) + str += format("i%i[shape=rectangle,label=%'%o%']%n", id, id); + else + str += format("i%i[shape=ellipse,style=dashed,color=%'%c%',label=%'%o%']%n", id, self.image_blend, id); + + if (instanceof(id, Type)) + for (var trait = ds_set_first(self.traits); ds_set_exists(self.traits, trait); trait = ds_set_next(self.traits, trait)) + str += format("i%i->i%i%n", id, trait); +} + +with (Trait) { + str += format("i%i[shape=house,label=%'%o%']%n", id, id); + + for (var trait = ds_set_first(self.traits); ds_set_exists(self.traits, trait); trait = ds_set_next(self.traits, trait)) + str += format("i%i->i%i%n", id, trait); +} + +str += "}"; + +return str; + diff --git a/scripts/generic/assert.gml b/scripts/generic/assert.gml new file mode 100644 index 0000000..e662956 --- /dev/null +++ b/scripts/generic/assert.gml @@ -0,0 +1,13 @@ +///assert(expr, msg) +/** + * assert :: Boolean -> a[a->String] -> () + * + * Asserts an expression is true. If not, the program halts with the given message. + * + * @param expr the expression to test + * @param msg the message shown if the assertion fails + */ + +if (!argument0) + show_error(string(argument1), true); + diff --git a/scripts/generic/assertInstanceof.gml b/scripts/generic/assertInstanceof.gml new file mode 100644 index 0000000..fe3053d --- /dev/null +++ b/scripts/generic/assertInstanceof.gml @@ -0,0 +1,17 @@ +///assertInstanceof(id, ind) +/** + * assertInstanceof :: Instance -> Class -> Bool + * + * Asserts `id` is of type `ind`, either directly or via the parent hierarchy. + * + * @param id the instance to check + * @param ind the object type to check for + * @returns true if id is of type ind, false otherwise + */ + +var res = instanceof(argument0, argument1); + +assert(res, "'"+getInstObjName(argument0)+"' is not an instance of "+getInstObjName(argument1)); + +return res; + diff --git a/scripts/generic/cancelTouchEvent.gml b/scripts/generic/cancelTouchEvent.gml new file mode 100644 index 0000000..da6b430 --- /dev/null +++ b/scripts/generic/cancelTouchEvent.gml @@ -0,0 +1,9 @@ +///cancelTouchEvent() +/** + * cancelTouchEvent :: () -> () + * + * Stops a touch event by resetting the touch_id. + */ + +global.touch_id = -1; + diff --git a/scripts/generic/delete.gml b/scripts/generic/delete.gml new file mode 100644 index 0000000..d7ff85e --- /dev/null +++ b/scripts/generic/delete.gml @@ -0,0 +1,12 @@ +///delete(id) +/** + * delete :: Instance -> () + * + * Removes an instance. + * + * @param the instance id + */ + +with (argument0) + instance_destroy(); + diff --git a/scripts/generic/format.gml b/scripts/generic/format.gml new file mode 100644 index 0000000..d621ddc --- /dev/null +++ b/scripts/generic/format.gml @@ -0,0 +1,107 @@ +#define format +///format(str, arg...) +/** + * format :: String -> ... -> String + * + * Formats a string by replacing parameters `%` by the given values. + * A parameter is either an escape sequence or a conversion type. + * + * Available escape sequences: + * - `%%` for a percent sign `%` + * - `%'` for a double quote `"` + * - `%"` for a single quote `'` + * - `%t` for a tab character + * - `%n` for a newline + * + * Available parameter conversions: + * - `%s` for a string + * - `%i` for a decimal integer + * - `%x` for a hexadecimal integer + * - `%f` for a real value + * - `%o` for an instance or object + * - `%c` for a HTML colour code (`#RRGGBB`) + * - `%dm` for a ds_map + * + * @param str the format string + * @param arg any value that is compatible with its respective conversion format + * @returns a formatted string + */ + +var str = argument[0]; + +var in = str; +var out = ""; +var i = 1; + +for (var pos = string_pos("%", in); pos > 0; pos = string_pos("%", in)) { + out += string_copy(in, 1, pos-1); + var token = _format_get_token(string_delete(in, 1, pos)); + in = string_delete(in, 1, pos+string_length(token)); + + if (token == "") + show_error("Unexpected format parameter.", false); + else + switch (token) { + case "%": + out += "%"; + break; + case "'": + out += '"'; + break; + case '"': + out += "'"; + break; + case "n": + out += chr($A); + break; + case "t": + out += chr($9); + break; + case "s": + out += string(argument[i]); + i++; + break; + case "i": + out += string(floor(argument[i])); + i++; + break; + case "x": + out += string_base(floor(argument[i]), 16); + i++; + break; + case "f": + out += string(argument[i]); + i++; + break; + case "o": + out += getInstObjName(argument[i]); + i++; + break; + case "c": + var r = ((argument[i] >> 0) mod 256) << 16; + var g = ((argument[i] >> 8) mod 256) << 8; + var b = ((argument[i] >> 16) mod 256) << 0; + + out += "#"+string_base(r+g+b, 16); + i++; + break; + default: + show_error("Unexpected format parameter '%"+token+"'.", false); + } +} + + +out += in; + +return out; + + +#define _format_get_token +if (string_pos(string_char_at(argument0, 1), "%'nt"+'"') > 0) + return string_copy(argument0, 1, 1); +if (string_pos(string_char_at(argument0, 1), "sixfoc") > 0) + return string_copy(argument0, 1, 1); +if (string_pos(string_char_at(argument0, 1), "d") > 0) + return string_copy(argument0, 1, 2); + +return ""; diff --git a/scripts/generic/getInstObjName.gml b/scripts/generic/getInstObjName.gml new file mode 100644 index 0000000..80095b2 --- /dev/null +++ b/scripts/generic/getInstObjName.gml @@ -0,0 +1,36 @@ +///getInstObjName(i) +/** + * getInstObjName :: Any -> String + * + * Returns the given instance/object/keyword as a string. + */ + +if (!is_real(argument0)) + return "[NaN "+string(argument0)+"]"; + +if (argument0 >= 0) { + if (object_exists(argument0)) + return "<"+object_get_name(argument0)+">"; + if (instance_exists(argument0)) + return "<"+object_get_name(argument0.object_index)+"@"+string(argument0)+">"; + + return "[unknown "+string(argument0)+"]"; +} + +switch (argument0) { +case global: + return "global"; +case -7: + return "local"; +case self: + return "self"; +case other: + return "other"; +case noone: + return "noone"; +case all: + return "all"; +} + +return "[unknown "+string(argument0)+"]"; + diff --git a/scripts/generic/hermite.gml b/scripts/generic/hermite.gml new file mode 100644 index 0000000..bb4a351 --- /dev/null +++ b/scripts/generic/hermite.gml @@ -0,0 +1,17 @@ +///hermite(x0, dx0, x1, dx1, t) +/** + * hermite :: Real -> Real -> Real -> Real -> Real -> Real + * + * Cubic Hermite interpolation between `x0` and `x1` with tangents `dx0` and `dx1` given a time 0 <= `t` <= 1. + * + * @param x0 the value of x at t=0 + * @param dx0 the tangent of x at t=0 + * @param x1 the value of x at t=1 + * @param dx1 the tangent of x at t=1 + * @param t the interpolation parameter 0<=t<=1 + * @returns the value x(t) + */ +var t = argument4, t2 = t*t, t3 = t2*t; + +return (2*t3-3*t2+1)*argument0+(t3-2*t2+t)*argument1+(-2*t3+3*t2)*argument2+(t3-t2)*argument3; + diff --git a/scripts/generic/instanceof.gml b/scripts/generic/instanceof.gml new file mode 100644 index 0000000..b89d475 --- /dev/null +++ b/scripts/generic/instanceof.gml @@ -0,0 +1,23 @@ +///instanceof(id, ind) +/** + * instanceof :: Instance -> Class -> Boolean + * + * Returns whether `id` is of type `ind`, either directly or via the parent hierarchy. + * + * @param id the instance to check + * @param ind the object type to check for + * @returns true if id is of type ind, false otherwise + */ + +var inst = argument0; +var ind = argument1; + +if (!instance_exists(inst)) + return false; + +for (var obj = inst.object_index; object_exists(obj); obj = object_get_parent(obj)) + if (obj == ind) + return true; + +return false; + diff --git a/scripts/generic/new.gml b/scripts/generic/new.gml new file mode 100644 index 0000000..89c6b18 --- /dev/null +++ b/scripts/generic/new.gml @@ -0,0 +1,12 @@ +///new(ind) +/** + * new :: Class -> Instance + * + * Creates an instance of object `ind`. + * + * @param ind the object class of the desired instance + * @returns an instance id + */ + +return instance_create(0, 0, argument0); + diff --git a/scripts/generic/performAs.gml b/scripts/generic/performAs.gml new file mode 100644 index 0000000..1e39032 --- /dev/null +++ b/scripts/generic/performAs.gml @@ -0,0 +1,11 @@ +///performAs(ind) +/** + * performAs :: Class -> () + * + * Performs the current event within another class on the current instance. + * + * @param ind the object whose event to perform + */ + +event_perform_object(argument0, event_type, event_number); + diff --git a/scripts/generic/string_base.gml b/scripts/generic/string_base.gml new file mode 100644 index 0000000..99af1a6 --- /dev/null +++ b/scripts/generic/string_base.gml @@ -0,0 +1,39 @@ +///string_base(val, base) +/** + * string_base :: Integer -> Integer -> String + * + * Converts an integer to a string using a given base. + * + * @param val the number to convert + * @param base the number base to use + * @returns a string representation of the number + */ + +var val = floor(argument0); +var base = floor(argument1); +var symbols = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + +if (base == 10) + return string(val); + +if (val < 0) + return "-"+string_base(val, base); + +if (base == 1) + return string_repeat("1", val); + +if (base <= 0 || base > string_length(symbols)) { + show_error("Unsupported base '"+string(base)+"'.", false); + return "0"; +} + +if (val == 0) + return "0"; + + + +for (var str = ""; val > 0; val = val div base) + str = string_char_at(symbols, 1+(val mod base))+str; + +return str; + diff --git a/scripts/graph/addLink.gml b/scripts/graph/addLink.gml new file mode 100644 index 0000000..79b0807 --- /dev/null +++ b/scripts/graph/addLink.gml @@ -0,0 +1,19 @@ +///addLink(from, to) +/** + * addLink :: TypeConLink -> TypeConLink -> () + * + * Adds an edge from one type con to another. + * + * @param from the source of the edge + * @param to the target of the edge + */ + +var from = argument0; +var to = argument1; + +assertInstanceof(from, TypeConLink); +assertInstanceof(to, TypeConLink); + +ds_list_add(from.to, to); +ds_set_add(to.from, from); + diff --git a/scripts/graph/removeLink.gml b/scripts/graph/removeLink.gml new file mode 100644 index 0000000..d8d4595 --- /dev/null +++ b/scripts/graph/removeLink.gml @@ -0,0 +1,21 @@ +///removeLink(from, to) +/** + * removeLink :: TypeConLink -> TypeConLink -> () + * + * Removes an edge from one type con to another. + * + * @param from the source of the edge + * @param to the target of the edge + */ + +var from = argument0; +var to = argument1; + +assertInstanceof(from, TypeConLink); +assertInstanceof(to, TypeConLink); + +ds_list_delete(from.to, ds_list_find_index(from.to, to)); + +if (ds_list_find_index(from.to, to) == -1) + ds_set_delete(to.from, from); + diff --git a/scripts/graph/replaceLink.gml b/scripts/graph/replaceLink.gml new file mode 100644 index 0000000..49c0d56 --- /dev/null +++ b/scripts/graph/replaceLink.gml @@ -0,0 +1,26 @@ +///replaceLink(from, toOld, toNew) +/** + * replaceLink :: TypeConLink -> TypeConLink -> TypeConLink -> () + * + * Replaces an edge between one type con and another with a new target. + * + * @param from the source of the edge + * @param toOld the current target of the edge + * @param toNew the new target of the edge + */ + +var from = argument0; +var toOld = argument1; +var toNew = argument2; + +assertInstanceof(from, TypeConLink); +assertInstanceof(toOld, TypeConLink); +assertInstanceof(toNew, TypeConLink); + +assert(toOld != toNew, "Replacing link from "+getInstObjName(from)+" to "+getInstObjName(toOld)+" by itself."); + +ds_list_replace(from.to, ds_list_find_index(from.to, toOld), toNew); +if (ds_list_find_index(from.to, toOld) == -1) + ds_set_delete(toOld.from, from); +ds_set_add(toNew.from, from); + diff --git a/scripts/scene/layout.gml b/scripts/scene/layout.gml new file mode 100644 index 0000000..5e68432 --- /dev/null +++ b/scripts/scene/layout.gml @@ -0,0 +1,14 @@ +///layout(id) +/** + * layout :: SceneNode -> () + * + * Updates the dimensions and position of a scene node. + * + * @param id the SceneNode to update + */ + +with (argument0) { + event_user(0); + event_user(1); +} + diff --git a/scripts/scene/setMargin.gml b/scripts/scene/setMargin.gml new file mode 100644 index 0000000..e48f25d --- /dev/null +++ b/scripts/scene/setMargin.gml @@ -0,0 +1,20 @@ +///setMargin(top, right, bottom, left) +/** + * setMargin :: Real -> Real -> Real -> Real -> () + * + * Sets the margins of a scene node. + * + * @param top the new top margin + * @param right the new right margin + * @param bottom the new bottom margin + * @param left the new left margin + */ + +if (!instanceof(id, SceneNode)) + show_error("Cannot set margins because this instance is not a "+object_get_name(SceneNode), true); + +self.marginTop = argument0; +self.marginRight = argument1; +self.marginBottom = argument2; +self.marginLeft = argument3; + diff --git a/scripts/scene/setPadding.gml b/scripts/scene/setPadding.gml new file mode 100644 index 0000000..066fdd1 --- /dev/null +++ b/scripts/scene/setPadding.gml @@ -0,0 +1,20 @@ +///setPadding(top, right, bottom, left) +/** + * setPadding :: Real -> Real -> Real -> Real -> () + * + * Sets the padding of a scene node. + * + * @param top the new top padding + * @param right the new right padding + * @param bottom the new bottom padding + * @param left the new left padding + */ + +if (!instanceof(id, SceneNode)) + show_error("Cannot set padding because this instance is not a "+object_get_name(SceneNode), true); + +self.paddingTop = argument0; +self.paddingRight = argument1; +self.paddingBottom = argument2; +self.paddingLeft = argument3; + diff --git a/scripts/set/ds_set_add.gml b/scripts/set/ds_set_add.gml new file mode 100644 index 0000000..fe88801 --- /dev/null +++ b/scripts/set/ds_set_add.gml @@ -0,0 +1,13 @@ +///ds_set_add(set, val) +/** + * ds_set_add :: Set a -> a -> Boolean + * + * Adds an element to the set. Returns whether the element was newly added. + * + * @param set the set resource + * @param val the value to add to the set + * @returns true if the element was added, false if it already exists + */ + +return ds_map_add(argument0, argument1, 0); + diff --git a/scripts/set/ds_set_add_all.gml b/scripts/set/ds_set_add_all.gml new file mode 100644 index 0000000..5efc466 --- /dev/null +++ b/scripts/set/ds_set_add_all.gml @@ -0,0 +1,16 @@ +///ds_set_add_all(a, b) +/** + * ds_set_add_all :: Set a -> Set a -> () + * + * Adds all elements from set `b` to `a`. + * + * @param a the set to add elements to + * @param b the set of elements to add + */ + +var a = argument0; +var b = argument1; + +for (var el = ds_set_first(b); ds_set_exists(b, el); el = ds_set_next(b, el)) + ds_set_add(a, el); + diff --git a/scripts/set/ds_set_choose.gml b/scripts/set/ds_set_choose.gml new file mode 100644 index 0000000..9726ec6 --- /dev/null +++ b/scripts/set/ds_set_choose.gml @@ -0,0 +1,18 @@ +///ds_set_choose(set) +/** + * ds_set_choose :: Set a -> a + * + * Returns a random element from the set or `undefined` if the set is empty. + * + * @param set the set resource + * @returns an element of the set or undefined + */ + +var set = argument0; +var element = ds_map_find_first(set); + +repeat (irandom(ds_map_size(set)-1)) + element = ds_map_find_next(set, element); + +return element; + diff --git a/scripts/set/ds_set_clear.gml b/scripts/set/ds_set_clear.gml new file mode 100644 index 0000000..5c59602 --- /dev/null +++ b/scripts/set/ds_set_clear.gml @@ -0,0 +1,10 @@ +///ds_set_clear(set) +/** + * ds_set_clear :: Set a -> () + * + * Removes all element from a set. + * + * @param set the set resource + */ + +ds_map_clear(argument0); diff --git a/scripts/set/ds_set_copy.gml b/scripts/set/ds_set_copy.gml new file mode 100644 index 0000000..77070dd --- /dev/null +++ b/scripts/set/ds_set_copy.gml @@ -0,0 +1,11 @@ +///ds_set_copy(set) +/** + * ds_set_copy :: Set a -> Set a + * + * Returns a copy of the given set. + * + * @param set the set resource + * @returns a copy of all elements of this set + */ + +return ds_map_copy(argument0, ds_map_create()); diff --git a/scripts/set/ds_set_create.gml b/scripts/set/ds_set_create.gml new file mode 100644 index 0000000..238f74c --- /dev/null +++ b/scripts/set/ds_set_create.gml @@ -0,0 +1,10 @@ +///ds_set_create() +/** + * ds_set_create :: () -> Set a + * + * Creates a new set. + * + * @returns the set id + */ + +return ds_map_create(); diff --git a/scripts/set/ds_set_delete.gml b/scripts/set/ds_set_delete.gml new file mode 100644 index 0000000..bef3f48 --- /dev/null +++ b/scripts/set/ds_set_delete.gml @@ -0,0 +1,17 @@ +///ds_set_delete(set, val) +/** + * ds_set_delete :: Set a -> a -> () + * + * Removes an element from the set. Returns whether the element was present in the set. + * + * @param set the set resource + * @param val the value to remove from the set + * @returns true if the element was removed, false if it was not present + */ + +if (ds_map_exists(argument0, argument1)) { + ds_map_delete(argument0, argument1); + return true; +} +else + return false; diff --git a/scripts/set/ds_set_destroy.gml b/scripts/set/ds_set_destroy.gml new file mode 100644 index 0000000..3bdfec5 --- /dev/null +++ b/scripts/set/ds_set_destroy.gml @@ -0,0 +1,10 @@ +///ds_set_destroy(set) +/** + * ds_set_destroy :: Set a -> () + * + * Destroys a set. + * + * @param set the set resource + */ + +ds_map_destroy(argument0); diff --git a/scripts/set/ds_set_empty.gml b/scripts/set/ds_set_empty.gml new file mode 100644 index 0000000..6be948c --- /dev/null +++ b/scripts/set/ds_set_empty.gml @@ -0,0 +1,11 @@ +///ds_set_empty(set) +/** + * ds_set_empty :: Set a -> Boolean + * + * Returns whether the given set is empty. + * + * @param set the set resource + * @returns true if the set has no elements, false otherwise + */ + +return ds_map_empty(argument0); diff --git a/scripts/set/ds_set_exists.gml b/scripts/set/ds_set_exists.gml new file mode 100644 index 0000000..286e4e6 --- /dev/null +++ b/scripts/set/ds_set_exists.gml @@ -0,0 +1,12 @@ +///ds_set_exists(set, val) +/** + * ds_set_exists :: Set a -> a -> Boolean + * + * Returns whether the given set contains the given value. + * + * @param set the set resource + * @param val the value to find + * @returns true if the element is present, false otherwise + */ + +return ds_map_exists(argument0, argument1); diff --git a/scripts/set/ds_set_first.gml b/scripts/set/ds_set_first.gml new file mode 100644 index 0000000..7d84e9e --- /dev/null +++ b/scripts/set/ds_set_first.gml @@ -0,0 +1,12 @@ +///ds_set_first(set) +/** + * ds_set_first :: Set a -> a + * + * Returns the 'first' element of the set for iterating over it. + * Guarantees all elements will be enumerated with subsequent calls to {@link ds_set_next}. + * + * @param set the set resource + * @returns an element of the set + */ + +return ds_map_find_first(argument0); diff --git a/scripts/set/ds_set_is_disjoint.gml b/scripts/set/ds_set_is_disjoint.gml new file mode 100644 index 0000000..848d857 --- /dev/null +++ b/scripts/set/ds_set_is_disjoint.gml @@ -0,0 +1,20 @@ +///ds_set_is_disjoint(a, b) +/** + * ds_set_is_disjoint :: Set a -> Set a -> Boolean + * + * Returns whether sets `a` and `b` are disjoint. + * + * @param a one set + * @param b another set + * @returns true if a and b have no common element, false otherwise + */ + +var a = argument0; +var b = argument1; + +for (var el = ds_set_first(a); ds_set_exists(a, el); el = ds_set_next(a, el)) + if (ds_set_exists(b, el)) + return false; + +return true; + diff --git a/scripts/set/ds_set_is_equal.gml b/scripts/set/ds_set_is_equal.gml new file mode 100644 index 0000000..1c01625 --- /dev/null +++ b/scripts/set/ds_set_is_equal.gml @@ -0,0 +1,13 @@ +///ds_set_is_equal(a, b) +/** + * ds_set_is_equal :: Set a -> Set a -> Boolean + * + * Returns whether sets `a` and `b` are equal. + * + * @param a one set + * @param b another set + * @returns true if all elements appear in both sets, false otherwise + */ + +return (ds_set_is_subset(a, b) && ds_set_is_subset(b, a)); + diff --git a/scripts/set/ds_set_is_subset.gml b/scripts/set/ds_set_is_subset.gml new file mode 100644 index 0000000..8597045 --- /dev/null +++ b/scripts/set/ds_set_is_subset.gml @@ -0,0 +1,20 @@ +///ds_set_is_subset(a, b) +/** + * ds_set_is_subset :: Set a -> Set a -> Boolean + * + * Returns whether set `a` is a subset of set `b`. + * + * @param a one set + * @param b another set + * @returns true if all elements of a appear in b, false otherwise + */ + +var a = argument0; +var b = argument1; + +for (var el = ds_set_first(a); ds_set_exists(a, el); el = ds_set_next(a, el)) + if (!ds_set_exists(b, el)) + return false; + +return true; + diff --git a/scripts/set/ds_set_last.gml b/scripts/set/ds_set_last.gml new file mode 100644 index 0000000..b23fc92 --- /dev/null +++ b/scripts/set/ds_set_last.gml @@ -0,0 +1,12 @@ +///ds_set_last(set) +/** + * ds_set_last :: Set a -> a + * + * Returns the 'last' element of the set for iterating over it. + * Guarantees all elements will be enumerated with subsequent calls to {@link ds_set_previous}. + * + * @param set the set resource + * @returns an element of the set + */ + +return ds_map_find_last(argument0); diff --git a/scripts/set/ds_set_next.gml b/scripts/set/ds_set_next.gml new file mode 100644 index 0000000..ad4bf81 --- /dev/null +++ b/scripts/set/ds_set_next.gml @@ -0,0 +1,12 @@ +///ds_set_next(set, val) +/** + * ds_set_next :: Set a -> a -> a + * + * Returns the 'next' element of the set given a current element or `undefined` if the element is {@link ds_set_last}. + * Guarantees it will return the input value when composed with {@link ds_set_previous}. + * + * @param set the set resource + * @returns an element of the set or undefined + */ + +return ds_map_find_next(argument0, argument1); diff --git a/scripts/set/ds_set_previous.gml b/scripts/set/ds_set_previous.gml new file mode 100644 index 0000000..379e5aa --- /dev/null +++ b/scripts/set/ds_set_previous.gml @@ -0,0 +1,12 @@ +///ds_set_previous(set, val) +/** + * ds_set_previous :: Set a -> a -> a + * + * Returns the 'previous' element of the set given a current element or `undefined` if the element is {@link ds_set_first}. + * Guarantees it will return the input value when composed with {@link ds_set_next}. + * + * @param set the set resource + * @returns an element of the set or undefined + */ + +return ds_map_find_previous(argument0, argument1); diff --git a/scripts/set/ds_set_size.gml b/scripts/set/ds_set_size.gml new file mode 100644 index 0000000..bb30480 --- /dev/null +++ b/scripts/set/ds_set_size.gml @@ -0,0 +1,11 @@ +///ds_set_size(set) +/** + * ds_set_size :: Set a -> Integer + * + * Returns the number of elements in the given set. + * + * @param set the set resource + * @returns the number of elements in this set + */ + +return ds_map_size(argument0); diff --git a/scripts/treenode/addChild.gml b/scripts/treenode/addChild.gml new file mode 100644 index 0000000..5253f3b --- /dev/null +++ b/scripts/treenode/addChild.gml @@ -0,0 +1,13 @@ +///addChild(parent, child) +/** + * addChild :: TreeNode -> TreeNode -> () + * + * Adds `child` to the list of children in `parent` and sets the parent of the `child` to `parent`. + * + * @param parent the parent TreeNode + * @param child the child TreeNode + */ + +ds_list_add(argument0.children, argument1); +argument1.parent = argument0; + diff --git a/scripts/treenode/hasChild.gml b/scripts/treenode/hasChild.gml new file mode 100644 index 0000000..0b3e201 --- /dev/null +++ b/scripts/treenode/hasChild.gml @@ -0,0 +1,13 @@ +///hasChild(parent, id) +/** + * hasChild :: TreeNode -> TreeNode -> Boolean + * + * Returns whether `parent` directly contains `id` as a child. + * + * @param parent the parent TreeNode + * @param id the child TreeNode + * @returns true if id is a child of parent + */ + +return ds_list_find_index(argument0.children, argument1); + diff --git a/scripts/treenode/hasParentNode.gml b/scripts/treenode/hasParentNode.gml new file mode 100644 index 0000000..dc65b05 --- /dev/null +++ b/scripts/treenode/hasParentNode.gml @@ -0,0 +1,17 @@ +///hasParentNode(id, ind) +/** + * hasParentNode :: TreeNode -> Class -> Bool + * + * Returns whether `id` has a parent node of type `ind` somewhere up the tree. + * + * @param id the node to check + * @param ind the node type type to look for + * @returns true if id has a parent of type ind, false otherwise + */ + +for (var node = argument0.parent; node != noone; node = node.parent) + if (node.object_index == argument1) + return true; + +return false; + diff --git a/scripts/treenode/removeChild.gml b/scripts/treenode/removeChild.gml new file mode 100644 index 0000000..ee98368 --- /dev/null +++ b/scripts/treenode/removeChild.gml @@ -0,0 +1,13 @@ +///removeChild(parent, child) +/** + * removeChild :: TreeNode -> TreeNode -> () + * + * Removes `child` from the list of children in `parent` and sets the parent of the `child` to noone. + * + * @param parent the parent TreeNode + * @param child the child TreeNode + */ + +ds_list_delete(argument0.children, ds_list_find_index(argument0.children, argument1)); +argument1.parent = noone; + diff --git a/scripts/typing/copyType.gml b/scripts/typing/copyType.gml new file mode 100644 index 0000000..4920d7c --- /dev/null +++ b/scripts/typing/copyType.gml @@ -0,0 +1,38 @@ +///copyType(id) +/** + * copyType :: Type -> Type + * + * Returns a deep copy of the given type instance. + * + * @param id the type to copy + */ + +assert(false, "deprecated"); + +var orig = argument0; +var copy = new(orig.object_index); + +for (var trait = ds_set_first(orig.traits); ds_set_exists(orig.traits, trait); trait = ds_set_next(orig.traits, trait)) { + var newTrait = new(trait.object_index); + newTrait.parameter = trait.parameter; + ds_set_add(copy.traits, newTrait); + addChild(copy, newTrait); +} + +if (instanceof(orig, ParametricType)) + setParameter(copy, orig.parameter); + +if (instanceof(orig, UnaryType)) { + copy.first = copyType(orig.first); + addChild(copy, copy.first); +} + +if (instanceof(orig, BinaryType)) { + copy.first = copyType(orig.first); + copy.second = copyType(orig.second); + addChild(copy, copy.first); + addChild(copy, copy.second); +} + +return copy; + diff --git a/scripts/typing/freshTypes.gml b/scripts/typing/freshTypes.gml new file mode 100644 index 0000000..ea854f1 --- /dev/null +++ b/scripts/typing/freshTypes.gml @@ -0,0 +1,117 @@ +#define freshTypes +///freshTypes(block) +/** + * freshTypes :: Block -> () + * + * Refreshes the anchor types of this block. + * + * @param block the block to refresh + */ + +var block = argument0; + +assertInstanceof(block, Block); + +with (block) { + for (var i = 0; i < ds_list_size(self.children); i++) + if (instanceof(self.children[|i], Anchor)) { + var anchor = self.children[|i]; + + if (!ds_list_empty(anchor.children)) + delete(anchor.children[|0]); + } + + var tmap = ds_map_create(); + var vmap = ds_map_create(); + for (var i = 0; i < ds_list_size(children); i++) + if (instanceof(self.children[|i], Anchor)) { + var anchor = self.children[|i]; + + if (anchor.currentType != noone) { + if (!instanceof(anchor.currentType, TypeCon1Link)) + removeType(anchor.currentType); + + anchor.currentType = noone; + } + + anchor.currentType = copyFreshCon(tmap, vmap, anchor.freshType); + addChild(anchor, createTypeInstance(anchor.currentType.to[|0])); + } + + ds_map_destroy(tmap); + ds_map_destroy(vmap); +} + + +#define copyFreshCon +///copyFreshCon(cmap, vmap, id) +/** + * copyFreshCon :: Map TypeConLink TypeConLink -> Map FreeType FreeType -> TypeConLink -> TypeConLink + * + * Returns a deep copy of the given type structure with fresh type variables. + * + * @param cmap a map of old cons to fresh ones + * @param vmap a map of old free types to fresh ones + * @param id the type to copy + */ + +var cmap = argument0; +var vmap = argument1; +var con = argument2; + +assertInstanceof(con, TypeConLink); + +if (!ds_map_exists(cmap, con)) { + if (instanceof(con, TypeCon1Link)) { + if (instanceof(con.type, FreeType)) + with (new(TypeCon1Link)) { + self.type = copyFreshType(vmap, con.type); + + cmap[?con] = id; + } + else + return con; + } + else if (instanceof(con, TypeConLink)) + with (new(TypeConLink)) { + for (var i = 0; i < ds_list_size(con.to); i++) + addLink(id, copyFreshCon(cmap, vmap, con.to[|i])); + + cmap[?con] = id; + } +} + +return cmap[?con]; + + +#define copyFreshType +///copyFreshType(vmap, id) +/** + * copyFreshType :: Map FreeType FreeType -> Type -> Type + * + * Returns a copy of the given type with a fresh type variable (if applicable). + * + * @param vmap a map of old free types to fresh ones + * @param id the type to copy + */ + +var vmap = argument0; +var type = argument1; + +assertInstanceof(type, Type); + +if (instanceof(type, ConcreteType)) + return type; + +if (instanceof(type, FreeType)) { + if (!ds_map_exists(vmap, type)) + with (new(FreeType)) { + ds_set_add_all(self.traits, type.traits); + + vmap[?type] = id; + } + + return vmap[?type]; +} + +assert(false, "Unknown type "+getInstObjName(type)); \ No newline at end of file diff --git a/scripts/typing/getRandomType.gml b/scripts/typing/getRandomType.gml new file mode 100644 index 0000000..18e5c9d --- /dev/null +++ b/scripts/typing/getRandomType.gml @@ -0,0 +1,32 @@ +///getRandomType(conset) +/** + * getRandomType :: Set TypeCon1Link -> TypeConLink + * + */ + +var conset = argument0; +var con; + +if (irandom_range(0, sqrt(ds_set_size(conset))) == 0) { + con = new(choose(TypeConLink, TypeCon1Link, TypeCon1Link, TypeCon1Link)); + + if (instanceof(con, TypeCon1Link)) { + con.type = new(choose(FreeType, ConcreteType)); + ds_set_add(conset, con); + } + else { + if (random(1) < 0.50) { + addLink(con, function); + addLink(con, getRandomType(conset)); + addLink(con, getRandomType(conset)); + } + else + repeat (irandom_range(1, 3)) + addLink(con, getRandomType(conset)); + } +} +else + con = ds_set_choose(conset); + +return con; + diff --git a/scripts/typing/removeType.gml b/scripts/typing/removeType.gml new file mode 100644 index 0000000..a7a262f --- /dev/null +++ b/scripts/typing/removeType.gml @@ -0,0 +1,31 @@ +///removeType(con) +/** + * removeType :: TypeConLink -> () + * + * Removes a type con and all orphaned children. + * + * @param con the type con to remove + */ + +var con = argument0; + +assertInstanceof(con, TypeConLink); + +var visited = ds_set_create(); + +repeat (ds_list_size(con.to)) { + var to = con.to[|0]; + removeLink(con, to); + if (ds_set_empty(to.from)) + removeType(to); +} + +repeat (ds_set_size(con.from)) { + removeLink(ds_set_first(con.from), con); +} + +if (instanceof(con, TypeCon1Link)) + delete(con.type); + +delete(con); + diff --git a/scripts/typing/setParameter.gml b/scripts/typing/setParameter.gml new file mode 100644 index 0000000..cf3ab03 --- /dev/null +++ b/scripts/typing/setParameter.gml @@ -0,0 +1,27 @@ +///setParameter(type, param) +/** + * setParameter :: ParametricType -> Parameter -> () + * + * Changes the parameter (name/link) of a parametrized type. + * + * @param type the type instance to change + * @param param the new parameter + */ +var type = argument0; +var param = argument1; + +if (type.parameter == param) + exit; + +with (type.parameter) { + ds_set_delete(self.types, type); + + if (ds_set_empty(self.types)) + delete(id); +} + +with (param) + ds_set_add(self.types, type); + +type.parameter = param; + diff --git a/scripts/typing/testUnify.gml b/scripts/typing/testUnify.gml new file mode 100644 index 0000000..4669f1b --- /dev/null +++ b/scripts/typing/testUnify.gml @@ -0,0 +1,111 @@ +#define testUnify +///testUnify(a, b) +/** + * testUnify :: TypeConLink -> TypeConLink -> Boolean + * + * Returns whether types `a` and `b` can be unified. + * + * @param a the first type con + * @param b the second type con + * @returns true if a and b can be unified, false otherwise + */ +var a = argument0; +var b = argument1; + +assertInstanceof(a, TypeConLink); +assertInstanceof(b, TypeConLink); + + +//same instance can always be unified +if (a == b) + return true; + + +//test whether inhabited type can be unified +if (instanceof(a, TypeCon1Link) && instanceof(b, TypeCon1Link)) + return testUnifyType(a.type, b.type); + + +//inhabited type can only be unified with type con if it is a free type +if (!instanceof(a, TypeCon1Link) && instanceof(b, TypeCon1Link)) + return testUnify(b, a); +if (instanceof(a, TypeCon1Link) && !instanceof(b, TypeCon1Link)) { + if (instanceof(a.type, FreeType) && !containsType(a.type, b) && instanceof(b.to[|0], TypeCon1Link)) + return testUnify(a, b.to[|0]); + else + return false; +} + +//type cons can only be unified if they have the same arity and their inhabited types match +if (!instanceof(a, TypeCon1Link) && !instanceof(b, TypeCon1Link)) { + if (ds_list_size(a.to) != ds_list_size(b.to)) + return false; + + for (var i = 0; i < ds_list_size(a.to); i++) + if (!testUnify(a.to[|i], b.to[|i])) + return false; + + return true; +} + + +#define testUnifyType +///testUnify(a, b) +/** + * testUnify :: Type -> Type -> Boolean + * + * Returns whether types `a` and `b` can be unified. + * + * @param a the first type + * @param b the second type + * @returns true if a and b can be unified, false otherwise + */ + +var a = argument0; +var b = argument1; + +assertInstanceof(a, Type); +assertInstanceof(b, Type); + +//the same type can always be unified +if (a == b) + return true; + + +//two free variables can always be unified +if (instanceof(a, FreeType) && instanceof(b, FreeType)) + return true; + + +//a type variable can be unified with a concrete type iff its traits are a subset of the concrete traits +if (instanceof(a, FreeType) && !instanceof(b, FreeType)) + return ds_set_is_subset(a.traits, b.traits); +if (!instanceof(a, FreeType) && instanceof(b, FreeType)) + return ds_set_is_subset(b.traits, a.traits); + + +//two different concrete types cannot be unified +return false; +#define containsType +///containsType(type, con) +/** + * containsType :: FreeType -> TypeConLink -> Boolean + * + * Returns whether a free type appears within a typecon. + */ + +var type = argument0; +var con = argument1; + +assertInstanceof(type, FreeType); +assertInstanceof(con, TypeConLink); + +if (instanceof(con, TypeCon1Link)) + return con.type == type; +else + for (var i = 0; i < ds_list_size(con.to); i++) + if (containsType(type, con.to[|i])) + return true; + +return false; + diff --git a/scripts/typing/unify.gml b/scripts/typing/unify.gml new file mode 100644 index 0000000..f522f4e --- /dev/null +++ b/scripts/typing/unify.gml @@ -0,0 +1,85 @@ +#define unify +///unify(a, b) +/** + * unify :: TypeConLink -> TypeConLink -> () + * + * Unifies types `a` and `b`. + * + * @param a the first type con + * @param b the second type con + */ +var a = argument0; +var b = argument1; + +assertInstanceof(a, TypeConLink); +assertInstanceof(b, TypeConLink); + +if (instanceof(a, TypeCon1Link) && instanceof(b, TypeCon1Link)) + unifyType(a, b); +else if (instanceof(a, TypeCon1Link) && !instanceof(b, TypeCon1Link)) + unify(b, a); +else if (!instanceof(a, TypeCon1Link) && instanceof(b, TypeCon1Link)) { + while (!ds_set_empty(b.from)) + replaceLink(ds_set_first(b.from), b, a); + + delete(b.type); + delete(b); + exit; + +} +else if (!instanceof(a, TypeCon1Link) && !instanceof(b, TypeCon1Link)) { + for (var i = 0; i < ds_list_size(a.to); i++) + unify(a.to[|i], b.to[|i]); +} + + +#define unifyType +///unifyType(a, b) +/** + * unifyType :: TypeConLink -> TypeConLink -> () + * + * Unifies types `a` and `b`. + * + * @param a the first type con + * @param b the second type con + */ +var a = argument0; +var b = argument1; + +assertInstanceof(a, TypeCon1Link); +assertInstanceof(b, TypeCon1Link); +assertInstanceof(a.type, Type); +assertInstanceof(b.type, Type); + +if (a == b) + exit; + +//unify free types by taking the union of their traits and destroying the second type +if (instanceof(a.type, FreeType) && instanceof(b.type, FreeType)) { + ds_set_add_all(a.type.traits, b.type.traits); + for (var trait = ds_set_first(b.type.traits); ds_set_exists(b.type.traits, trait); trait = ds_set_next(b.type.traits, trait)) + ds_set_add(a.type.traits, trait); + + while (!ds_set_empty(b.from)) + replaceLink(ds_set_first(b.from), b, a); + + delete(b.type); + delete(b); + exit; +} + + +//unify free type with concrete type by replacing all occurrences with the concrete type +if (instanceof(a.type, FreeType) && !instanceof(b.type, FreeType)) { + unify(b, a); + exit; +} + +if (!instanceof(a.type, FreeType) && instanceof(b.type, FreeType)) { + while (!ds_set_empty(b.from)) + replaceLink(ds_set_first(b.from), b, a); + + delete(b.type); + delete(b); + exit; +} \ No newline at end of file diff --git a/scripts/typing/unifyAnchors.gml b/scripts/typing/unifyAnchors.gml new file mode 100644 index 0000000..307ff15 --- /dev/null +++ b/scripts/typing/unifyAnchors.gml @@ -0,0 +1,16 @@ +///unifyAnchors(source, drain) +/** + * unifyAnchors :: OutputAnchor -> InputAnchor -> () + * + * Unifies two anchors. + * + * @param source the output anchor to unify + * @param drain the input anchor to unify + */ + +var source = argument0; +var drain = argument1; + + +unify(source.currentType.to[|0], drain.currentType.to[|0]); + diff --git a/sprites/images/pixel_0.png b/sprites/images/pixel_0.png new file mode 100644 index 0000000000000000000000000000000000000000..8ef45ceaba2fe131dadaa6ba1983d8211a6b6d2d GIT binary patch literal 70 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k92}1TpU9x<|HR1B>doKU}Rxrh<|$6 Q8z{lx>FVdQ&MBb@0Ha_Ih5!Hn literal 0 HcmV?d00001 diff --git a/sprites/mask/images/maskConnection_0.png b/sprites/mask/images/maskConnection_0.png new file mode 100644 index 0000000000000000000000000000000000000000..d1b74325a76e3039b05714133987d09b298e91de GIT binary patch literal 162 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJOivfbkcv5P&sp;UC0GLA*Jr-f zG5IGTA$&9Cb*1LX>9c3A=Uvy=8mhRx(9lU+rzzs-c0r8;R(7rxN833>9>~5IsApbL z;mV@GVA0@mg|)$<g}6!-Bda>A+VqH;-9SqjJYD@< J);T3K0RXm1HT?hp literal 0 HcmV?d00001 diff --git a/sprites/mask/maskConnection.sprite.gmx b/sprites/mask/maskConnection.sprite.gmx new file mode 100644 index 0000000..5f60dc2 --- /dev/null +++ b/sprites/mask/maskConnection.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 16 + 16 + 1 + 0 + 0 + 0 + 0 + 31 + 0 + 31 + 0 + 0 + + 0 + + 0 + 32 + 32 + + images\maskConnection_0.png + + diff --git a/sprites/pixel.sprite.gmx b/sprites/pixel.sprite.gmx new file mode 100644 index 0000000..7bafed8 --- /dev/null +++ b/sprites/pixel.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + 0 + + 0 + 1 + 1 + + images\pixel_0.png + + diff --git a/sprites/placeholder/images/placeholderBlock_0.png b/sprites/placeholder/images/placeholderBlock_0.png new file mode 100644 index 0000000000000000000000000000000000000000..4aff420f6dc3283ed3a858320a83b5ca843b1ff4 GIT binary patch literal 162 zcmeAS@N?(olHy`uVBq!ia0vp^0YI$4!3HE-jsNEWsZ387$B>FSZ!c`*JYXQe;yCr& zU-Q&dKbc5riNiWEb!TSHJbiBaKD!U!?>1D4ACMpe-eA6Pj?EyC`R^%V-F(G~ra(&> NJYD@<);T3K0RTekJ7E9- literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderCircleType_0.png b/sprites/placeholder/images/placeholderCircleType_0.png new file mode 100644 index 0000000000000000000000000000000000000000..44c81d86a2514fa75642d20c3e3a07421f451f5b GIT binary patch literal 129 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`9-c0aAr*6y6A}`B_$#LU@Yhqw zU^pW-iAUi{${w}{K|T&L!HOH>7Oi7!F-bOV*~J#{hIN&cLzziZuuqVa(vuXKPa!9K brX(;(ZJpZAc4^{zpqUJwu6{1-oD!M<>EkGY literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderError_0.png b/sprites/placeholder/images/placeholderError_0.png new file mode 100644 index 0000000000000000000000000000000000000000..09cee2d138d46b6a75e5eb58436816135e0c1058 GIT binary patch literal 143 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`VV*9IAr*7xPIeSxFkoT+`~UJ< z?dCU2g3TirN?km6y4v;paVJit(6Ejz+byPxZw{*ozfzWzpDB07ET7DI7c=5Q g1RgW6MTuW$*wbEmxHIzYIiR@=p00i_>zopr0FVeNumAu6 literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderInputAnchorWhite_0.png b/sprites/placeholder/images/placeholderInputAnchorWhite_0.png new file mode 100644 index 0000000000000000000000000000000000000000..4cba12d95615b11d93d88c78d96a1166c2d358aa GIT binary patch literal 97 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`8lEnWAr*6yfBgS%&#Wpjokh%aoD2lir8(-}2P?2fuL1~RiXGcqXGF6eSdGoJ|5!{F)a=d#Wzp$Pz2a~Z$@ literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderInputAnchor_0.png b/sprites/placeholder/images/placeholderInputAnchor_0.png new file mode 100644 index 0000000000000000000000000000000000000000..a182ff403f2b5ac2f2926e973b998e32fd5ff09a GIT binary patch literal 93 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`DxNNmAr*6y6BY>m=x6SiGFZX; qqrdf7DuY#Tu;IpvD-De13=D}E7suMI_;3KIp25@A&t;ucLK6Ta0UK2S literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderJaggedLine_0.png b/sprites/placeholder/images/placeholderJaggedLine_0.png new file mode 100644 index 0000000000000000000000000000000000000000..893f0aa7db3e3b4314d8348bd0ed5b4ae34e4e0b GIT binary patch literal 166 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJTu&Frkcv5PuRC%z7zi*QsGZS& zv;Ax0Kebm21H`Lyf(*D{Du&MRp32tXJk#JoT+mFu15X;C);_TPy7cK@#@mdy1ibPc zSm!uv)UsYU&cM8l`9%N1Kh7x)f68+jSSHBNKKUwnljCXT3GrwD@$O)VS6MP&Zc~B` P&|(HpS3j3^P6q)boQufwhP2fP;0yf`c1)8Wcm>COnCVYEXO{A;rM($l#Zc?wq=CpcxFF Lu6{1-oD!M<5*Z*r literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderMonoType_0.png b/sprites/placeholder/images/placeholderMonoType_0.png new file mode 100644 index 0000000000000000000000000000000000000000..a76740345a45b10cace4806feefbc798af8ae05e GIT binary patch literal 87 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`a-J@ZAr*6y6A}`B_$#LU@YjAy8=)RgQu&X%Q~loCIE8v5@rAZ literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderOrderLink_0.png b/sprites/placeholder/images/placeholderOrderLink_0.png new file mode 100644 index 0000000000000000000000000000000000000000..f0bc1a107161c53385cd129c249ac2667d208bfe GIT binary patch literal 108 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzV^0^ykcv5P&mH7tFyLX@_{Lsz y_R?1(PaaNw@b+dAGf)K(e9-qyg|HaP8P3Wj8}$`We|ba%B;@Jp=d#Wzp$P!ZVIF7z literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderOutputAnchorWhite_0.png b/sprites/placeholder/images/placeholderOutputAnchorWhite_0.png new file mode 100644 index 0000000000000000000000000000000000000000..587acf21aa39ea505117a2afb15ab768131ce151 GIT binary patch literal 97 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`8lEnWAr*6yfA}jVNSG!}kT}qA uL@h<5Eouhiiy0GI3v99uB$zd1@Gy8KE$AxRblVfChr!d;&t;ucLK6UwgB*|m literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderOutputAnchor_0.png b/sprites/placeholder/images/placeholderOutputAnchor_0.png new file mode 100644 index 0000000000000000000000000000000000000000..7d2501f56da7b50e8c439a981514c24988d8c91f GIT binary patch literal 98 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`nw~C>Ar*6y6A}`B_$$hpCImGzBn4#Qb&G${p4c*Vb$k`3EH9 M>FVdQ&MBb@0G~r6I{*Lx literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderParameter_0.png b/sprites/placeholder/images/placeholderParameter_0.png new file mode 100644 index 0000000000000000000000000000000000000000..e84fcdb542b7d888389f60b41605423098c2f432 GIT binary patch literal 115 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`R-P`7Ar*6yfBgS%_>1>H1 z1KSBB2H6QI40;Yz7+V6R literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderParameter_1.png b/sprites/placeholder/images/placeholderParameter_1.png new file mode 100644 index 0000000000000000000000000000000000000000..284b0cd0544a446a8946bfe3425411bf42916569 GIT binary patch literal 96 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`>Ygr+Ar*6yfBgS%_>1>H1 t1Do3<#v@F(Bn>_!8vNi<=wQFcz>v+Q$hGs3-#4HZ22WQ%mvv4FO#oxr8u9=D literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderParameter_2.png b/sprites/placeholder/images/placeholderParameter_2.png new file mode 100644 index 0000000000000000000000000000000000000000..05f2e71705706e9de49d84427f7ff5ebcdb96e59 GIT binary patch literal 120 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`_MR?|Ar*6yfBgS%_>1>H1 z1Dl5#gSf&ehM2C6U5||z=AZr`<#6J>#HSGRh9vy}RRPUDw^b@Ci#{HZW?;zXQsl}C SP&t;ucLK6UyL?g%m literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderParameter_3.png b/sprites/placeholder/images/placeholderParameter_3.png new file mode 100644 index 0000000000000000000000000000000000000000..8d20faf5b399019fc59a330253c5840431b0f53a GIT binary patch literal 137 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`0iG_7Ar*6yfBgS%_>8yz% z16#qzPBR8^g;U%+OcG36CNSRMQMBUOAla0tv9YluPs34P;I-1>H1 z16#qzLMaE12c``fXH5(nCb%`lDWqsSGH;M<(sK`zc+ed*=`e${u^sb=TV5x)o3-@? ajxdBAuzww}eu^v5NCr<=KbLh*2~7ay*eDDD literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderParameter_5.png b/sprites/placeholder/images/placeholderParameter_5.png new file mode 100644 index 0000000000000000000000000000000000000000..e391399964e1132c588ec8804eecd01bd4cd4c90 GIT binary patch literal 122 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`j-D=#Ar*6uUOLFj;K0G;_&a}A zwu6A_GoOlgdw3W&-qf;VytAA6#-$sq8E+Vj)-@P~HHaD?=rdj*s-5ts^X*@DIi(*O V%t{@x6M=>?c)I$ztaD0e0suKACv^Y- literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderParameter_6.png b/sprites/placeholder/images/placeholderParameter_6.png new file mode 100644 index 0000000000000000000000000000000000000000..1283fd37ea5caef522db1c4f6151466776e4917b GIT binary patch literal 124 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`&YmugAr*6yfBgS%_>8yz% z1Dl3fLx%GP&Pgd8dYp@R52|}kQEZvxaX}!7iEF*$5jSx^=MS1k*fY`@PF6hNWngG~ WpuxOby!I&2I0jEwKbLh*2~7akrX*zm literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderParameter_7.png b/sprites/placeholder/images/placeholderParameter_7.png new file mode 100644 index 0000000000000000000000000000000000000000..5d29605205632a962ad9b9fc6777a6233989ae4a GIT binary patch literal 109 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`CY~;iAr*6yfBgS%_>8$hl zhW}F}KFk+l{ui9YV5M-9A*UgOxqxvI&jI$f3MZ*0K+VlJB!zAXWl00|GkCiCxvXGAr*6yfBgS%_>Fi=Q mo@nL{*26a&8v9u%88Rrzsj}_hs=o|W%i!ti=d#Wzp$Pz}n;0Mf literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderParameter_9.png b/sprites/placeholder/images/placeholderParameter_9.png new file mode 100644 index 0000000000000000000000000000000000000000..4e1baf51ed5e0747101f097213db9cd2e1187640 GIT binary patch literal 93 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`DxNNmAr*6yfBgS%_>8yz% pgSdog!#uVJMg=O;4g&mp7#S{GYBD7qYy%m<;OXk;vd$@?2>{^H7!3db literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderTypeTrait_0.png b/sprites/placeholder/images/placeholderTypeTrait_0.png new file mode 100644 index 0000000000000000000000000000000000000000..e252dfe9225aa4970eb8e75c11c5693a7afbc1fa GIT binary patch literal 111 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`W}YsNAr*6y6A}`B_$wV_`0vSh zgGccsLr&X-9EM$r&Q};xoZVJ2GRt#|NIC=t9h)`N@v0o1xg>|Buo<`q#QT`&NFx!FeDwgYyaKDZXr+`gQu&X%Q~loCIIS09Vh?* literal 0 HcmV?d00001 diff --git a/sprites/placeholder/images/placeholderVariableType_0.png b/sprites/placeholder/images/placeholderVariableType_0.png new file mode 100644 index 0000000000000000000000000000000000000000..12cac48db505b4a1345f8ca3e69c3c0875ab8887 GIT binary patch literal 125 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`E}kxqAr*6y6AtkGdwjs9@&676 zMdyEyFZZNzgf(+y9eXac$TZowCFSgkwjL=5R%VSpw^b@Ct5i~(^c0r}9yX0I02;Pr W_RQwLA6Y>bF?hQAxvX + + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 13 + 0 + 13 + 0 + 0 + + 0 + + 0 + 14 + 14 + + images\placeholder_0.png + + diff --git a/sprites/placeholder/placeholderBlock.sprite.gmx b/sprites/placeholder/placeholderBlock.sprite.gmx new file mode 100644 index 0000000..c81e230 --- /dev/null +++ b/sprites/placeholder/placeholderBlock.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 79 + 0 + 31 + 0 + 0 + + 0 + + 0 + 80 + 32 + + images\placeholderBlock_0.png + + diff --git a/sprites/placeholder/placeholderError.sprite.gmx b/sprites/placeholder/placeholderError.sprite.gmx new file mode 100644 index 0000000..8205c66 --- /dev/null +++ b/sprites/placeholder/placeholderError.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 15 + 0 + 15 + 0 + 0 + + 0 + + 0 + 16 + 16 + + images\placeholderError_0.png + + diff --git a/sprites/placeholder/placeholderFunctionType.sprite.gmx b/sprites/placeholder/placeholderFunctionType.sprite.gmx new file mode 100644 index 0000000..6f93062 --- /dev/null +++ b/sprites/placeholder/placeholderFunctionType.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 23 + 0 + 15 + 0 + 0 + + 0 + + 0 + 24 + 16 + + images\placeholderFunctionType_0.png + + diff --git a/sprites/placeholder/placeholderInputAnchor.sprite.gmx b/sprites/placeholder/placeholderInputAnchor.sprite.gmx new file mode 100644 index 0000000..3b5188b --- /dev/null +++ b/sprites/placeholder/placeholderInputAnchor.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 8 + 15 + 1 + 0 + 0 + 0 + 0 + 15 + 1 + 15 + 0 + 0 + + 0 + + 0 + 16 + 16 + + images\placeholderInputAnchor_0.png + + diff --git a/sprites/placeholder/placeholderInputAnchorWhite.sprite.gmx b/sprites/placeholder/placeholderInputAnchorWhite.sprite.gmx new file mode 100644 index 0000000..4d21203 --- /dev/null +++ b/sprites/placeholder/placeholderInputAnchorWhite.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 8 + 15 + 1 + 0 + 0 + 0 + 0 + 15 + 1 + 15 + 0 + 0 + + 0 + + 0 + 16 + 16 + + images\placeholderInputAnchorWhite_0.png + + diff --git a/sprites/placeholder/placeholderLine.sprite.gmx b/sprites/placeholder/placeholderLine.sprite.gmx new file mode 100644 index 0000000..502286d --- /dev/null +++ b/sprites/placeholder/placeholderLine.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 0 + 4 + 1 + 0 + 0 + 0 + 0 + 63 + 0 + 8 + 0 + 0 + + 0 + + 0 + 64 + 9 + + images\placeholderLine_0.png + + diff --git a/sprites/placeholder/placeholderMonoType.sprite.gmx b/sprites/placeholder/placeholderMonoType.sprite.gmx new file mode 100644 index 0000000..8213d3d --- /dev/null +++ b/sprites/placeholder/placeholderMonoType.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 15 + 0 + 15 + 0 + 0 + + 0 + + 0 + 16 + 16 + + images\placeholderMonoType_0.png + + diff --git a/sprites/placeholder/placeholderOneUse.sprite.gmx b/sprites/placeholder/placeholderOneUse.sprite.gmx new file mode 100644 index 0000000..e7c88d4 --- /dev/null +++ b/sprites/placeholder/placeholderOneUse.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 5 + 0 + 15 + 0 + 0 + + 0 + + 0 + 6 + 16 + + images\placeholderOneUse_0.png + + diff --git a/sprites/placeholder/placeholderOrderLink.sprite.gmx b/sprites/placeholder/placeholderOrderLink.sprite.gmx new file mode 100644 index 0000000..085fb42 --- /dev/null +++ b/sprites/placeholder/placeholderOrderLink.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 31 + 0 + 31 + 0 + 0 + + 0 + + 0 + 32 + 32 + + images\placeholderOrderLink_0.png + + diff --git a/sprites/placeholder/placeholderOutputAnchor.sprite.gmx b/sprites/placeholder/placeholderOutputAnchor.sprite.gmx new file mode 100644 index 0000000..1ee4f49 --- /dev/null +++ b/sprites/placeholder/placeholderOutputAnchor.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 8 + 0 + 1 + 0 + 0 + 0 + 0 + 15 + 0 + 14 + 0 + 0 + + 0 + + 0 + 16 + 16 + + images\placeholderOutputAnchor_0.png + + diff --git a/sprites/placeholder/placeholderOutputAnchorWhite.sprite.gmx b/sprites/placeholder/placeholderOutputAnchorWhite.sprite.gmx new file mode 100644 index 0000000..c412eef --- /dev/null +++ b/sprites/placeholder/placeholderOutputAnchorWhite.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 8 + 0 + 1 + 0 + 0 + 0 + 0 + 15 + 0 + 14 + 0 + 0 + + 0 + + 0 + 16 + 16 + + images\placeholderOutputAnchorWhite_0.png + + diff --git a/sprites/placeholder/placeholderPane.sprite.gmx b/sprites/placeholder/placeholderPane.sprite.gmx new file mode 100644 index 0000000..0565335 --- /dev/null +++ b/sprites/placeholder/placeholderPane.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 63 + 0 + 63 + 0 + 0 + + 0 + + 0 + 64 + 64 + + images\placeholderPane_0.png + + diff --git a/sprites/placeholder/placeholderParameter.sprite.gmx b/sprites/placeholder/placeholderParameter.sprite.gmx new file mode 100644 index 0000000..f9bc9ad --- /dev/null +++ b/sprites/placeholder/placeholderParameter.sprite.gmx @@ -0,0 +1,34 @@ + + + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 3 + 12 + 3 + 12 + 0 + 0 + + 0 + + 0 + 16 + 16 + + images\placeholderParameter_0.png + images\placeholderParameter_1.png + images\placeholderParameter_2.png + images\placeholderParameter_3.png + images\placeholderParameter_4.png + images\placeholderParameter_5.png + images\placeholderParameter_6.png + images\placeholderParameter_7.png + images\placeholderParameter_8.png + images\placeholderParameter_9.png + + diff --git a/sprites/placeholder/placeholderTypeTrait.sprite.gmx b/sprites/placeholder/placeholderTypeTrait.sprite.gmx new file mode 100644 index 0000000..24e4e0e --- /dev/null +++ b/sprites/placeholder/placeholderTypeTrait.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 15 + 0 + 15 + 0 + 0 + + 0 + + 0 + 16 + 16 + + images\placeholderTypeTrait_0.png + + diff --git a/sprites/placeholder/placeholderVariableType.sprite.gmx b/sprites/placeholder/placeholderVariableType.sprite.gmx new file mode 100644 index 0000000..d183665 --- /dev/null +++ b/sprites/placeholder/placeholderVariableType.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 15 + 0 + 15 + 0 + 0 + + 0 + + 0 + 16 + 16 + + images\placeholderVariableType_0.png + +