Skip to content

Commit

Permalink
Fix compiling with latest Godot
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylann committed Nov 4, 2024
1 parent 8aa25f3 commit b08efc7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions util/godot/classes/button.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define ZN_GODOT_BUTTON_H

#if defined(ZN_GODOT)
#include <core/version.h>
#include <scene/gui/button.h>
#elif defined(ZN_GODOT_EXTENSION)
#include <godot_cpp/classes/button.hpp>
Expand All @@ -12,7 +13,13 @@ namespace zylann::godot {

inline void set_button_icon(Button &button, Ref<Texture2D> icon) {
#if defined(ZN_GODOT)

#if VERSION_MAJOR == 4 && VERSION_MINOR <= 3
button.set_icon(icon);
#else
button.set_button_icon(icon);
#endif

#elif defined(ZN_GODOT_EXTENSION)
button.set_button_icon(icon);
#endif
Expand Down

0 comments on commit b08efc7

Please sign in to comment.