Skip to content

Commit ca7a58f

Browse files
committed
Migrate to Tree::set_custom_draw_callback.
Due to upstream change: godotengine/godot@a32a2ea
1 parent fabd060 commit ca7a58f

File tree

4 files changed

+8
-18
lines changed

4 files changed

+8
-18
lines changed

editor/debugger/behavior_tree_view.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,16 @@ void BehaviorTreeView::_update_tree(const Ref<BehaviorTreeData> &p_data) {
104104
if (status_changed) {
105105
item->set_metadata(1, current_status);
106106
if (current_status == BTTask::SUCCESS) {
107-
item->set_custom_draw(0, this, LW_NAME(_draw_success_status));
107+
item->set_custom_draw_callback(0, callable_mp(this, &BehaviorTreeView::_draw_success_status));
108108
item->set_icon(1, theme_cache.icon_success);
109109
} else if (current_status == BTTask::FAILURE) {
110-
item->set_custom_draw(0, this, LW_NAME(_draw_failure_status));
110+
item->set_custom_draw_callback(0, callable_mp(this, &BehaviorTreeView::_draw_failure_status));
111111
item->set_icon(1, theme_cache.icon_failure);
112112
} else if (current_status == BTTask::RUNNING) {
113-
item->set_custom_draw(0, this, LW_NAME(_draw_running_status));
113+
item->set_custom_draw_callback(0, callable_mp(this, &BehaviorTreeView::_draw_running_status));
114114
item->set_icon(1, theme_cache.icon_running);
115115
} else {
116-
item->set_custom_draw(0, this, LW_NAME(_draw_fresh));
116+
item->set_custom_draw_callback(0, callable_mp(this, &BehaviorTreeView::_draw_fresh));
117117
item->set_icon(1, nullptr);
118118
}
119119
}
@@ -180,13 +180,13 @@ void BehaviorTreeView::_update_tree(const Ref<BehaviorTreeData> &p_data) {
180180
item->set_icon_max_width(0, 16 * _get_editor_scale()); // Force user icon size.
181181

182182
if (task_data.status == BTTask::SUCCESS) {
183-
item->set_custom_draw(0, this, LW_NAME(_draw_success_status));
183+
item->set_custom_draw_callback(0, callable_mp(this, &BehaviorTreeView::_draw_success_status));
184184
item->set_icon(1, theme_cache.icon_success);
185185
} else if (task_data.status == BTTask::FAILURE) {
186-
item->set_custom_draw(0, this, LW_NAME(_draw_failure_status));
186+
item->set_custom_draw_callback(0, callable_mp(this, &BehaviorTreeView::_draw_failure_status));
187187
item->set_icon(1, theme_cache.icon_failure);
188188
} else if (task_data.status == BTTask::RUNNING) {
189-
item->set_custom_draw(0, this, LW_NAME(_draw_running_status));
189+
item->set_custom_draw_callback(0, callable_mp(this, &BehaviorTreeView::_draw_running_status));
190190
item->set_icon(1, theme_cache.icon_running);
191191
}
192192

editor/task_tree.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void TaskTree::_update_item(TreeItem *p_item) {
5050
if (p_item->get_parent()) {
5151
Ref<BTProbabilitySelector> sel = p_item->get_parent()->get_metadata(0);
5252
if (sel.is_valid() && sel->has_probability(p_item->get_index())) {
53-
p_item->set_custom_draw(0, this, LW_NAME(_draw_probability));
53+
p_item->set_custom_draw_callback(0, callable_mp(this, &TaskTree::_draw_probability));
5454
p_item->set_cell_mode(0, TreeItem::CELL_MODE_CUSTOM);
5555
}
5656
}

util/limbo_string_names.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@
2727
LimboStringNames *LimboStringNames::singleton = nullptr;
2828

2929
LimboStringNames::LimboStringNames() {
30-
_draw_failure_status = SN("_draw_failure_status");
31-
_draw_fresh = SN("_draw_fresh");
32-
_draw_probability = SN("_draw_probability");
33-
_draw_running_status = SN("_draw_running_status");
34-
_draw_success_status = SN("_draw_success_status");
3530
_enter = SN("_enter");
3631
_exit = SN("_exit");
3732
_generate_name = SN("_generate_name");

util/limbo_string_names.h

-5
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ class LimboStringNames {
4141
public:
4242
_FORCE_INLINE_ static LimboStringNames *get_singleton() { return singleton; }
4343

44-
StringName _draw_failure_status;
45-
StringName _draw_fresh;
46-
StringName _draw_probability;
47-
StringName _draw_running_status;
48-
StringName _draw_success_status;
4944
StringName _enter;
5045
StringName _exit;
5146
StringName _generate_name;

0 commit comments

Comments
 (0)