feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
|
|
@ -30,10 +30,12 @@
|
|||
|
||||
#include "editor_sectioned_inspector.h"
|
||||
|
||||
#include "editor/editor_inspector.h"
|
||||
#include "editor/editor_property_name_processor.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "editor/themes/editor_scale.h"
|
||||
#include "scene/gui/check_button.h"
|
||||
#include "scene/gui/tree.h"
|
||||
|
||||
static bool _property_path_matches(const String &p_property_path, const String &p_filter, EditorPropertyNameProcessor::Style p_style) {
|
||||
if (p_property_path.containsn(p_filter)) {
|
||||
|
|
@ -94,7 +96,7 @@ class SectionedInspectorFilter : public Object {
|
|||
List<PropertyInfo> pinfo;
|
||||
edited->get_property_list(&pinfo);
|
||||
for (PropertyInfo &pi : pinfo) {
|
||||
int sp = pi.name.find("/");
|
||||
int sp = pi.name.find_char('/');
|
||||
|
||||
if (pi.name == "resource_path" || pi.name == "resource_name" || pi.name == "resource_local_to_scene" || pi.name.begins_with("script/") || pi.name.begins_with("_global_script")) { //skip resource stuff
|
||||
continue;
|
||||
|
|
@ -106,7 +108,7 @@ class SectionedInspectorFilter : public Object {
|
|||
|
||||
if (pi.name.begins_with(section + "/")) {
|
||||
pi.name = pi.name.replace_first(section + "/", "");
|
||||
if (!allow_sub && pi.name.contains("/")) {
|
||||
if (!allow_sub && pi.name.contains_char('/')) {
|
||||
continue;
|
||||
}
|
||||
p_list->push_back(pi);
|
||||
|
|
@ -245,7 +247,7 @@ void SectionedInspector::update_category_list() {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (pi.name.contains(":") || pi.name == "script" || pi.name == "resource_name" || pi.name == "resource_path" || pi.name == "resource_local_to_scene" || pi.name.begins_with("_global_script")) {
|
||||
if (pi.name.contains_char(':') || pi.name == "script" || pi.name == "resource_name" || pi.name == "resource_path" || pi.name == "resource_local_to_scene" || pi.name.begins_with("_global_script")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -253,7 +255,7 @@ void SectionedInspector::update_category_list() {
|
|||
continue;
|
||||
}
|
||||
|
||||
int sp = pi.name.find("/");
|
||||
int sp = pi.name.find_char('/');
|
||||
if (sp == -1) {
|
||||
pi.name = "global/" + pi.name;
|
||||
}
|
||||
|
|
@ -307,20 +309,37 @@ void SectionedInspector::register_search_box(LineEdit *p_box) {
|
|||
search_box->connect(SceneStringName(text_changed), callable_mp(this, &SectionedInspector::_search_changed));
|
||||
}
|
||||
|
||||
void SectionedInspector::register_advanced_toggle(CheckButton *p_toggle) {
|
||||
advanced_toggle = p_toggle;
|
||||
advanced_toggle->connect(SceneStringName(toggled), callable_mp(this, &SectionedInspector::_advanced_toggled));
|
||||
_advanced_toggled(advanced_toggle->is_pressed());
|
||||
}
|
||||
|
||||
void SectionedInspector::_search_changed(const String &p_what) {
|
||||
if (advanced_toggle) {
|
||||
if (p_what.is_empty()) {
|
||||
advanced_toggle->set_pressed_no_signal(!restrict_to_basic);
|
||||
advanced_toggle->set_disabled(false);
|
||||
advanced_toggle->set_tooltip_text(String());
|
||||
} else {
|
||||
advanced_toggle->set_pressed_no_signal(true);
|
||||
advanced_toggle->set_disabled(true);
|
||||
advanced_toggle->set_tooltip_text(TTR("Advanced settings are always shown when searching."));
|
||||
}
|
||||
}
|
||||
update_category_list();
|
||||
}
|
||||
|
||||
void SectionedInspector::_advanced_toggled(bool p_toggled_on) {
|
||||
restrict_to_basic = !p_toggled_on;
|
||||
update_category_list();
|
||||
inspector->set_restrict_to_basic_settings(restrict_to_basic);
|
||||
}
|
||||
|
||||
EditorInspector *SectionedInspector::get_inspector() {
|
||||
return inspector;
|
||||
}
|
||||
|
||||
void SectionedInspector::set_restrict_to_basic_settings(bool p_restrict) {
|
||||
restrict_to_basic = p_restrict;
|
||||
update_category_list();
|
||||
inspector->set_restrict_to_basic_settings(p_restrict);
|
||||
}
|
||||
|
||||
SectionedInspector::SectionedInspector() :
|
||||
sections(memnew(Tree)),
|
||||
filter(memnew(SectionedInspectorFilter)),
|
||||
|
|
@ -334,6 +353,7 @@ SectionedInspector::SectionedInspector() :
|
|||
sections->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
|
||||
sections->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
sections->set_hide_root(true);
|
||||
sections->set_theme_type_variation("TreeSecondary");
|
||||
|
||||
left_vb->add_child(sections, true);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue