Comments (3)
The issue is, that the PandoraReference
class isn't considered of type "reference"
and fails the is_valid_type check.
func(variant): return variant is PandoraEntity,
Adding PandoraReference
to the type check should be fine, I think. I tried it, seemed to work just fine.
func(variant): return variant is PandoraEntity or variant is PandoraReference,
But I don't understand the codebase well enough (yet!) to be fully confident.
from pandora.
@VojtaStruhar the idea is that the reference gets created dynamically inside Pandora. From an API perspective, it should always be PandoraEntity.
Let me see today what the issue is here!
from pandora.
I dug a little more and found, that after selecting entity from a dropdown, you wrap it in PandoraReference and then call set_default_value
with it:
# reference_property.gd, _ready
entity_picker.entity_selected.connect(
func(entity:PandoraEntity):
var reference = PandoraReference.new(entity.get_entity_id(), 1 if entity is PandoraCategory else 0)
_property.set_default_value(reference)
property_value_changed.emit())
But in set_default_value
you have a very similar piece of code that does the same thing conditionally:
if value is PandoraEntity:
value = PandoraReference.new(value.get_entity_id(), PandoraReference.Type.CATEGORY if value is PandoraCategory else PandoraReference.Type.ENTITY)
I think that in the entity_picker, we are wrapping the entity in a PandoraReference too early! I tried to pass in just the entity, seems to work just fine. I had a look in the stored data too - it seems to add the override correctly:
If this sounds good to you, I'll make a pull request, it's a one-liner :)
from pandora.
Related Issues (20)
- Resetting entity in inspector does not clear the dropdown
- Display top categories as individual tabs
- Ability to display items as GraphEdit
- Getting entities from category + Path HOT 4
- Data loss HOT 9
- Property settings persist even when property's fields lose focus HOT 1
- Array properties do not properly deserialize all types HOT 2
- Entities and Categories lose saved order after reload project
- Re-order properties
- Add right-click context menu to tree
- The path of the Icon will change when moved to another location.
- Reference properties aren't serialized properly HOT 1
- Inventory Example Missing Dependency entity_proxy.gd HOT 1
- `data.pandora` file is not included in release builds HOT 1
- Invalid GDScript code generated from category that contains special characters
- Pandora fails to assign script with compiled script files
- Pandora gets confused with mixed entities and categories.
- Entity ids are missing in id file
- Issues with Godot 4.3 HOT 9
- Feature request: Export data as resources
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandora.