Enum value editing via editor

#1

Hello~
I’m a Urho3d newbie :D.
I’m trying to make tweening script via angelscript.
My scripts’ class’ variable needs non built-in enum values.
(like enum LoopType { once, loop, yoyo }:wink:

I added enum value on c++ project using
asCScriptEngine::RegisterEnum(const char*)
asCScriptEngine::RegisterEnumValue(const char*, const char *, int)
functions and compiled angelscript successfully.

But I can’t edit in editor(invisible). I think because enum value isn’t serializable object.
What should I do?

Best regards

#2

I’m unsure if there is a routine to register enum attributes for ScriptComponent. Only C++ components have full feature set.

Maybe some AngelScript expert knows how to parse enum attributes and implement this feature. I personally never thought about it.

1 Like
#3

I tried implementing the feature. You can see the commit here, and the (presently incorrect) pull request here.

Probably, more features should be added (like the ability to specify the names for the attributes instead of just parsing the ones used in AngelsScript so that it can be made to show up as “Loop Once” instead of “LT_ONCE”, but this seems a suitable start.

#4

Thanks for your answers Eugene, SirNate0.
I have already implemented using c++.
But Working with scripts will help save our times sometimes.

Best regards :smiley: