GDNative - How would I create a custom resource that can be found by the inspector?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By dai

I know this can be done in gdscript with this:

extends Resource
class_name Custom

Which would allow an instance of the resource to be created thorough the inspector and allow the engine to recognize the class globally to access enums and the like. I want to do the same in gdnative because I have another gdnative script that needs to recognize this class. Gdscript should also be able to recognize this class.

This is what the current header looks like:

#include "Common.h"
#include <Resource.hpp>

class Custom : public Resource {
    GODOT_CLASS(Custom, Resource);

    enum COLOR {
        RED,
        YELLOW,
        BLUE
    };

    int integer = RED;

public:
    static void _register_methods();
    void _init();
};

And this is the cpp file:

#include "Custom.h"


void Custom::_register_methods() {
    register_property("integer", &Custom::integer, int(RED),
        GODOT_METHOD_RPC_MODE_DISABLED,
        GODOT_PROPERTY_USAGE_DEFAULT,
        GODOT_PROPERTY_HINT_ENUM,
        "Red, Yellow, Blue");
};


void Custom::_init() {

};

How would I make the engine recognize this as a resource?