godotengine / godotengine/godot-cpp
Using NodePath editor hint with NativeScript
Nessuno ha ancora preso questa issue.
- Lingua principale
- C++
- Stelle
- 2.7k
- Fork
- 810
- Merge medio
- 1g 3h
- PR unite (30g)
- 8
Descrizione
So I am currently trying to replicate some like this with GDNative:
export(NodePath) var sample;
Desired Result:

Here is what I've been testing, but it doesn't seem to get what I am looking for.
register_property<SampleClass, String>("sample", &SampleClass::sample, "", GODOT_METHOD_RPC_MODE_DISABLED, GODOT_PROPERTY_USAGE_EDITOR, GODOT_PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE);

Since NodePath is not a valid type for register_property, my thought is I could have used a string with the editor hint and convert it in my code.
I've also tried using a setter and getter, but I am guessing there is an alternative to GODOT_PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE or something entirely outside of register_property I should be looking for.
Any suggestions or guidance would be amazing appreciated!!! 😄
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con la chiamata a register_property e l’uso di GODOT_PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE mostrati nell’issue, quindi traccia il modo in cui le proprietà NodePath vengono rappresentate per l’integrazione di NativeScript nell’editor. Il lavoro è completato quando una proprietà NativeScript può esporre l’hint dell’editor NodePath e produrre il campo dell’editor desiderato senza gestire tipi non supportati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp
- Ambito
- game-dev, tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100