Skip to content

Commit

Permalink
GH-521 Fix compatibility issue with Godot 4.2.1 and `set_auto_transla…
Browse files Browse the repository at this point in the history
…te_mode`
  • Loading branch information
Naros committed Jul 14, 2024
1 parent d6b9352 commit e18e7bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/editor/property_selector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ OrchestratorPropertySelector::OrchestratorPropertySelector()
SceneUtils::add_margin_child(vbox, "Search:", _search_box);

_search_options = memnew(Tree);
#if GODOT_VERSION >= 0x040300
_search_options->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
#else
_search_options->set_auto_translate(false);
#endif
_search_options->set_hide_root(true);
_search_options->set_hide_folding(true);
SceneUtils::add_margin_child(vbox, "Matches:", _search_options, true);
Expand Down
5 changes: 5 additions & 0 deletions src/editor/scene_node_selector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "common/macros.h"
#include "common/scene_utils.h"
#include "common/version.h"

#include <godot_cpp/classes/button.hpp>
#include <godot_cpp/classes/engine.hpp>
Expand Down Expand Up @@ -227,7 +228,11 @@ OrchestratorSceneNodeSelector::OrchestratorSceneNodeSelector()

_tree = memnew(Tree);
_tree->set_v_size_flags(Control::SIZE_EXPAND_FILL);
#if GODOT_VERSION >= 0x040300
_tree->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
#else
_tree->set_auto_translate(false);
#endif
_tree->set_anchor(SIDE_RIGHT, Control::ANCHOR_END);
_tree->set_anchor(SIDE_BOTTOM, Control::ANCHOR_END);
_tree->set_begin(Point2(0, 0));
Expand Down

0 comments on commit e18e7bd

Please sign in to comment.