Compare commits

..

2 Commits

Author SHA1 Message Date
Sara 160eeba054 feat: godot macros now includes dependencies 2024-02-02 08:47:30 +01:00
Sara 63bf083467 feat: added GDEDITORONLY and GDGAMEONLY 2024-02-02 08:47:05 +01:00
1 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,9 @@
#ifndef UC_GODOT_MACROS_H #ifndef UC_GODOT_MACROS_H
#define UC_GODOT_MACROS_H #define UC_GODOT_MACROS_H
#include "godot_cpp/classes/engine.hpp"
#include "godot_cpp/core/class_db.hpp"
#define MACRO_STRING_INNER(_Arg) #_Arg #define MACRO_STRING_INNER(_Arg) #_Arg
#define MACRO_STRING(_Arg) MACRO_STRING_INNER(_Arg) #define MACRO_STRING(_Arg) MACRO_STRING_INNER(_Arg)
@ -28,4 +31,7 @@
#define GDRESOURCETYPE(_Class) vformat("%s/%s:%s", Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, #_Class) #define GDRESOURCETYPE(_Class) vformat("%s/%s:%s", Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, #_Class)
#define GDEDITORONLY() if(!Engine::get_singleton()->is_editor_hint()) return
#define GDGAMEONLY() if(Engine::get_singleton()->is_editor_hint()) return
#endif // !UC_GODOT_MACROS_H #endif // !UC_GODOT_MACROS_H