feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -187,7 +187,7 @@ void EditorAutoloadSettings::_autoload_edited() {
|
|||
|
||||
if (column == 0) {
|
||||
String name = ti->get_text(0);
|
||||
String old_name = selected_autoload.get_slice("/", 1);
|
||||
String old_name = selected_autoload.get_slicec('/', 1);
|
||||
|
||||
if (name == old_name) {
|
||||
return;
|
||||
|
|
@ -242,7 +242,7 @@ void EditorAutoloadSettings::_autoload_edited() {
|
|||
String scr_path = GLOBAL_GET(base);
|
||||
|
||||
if (scr_path.begins_with("*")) {
|
||||
scr_path = scr_path.substr(1, scr_path.length());
|
||||
scr_path = scr_path.substr(1);
|
||||
}
|
||||
|
||||
// Singleton autoloads are represented with a leading "*" in their path.
|
||||
|
|
@ -349,11 +349,7 @@ void EditorAutoloadSettings::_autoload_activated() {
|
|||
}
|
||||
|
||||
void EditorAutoloadSettings::_autoload_open(const String &fpath) {
|
||||
if (ResourceLoader::get_resource_type(fpath) == "PackedScene") {
|
||||
EditorNode::get_singleton()->open_request(fpath);
|
||||
} else {
|
||||
EditorNode::get_singleton()->load_resource(fpath);
|
||||
}
|
||||
EditorNode::get_singleton()->load_scene_or_resource(fpath);
|
||||
ProjectSettingsEditor::get_singleton()->hide();
|
||||
}
|
||||
|
||||
|
|
@ -483,7 +479,7 @@ void EditorAutoloadSettings::update_autoload() {
|
|||
continue;
|
||||
}
|
||||
|
||||
String name = pi.name.get_slice("/", 1);
|
||||
String name = pi.name.get_slicec('/', 1);
|
||||
String scr_path = GLOBAL_GET(pi.name);
|
||||
|
||||
if (name.is_empty()) {
|
||||
|
|
@ -494,7 +490,7 @@ void EditorAutoloadSettings::update_autoload() {
|
|||
info.is_singleton = scr_path.begins_with("*");
|
||||
|
||||
if (info.is_singleton) {
|
||||
scr_path = scr_path.substr(1, scr_path.length());
|
||||
scr_path = scr_path.substr(1);
|
||||
}
|
||||
|
||||
info.name = name;
|
||||
|
|
@ -625,7 +621,7 @@ Variant EditorAutoloadSettings::get_drag_data_fw(const Point2 &p_point, Control
|
|||
next = tree->get_next_selected(next);
|
||||
}
|
||||
|
||||
if (autoloads.size() == 0 || autoloads.size() == autoload_cache.size()) {
|
||||
if (autoloads.is_empty() || autoloads.size() == autoload_cache.size()) {
|
||||
return Variant();
|
||||
}
|
||||
|
||||
|
|
@ -663,13 +659,13 @@ bool EditorAutoloadSettings::can_drop_data_fw(const Point2 &p_point, const Varia
|
|||
}
|
||||
|
||||
if (drop_data.has("type")) {
|
||||
TreeItem *ti = tree->get_item_at_position(p_point);
|
||||
TreeItem *ti = (p_point == Vector2(Math::INF, Math::INF)) ? tree->get_selected() : tree->get_item_at_position(p_point);
|
||||
|
||||
if (!ti) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int section = tree->get_drop_section_at_position(p_point);
|
||||
int section = (p_point == Vector2(Math::INF, Math::INF)) ? tree->get_drop_section_at_position(tree->get_item_rect(ti).position) : tree->get_drop_section_at_position(p_point);
|
||||
|
||||
return section >= -1;
|
||||
}
|
||||
|
|
@ -678,13 +674,13 @@ bool EditorAutoloadSettings::can_drop_data_fw(const Point2 &p_point, const Varia
|
|||
}
|
||||
|
||||
void EditorAutoloadSettings::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_control) {
|
||||
TreeItem *ti = tree->get_item_at_position(p_point);
|
||||
TreeItem *ti = (p_point == Vector2(Math::INF, Math::INF)) ? tree->get_selected() : tree->get_item_at_position(p_point);
|
||||
|
||||
if (!ti) {
|
||||
return;
|
||||
}
|
||||
|
||||
int section = tree->get_drop_section_at_position(p_point);
|
||||
int section = (p_point == Vector2(Math::INF, Math::INF)) ? tree->get_drop_section_at_position(tree->get_item_rect(ti).position) : tree->get_drop_section_at_position(p_point);
|
||||
|
||||
if (section < -1) {
|
||||
return;
|
||||
|
|
@ -862,7 +858,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
|
|||
continue;
|
||||
}
|
||||
|
||||
String name = pi.name.get_slice("/", 1);
|
||||
String name = pi.name.get_slicec('/', 1);
|
||||
String scr_path = GLOBAL_GET(pi.name);
|
||||
|
||||
if (name.is_empty()) {
|
||||
|
|
@ -873,7 +869,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
|
|||
info.is_singleton = scr_path.begins_with("*");
|
||||
|
||||
if (info.is_singleton) {
|
||||
scr_path = scr_path.substr(1, scr_path.length());
|
||||
scr_path = scr_path.substr(1);
|
||||
}
|
||||
|
||||
info.name = name;
|
||||
|
|
@ -905,6 +901,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
|
|||
|
||||
autoload_add_path = memnew(LineEdit);
|
||||
hbc->add_child(autoload_add_path);
|
||||
autoload_add_path->set_accessibility_name(TTRC("Autoload Path"));
|
||||
autoload_add_path->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
autoload_add_path->set_clear_button_enabled(true);
|
||||
autoload_add_path->set_placeholder(vformat(TTR("Set path or press \"%s\" to create a script."), TTR("Add")));
|
||||
|
|
@ -912,6 +909,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
|
|||
|
||||
browse_button = memnew(Button);
|
||||
hbc->add_child(browse_button);
|
||||
browse_button->set_accessibility_name(TTRC("Select Autoload Path"));
|
||||
browse_button->connect(SceneStringName(pressed), callable_mp(this, &EditorAutoloadSettings::_browse_autoload_add_path));
|
||||
|
||||
file_dialog = memnew(EditorFileDialog);
|
||||
|
|
@ -929,6 +927,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
|
|||
hbc->add_child(l);
|
||||
|
||||
autoload_add_name = memnew(LineEdit);
|
||||
autoload_add_name->set_accessibility_name(TTRC("Node Name"));
|
||||
autoload_add_name->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
autoload_add_name->connect(SceneStringName(text_submitted), callable_mp(this, &EditorAutoloadSettings::_autoload_text_submitted));
|
||||
autoload_add_name->connect(SceneStringName(text_changed), callable_mp(this, &EditorAutoloadSettings::_autoload_text_changed));
|
||||
|
|
@ -942,6 +941,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
|
|||
hbc->add_child(add_autoload);
|
||||
|
||||
tree = memnew(Tree);
|
||||
tree->set_accessibility_name(TTRC("Autoloads"));
|
||||
tree->set_hide_root(true);
|
||||
tree->set_select_mode(Tree::SELECT_MULTI);
|
||||
tree->set_allow_reselect(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue