Run clang-format
This commit is contained in:
parent
f523af2d13
commit
b4974bffd2
|
@ -23,17 +23,17 @@
|
|||
#include "core/object/script_language.h"
|
||||
#include "editor/themes/editor_scale.h"
|
||||
#include "scene/gui/box_container.h"
|
||||
#include "scene/gui/texture_rect.h"
|
||||
#include "scene/gui/label.h"
|
||||
#include "scene/gui/texture_rect.h"
|
||||
#endif // LIMBOAI_MODULE
|
||||
|
||||
#ifdef LIMBOAI_GDEXTENSION
|
||||
#include <godot_cpp/classes/editor_interface.hpp>
|
||||
#include <godot_cpp/classes/script.hpp>
|
||||
#include <godot_cpp/classes/h_box_container.hpp>
|
||||
#include <godot_cpp/classes/v_box_container.hpp>
|
||||
#include <godot_cpp/classes/texture_rect.hpp>
|
||||
#include <godot_cpp/classes/label.hpp>
|
||||
#include <godot_cpp/classes/script.hpp>
|
||||
#include <godot_cpp/classes/texture_rect.hpp>
|
||||
#include <godot_cpp/classes/v_box_container.hpp>
|
||||
using namespace godot;
|
||||
#endif // LIMBOAI_GDEXTENSION
|
||||
|
||||
|
@ -437,7 +437,7 @@ void TaskTree::_normalize_drop(TreeItem *item, int type, int &to_pos, Ref<BTTask
|
|||
to_pos = to_task->get_index();
|
||||
{
|
||||
Vector<Ref<BTTask>> selected = get_selected_tasks();
|
||||
if (to_task == selected[selected.size()-1]) {
|
||||
if (to_task == selected[selected.size() - 1]) {
|
||||
to_pos += 1;
|
||||
}
|
||||
}
|
||||
|
@ -577,7 +577,7 @@ TaskTree::TaskTree() {
|
|||
|
||||
// for Tree + TreeSearch, we want a VBoxContainer. For now, rather than changing this classes type, let's do nesting:
|
||||
// TaskTree -> VBoxContainer -> [Tree, TreeSearchPanel]
|
||||
VBoxContainer * vbox_container = memnew(VBoxContainer);
|
||||
VBoxContainer *vbox_container = memnew(VBoxContainer);
|
||||
add_child(vbox_container);
|
||||
vbox_container->set_anchors_preset(PRESET_FULL_RECT);
|
||||
|
||||
|
|
|
@ -22,19 +22,19 @@
|
|||
#include "core/math/math_funcs.h"
|
||||
#include "editor/editor_interface.h"
|
||||
#include "editor/themes/editor_scale.h"
|
||||
#include "scene/resources/font.h"
|
||||
#include "scene/gui/separator.h"
|
||||
#include "scene/resources/style_box_flat.h"
|
||||
#include "scene/main/viewport.h"
|
||||
#include "scene/resources/font.h"
|
||||
#include "scene/resources/style_box_flat.h"
|
||||
#endif // LIMBOAI_MODULE
|
||||
|
||||
#ifdef LIMBOAI_GDEXTENSION
|
||||
#include <godot_cpp/core/math.hpp>
|
||||
#include <godot_cpp/classes/editor_interface.hpp> // for edge scale
|
||||
#include <godot_cpp/classes/font.hpp>
|
||||
#include <godot_cpp/classes/h_separator.hpp>
|
||||
#include <godot_cpp/classes/style_box_flat.hpp>
|
||||
#include <godot_cpp/classes/viewport.hpp>
|
||||
#include <godot_cpp/core/math.hpp>
|
||||
#endif // LIMBOAI_GDEXTENSION
|
||||
|
||||
#define UPPER_BOUND (1 << 15) // for substring search.
|
||||
|
@ -141,8 +141,7 @@ void TreeSearchPanel::show_and_focus() {
|
|||
/* ------- TreeSearch ------- */
|
||||
|
||||
void TreeSearch::_filter_tree(TreeItem *p_tree_item, const String &p_search_mask) {
|
||||
for (int i = 0; i < ordered_tree_items.size(); i++){
|
||||
|
||||
for (int i = 0; i < ordered_tree_items.size(); i++) {
|
||||
}
|
||||
PRINT_LINE("filter tree not yet implemented!", p_search_mask);
|
||||
}
|
||||
|
@ -153,8 +152,9 @@ void TreeSearch::_highlight_tree(const String &p_search_mask) {
|
|||
TreeItem *entry = ordered_tree_items[i];
|
||||
|
||||
int num_m = number_matches.has(entry) ? number_matches.get(entry) : 0;
|
||||
if (num_m == 0){
|
||||
continue;;
|
||||
if (num_m == 0) {
|
||||
continue;
|
||||
;
|
||||
}
|
||||
|
||||
// make sure to also call any draw method already defined.
|
||||
|
@ -192,7 +192,6 @@ void TreeSearch::_draw_highlight_item(TreeItem *p_tree_item, Rect2 p_rect, Strin
|
|||
|
||||
// first part: outline
|
||||
if (matching_entries.has(p_tree_item)) {
|
||||
|
||||
// font info
|
||||
Ref<Font> font = p_tree_item->get_custom_font(0);
|
||||
if (font.is_null()) {
|
||||
|
@ -409,16 +408,16 @@ void TreeSearch::_select_next_match() {
|
|||
_select_first_match(); // wrap around.
|
||||
}
|
||||
|
||||
void TreeSearch::on_item_edited(TreeItem * item) {
|
||||
if (item->get_cell_mode(0) != TreeItem::CELL_MODE_CUSTOM){
|
||||
void TreeSearch::on_item_edited(TreeItem *item) {
|
||||
if (item->get_cell_mode(0) != TreeItem::CELL_MODE_CUSTOM) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!callable_cache.has(item) || item->get_custom_draw_callback(0) == callable_cache.get(item)){
|
||||
if (!callable_cache.has(item) || item->get_custom_draw_callback(0) == callable_cache.get(item)) {
|
||||
return;
|
||||
}
|
||||
|
||||
item->set_custom_draw_callback(0,callable_cache.get(item));
|
||||
item->set_custom_draw_callback(0, callable_cache.get(item));
|
||||
}
|
||||
|
||||
// Call this as a post-processing step for the already constructed tree.
|
||||
|
@ -440,7 +439,6 @@ void TreeSearch::update_search(Tree *p_tree) {
|
|||
_update_matching_entries(search_mask);
|
||||
_update_number_matches();
|
||||
|
||||
|
||||
if (search_mode == TreeSearchMode::HIGHLIGHT) {
|
||||
_highlight_tree(search_mask);
|
||||
if (!search_panel->is_connected("text_submitted", callable_mp(this, &TreeSearch::_select_next_match))) {
|
||||
|
|
|
@ -83,7 +83,7 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
Tree * tree_reference;
|
||||
Tree *tree_reference;
|
||||
|
||||
Vector<TreeItem *> ordered_tree_items;
|
||||
Vector<TreeItem *> matching_entries;
|
||||
|
@ -99,13 +99,12 @@ private:
|
|||
Vector<TreeItem *> _find_matching_entries(TreeItem *tree_item, const String &search_mask, Vector<TreeItem *> &buffer);
|
||||
StringSearchIndices _substring_bounds(const String &searchable, const String &search_mask) const;
|
||||
|
||||
void _select_item(TreeItem * item);
|
||||
void _select_item(TreeItem *item);
|
||||
void _select_first_match();
|
||||
void _select_next_match();
|
||||
|
||||
|
||||
protected:
|
||||
static void _bind_methods(){}
|
||||
static void _bind_methods() {}
|
||||
|
||||
public:
|
||||
// we will add everything from TaskTree.h
|
||||
|
|
Loading…
Reference in New Issue