Drop Zone - Hawthorn-Games/ProjectScrapped GitHub Wiki

Functions

OnDrop()

Type Name Description
DragAndDropOperation Operation

If the drop zone can accept the widget, calls reorder blocks, then saves the list.

ReorderBlocks()

Type Name Description
BASEBlockObjectReference NewBlock the block that was just dropped
int Index The index where the block was dropped
bool append should the block be appended or inserted in the list
InstructionList[] SubList sub list of instructions (e.g.: a for block)
str parameter parameter of the new block

generate the instruction list, then appends or inserts the new block. If the block is a for or an if, calls PopulateBlocks for the SubList. Then recalculates the blocks score.

PopulateBlocks()

Type Name Description
InstructionList[] List

Spawns the blocks based on the instruction list passed.

ClearAllWidgets()

Empties the dropzone.

GenarateInstructionList()

Outputs

Type Name Description
InstructionList[] List
Generates and returns the instruction list base off the blocks in the drop zone.

Save()

Inputs

Type Name Description
InstructionList[] List

Sets the passed list as the start list for the current interactable.

⚠️ **GitHub.com Fallback** ⚠️