jamie-pate / godot-control-data-binds

Data binding and templating for godot control ui
MIT License
19 stars 1 forks source link

Add more flexibility to array_model when using BindItems and BindRepeat #1

Closed jamie-pate closed 4 months ago

jamie-pate commented 5 months ago

Problems:

Filtering array_model

Often you have an array of items but you don't want to show them all in the GUI...

BindItems and BindRepeat currently show the entire array of items, requiring a 'shadow model' that only has the visible items inside.

Dynamic array_model

Sometimes your array_model needs to be generated dynamically. For example it may be composed of array_a + array_b to generate array_ab. This requires extra glue function in your Component to generate the extra array_ab model that needs to get updated any time array_a or array_b is modified.

Proposal:

Allow the () suffix to call a Callable when specifying the array_model property of BindItems and BindRepeat classes.

E.G.: array_model = array_ab()