Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlockCanvas: Implement drag & drop the file from resource FileSystem #305

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Commits on Nov 20, 2024

  1. Configuration menu
    Copy the full SHA
    8be79dc View commit details
    Browse the repository at this point in the history
  2. Block definition: Add constant value like definition

    Define the format "{const <parameter name>: <type>}" as constant
    parameter value. And, it is a kind of in parameter value, but never
    changes.
    
    https://phabricator.endlessm.com/T35712
    starnight committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    f30e4a1 View commit details
    Browse the repository at this point in the history
  3. blocks_catalog: Introduce get_resource_block_definition()

    Have get_resource_block_definition() providing resource block's
    definition. It uses constant parameter value with key "file_path" to
    hold the resource file's path information.
    
    https://phabricator.endlessm.com/T35712
    starnight committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    1b896bc View commit details
    Browse the repository at this point in the history
  4. BlockCanvas: Implement drag & drop resource files from the filesystem…

    … dock
    
    Dragging the resources from the filesystem dock shows the object's type
    as "files". So, allow the "files" type in _can_drop_data() and handle it
    in _drop_data(). Then, implement getting the resource's file path as a
    Variable block with _drop_files() in detail.
    
    And, because Godot allows dragging multiple files at the same time, this
    implemention parses the "files"' paths, then generates the corresponding
    block definition with get_resource_block_definition() and sets default
    "file_path" for each file's path.
    
    Besides, to avoid the dropped blocks overlap with each others on the
    canvas, each block biases its position a little bit automatically.
    
    https://phabricator.endlessm.com/T35712
    starnight committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    2125148 View commit details
    Browse the repository at this point in the history
  5. BlockScriptSerialization: Re-generate block definition for resource f…

    …ile blocks
    
    Drag & drop resouce files as blocks into canvas has been implemented.
    This commit focuses on serializing from the resource file blocks to AST
    nodes and values.
    
    The resource file's path is saved as in the arguments "file_path" feild.
    So, pass the arguments, which may have "file_path" into
    get_block_definition() to rebuild resource file's block definition.
    
    https://phabricator.endlessm.com/T35712
    starnight committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    714c31f View commit details
    Browse the repository at this point in the history