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

Update editor view #172

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,47 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres loosely to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!--
FYI here's a hint about versioning:

Added for new features.
Changed for changes in existing functionality.
Deprecated for soon-to-be removed features.
Removed for now removed features.
Fixed for any bug fixes.
Security in case of vulnerabilities.

-->

## Unreleased
### Added
- More documentation about project structure and usage.
- A simple example. It just prints something in console.
- **Multiple selection of commands**. This is part of our new UI.
- `Command` properties:
- `block_name` as `command_name` alias to change the display name in editor.
- `block_color` to tint the block representation in editor.
- `block_icon` to define the texture used in the block representation in editor.
### Changed
- `Set` command behavior. Now includes more operations and hints to be done in the command - [#153](https://github.com/AnidemDex/Blockflow/pull/153).
- **Editor UI**. We now have a new custom displayer.
- `Command.background_color` to `Command.block_color`.
- `Command.command_hint_icon` to `Command.block_icon`
### Deprecated
- `Set.PlusOperables` constant. Now `Operables` is used instead.
- `Command.Group`. Unused constant.
- `Command.background_color`.
- `Command.command_hint_icon`.
- `Command.command_text_color`.
- `Command.defines_default_branches`.
- `Command.can_be_moved`.
- `Command.go_to_branch()`.
- `Command._get_hint_icon()`.
- `Command._can_be_selected()`.
- `Command._defines_default_branches()`.
- `Command._get_default_branch_for()`.
### Removed
- Old `Timeline` references. You _really_ should not be using those, they were not meant to exist in 1.0 but it was keep to preserve an older project stability.
## \[[1.1](https://github.com/AnidemDex/Blockflow/releases/tag/1.1)] 2024-06-02
### Added
- Copy and paste command functionality - [#105](https://github.com/AnidemDex/Blockflow/pull/105).
Expand Down
16 changes: 11 additions & 5 deletions collection.gd
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ func size() -> int:
func is_empty() -> bool:
return collection.is_empty()

## Forces an update to contained data.
func update() -> void:
_notify_changed()

func _notify_changed() -> void:
notification(NOTIFICATION_UPDATE_STRUCTURE)
Blockflow.generate_tree(self)
Expand All @@ -177,10 +181,12 @@ func _notification(what: int) -> void:
command.index = command_index
command.weak_collection = weak_collection

func _get_property_list() -> Array:
var p:Array = []
p.append({"name":"collection", "type":TYPE_ARRAY, "usage":PROPERTY_USAGE_NO_EDITOR|PROPERTY_USAGE_SCRIPT_VARIABLE|PROPERTY_USAGE_ALWAYS_DUPLICATE})
return p
func _validate_property(property: Dictionary) -> void:
if property.name == "collection":
if collection.is_empty():
property.usage = PROPERTY_USAGE_ALWAYS_DUPLICATE
else:
property.usage = PROPERTY_USAGE_NO_EDITOR | PROPERTY_USAGE_ALWAYS_DUPLICATE

func _to_string() -> String:
return "<Collection:%d>" % get_instance_id()
Expand All @@ -203,4 +209,4 @@ func _iter_next(_d) -> bool:
return _should_continue()

func _iter_get(_d):
return _get_iterator_ref()[__itr_cnt]
return _get_iterator_ref()[__itr_cnt]
Loading