Skip to content

Commit

Permalink
Tried to fix assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
niklas2902 committed Oct 24, 2024
1 parent a8800c2 commit 3a5ef92
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions py4godot/script_language/PyLanguage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,24 @@
#include "py4godot/cppclasses/ImageTexture/ImageTexture.h"
#include "py4godot/cppclasses/Image/Image.h"
#include "py4godot/pluginscript_api/api.h"


//TODO: generate this
bool theme_has_method(){
StringName _class_name = c_string_to_string_name("EditorInterface");
_class_name.shouldBeDeleted = true;
StringName _method_name = c_string_to_string_name("get_editor_theme");
_method_name.shouldBeDeleted = true;
GDExtensionMethodBindPtr method_bind = functions::get_classdb_get_method_bind()(&_class_name.godot_owner,&_method_name.godot_owner, 3846893731);
return method_bind != nullptr;
}

void PyLanguage::init_theme_icon(){
if(counter == 1){
auto instance = EditorInterface::get_instance();
if(!theme_has_method()){
return;
}
auto theme = instance ->get_editor_theme();
std::shared_ptr<ImageTexture> image_texture = ImageTexture::constructor();
auto icon_path = c_string_to_string("addons/py4godot/Python.svg");
Expand Down

0 comments on commit 3a5ef92

Please sign in to comment.