Use C++ iterators for Lists in many situations

This commit is contained in:
Aaron Franke 2021-07-15 23:45:57 -04:00
parent b918c4c3ce
commit 4e6efd1b07
No known key found for this signature in database
GPG Key ID: 40A1750B977E56BF
218 changed files with 2755 additions and 3004 deletions

View File

@ -214,8 +214,8 @@ bool Engine::has_singleton(const String &p_name) const {
}
void Engine::get_singletons(List<Singleton> *p_singletons) {
for (List<Singleton>::Element *E = singletons.front(); E; E = E->next()) {
p_singletons->push_back(E->get());
for (Singleton &E : singletons) {
p_singletons->push_back(E);
}
}

View File

@ -700,9 +700,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str
int count = 0;
for (Map<String, List<String>>::Element *E = props.front(); E; E = E->next()) {
for (List<String>::Element *F = E->get().front(); F; F = F->next()) {
count++;
}
count += E->get().size();
}
if (p_custom_features != String()) {
@ -734,8 +732,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str
}
for (Map<String, List<String>>::Element *E = props.front(); E; E = E->next()) {
for (List<String>::Element *F = E->get().front(); F; F = F->next()) {
String key = F->get();
for (String &key : E->get()) {
if (E->key() != "") {
key = E->key() + "/" + key;
}
@ -803,8 +800,8 @@ Error ProjectSettings::_save_settings_text(const String &p_file, const Map<Strin
if (E->key() != "") {
file->store_string("[" + E->key() + "]\n\n");
}
for (List<String>::Element *F = E->get().front(); F; F = F->next()) {
String key = F->get();
for (String &F : E->get()) {
String key = F;
if (E->key() != "") {
key = E->key() + "/" + key;
}
@ -817,7 +814,7 @@ Error ProjectSettings::_save_settings_text(const String &p_file, const Map<Strin
String vstr;
VariantWriter::write_to_string(value, vstr);
file->store_string(F->get().property_name_encode() + "=" + vstr + "\n");
file->store_string(F.property_name_encode() + "=" + vstr + "\n");
}
}
@ -931,11 +928,11 @@ Vector<String> ProjectSettings::get_optimizer_presets() const {
ProjectSettings::get_singleton()->get_property_list(&pi);
Vector<String> names;
for (List<PropertyInfo>::Element *E = pi.front(); E; E = E->next()) {
if (!E->get().name.begins_with("optimizer_presets/")) {
for (PropertyInfo &E : pi) {
if (!E.name.begins_with("optimizer_presets/")) {
continue;
}
names.push_back(E->get().name.get_slicec('/', 1));
names.push_back(E.name.get_slicec('/', 1));
}
names.sort();

View File

@ -75,8 +75,8 @@ Vector<String> _ResourceLoader::get_recognized_extensions_for_type(const String
List<String> exts;
ResourceLoader::get_recognized_extensions_for_type(p_type, &exts);
Vector<String> ret;
for (List<String>::Element *E = exts.front(); E; E = E->next()) {
ret.push_back(E->get());
for (String &E : exts) {
ret.push_back(E);
}
return ret;
@ -91,8 +91,8 @@ PackedStringArray _ResourceLoader::get_dependencies(const String &p_path) {
ResourceLoader::get_dependencies(p_path, &deps);
PackedStringArray ret;
for (List<String>::Element *E = deps.front(); E; E = E->next()) {
ret.push_back(E->get());
for (String &E : deps) {
ret.push_back(E);
}
return ret;
@ -141,8 +141,8 @@ Vector<String> _ResourceSaver::get_recognized_extensions(const RES &p_resource)
List<String> exts;
ResourceSaver::get_recognized_extensions(p_resource, &exts);
Vector<String> ret;
for (List<String>::Element *E = exts.front(); E; E = E->next()) {
ret.push_back(E->get());
for (String &E : exts) {
ret.push_back(E);
}
return ret;
}
@ -268,8 +268,8 @@ String _OS::get_name() const {
Vector<String> _OS::get_cmdline_args() {
List<String> cmdline = OS::get_singleton()->get_cmdline_args();
Vector<String> cmdlinev;
for (List<String>::Element *E = cmdline.front(); E; E = E->next()) {
cmdlinev.push_back(E->get());
for (String &E : cmdline) {
cmdlinev.push_back(E);
}
return cmdlinev;
@ -355,20 +355,20 @@ void _OS::print_all_textures_by_size() {
List<Ref<Resource>> rsrc;
ResourceCache::get_cached_resources(&rsrc);
for (List<Ref<Resource>>::Element *E = rsrc.front(); E; E = E->next()) {
if (!E->get()->is_class("ImageTexture")) {
for (Ref<Resource> E : rsrc) {
if (!E->is_class("ImageTexture")) {
continue;
}
Size2 size = E->get()->call("get_size");
int fmt = E->get()->call("get_format");
Size2 size = E->call("get_size");
int fmt = E->call("get_format");
_OSCoreBindImg img;
img.size = size;
img.fmt = fmt;
img.path = E->get()->get_path();
img.path = E->get_path();
img.vram = Image::get_image_data_size(img.size.width, img.size.height, Image::Format(img.fmt));
img.id = E->get()->get_instance_id();
img.id = E->get_instance_id();
total += img.vram;
imgs.push_back(img);
}
@ -376,8 +376,8 @@ void _OS::print_all_textures_by_size() {
imgs.sort();
for (List<_OSCoreBindImg>::Element *E = imgs.front(); E; E = E->next()) {
total -= E->get().vram;
for (_OSCoreBindImg &E : imgs) {
total -= E.vram;
}
}
@ -387,9 +387,7 @@ void _OS::print_resources_by_type(const Vector<String> &p_types) {
List<Ref<Resource>> resources;
ResourceCache::get_cached_resources(&resources);
for (List<Ref<Resource>>::Element *E = resources.front(); E; E = E->next()) {
Ref<Resource> r = E->get();
for (Ref<Resource> r : resources) {
bool found = false;
for (int i = 0; i < p_types.size(); i++) {
@ -1824,8 +1822,8 @@ PackedStringArray _ClassDB::get_class_list() const {
PackedStringArray ret;
ret.resize(classes.size());
int idx = 0;
for (List<StringName>::Element *E = classes.front(); E; E = E->next()) {
ret.set(idx++, E->get());
for (StringName &E : classes) {
ret.set(idx++, E);
}
return ret;
@ -1838,8 +1836,8 @@ PackedStringArray _ClassDB::get_inheriters_from_class(const StringName &p_class)
PackedStringArray ret;
ret.resize(classes.size());
int idx = 0;
for (List<StringName>::Element *E = classes.front(); E; E = E->next()) {
ret.set(idx++, E->get());
for (StringName &E : classes) {
ret.set(idx++, E);
}
return ret;
@ -1893,8 +1891,8 @@ Array _ClassDB::get_signal_list(StringName p_class, bool p_no_inheritance) const
ClassDB::get_signal_list(p_class, &signals, p_no_inheritance);
Array ret;
for (List<MethodInfo>::Element *E = signals.front(); E; E = E->next()) {
ret.push_back(E->get().operator Dictionary());
for (MethodInfo &E : signals) {
ret.push_back(E.operator Dictionary());
}
return ret;
@ -1904,8 +1902,8 @@ Array _ClassDB::get_property_list(StringName p_class, bool p_no_inheritance) con
List<PropertyInfo> plist;
ClassDB::get_property_list(p_class, &plist, p_no_inheritance);
Array ret;
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
ret.push_back(E->get().operator Dictionary());
for (PropertyInfo &E : plist) {
ret.push_back(E.operator Dictionary());
}
return ret;
@ -1937,12 +1935,12 @@ Array _ClassDB::get_method_list(StringName p_class, bool p_no_inheritance) const
ClassDB::get_method_list(p_class, &methods, p_no_inheritance);
Array ret;
for (List<MethodInfo>::Element *E = methods.front(); E; E = E->next()) {
for (MethodInfo &E : methods) {
#ifdef DEBUG_METHODS_ENABLED
ret.push_back(E->get().operator Dictionary());
ret.push_back(E.operator Dictionary());
#else
Dictionary dict;
dict["name"] = E->get().name;
dict["name"] = E.name;
ret.push_back(dict);
#endif
}
@ -1957,8 +1955,8 @@ PackedStringArray _ClassDB::get_integer_constant_list(const StringName &p_class,
PackedStringArray ret;
ret.resize(constants.size());
int idx = 0;
for (List<String>::Element *E = constants.front(); E; E = E->next()) {
ret.set(idx++, E->get());
for (String &E : constants) {
ret.set(idx++, E);
}
return ret;

View File

@ -40,11 +40,11 @@ Array DebuggerMarshalls::ResourceUsage::serialize() {
Array arr;
arr.push_back(infos.size() * 4);
for (List<ResourceInfo>::Element *E = infos.front(); E; E = E->next()) {
arr.push_back(E->get().path);
arr.push_back(E->get().format);
arr.push_back(E->get().type);
arr.push_back(E->get().vram);
for (ResourceInfo &E : infos) {
arr.push_back(E.path);
arr.push_back(E.format);
arr.push_back(E.type);
arr.push_back(E.vram);
}
return arr;
}

View File

@ -320,13 +320,13 @@ void LocalDebugger::print_variables(const List<String> &names, const List<Varian
String value;
Vector<String> value_lines;
const List<Variant>::Element *V = values.front();
for (const List<String>::Element *E = names.front(); E; E = E->next()) {
for (const String &E : names) {
value = String(V->get());
if (variable_prefix.is_empty()) {
print_line(E->get() + ": " + String(V->get()));
print_line(E + ": " + String(V->get()));
} else {
print_line(E->get() + ":");
print_line(E + ":");
value_lines = value.split("\n");
for (int i = 0; i < value_lines.size(); ++i) {
print_line(variable_prefix + value_lines[i]);

View File

@ -427,16 +427,16 @@ void RemoteDebugger::_send_resource_usage() {
List<RS::TextureInfo> tinfo;
RS::get_singleton()->texture_debug_usage(&tinfo);
for (List<RS::TextureInfo>::Element *E = tinfo.front(); E; E = E->next()) {
for (RS::TextureInfo &E : tinfo) {
DebuggerMarshalls::ResourceInfo info;
info.path = E->get().path;
info.vram = E->get().bytes;
info.id = E->get().texture;
info.path = E.path;
info.vram = E.bytes;
info.id = E.texture;
info.type = "Texture";
if (E->get().depth == 0) {
info.format = itos(E->get().width) + "x" + itos(E->get().height) + " " + Image::get_format_name(E->get().format);
if (E.depth == 0) {
info.format = itos(E.width) + "x" + itos(E.height) + " " + Image::get_format_name(E.format);
} else {
info.format = itos(E->get().width) + "x" + itos(E->get().height) + "x" + itos(E->get().depth) + " " + Image::get_format_name(E->get().format);
info.format = itos(E.width) + "x" + itos(E.height) + "x" + itos(E.depth) + " " + Image::get_format_name(E.format);
}
usage.infos.push_back(info);
}

View File

@ -276,10 +276,10 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
Dictionary d1;
d1["name"] = E->key();
Array values;
for (List<Pair<String, int>>::Element *F = E->get().front(); F; F = F->next()) {
for (Pair<String, int> &F : E->get()) {
Dictionary d2;
d2["name"] = F->get().first;
d2["value"] = F->get().second;
d2["name"] = F.first;
d2["value"] = F.second;
values.push_back(d2);
}
d1["values"] = values;
@ -294,8 +294,7 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
List<StringName> utility_func_names;
Variant::get_utility_function_list(&utility_func_names);
for (List<StringName>::Element *E = utility_func_names.front(); E; E = E->next()) {
StringName name = E->get();
for (StringName &name : utility_func_names) {
Dictionary func;
func["name"] = String(name);
if (Variant::has_utility_function_return_value(name)) {
@ -363,8 +362,7 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
List<StringName> member_names;
Variant::get_member_list(type, &member_names);
for (List<StringName>::Element *E = member_names.front(); E; E = E->next()) {
StringName member_name = E->get();
for (StringName &member_name : member_names) {
Dictionary d2;
d2["name"] = String(member_name);
d2["type"] = Variant::get_type_name(Variant::get_member_type(type, member_name));
@ -380,8 +378,7 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
List<StringName> constant_names;
Variant::get_constants_for_type(type, &constant_names);
for (List<StringName>::Element *E = constant_names.front(); E; E = E->next()) {
StringName constant_name = E->get();
for (StringName &constant_name : constant_names) {
Dictionary d2;
d2["name"] = String(constant_name);
Variant constant = Variant::get_constant_value(type, constant_name);
@ -420,8 +417,7 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
List<StringName> method_names;
Variant::get_builtin_method_list(type, &method_names);
for (List<StringName>::Element *E = method_names.front(); E; E = E->next()) {
StringName method_name = E->get();
for (StringName &method_name : method_names) {
Dictionary d2;
d2["name"] = String(method_name);
if (Variant::has_builtin_method_return_value(type, method_name)) {
@ -503,9 +499,8 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
class_list.sort_custom<StringName::AlphCompare>();
for (List<StringName>::Element *E = class_list.front(); E; E = E->next()) {
for (StringName &class_name : class_list) {
Dictionary d;
StringName class_name = E->get();
d["name"] = String(class_name);
d["is_refcounted"] = ClassDB::is_parent_class(class_name, "RefCounted");
d["is_instantiable"] = ClassDB::can_instantiate(class_name);
@ -525,15 +520,15 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
Array constants;
List<String> constant_list;
ClassDB::get_integer_constant_list(class_name, &constant_list, true);
for (List<String>::Element *F = constant_list.front(); F; F = F->next()) {
StringName enum_name = ClassDB::get_integer_constant_enum(class_name, F->get());
for (String &F : constant_list) {
StringName enum_name = ClassDB::get_integer_constant_enum(class_name, F);
if (enum_name != StringName()) {
continue; //enums will be handled on their own
}
Dictionary d2;
d2["name"] = String(F->get());
d2["value"] = ClassDB::get_integer_constant(class_name, F->get());
d2["name"] = String(F);
d2["value"] = ClassDB::get_integer_constant(class_name, F);
constants.push_back(d2);
}
@ -547,13 +542,13 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
Array enums;
List<StringName> enum_list;
ClassDB::get_enum_list(class_name, &enum_list, true);
for (List<StringName>::Element *F = enum_list.front(); F; F = F->next()) {
for (StringName &F : enum_list) {
Dictionary d2;
d2["name"] = String(F->get());
d2["name"] = String(F);
Array values;
List<StringName> enum_constant_list;
ClassDB::get_enum_constants(class_name, F->get(), &enum_constant_list, true);
ClassDB::get_enum_constants(class_name, F, &enum_constant_list, true);
for (List<StringName>::Element *G = enum_constant_list.front(); G; G = G->next()) {
Dictionary d3;
d3["name"] = String(G->get());
@ -575,14 +570,14 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
Array methods;
List<MethodInfo> method_list;
ClassDB::get_method_list(class_name, &method_list, true);
for (List<MethodInfo>::Element *F = method_list.front(); F; F = F->next()) {
StringName method_name = F->get().name;
if (F->get().flags & METHOD_FLAG_VIRTUAL) {
for (MethodInfo &F : method_list) {
StringName method_name = F.name;
if (F.flags & METHOD_FLAG_VIRTUAL) {
//virtual method
const MethodInfo &mi = F->get();
const MethodInfo &mi = F;
Dictionary d2;
d2["name"] = String(method_name);
d2["is_const"] = (F->get().flags & METHOD_FLAG_CONST) ? true : false;
d2["is_const"] = (F.flags & METHOD_FLAG_CONST) ? true : false;
d2["is_vararg"] = false;
d2["is_virtual"] = true;
// virtual functions have no hash since no MethodBind is involved
@ -619,7 +614,7 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
methods.push_back(d2);
} else if (F->get().name.begins_with("_")) {
} else if (F.name.begins_with("_")) {
//hidden method, ignore
} else {
@ -692,19 +687,19 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
Array signals;
List<MethodInfo> signal_list;
ClassDB::get_signal_list(class_name, &signal_list, true);
for (List<MethodInfo>::Element *F = signal_list.front(); F; F = F->next()) {
StringName signal_name = F->get().name;
for (MethodInfo &F : signal_list) {
StringName signal_name = F.name;
Dictionary d2;
d2["name"] = String(signal_name);
Array arguments;
for (int i = 0; i < F->get().arguments.size(); i++) {
for (int i = 0; i < F.arguments.size(); i++) {
Dictionary d3;
d3["name"] = F->get().arguments[i].name;
Variant::Type type = F->get().arguments[i].type;
if (F->get().arguments[i].class_name != StringName()) {
d3["type"] = String(F->get().arguments[i].class_name);
d3["name"] = F.arguments[i].name;
Variant::Type type = F.arguments[i].type;
if (F.arguments[i].class_name != StringName()) {
d3["type"] = String(F.arguments[i].class_name);
} else if (type == Variant::NIL) {
d3["type"] = "Variant";
} else {
@ -728,28 +723,28 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
Array properties;
List<PropertyInfo> property_list;
ClassDB::get_property_list(class_name, &property_list, true);
for (List<PropertyInfo>::Element *F = property_list.front(); F; F = F->next()) {
if (F->get().usage & PROPERTY_USAGE_CATEGORY || F->get().usage & PROPERTY_USAGE_GROUP || F->get().usage & PROPERTY_USAGE_SUBGROUP) {
for (PropertyInfo &F : property_list) {
if (F.usage & PROPERTY_USAGE_CATEGORY || F.usage & PROPERTY_USAGE_GROUP || F.usage & PROPERTY_USAGE_SUBGROUP) {
continue; //not real properties
}
if (F->get().name.begins_with("_")) {
if (F.name.begins_with("_")) {
continue; //hidden property
}
StringName property_name = F->get().name;
StringName property_name = F.name;
Dictionary d2;
d2["name"] = String(property_name);
if (F->get().class_name != StringName()) {
d2["type"] = String(F->get().class_name);
} else if (F->get().type == Variant::NIL && F->get().usage & PROPERTY_USAGE_NIL_IS_VARIANT) {
if (F.class_name != StringName()) {
d2["type"] = String(F.class_name);
} else if (F.type == Variant::NIL && F.usage & PROPERTY_USAGE_NIL_IS_VARIANT) {
d2["type"] = "Variant";
} else {
d2["type"] = Variant::get_type_name(F->get().type);
d2["type"] = Variant::get_type_name(F.type);
}
d2["setter"] = ClassDB::get_property_setter(class_name, F->get().name);
d2["getter"] = ClassDB::get_property_getter(class_name, F->get().name);
d2["index"] = ClassDB::get_property_index(class_name, F->get().name);
d2["setter"] = ClassDB::get_property_setter(class_name, F.name);
d2["getter"] = ClassDB::get_property_getter(class_name, F.name);
d2["index"] = ClassDB::get_property_index(class_name, F.name);
properties.push_back(d2);
}
@ -771,8 +766,7 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
List<Engine::Singleton> singleton_list;
Engine::get_singleton()->get_singletons(&singleton_list);
for (List<Engine::Singleton>::Element *E = singleton_list.front(); E; E = E->next()) {
const Engine::Singleton &s = E->get();
for (Engine::Singleton &s : singleton_list) {
Dictionary d;
d["name"] = s.name;
if (s.class_name != StringName()) {

View File

@ -351,8 +351,8 @@ RES NativeExtensionResourceLoader::load(const String &p_path, const String &p_or
String library_path;
for (List<String>::Element *E = libraries.front(); E; E = E->next()) {
Vector<String> tags = E->get().split(".");
for (String &E : libraries) {
Vector<String> tags = E.split(".");
bool all_tags_met = true;
for (int i = 0; i < tags.size(); i++) {
String tag = tags[i].strip_edges();
@ -363,7 +363,7 @@ RES NativeExtensionResourceLoader::load(const String &p_path, const String &p_or
}
if (all_tags_met) {
library_path = config->get_value("libraries", E->get());
library_path = config->get_value("libraries", E);
break;
}
}

View File

@ -174,9 +174,7 @@ void Input::get_argument_options(const StringName &p_function, int p_idx, List<S
List<PropertyInfo> pinfo;
ProjectSettings::get_singleton()->get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
const PropertyInfo &pi = E->get();
for (PropertyInfo &pi : pinfo) {
if (!pi.name.begins_with("input/")) {
continue;
}

View File

@ -65,11 +65,11 @@ String InputMap::_suggest_actions(const StringName &p_action) const {
float closest_similarity = 0.0;
// Find the most action with the most similar name.
for (List<StringName>::Element *E = actions.front(); E; E = E->next()) {
const float similarity = String(E->get()).similarity(p_action);
for (StringName &action : actions) {
const float similarity = String(action).similarity(p_action);
if (similarity > closest_similarity) {
closest_action = E->get();
closest_action = action;
closest_similarity = similarity;
}
}
@ -105,8 +105,8 @@ Array InputMap::_get_actions() {
return ret;
}
for (const List<StringName>::Element *E = actions.front(); E; E = E->next()) {
ret.push_back(E->get());
for (const StringName &E : actions) {
ret.push_back(E);
}
return ret;
@ -129,13 +129,11 @@ List<Ref<InputEvent>>::Element *InputMap::_find_event(Action &p_action, const Re
ERR_FAIL_COND_V(!p_event.is_valid(), nullptr);
for (List<Ref<InputEvent>>::Element *E = p_action.inputs.front(); E; E = E->next()) {
const Ref<InputEvent> e = E->get();
int device = e->get_device();
int device = E->get()->get_device();
if (device == ALL_DEVICES || device == p_event->get_device()) {
if (p_exact_match && e->is_match(p_event, true)) {
if (p_exact_match && E->get()->is_match(p_event, true)) {
return E;
} else if (!p_exact_match && e->action_match(p_event, p_pressed, p_strength, p_raw_strength, p_action.deadzone)) {
} else if (!p_exact_match && E->get()->action_match(p_event, p_pressed, p_strength, p_raw_strength, p_action.deadzone)) {
return E;
}
}
@ -198,7 +196,7 @@ Array InputMap::_action_get_events(const StringName &p_action) {
const List<Ref<InputEvent>> *al = action_get_events(p_action);
if (al) {
for (const List<Ref<InputEvent>>::Element *E = al->front(); E; E = E->next()) {
ret.push_back(E->get());
ret.push_back(E);
}
}
@ -263,9 +261,7 @@ void InputMap::load_from_project_settings() {
List<PropertyInfo> pinfo;
ProjectSettings::get_singleton()->get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
const PropertyInfo &pi = E->get();
for (PropertyInfo &pi : pinfo) {
if (!pi.name.begins_with("input/")) {
continue;
}

View File

@ -40,8 +40,8 @@ PackedStringArray ConfigFile::_get_sections() const {
PackedStringArray arr;
arr.resize(s.size());
int idx = 0;
for (const List<String>::Element *E = s.front(); E; E = E->next()) {
arr.set(idx++, E->get());
for (const String &E : s) {
arr.set(idx++, E);
}
return arr;
@ -53,8 +53,8 @@ PackedStringArray ConfigFile::_get_section_keys(const String &p_section) const {
PackedStringArray arr;
arr.resize(s.size());
int idx = 0;
for (const List<String>::Element *E = s.front(); E; E = E->next()) {
arr.set(idx++, E->get());
for (const String &E : s) {
arr.set(idx++, E);
}
return arr;

View File

@ -93,8 +93,8 @@ static Error _erase_recursive(DirAccess *da) {
da->list_dir_end();
for (List<String>::Element *E = dirs.front(); E; E = E->next()) {
Error err = da->change_dir(E->get());
for (String &E : dirs) {
Error err = da->change_dir(E);
if (err == OK) {
err = _erase_recursive(da);
if (err) {
@ -105,7 +105,7 @@ static Error _erase_recursive(DirAccess *da) {
if (err) {
return err;
}
err = da->remove(da->get_current_dir().plus_file(E->get()));
err = da->remove(da->get_current_dir().plus_file(E));
if (err) {
return err;
}
@ -114,8 +114,8 @@ static Error _erase_recursive(DirAccess *da) {
}
}
for (List<String>::Element *E = files.front(); E; E = E->next()) {
Error err = da->remove(da->get_current_dir().plus_file(E->get()));
for (String &E : files) {
Error err = da->remove(da->get_current_dir().plus_file(E));
if (err) {
return err;
}
@ -362,16 +362,15 @@ Error DirAccess::_copy_dir(DirAccess *p_target_da, String p_to, int p_chmod_flag
list_dir_end();
for (List<String>::Element *E = dirs.front(); E; E = E->next()) {
String rel_path = E->get();
for (String &rel_path : dirs) {
String target_dir = p_to + rel_path;
if (!p_target_da->dir_exists(target_dir)) {
Error err = p_target_da->make_dir(target_dir);
ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot create directory '" + target_dir + "'.");
}
Error err = change_dir(E->get());
ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot change current directory to '" + E->get() + "'.");
Error err = change_dir(rel_path);
ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot change current directory to '" + rel_path + "'.");
err = _copy_dir(p_target_da, p_to + rel_path + "/", p_chmod_flags, p_copy_links);
if (err) {

View File

@ -93,8 +93,7 @@ Dictionary HTTPClient::_get_response_headers_as_dictionary() {
List<String> rh;
get_response_headers(&rh);
Dictionary ret;
for (const List<String>::Element *E = rh.front(); E; E = E->next()) {
const String &s = E->get();
for (const String &s : rh) {
int sp = s.find(":");
if (sp == -1) {
continue;
@ -113,8 +112,8 @@ PackedStringArray HTTPClient::_get_response_headers() {
PackedStringArray ret;
ret.resize(rh.size());
int idx = 0;
for (const List<String>::Element *E = rh.front(); E; E = E->next()) {
ret.set(idx++, E->get());
for (const String &E : rh) {
ret.set(idx++, E);
}
return ret;

View File

@ -35,8 +35,8 @@
bool ImageFormatLoader::recognize(const String &p_extension) const {
List<String> extensions;
get_recognized_extensions(&extensions);
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
if (E->get().nocasecmp_to(p_extension) == 0) {
for (String &E : extensions) {
if (E.nocasecmp_to(p_extension) == 0) {
return true;
}
}

View File

@ -252,8 +252,8 @@ Array IP::_get_local_addresses() const {
Array addresses;
List<IPAddress> ip_addresses;
get_local_addresses(&ip_addresses);
for (List<IPAddress>::Element *E = ip_addresses.front(); E; E = E->next()) {
addresses.push_back(E->get());
for (IPAddress &E : ip_addresses) {
addresses.push_back(E);
}
return addresses;
@ -271,8 +271,8 @@ Array IP::_get_local_interfaces() const {
rc["index"] = c.index;
Array ips;
for (const List<IPAddress>::Element *F = c.ip_addresses.front(); F; F = F->next()) {
ips.push_front(F->get());
for (const IPAddress &F : c.ip_addresses) {
ips.push_front(F);
}
rc["addresses"] = ips;
@ -286,8 +286,8 @@ void IP::get_local_addresses(List<IPAddress> *r_addresses) const {
Map<String, Interface_Info> interfaces;
get_local_interfaces(&interfaces);
for (Map<String, Interface_Info>::Element *E = interfaces.front(); E; E = E->next()) {
for (const List<IPAddress>::Element *F = E->get().ip_addresses.front(); F; F = F->next()) {
r_addresses->push_front(F->get());
for (const IPAddress &F : E->get().ip_addresses) {
r_addresses->push_front(F);
}
}
}

View File

@ -121,14 +121,14 @@ String JSON::_stringify(const Variant &p_var, const String &p_indent, int p_cur_
keys.sort();
}
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
for (Variant &E : keys) {
if (E != keys.front()) {
s += ",";
s += end_statement;
}
s += _make_indent(p_indent, p_cur_indent + 1) + _stringify(String(E->get()), p_indent, p_cur_indent + 1, p_sort_keys, p_markers);
s += _make_indent(p_indent, p_cur_indent + 1) + _stringify(String(E), p_indent, p_cur_indent + 1, p_sort_keys, p_markers);
s += colon;
s += _stringify(d[E->get()], p_indent, p_cur_indent + 1, p_sort_keys, p_markers);
s += _stringify(d[E], p_indent, p_cur_indent + 1, p_sort_keys, p_markers);
}
s += end_statement + _make_indent(p_indent, p_cur_indent) + "}";

View File

@ -1358,8 +1358,8 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
obj->get_property_list(&props);
int pc = 0;
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) {
for (PropertyInfo &E : props) {
if (!(E.usage & PROPERTY_USAGE_STORAGE)) {
continue;
}
pc++;
@ -1372,15 +1372,15 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
r_len += 4;
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) {
for (PropertyInfo &E : props) {
if (!(E.usage & PROPERTY_USAGE_STORAGE)) {
continue;
}
_encode_string(E->get().name, buf, r_len);
_encode_string(E.name, buf, r_len);
int len;
Error err = encode_variant(obj->get(E->get().name), buf, len, p_full_objects);
Error err = encode_variant(obj->get(E.name), buf, len, p_full_objects);
if (err) {
return err;
}
@ -1418,7 +1418,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
List<Variant> keys;
d.get_key_list(&keys);
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
for (Variant &E : keys) {
/*
CharString utf8 = E->->utf8();
@ -1433,13 +1433,13 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
r_len++; //pad
*/
int len;
encode_variant(E->get(), buf, len, p_full_objects);
encode_variant(E, buf, len, p_full_objects);
ERR_FAIL_COND_V(len % 4, ERR_BUG);
r_len += len;
if (buf) {
buf += len;
}
Variant *v = d.getptr(E->get());
Variant *v = d.getptr(E);
ERR_FAIL_COND_V(!v, ERR_BUG);
encode_variant(*v, buf, len, p_full_objects);
ERR_FAIL_COND_V(len % 4, ERR_BUG);

View File

@ -555,12 +555,12 @@ bool MultiplayerAPI::_send_confirm_path(Node *p_node, NodePath p_path, PathSentC
ofs += encode_cstring(path.get_data(), &packet.write[ofs]);
for (List<int>::Element *E = peers_to_add.front(); E; E = E->next()) {
network_peer->set_target_peer(E->get()); // To all of you.
for (int &E : peers_to_add) {
network_peer->set_target_peer(E); // To all of you.
network_peer->set_transfer_mode(MultiplayerPeer::TRANSFER_MODE_RELIABLE);
network_peer->put_packet(packet.ptr(), packet.size());
psc->confirmed_peers.insert(E->get(), false); // Insert into confirmed, but as false since it was not confirmed.
psc->confirmed_peers.insert(E, false); // Insert into confirmed, but as false since it was not confirmed.
}
}
@ -917,8 +917,8 @@ void MultiplayerAPI::_del_peer(int p_id) {
// Some refactoring is needed to make this faster and do paths GC.
List<NodePath> keys;
path_send_cache.get_key_list(&keys);
for (List<NodePath>::Element *E = keys.front(); E; E = E->next()) {
PathSentCache *psc = path_send_cache.getptr(E->get());
for (NodePath &E : keys) {
PathSentCache *psc = path_send_cache.getptr(E);
psc->confirmed_peers.erase(p_id);
}
emit_signal(SNAME("network_peer_disconnected"), p_id);

View File

@ -268,21 +268,21 @@ uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpd
d.get_key_list(&keys);
List<DictKey> sortk;
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
for (Variant &key : keys) {
DictKey dk;
dk.hash = E->get().hash();
dk.key = E->get();
dk.hash = key.hash();
dk.key = key;
sortk.push_back(dk);
}
sortk.sort();
int idx = 0;
for (List<DictKey>::Element *E = sortk.front(); E; E = E->next()) {
encode_uint32(E->get().hash, &tmpdata.write[pos + 8 + idx * 12 + 0]);
uint32_t ofs = _pack(E->get().key, tmpdata, string_cache);
for (DictKey &E : sortk) {
encode_uint32(E.hash, &tmpdata.write[pos + 8 + idx * 12 + 0]);
uint32_t ofs = _pack(E.key, tmpdata, string_cache);
encode_uint32(ofs, &tmpdata.write[pos + 8 + idx * 12 + 4]);
ofs = _pack(d[E->get().key], tmpdata, string_cache);
ofs = _pack(d[E.key], tmpdata, string_cache);
encode_uint32(ofs, &tmpdata.write[pos + 8 + idx * 12 + 8]);
idx++;
}

View File

@ -165,15 +165,15 @@ Error Resource::copy_from(const Ref<Resource> &p_resource) {
List<PropertyInfo> pi;
p_resource->get_property_list(&pi);
for (List<PropertyInfo>::Element *E = pi.front(); E; E = E->next()) {
if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) {
for (PropertyInfo &E : pi) {
if (!(E.usage & PROPERTY_USAGE_STORAGE)) {
continue;
}
if (E->get().name == "resource_path") {
if (E.name == "resource_path") {
continue; //do not change path
}
set(E->get().name, p_resource->get(E->get().name));
set(E.name, p_resource->get(E.name));
}
return OK;
}
@ -201,11 +201,11 @@ Ref<Resource> Resource::duplicate_for_local_scene(Node *p_for_scene, Map<Ref<Res
r->local_scene = p_for_scene;
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) {
for (PropertyInfo &E : plist) {
if (!(E.usage & PROPERTY_USAGE_STORAGE)) {
continue;
}
Variant p = get(E->get().name);
Variant p = get(E.name);
if (p.get_type() == Variant::OBJECT) {
RES sr = p;
if (sr.is_valid()) {
@ -221,7 +221,7 @@ Ref<Resource> Resource::duplicate_for_local_scene(Node *p_for_scene, Map<Ref<Res
}
}
r->set(E->get().name, p);
r->set(E.name, p);
}
return r;
@ -233,11 +233,11 @@ void Resource::configure_for_local_scene(Node *p_for_scene, Map<Ref<Resource>, R
local_scene = p_for_scene;
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) {
for (PropertyInfo &E : plist) {
if (!(E.usage & PROPERTY_USAGE_STORAGE)) {
continue;
}
Variant p = get(E->get().name);
Variant p = get(E.name);
if (p.get_type() == Variant::OBJECT) {
RES sr = p;
if (sr.is_valid()) {
@ -259,21 +259,21 @@ Ref<Resource> Resource::duplicate(bool p_subresources) const {
Ref<Resource> r = (Resource *)ClassDB::instantiate(get_class());
ERR_FAIL_COND_V(r.is_null(), Ref<Resource>());
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) {
for (PropertyInfo &E : plist) {
if (!(E.usage & PROPERTY_USAGE_STORAGE)) {
continue;
}
Variant p = get(E->get().name);
Variant p = get(E.name);
if ((p.get_type() == Variant::DICTIONARY || p.get_type() == Variant::ARRAY)) {
r->set(E->get().name, p.duplicate(p_subresources));
} else if (p.get_type() == Variant::OBJECT && (p_subresources || (E->get().usage & PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE))) {
r->set(E.name, p.duplicate(p_subresources));
} else if (p.get_type() == Variant::OBJECT && (p_subresources || (E.usage & PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE))) {
RES sr = p;
if (sr.is_valid()) {
r->set(E->get().name, sr->duplicate(p_subresources));
r->set(E.name, sr->duplicate(p_subresources));
}
} else {
r->set(E->get().name, p);
r->set(E.name, p);
}
}
@ -317,9 +317,9 @@ uint32_t Resource::hash_edited_version() const {
List<PropertyInfo> plist;
get_property_list(&plist);
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
if (E->get().usage & PROPERTY_USAGE_STORAGE && E->get().type == Variant::OBJECT && E->get().hint == PROPERTY_HINT_RESOURCE_TYPE) {
RES res = get(E->get().name);
for (PropertyInfo &E : plist) {
if (E.usage & PROPERTY_USAGE_STORAGE && E.type == Variant::OBJECT && E.hint == PROPERTY_HINT_RESOURCE_TYPE) {
RES res = get(E.name);
if (res.is_valid()) {
hash = hash_djb2_one_32(res->hash_edited_version(), hash);
}

View File

@ -1025,8 +1025,8 @@ void ResourceFormatLoaderBinary::get_recognized_extensions_for_type(const String
extensions.sort();
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
String ext = E->get().to_lower();
for (String &E : extensions) {
String ext = E.to_lower();
p_extensions->push_back(ext);
}
}
@ -1036,8 +1036,8 @@ void ResourceFormatLoaderBinary::get_recognized_extensions(List<String> *p_exten
ClassDB::get_resource_base_extensions(&extensions);
extensions.sort();
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
String ext = E->get().to_lower();
for (String &E : extensions) {
String ext = E.to_lower();
p_extensions->push_back(ext);
}
}
@ -1528,14 +1528,14 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia
List<Variant> keys;
d.get_key_list(&keys);
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
for (Variant &E : keys) {
/*
if (!_check_type(dict[E->get()]))
if (!_check_type(dict[E]))
continue;
*/
write_variant(f, E->get(), resource_map, external_resources, string_map);
write_variant(f, d[E->get()], resource_map, external_resources, string_map);
write_variant(f, E, resource_map, external_resources, string_map);
write_variant(f, d[E], resource_map, external_resources, string_map);
}
} break;
@ -1685,15 +1685,15 @@ void ResourceFormatSaverBinaryInstance::_find_resources(const Variant &p_variant
res->get_property_list(&property_list);
for (List<PropertyInfo>::Element *E = property_list.front(); E; E = E->next()) {
if (E->get().usage & PROPERTY_USAGE_STORAGE) {
Variant value = res->get(E->get().name);
if (E->get().usage & PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT) {
for (PropertyInfo &E : property_list) {
if (E.usage & PROPERTY_USAGE_STORAGE) {
Variant value = res->get(E.name);
if (E.usage & PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT) {
RES sres = value;
if (sres.is_valid()) {
NonPersistentKey npk;
npk.base = res;
npk.property = E->get().name;
npk.property = E.name;
non_persistent_map[npk] = sres;
resource_set.insert(sres);
saved_resources.push_back(sres);
@ -1723,9 +1723,9 @@ void ResourceFormatSaverBinaryInstance::_find_resources(const Variant &p_variant
Dictionary d = p_variant;
List<Variant> keys;
d.get_key_list(&keys);
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
_find_resources(E->get());
Variant v = d[E->get()];
for (Variant &E : keys) {
_find_resources(E);
Variant v = d[E];
_find_resources(v);
}
} break;
@ -1832,39 +1832,39 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p
List<ResourceData> resources;
{
for (List<RES>::Element *E = saved_resources.front(); E; E = E->next()) {
for (RES &E : saved_resources) {
ResourceData &rd = resources.push_back(ResourceData())->get();
rd.type = E->get()->get_class();
rd.type = E->get_class();
List<PropertyInfo> property_list;
E->get()->get_property_list(&property_list);
E->get_property_list(&property_list);
for (List<PropertyInfo>::Element *F = property_list.front(); F; F = F->next()) {
if (skip_editor && F->get().name.begins_with("__editor")) {
for (PropertyInfo &F : property_list) {
if (skip_editor && F.name.begins_with("__editor")) {
continue;
}
if ((F->get().usage & PROPERTY_USAGE_STORAGE)) {
if ((F.usage & PROPERTY_USAGE_STORAGE)) {
Property p;
p.name_idx = get_string_index(F->get().name);
p.name_idx = get_string_index(F.name);
if (F->get().usage & PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT) {
if (F.usage & PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT) {
NonPersistentKey npk;
npk.base = E->get();
npk.property = F->get().name;
npk.base = E;
npk.property = F.name;
if (non_persistent_map.has(npk)) {
p.value = non_persistent_map[npk];
}
} else {
p.value = E->get()->get(F->get().name);
p.value = E->get(F.name);
}
Variant default_value = ClassDB::class_get_default_property_value(E->get()->get_class(), F->get().name);
Variant default_value = ClassDB::class_get_default_property_value(E->get_class(), F.name);
if (default_value.get_type() != Variant::NIL && bool(Variant::evaluate(Variant::OP_EQUAL, p.value, default_value))) {
continue;
}
p.pi = F->get();
p.pi = F;
rd.properties.push_back(p);
}
@ -1897,8 +1897,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p
Vector<uint64_t> ofs_pos;
Set<String> used_unique_ids;
for (List<RES>::Element *E = saved_resources.front(); E; E = E->next()) {
RES r = E->get();
for (RES &r : saved_resources) {
if (r->get_path() == "" || r->get_path().find("::") != -1) {
if (r->get_scene_unique_id() != "") {
if (used_unique_ids.has(r->get_scene_unique_id())) {
@ -1912,8 +1911,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p
Map<RES, int> resource_map;
int res_index = 0;
for (List<RES>::Element *E = saved_resources.front(); E; E = E->next()) {
RES r = E->get();
for (RES &r : saved_resources) {
if (r->get_path() == "" || r->get_path().find("::") != -1) {
if (r->get_scene_unique_id() == "") {
String new_id;
@ -1947,17 +1945,15 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p
Vector<uint64_t> ofs_table;
//now actually save the resources
for (List<ResourceData>::Element *E = resources.front(); E; E = E->next()) {
ResourceData &rd = E->get();
for (ResourceData &rd : resources) {
ofs_table.push_back(f->get_position());
save_unicode_string(f, rd.type);
f->store_32(rd.properties.size());
for (List<Property>::Element *F = rd.properties.front(); F; F = F->next()) {
Property &p = F->get();
for (Property &F : rd.properties) {
Property &p = F;
f->store_32(p.name_idx);
write_variant(f, p.value, resource_map, external_resources, string_map, F->get().pi);
write_variant(f, p.value, resource_map, external_resources, string_map, F.pi);
}
}

View File

@ -146,10 +146,10 @@ void ResourceFormatImporter::get_recognized_extensions(List<String> *p_extension
for (int i = 0; i < importers.size(); i++) {
List<String> local_exts;
importers[i]->get_recognized_extensions(&local_exts);
for (List<String>::Element *F = local_exts.front(); F; F = F->next()) {
if (!found.has(F->get())) {
p_extensions->push_back(F->get());
found.insert(F->get());
for (String &F : local_exts) {
if (!found.has(F)) {
p_extensions->push_back(F);
found.insert(F);
}
}
}
@ -175,10 +175,10 @@ void ResourceFormatImporter::get_recognized_extensions_for_type(const String &p_
List<String> local_exts;
importers[i]->get_recognized_extensions(&local_exts);
for (List<String>::Element *F = local_exts.front(); F; F = F->next()) {
if (!found.has(F->get())) {
p_extensions->push_back(F->get());
found.insert(F->get());
for (String &F : local_exts) {
if (!found.has(F)) {
p_extensions->push_back(F);
found.insert(F);
}
}
}
@ -372,8 +372,8 @@ void ResourceFormatImporter::get_importers_for_extension(const String &p_extensi
for (int i = 0; i < importers.size(); i++) {
List<String> local_exts;
importers[i]->get_recognized_extensions(&local_exts);
for (List<String>::Element *F = local_exts.front(); F; F = F->next()) {
if (p_extension.to_lower() == F->get()) {
for (String &F : local_exts) {
if (p_extension.to_lower() == F) {
r_importers->push_back(importers[i]);
}
}
@ -393,8 +393,8 @@ Ref<ResourceImporter> ResourceFormatImporter::get_importer_by_extension(const St
for (int i = 0; i < importers.size(); i++) {
List<String> local_exts;
importers[i]->get_recognized_extensions(&local_exts);
for (List<String>::Element *F = local_exts.front(); F; F = F->next()) {
if (p_extension.to_lower() == F->get() && importers[i]->get_priority() > priority) {
for (String &F : local_exts) {
if (p_extension.to_lower() == F && importers[i]->get_priority() > priority) {
importer = importers[i];
priority = importers[i]->get_priority();
}

View File

@ -58,8 +58,8 @@ bool ResourceFormatLoader::recognize_path(const String &p_path, const String &p_
get_recognized_extensions_for_type(p_for_type, &extensions);
}
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
if (E->get().nocasecmp_to(extension) == 0) {
for (String &E : extensions) {
if (E.nocasecmp_to(extension) == 0) {
return true;
}
}
@ -978,15 +978,15 @@ void ResourceLoader::load_translation_remaps() {
Dictionary remaps = ProjectSettings::get_singleton()->get("internationalization/locale/translation_remaps");
List<Variant> keys;
remaps.get_key_list(&keys);
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
Array langs = remaps[E->get()];
for (Variant &E : keys) {
Array langs = remaps[E];
Vector<String> lang_remaps;
lang_remaps.resize(langs.size());
for (int i = 0; i < langs.size(); i++) {
lang_remaps.write[i] = langs[i];
}
translation_remaps[String(E->get())] = lang_remaps;
translation_remaps[String(E)] = lang_remaps;
}
}
@ -1071,8 +1071,7 @@ void ResourceLoader::add_custom_loaders() {
List<StringName> global_classes;
ScriptServer::get_global_class_list(&global_classes);
for (List<StringName>::Element *E = global_classes.front(); E; E = E->next()) {
StringName class_name = E->get();
for (StringName &class_name : global_classes) {
StringName base_class = ScriptServer::get_global_class_native_base(class_name);
if (base_class == custom_loader_base_class) {

View File

@ -94,8 +94,8 @@ Error ResourceSaver::save(const String &p_path, const RES &p_resource, uint32_t
bool recognized = false;
saver[i]->get_recognized_extensions(p_resource, &extensions);
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
if (E->get().nocasecmp_to(extension) == 0) {
for (String &E : extensions) {
if (E.nocasecmp_to(extension) == 0) {
recognized = true;
}
}
@ -236,8 +236,7 @@ void ResourceSaver::add_custom_savers() {
List<StringName> global_classes;
ScriptServer::get_global_class_list(&global_classes);
for (List<StringName>::Element *E = global_classes.front(); E; E = E->next()) {
StringName class_name = E->get();
for (StringName &class_name : global_classes) {
StringName base_class = ScriptServer::get_global_class_native_base(class_name);
if (base_class == custom_saver_base_class) {

View File

@ -375,8 +375,7 @@ public:
OutputSimplex *ret_simplicesw = ret_simplices.ptrw();
uint32_t simplices_written = 0;
for (List<Simplex *>::Element *E = simplex_list.front(); E; E = E->next()) {
Simplex *simplex = E->get();
for (Simplex *simplex : simplex_list) {
bool invalid = false;
for (int j = 0; j < 4; j++) {
if (simplex->points[j] >= point_count) {

View File

@ -192,9 +192,9 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry3D::MeshData &r_
continue;
}
for (List<Face>::Element *E = faces.front(); E; E = E->next()) {
if (E->get().plane.distance_to(p_points[i]) > over_tolerance) {
E->get().points_over.push_back(i);
for (Face &E : faces) {
if (E.plane.distance_to(p_points[i]) > over_tolerance) {
E.points_over.push_back(i);
break;
}
}
@ -292,8 +292,8 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry3D::MeshData &r_
//distribute points into new faces
for (List<List<Face>::Element *>::Element *F = lit_faces.front(); F; F = F->next()) {
Face &lf = F->get()->get();
for (List<Face>::Element *&F : lit_faces) {
Face &lf = F->get();
for (int i = 0; i < lf.points_over.size(); i++) {
if (lf.points_over[i] == f.points_over[next]) { //do not add current one
@ -301,8 +301,8 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry3D::MeshData &r_
}
Vector3 p = p_points[lf.points_over[i]];
for (List<List<Face>::Element *>::Element *E = new_faces.front(); E; E = E->next()) {
Face &f2 = E->get()->get();
for (List<Face>::Element *&E : new_faces) {
Face &f2 = E->get();
if (f2.plane.distance_to(p) > over_tolerance) {
f2.points_over.push_back(lf.points_over[i]);
break;
@ -320,10 +320,10 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry3D::MeshData &r_
//put faces that contain no points on the front
for (List<List<Face>::Element *>::Element *E = new_faces.front(); E; E = E->next()) {
Face &f2 = E->get()->get();
for (List<Face>::Element *&E : new_faces) {
Face &f2 = E->get();
if (f2.points_over.size() == 0) {
faces.move_to_front(E->get());
faces.move_to_front(E);
}
}
@ -336,19 +336,19 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry3D::MeshData &r_
Map<Edge, RetFaceConnect> ret_edges;
List<Geometry3D::MeshData::Face> ret_faces;
for (List<Face>::Element *E = faces.front(); E; E = E->next()) {
for (Face &E : faces) {
Geometry3D::MeshData::Face f;
f.plane = E->get().plane;
f.plane = E.plane;
for (int i = 0; i < 3; i++) {
f.indices.push_back(E->get().vertices[i]);
f.indices.push_back(E.vertices[i]);
}
List<Geometry3D::MeshData::Face>::Element *F = ret_faces.push_back(f);
for (int i = 0; i < 3; i++) {
uint32_t a = E->get().vertices[i];
uint32_t b = E->get().vertices[(i + 1) % 3];
uint32_t a = E.vertices[i];
uint32_t b = E.vertices[(i + 1) % 3];
Edge e(a, b);
Map<Edge, RetFaceConnect>::Element *G = ret_edges.find(e);
@ -439,8 +439,8 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry3D::MeshData &r_
r_mesh.faces.resize(ret_faces.size());
int idx = 0;
for (List<Geometry3D::MeshData::Face>::Element *E = ret_faces.front(); E; E = E->next()) {
r_mesh.faces.write[idx++] = E->get();
for (Geometry3D::MeshData::Face &E : ret_faces) {
r_mesh.faces.write[idx++] = E;
}
r_mesh.edges.resize(ret_edges.size());
idx = 0;

View File

@ -359,9 +359,9 @@ uint64_t ClassDB::get_api_hash(APIType p_api) {
//must be alphabetically sorted for hash to compute
names.sort_custom<StringName::AlphCompare>();
for (List<StringName>::Element *E = names.front(); E; E = E->next()) {
ClassInfo *t = classes.getptr(E->get());
ERR_FAIL_COND_V_MSG(!t, 0, "Cannot get class '" + String(E->get()) + "'.");
for (StringName &E : names) {
ClassInfo *t = classes.getptr(E);
ERR_FAIL_COND_V_MSG(!t, 0, "Cannot get class '" + String(E) + "'.");
if (t->api != p_api || !t->exposed) {
continue;
}
@ -388,8 +388,8 @@ uint64_t ClassDB::get_api_hash(APIType p_api) {
snames.sort_custom<StringName::AlphCompare>();
for (List<StringName>::Element *F = snames.front(); F; F = F->next()) {
MethodBind *mb = t->method_map[F->get()];
for (StringName &F : snames) {
MethodBind *mb = t->method_map[F];
hash = hash_djb2_one_64(mb->get_name().hash(), hash);
hash = hash_djb2_one_64(mb->get_argument_count(), hash);
hash = hash_djb2_one_64(mb->get_argument_type(-1), hash); //return
@ -426,9 +426,9 @@ uint64_t ClassDB::get_api_hash(APIType p_api) {
snames.sort_custom<StringName::AlphCompare>();
for (List<StringName>::Element *F = snames.front(); F; F = F->next()) {
hash = hash_djb2_one_64(F->get().hash(), hash);
hash = hash_djb2_one_64(t->constant_map[F->get()], hash);
for (StringName &F : snames) {
hash = hash_djb2_one_64(F.hash(), hash);
hash = hash_djb2_one_64(t->constant_map[F], hash);
}
}
@ -444,9 +444,9 @@ uint64_t ClassDB::get_api_hash(APIType p_api) {
snames.sort_custom<StringName::AlphCompare>();
for (List<StringName>::Element *F = snames.front(); F; F = F->next()) {
MethodInfo &mi = t->signal_map[F->get()];
hash = hash_djb2_one_64(F->get().hash(), hash);
for (StringName &F : snames) {
MethodInfo &mi = t->signal_map[F];
hash = hash_djb2_one_64(F.hash(), hash);
for (int i = 0; i < mi.arguments.size(); i++) {
hash = hash_djb2_one_64(mi.arguments[i].type, hash);
}
@ -465,23 +465,23 @@ uint64_t ClassDB::get_api_hash(APIType p_api) {
snames.sort_custom<StringName::AlphCompare>();
for (List<StringName>::Element *F = snames.front(); F; F = F->next()) {
PropertySetGet *psg = t->property_setget.getptr(F->get());
for (StringName &F : snames) {
PropertySetGet *psg = t->property_setget.getptr(F);
ERR_FAIL_COND_V(!psg, 0);
hash = hash_djb2_one_64(F->get().hash(), hash);
hash = hash_djb2_one_64(F.hash(), hash);
hash = hash_djb2_one_64(psg->setter.hash(), hash);
hash = hash_djb2_one_64(psg->getter.hash(), hash);
}
}
//property list
for (List<PropertyInfo>::Element *F = t->property_list.front(); F; F = F->next()) {
hash = hash_djb2_one_64(F->get().name.hash(), hash);
hash = hash_djb2_one_64(F->get().type, hash);
hash = hash_djb2_one_64(F->get().hint, hash);
hash = hash_djb2_one_64(F->get().hint_string.hash(), hash);
hash = hash_djb2_one_64(F->get().usage, hash);
for (PropertyInfo &F : t->property_list) {
hash = hash_djb2_one_64(F.name.hash(), hash);
hash = hash_djb2_one_64(F.type, hash);
hash = hash_djb2_one_64(F.hint, hash);
hash = hash_djb2_one_64(F.hint_string.hash(), hash);
hash = hash_djb2_one_64(F.usage, hash);
}
}
@ -619,16 +619,16 @@ void ClassDB::get_method_list(const StringName &p_class, List<MethodInfo> *p_met
#ifdef DEBUG_METHODS_ENABLED
for (List<MethodInfo>::Element *E = type->virtual_methods.front(); E; E = E->next()) {
p_methods->push_back(E->get());
for (MethodInfo &E : type->virtual_methods) {
p_methods->push_back(E);
}
for (List<StringName>::Element *E = type->method_order.front(); E; E = E->next()) {
if (p_exclude_from_properties && type->methods_in_properties.has(E->get())) {
for (StringName &E : type->method_order) {
if (p_exclude_from_properties && type->methods_in_properties.has(E)) {
continue;
}
MethodBind *method = type->method_map.get(E->get());
MethodBind *method = type->method_map.get(E);
MethodInfo minfo = info_from_bind(method);
p_methods->push_back(minfo);
@ -763,8 +763,8 @@ void ClassDB::get_integer_constant_list(const StringName &p_class, List<String>
while (type) {
#ifdef DEBUG_METHODS_ENABLED
for (List<StringName>::Element *E = type->constant_order.front(); E; E = E->next()) {
p_constants->push_back(E->get());
for (StringName &E : type->constant_order) {
p_constants->push_back(E);
}
#else
const StringName *K = nullptr;
@ -1073,13 +1073,12 @@ void ClassDB::get_property_list(const StringName &p_class, List<PropertyInfo> *p
ClassInfo *type = classes.getptr(p_class);
ClassInfo *check = type;
while (check) {
for (List<PropertyInfo>::Element *E = check->property_list.front(); E; E = E->next()) {
for (PropertyInfo pi : check->property_list) {
if (p_validator) {
PropertyInfo pi = E->get();
p_validator->_validate_property(pi);
p_list->push_back(pi);
} else {
p_list->push_back(E->get());
p_list->push_back(pi);
}
}
@ -1429,8 +1428,8 @@ void ClassDB::get_virtual_methods(const StringName &p_class, List<MethodInfo> *p
ClassInfo *type = classes.getptr(p_class);
ClassInfo *check = type;
while (check) {
for (List<MethodInfo>::Element *E = check->virtual_methods.front(); E; E = E->next()) {
p_methods->push_back(E->get());
for (MethodInfo &E : check->virtual_methods) {
p_methods->push_back(E);
}
if (p_no_inheritance) {
@ -1530,11 +1529,11 @@ Variant ClassDB::class_get_default_property_value(const StringName &p_class, con
if (c) {
List<PropertyInfo> plist;
c->get_property_list(&plist);
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
if (E->get().usage & (PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR)) {
if (!default_values[p_class].has(E->get().name)) {
Variant v = c->get(E->get().name);
default_values[p_class][E->get().name] = v;
for (PropertyInfo &E : plist) {
if (E.usage & (PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR)) {
if (!default_values[p_class].has(E.name)) {
Variant v = c->get(E.name);
default_values[p_class][E.name] = v;
}
}
}

View File

@ -969,8 +969,8 @@ Vector<StringName> Object::_get_meta_list_bind() const {
List<Variant> keys;
metadata.get_key_list(&keys);
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
_metaret.push_back(E->get());
for (Variant &E : keys) {
_metaret.push_back(E);
}
return _metaret;
@ -979,8 +979,8 @@ Vector<StringName> Object::_get_meta_list_bind() const {
void Object::get_meta_list(List<StringName> *p_list) const {
List<Variant> keys;
metadata.get_key_list(&keys);
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
p_list->push_back(E->get());
for (Variant &E : keys) {
p_list->push_back(E);
}
}
@ -1184,8 +1184,8 @@ Array Object::_get_signal_list() const {
get_signal_list(&signal_list);
Array ret;
for (List<MethodInfo>::Element *E = signal_list.front(); E; E = E->next()) {
ret.push_back(Dictionary(E->get()));
for (MethodInfo &E : signal_list) {
ret.push_back(Dictionary(E));
}
return ret;
@ -1197,8 +1197,7 @@ Array Object::_get_signal_connection_list(const String &p_signal) const {
Array ret;
for (List<Connection>::Element *E = conns.front(); E; E = E->next()) {
Connection &c = E->get();
for (Connection &c : conns) {
if (c.signal.get_name() == p_signal) {
ret.push_back(c);
}
@ -1297,8 +1296,8 @@ int Object::get_persistent_signal_connection_count() const {
}
void Object::get_signals_connected_to_this(List<Connection> *p_connections) const {
for (const List<Connection>::Element *E = connections.front(); E; E = E->next()) {
p_connections->push_back(E->get());
for (const Connection &E : connections) {
p_connections->push_back(E);
}
}
@ -1500,9 +1499,9 @@ void Object::_clear_internal_resource_paths(const Variant &p_var) {
List<Variant> keys;
d.get_key_list(&keys);
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
_clear_internal_resource_paths(E->get());
_clear_internal_resource_paths(d[E->get()]);
for (Variant &E : keys) {
_clear_internal_resource_paths(E);
_clear_internal_resource_paths(d[E]);
}
} break;
default: {
@ -1531,8 +1530,8 @@ void Object::clear_internal_resource_paths() {
get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
_clear_internal_resource_paths(get(E->get().name));
for (PropertyInfo &E : pinfo) {
_clear_internal_resource_paths(get(E.name));
}
}
@ -1666,12 +1665,12 @@ void Object::get_translatable_strings(List<String> *p_strings) const {
List<PropertyInfo> plist;
get_property_list(&plist);
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
if (!(E->get().usage & PROPERTY_USAGE_INTERNATIONALIZED)) {
for (PropertyInfo &E : plist) {
if (!(E.usage & PROPERTY_USAGE_INTERNATIONALIZED)) {
continue;
}
String text = get(E->get().name);
String text = get(E.name);
if (text == "") {
continue;

View File

@ -63,8 +63,8 @@ Array Script::_get_script_property_list() {
Array ret;
List<PropertyInfo> list;
get_script_property_list(&list);
for (List<PropertyInfo>::Element *E = list.front(); E; E = E->next()) {
ret.append(E->get().operator Dictionary());
for (PropertyInfo &E : list) {
ret.append(E.operator Dictionary());
}
return ret;
}
@ -73,8 +73,8 @@ Array Script::_get_script_method_list() {
Array ret;
List<MethodInfo> list;
get_script_method_list(&list);
for (List<MethodInfo>::Element *E = list.front(); E; E = E->next()) {
ret.append(E->get().operator Dictionary());
for (MethodInfo &E : list) {
ret.append(E.operator Dictionary());
}
return ret;
}
@ -83,8 +83,8 @@ Array Script::_get_script_signal_list() {
Array ret;
List<MethodInfo> list;
get_script_signal_list(&list);
for (List<MethodInfo>::Element *E = list.front(); E; E = E->next()) {
ret.append(E->get().operator Dictionary());
for (MethodInfo &E : list) {
ret.append(E.operator Dictionary());
}
return ret;
}
@ -257,8 +257,8 @@ void ScriptServer::get_global_class_list(List<StringName> *r_global_classes) {
classes.push_back(*K);
}
classes.sort_custom<StringName::AlphCompare>();
for (List<StringName>::Element *E = classes.front(); E; E = E->next()) {
r_global_classes->push_back(E->get());
for (StringName &E : classes) {
r_global_classes->push_back(E);
}
}
@ -266,12 +266,12 @@ void ScriptServer::save_global_classes() {
List<StringName> gc;
get_global_class_list(&gc);
Array gcarr;
for (List<StringName>::Element *E = gc.front(); E; E = E->next()) {
for (StringName &E : gc) {
Dictionary d;
d["class"] = E->get();
d["language"] = global_classes[E->get()].language;
d["path"] = global_classes[E->get()].path;
d["base"] = global_classes[E->get()].base;
d["class"] = E;
d["language"] = global_classes[E].language;
d["path"] = global_classes[E].path;
d["base"] = global_classes[E].base;
gcarr.push_back(d);
}
@ -297,10 +297,10 @@ void ScriptServer::save_global_classes() {
void ScriptInstance::get_property_state(List<Pair<StringName, Variant>> &state) {
List<PropertyInfo> pinfo;
get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
if (E->get().usage & PROPERTY_USAGE_STORAGE) {
for (PropertyInfo &E : pinfo) {
if (E.usage & PROPERTY_USAGE_STORAGE) {
Pair<StringName, Variant> p;
p.first = E->get().name;
p.first = E.name;
if (get(p.first, p.second)) {
state.push_back(p);
}
@ -430,16 +430,16 @@ bool PlaceHolderScriptInstance::get(const StringName &p_name, Variant &r_ret) co
void PlaceHolderScriptInstance::get_property_list(List<PropertyInfo> *p_properties) const {
if (script->is_placeholder_fallback_enabled()) {
for (const List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
p_properties->push_back(E->get());
for (const PropertyInfo &E : properties) {
p_properties->push_back(E);
}
} else {
for (const List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
PropertyInfo pinfo = E->get();
for (const PropertyInfo &E : properties) {
PropertyInfo pinfo = E;
if (!values.has(pinfo.name)) {
pinfo.usage |= PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE;
}
p_properties->push_back(E->get());
p_properties->push_back(E);
}
}
}
@ -489,11 +489,11 @@ bool PlaceHolderScriptInstance::has_method(const StringName &p_method) const {
void PlaceHolderScriptInstance::update(const List<PropertyInfo> &p_properties, const Map<StringName, Variant> &p_values) {
Set<StringName> new_values;
for (const List<PropertyInfo>::Element *E = p_properties.front(); E; E = E->next()) {
StringName n = E->get().name;
for (const PropertyInfo &E : p_properties) {
StringName n = E.name;
new_values.insert(n);
if (!values.has(n) || values[n].get_type() != E->get().type) {
if (!values.has(n) || values[n].get_type() != E.type) {
if (p_values.has(n)) {
values[n] = p_values[n];
}
@ -511,7 +511,7 @@ void PlaceHolderScriptInstance::update(const List<PropertyInfo> &p_properties, c
Variant defval;
if (script->get_property_default_value(E->key(), defval)) {
//remove because it's the same as the default value
if (defval == E->get()) {
if (defval == E) {
to_remove.push_back(E->key());
}
}
@ -542,8 +542,8 @@ void PlaceHolderScriptInstance::property_set_fallback(const StringName &p_name,
}
bool found = false;
for (const List<PropertyInfo>::Element *F = properties.front(); F; F = F->next()) {
if (F->get().name == p_name) {
for (const PropertyInfo &F : properties) {
if (F.name == p_name) {
found = true;
break;
}

View File

@ -39,12 +39,12 @@ void UndoRedo::_discard_redo() {
}
for (int i = current_action + 1; i < actions.size(); i++) {
for (List<Operation>::Element *E = actions.write[i].do_ops.front(); E; E = E->next()) {
if (E->get().type == Operation::TYPE_REFERENCE) {
if (E->get().ref.is_valid()) {
E->get().ref.unref();
for (Operation &E : actions.write[i].do_ops) {
if (E.type == Operation::TYPE_REFERENCE) {
if (E.ref.is_valid()) {
E.ref.unref();
} else {
Object *obj = ObjectDB::get_instance(E->get().object);
Object *obj = ObjectDB::get_instance(E.object);
if (obj) {
memdelete(obj);
}
@ -244,12 +244,12 @@ void UndoRedo::_pop_history_tail() {
return;
}
for (List<Operation>::Element *E = actions.write[0].undo_ops.front(); E; E = E->next()) {
if (E->get().type == Operation::TYPE_REFERENCE) {
if (E->get().ref.is_valid()) {
E->get().ref.unref();
for (Operation &E : actions.write[0].undo_ops) {
if (E.type == Operation::TYPE_REFERENCE) {
if (E.ref.is_valid()) {
E.ref.unref();
} else {
Object *obj = ObjectDB::get_instance(E->get().object);
Object *obj = ObjectDB::get_instance(E.object);
if (obj) {
memdelete(obj);
}

View File

@ -66,9 +66,9 @@ void OptimizedTranslation::generate(const Ref<Translation> &p_from) {
int total_compression_size = 0;
int total_string_size = 0;
for (List<StringName>::Element *E = keys.front(); E; E = E->next()) {
for (StringName &E : keys) {
//hash string
CharString cs = E->get().operator String().utf8();
CharString cs = E.operator String().utf8();
uint32_t h = hash(0, cs.get_data());
Pair<int, CharString> p;
p.first = idx;
@ -76,7 +76,7 @@ void OptimizedTranslation::generate(const Ref<Translation> &p_from) {
buckets.write[h % size].push_back(p);
//compress string
CharString src_s = p_from->get_message(E->get()).operator String().utf8();
CharString src_s = p_from->get_message(E).operator String().utf8();
CompressedString ps;
ps.orig_len = src_s.size();
ps.offset = total_compression_size;

View File

@ -841,8 +841,8 @@ Vector<String> Translation::_get_message_list() const {
void Translation::_set_messages(const Dictionary &p_messages) {
List<Variant> keys;
p_messages.get_key_list(&keys);
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
translation_map[E->get()] = p_messages[E->get()];
for (Variant &E : keys) {
translation_map[E] = p_messages[E];
}
}

View File

@ -47,8 +47,7 @@ void TranslationPO::print_translation_map() {
List<StringName> context_l;
translation_map.get_key_list(&context_l);
for (List<StringName>::Element *E = context_l.front(); E; E = E->next()) {
StringName ctx = E->get();
for (StringName &ctx : context_l) {
file->store_line(" ===== Context: " + String::utf8(String(ctx).utf8()) + " ===== ");
const HashMap<StringName, Vector<StringName>> &inner_map = translation_map[ctx];
@ -74,8 +73,7 @@ Dictionary TranslationPO::_get_messages() const {
List<StringName> context_l;
translation_map.get_key_list(&context_l);
for (List<StringName>::Element *E = context_l.front(); E; E = E->next()) {
StringName ctx = E->get();
for (StringName &ctx : context_l) {
const HashMap<StringName, Vector<StringName>> &id_str_map = translation_map[ctx];
Dictionary d2;
@ -98,8 +96,7 @@ void TranslationPO::_set_messages(const Dictionary &p_messages) {
List<Variant> context_l;
p_messages.get_key_list(&context_l);
for (List<Variant>::Element *E = context_l.front(); E; E = E->next()) {
StringName ctx = E->get();
for (Variant &ctx : context_l) {
const Dictionary &id_str_map = p_messages[ctx];
HashMap<StringName, Vector<StringName>> temp_map;
@ -121,8 +118,8 @@ Vector<String> TranslationPO::_get_message_list() const {
get_message_list(&msgs);
Vector<String> v;
for (List<StringName>::Element *E = msgs.front(); E; E = E->next()) {
v.push_back(E->get());
for (StringName &E : msgs) {
v.push_back(E);
}
return v;
@ -281,13 +278,13 @@ void TranslationPO::get_message_list(List<StringName> *r_messages) const {
List<StringName> context_l;
translation_map.get_key_list(&context_l);
for (List<StringName>::Element *E = context_l.front(); E; E = E->next()) {
if (String(E->get()) != "") {
for (StringName &E : context_l) {
if (String(E) != "") {
continue;
}
List<StringName> msgid_l;
translation_map[E->get()].get_key_list(&msgid_l);
translation_map[E].get_key_list(&msgid_l);
for (List<StringName>::Element *E2 = msgid_l.front(); E2; E2 = E2->next()) {
r_messages->push_back(E2->get());
@ -300,8 +297,8 @@ int TranslationPO::get_message_count() const {
translation_map.get_key_list(&context_l);
int count = 0;
for (List<StringName>::Element *E = context_l.front(); E; E = E->next()) {
count += translation_map[E->get()].size();
for (StringName &E : context_l) {
count += translation_map[E].size();
}
return count;
}

View File

@ -3421,11 +3421,8 @@ String String::format(const Variant &values, String placeholder) const {
List<Variant> keys;
d.get_key_list(&keys);
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
String key = E->get();
String val = d[E->get()];
new_string = new_string.replace(placeholder.replace("_", key), val);
for (Variant &key : keys) {
new_string = new_string.replace(placeholder.replace("_", key), d[key]);
}
} else {
ERR_PRINT(String("Invalid type: use Array or Dictionary.").ascii().get_data());

View File

@ -407,8 +407,8 @@ Array Signal::get_connections() const {
object->get_signal_connection_list(name, &connections);
Array arr;
for (List<Object::Connection>::Element *E = connections.front(); E; E = E->next()) {
arr.push_back(E->get());
for (Object::Connection &E : connections) {
arr.push_back(E);
}
return arr;
}

View File

@ -1681,10 +1681,10 @@ String Variant::stringify(List<const void *> &stack) const {
Vector<_VariantStrPair> pairs;
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
for (Variant &E : keys) {
_VariantStrPair sp;
sp.key = E->get().stringify(stack);
sp.value = d[E->get()].stringify(stack);
sp.key = E.stringify(stack);
sp.value = d[E].stringify(stack);
pairs.push_back(sp);
}

View File

@ -1088,8 +1088,8 @@ bool Variant::has_builtin_method_return_value(Variant::Type p_type, const String
void Variant::get_builtin_method_list(Variant::Type p_type, List<StringName> *p_list) {
ERR_FAIL_INDEX(p_type, Variant::VARIANT_MAX);
for (List<StringName>::Element *E = builtin_method_names[p_type].front(); E; E = E->next()) {
p_list->push_back(E->get());
for (StringName &E : builtin_method_names[p_type]) {
p_list->push_back(E);
}
}
@ -1152,12 +1152,12 @@ void Variant::get_method_list(List<MethodInfo> *p_list) const {
obj->get_method_list(p_list);
}
} else {
for (List<StringName>::Element *E = builtin_method_names[type].front(); E; E = E->next()) {
const VariantBuiltInMethodInfo *method = builtin_method_info[type].lookup_ptr(E->get());
for (StringName &E : builtin_method_names[type]) {
const VariantBuiltInMethodInfo *method = builtin_method_info[type].lookup_ptr(E);
ERR_CONTINUE(!method);
MethodInfo mi;
mi.name = E->get();
mi.name = E;
//return type
if (method->has_return_type) {

View File

@ -1586,8 +1586,8 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
List<PropertyInfo> props;
obj->get_property_list(&props);
bool first = true;
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
if (E->get().usage & PROPERTY_USAGE_STORAGE || E->get().usage & PROPERTY_USAGE_SCRIPT_VARIABLE) {
for (PropertyInfo &E : props) {
if (E.usage & PROPERTY_USAGE_STORAGE || E.usage & PROPERTY_USAGE_SCRIPT_VARIABLE) {
//must be serialized
if (first) {
@ -1596,8 +1596,8 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
p_store_string_func(p_store_string_ud, ",");
}
p_store_string_func(p_store_string_ud, "\"" + E->get().name + "\":");
write(obj->get(E->get().name), p_store_string_func, p_store_string_ud, p_encode_res_func, p_encode_res_ud);
p_store_string_func(p_store_string_ud, "\"" + E.name + "\":");
write(obj->get(E.name), p_store_string_func, p_store_string_ud, p_encode_res_func, p_encode_res_ud);
}
}
@ -1615,7 +1615,7 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
p_store_string_func(p_store_string_ud, "{\n");
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
/*
if (!_check_type(dict[E->get()]))
if (!_check_type(dict[E]))
continue;
*/
write(E->get(), p_store_string_func, p_store_string_ud, p_encode_res_func, p_encode_res_ud);

View File

@ -1093,9 +1093,9 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
const Dictionary *dic = reinterpret_cast<const Dictionary *>(_data._mem);
List<Variant> keys;
dic->get_key_list(&keys);
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
if (E->get().get_type() == Variant::STRING) {
p_list->push_back(PropertyInfo(Variant::STRING, E->get()));
for (Variant &E : keys) {
if (E.get_type() == Variant::STRING) {
p_list->push_back(PropertyInfo(Variant::STRING, E));
}
}
} else if (type == OBJECT) {
@ -1106,10 +1106,10 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
} else {
List<StringName> members;
get_member_list(type, &members);
for (List<StringName>::Element *E = members.front(); E; E = E->next()) {
for (StringName &E : members) {
PropertyInfo pi;
pi.name = E->get();
pi.type = get_member_type(type, E->get());
pi.name = E;
pi.type = get_member_type(type, E);
p_list->push_back(pi);
}
}

View File

@ -1397,8 +1397,8 @@ uint32_t Variant::get_utility_function_hash(const StringName &p_name) {
}
void Variant::get_utility_function_list(List<StringName> *r_functions) {
for (List<StringName>::Element *E = utility_function_name_table.front(); E; E = E->next()) {
r_functions->push_back(E->get());
for (StringName &E : utility_function_name_table) {
r_functions->push_back(E);
}
}

View File

@ -269,11 +269,11 @@ _FORCE_INLINE_ Error NetSocketPosix::_change_multicast_group(IPAddress p_ip, Str
break; // IPv6 uses index.
}
for (List<IPAddress>::Element *F = c.ip_addresses.front(); F; F = F->next()) {
if (!F->get().is_ipv4()) {
for (IPAddress &F : c.ip_addresses) {
if (!F.is_ipv4()) {
continue; // Wrong IP type
}
if_ip = F->get();
if_ip = F;
break;
}
break;

View File

@ -8542,8 +8542,8 @@ void RenderingDeviceVulkan::_free_rids(T &p_owner, const char *p_type) {
} else {
WARN_PRINT(vformat("%d RIDs of type \"%s\" were leaked.", owned.size(), p_type));
}
for (List<RID>::Element *E = owned.front(); E; E = E->next()) {
free(E->get());
for (RID E : owned) {
free(E);
}
}
}
@ -8764,13 +8764,13 @@ void RenderingDeviceVulkan::finalize() {
List<RID>::Element *N = E->next();
if (texture_is_shared(E->get())) {
free(E->get());
owned.erase(E->get());
owned.erase(E);
}
E = N;
}
//free non shared second, this will avoid an error trying to free unexisting textures due to dependencies.
for (List<RID>::Element *E = owned.front(); E; E = E->next()) {
free(E->get());
for (RID E : owned) {
free(E);
}
}
}

View File

@ -898,8 +898,7 @@ void AnimationBezierTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
}
// 6-(undo) reinsert overlapped keys
for (List<AnimMoveRestore>::Element *E = to_restore.front(); E; E = E->next()) {
AnimMoveRestore &amr = E->get();
for (AnimMoveRestore &amr : to_restore) {
undo_redo->add_undo_method(animation.ptr(), "track_insert_key", amr.track, amr.time, amr.key, 1);
}
@ -1091,9 +1090,9 @@ void AnimationBezierTrackEdit::duplicate_selection() {
//reselect duplicated
selection.clear();
for (List<Pair<int, float>>::Element *E = new_selection_values.front(); E; E = E->next()) {
int track = E->get().first;
float time = E->get().second;
for (Pair<int, float> &E : new_selection_values) {
int track = E.first;
float time = E.second;
int existing_idx = animation->track_find_key(track, time, true);

View File

@ -598,12 +598,12 @@ public:
if (ap) {
List<StringName> anims;
ap->get_animation_list(&anims);
for (List<StringName>::Element *E = anims.front(); E; E = E->next()) {
for (StringName &E : anims) {
if (animations != String()) {
animations += ",";
}
animations += String(E->get());
animations += String(E);
}
}
}
@ -702,8 +702,8 @@ public:
for (Map<int, List<float>>::Element *E = key_ofs_map.front(); E; E = E->next()) {
int key = 0;
for (List<float>::Element *F = E->value().front(); F; F = F->next()) {
float key_ofs = F->get();
for (float &F : E->value()) {
float key_ofs = F;
if (from != key_ofs) {
key++;
continue;
@ -728,8 +728,8 @@ public:
bool change_notify_deserved = false;
for (Map<int, List<float>>::Element *E = key_ofs_map.front(); E; E = E->next()) {
int track = E->key();
for (List<float>::Element *F = E->value().front(); F; F = F->next()) {
float key_ofs = F->get();
for (float &F : E->value()) {
float key_ofs = F;
int key = animation->track_find_key(track, key_ofs, true);
ERR_FAIL_COND_V(key == -1, false);
@ -986,8 +986,8 @@ public:
bool _get(const StringName &p_name, Variant &r_ret) const {
for (Map<int, List<float>>::Element *E = key_ofs_map.front(); E; E = E->next()) {
int track = E->key();
for (List<float>::Element *F = E->value().front(); F; F = F->next()) {
float key_ofs = F->get();
for (float &F : E->value()) {
float key_ofs = F;
int key = animation->track_find_key(track, key_ofs, true);
ERR_CONTINUE(key == -1);
@ -1137,8 +1137,8 @@ public:
same_key_type = false;
}
for (List<float>::Element *F = E->value().front(); F; F = F->next()) {
int key = animation->track_find_key(track, F->get(), true);
for (float &F : E->value()) {
int key = animation->track_find_key(track, F, true);
ERR_FAIL_COND(key == -1);
if (first_key < 0) {
first_key = key;
@ -3356,9 +3356,9 @@ void AnimationTrackEditor::_query_insert(const InsertData &p_id) {
}
insert_frame = Engine::get_singleton()->get_frames_drawn();
for (List<InsertData>::Element *E = insert_data.front(); E; E = E->next()) {
for (InsertData &E : insert_data) {
//prevent insertion of multiple tracks
if (E->get().path == p_id.path) {
if (E.path == p_id.path) {
return; //already inserted a track for this on this frame
}
}
@ -3843,9 +3843,9 @@ PropertyInfo AnimationTrackEditor::_find_hint_for_track(int p_idx, NodePath &r_b
List<PropertyInfo> pinfo;
property_info_base.get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
if (E->get().name == leftover_path[leftover_path.size() - 1]) {
return E->get();
for (PropertyInfo &E : pinfo) {
if (E.name == leftover_path[leftover_path.size() - 1]) {
return E;
}
}
@ -4675,21 +4675,21 @@ void AnimationTrackEditor::_add_method_key(const String &p_method) {
List<MethodInfo> minfo;
base->get_method_list(&minfo);
for (List<MethodInfo>::Element *E = minfo.front(); E; E = E->next()) {
if (E->get().name == p_method) {
for (MethodInfo &E : minfo) {
if (E.name == p_method) {
Dictionary d;
d["method"] = p_method;
Array params;
int first_defarg = E->get().arguments.size() - E->get().default_arguments.size();
int first_defarg = E.arguments.size() - E.default_arguments.size();
for (int i = 0; i < E->get().arguments.size(); i++) {
for (int i = 0; i < E.arguments.size(); i++) {
if (i >= first_defarg) {
Variant arg = E->get().default_arguments[i - first_defarg];
Variant arg = E.default_arguments[i - first_defarg];
params.push_back(arg);
} else {
Callable::CallError ce;
Variant arg;
Variant::construct(E->get().arguments[i].type, arg, nullptr, 0, ce);
Variant::construct(E.arguments[i].type, arg, nullptr, 0, ce);
params.push_back(arg);
}
}
@ -4936,8 +4936,7 @@ void AnimationTrackEditor::_move_selection_commit() {
}
// 6 - (undo) reinsert overlapped keys
for (List<_AnimMoveRestore>::Element *E = to_restore.front(); E; E = E->next()) {
_AnimMoveRestore &amr = E->get();
for (_AnimMoveRestore &amr : to_restore) {
undo_redo->add_undo_method(animation.ptr(), "track_insert_key", amr.track, amr.time, amr.key, amr.transition);
}
@ -5151,9 +5150,9 @@ void AnimationTrackEditor::_anim_duplicate_keys(bool transpose) {
//reselect duplicated
Map<SelectedKey, KeyInfo> new_selection;
for (List<Pair<int, float>>::Element *E = new_selection_values.front(); E; E = E->next()) {
int track = E->get().first;
float time = E->get().second;
for (Pair<int, float> &E : new_selection_values) {
int track = E.first;
float time = E.second;
int existing_idx = animation->track_find_key(track, time, true);
@ -5462,8 +5461,7 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
}
// 6-(undo) reinsert overlapped keys
for (List<_AnimMoveRestore>::Element *E = to_restore.front(); E; E = E->next()) {
_AnimMoveRestore &amr = E->get();
for (_AnimMoveRestore &amr : to_restore) {
undo_redo->add_undo_method(animation.ptr(), "track_insert_key", amr.track, amr.time, amr.key, amr.transition);
}
@ -5543,8 +5541,8 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
if (cleanup_all->is_pressed()) {
List<StringName> names;
AnimationPlayerEditor::singleton->get_player()->get_animation_list(&names);
for (List<StringName>::Element *E = names.front(); E; E = E->next()) {
_cleanup_animation(AnimationPlayerEditor::singleton->get_player()->get_animation(E->get()));
for (StringName &E : names) {
_cleanup_animation(AnimationPlayerEditor::singleton->get_player()->get_animation(E));
}
} else {
_cleanup_animation(animation);

View File

@ -854,9 +854,7 @@ void CodeTextEditor::_complete_request() {
return;
}
for (List<ScriptCodeCompletionOption>::Element *E = entries.front(); E; E = E->next()) {
ScriptCodeCompletionOption &e = E->get();
for (ScriptCodeCompletionOption &e : entries) {
Color font_color = completion_font_color;
if (e.insert_text.begins_with("\"") || e.insert_text.begins_with("\'")) {
font_color = completion_string_color;

View File

@ -944,9 +944,7 @@ void ConnectionsDock::update_tree() {
node_signals2.sort();
}
for (List<MethodInfo>::Element *E = node_signals2.front(); E; E = E->next()) {
MethodInfo &mi = E->get();
for (MethodInfo &mi : node_signals2) {
StringName signal_name = mi.name;
String signaldesc = "(";
PackedStringArray argnames;
@ -1025,8 +1023,8 @@ void ConnectionsDock::update_tree() {
List<Object::Connection> connections;
selectedNode->get_signal_connection_list(signal_name, &connections);
for (List<Object::Connection>::Element *F = connections.front(); F; F = F->next()) {
Connection cn = F->get();
for (Object::Connection &F : connections) {
Connection cn = F;
if (!(cn.flags & CONNECT_PERSIST)) {
continue;
}

View File

@ -447,8 +447,7 @@ Variant CreateDialog::instance_selected() {
List<PropertyInfo> pinfo;
((Object *)obj)->get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
PropertyInfo pi = E->get();
for (PropertyInfo &pi : pinfo) {
if (pi.type == Variant::OBJECT && pi.usage & PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT) {
Object *prop = ClassDB::instantiate(pi.class_name);
((Object *)obj)->set(pi.name, prop);

View File

@ -56,8 +56,8 @@ bool EditorDebuggerRemoteObject::_get(const StringName &p_name, Variant &r_ret)
void EditorDebuggerRemoteObject::_get_property_list(List<PropertyInfo> *p_list) const {
p_list->clear(); //sorry, no want category
for (const List<PropertyInfo>::Element *E = prop_list.front(); E; E = E->next()) {
p_list->push_back(E->get());
for (const PropertyInfo &E : prop_list) {
p_list->push_back(E);
}
}

View File

@ -365,13 +365,13 @@ void EditorVisualProfiler::_update_frame(bool p_focus_selected) {
}
TreeItem *category = variables->create_item(parent);
for (List<TreeItem *>::Element *E = stack.front(); E; E = E->next()) {
float total_cpu = E->get()->get_metadata(1);
float total_gpu = E->get()->get_metadata(2);
for (TreeItem *E : stack) {
float total_cpu = E->get_metadata(1);
float total_gpu = E->get_metadata(2);
total_cpu += cpu_time;
total_gpu += gpu_time;
E->get()->set_metadata(1, cpu_time);
E->get()->set_metadata(2, gpu_time);
E->set_metadata(1, cpu_time);
E->set_metadata(2, gpu_time);
}
category->set_icon(0, track_icon);
@ -392,11 +392,11 @@ void EditorVisualProfiler::_update_frame(bool p_focus_selected) {
}
}
for (List<TreeItem *>::Element *E = categories.front(); E; E = E->next()) {
float total_cpu = E->get()->get_metadata(1);
float total_gpu = E->get()->get_metadata(2);
E->get()->set_text(1, _get_time_as_text(total_cpu));
E->get()->set_text(2, _get_time_as_text(total_gpu));
for (TreeItem *E : categories) {
float total_cpu = E->get_metadata(1);
float total_gpu = E->get_metadata(2);
E->set_text(1, _get_time_as_text(total_cpu));
E->set_text(2, _get_time_as_text(total_gpu));
}
if (ensure_selected) {

View File

@ -347,13 +347,13 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
uint64_t total = 0;
for (List<DebuggerMarshalls::ResourceInfo>::Element *E = usage.infos.front(); E; E = E->next()) {
for (DebuggerMarshalls::ResourceInfo &E : usage.infos) {
TreeItem *it = vmem_tree->create_item(root);
String type = E->get().type;
int bytes = E->get().vram;
it->set_text(0, E->get().path);
String type = E.type;
int bytes = E.vram;
it->set_text(0, E.path);
it->set_text(1, type);
it->set_text(2, E->get().format);
it->set_text(2, E.format);
it->set_text(3, String::humanize_size(bytes));
total += bytes;

View File

@ -55,8 +55,8 @@ void DependencyEditor::_load_pressed(Object *p_item, int p_cell, int p_button) {
search->clear_filters();
List<String> ext;
ResourceLoader::get_recognized_extensions_for_type(ti->get_metadata(0), &ext);
for (List<String>::Element *E = ext.front(); E; E = E->next()) {
search->add_filter("*" + E->get());
for (String &E : ext) {
search->add_filter("*" + E);
}
search->popup_file_dialog();
}
@ -120,13 +120,13 @@ void DependencyEditor::_fix_all() {
Map<String, Map<String, String>> candidates;
for (List<String>::Element *E = missing.front(); E; E = E->next()) {
String base = E->get().get_file();
for (String &E : missing) {
String base = E.get_file();
if (!candidates.has(base)) {
candidates[base] = Map<String, String>();
}
candidates[base][E->get()] = "";
candidates[base][E] = "";
}
_fix_and_find(EditorFileSystem::get_singleton()->get_filesystem(), candidates);
@ -166,10 +166,8 @@ void DependencyEditor::_update_list() {
bool broken = false;
for (List<String>::Element *E = deps.front(); E; E = E->next()) {
for (String &n : deps) {
TreeItem *item = tree->create_item(root);
String n = E->get();
String path;
String type;
@ -741,9 +739,9 @@ void OrphanResourcesDialog::_find_to_delete(TreeItem *p_item, List<String> &path
void OrphanResourcesDialog::_delete_confirm() {
DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
for (List<String>::Element *E = paths.front(); E; E = E->next()) {
da->remove(E->get());
EditorFileSystem::get_singleton()->update_file(E->get());
for (String &E : paths) {
da->remove(E);
EditorFileSystem::get_singleton()->update_file(E);
}
memdelete(da);
refresh();

View File

@ -266,20 +266,20 @@ void DocTools::generate(bool p_basic_types) {
}
List<PropertyInfo>::Element *EO = own_properties.front();
for (List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
for (PropertyInfo &E : properties) {
bool inherited = EO == nullptr;
if (EO && EO->get() == E->get()) {
if (EO && EO->get() == E) {
inherited = false;
EO = EO->next();
}
if (E->get().usage & PROPERTY_USAGE_GROUP || E->get().usage & PROPERTY_USAGE_SUBGROUP || E->get().usage & PROPERTY_USAGE_CATEGORY || E->get().usage & PROPERTY_USAGE_INTERNAL) {
if (E.usage & PROPERTY_USAGE_GROUP || E.usage & PROPERTY_USAGE_SUBGROUP || E.usage & PROPERTY_USAGE_CATEGORY || E.usage & PROPERTY_USAGE_INTERNAL) {
continue;
}
DocData::PropertyDoc prop;
prop.name = E->get().name;
prop.name = E.name;
prop.overridden = inherited;
@ -288,20 +288,20 @@ void DocTools::generate(bool p_basic_types) {
if (name == "ProjectSettings") {
// Special case for project settings, so that settings are not taken from the current project's settings
if (E->get().name == "script" || !ProjectSettings::get_singleton()->is_builtin_setting(E->get().name)) {
if (E.name == "script" || !ProjectSettings::get_singleton()->is_builtin_setting(E.name)) {
continue;
}
if (E->get().usage & PROPERTY_USAGE_EDITOR) {
if (!ProjectSettings::get_singleton()->get_ignore_value_in_docs(E->get().name)) {
default_value = ProjectSettings::get_singleton()->property_get_revert(E->get().name);
if (E.usage & PROPERTY_USAGE_EDITOR) {
if (!ProjectSettings::get_singleton()->get_ignore_value_in_docs(E.name)) {
default_value = ProjectSettings::get_singleton()->property_get_revert(E.name);
default_value_valid = true;
}
}
} else {
default_value = get_documentation_default_value(name, E->get().name, default_value_valid);
default_value = get_documentation_default_value(name, E.name, default_value_valid);
if (inherited) {
bool base_default_value_valid = false;
Variant base_default_value = get_documentation_default_value(ClassDB::get_parent_class(name), E->get().name, base_default_value_valid);
Variant base_default_value = get_documentation_default_value(ClassDB::get_parent_class(name), E.name, base_default_value_valid);
if (!default_value_valid || !base_default_value_valid || default_value == base_default_value) {
continue;
}
@ -309,13 +309,13 @@ void DocTools::generate(bool p_basic_types) {
}
//used to track uninitialized values using valgrind
//print_line("getting default value for " + String(name) + "." + String(E->get().name));
//print_line("getting default value for " + String(name) + "." + String(E.name));
if (default_value_valid && default_value.get_type() != Variant::OBJECT) {
prop.default_value = default_value.get_construct_string().replace("\n", "");
}
StringName setter = ClassDB::get_property_setter(name, E->get().name);
StringName getter = ClassDB::get_property_getter(name, E->get().name);
StringName setter = ClassDB::get_property_setter(name, E.name);
StringName getter = ClassDB::get_property_getter(name, E.name);
prop.setter = setter;
prop.getter = getter;
@ -353,10 +353,10 @@ void DocTools::generate(bool p_basic_types) {
}
if (!found_type) {
if (E->get().type == Variant::OBJECT && E->get().hint == PROPERTY_HINT_RESOURCE_TYPE) {
prop.type = E->get().hint_string;
if (E.type == Variant::OBJECT && E.hint == PROPERTY_HINT_RESOURCE_TYPE) {
prop.type = E.hint_string;
} else {
prop.type = Variant::get_type_name(E->get().type);
prop.type = Variant::get_type_name(E.type);
}
}
@ -367,62 +367,62 @@ void DocTools::generate(bool p_basic_types) {
ClassDB::get_method_list(name, &method_list, true);
method_list.sort();
for (List<MethodInfo>::Element *E = method_list.front(); E; E = E->next()) {
if (E->get().name == "" || (E->get().name[0] == '_' && !(E->get().flags & METHOD_FLAG_VIRTUAL))) {
for (MethodInfo &E : method_list) {
if (E.name == "" || (E.name[0] == '_' && !(E.flags & METHOD_FLAG_VIRTUAL))) {
continue; //hidden, don't count
}
if (skip_setter_getter_methods && setters_getters.has(E->get().name)) {
if (skip_setter_getter_methods && setters_getters.has(E.name)) {
// Don't skip parametric setters and getters, i.e. method which require
// one or more parameters to define what property should be set or retrieved.
// E.g. CPUParticles3D::set_param(Parameter param, float value).
if (E->get().arguments.size() == 0 /* getter */ || (E->get().arguments.size() == 1 && E->get().return_val.type == Variant::NIL /* setter */)) {
if (E.arguments.size() == 0 /* getter */ || (E.arguments.size() == 1 && E.return_val.type == Variant::NIL /* setter */)) {
continue;
}
}
DocData::MethodDoc method;
method.name = E->get().name;
method.name = E.name;
if (E->get().flags & METHOD_FLAG_VIRTUAL) {
if (E.flags & METHOD_FLAG_VIRTUAL) {
method.qualifiers = "virtual";
}
if (E->get().flags & METHOD_FLAG_CONST) {
if (E.flags & METHOD_FLAG_CONST) {
if (method.qualifiers != "") {
method.qualifiers += " ";
}
method.qualifiers += "const";
}
if (E->get().flags & METHOD_FLAG_VARARG) {
if (E.flags & METHOD_FLAG_VARARG) {
if (method.qualifiers != "") {
method.qualifiers += " ";
}
method.qualifiers += "vararg";
}
if (E->get().flags & METHOD_FLAG_STATIC) {
if (E.flags & METHOD_FLAG_STATIC) {
if (method.qualifiers != "") {
method.qualifiers += " ";
}
method.qualifiers += "static";
}
for (int i = -1; i < E->get().arguments.size(); i++) {
for (int i = -1; i < E.arguments.size(); i++) {
if (i == -1) {
#ifdef DEBUG_METHODS_ENABLED
DocData::return_doc_from_retinfo(method, E->get().return_val);
DocData::return_doc_from_retinfo(method, E.return_val);
#endif
} else {
const PropertyInfo &arginfo = E->get().arguments[i];
const PropertyInfo &arginfo = E.arguments[i];
DocData::ArgumentDoc argument;
DocData::argument_doc_from_arginfo(argument, arginfo);
int darg_idx = i - (E->get().arguments.size() - E->get().default_arguments.size());
int darg_idx = i - (E.arguments.size() - E.default_arguments.size());
if (darg_idx >= 0) {
Variant default_arg = E->get().default_arguments[darg_idx];
Variant default_arg = E.default_arguments[darg_idx];
argument.default_value = default_arg.get_construct_string();
}
@ -455,12 +455,12 @@ void DocTools::generate(bool p_basic_types) {
List<String> constant_list;
ClassDB::get_integer_constant_list(name, &constant_list, true);
for (List<String>::Element *E = constant_list.front(); E; E = E->next()) {
for (String &E : constant_list) {
DocData::ConstantDoc constant;
constant.name = E->get();
constant.value = itos(ClassDB::get_integer_constant(name, E->get()));
constant.name = E;
constant.value = itos(ClassDB::get_integer_constant(name, E));
constant.is_value_valid = true;
constant.enumeration = ClassDB::get_integer_constant_enum(name, E->get());
constant.enumeration = ClassDB::get_integer_constant_enum(name, E);
c.constants.push_back(constant);
}
@ -469,53 +469,53 @@ void DocTools::generate(bool p_basic_types) {
{
List<StringName> l;
Theme::get_default()->get_constant_list(cname, &l);
for (List<StringName>::Element *E = l.front(); E; E = E->next()) {
for (StringName &E : l) {
DocData::PropertyDoc pd;
pd.name = E->get();
pd.name = E;
pd.type = "int";
pd.default_value = itos(Theme::get_default()->get_constant(E->get(), cname));
pd.default_value = itos(Theme::get_default()->get_constant(E, cname));
c.theme_properties.push_back(pd);
}
l.clear();
Theme::get_default()->get_color_list(cname, &l);
for (List<StringName>::Element *E = l.front(); E; E = E->next()) {
for (StringName &E : l) {
DocData::PropertyDoc pd;
pd.name = E->get();
pd.name = E;
pd.type = "Color";
pd.default_value = Variant(Theme::get_default()->get_color(E->get(), cname)).get_construct_string();
pd.default_value = Variant(Theme::get_default()->get_color(E, cname)).get_construct_string();
c.theme_properties.push_back(pd);
}
l.clear();
Theme::get_default()->get_icon_list(cname, &l);
for (List<StringName>::Element *E = l.front(); E; E = E->next()) {
for (StringName &E : l) {
DocData::PropertyDoc pd;
pd.name = E->get();
pd.name = E;
pd.type = "Texture2D";
c.theme_properties.push_back(pd);
}
l.clear();
Theme::get_default()->get_font_list(cname, &l);
for (List<StringName>::Element *E = l.front(); E; E = E->next()) {
for (StringName &E : l) {
DocData::PropertyDoc pd;
pd.name = E->get();
pd.name = E;
pd.type = "Font";
c.theme_properties.push_back(pd);
}
l.clear();
Theme::get_default()->get_font_size_list(cname, &l);
for (List<StringName>::Element *E = l.front(); E; E = E->next()) {
for (StringName &E : l) {
DocData::PropertyDoc pd;
pd.name = E->get();
pd.name = E;
pd.type = "int";
c.theme_properties.push_back(pd);
}
l.clear();
Theme::get_default()->get_stylebox_list(cname, &l);
for (List<StringName>::Element *E = l.front(); E; E = E->next()) {
for (StringName &E : l) {
DocData::PropertyDoc pd;
pd.name = E->get();
pd.name = E;
pd.type = "StyleBox";
c.theme_properties.push_back(pd);
}
@ -621,8 +621,7 @@ void DocTools::generate(bool p_basic_types) {
method_list.push_back(mi);
}
for (List<MethodInfo>::Element *E = method_list.front(); E; E = E->next()) {
MethodInfo &mi = E->get();
for (MethodInfo &mi : method_list) {
DocData::MethodDoc method;
method.name = mi.name;
@ -675,8 +674,7 @@ void DocTools::generate(bool p_basic_types) {
List<PropertyInfo> properties;
v.get_property_list(&properties);
for (List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
PropertyInfo pi = E->get();
for (PropertyInfo &pi : properties) {
DocData::PropertyDoc property;
property.name = pi.name;
property.type = Variant::get_type_name(pi.type);
@ -688,10 +686,10 @@ void DocTools::generate(bool p_basic_types) {
List<StringName> constants;
Variant::get_constants_for_type(Variant::Type(i), &constants);
for (List<StringName>::Element *E = constants.front(); E; E = E->next()) {
for (StringName &E : constants) {
DocData::ConstantDoc constant;
constant.name = E->get();
Variant value = Variant::get_constant_value(Variant::Type(i), E->get());
constant.name = E;
Variant value = Variant::get_constant_value(Variant::Type(i), E);
constant.value = value.get_type() == Variant::INT ? itos(value) : value.get_construct_string();
constant.is_value_valid = true;
c.constants.push_back(constant);
@ -723,9 +721,8 @@ void DocTools::generate(bool p_basic_types) {
Engine::get_singleton()->get_singletons(&singletons);
//servers (this is kind of hackish)
for (List<Engine::Singleton>::Element *E = singletons.front(); E; E = E->next()) {
for (Engine::Singleton &s : singletons) {
DocData::PropertyDoc pd;
Engine::Singleton &s = E->get();
if (!s.ptr) {
continue;
}
@ -743,13 +740,13 @@ void DocTools::generate(bool p_basic_types) {
List<StringName> utility_functions;
Variant::get_utility_function_list(&utility_functions);
utility_functions.sort_custom<StringName::AlphCompare>();
for (List<StringName>::Element *E = utility_functions.front(); E; E = E->next()) {
for (StringName &E : utility_functions) {
DocData::MethodDoc md;
md.name = E->get();
md.name = E;
//return
if (Variant::has_utility_function_return_value(E->get())) {
if (Variant::has_utility_function_return_value(E)) {
PropertyInfo pi;
pi.type = Variant::get_utility_function_return_type(E->get());
pi.type = Variant::get_utility_function_return_type(E);
if (pi.type == Variant::NIL) {
pi.usage = PROPERTY_USAGE_NIL_IS_VARIANT;
}
@ -758,13 +755,13 @@ void DocTools::generate(bool p_basic_types) {
md.return_type = ad.type;
}
if (Variant::is_utility_function_vararg(E->get())) {
if (Variant::is_utility_function_vararg(E)) {
md.qualifiers = "vararg";
} else {
for (int i = 0; i < Variant::get_utility_function_argument_count(E->get()); i++) {
for (int i = 0; i < Variant::get_utility_function_argument_count(E); i++) {
PropertyInfo pi;
pi.type = Variant::get_utility_function_argument_type(E->get(), i);
pi.name = Variant::get_utility_function_argument_name(E->get(), i);
pi.type = Variant::get_utility_function_argument_type(E, i);
pi.name = Variant::get_utility_function_argument_name(E, i);
if (pi.type == Variant::NIL) {
pi.usage = PROPERTY_USAGE_NIL_IS_VARIANT;
}
@ -793,8 +790,7 @@ void DocTools::generate(bool p_basic_types) {
List<MethodInfo> minfo;
lang->get_public_functions(&minfo);
for (List<MethodInfo>::Element *E = minfo.front(); E; E = E->next()) {
MethodInfo &mi = E->get();
for (MethodInfo &mi : minfo) {
DocData::MethodDoc md;
md.name = mi.name;
@ -813,7 +809,7 @@ void DocTools::generate(bool p_basic_types) {
int darg_idx = j - (mi.arguments.size() - mi.default_arguments.size());
if (darg_idx >= 0) {
Variant default_arg = E->get().default_arguments[darg_idx];
Variant default_arg = mi.default_arguments[darg_idx];
ad.default_value = default_arg.get_construct_string();
}
@ -827,10 +823,10 @@ void DocTools::generate(bool p_basic_types) {
List<Pair<String, Variant>> cinfo;
lang->get_public_constants(&cinfo);
for (List<Pair<String, Variant>>::Element *E = cinfo.front(); E; E = E->next()) {
for (Pair<String, Variant> &E : cinfo) {
DocData::ConstantDoc cd;
cd.name = E->get().first;
cd.value = E->get().second;
cd.name = E.first;
cd.value = E.second;
cd.is_value_valid = true;
c.constants.push_back(cd);
}

View File

@ -920,15 +920,15 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
List<StringName> effects;
ClassDB::get_inheriters_from_class("AudioEffect", &effects);
effects.sort_custom<StringName::AlphCompare>();
for (List<StringName>::Element *E = effects.front(); E; E = E->next()) {
if (!ClassDB::can_instantiate(E->get())) {
for (StringName &E : effects) {
if (!ClassDB::can_instantiate(E)) {
continue;
}
Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(E->get());
String name = E->get().operator String().replace("AudioEffect", "");
Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(E);
String name = E.operator String().replace("AudioEffect", "");
effect_options->add_item(name);
effect_options->set_item_metadata(effect_options->get_item_count() - 1, E->get());
effect_options->set_item_metadata(effect_options->get_item_count() - 1, E);
effect_options->set_item_icon(effect_options->get_item_count() - 1, icon);
}
@ -1331,8 +1331,8 @@ EditorAudioBuses::EditorAudioBuses() {
file_dialog = memnew(EditorFileDialog);
List<String> ext;
ResourceLoader::get_recognized_extensions_for_type("AudioBusLayout", &ext);
for (List<String>::Element *E = ext.front(); E; E = E->next()) {
file_dialog->add_filter("*." + E->get() + "; Audio Bus Layout");
for (String &E : ext) {
file_dialog->add_filter("*." + E + "; Audio Bus Layout");
}
add_child(file_dialog);
file_dialog->connect("file_selected", callable_mp(this, &EditorAudioBuses::_file_dialog_callback));

View File

@ -46,12 +46,11 @@ void EditorAutoloadSettings::_notification(int p_what) {
ResourceLoader::get_recognized_extensions_for_type("Script", &afn);
ResourceLoader::get_recognized_extensions_for_type("PackedScene", &afn);
for (List<String>::Element *E = afn.front(); E; E = E->next()) {
file_dialog->add_filter("*." + E->get());
for (String &E : afn) {
file_dialog->add_filter("*." + E);
}
for (List<AutoLoadInfo>::Element *E = autoload_cache.front(); E; E = E->next()) {
AutoLoadInfo &info = E->get();
for (AutoLoadInfo &info : autoload_cache) {
if (info.node && info.in_editor) {
get_tree()->get_root()->call_deferred(SNAME("add_child"), info.node);
}
@ -102,8 +101,8 @@ bool EditorAutoloadSettings::_autoload_name_is_valid(const String &p_name, Strin
for (int i = 0; i < ScriptServer::get_language_count(); i++) {
List<String> keywords;
ScriptServer::get_language(i)->get_reserved_words(&keywords);
for (List<String>::Element *E = keywords.front(); E; E = E->next()) {
if (E->get() == p_name) {
for (String &E : keywords) {
if (E == p_name) {
if (r_error) {
*r_error = TTR("Invalid name.") + "\n" + TTR("Keyword cannot be used as an autoload name.");
}
@ -379,8 +378,7 @@ void EditorAutoloadSettings::update_autoload() {
Map<String, AutoLoadInfo> to_remove;
List<AutoLoadInfo *> to_add;
for (List<AutoLoadInfo>::Element *E = autoload_cache.front(); E; E = E->next()) {
AutoLoadInfo &info = E->get();
for (AutoLoadInfo &info : autoload_cache) {
to_remove.insert(info.name, info);
}
@ -392,9 +390,7 @@ void EditorAutoloadSettings::update_autoload() {
List<PropertyInfo> props;
ProjectSettings::get_singleton()->get_property_list(&props);
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
const PropertyInfo &pi = E->get();
for (PropertyInfo &pi : props) {
if (!pi.name.begins_with("autoload/")) {
continue;
}
@ -483,9 +479,7 @@ void EditorAutoloadSettings::update_autoload() {
// Load new/changed autoloads
List<Node *> nodes_to_add;
for (List<AutoLoadInfo *>::Element *E = to_add.front(); E; E = E->next()) {
AutoLoadInfo *info = E->get();
for (AutoLoadInfo *info : to_add) {
info->node = _create_autoload(info->path);
ERR_CONTINUE(!info->node);
@ -518,8 +512,8 @@ void EditorAutoloadSettings::update_autoload() {
}
}
for (List<Node *>::Element *E = nodes_to_add.front(); E; E = E->next()) {
get_tree()->get_root()->add_child(E->get());
for (Node *E : nodes_to_add) {
get_tree()->get_root()->add_child(E);
}
updating_autoload = false;
@ -649,8 +643,8 @@ void EditorAutoloadSettings::drop_data_fw(const Point2 &p_point, const Variant &
int i = 0;
for (List<AutoLoadInfo>::Element *F = autoload_cache.front(); F; F = F->next()) {
orders.write[i++] = F->get().order;
for (AutoLoadInfo &F : autoload_cache) {
orders.write[i++] = F.order;
}
orders.sort();
@ -661,9 +655,9 @@ void EditorAutoloadSettings::drop_data_fw(const Point2 &p_point, const Variant &
i = 0;
for (List<AutoLoadInfo>::Element *F = autoload_cache.front(); F; F = F->next()) {
undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", "autoload/" + F->get().name, orders[i++]);
undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", "autoload/" + F->get().name, F->get().order);
for (AutoLoadInfo &F : autoload_cache) {
undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", "autoload/" + F.name, orders[i++]);
undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", "autoload/" + F.name, F.order);
}
orders.clear();
@ -764,9 +758,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
// Make first cache
List<PropertyInfo> props;
ProjectSettings::get_singleton()->get_property_list(&props);
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
const PropertyInfo &pi = E->get();
for (PropertyInfo &pi : props) {
if (!pi.name.begins_with("autoload/")) {
continue;
}
@ -799,9 +791,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
autoload_cache.push_back(info);
}
for (List<AutoLoadInfo>::Element *E = autoload_cache.front(); E; E = E->next()) {
AutoLoadInfo &info = E->get();
for (AutoLoadInfo &info : autoload_cache) {
info.node = _create_autoload(info.path);
if (info.node) {
@ -904,8 +894,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
}
EditorAutoloadSettings::~EditorAutoloadSettings() {
for (List<AutoLoadInfo>::Element *E = autoload_cache.front(); E; E = E->next()) {
AutoLoadInfo &info = E->get();
for (AutoLoadInfo &info : autoload_cache) {
if (info.node && !info.in_editor) {
memdelete(info.node);
}

View File

@ -299,13 +299,13 @@ void EditorData::copy_object_params(Object *p_object) {
List<PropertyInfo> pinfo;
p_object->get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
if (!(E->get().usage & PROPERTY_USAGE_EDITOR) || E->get().name == "script" || E->get().name == "scripts") {
for (PropertyInfo &E : pinfo) {
if (!(E.usage & PROPERTY_USAGE_EDITOR) || E.name == "script" || E.name == "scripts") {
continue;
}
PropertyData pd;
pd.name = E->get().name;
pd.name = E.name;
pd.value = p_object->get(pd.name);
clipboard.push_back(pd);
}
@ -404,9 +404,9 @@ void EditorData::restore_editor_global_states() {
void EditorData::paste_object_params(Object *p_object) {
ERR_FAIL_NULL(p_object);
undo_redo.create_action(TTR("Paste Params"));
for (List<PropertyData>::Element *E = clipboard.front(); E; E = E->next()) {
String name = E->get().name;
undo_redo.add_do_property(p_object, name, E->get().value);
for (PropertyData &E : clipboard) {
String name = E.name;
undo_redo.add_do_property(p_object, name, E.value);
undo_redo.add_undo_property(p_object, name, p_object->get(name));
}
undo_redo.commit_action();
@ -616,8 +616,8 @@ bool EditorData::check_and_update_scene(int p_idx) {
//transfer selection
List<Node *> new_selection;
for (List<Node *>::Element *E = edited_scene.write[p_idx].selection.front(); E; E = E->next()) {
NodePath p = edited_scene[p_idx].root->get_path_to(E->get());
for (Node *E : edited_scene.write[p_idx].selection) {
NodePath p = edited_scene[p_idx].root->get_path_to(E);
Node *new_node = new_scene->get_node(p);
if (new_node) {
new_selection.push_back(new_node);
@ -841,8 +841,8 @@ Dictionary EditorData::restore_edited_scene_state(EditorSelection *p_selection,
p_history->history = es.history_stored;
p_selection->clear();
for (List<Node *>::Element *E = es.selection.front(); E; E = E->next()) {
p_selection->add_node(E->get());
for (Node *E : es.selection) {
p_selection->add_node(E);
}
set_editor_states(es.editor_states);
@ -964,9 +964,9 @@ void EditorData::script_class_save_icon_paths() {
_script_class_icon_paths.get_key_list(&keys);
Dictionary d;
for (List<StringName>::Element *E = keys.front(); E; E = E->next()) {
if (ScriptServer::is_global_class(E->get())) {
d[E->get()] = _script_class_icon_paths[E->get()];
for (StringName &E : keys) {
if (ScriptServer::is_global_class(E)) {
d[E] = _script_class_icon_paths[E];
}
}
@ -996,8 +996,8 @@ void EditorData::script_class_load_icon_paths() {
List<Variant> keys;
d.get_key_list(&keys);
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
String name = E->get().operator String();
for (Variant &E : keys) {
String name = E.operator String();
_script_class_icon_paths[name] = d[name];
String path = ScriptServer::get_global_class_path(name);
@ -1038,8 +1038,8 @@ void EditorSelection::add_node(Node *p_node) {
changed = true;
nl_changed = true;
Object *meta = nullptr;
for (List<Object *>::Element *E = editor_plugins.front(); E; E = E->next()) {
meta = E->get()->call("_get_editor_data", p_node);
for (Object *E : editor_plugins) {
meta = E->call("_get_editor_data", p_node);
if (meta) {
break;
}
@ -1076,8 +1076,8 @@ bool EditorSelection::is_selected(Node *p_node) const {
Array EditorSelection::_get_transformable_selected_nodes() {
Array ret;
for (List<Node *>::Element *E = selected_node_list.front(); E; E = E->next()) {
ret.push_back(E->get());
for (Node *E : selected_node_list) {
ret.push_back(E);
}
return ret;

View File

@ -80,9 +80,9 @@ bool EditorExportPreset::_get(const StringName &p_name, Variant &r_ret) const {
}
void EditorExportPreset::_get_property_list(List<PropertyInfo> *p_list) const {
for (const List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
if (platform->get_option_visibility(E->get().name, values)) {
p_list->push_back(E->get());
for (const PropertyInfo &E : properties) {
if (platform->get_option_visibility(E.name, values)) {
p_list->push_back(E);
}
}
}
@ -436,9 +436,9 @@ Ref<EditorExportPreset> EditorExportPlatform::create_preset() {
List<ExportOption> options;
get_export_options(&options);
for (List<ExportOption>::Element *E = options.front(); E; E = E->next()) {
preset->properties.push_back(E->get().option);
preset->values[E->get().option.name] = E->get().default_value;
for (ExportOption &E : options) {
preset->properties.push_back(E.option);
preset->values[E.option.name] = E.default_value;
}
return preset;
@ -679,9 +679,9 @@ EditorExportPlatform::FeatureContainers EditorExportPlatform::get_feature_contai
platform->get_preset_features(p_preset, &feature_list);
FeatureContainers result;
for (List<String>::Element *E = feature_list.front(); E; E = E->next()) {
result.features.insert(E->get());
result.features_pv.push_back(E->get());
for (String &E : feature_list) {
result.features.insert(E);
result.features_pv.push_back(E);
}
if (p_preset->get_custom_features() != String()) {
@ -752,9 +752,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
List<PropertyInfo> props;
ProjectSettings::get_singleton()->get_property_list(&props);
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
const PropertyInfo &pi = E->get();
for (PropertyInfo &pi : props) {
if (!pi.name.begins_with("autoload/")) {
continue;
}
@ -899,8 +897,8 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
Set<String> remap_features;
for (List<String>::Element *F = remaps.front(); F; F = F->next()) {
String remap = F->get();
for (String &F : remaps) {
String remap = F;
String feature = remap.get_slice(".", 1);
if (features.has(feature)) {
remap_features.insert(feature);
@ -913,8 +911,8 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
err = OK;
for (List<String>::Element *F = remaps.front(); F; F = F->next()) {
String remap = F->get();
for (String &F : remaps) {
String remap = F;
if (remap == "path") {
String remapped_path = config->get_value("remap", remap);
Vector<uint8_t> array = FileAccess::get_file_as_array(remapped_path);
@ -1362,7 +1360,7 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags
if (breakpoints.size()) {
r_flags.push_back("--breakpoints");
String bpoints;
for (const List<String>::Element *E = breakpoints.front(); E; E = E->next()) {
for (List<String>::Element *E = breakpoints.front(); E; E = E->next()) {
bpoints += E->get().replace(" ", "%20");
if (E->next()) {
bpoints += ",";
@ -1436,8 +1434,8 @@ void EditorExport::_save() {
String option_section = "preset." + itos(i) + ".options";
for (const List<PropertyInfo>::Element *E = preset->get_properties().front(); E; E = E->next()) {
config->set_value(option_section, E->get().name, preset->get(E->get().name));
for (const PropertyInfo &E : preset->get_properties()) {
config->set_value(option_section, E.name, preset->get(E.name));
}
}
@ -1642,10 +1640,10 @@ void EditorExport::load_config() {
config->get_section_keys(option_section, &options);
for (List<String>::Element *E = options.front(); E; E = E->next()) {
Variant value = config->get_value(option_section, E->get());
for (String &E : options) {
Variant value = config->get_value(option_section, E);
preset->set(E->get(), value);
preset->set(E, value);
}
add_export_preset(preset);
@ -1684,11 +1682,11 @@ void EditorExport::update_export_presets() {
preset->properties.clear();
preset->values.clear();
for (List<EditorExportPlatform::ExportOption>::Element *E = options.front(); E; E = E->next()) {
preset->properties.push_back(E->get().option);
for (EditorExportPlatform::ExportOption &E : options) {
preset->properties.push_back(E.option);
StringName option_name = E->get().option.name;
preset->values[option_name] = previous_values.has(option_name) ? previous_values[option_name] : E->get().default_value;
StringName option_name = E.option.name;
preset->values[option_name] = previous_values.has(option_name) ? previous_values[option_name] : E.default_value;
}
}
}

View File

@ -527,9 +527,8 @@ void EditorFeatureProfileManager::_fill_classes_from(TreeItem *p_parent, const S
ClassDB::get_direct_inheriters_from_class(p_class, &child_classes);
child_classes.sort_custom<StringName::AlphCompare>();
for (List<StringName>::Element *E = child_classes.front(); E; E = E->next()) {
String name = E->get();
if (name.begins_with("Editor") || ClassDB::get_api_type(name) != ClassDB::API_CORE) {
for (StringName &name : child_classes) {
if (String(name).begins_with("Editor") || ClassDB::get_api_type(name) != ClassDB::API_CORE) {
continue;
}
_fill_classes_from(class_item, name, p_selected);
@ -597,9 +596,9 @@ void EditorFeatureProfileManager::_class_list_item_selected() {
TreeItem *properties = property_list->create_item(root);
properties->set_text(0, TTR("Class Properties:"));
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
String name = E->get().name;
if (!(E->get().usage & PROPERTY_USAGE_EDITOR)) {
for (PropertyInfo &E : props) {
String name = E.name;
if (!(E.usage & PROPERTY_USAGE_EDITOR)) {
continue;
}
TreeItem *property = property_list->create_item(properties);
@ -609,7 +608,7 @@ void EditorFeatureProfileManager::_class_list_item_selected() {
property->set_checked(0, !edited->is_class_property_disabled(class_name, name));
property->set_text(0, name.capitalize());
property->set_metadata(0, name);
String icon_type = Variant::get_type_name(E->get().type);
String icon_type = Variant::get_type_name(E.type);
property->set_icon(0, EditorNode::get_singleton()->get_class_icon(icon_type));
}
}

View File

@ -830,8 +830,8 @@ void EditorFileDialog::update_file_list() {
while (!files.is_empty()) {
bool match = patterns.is_empty();
for (List<String>::Element *E = patterns.front(); E; E = E->next()) {
if (files.front()->get().matchn(E->get())) {
for (String &E : patterns) {
if (files.front()->get().matchn(E)) {
match = true;
break;
}

View File

@ -457,8 +457,8 @@ bool EditorFileSystem::_test_for_reimport(const String &p_path, bool p_only_impo
memdelete(md5s);
//imported files are gone, reimport
for (List<String>::Element *E = to_check.front(); E; E = E->next()) {
if (!FileAccess::exists(E->get())) {
for (String &E : to_check) {
if (!FileAccess::exists(E)) {
return true;
}
}
@ -497,9 +497,7 @@ bool EditorFileSystem::_update_scan_actions() {
Vector<String> reimports;
Vector<String> reloads;
for (List<ItemAction>::Element *E = scan_actions.front(); E; E = E->next()) {
ItemAction &ia = E->get();
for (ItemAction &ia : scan_actions) {
switch (ia.action) {
case ItemAction::ACTION_NONE: {
} break;
@ -1027,8 +1025,8 @@ void EditorFileSystem::_delete_internal_files(String p_file) {
List<String> paths;
ResourceFormatImporter::get_singleton()->get_internal_resource_path_list(p_file, &paths);
DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
for (List<String>::Element *E = paths.front(); E; E = E->next()) {
da->remove(E->get());
for (String &E : paths) {
da->remove(E);
}
da->remove(p_file + ".import");
memdelete(da);
@ -1368,8 +1366,8 @@ Vector<String> EditorFileSystem::_get_dependencies(const String &p_path) {
ResourceLoader::get_dependencies(p_path, &deps);
Vector<String> ret;
for (List<String>::Element *E = deps.front(); E; E = E->next()) {
ret.push_back(E->get());
for (String &E : deps) {
ret.push_back(E);
}
return ret;
@ -1549,15 +1547,14 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector
List<ResourceImporter::ImportOption> options;
importer->get_import_options(&options);
//set default values
for (List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) {
source_file_options[p_files[i]][E->get().option.name] = E->get().default_value;
for (ResourceImporter::ImportOption &E : options) {
source_file_options[p_files[i]][E.option.name] = E.default_value;
}
if (config->has_section("params")) {
List<String> sk;
config->get_section_keys("params", &sk);
for (List<String>::Element *E = sk.front(); E; E = E->next()) {
String param = E->get();
for (String &param : sk) {
Variant value = config->get_value("params", param);
//override with whathever is in file
source_file_options[p_files[i]][param] = value;
@ -1631,9 +1628,9 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector
List<ResourceImporter::ImportOption> options;
importer->get_import_options(&options);
//set default values
for (List<ResourceImporter::ImportOption>::Element *F = options.front(); F; F = F->next()) {
String base = F->get().option.name;
Variant v = F->get().default_value;
for (ResourceImporter::ImportOption &F : options) {
String base = F.option.name;
Variant v = F.default_value;
if (source_file_options[file].has(base)) {
v = source_file_options[file][base];
}
@ -1712,8 +1709,8 @@ void EditorFileSystem::_reimport_file(const String &p_file, const Map<StringName
if (cf->has_section("params")) {
List<String> sk;
cf->get_section_keys("params", &sk);
for (List<String>::Element *E = sk.front(); E; E = E->next()) {
params[E->get()] = cf->get_value("params", E->get());
for (String &E : sk) {
params[E] = cf->get_value("params", E);
}
}
if (p_custom_importer == String() && cf->has_section("remap")) {
@ -1754,9 +1751,9 @@ void EditorFileSystem::_reimport_file(const String &p_file, const Map<StringName
List<ResourceImporter::ImportOption> opts;
importer->get_import_options(&opts);
for (List<ResourceImporter::ImportOption>::Element *E = opts.front(); E; E = E->next()) {
if (!params.has(E->get().option.name)) { //this one is not present
params[E->get().option.name] = E->get().default_value;
for (ResourceImporter::ImportOption &E : opts) {
if (!params.has(E.option.name)) { //this one is not present
params[E.option.name] = E.default_value;
}
}
@ -1766,8 +1763,8 @@ void EditorFileSystem::_reimport_file(const String &p_file, const Map<StringName
List<Variant> v;
d.get_key_list(&v);
for (List<Variant>::Element *E = v.front(); E; E = E->next()) {
params[E->get()] = d[E->get()];
for (Variant &E : v) {
params[E] = d[E];
}
}
@ -1807,10 +1804,10 @@ void EditorFileSystem::_reimport_file(const String &p_file, const Map<StringName
//no path
} else if (import_variants.size()) {
//import with variants
for (List<String>::Element *E = import_variants.front(); E; E = E->next()) {
String path = base_path.c_escape() + "." + E->get() + "." + importer->get_save_extension();
for (String &E : import_variants) {
String path = base_path.c_escape() + "." + E + "." + importer->get_save_extension();
f->store_line("path." + E->get() + "=\"" + path + "\"");
f->store_line("path." + E + "=\"" + path + "\"");
dest_paths.push_back(path);
}
} else {
@ -1833,9 +1830,9 @@ void EditorFileSystem::_reimport_file(const String &p_file, const Map<StringName
if (gen_files.size()) {
Array genf;
for (List<String>::Element *E = gen_files.front(); E; E = E->next()) {
genf.push_back(E->get());
dest_paths.push_back(E->get());
for (String &E : gen_files) {
genf.push_back(E);
dest_paths.push_back(E);
}
String value;
@ -1859,8 +1856,8 @@ void EditorFileSystem::_reimport_file(const String &p_file, const Map<StringName
//store options in provided order, to avoid file changing. Order is also important because first match is accepted first.
for (List<ResourceImporter::ImportOption>::Element *E = opts.front(); E; E = E->next()) {
String base = E->get().option.name;
for (ResourceImporter::ImportOption &E : opts) {
String base = E.option.name;
String value;
VariantWriter::write_to_string(params[base], value);
f->store_line(base + "=" + value);
@ -2080,9 +2077,8 @@ void EditorFileSystem::_move_group_files(EditorFileSystemDirectory *efd, const S
List<String> sk;
config->get_section_keys("params", &sk);
for (List<String>::Element *E = sk.front(); E; E = E->next()) {
for (String &param : sk) {
//not very clean, but should work
String param = E->get();
String value = config->get_value("params", param);
if (value == p_group_file) {
config->set_value("params", param, p_new_location);
@ -2131,14 +2127,14 @@ void EditorFileSystem::_update_extensions() {
List<String> extensionsl;
ResourceLoader::get_recognized_extensions_for_type("", &extensionsl);
for (List<String>::Element *E = extensionsl.front(); E; E = E->next()) {
valid_extensions.insert(E->get());
for (String &E : extensionsl) {
valid_extensions.insert(E);
}
extensionsl.clear();
ResourceFormatImporter::get_singleton()->get_recognized_extensions(&extensionsl);
for (List<String>::Element *E = extensionsl.front(); E; E = E->next()) {
import_extensions.insert(E->get());
for (String &E : extensionsl) {
import_extensions.insert(E);
}
}

View File

@ -109,10 +109,10 @@ void EditorFolding::_fill_folds(const Node *p_root, const Node *p_node, Array &p
List<PropertyInfo> plist;
p_node->get_property_list(&plist);
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
if (E->get().usage & PROPERTY_USAGE_EDITOR) {
if (E->get().type == Variant::OBJECT) {
RES res = p_node->get(E->get().name);
for (PropertyInfo &E : plist) {
if (E.usage & PROPERTY_USAGE_EDITOR) {
if (E.type == Variant::OBJECT) {
RES res = p_node->get(E.name);
if (res.is_valid() && !resources.has(res) && res->get_path() != String() && !res->get_path().is_resource_file()) {
Vector<String> res_unfolds = _get_unfolds(res.ptr());
resource_folds.push_back(res->get_path());
@ -228,41 +228,41 @@ void EditorFolding::_do_object_unfolds(Object *p_object, Set<RES> &resources) {
Set<String> unfold_group;
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
if (E->get().usage & PROPERTY_USAGE_CATEGORY) {
for (PropertyInfo &E : plist) {
if (E.usage & PROPERTY_USAGE_CATEGORY) {
group = "";
group_base = "";
}
if (E->get().usage & PROPERTY_USAGE_GROUP) {
group = E->get().name;
group_base = E->get().hint_string;
if (E.usage & PROPERTY_USAGE_GROUP) {
group = E.name;
group_base = E.hint_string;
if (group_base.ends_with("_")) {
group_base = group_base.substr(0, group_base.length() - 1);
}
}
//can unfold
if (E->get().usage & PROPERTY_USAGE_EDITOR) {
if (E.usage & PROPERTY_USAGE_EDITOR) {
if (group != "") { //group
if (group_base == String() || E->get().name.begins_with(group_base)) {
bool can_revert = EditorPropertyRevert::can_property_revert(p_object, E->get().name);
if (group_base == String() || E.name.begins_with(group_base)) {
bool can_revert = EditorPropertyRevert::can_property_revert(p_object, E.name);
if (can_revert) {
unfold_group.insert(group);
}
}
} else { //path
int last = E->get().name.rfind("/");
int last = E.name.rfind("/");
if (last != -1) {
bool can_revert = EditorPropertyRevert::can_property_revert(p_object, E->get().name);
bool can_revert = EditorPropertyRevert::can_property_revert(p_object, E.name);
if (can_revert) {
unfold_group.insert(E->get().name.substr(0, last));
unfold_group.insert(E.name.substr(0, last));
}
}
}
if (E->get().type == Variant::OBJECT) {
RES res = p_object->get(E->get().name);
print_line("res: " + String(E->get().name) + " valid " + itos(res.is_valid()));
if (E.type == Variant::OBJECT) {
RES res = p_object->get(E.name);
print_line("res: " + String(E.name) + " valid " + itos(res.is_valid()));
if (res.is_valid()) {
print_line("path " + res->get_path());
}

View File

@ -1508,9 +1508,9 @@ String EditorInspector::get_selected_path() const {
}
void EditorInspector::_parse_added_editors(VBoxContainer *current_vbox, Ref<EditorInspectorPlugin> ped) {
for (List<EditorInspectorPlugin::AddedEditor>::Element *F = ped->added_editors.front(); F; F = F->next()) {
EditorProperty *ep = Object::cast_to<EditorProperty>(F->get().property_editor);
current_vbox->add_child(F->get().property_editor);
for (EditorInspectorPlugin::AddedEditor &F : ped->added_editors) {
EditorProperty *ep = Object::cast_to<EditorProperty>(F.property_editor);
current_vbox->add_child(F.property_editor);
if (ep) {
ep->object = object;
@ -1524,19 +1524,19 @@ void EditorInspector::_parse_added_editors(VBoxContainer *current_vbox, Ref<Edit
ep->connect("resource_selected", callable_mp(this, &EditorInspector::_resource_selected), varray(), CONNECT_DEFERRED);
ep->connect("object_id_selected", callable_mp(this, &EditorInspector::_object_id_selected), varray(), CONNECT_DEFERRED);
if (F->get().properties.size()) {
if (F->get().properties.size() == 1) {
if (F.properties.size()) {
if (F.properties.size() == 1) {
//since it's one, associate:
ep->property = F->get().properties[0];
ep->property = F.properties[0];
ep->property_usage = 0;
}
if (F->get().label != String()) {
ep->set_label(F->get().label);
if (F.label != String()) {
ep->set_label(F.label);
}
for (int i = 0; i < F->get().properties.size(); i++) {
String prop = F->get().properties[i];
for (int i = 0; i < F.properties.size(); i++) {
String prop = F.properties[i];
if (!editor_property_map.has(prop)) {
editor_property_map[prop] = List<EditorProperty *>();
@ -1648,8 +1648,7 @@ void EditorInspector::update_tree() {
Color sscolor = get_theme_color(SNAME("prop_subsection"), SNAME("Editor"));
for (List<Ref<EditorInspectorPlugin>>::Element *E = valid_plugins.front(); E; E = E->next()) {
Ref<EditorInspectorPlugin> ped = E->get();
for (Ref<EditorInspectorPlugin> ped : valid_plugins) {
ped->parse_begin(object);
_parse_added_editors(main_vbox, ped);
}
@ -1746,8 +1745,7 @@ void EditorInspector::update_tree() {
category->set_tooltip(p.name + "::" + (class_descr_cache[type2] == "" ? "" : class_descr_cache[type2]));
}
for (List<Ref<EditorInspectorPlugin>>::Element *E = valid_plugins.front(); E; E = E->next()) {
Ref<EditorInspectorPlugin> ped = E->get();
for (Ref<EditorInspectorPlugin> ped : valid_plugins) {
ped->parse_category(object, p.name);
_parse_added_editors(main_vbox, ped);
}
@ -1948,36 +1946,35 @@ void EditorInspector::update_tree() {
doc_hint = descr;
}
for (List<Ref<EditorInspectorPlugin>>::Element *E = valid_plugins.front(); E; E = E->next()) {
Ref<EditorInspectorPlugin> ped = E->get();
for (Ref<EditorInspectorPlugin> ped : valid_plugins) {
bool exclusive = ped->parse_property(object, p.type, p.name, p.hint, p.hint_string, p.usage, wide_editors);
List<EditorInspectorPlugin::AddedEditor> editors = ped->added_editors; //make a copy, since plugins may be used again in a sub-inspector
ped->added_editors.clear();
for (List<EditorInspectorPlugin::AddedEditor>::Element *F = editors.front(); F; F = F->next()) {
EditorProperty *ep = Object::cast_to<EditorProperty>(F->get().property_editor);
for (EditorInspectorPlugin::AddedEditor &F : editors) {
EditorProperty *ep = Object::cast_to<EditorProperty>(F.property_editor);
if (ep) {
//set all this before the control gets the ENTER_TREE notification
ep->object = object;
if (F->get().properties.size()) {
if (F->get().properties.size() == 1) {
if (F.properties.size()) {
if (F.properties.size() == 1) {
//since it's one, associate:
ep->property = F->get().properties[0];
ep->property = F.properties[0];
ep->property_usage = p.usage;
//and set label?
}
if (F->get().label != String()) {
ep->set_label(F->get().label);
if (F.label != String()) {
ep->set_label(F.label);
} else {
//use existin one
ep->set_label(name);
}
for (int i = 0; i < F->get().properties.size(); i++) {
String prop = F->get().properties[i];
for (int i = 0; i < F.properties.size(); i++) {
String prop = F.properties[i];
if (!editor_property_map.has(prop)) {
editor_property_map[prop] = List<EditorProperty *>();
@ -1995,7 +1992,7 @@ void EditorInspector::update_tree() {
ep->set_deletable(deletable_properties);
}
current_vbox->add_child(F->get().property_editor);
current_vbox->add_child(F.property_editor);
if (ep) {
ep->connect("property_changed", callable_mp(this, &EditorInspector::_property_changed));
@ -2031,8 +2028,7 @@ void EditorInspector::update_tree() {
}
}
for (List<Ref<EditorInspectorPlugin>>::Element *E = valid_plugins.front(); E; E = E->next()) {
Ref<EditorInspectorPlugin> ped = E->get();
for (Ref<EditorInspectorPlugin> ped : valid_plugins) {
ped->parse_end();
_parse_added_editors(main_vbox, ped);
}
@ -2045,10 +2041,10 @@ void EditorInspector::update_property(const String &p_prop) {
return;
}
for (List<EditorProperty *>::Element *E = editor_property_map[p_prop].front(); E; E = E->next()) {
E->get()->update_property();
E->get()->update_reload_status();
E->get()->update_cache();
for (EditorProperty *E : editor_property_map[p_prop]) {
E->update_property();
E->update_reload_status();
E->update_cache();
}
}
@ -2157,24 +2153,24 @@ bool EditorInspector::is_using_folding() {
}
void EditorInspector::collapse_all_folding() {
for (List<EditorInspectorSection *>::Element *E = sections.front(); E; E = E->next()) {
E->get()->fold();
for (EditorInspectorSection *E : sections) {
E->fold();
}
for (Map<StringName, List<EditorProperty *>>::Element *F = editor_property_map.front(); F; F = F->next()) {
for (List<EditorProperty *>::Element *E = F->get().front(); E; E = E->next()) {
E->get()->collapse_all_folding();
for (EditorProperty *E : F->get()) {
E->collapse_all_folding();
}
}
}
void EditorInspector::expand_all_folding() {
for (List<EditorInspectorSection *>::Element *E = sections.front(); E; E = E->next()) {
E->get()->unfold();
for (EditorInspectorSection *E : sections) {
E->unfold();
}
for (Map<StringName, List<EditorProperty *>>::Element *F = editor_property_map.front(); F; F = F->next()) {
for (List<EditorProperty *>::Element *E = F->get().front(); E; E = E->next()) {
E->get()->expand_all_folding();
for (EditorProperty *E : F->get()) {
E->expand_all_folding();
}
}
}
@ -2239,9 +2235,9 @@ void EditorInspector::_edit_request_change(Object *p_object, const String &p_pro
void EditorInspector::_edit_set(const String &p_name, const Variant &p_value, bool p_refresh_all, const String &p_changed_field) {
if (autoclear && editor_property_map.has(p_name)) {
for (List<EditorProperty *>::Element *E = editor_property_map[p_name].front(); E; E = E->next()) {
if (E->get()->is_checkable()) {
E->get()->set_checked(true);
for (EditorProperty *E : editor_property_map[p_name]) {
if (E->is_checkable()) {
E->set_checked(true);
}
}
}
@ -2308,8 +2304,8 @@ void EditorInspector::_edit_set(const String &p_name, const Variant &p_value, bo
}
if (editor_property_map.has(p_name)) {
for (List<EditorProperty *>::Element *E = editor_property_map[p_name].front(); E; E = E->next()) {
E->get()->update_reload_status();
for (EditorProperty *E : editor_property_map[p_name]) {
E->update_reload_status();
}
}
}
@ -2395,10 +2391,10 @@ void EditorInspector::_property_checked(const String &p_path, bool p_checked) {
Variant to_create;
List<PropertyInfo> pinfo;
object->get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
if (E->get().name == p_path) {
for (PropertyInfo &E : pinfo) {
if (E.name == p_path) {
Callable::CallError ce;
Variant::construct(E->get().type, to_create, nullptr, 0, ce);
Variant::construct(E.type, to_create, nullptr, 0, ce);
break;
}
}
@ -2406,10 +2402,10 @@ void EditorInspector::_property_checked(const String &p_path, bool p_checked) {
}
if (editor_property_map.has(p_path)) {
for (List<EditorProperty *>::Element *E = editor_property_map[p_path].front(); E; E = E->next()) {
E->get()->update_property();
E->get()->update_reload_status();
E->get()->update_cache();
for (EditorProperty *E : editor_property_map[p_path]) {
E->update_property();
E->update_reload_status();
E->update_cache();
}
}
@ -2426,9 +2422,9 @@ void EditorInspector::_property_selected(const String &p_path, int p_focusable)
if (F->key() == property_selected) {
continue;
}
for (List<EditorProperty *>::Element *E = F->get().front(); E; E = E->next()) {
if (E->get()->is_selected()) {
E->get()->deselect();
for (EditorProperty *E : F->get()) {
if (E->is_selected()) {
E->deselect();
}
}
}
@ -2485,11 +2481,11 @@ void EditorInspector::_notification(int p_what) {
refresh_countdown -= get_process_delta_time();
if (refresh_countdown <= 0) {
for (Map<StringName, List<EditorProperty *>>::Element *F = editor_property_map.front(); F; F = F->next()) {
for (List<EditorProperty *>::Element *E = F->get().front(); E; E = E->next()) {
if (!E->get()->is_cache_valid()) {
E->get()->update_property();
E->get()->update_reload_status();
E->get()->update_cache();
for (EditorProperty *E : F->get()) {
if (!E->is_cache_valid()) {
E->update_property();
E->update_reload_status();
E->update_cache();
}
}
}
@ -2508,10 +2504,10 @@ void EditorInspector::_notification(int p_what) {
while (pending.size()) {
StringName prop = pending.front()->get();
if (editor_property_map.has(prop)) {
for (List<EditorProperty *>::Element *E = editor_property_map[prop].front(); E; E = E->next()) {
E->get()->update_property();
E->get()->update_reload_status();
E->get()->update_cache();
for (EditorProperty *E : editor_property_map[prop]) {
E->update_property();
E->update_reload_status();
E->update_cache();
}
}
pending.erase(pending.front());
@ -2599,8 +2595,7 @@ void EditorInspector::_update_script_class_properties(const Object &p_object, Li
}
Set<StringName> added;
for (List<Ref<Script>>::Element *E = classes.front(); E; E = E->next()) {
Ref<Script> s = E->get();
for (Ref<Script> s : classes) {
String path = s->get_path();
String name = EditorNode::get_editor_data().script_class_get_name(path);
if (name.is_empty()) {

View File

@ -92,8 +92,8 @@ void EditorLayoutsDialog::_post_popup() {
List<String> layouts;
config.ptr()->get_sections(&layouts);
for (List<String>::Element *E = layouts.front(); E; E = E->next()) {
layout_names->add_item(**E);
for (String &E : layouts) {
layout_names->add_item(E);
}
}

View File

@ -797,8 +797,8 @@ void EditorNode::_resources_changed(const Vector<String> &p_resources) {
}
if (changed.size()) {
for (List<Ref<Resource>>::Element *E = changed.front(); E; E = E->next()) {
E->get()->reload_from_file();
for (Ref<Resource> E : changed) {
E->reload_from_file();
}
}
}
@ -914,8 +914,8 @@ void EditorNode::_resources_reimported(const Vector<String> &p_resources) {
}
}
for (List<String>::Element *E = scenes.front(); E; E = E->next()) {
reload_scene(E->get());
for (String &E : scenes) {
reload_scene(E);
}
scene_tabs->set_current_tab(current_tab);
@ -1143,13 +1143,13 @@ void EditorNode::save_resource_as(const Ref<Resource> &p_resource, const String
file->clear_filters();
List<String> preferred;
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
if (p_resource->is_class("Script") && (E->get() == "tres" || E->get() == "res")) {
for (String &E : extensions) {
if (p_resource->is_class("Script") && (E == "tres" || E == "res")) {
//this serves no purpose and confused people
continue;
}
file->add_filter("*." + E->get() + " ; " + E->get().to_upper());
preferred.push_back(E->get());
file->add_filter("*." + E + " ; " + E.to_upper());
preferred.push_back(E);
}
// Lowest priority extension
List<String>::Element *res_element = preferred.find("res");
@ -1259,10 +1259,10 @@ void EditorNode::_get_scene_metadata(const String &p_file) {
cf->get_section_keys("editor_states", &esl);
Dictionary md;
for (List<String>::Element *E = esl.front(); E; E = E->next()) {
Variant st = cf->get_value("editor_states", E->get());
for (String &E : esl) {
Variant st = cf->get_value("editor_states", E);
if (st.get_type() != Variant::NIL) {
md[E->get()] = st;
md[E] = st;
}
}
@ -1295,8 +1295,8 @@ void EditorNode::_set_scene_metadata(const String &p_file, int p_idx) {
List<Variant> keys;
md.get_key_list(&keys);
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
cf->set_value("editor_states", E->get(), md[E->get()]);
for (Variant &E : keys) {
cf->set_value("editor_states", E, md[E]);
}
Error err = cf->save(path);
@ -1334,14 +1334,14 @@ bool EditorNode::_find_and_save_edited_subresources(Object *obj, Map<RES, bool>
bool ret_changed = false;
List<PropertyInfo> pi;
obj->get_property_list(&pi);
for (List<PropertyInfo>::Element *E = pi.front(); E; E = E->next()) {
if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) {
for (PropertyInfo &E : pi) {
if (!(E.usage & PROPERTY_USAGE_STORAGE)) {
continue;
}
switch (E->get().type) {
switch (E.type) {
case Variant::OBJECT: {
RES res = obj->get(E->get().name);
RES res = obj->get(E.name);
if (_find_and_save_resource(res, processed, flags)) {
ret_changed = true;
@ -1349,7 +1349,7 @@ bool EditorNode::_find_and_save_edited_subresources(Object *obj, Map<RES, bool>
} break;
case Variant::ARRAY: {
Array varray = obj->get(E->get().name);
Array varray = obj->get(E.name);
int len = varray.size();
for (int i = 0; i < len; i++) {
const Variant &v = varray.get(i);
@ -1361,11 +1361,11 @@ bool EditorNode::_find_and_save_edited_subresources(Object *obj, Map<RES, bool>
} break;
case Variant::DICTIONARY: {
Dictionary d = obj->get(E->get().name);
Dictionary d = obj->get(E.name);
List<Variant> keys;
d.get_key_list(&keys);
for (List<Variant>::Element *F = keys.front(); F; F = F->next()) {
Variant v = d[F->get()];
for (Variant &F : keys) {
Variant v = d[F];
RES res = v;
if (_find_and_save_resource(res, processed, flags)) {
ret_changed = true;
@ -1520,9 +1520,9 @@ static bool _find_edited_resources(const Ref<Resource> &p_resource, Set<Ref<Reso
p_resource->get_property_list(&plist);
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
if (E->get().type == Variant::OBJECT && E->get().usage & PROPERTY_USAGE_STORAGE && !(E->get().usage & PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT)) {
RES res = p_resource->get(E->get().name);
for (PropertyInfo &E : plist) {
if (E.type == Variant::OBJECT && E.usage & PROPERTY_USAGE_STORAGE && !(E.usage & PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT)) {
RES res = p_resource->get(E.name);
if (res.is_null()) {
continue;
}
@ -1551,8 +1551,7 @@ int EditorNode::_save_external_resources() {
int saved = 0;
List<Ref<Resource>> cached;
ResourceCache::get_cached_resources(&cached);
for (List<Ref<Resource>>::Element *E = cached.front(); E; E = E->next()) {
Ref<Resource> res = E->get();
for (Ref<Resource> res : cached) {
if (!res->get_path().is_resource_file()) {
continue;
}
@ -1642,8 +1641,8 @@ void EditorNode::_save_scene(String p_file, int idx) {
editor_data.save_editor_external_data();
for (List<Ref<AnimatedValuesBackup>>::Element *E = anim_backups.front(); E; E = E->next()) {
E->get()->restore();
for (Ref<AnimatedValuesBackup> E : anim_backups) {
E->restore();
}
if (err == OK) {
@ -1884,8 +1883,8 @@ void EditorNode::_dialog_action(String p_file) {
// erase
List<String> keys;
config->get_section_keys(p_file, &keys);
for (List<String>::Element *E = keys.front(); E; E = E->next()) {
config->set_value(p_file, E->get(), Variant());
for (String &E : keys) {
config->set_value(p_file, E, Variant());
}
config->save(EditorSettings::get_singleton()->get_editor_layouts_config());
@ -2533,8 +2532,8 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
Ref<MeshLibrary> ml(memnew(MeshLibrary));
ResourceSaver::get_recognized_extensions(ml, &extensions);
file_export_lib->clear_filters();
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
file_export_lib->add_filter("*." + E->get());
for (String &E : extensions) {
file_export_lib->add_filter("*." + E);
}
file_export_lib->popup_file_dialog();
@ -4055,11 +4054,11 @@ void EditorNode::_build_icon_type_cache() {
List<StringName> tl;
StringName ei = "EditorIcons";
theme_base->get_theme()->get_icon_list(ei, &tl);
for (List<StringName>::Element *E = tl.front(); E; E = E->next()) {
if (!ClassDB::class_exists(E->get())) {
for (StringName &E : tl) {
if (!ClassDB::class_exists(E)) {
continue;
}
icon_type_cache[E->get()] = theme_base->get_theme()->get_icon(E->get(), ei);
icon_type_cache[E] = theme_base->get_theme()->get_icon(E, ei);
}
}
@ -4784,9 +4783,7 @@ void EditorNode::_update_layouts_menu() {
List<String> layouts;
config.ptr()->get_sections(&layouts);
for (List<String>::Element *E = layouts.front(); E; E = E->next()) {
String layout = E->get();
for (String &layout : layouts) {
if (layout == TTR("Default")) {
editor_layouts->remove_item(editor_layouts->get_item_index(SETTINGS_LAYOUT_DEFAULT));
overridden_default_layout = editor_layouts->get_item_count();
@ -5343,9 +5340,9 @@ void EditorNode::reload_scene(const String &p_path) {
List<Ref<Resource>> cached;
ResourceCache::get_cached_resources(&cached);
List<Ref<Resource>> to_clear; //clear internal resources from previous scene from being used
for (List<Ref<Resource>>::Element *E = cached.front(); E; E = E->next()) {
if (E->get()->get_path().begins_with(p_path + "::")) { //subresources of existing scene
to_clear.push_back(E->get());
for (Ref<Resource> E : cached) {
if (E->get_path().begins_with(p_path + "::")) { //subresources of existing scene
to_clear.push_back(E);
}
}
@ -6741,8 +6738,8 @@ EditorNode::EditorNode() {
file_script->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE);
List<String> sexts;
ResourceLoader::get_recognized_extensions_for_type("Script", &sexts);
for (List<String>::Element *E = sexts.front(); E; E = E->next()) {
file_script->add_filter("*." + E->get());
for (String &E : sexts) {
file_script->add_filter("*." + E);
}
gui_base->add_child(file_script);
file_script->connect("file_selected", callable_mp(this, &EditorNode::_dialog_action));

View File

@ -40,15 +40,15 @@ void EditorPath::_add_children_to_popup(Object *p_obj, int p_depth) {
List<PropertyInfo> pinfo;
p_obj->get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
if (!(E->get().usage & PROPERTY_USAGE_EDITOR)) {
for (PropertyInfo &E : pinfo) {
if (!(E.usage & PROPERTY_USAGE_EDITOR)) {
continue;
}
if (E->get().hint != PROPERTY_HINT_RESOURCE_TYPE) {
if (E.hint != PROPERTY_HINT_RESOURCE_TYPE) {
continue;
}
Variant value = p_obj->get(E->get().name);
Variant value = p_obj->get(E.name);
if (value.get_type() != Variant::OBJECT) {
continue;
}
@ -60,7 +60,7 @@ void EditorPath::_add_children_to_popup(Object *p_obj, int p_depth) {
Ref<Texture2D> icon = EditorNode::get_singleton()->get_object_icon(obj);
String proper_name = "";
Vector<String> name_parts = E->get().name.split("/");
Vector<String> name_parts = E.name.split("/");
for (int i = 0; i < name_parts.size(); i++) {
if (i > 0) {

View File

@ -221,8 +221,8 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
}
Set<String> valid_extensions;
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
valid_extensions.insert(E->get());
for (String &E : extensions) {
valid_extensions.insert(E);
}
if (!file_dialog) {
@ -260,9 +260,8 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
List<PropertyInfo> property_list;
edited_resource->get_property_list(&property_list);
List<Pair<String, Variant>> propvalues;
for (List<PropertyInfo>::Element *E = property_list.front(); E; E = E->next()) {
for (PropertyInfo &pi : property_list) {
Pair<String, Variant> p;
PropertyInfo &pi = E->get();
if (pi.usage & PROPERTY_USAGE_STORAGE) {
p.first = pi.name;
p.second = edited_resource->get(pi.name);
@ -276,8 +275,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
Ref<Resource> unique_resource = Ref<Resource>(Object::cast_to<Resource>(inst));
ERR_FAIL_COND(unique_resource.is_null());
for (List<Pair<String, Variant>>::Element *E = propvalues.front(); E; E = E->next()) {
Pair<String, Variant> &p = E->get();
for (Pair<String, Variant> &p : propvalues) {
unique_resource->set(p.first, p.second);
}
@ -467,13 +465,13 @@ void EditorResourcePicker::_get_allowed_types(bool p_with_convert, Set<String> *
List<StringName> inheriters;
ClassDB::get_inheriters_from_class(base, &inheriters);
for (List<StringName>::Element *E = inheriters.front(); E; E = E->next()) {
p_vector->insert(E->get());
for (StringName &E : inheriters) {
p_vector->insert(E);
}
for (List<StringName>::Element *E = global_classes.front(); E; E = E->next()) {
if (EditorNode::get_editor_data().script_class_is_parent(E->get(), base)) {
p_vector->insert(E->get());
for (StringName &E : global_classes) {
if (EditorNode::get_editor_data().script_class_is_parent(E, base)) {
p_vector->insert(E);
}
}

View File

@ -228,8 +228,8 @@ Error EditorRun::run(const String &p_scene, const String &p_custom_args, const L
}
printf("Running: %s", exec.utf8().get_data());
for (List<String>::Element *E = args.front(); E; E = E->next()) {
printf(" %s", E->get().utf8().get_data());
for (String &E : args) {
printf(" %s", E.utf8().get_data());
};
printf("\n");
@ -250,8 +250,8 @@ Error EditorRun::run(const String &p_scene, const String &p_custom_args, const L
}
bool EditorRun::has_child_process(OS::ProcessID p_pid) const {
for (const List<OS::ProcessID>::Element *E = pids.front(); E; E = E->next()) {
if (E->get() == p_pid) {
for (const OS::ProcessID &E : pids) {
if (E == p_pid) {
return true;
}
}
@ -267,8 +267,8 @@ void EditorRun::stop_child_process(OS::ProcessID p_pid) {
void EditorRun::stop() {
if (status != STATUS_STOP && pids.size() > 0) {
for (List<OS::ProcessID>::Element *E = pids.front(); E; E = E->next()) {
OS::get_singleton()->kill(E->get());
for (OS::ProcessID &E : pids) {
OS::get_singleton()->kill(E);
}
}

View File

@ -76,8 +76,7 @@ class SectionedInspectorFilter : public Object {
List<PropertyInfo> pinfo;
edited->get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
PropertyInfo pi = E->get();
for (PropertyInfo &pi : pinfo) {
int sp = pi.name.find("/");
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
@ -221,9 +220,7 @@ void SectionedInspector::update_category_list() {
filter = search_box->get_text();
}
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
PropertyInfo pi = E->get();
for (PropertyInfo &pi : pinfo) {
if (pi.usage & PROPERTY_USAGE_CATEGORY) {
continue;
} else if (!(pi.usage & PROPERTY_USAGE_EDITOR) || (restrict_to_basic && !(pi.usage & PROPERTY_USAGE_EDITOR_BASIC_SETTING))) {

View File

@ -759,8 +759,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
List<String> keys;
p_extra_config->get_section_keys("presets", &keys);
for (List<String>::Element *E = keys.front(); E; E = E->next()) {
String key = E->get();
for (String &key : keys) {
Variant val = p_extra_config->get_value("presets", key);
set(key, val);
}
@ -815,8 +814,7 @@ bool EditorSettings::_save_text_editor_theme(String p_file) {
props.get_key_list(&keys);
keys.sort();
for (const List<String>::Element *E = keys.front(); E; E = E->next()) {
const String &key = E->get();
for (const String &key : keys) {
if (key.begins_with("text_editor/highlighting/") && key.find("color") >= 0) {
cf->set_value(theme_section, key.replace("text_editor/highlighting/", ""), ((Color)props[key].variant).to_html());
}
@ -1015,15 +1013,13 @@ void EditorSettings::setup_network() {
String selected = "127.0.0.1";
// Check that current remote_host is a valid interface address and populate hints.
for (List<IPAddress>::Element *E = local_ip.front(); E; E = E->next()) {
String ip = E->get();
for (IPAddress &ip : local_ip) {
// link-local IPv6 addresses don't work, skipping them
if (ip.begins_with("fe80:0:0:0:")) { // fe80::/64
if (String(ip).begins_with("fe80:0:0:0:")) { // fe80::/64
continue;
}
// Same goes for IPv4 link-local (APIPA) addresses.
if (ip.begins_with("169.254.")) { // 169.254.0.0/16
if (String(ip).begins_with("169.254.")) { // 169.254.0.0/16
continue;
}
// Select current IP (found)
@ -1303,8 +1299,8 @@ void EditorSettings::list_text_editor_themes() {
memdelete(d);
custom_themes.sort();
for (List<String>::Element *E = custom_themes.front(); E; E = E->next()) {
themes += "," + E->get();
for (String &E : custom_themes) {
themes += "," + E;
}
}
add_property_hint(PropertyInfo(Variant::STRING, "text_editor/theme/color_theme", PROPERTY_HINT_ENUM, themes));
@ -1332,8 +1328,7 @@ void EditorSettings::load_text_editor_theme() {
List<String> keys;
cf->get_section_keys("color_theme", &keys);
for (List<String>::Element *E = keys.front(); E; E = E->next()) {
String key = E->get();
for (String &key : keys) {
String val = cf->get_value("color_theme", key);
// don't load if it's not already there!
@ -1585,8 +1580,8 @@ void EditorSettings::set_builtin_action_override(const String &p_name, const Arr
int event_idx = 0;
// Check equality of each event.
for (List<Ref<InputEvent>>::Element *E = builtin_events.front(); E; E = E->next()) {
if (!E->get()->is_match(p_events[event_idx])) {
for (Ref<InputEvent> E : builtin_events) {
if (!E->is_match(p_events[event_idx])) {
same_as_builtin = false;
break;
}
@ -1615,8 +1610,8 @@ const Array EditorSettings::get_builtin_action_overrides(const String &p_name) c
Array event_array;
List<Ref<InputEvent>> events_list = AO->get();
for (List<Ref<InputEvent>>::Element *E = events_list.front(); E; E = E->next()) {
event_array.push_back(E->get());
for (Ref<InputEvent> E : events_list) {
event_array.push_back(E);
}
return event_array;
}

View File

@ -135,9 +135,7 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory
_sort_file_info_list(file_list);
// Build the tree.
for (List<FileInfo>::Element *E = file_list.front(); E; E = E->next()) {
FileInfo fi = E->get();
for (FileInfo &fi : file_list) {
TreeItem *file_item = tree->create_item(subdirectory_item);
file_item->set_text(0, fi.name);
file_item->set_structured_text_bidi_override(0, STRUCTURED_TEXT_FILE);
@ -869,8 +867,8 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) {
// Fills the ItemList control node from the FileInfos.
String main_scene = ProjectSettings::get_singleton()->get("application/run/main_scene");
String oi = "Object";
for (List<FileInfo>::Element *E = file_list.front(); E; E = E->next()) {
FileInfo *finfo = &(E->get());
for (FileInfo &E : file_list) {
FileInfo *finfo = &(E);
String fname = finfo->name;
String fpath = finfo->path;
String ftype = finfo->type;
@ -966,8 +964,8 @@ void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorit
List<String> importer_exts;
ResourceImporterScene::get_singleton()->get_recognized_extensions(&importer_exts);
String extension = fpath.get_extension();
for (List<String>::Element *E = importer_exts.front(); E; E = E->next()) {
if (extension.nocasecmp_to(E->get()) == 0) {
for (String &E : importer_exts) {
if (extension.nocasecmp_to(E) == 0) {
is_imported = true;
break;
}
@ -1239,9 +1237,7 @@ void FileSystemDock::_update_resource_paths_after_move(const Map<String, String>
List<Ref<Resource>> cached;
ResourceCache::get_cached_resources(&cached);
for (List<Ref<Resource>>::Element *E = cached.front(); E; E = E->next()) {
Ref<Resource> r = E->get();
for (Ref<Resource> r : cached) {
String base_path = r->get_path();
String extra_path;
int sep_pos = r->get_path().find("::");
@ -1317,16 +1313,16 @@ void FileSystemDock::_update_project_settings_after_move(const Map<String, Strin
// Also search for the file in autoload, as they are stored differently from normal files.
List<PropertyInfo> property_list;
ProjectSettings::get_singleton()->get_property_list(&property_list);
for (const List<PropertyInfo>::Element *E = property_list.front(); E; E = E->next()) {
if (E->get().name.begins_with("autoload/")) {
for (const PropertyInfo &E : property_list) {
if (E.name.begins_with("autoload/")) {
// If the autoload resource paths has a leading "*", it indicates that it is a Singleton,
// so we have to handle both cases when updating.
String autoload = GLOBAL_GET(E->get().name);
String autoload = GLOBAL_GET(E.name);
String autoload_singleton = autoload.substr(1, autoload.length());
if (p_renames.has(autoload)) {
ProjectSettings::get_singleton()->set_setting(E->get().name, p_renames[autoload]);
ProjectSettings::get_singleton()->set_setting(E.name, p_renames[autoload]);
} else if (autoload.begins_with("*") && p_renames.has(autoload_singleton)) {
ProjectSettings::get_singleton()->set_setting(E->get().name, "*" + p_renames[autoload_singleton]);
ProjectSettings::get_singleton()->set_setting(E.name, "*" + p_renames[autoload_singleton]);
}
}
}
@ -1417,8 +1413,8 @@ void FileSystemDock::_make_scene_confirm() {
ResourceSaver::get_recognized_extensions(sd, &extensions);
bool extension_correct = false;
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
if (E->get() == extension) {
for (String &E : extensions) {
if (E == extension) {
extension_correct = true;
break;
}

View File

@ -240,8 +240,7 @@ void GroupDialog::_group_renamed() {
List<Node *> nodes;
scene_tree->get_nodes_in_group(selected_group, &nodes);
bool removed_all = true;
for (List<Node *>::Element *E = nodes.front(); E; E = E->next()) {
Node *node = E->get();
for (Node *node : nodes) {
if (_can_edit(node, selected_group)) {
undo_redo->add_do_method(node, "remove_from_group", selected_group);
undo_redo->add_undo_method(node, "remove_from_group", name);
@ -286,11 +285,11 @@ void GroupDialog::_load_groups(Node *p_current) {
List<Node::GroupInfo> gi;
p_current->get_groups(&gi);
for (List<Node::GroupInfo>::Element *E = gi.front(); E; E = E->next()) {
if (!E->get().persistent) {
for (Node::GroupInfo &E : gi) {
if (!E.persistent) {
continue;
}
_add_group(E->get().name);
_add_group(E.name);
}
for (int i = 0; i < p_current->get_child_count(); i++) {
@ -311,10 +310,10 @@ void GroupDialog::_delete_group_pressed(Object *p_item, int p_column, int p_id)
List<Node *> nodes;
scene_tree->get_nodes_in_group(name, &nodes);
bool removed_all = true;
for (List<Node *>::Element *E = nodes.front(); E; E = E->next()) {
if (_can_edit(E->get(), name)) {
undo_redo->add_do_method(E->get(), "remove_from_group", name);
undo_redo->add_undo_method(E->get(), "add_to_group", name, true);
for (Node *E : nodes) {
if (_can_edit(E, name)) {
undo_redo->add_do_method(E, "remove_from_group", name);
undo_redo->add_undo_method(E, "add_to_group", name, true);
} else {
removed_all = false;
}
@ -628,8 +627,7 @@ void GroupsEditor::update_tree() {
TreeItem *root = tree->create_item();
for (List<GroupInfo>::Element *E = groups.front(); E; E = E->next()) {
Node::GroupInfo gi = E->get();
for (GroupInfo &gi : groups) {
if (!gi.persistent) {
continue;
}

View File

@ -894,8 +894,8 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<EditorSceneImpor
surftool->add_vertex(vertex_array[k].vertex);
}
for (List<int>::Element *E = indices_list.front(); E; E = E->next()) {
surftool->add_index(E->get());
for (int &E : indices_list) {
surftool->add_index(E);
}
if (!normal_src) {

View File

@ -438,17 +438,16 @@ Node *EditorOBJImporter::import_scene(const String &p_path, uint32_t p_flags, in
Node3D *scene = memnew(Node3D);
for (List<Ref<Mesh>>::Element *E = meshes.front(); E; E = E->next()) {
for (Ref<Mesh> m : meshes) {
Ref<EditorSceneImporterMesh> mesh;
mesh.instantiate();
Ref<Mesh> m = E->get();
for (int i = 0; i < m->get_surface_count(); i++) {
mesh->add_surface(m->surface_get_primitive_type(i), m->surface_get_arrays(i), Array(), Dictionary(), m->surface_get_material(i));
}
EditorSceneImporterMeshNode3D *mi = memnew(EditorSceneImporterMeshNode3D);
mi->set_mesh(mesh);
mi->set_name(E->get()->get_name());
mi->set_name(m->get_name());
scene->add_child(mi);
mi->set_owner(scene);
}

View File

@ -312,8 +312,8 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<E
List<StringName> anims;
ap->get_animation_list(&anims);
for (List<StringName>::Element *E = anims.front(); E; E = E->next()) {
Ref<Animation> anim = ap->get_animation(E->get());
for (StringName &E : anims) {
Ref<Animation> anim = ap->get_animation(E);
ERR_CONTINUE(anim.is_null());
for (int i = 0; i < anim->get_track_count(); i++) {
NodePath path = anim->track_get_path(i);
@ -328,14 +328,14 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<E
}
}
String animname = E->get();
String animname = E;
const int loop_string_count = 3;
static const char *loop_strings[loop_string_count] = { "loops", "loop", "cycle" };
for (int i = 0; i < loop_string_count; i++) {
if (_teststr(animname, loop_strings[i])) {
anim->set_loop(true);
animname = _fixstr(animname, loop_strings[i]);
ap->rename_animation(E->get(), animname);
ap->rename_animation(E, animname);
}
}
}
@ -659,9 +659,9 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, Map<Ref<
}
int idx = 0;
for (List<Ref<Shape3D>>::Element *E = shapes.front(); E; E = E->next()) {
for (Ref<Shape3D> &E : shapes) {
CollisionShape3D *cshape = memnew(CollisionShape3D);
cshape->set_shape(E->get());
cshape->set_shape(E);
base->add_child(cshape);
cshape->set_owner(base->get_owner());
@ -712,9 +712,9 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, Map<Ref<
//fill node settings for this node with default values
List<ImportOption> iopts;
get_internal_import_options(INTERNAL_IMPORT_CATEGORY_ANIMATION_NODE, &iopts);
for (List<ImportOption>::Element *E = iopts.front(); E; E = E->next()) {
if (!node_settings.has(E->get().option.name)) {
node_settings[E->get().option.name] = E->get().default_value;
for (ImportOption &E : iopts) {
if (!node_settings.has(E.option.name)) {
node_settings[E.option.name] = E.default_value;
}
}
}
@ -756,8 +756,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, Map<Ref<
} else {
List<StringName> anims;
ap->get_animation_list(&anims);
for (List<StringName>::Element *E = anims.front(); E; E = E->next()) {
String name = E->get();
for (StringName &name : anims) {
Ref<Animation> anim = ap->get_animation(name);
if (p_animation_data.has(name)) {
Dictionary anim_settings = p_animation_data[name];
@ -765,9 +764,9 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, Map<Ref<
//fill with default values
List<ImportOption> iopts;
get_internal_import_options(INTERNAL_IMPORT_CATEGORY_ANIMATION, &iopts);
for (List<ImportOption>::Element *F = iopts.front(); F; F = F->next()) {
if (!anim_settings.has(F->get().option.name)) {
anim_settings[F->get().option.name] = F->get().default_value;
for (ImportOption &F : iopts) {
if (!anim_settings.has(F.option.name)) {
anim_settings[F.option.name] = F.default_value;
}
}
}
@ -936,8 +935,8 @@ void ResourceImporterScene::_create_clips(AnimationPlayer *anim, const Array &p_
void ResourceImporterScene::_optimize_animations(AnimationPlayer *anim, float p_max_lin_error, float p_max_ang_error, float p_max_angle) {
List<StringName> anim_names;
anim->get_animation_list(&anim_names);
for (List<StringName>::Element *E = anim_names.front(); E; E = E->next()) {
Ref<Animation> a = anim->get_animation(E->get());
for (StringName &E : anim_names) {
Ref<Animation> a = anim->get_animation(E);
a->optimize(p_max_lin_error, p_max_ang_error, Math::deg2rad(p_max_angle));
}
}
@ -1046,11 +1045,11 @@ void ResourceImporterScene::get_import_options(List<ImportOption> *r_options, in
String script_ext_hint;
for (List<String>::Element *E = script_extentions.front(); E; E = E->next()) {
for (String &E : script_extentions) {
if (script_ext_hint != "") {
script_ext_hint += ",";
}
script_ext_hint += "*." + E->get();
script_ext_hint += "*." + E;
}
r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "nodes/root_scale", PROPERTY_HINT_RANGE, "0.001,1000,0.001"), 1.0));
@ -1089,9 +1088,9 @@ Node *ResourceImporterScene::import_scene_from_other_importer(EditorSceneImporte
List<String> extensions;
E->get()->get_extensions(&extensions);
for (List<String>::Element *F = extensions.front(); F; F = F->next()) {
if (F->get().to_lower() == ext) {
importer = E->get();
for (String &F : extensions) {
if (F.to_lower() == ext) {
importer = E;
break;
}
}
@ -1119,9 +1118,9 @@ Ref<Animation> ResourceImporterScene::import_animation_from_other_importer(Edito
List<String> extensions;
E->get()->get_extensions(&extensions);
for (List<String>::Element *F = extensions.front(); F; F = F->next()) {
if (F->get().to_lower() == ext) {
importer = E->get();
for (String &F : extensions) {
if (F.to_lower() == ext) {
importer = E;
break;
}
}
@ -1291,9 +1290,9 @@ void ResourceImporterScene::_generate_meshes(Node *p_node, const Dictionary &p_m
}
void ResourceImporterScene::_add_shapes(Node *p_node, const List<Ref<Shape3D>> &p_shapes) {
for (const List<Ref<Shape3D>>::Element *E = p_shapes.front(); E; E = E->next()) {
for (const Ref<Shape3D> &E : p_shapes) {
CollisionShape3D *cshape = memnew(CollisionShape3D);
cshape->set_shape(E->get());
cshape->set_shape(E);
p_node->add_child(cshape);
cshape->set_owner(p_node->get_owner());
@ -1311,9 +1310,9 @@ Node *ResourceImporterScene::pre_import(const String &p_source_file) {
List<String> extensions;
E->get()->get_extensions(&extensions);
for (List<String>::Element *F = extensions.front(); F; F = F->next()) {
if (F->get().to_lower() == ext) {
importer = E->get();
for (String &F : extensions) {
if (F.to_lower() == ext) {
importer = E;
break;
}
}
@ -1351,9 +1350,9 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
List<String> extensions;
E->get()->get_extensions(&extensions);
for (List<String>::Element *F = extensions.front(); F; F = F->next()) {
if (F->get().to_lower() == ext) {
importer = E->get();
for (String &F : extensions) {
if (F.to_lower() == ext) {
importer = E;
break;
}
}

View File

@ -71,9 +71,9 @@ class SceneImportSettingsData : public Object {
return false;
}
void _get_property_list(List<PropertyInfo> *p_list) const {
for (const List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) {
if (ResourceImporterScene::get_singleton()->get_internal_option_visibility(category, E->get().option.name, current)) {
p_list->push_back(E->get().option);
for (const ResourceImporter::ImportOption &E : options) {
if (ResourceImporterScene::get_singleton()->get_internal_option_visibility(category, E.option.name, current)) {
p_list->push_back(E.option);
}
}
}
@ -305,8 +305,8 @@ void SceneImportSettings::_fill_scene(Node *p_node, TreeItem *p_parent_item) {
if (anim_node) {
List<StringName> animations;
anim_node->get_animation_list(&animations);
for (List<StringName>::Element *E = animations.front(); E; E = E->next()) {
_fill_animation(scene_tree, anim_node->get_animation(E->get()), E->get(), item);
for (StringName &E : animations) {
_fill_animation(scene_tree, anim_node->get_animation(E), E, item);
}
}
@ -394,8 +394,8 @@ void SceneImportSettings::_load_default_subresource_settings(Map<StringName, Var
d = d[p_import_id];
List<ResourceImporterScene::ImportOption> options;
ResourceImporterScene::get_singleton()->get_internal_import_options(p_category, &options);
for (List<ResourceImporterScene::ImportOption>::Element *E = options.front(); E; E = E->next()) {
String key = E->get().option.name;
for (ResourceImporterScene::ImportOption &E : options) {
String key = E.option.name;
if (d.has(key)) {
settings[key] = d[key];
}
@ -440,12 +440,12 @@ void SceneImportSettings::open_settings(const String &p_path) {
if (err == OK) {
List<String> keys;
config->get_section_keys("params", &keys);
for (List<String>::Element *E = keys.front(); E; E = E->next()) {
Variant value = config->get_value("params", E->get());
if (E->get() == "_subresources") {
for (String &E : keys) {
Variant value = config->get_value("params", E);
if (E == "_subresources") {
base_subresource_settings = value;
} else {
defaults[E->get()] = value;
defaults[E] = value;
}
}
}
@ -605,13 +605,13 @@ void SceneImportSettings::_select(Tree *p_from, String p_type, String p_id) {
scene_import_settings_data->defaults.clear();
scene_import_settings_data->current.clear();
for (List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) {
scene_import_settings_data->defaults[E->get().option.name] = E->get().default_value;
for (ResourceImporter::ImportOption &E : options) {
scene_import_settings_data->defaults[E.option.name] = E.default_value;
//needed for visibility toggling (fails if something is missing)
if (scene_import_settings_data->settings->has(E->get().option.name)) {
scene_import_settings_data->current[E->get().option.name] = (*scene_import_settings_data->settings)[E->get().option.name];
if (scene_import_settings_data->settings->has(E.option.name)) {
scene_import_settings_data->current[E.option.name] = (*scene_import_settings_data->settings)[E.option.name];
} else {
scene_import_settings_data->current[E->get().option.name] = E->get().default_value;
scene_import_settings_data->current[E.option.name] = E.default_value;
}
}
scene_import_settings_data->options = options;

View File

@ -79,11 +79,11 @@ void EditorSceneImporterMesh::add_surface(Mesh::PrimitiveType p_primitive, const
List<Variant> lods;
p_lods.get_key_list(&lods);
for (List<Variant>::Element *E = lods.front(); E; E = E->next()) {
ERR_CONTINUE(!E->get().is_num());
for (Variant &E : lods) {
ERR_CONTINUE(!E.is_num());
Surface::LOD lod;
lod.distance = E->get();
lod.indices = p_lods[E->get()];
lod.distance = E;
lod.indices = p_lods[E];
ERR_CONTINUE(lod.indices.size() == 0);
s.lods.push_back(lod);
}

View File

@ -61,9 +61,9 @@ protected:
if (importer.is_null()) {
return;
}
for (const List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
if (importer->get_option_visibility(E->get().name, values)) {
p_list->push_back(E->get());
for (const PropertyInfo &E : properties) {
if (importer->get_option_visibility(E.name, values)) {
p_list->push_back(E);
}
}
}
@ -106,9 +106,9 @@ void ImportDefaultsEditor::_update_importer() {
List<Ref<ResourceImporter>> importer_list;
ResourceFormatImporter::get_singleton()->get_importers(&importer_list);
Ref<ResourceImporter> importer;
for (List<Ref<ResourceImporter>>::Element *E = importer_list.front(); E; E = E->next()) {
if (E->get()->get_visible_name() == importers->get_item_text(importers->get_selected())) {
importer = E->get();
for (Ref<ResourceImporter> E : importer_list) {
if (E->get_visible_name() == importers->get_item_text(importers->get_selected())) {
importer = E;
break;
}
}
@ -125,14 +125,14 @@ void ImportDefaultsEditor::_update_importer() {
d = ProjectSettings::get_singleton()->get("importer_defaults/" + importer->get_importer_name());
}
for (List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) {
settings->properties.push_back(E->get().option);
if (d.has(E->get().option.name)) {
settings->values[E->get().option.name] = d[E->get().option.name];
for (ResourceImporter::ImportOption &E : options) {
settings->properties.push_back(E.option);
if (d.has(E.option.name)) {
settings->values[E.option.name] = d[E.option.name];
} else {
settings->values[E->get().option.name] = E->get().default_value;
settings->values[E.option.name] = E.default_value;
}
settings->default_values[E->get().option.name] = E->get().default_value;
settings->default_values[E.option.name] = E.default_value;
}
save_defaults->set_disabled(false);
@ -166,8 +166,8 @@ void ImportDefaultsEditor::clear() {
List<Ref<ResourceImporter>> importer_list;
ResourceFormatImporter::get_singleton()->get_importers(&importer_list);
Vector<String> names;
for (List<Ref<ResourceImporter>>::Element *E = importer_list.front(); E; E = E->next()) {
String vn = E->get()->get_visible_name();
for (Ref<ResourceImporter> E : importer_list) {
String vn = E->get_visible_name();
names.push_back(vn);
}
names.sort();

View File

@ -65,14 +65,14 @@ public:
return false;
}
void _get_property_list(List<PropertyInfo> *p_list) const {
for (const List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
if (!importer->get_option_visibility(E->get().name, values)) {
for (const PropertyInfo &E : properties) {
if (!importer->get_option_visibility(E.name, values)) {
continue;
}
PropertyInfo pi = E->get();
PropertyInfo pi = E;
if (checking) {
pi.usage |= PROPERTY_USAGE_CHECKABLE;
if (checked.has(E->get().name)) {
if (checked.has(E.name)) {
pi.usage |= PROPERTY_USAGE_CHECKED;
}
}
@ -111,18 +111,18 @@ void ImportDock::set_edit_path(const String &p_path) {
ResourceFormatImporter::get_singleton()->get_importers_for_extension(p_path.get_extension(), &importers);
List<Pair<String, String>> importer_names;
for (List<Ref<ResourceImporter>>::Element *E = importers.front(); E; E = E->next()) {
importer_names.push_back(Pair<String, String>(E->get()->get_visible_name(), E->get()->get_importer_name()));
for (Ref<ResourceImporter> E : importers) {
importer_names.push_back(Pair<String, String>(E->get_visible_name(), E->get_importer_name()));
}
importer_names.sort_custom<PairSort<String, String>>();
import_as->clear();
for (List<Pair<String, String>>::Element *E = importer_names.front(); E; E = E->next()) {
import_as->add_item(E->get().first);
import_as->set_item_metadata(import_as->get_item_count() - 1, E->get().second);
if (E->get().second == importer_name) {
for (Pair<String, String> &E : importer_names) {
import_as->add_item(E.first);
import_as->set_item_metadata(import_as->get_item_count() - 1, E.second);
if (E.second == importer_name) {
import_as->select(import_as->get_item_count() - 1);
}
}
@ -153,12 +153,12 @@ void ImportDock::_update_options(const Ref<ConfigFile> &p_config) {
params->checking = params->paths.size() > 1;
params->checked.clear();
for (List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) {
params->properties.push_back(E->get().option);
if (p_config.is_valid() && p_config->has_section_key("params", E->get().option.name)) {
params->values[E->get().option.name] = p_config->get_value("params", E->get().option.name);
for (ResourceImporter::ImportOption &E : options) {
params->properties.push_back(E.option);
if (p_config.is_valid() && p_config->has_section_key("params", E.option.name)) {
params->values[E.option.name] = p_config->get_value("params", E.option.name);
} else {
params->values[E->get().option.name] = E->get().default_value;
params->values[E.option.name] = E.default_value;
}
}
@ -201,17 +201,17 @@ void ImportDock::set_edit_multiple_paths(const Vector<String> &p_paths) {
List<String> keys;
config->get_section_keys("params", &keys);
for (List<String>::Element *E = keys.front(); E; E = E->next()) {
if (!value_frequency.has(E->get())) {
value_frequency[E->get()] = Dictionary();
for (String &E : keys) {
if (!value_frequency.has(E)) {
value_frequency[E] = Dictionary();
}
Variant value = config->get_value("params", E->get());
Variant value = config->get_value("params", E);
if (value_frequency[E->get()].has(value)) {
value_frequency[E->get()][value] = int(value_frequency[E->get()][value]) + 1;
if (value_frequency[E].has(value)) {
value_frequency[E][value] = int(value_frequency[E][value]) + 1;
} else {
value_frequency[E->get()][value] = 1;
value_frequency[E][value] = 1;
}
}
}
@ -226,25 +226,25 @@ void ImportDock::set_edit_multiple_paths(const Vector<String> &p_paths) {
params->checking = true;
params->checked.clear();
for (List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) {
params->properties.push_back(E->get().option);
for (ResourceImporter::ImportOption &E : options) {
params->properties.push_back(E.option);
if (value_frequency.has(E->get().option.name)) {
Dictionary d = value_frequency[E->get().option.name];
if (value_frequency.has(E.option.name)) {
Dictionary d = value_frequency[E.option.name];
int freq = 0;
List<Variant> v;
d.get_key_list(&v);
Variant value;
for (List<Variant>::Element *F = v.front(); F; F = F->next()) {
int f = d[F->get()];
for (Variant &F : v) {
int f = d[F];
if (f > freq) {
value = F->get();
value = F;
}
}
params->values[E->get().option.name] = value;
params->values[E.option.name] = value;
} else {
params->values[E->get().option.name] = E->get().default_value;
params->values[E.option.name] = E.default_value;
}
}
@ -254,18 +254,18 @@ void ImportDock::set_edit_multiple_paths(const Vector<String> &p_paths) {
ResourceFormatImporter::get_singleton()->get_importers_for_extension(p_paths[0].get_extension(), &importers);
List<Pair<String, String>> importer_names;
for (List<Ref<ResourceImporter>>::Element *E = importers.front(); E; E = E->next()) {
importer_names.push_back(Pair<String, String>(E->get()->get_visible_name(), E->get()->get_importer_name()));
for (Ref<ResourceImporter> E : importers) {
importer_names.push_back(Pair<String, String>(E->get_visible_name(), E->get_importer_name()));
}
importer_names.sort_custom<PairSort<String, String>>();
import_as->clear();
for (List<Pair<String, String>>::Element *E = importer_names.front(); E; E = E->next()) {
import_as->add_item(E->get().first);
import_as->set_item_metadata(import_as->get_item_count() - 1, E->get().second);
if (E->get().second == params->importer->get_importer_name()) {
for (Pair<String, String> &E : importer_names) {
import_as->add_item(E.first);
import_as->set_item_metadata(import_as->get_item_count() - 1, E.second);
if (E.second == params->importer->get_importer_name()) {
import_as->select(import_as->get_item_count() - 1);
}
}
@ -345,8 +345,8 @@ void ImportDock::_preset_selected(int p_idx) {
case ITEM_SET_AS_DEFAULT: {
Dictionary d;
for (const List<PropertyInfo>::Element *E = params->properties.front(); E; E = E->next()) {
d[E->get().name] = params->values[E->get().name];
for (const PropertyInfo &E : params->properties) {
d[E.name] = params->values[E.name];
}
ProjectSettings::get_singleton()->set("importer_defaults/" + params->importer->get_importer_name(), d);
@ -363,10 +363,10 @@ void ImportDock::_preset_selected(int p_idx) {
if (params->checking) {
params->checked.clear();
}
for (List<Variant>::Element *E = v.front(); E; E = E->next()) {
params->values[E->get()] = d[E->get()];
for (Variant &E : v) {
params->values[E] = d[E];
if (params->checking) {
params->checked.insert(E->get());
params->checked.insert(E);
}
}
params->update();
@ -384,10 +384,10 @@ void ImportDock::_preset_selected(int p_idx) {
if (params->checking) {
params->checked.clear();
}
for (List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) {
params->values[E->get().option.name] = E->get().default_value;
for (ResourceImporter::ImportOption &E : options) {
params->values[E.option.name] = E.default_value;
if (params->checking) {
params->checked.insert(E->get().option.name);
params->checked.insert(E.option.name);
}
}
params->update();
@ -486,9 +486,9 @@ void ImportDock::_reimport() {
if (params->checking && config->get_value("remap", "importer") == params->importer->get_importer_name()) {
//update only what is edited (checkboxes) if the importer is the same
for (List<PropertyInfo>::Element *E = params->properties.front(); E; E = E->next()) {
if (params->checked.has(E->get().name)) {
config->set_value("params", E->get().name, params->values[E->get().name]);
for (PropertyInfo &E : params->properties) {
if (params->checked.has(E.name)) {
config->set_value("params", E.name, params->values[E.name]);
}
}
} else {
@ -498,8 +498,8 @@ void ImportDock::_reimport() {
config->erase_section("params");
}
for (List<PropertyInfo>::Element *E = params->properties.front(); E; E = E->next()) {
config->set_value("params", E->get().name, params->values[E->get().name]);
for (PropertyInfo &E : params->properties) {
config->set_value("params", E.name, params->values[E.name]);
}
}

View File

@ -87,12 +87,12 @@ void InspectorDock::_menu_option(int p_option) {
List<PropertyInfo> props;
current->get_property_list(&props);
Map<RES, RES> duplicates;
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) {
for (PropertyInfo &E : props) {
if (!(E.usage & PROPERTY_USAGE_STORAGE)) {
continue;
}
Variant v = current->get(E->get().name);
Variant v = current->get(E.name);
if (v.is_ref()) {
REF ref = v;
if (ref.is_valid()) {
@ -103,8 +103,8 @@ void InspectorDock::_menu_option(int p_option) {
}
res = duplicates[res];
current->set(E->get().name, res);
editor->get_inspector()->update_property(E->get().name);
current->set(E.name, res);
editor->get_inspector()->update_property(E.name);
}
}
}

View File

@ -43,15 +43,15 @@ void LocalizationEditor::_notification(int p_what) {
List<String> tfn;
ResourceLoader::get_recognized_extensions_for_type("Translation", &tfn);
for (List<String>::Element *E = tfn.front(); E; E = E->next()) {
translation_file_open->add_filter("*." + E->get());
for (String &E : tfn) {
translation_file_open->add_filter("*." + E);
}
List<String> rfn;
ResourceLoader::get_recognized_extensions_for_type("Resource", &rfn);
for (List<String>::Element *E = rfn.front(); E; E = E->next()) {
translation_res_file_open_dialog->add_filter("*." + E->get());
translation_res_option_file_open_dialog->add_filter("*." + E->get());
for (String &E : rfn) {
translation_res_file_open_dialog->add_filter("*." + E);
translation_res_option_file_open_dialog->add_filter("*." + E);
}
_update_pot_file_extensions();
@ -430,8 +430,8 @@ void LocalizationEditor::_update_pot_file_extensions() {
pot_file_open_dialog->clear_filters();
List<String> translation_parse_file_extensions;
EditorTranslationParser::get_singleton()->get_recognized_extensions(&translation_parse_file_extensions);
for (List<String>::Element *E = translation_parse_file_extensions.front(); E; E = E->next()) {
pot_file_open_dialog->add_filter("*." + E->get());
for (String &E : translation_parse_file_extensions) {
pot_file_open_dialog->add_filter("*." + E);
}
}
@ -560,8 +560,8 @@ void LocalizationEditor::update_translations() {
List<Variant> rk;
remaps.get_key_list(&rk);
Vector<String> keys;
for (List<Variant>::Element *E = rk.front(); E; E = E->next()) {
keys.push_back(E->get());
for (Variant &E : rk) {
keys.push_back(E);
}
keys.sort();

View File

@ -52,12 +52,12 @@ bool MultiNodeEdit::_set_impl(const StringName &p_name, const Variant &p_value,
UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("MultiNode Set") + " " + String(name), UndoRedo::MERGE_ENDS);
for (const List<NodePath>::Element *E = nodes.front(); E; E = E->next()) {
if (!es->has_node(E->get())) {
for (const NodePath &E : nodes) {
if (!es->has_node(E)) {
continue;
}
Node *n = es->get_node(E->get());
Node *n = es->get_node(E);
if (!n) {
continue;
}
@ -98,12 +98,12 @@ bool MultiNodeEdit::_get(const StringName &p_name, Variant &r_ret) const {
name = "script";
}
for (const List<NodePath>::Element *E = nodes.front(); E; E = E->next()) {
if (!es->has_node(E->get())) {
for (const NodePath &E : nodes) {
if (!es->has_node(E)) {
continue;
}
const Node *n = es->get_node(E->get());
const Node *n = es->get_node(E);
if (!n) {
continue;
}
@ -130,12 +130,12 @@ void MultiNodeEdit::_get_property_list(List<PropertyInfo> *p_list) const {
List<PLData *> data_list;
for (const List<NodePath>::Element *E = nodes.front(); E; E = E->next()) {
if (!es->has_node(E->get())) {
for (const NodePath &E : nodes) {
if (!es->has_node(E)) {
continue;
}
Node *n = es->get_node(E->get());
Node *n = es->get_node(E);
if (!n) {
continue;
}
@ -143,30 +143,30 @@ void MultiNodeEdit::_get_property_list(List<PropertyInfo> *p_list) const {
List<PropertyInfo> plist;
n->get_property_list(&plist, true);
for (List<PropertyInfo>::Element *F = plist.front(); F; F = F->next()) {
if (F->get().name == "script") {
for (PropertyInfo &F : plist) {
if (F.name == "script") {
continue; //added later manually, since this is intercepted before being set (check Variant Object::get() )
}
if (!usage.has(F->get().name)) {
if (!usage.has(F.name)) {
PLData pld;
pld.uses = 0;
pld.info = F->get();
usage[F->get().name] = pld;
data_list.push_back(usage.getptr(F->get().name));
pld.info = F;
usage[F.name] = pld;
data_list.push_back(usage.getptr(F.name));
}
// Make sure only properties with the same exact PropertyInfo data will appear
if (usage[F->get().name].info == F->get()) {
usage[F->get().name].uses++;
if (usage[F.name].info == F) {
usage[F.name].uses++;
}
}
nc++;
}
for (List<PLData *>::Element *E = data_list.front(); E; E = E->next()) {
if (nc == E->get()->uses) {
p_list->push_back(E->get()->info);
for (PLData *E : data_list) {
if (nc == E->uses) {
p_list->push_back(E->info);
}
}

View File

@ -72,22 +72,22 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEven
List<StringName> names;
ap->get_animation_list(&names);
for (List<StringName>::Element *E = names.front(); E; E = E->next()) {
animations_menu->add_icon_item(get_theme_icon(SNAME("Animation"), SNAME("EditorIcons")), E->get());
animations_to_add.push_back(E->get());
for (StringName &E : names) {
animations_menu->add_icon_item(get_theme_icon(SNAME("Animation"), SNAME("EditorIcons")), E);
animations_to_add.push_back(E);
}
}
}
for (List<StringName>::Element *E = classes.front(); E; E = E->next()) {
String name = String(E->get()).replace_first("AnimationNode", "");
for (StringName &E : classes) {
String name = String(E).replace_first("AnimationNode", "");
if (name == "Animation") {
continue;
}
int idx = menu->get_item_count();
menu->add_item(vformat("Add %s", name), idx);
menu->set_item_metadata(idx, E->get());
menu->set_item_metadata(idx, E);
}
Ref<AnimationNode> clipb = EditorSettings::get_singleton()->get_resource_clipboard();
@ -373,8 +373,8 @@ void AnimationNodeBlendSpace1DEditor::_add_menu_type(int p_index) {
open_file->clear_filters();
List<String> filters;
ResourceLoader::get_recognized_extensions_for_type("AnimationRootNode", &filters);
for (List<String>::Element *E = filters.front(); E; E = E->next()) {
open_file->add_filter("*." + E->get());
for (String &E : filters) {
open_file->add_filter("*." + E);
}
open_file->popup_file_dialog();
return;

View File

@ -96,21 +96,21 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_gui_input(const Ref<InputEven
if (ap) {
List<StringName> names;
ap->get_animation_list(&names);
for (List<StringName>::Element *E = names.front(); E; E = E->next()) {
animations_menu->add_icon_item(get_theme_icon(SNAME("Animation"), SNAME("EditorIcons")), E->get());
animations_to_add.push_back(E->get());
for (StringName &E : names) {
animations_menu->add_icon_item(get_theme_icon(SNAME("Animation"), SNAME("EditorIcons")), E);
animations_to_add.push_back(E);
}
}
}
for (List<StringName>::Element *E = classes.front(); E; E = E->next()) {
String name = String(E->get()).replace_first("AnimationNode", "");
for (StringName &E : classes) {
String name = String(E).replace_first("AnimationNode", "");
if (name == "Animation") {
continue; // nope
}
int idx = menu->get_item_count();
menu->add_item(vformat("Add %s", name), idx);
menu->set_item_metadata(idx, E->get());
menu->set_item_metadata(idx, E);
}
Ref<AnimationNode> clipb = EditorSettings::get_singleton()->get_resource_clipboard();
@ -295,8 +295,8 @@ void AnimationNodeBlendSpace2DEditor::_add_menu_type(int p_index) {
open_file->clear_filters();
List<String> filters;
ResourceLoader::get_recognized_extensions_for_type("AnimationRootNode", &filters);
for (List<String>::Element *E = filters.front(); E; E = E->next()) {
open_file->add_filter("*." + E->get());
for (String &E : filters) {
open_file->add_filter("*." + E);
}
open_file->popup_file_dialog();
return;

View File

@ -121,21 +121,21 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
List<StringName> nodes;
blend_tree->get_node_list(&nodes);
for (List<StringName>::Element *E = nodes.front(); E; E = E->next()) {
for (StringName &E : nodes) {
GraphNode *node = memnew(GraphNode);
graph->add_child(node);
Ref<AnimationNode> agnode = blend_tree->get_node(E->get());
Ref<AnimationNode> agnode = blend_tree->get_node(E);
node->set_position_offset(blend_tree->get_node_position(E->get()) * EDSCALE);
node->set_position_offset(blend_tree->get_node_position(E) * EDSCALE);
node->set_title(agnode->get_caption());
node->set_name(E->get());
node->set_name(E);
int base = 0;
if (String(E->get()) != "output") {
if (String(E) != "output") {
LineEdit *name = memnew(LineEdit);
name->set_text(E->get());
name->set_text(E);
name->set_expand_to_text_length_enabled(true);
node->add_child(name);
node->set_slot(0, false, 0, Color(), true, 0, get_theme_color(SNAME("font_color"), SNAME("Label")));
@ -143,7 +143,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
name->connect("focus_exited", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_renamed_focus_out), varray(name, agnode), CONNECT_DEFERRED);
base = 1;
node->set_show_close_button(true);
node->connect("close_request", callable_mp(this, &AnimationNodeBlendTreeEditor::_delete_request), varray(E->get()), CONNECT_DEFERRED);
node->connect("close_request", callable_mp(this, &AnimationNodeBlendTreeEditor::_delete_request), varray(E), CONNECT_DEFERRED);
}
for (int i = 0; i < agnode->get_input_count(); i++) {
@ -155,12 +155,12 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
List<PropertyInfo> pinfo;
agnode->get_parameter_list(&pinfo);
for (List<PropertyInfo>::Element *F = pinfo.front(); F; F = F->next()) {
if (!(F->get().usage & PROPERTY_USAGE_EDITOR)) {
for (PropertyInfo &F : pinfo) {
if (!(F.usage & PROPERTY_USAGE_EDITOR)) {
continue;
}
String base_path = AnimationTreeEditor::get_singleton()->get_base_path() + String(E->get()) + "/" + F->get().name;
EditorProperty *prop = EditorInspector::instantiate_property_editor(AnimationTreeEditor::get_singleton()->get_tree(), F->get().type, base_path, F->get().hint, F->get().hint_string, F->get().usage);
String base_path = AnimationTreeEditor::get_singleton()->get_base_path() + String(E) + "/" + F.name;
EditorProperty *prop = EditorInspector::instantiate_property_editor(AnimationTreeEditor::get_singleton()->get_tree(), F.type, base_path, F.hint, F.hint_string, F.usage);
if (prop) {
prop->set_object_and_property(AnimationTreeEditor::get_singleton()->get_tree(), base_path);
prop->update_property();
@ -171,7 +171,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
}
}
node->connect("dragged", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_dragged), varray(E->get()));
node->connect("dragged", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_dragged), varray(E));
if (AnimationTreeEditor::get_singleton()->can_edit(agnode)) {
node->add_child(memnew(HSeparator));
@ -179,7 +179,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
open_in_editor->set_text(TTR("Open Editor"));
open_in_editor->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
node->add_child(open_in_editor);
open_in_editor->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_open_in_editor), varray(E->get()), CONNECT_DEFERRED);
open_in_editor->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_open_in_editor), varray(E), CONNECT_DEFERRED);
open_in_editor->set_h_size_flags(SIZE_SHRINK_CENTER);
}
@ -189,7 +189,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
edit_filters->set_text(TTR("Edit Filters"));
edit_filters->set_icon(get_theme_icon(SNAME("AnimationFilter"), SNAME("EditorIcons")));
node->add_child(edit_filters);
edit_filters->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_edit_filters), varray(E->get()), CONNECT_DEFERRED);
edit_filters->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_edit_filters), varray(E), CONNECT_DEFERRED);
edit_filters->set_h_size_flags(SIZE_SHRINK_CENTER);
}
@ -212,9 +212,9 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
List<StringName> anims;
ap->get_animation_list(&anims);
for (List<StringName>::Element *F = anims.front(); F; F = F->next()) {
mb->get_popup()->add_item(F->get());
options.push_back(F->get());
for (StringName &F : anims) {
mb->get_popup()->add_item(F);
options.push_back(F);
}
if (ap->has_animation(anim->get_animation())) {
@ -225,10 +225,10 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
pb->set_percent_visible(false);
pb->set_custom_minimum_size(Vector2(0, 14) * EDSCALE);
animations[E->get()] = pb;
animations[E] = pb;
node->add_child(pb);
mb->get_popup()->connect("index_pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_anim_selected), varray(options, E->get()), CONNECT_DEFERRED);
mb->get_popup()->connect("index_pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_anim_selected), varray(options, E), CONNECT_DEFERRED);
}
Ref<StyleBoxFlat> sb = node->get_theme_stylebox(SNAME("frame"), SNAME("GraphNode"));
@ -246,10 +246,10 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
List<AnimationNodeBlendTree::NodeConnection> connections;
blend_tree->get_node_connections(&connections);
for (List<AnimationNodeBlendTree::NodeConnection>::Element *E = connections.front(); E; E = E->next()) {
StringName from = E->get().output_node;
StringName to = E->get().input_node;
int to_idx = E->get().input_index;
for (AnimationNodeBlendTree::NodeConnection &E : connections) {
StringName from = E.output_node;
StringName to = E.input_node;
int to_idx = E.input_index;
graph->connect_node(from, 0, to, to_idx);
}
@ -274,8 +274,8 @@ void AnimationNodeBlendTreeEditor::_add_node(int p_idx) {
open_file->clear_filters();
List<String> filters;
ResourceLoader::get_recognized_extensions_for_type("AnimationNode", &filters);
for (List<String>::Element *E = filters.front(); E; E = E->next()) {
open_file->add_filter("*." + E->get());
for (String &E : filters) {
open_file->add_filter("*." + E);
}
open_file->popup_file_dialog();
return;
@ -394,9 +394,9 @@ void AnimationNodeBlendTreeEditor::_delete_request(const String &p_which) {
List<AnimationNodeBlendTree::NodeConnection> conns;
blend_tree->get_node_connections(&conns);
for (List<AnimationNodeBlendTree::NodeConnection>::Element *E = conns.front(); E; E = E->next()) {
if (E->get().output_node == p_which || E->get().input_node == p_which) {
undo_redo->add_undo_method(blend_tree.ptr(), "connect_node", E->get().input_node, E->get().input_index, E->get().output_node);
for (AnimationNodeBlendTree::NodeConnection &E : conns) {
if (E.output_node == p_which || E.input_node == p_which) {
undo_redo->add_undo_method(blend_tree.ptr(), "connect_node", E.input_node, E.input_index, E.output_node);
}
}
@ -423,8 +423,8 @@ void AnimationNodeBlendTreeEditor::_delete_nodes_request() {
undo_redo->create_action(TTR("Delete Node(s)"));
for (List<StringName>::Element *F = to_erase.front(); F; F = F->next()) {
_delete_request(F->get());
for (StringName &F : to_erase) {
_delete_request(F);
}
undo_redo->commit_action();
@ -517,8 +517,8 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano
List<StringName> animations;
player->get_animation_list(&animations);
for (List<StringName>::Element *E = animations.front(); E; E = E->next()) {
Ref<Animation> anim = player->get_animation(E->get());
for (StringName &E : animations) {
Ref<Animation> anim = player->get_animation(E);
for (int i = 0; i < anim->get_track_count(); i++) {
String track_path = anim->track_get_path(i);
paths.insert(track_path);
@ -718,13 +718,13 @@ void AnimationNodeBlendTreeEditor::_notification(int p_what) {
List<AnimationNodeBlendTree::NodeConnection> conns;
blend_tree->get_node_connections(&conns);
for (List<AnimationNodeBlendTree::NodeConnection>::Element *E = conns.front(); E; E = E->next()) {
for (AnimationNodeBlendTree::NodeConnection &E : conns) {
float activity = 0;
StringName path = AnimationTreeEditor::get_singleton()->get_base_path() + E->get().input_node;
StringName path = AnimationTreeEditor::get_singleton()->get_base_path() + E.input_node;
if (AnimationTreeEditor::get_singleton()->get_tree() && !AnimationTreeEditor::get_singleton()->get_tree()->is_state_invalid()) {
activity = AnimationTreeEditor::get_singleton()->get_tree()->get_connection_activity(path, E->get().input_index);
activity = AnimationTreeEditor::get_singleton()->get_tree()->get_connection_activity(path, E.input_index);
}
graph->set_connection_activity(E->get().output_node, 0, E->get().input_node, E->get().input_index, activity);
graph->set_connection_activity(E.output_node, 0, E.input_node, E.input_index, activity);
}
AnimationTree *graph_player = AnimationTreeEditor::get_singleton()->get_tree();
@ -741,7 +741,7 @@ void AnimationNodeBlendTreeEditor::_notification(int p_what) {
Ref<Animation> anim = player->get_animation(an->get_animation());
if (anim.is_valid()) {
E->get()->set_max(anim->get_length());
//StringName path = AnimationTreeEditor::get_singleton()->get_base_path() + E->get().input_node;
//StringName path = AnimationTreeEditor::get_singleton()->get_base_path() + E.input_node;
StringName time_path = AnimationTreeEditor::get_singleton()->get_base_path() + String(E->key()) + "/time";
E->get()->set_value(AnimationTreeEditor::get_singleton()->get_tree()->get(time_path));
}
@ -828,10 +828,10 @@ void AnimationNodeBlendTreeEditor::_node_renamed(const String &p_text, Ref<Anima
List<AnimationNodeBlendTree::NodeConnection> connections;
blend_tree->get_node_connections(&connections);
for (List<AnimationNodeBlendTree::NodeConnection>::Element *E = connections.front(); E; E = E->next()) {
StringName from = E->get().output_node;
StringName to = E->get().input_node;
int to_idx = E->get().input_index;
for (AnimationNodeBlendTree::NodeConnection &E : connections) {
StringName from = E.output_node;
StringName to = E.input_node;
int to_idx = E.input_index;
graph->connect_node(from, 0, to, to_idx);
}

View File

@ -350,8 +350,8 @@ void AnimationPlayerEditor::_animation_load() {
List<String> extensions;
ResourceLoader::get_recognized_extensions_for_type("Animation", &extensions);
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
file->add_filter("*." + E->get() + " ; " + E->get().to_upper());
for (String &E : extensions) {
file->add_filter("*." + E + " ; " + E.to_upper());
}
file->popup_file_dialog();
@ -584,8 +584,7 @@ void AnimationPlayerEditor::_animation_blend() {
blend_editor.next->clear();
blend_editor.next->add_item("", i);
for (List<StringName>::Element *E = anims.front(); E; E = E->next()) {
String to = E->get();
for (StringName &to : anims) {
TreeItem *blend = blend_editor.tree->create_item(root);
blend->set_editable(0, false);
blend->set_editable(1, true);
@ -830,20 +829,20 @@ void AnimationPlayerEditor::_update_player() {
}
int active_idx = -1;
for (List<StringName>::Element *E = animlist.front(); E; E = E->next()) {
for (StringName &E : animlist) {
Ref<Texture2D> icon;
if (E->get() == player->get_autoplay()) {
if (E->get() == "RESET") {
if (E == player->get_autoplay()) {
if (E == "RESET") {
icon = autoplay_reset_icon;
} else {
icon = autoplay_icon;
}
} else if (E->get() == "RESET") {
} else if (E == "RESET") {
icon = reset_icon;
}
animation->add_icon_item(icon, E->get());
animation->add_icon_item(icon, E);
if (player->get_assigned_animation() == E->get()) {
if (player->get_assigned_animation() == E) {
active_idx = animation->get_item_count() - 1;
}
}
@ -966,9 +965,9 @@ void AnimationPlayerEditor::_animation_duplicate() {
Ref<Animation> new_anim = memnew(Animation);
List<PropertyInfo> plist;
anim->get_property_list(&plist);
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
if (E->get().usage & PROPERTY_USAGE_STORAGE) {
new_anim->set(E->get().name, anim->get(E->get().name));
for (PropertyInfo &E : plist) {
if (E.usage & PROPERTY_USAGE_STORAGE) {
new_anim->set(E.name, anim->get(E.name));
}
}
new_anim->set_path("");

View File

@ -93,21 +93,21 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv
if (ap) {
List<StringName> names;
ap->get_animation_list(&names);
for (List<StringName>::Element *E = names.front(); E; E = E->next()) {
animations_menu->add_icon_item(get_theme_icon(SNAME("Animation"), SNAME("EditorIcons")), E->get());
animations_to_add.push_back(E->get());
for (StringName &E : names) {
animations_menu->add_icon_item(get_theme_icon(SNAME("Animation"), SNAME("EditorIcons")), E);
animations_to_add.push_back(E);
}
}
}
for (List<StringName>::Element *E = classes.front(); E; E = E->next()) {
String name = String(E->get()).replace_first("AnimationNode", "");
for (StringName &E : classes) {
String name = String(E).replace_first("AnimationNode", "");
if (name == "Animation") {
continue; // nope
}
int idx = menu->get_item_count();
menu->add_item(vformat("Add %s", name), idx);
menu->set_item_metadata(idx, E->get());
menu->set_item_metadata(idx, E);
}
Ref<AnimationNode> clipb = EditorSettings::get_singleton()->get_resource_clipboard();
@ -318,24 +318,24 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv
float best_d_x = 1e20;
float best_d_y = 1e20;
for (List<StringName>::Element *E = nodes.front(); E; E = E->next()) {
if (E->get() == selected_node) {
for (StringName &E : nodes) {
if (E == selected_node) {
continue;
}
Vector2 npos = state_machine->get_node_position(E->get());
Vector2 npos = state_machine->get_node_position(E);
float d_x = ABS(npos.x - cpos.x);
if (d_x < MIN(5, best_d_x)) {
drag_ofs.x -= cpos.x - npos.x;
best_d_x = d_x;
snap_x = E->get();
snap_x = E;
}
float d_y = ABS(npos.y - cpos.y);
if (d_y < MIN(5, best_d_y)) {
drag_ofs.y -= cpos.y - npos.y;
best_d_y = d_y;
snap_y = E->get();
snap_y = E;
}
}
}
@ -409,8 +409,8 @@ void AnimationNodeStateMachineEditor::_add_menu_type(int p_index) {
open_file->clear_filters();
List<String> filters;
ResourceLoader::get_recognized_extensions_for_type("AnimationRootNode", &filters);
for (List<String>::Element *E = filters.front(); E; E = E->next()) {
open_file->add_filter("*." + E->get());
for (String &E : filters) {
open_file->add_filter("*." + E);
}
open_file->popup_file_dialog();
return;
@ -606,11 +606,11 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() {
}
//pre pass nodes so we know the rectangles
for (List<StringName>::Element *E = nodes.front(); E; E = E->next()) {
Ref<AnimationNode> anode = state_machine->get_node(E->get());
String name = E->get();
for (StringName &E : nodes) {
Ref<AnimationNode> anode = state_machine->get_node(E);
String name = E;
bool needs_editor = EditorNode::get_singleton()->item_has_editor(anode.ptr());
Ref<StyleBox> sb = E->get() == selected_node ? style_selected : style;
Ref<StyleBox> sb = E == selected_node ? style_selected : style;
Size2 s = sb->get_minimum_size();
int strsize = font->get_string_size(name, font_size).width;
@ -622,8 +622,8 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() {
}
Vector2 offset;
offset += state_machine->get_node_position(E->get()) * EDSCALE;
if (selected_node == E->get() && dragging_selected) {
offset += state_machine->get_node_position(E) * EDSCALE;
if (selected_node == E && dragging_selected) {
offset += drag_ofs;
}
offset -= s / 2;
@ -633,7 +633,7 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() {
NodeRect nr;
nr.node = Rect2(offset, s);
nr.node_name = E->get();
nr.node_name = E;
scroll_range = scroll_range.merge(nr.node); //merge with range

View File

@ -215,8 +215,8 @@ Vector<String> AnimationTreeEditor::get_animation_list() {
List<StringName> anims;
ap->get_animation_list(&anims);
Vector<String> ret;
for (List<StringName>::Element *E = anims.front(); E; E = E->next()) {
ret.push_back(E->get());
for (StringName &E : anims) {
ret.push_back(E);
}
return ret;

View File

@ -607,7 +607,7 @@ void EditorAssetLibrary::_update_repository_options() {
Dictionary available_urls = _EDITOR_DEF("asset_library/available_urls", default_urls, true);
repository->clear();
Array keys = available_urls.keys();
for (int i = 0; i < available_urls.size(); i++) {
for (int i = 0; i < keys.size(); i++) {
String key = keys[i];
repository->add_item(key);
repository->set_item_metadata(i, available_urls[key]);

View File

@ -301,8 +301,8 @@ void CanvasItemEditor::_snap_other_nodes(
// Check if the element is in the exception
bool exception = false;
for (List<const CanvasItem *>::Element *E = p_exceptions.front(); E; E = E->next()) {
if (E->get() == p_current) {
for (const CanvasItem *&E : p_exceptions) {
if (E == p_current) {
exception = true;
break;
}
@ -399,8 +399,8 @@ Point2 CanvasItemEditor::snap_point(Point2 p_target, unsigned int p_modes, unsig
if ((is_snap_active && snap_other_nodes && (p_modes & SNAP_OTHER_NODES)) || (p_forced_modes & SNAP_OTHER_NODES)) {
Transform2D to_snap_transform = Transform2D();
List<const CanvasItem *> exceptions = List<const CanvasItem *>();
for (List<CanvasItem *>::Element *E = p_other_nodes_exceptions.front(); E; E = E->next()) {
exceptions.push_back(E->get());
for (CanvasItem *E : p_other_nodes_exceptions) {
exceptions.push_back(E);
}
if (p_self_canvas_item) {
exceptions.push_back(p_self_canvas_item);
@ -527,8 +527,7 @@ Rect2 CanvasItemEditor::_get_encompassing_rect_from_list(List<CanvasItem *> p_li
Rect2 rect = Rect2(canvas_item->get_global_transform_with_canvas().xform(canvas_item->_edit_get_rect().position + canvas_item->_edit_get_rect().size / 2), Size2());
// Expand with the other ones
for (List<CanvasItem *>::Element *E = p_list.front(); E; E = E->next()) {
CanvasItem *canvas_item2 = E->get();
for (CanvasItem *canvas_item2 : p_list) {
Transform2D xform = canvas_item2->get_global_transform_with_canvas();
Rect2 current_rect = canvas_item2->_edit_get_rect();
@ -760,9 +759,9 @@ List<CanvasItem *> CanvasItemEditor::_get_edited_canvas_items(bool retreive_lock
if (remove_canvas_item_if_parent_in_selection) {
List<CanvasItem *> filtered_selection;
for (List<CanvasItem *>::Element *E = selection.front(); E; E = E->next()) {
if (!selection.find(E->get()->get_parent())) {
filtered_selection.push_back(E->get());
for (CanvasItem *E : selection) {
if (!selection.find(E->get_parent())) {
filtered_selection.push_back(E);
}
}
return filtered_selection;
@ -800,8 +799,7 @@ Vector2 CanvasItemEditor::_position_to_anchor(const Control *p_control, Vector2
}
void CanvasItemEditor::_save_canvas_item_state(List<CanvasItem *> p_canvas_items, bool save_bones) {
for (List<CanvasItem *>::Element *E = p_canvas_items.front(); E; E = E->next()) {
CanvasItem *canvas_item = E->get();
for (CanvasItem *canvas_item : p_canvas_items) {
CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (se) {
se->undo_state = canvas_item->_edit_get_state();
@ -816,8 +814,7 @@ void CanvasItemEditor::_save_canvas_item_state(List<CanvasItem *> p_canvas_items
}
void CanvasItemEditor::_restore_canvas_item_state(List<CanvasItem *> p_canvas_items, bool restore_bones) {
for (List<CanvasItem *>::Element *E = drag_selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = E->get();
for (CanvasItem *canvas_item : drag_selection) {
CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
canvas_item->_edit_set_state(se->undo_state);
}
@ -825,8 +822,7 @@ void CanvasItemEditor::_restore_canvas_item_state(List<CanvasItem *> p_canvas_it
void CanvasItemEditor::_commit_canvas_item_state(List<CanvasItem *> p_canvas_items, String action_name, bool commit_bones) {
List<CanvasItem *> modified_canvas_items;
for (List<CanvasItem *>::Element *E = p_canvas_items.front(); E; E = E->next()) {
CanvasItem *canvas_item = E->get();
for (CanvasItem *canvas_item : p_canvas_items) {
Dictionary old_state = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item)->undo_state;
Dictionary new_state = canvas_item->_edit_get_state();
@ -840,17 +836,16 @@ void CanvasItemEditor::_commit_canvas_item_state(List<CanvasItem *> p_canvas_ite
}
undo_redo->create_action(action_name);
for (List<CanvasItem *>::Element *E = modified_canvas_items.front(); E; E = E->next()) {
CanvasItem *canvas_item = E->get();
for (CanvasItem *canvas_item : modified_canvas_items) {
CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (se) {
undo_redo->add_do_method(canvas_item, "_edit_set_state", canvas_item->_edit_get_state());
undo_redo->add_undo_method(canvas_item, "_edit_set_state", se->undo_state);
if (commit_bones) {
for (List<Dictionary>::Element *F = se->pre_drag_bones_undo_state.front(); F; F = F->next()) {
for (Dictionary &F : se->pre_drag_bones_undo_state) {
canvas_item = Object::cast_to<CanvasItem>(canvas_item->get_parent());
undo_redo->add_do_method(canvas_item, "_edit_set_state", canvas_item->_edit_get_state());
undo_redo->add_undo_method(canvas_item, "_edit_set_state", F->get());
undo_redo->add_undo_method(canvas_item, "_edit_set_state", F);
}
}
}
@ -1304,8 +1299,7 @@ bool CanvasItemEditor::_gui_input_pivot(const Ref<InputEvent> &p_event) {
// Filters the selection with nodes that allow setting the pivot
drag_selection = List<CanvasItem *>();
for (List<CanvasItem *>::Element *E = selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = E->get();
for (CanvasItem *canvas_item : selection) {
if (canvas_item->_edit_use_pivot()) {
drag_selection.push_back(canvas_item);
}
@ -1321,8 +1315,7 @@ bool CanvasItemEditor::_gui_input_pivot(const Ref<InputEvent> &p_event) {
} else {
new_pos = snap_point(drag_from, SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL, 0, nullptr, drag_selection);
}
for (List<CanvasItem *>::Element *E = drag_selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = E->get();
for (CanvasItem *canvas_item : drag_selection) {
canvas_item->_edit_set_pivot(canvas_item->get_global_transform_with_canvas().affine_inverse().xform(new_pos));
}
@ -1343,8 +1336,7 @@ bool CanvasItemEditor::_gui_input_pivot(const Ref<InputEvent> &p_event) {
} else {
new_pos = snap_point(drag_to, SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL);
}
for (List<CanvasItem *>::Element *E = drag_selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = E->get();
for (CanvasItem *canvas_item : drag_selection) {
canvas_item->_edit_set_pivot(canvas_item->get_global_transform_with_canvas().affine_inverse().xform(new_pos));
}
return true;
@ -1387,8 +1379,8 @@ bool CanvasItemEditor::_gui_input_rotate(const Ref<InputEvent> &p_event) {
List<CanvasItem *> selection = _get_edited_canvas_items();
// Remove not movable nodes
for (List<CanvasItem *>::Element *E = selection.front(); E; E = E->next()) {
if (!_is_node_movable(E->get(), true)) {
for (CanvasItem *E : selection) {
if (!_is_node_movable(E, true)) {
selection.erase(E);
}
}
@ -1414,8 +1406,7 @@ bool CanvasItemEditor::_gui_input_rotate(const Ref<InputEvent> &p_event) {
// Rotate the node
if (m.is_valid()) {
_restore_canvas_item_state(drag_selection);
for (List<CanvasItem *>::Element *E = drag_selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = E->get();
for (CanvasItem *canvas_item : drag_selection) {
drag_to = transform.affine_inverse().xform(m->get_position());
//Rotate the opposite way if the canvas item's compounded scale has an uneven number of negative elements
bool opposite = (canvas_item->get_global_transform().get_scale().sign().dot(canvas_item->get_transform().get_scale().sign()) == 0);
@ -2046,8 +2037,7 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) {
}
int index = 0;
for (List<CanvasItem *>::Element *E = drag_selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = E->get();
for (CanvasItem *canvas_item : drag_selection) {
Transform2D xform = canvas_item->get_global_transform_with_canvas().affine_inverse() * canvas_item->get_transform();
canvas_item->_edit_set_position(canvas_item->_edit_get_position() + xform.xform(new_pos) - xform.xform(previous_pos));
@ -2162,8 +2152,7 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) {
}
int index = 0;
for (List<CanvasItem *>::Element *E = drag_selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = E->get();
for (CanvasItem *canvas_item : drag_selection) {
Transform2D xform = canvas_item->get_global_transform_with_canvas().affine_inverse() * canvas_item->get_transform();
canvas_item->_edit_set_position(canvas_item->_edit_get_position() + xform.xform(new_pos) - xform.xform(previous_pos));
@ -2375,8 +2364,8 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) {
if (selitems.size() == 1 && editor_selection->get_selected_node_list().is_empty()) {
editor->push_item(selitems[0]);
}
for (List<CanvasItem *>::Element *E = selitems.front(); E; E = E->next()) {
editor_selection->add_node(E->get());
for (CanvasItem *E : selitems) {
editor_selection->add_node(E);
}
}
@ -3248,8 +3237,8 @@ void CanvasItemEditor::_draw_selection() {
List<CanvasItem *> selection = _get_edited_canvas_items(true, false);
bool single = selection.size() == 1;
for (List<CanvasItem *>::Element *E = selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E->get());
for (CanvasItem *E : selection) {
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E);
CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
bool item_locked = canvas_item->has_meta("_edit_lock_");
@ -3566,9 +3555,9 @@ void CanvasItemEditor::_draw_hover() {
Point2 pos = transform.xform(hovering_results[i].position) - Point2(0, item_size.y) + (Point2(node_icon->get_size().x, -node_icon->get_size().y) / 4);
// Rectify the position to avoid overlapping items
for (List<Rect2>::Element *E = previous_rects.front(); E; E = E->next()) {
if (E->get().intersects(Rect2(pos, item_size))) {
pos.y = E->get().get_position().y - item_size.y;
for (Rect2 &E : previous_rects) {
if (E.intersects(Rect2(pos, item_size))) {
pos.y = E.get_position().y - item_size.y;
}
}
@ -3642,14 +3631,14 @@ void CanvasItemEditor::_draw_viewport() {
all_locked = false;
all_group = false;
} else {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
if (Object::cast_to<CanvasItem>(E->get()) && !Object::cast_to<CanvasItem>(E->get())->has_meta("_edit_lock_")) {
for (Node *E : selection) {
if (Object::cast_to<CanvasItem>(E) && !Object::cast_to<CanvasItem>(E)->has_meta("_edit_lock_")) {
all_locked = false;
break;
}
}
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
if (Object::cast_to<CanvasItem>(E->get()) && !Object::cast_to<CanvasItem>(E->get())->has_meta("_edit_group_")) {
for (Node *E : selection) {
if (Object::cast_to<CanvasItem>(E) && !Object::cast_to<CanvasItem>(E)->has_meta("_edit_group_")) {
all_group = false;
break;
}
@ -3716,8 +3705,7 @@ void CanvasItemEditor::_notification(int p_what) {
// Update the viewport if the canvas_item changes
List<CanvasItem *> selection = _get_edited_canvas_items(true);
for (List<CanvasItem *>::Element *E = selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = E->get();
for (CanvasItem *canvas_item : selection) {
CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
Rect2 rect;
@ -3932,8 +3920,8 @@ void CanvasItemEditor::_selection_changed() {
int nbValidControls = 0;
int nbAnchorsMode = 0;
List<Node *> selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Control *control = Object::cast_to<Control>(E->get());
for (Node *E : selection) {
Control *control = Object::cast_to<Control>(E);
if (!control) {
continue;
}
@ -4101,8 +4089,8 @@ void CanvasItemEditor::_set_anchors_and_offsets_preset(Control::LayoutPreset p_p
undo_redo->create_action(TTR("Change Anchors and Offsets"));
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Control *control = Object::cast_to<Control>(E->get());
for (Node *E : selection) {
Control *control = Object::cast_to<Control>(E);
if (control) {
undo_redo->add_do_method(control, "set_anchors_preset", p_preset);
switch (p_preset) {
@ -4142,8 +4130,8 @@ void CanvasItemEditor::_set_anchors_and_offsets_to_keep_ratio() {
undo_redo->create_action(TTR("Change Anchors and Offsets"));
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Control *control = Object::cast_to<Control>(E->get());
for (Node *E : selection) {
Control *control = Object::cast_to<Control>(E);
if (control) {
Point2 top_left_anchor = _position_to_anchor(control, Point2());
Point2 bottom_right_anchor = _position_to_anchor(control, control->get_size());
@ -4169,8 +4157,8 @@ void CanvasItemEditor::_set_anchors_preset(Control::LayoutPreset p_preset) {
List<Node *> selection = editor_selection->get_selected_node_list();
undo_redo->create_action(TTR("Change Anchors"));
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Control *control = Object::cast_to<Control>(E->get());
for (Node *E : selection) {
Control *control = Object::cast_to<Control>(E);
if (control) {
undo_redo->add_do_method(control, "set_anchors_preset", p_preset);
undo_redo->add_undo_method(control, "_edit_set_state", control->_edit_get_state());
@ -4295,15 +4283,15 @@ void CanvasItemEditor::_insert_animation_keys(bool p_location, bool p_rotation,
}
if (has_chain && ik_chain.size()) {
for (List<Node2D *>::Element *F = ik_chain.front(); F; F = F->next()) {
for (Node2D *&F : ik_chain) {
if (key_pos) {
AnimationPlayerEditor::singleton->get_track_editor()->insert_node_value_key(F->get(), "position", F->get()->get_position(), p_on_existing);
AnimationPlayerEditor::singleton->get_track_editor()->insert_node_value_key(F, "position", F->get_position(), p_on_existing);
}
if (key_rot) {
AnimationPlayerEditor::singleton->get_track_editor()->insert_node_value_key(F->get(), "rotation", F->get()->get_rotation(), p_on_existing);
AnimationPlayerEditor::singleton->get_track_editor()->insert_node_value_key(F, "rotation", F->get_rotation(), p_on_existing);
}
if (key_scale) {
AnimationPlayerEditor::singleton->get_track_editor()->insert_node_value_key(F->get(), "scale", F->get()->get_scale(), p_on_existing);
AnimationPlayerEditor::singleton->get_track_editor()->insert_node_value_key(F, "scale", F->get_scale(), p_on_existing);
}
}
}
@ -4327,8 +4315,8 @@ void CanvasItemEditor::_insert_animation_keys(bool p_location, bool p_rotation,
void CanvasItemEditor::_button_toggle_anchor_mode(bool p_status) {
List<CanvasItem *> selection = _get_edited_canvas_items(false, false);
for (List<CanvasItem *>::Element *E = selection.front(); E; E = E->next()) {
Control *control = Object::cast_to<Control>(E->get());
for (CanvasItem *E : selection) {
Control *control = Object::cast_to<Control>(E);
if (!control || Object::cast_to<Container>(control->get_parent())) {
continue;
}
@ -4441,13 +4429,13 @@ void CanvasItemEditor::_popup_callback(int p_op) {
} break;
case SKELETON_SHOW_BONES: {
List<Node *> selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
for (Node *E : selection) {
// Add children nodes so they are processed
for (int child = 0; child < E->get()->get_child_count(); child++) {
selection.push_back(E->get()->get_child(child));
for (int child = 0; child < E->get_child_count(); child++) {
selection.push_back(E->get_child(child));
}
Bone2D *bone_2d = Object::cast_to<Bone2D>(E->get());
Bone2D *bone_2d = Object::cast_to<Bone2D>(E);
if (!bone_2d || !bone_2d->is_inside_tree()) {
continue;
}
@ -4477,8 +4465,8 @@ void CanvasItemEditor::_popup_callback(int p_op) {
undo_redo->create_action(TTR("Lock Selected"));
List<Node *> selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E->get());
for (Node *E : selection) {
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E);
if (!canvas_item || !canvas_item->is_inside_tree()) {
continue;
}
@ -4499,8 +4487,8 @@ void CanvasItemEditor::_popup_callback(int p_op) {
undo_redo->create_action(TTR("Unlock Selected"));
List<Node *> selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E->get());
for (Node *E : selection) {
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E);
if (!canvas_item || !canvas_item->is_inside_tree()) {
continue;
}
@ -4521,8 +4509,8 @@ void CanvasItemEditor::_popup_callback(int p_op) {
undo_redo->create_action(TTR("Group Selected"));
List<Node *> selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E->get());
for (Node *E : selection) {
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E);
if (!canvas_item || !canvas_item->is_inside_tree()) {
continue;
}
@ -4543,8 +4531,8 @@ void CanvasItemEditor::_popup_callback(int p_op) {
undo_redo->create_action(TTR("Ungroup Selected"));
List<Node *> selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E->get());
for (Node *E : selection) {
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E);
if (!canvas_item || !canvas_item->is_inside_tree()) {
continue;
}
@ -4711,14 +4699,14 @@ void CanvasItemEditor::_popup_callback(int p_op) {
}
undo_redo->create_action(TTR("Paste Pose"));
for (List<PoseClipboard>::Element *E = pose_clipboard.front(); E; E = E->next()) {
Node2D *n2d = Object::cast_to<Node2D>(ObjectDB::get_instance(E->get().id));
for (PoseClipboard &E : pose_clipboard) {
Node2D *n2d = Object::cast_to<Node2D>(ObjectDB::get_instance(E.id));
if (!n2d) {
continue;
}
undo_redo->add_do_method(n2d, "set_position", E->get().pos);
undo_redo->add_do_method(n2d, "set_rotation", E->get().rot);
undo_redo->add_do_method(n2d, "set_scale", E->get().scale);
undo_redo->add_do_method(n2d, "set_position", E.pos);
undo_redo->add_do_method(n2d, "set_rotation", E.rot);
undo_redo->add_do_method(n2d, "set_scale", E.scale);
undo_redo->add_undo_method(n2d, "set_position", n2d->get_position());
undo_redo->add_undo_method(n2d, "set_rotation", n2d->get_rotation());
undo_redo->add_undo_method(n2d, "set_scale", n2d->get_scale());
@ -5819,14 +5807,14 @@ void CanvasItemEditorViewport::_create_nodes(Node *parent, Node *child, String &
String property = "texture";
List<PropertyInfo> props;
child->get_property_list(&props);
for (const List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
if (E->get().name == "config/texture") { // Particles2D
for (const PropertyInfo &E : props) {
if (E.name == "config/texture") { // Particles2D
property = "config/texture";
break;
} else if (E->get().name == "texture/texture") { // Polygon2D
} else if (E.name == "texture/texture") { // Polygon2D
property = "texture/texture";
break;
} else if (E->get().name == "normal") { // TouchScreenButton
} else if (E.name == "normal") { // TouchScreenButton
property = "normal";
break;
}

View File

@ -253,8 +253,8 @@ CPUParticles2DEditorPlugin::CPUParticles2DEditorPlugin(EditorNode *p_node) {
file = memnew(EditorFileDialog);
List<String> ext;
ImageLoader::get_recognized_extensions(&ext);
for (List<String>::Element *E = ext.front(); E; E = E->next()) {
file->add_filter("*." + E->get() + "; " + E->get().to_upper());
for (String &E : ext) {
file->add_filter("*." + E + "; " + E.to_upper());
}
file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE);
toolbar->add_child(file);

View File

@ -490,11 +490,11 @@ Ref<Texture2D> EditorScriptPreviewPlugin::generate(const RES &p_from, const Size
Set<String> control_flow_keywords;
Set<String> keywords;
for (List<String>::Element *E = kwors.front(); E; E = E->next()) {
if (scr->get_language()->is_control_flow_keyword(E->get())) {
control_flow_keywords.insert(E->get());
for (String &E : kwors) {
if (scr->get_language()->is_control_flow_keyword(E)) {
control_flow_keywords.insert(E);
} else {
keywords.insert(E->get());
keywords.insert(E);
}
}

View File

@ -361,8 +361,8 @@ GPUParticles2DEditorPlugin::GPUParticles2DEditorPlugin(EditorNode *p_node) {
file = memnew(EditorFileDialog);
List<String> ext;
ImageLoader::get_recognized_extensions(&ext);
for (List<String>::Element *E = ext.front(); E; E = E->next()) {
file->add_filter("*." + E->get() + "; " + E->get().to_upper());
for (String &E : ext) {
file->add_filter("*." + E + "; " + E.to_upper());
}
file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE);
toolbar->add_child(file);

View File

@ -265,15 +265,15 @@ Ref<Resource> StandardMaterial3DConversionPlugin::convert(const Ref<Resource> &p
List<PropertyInfo> params;
RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
for (PropertyInfo &E : params) {
// Texture parameter has to be treated specially since StandardMaterial3D saved it
// as RID but ShaderMaterial needs Texture itself
Ref<Texture2D> texture = mat->get_texture_by_name(E->get().name);
Ref<Texture2D> texture = mat->get_texture_by_name(E.name);
if (texture.is_valid()) {
smat->set_shader_param(E->get().name, texture);
smat->set_shader_param(E.name, texture);
} else {
Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E.name);
smat->set_shader_param(E.name, value);
}
}
@ -309,9 +309,9 @@ Ref<Resource> ParticlesMaterialConversionPlugin::convert(const Ref<Resource> &p_
List<PropertyInfo> params;
RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
for (PropertyInfo &E : params) {
Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E.name);
smat->set_shader_param(E.name, value);
}
smat->set_render_priority(mat->get_render_priority());
@ -346,9 +346,9 @@ Ref<Resource> CanvasItemMaterialConversionPlugin::convert(const Ref<Resource> &p
List<PropertyInfo> params;
RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
for (PropertyInfo &E : params) {
Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E.name);
smat->set_shader_param(E.name, value);
}
smat->set_render_priority(mat->get_render_priority());
@ -383,9 +383,9 @@ Ref<Resource> ProceduralSkyMaterialConversionPlugin::convert(const Ref<Resource>
List<PropertyInfo> params;
RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
for (PropertyInfo &E : params) {
Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E.name);
smat->set_shader_param(E.name, value);
}
smat->set_render_priority(mat->get_render_priority());
@ -420,9 +420,9 @@ Ref<Resource> PanoramaSkyMaterialConversionPlugin::convert(const Ref<Resource> &
List<PropertyInfo> params;
RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
for (PropertyInfo &E : params) {
Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E.name);
smat->set_shader_param(E.name, value);
}
smat->set_render_priority(mat->get_render_priority());
@ -457,9 +457,9 @@ Ref<Resource> PhysicalSkyMaterialConversionPlugin::convert(const Ref<Resource> &
List<PropertyInfo> params;
RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
for (PropertyInfo &E : params) {
Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E.name);
smat->set_shader_param(E.name, value);
}
smat->set_render_priority(mat->get_render_priority());

View File

@ -90,8 +90,8 @@ void MeshInstance3DEditor::_menu_option(int p_option) {
ur->create_action(TTR("Create Static Trimesh Body"));
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
MeshInstance3D *instance = Object::cast_to<MeshInstance3D>(E->get());
for (Node *E : selection) {
MeshInstance3D *instance = Object::cast_to<MeshInstance3D>(E);
if (!instance) {
continue;
}

View File

@ -122,23 +122,23 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library,
List<uint32_t> shapes;
sb->get_shape_owners(&shapes);
for (List<uint32_t>::Element *E = shapes.front(); E; E = E->next()) {
if (sb->is_shape_owner_disabled(E->get())) {
for (uint32_t &E : shapes) {
if (sb->is_shape_owner_disabled(E)) {
continue;
}
//Transform3D shape_transform = sb->shape_owner_get_transform(E->get());
//Transform3D shape_transform = sb->shape_owner_get_transform(E);
//shape_transform.set_origin(shape_transform.get_origin() - phys_offset);
for (int k = 0; k < sb->shape_owner_get_shape_count(E->get()); k++) {
Ref<Shape3D> collision = sb->shape_owner_get_shape(E->get(), k);
for (int k = 0; k < sb->shape_owner_get_shape_count(E); k++) {
Ref<Shape3D> collision = sb->shape_owner_get_shape(E, k);
if (!collision.is_valid()) {
continue;
}
MeshLibrary::ShapeData shape_data;
shape_data.shape = collision;
shape_data.local_transform = sb->get_transform() * sb->shape_owner_get_transform(E->get());
shape_data.local_transform = sb->get_transform() * sb->shape_owner_get_transform(E);
collisions.push_back(shape_data);
}
}

View File

@ -4013,8 +4013,7 @@ void CollisionObject3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
List<uint32_t> owners;
co->get_shape_owners(&owners);
for (List<uint32_t>::Element *E = owners.front(); E; E = E->next()) {
uint32_t owner_id = E->get();
for (uint32_t &owner_id : owners) {
Transform3D xform = co->shape_owner_get_transform(owner_id);
Object *owner = co->shape_owner_get_owner(owner_id);
// Exclude CollisionShape3D and CollisionPolygon3D as they have their gizmo.
@ -4747,9 +4746,7 @@ void NavigationRegion3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
Vector3 *tw = tmeshfaces.ptrw();
int tidx = 0;
for (List<Face3>::Element *E = faces.front(); E; E = E->next()) {
const Face3 &f = E->get();
for (Face3 &f : faces) {
for (int j = 0; j < 3; j++) {
tw[tidx++] = f.vertex[j];
_EdgeKey ek;

View File

@ -1327,8 +1327,8 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
List<Node *> &selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node3D *sp = Object::cast_to<Node3D>(E->get());
for (Node *E : selection) {
Node3D *sp = Object::cast_to<Node3D>(E);
if (!sp) {
continue;
}
@ -1771,8 +1771,8 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")");
List<Node *> &selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node3D *sp = Object::cast_to<Node3D>(E->get());
for (Node *E : selection) {
Node3D *sp = Object::cast_to<Node3D>(E);
if (!sp) {
continue;
}
@ -1870,8 +1870,8 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")");
List<Node *> &selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node3D *sp = Object::cast_to<Node3D>(E->get());
for (Node *E : selection) {
Node3D *sp = Object::cast_to<Node3D>(E);
if (!sp) {
continue;
}
@ -1955,8 +1955,8 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
bool local_coords = (spatial_editor->are_local_coords_enabled() && _edit.plane != TRANSFORM_VIEW); // Disable local transformation for TRANSFORM_VIEW
List<Node *> &selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node3D *sp = Object::cast_to<Node3D>(E->get());
for (Node *E : selection) {
Node3D *sp = Object::cast_to<Node3D>(E);
if (!sp) {
continue;
}
@ -2186,8 +2186,8 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
List<Node *> &selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node3D *sp = Object::cast_to<Node3D>(E->get());
for (Node *E : selection) {
Node3D *sp = Object::cast_to<Node3D>(E);
if (!sp) {
continue;
}
@ -3052,8 +3052,8 @@ void Node3DEditorViewport::_menu_option(int p_option) {
undo_redo->create_action(TTR("Align Transform with View"));
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node3D *sp = Object::cast_to<Node3D>(E->get());
for (Node *E : selection) {
Node3D *sp = Object::cast_to<Node3D>(E);
if (!sp) {
continue;
}
@ -3088,8 +3088,8 @@ void Node3DEditorViewport::_menu_option(int p_option) {
List<Node *> &selection = editor_selection->get_selected_node_list();
undo_redo->create_action(TTR("Align Rotation with View"));
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node3D *sp = Object::cast_to<Node3D>(E->get());
for (Node *E : selection) {
Node3D *sp = Object::cast_to<Node3D>(E);
if (!sp) {
continue;
}
@ -3741,8 +3741,8 @@ void Node3DEditorViewport::focus_selection() {
List<Node *> &selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node3D *sp = Object::cast_to<Node3D>(E->get());
for (Node *E : selection) {
Node3D *sp = Object::cast_to<Node3D>(E);
if (!sp) {
continue;
}
@ -5176,8 +5176,8 @@ void Node3DEditor::_xform_dialog_action() {
List<Node *> &selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node3D *sp = Object::cast_to<Node3D>(E->get());
for (Node *E : selection) {
Node3D *sp = Object::cast_to<Node3D>(E);
if (!sp) {
continue;
}
@ -5413,8 +5413,8 @@ void Node3DEditor::_menu_item_pressed(int p_option) {
List<Node *> &selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node3D *spatial = Object::cast_to<Node3D>(E->get());
for (Node *E : selection) {
Node3D *spatial = Object::cast_to<Node3D>(E);
if (!spatial || !spatial->is_inside_tree()) {
continue;
}
@ -5438,8 +5438,8 @@ void Node3DEditor::_menu_item_pressed(int p_option) {
List<Node *> &selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node3D *spatial = Object::cast_to<Node3D>(E->get());
for (Node *E : selection) {
Node3D *spatial = Object::cast_to<Node3D>(E);
if (!spatial || !spatial->is_inside_tree()) {
continue;
}
@ -5463,8 +5463,8 @@ void Node3DEditor::_menu_item_pressed(int p_option) {
List<Node *> &selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node3D *spatial = Object::cast_to<Node3D>(E->get());
for (Node *E : selection) {
Node3D *spatial = Object::cast_to<Node3D>(E);
if (!spatial || !spatial->is_inside_tree()) {
continue;
}
@ -5487,8 +5487,8 @@ void Node3DEditor::_menu_item_pressed(int p_option) {
undo_redo->create_action(TTR("Ungroup Selected"));
List<Node *> &selection = editor_selection->get_selected_node_list();
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node3D *spatial = Object::cast_to<Node3D>(E->get());
for (Node *E : selection) {
Node3D *spatial = Object::cast_to<Node3D>(E);
if (!spatial || !spatial->is_inside_tree()) {
continue;
}
@ -6243,14 +6243,14 @@ void Node3DEditor::_refresh_menu_icons() {
all_locked = false;
all_grouped = false;
} else {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
if (Object::cast_to<Node3D>(E->get()) && !Object::cast_to<Node3D>(E->get())->has_meta("_edit_lock_")) {
for (Node *E : selection) {
if (Object::cast_to<Node3D>(E) && !Object::cast_to<Node3D>(E)->has_meta("_edit_lock_")) {
all_locked = false;
break;
}
}
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
if (Object::cast_to<Node3D>(E->get()) && !Object::cast_to<Node3D>(E->get())->has_meta("_edit_group_")) {
for (Node *E : selection) {
if (Object::cast_to<Node3D>(E) && !Object::cast_to<Node3D>(E)->has_meta("_edit_group_")) {
all_grouped = false;
break;
}
@ -6303,8 +6303,8 @@ void Node3DEditor::snap_selected_nodes_to_floor() {
List<Node *> &selection = editor_selection->get_selected_node_list();
Dictionary snap_data;
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node3D *sp = Object::cast_to<Node3D>(E->get());
for (Node *E : selection) {
Node3D *sp = Object::cast_to<Node3D>(E);
if (sp) {
Vector3 from = Vector3();
Vector3 position_offset = Vector3();

View File

@ -181,21 +181,21 @@ void ResourcePreloaderEditor::_update_library() {
preloader->get_resource_list(&rnames);
List<String> names;
for (List<StringName>::Element *E = rnames.front(); E; E = E->next()) {
names.push_back(E->get());
for (StringName &E : rnames) {
names.push_back(E);
}
names.sort();
for (List<String>::Element *E = names.front(); E; E = E->next()) {
for (String &E : names) {
TreeItem *ti = tree->create_item(root);
ti->set_cell_mode(0, TreeItem::CELL_MODE_STRING);
ti->set_editable(0, true);
ti->set_selectable(0, true);
ti->set_text(0, E->get());
ti->set_metadata(0, E->get());
ti->set_text(0, E);
ti->set_metadata(0, E);
RES r = preloader->get_resource(E->get());
RES r = preloader->get_resource(E);
ERR_CONTINUE(r.is_null());

View File

@ -70,8 +70,8 @@ void EditorPropertyRootMotion::_node_assign() {
List<StringName> animations;
player->get_animation_list(&animations);
for (List<StringName>::Element *E = animations.front(); E; E = E->next()) {
Ref<Animation> anim = player->get_animation(E->get());
for (StringName &E : animations) {
Ref<Animation> anim = player->get_animation(E);
for (int i = 0; i < anim->get_track_count(); i++) {
paths.insert(anim->track_get_path(i));
}

View File

@ -103,8 +103,8 @@ void EditorStandardSyntaxHighlighter::_update_cache() {
const Color type_color = EDITOR_GET("text_editor/highlighting/engine_type_color");
List<StringName> types;
ClassDB::get_class_list(&types);
for (List<StringName>::Element *E = types.front(); E; E = E->next()) {
String n = E->get();
for (StringName &E : types) {
String n = E;
if (n.begins_with("_")) {
n = n.substr(1, n.length());
}
@ -115,8 +115,8 @@ void EditorStandardSyntaxHighlighter::_update_cache() {
const Color usertype_color = EDITOR_GET("text_editor/highlighting/user_type_color");
List<StringName> global_classes;
ScriptServer::get_global_class_list(&global_classes);
for (List<StringName>::Element *E = global_classes.front(); E; E = E->next()) {
highlighter->add_keyword_color(E->get(), usertype_color);
for (StringName &E : global_classes) {
highlighter->add_keyword_color(E, usertype_color);
}
/* Autoloads. */
@ -134,8 +134,8 @@ void EditorStandardSyntaxHighlighter::_update_cache() {
const Color basetype_color = EDITOR_GET("text_editor/highlighting/base_type_color");
List<String> core_types;
script->get_language()->get_core_type_words(&core_types);
for (List<String>::Element *E = core_types.front(); E; E = E->next()) {
highlighter->add_keyword_color(E->get(), basetype_color);
for (String &E : core_types) {
highlighter->add_keyword_color(E, basetype_color);
}
/* Reserved words. */
@ -143,11 +143,11 @@ void EditorStandardSyntaxHighlighter::_update_cache() {
const Color control_flow_keyword_color = EDITOR_GET("text_editor/highlighting/control_flow_keyword_color");
List<String> keywords;
script->get_language()->get_reserved_words(&keywords);
for (List<String>::Element *E = keywords.front(); E; E = E->next()) {
if (script->get_language()->is_control_flow_keyword(E->get())) {
highlighter->add_keyword_color(E->get(), control_flow_keyword_color);
for (String &E : keywords) {
if (script->get_language()->is_control_flow_keyword(E)) {
highlighter->add_keyword_color(E, control_flow_keyword_color);
} else {
highlighter->add_keyword_color(E->get(), keyword_color);
highlighter->add_keyword_color(E, keyword_color);
}
}
@ -157,9 +157,9 @@ void EditorStandardSyntaxHighlighter::_update_cache() {
if (instance_base != StringName()) {
List<PropertyInfo> plist;
ClassDB::get_property_list(instance_base, &plist);
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
String name = E->get().name;
if (E->get().usage & PROPERTY_USAGE_CATEGORY || E->get().usage & PROPERTY_USAGE_GROUP || E->get().usage & PROPERTY_USAGE_SUBGROUP) {
for (PropertyInfo &E : plist) {
String name = E.name;
if (E.usage & PROPERTY_USAGE_CATEGORY || E.usage & PROPERTY_USAGE_GROUP || E.usage & PROPERTY_USAGE_SUBGROUP) {
continue;
}
if (name.find("/") != -1) {
@ -170,8 +170,8 @@ void EditorStandardSyntaxHighlighter::_update_cache() {
List<String> clist;
ClassDB::get_integer_constant_list(instance_base, &clist);
for (List<String>::Element *E = clist.front(); E; E = E->next()) {
highlighter->add_member_keyword_color(E->get(), member_variable_color);
for (String &E : clist) {
highlighter->add_member_keyword_color(E, member_variable_color);
}
}
@ -179,8 +179,7 @@ void EditorStandardSyntaxHighlighter::_update_cache() {
const Color comment_color = EDITOR_GET("text_editor/highlighting/comment_color");
List<String> comments;
script->get_language()->get_comment_delimiters(&comments);
for (List<String>::Element *E = comments.front(); E; E = E->next()) {
String comment = E->get();
for (String &comment : comments) {
String beg = comment.get_slice(" ", 0);
String end = comment.get_slice_count(" ") > 1 ? comment.get_slice(" ", 1) : String();
highlighter->add_color_region(beg, end, comment_color, end == "");
@ -190,8 +189,7 @@ void EditorStandardSyntaxHighlighter::_update_cache() {
const Color string_color = EDITOR_GET("text_editor/highlighting/string_color");
List<String> strings;
script->get_language()->get_string_delimiters(&strings);
for (List<String>::Element *E = strings.front(); E; E = E->next()) {
String string = E->get();
for (String &string : strings) {
String beg = string.get_slice(" ", 0);
String end = string.get_slice_count(" ") > 1 ? string.get_slice(" ", 1) : String();
highlighter->add_color_region(beg, end, string_color, end == "");

View File

@ -50,9 +50,7 @@ void ConnectionInfoDialog::popup_connections(String p_method, Vector<Node *> p_n
List<Connection> all_connections;
p_nodes[i]->get_signals_connected_to_this(&all_connections);
for (List<Connection>::Element *E = all_connections.front(); E; E = E->next()) {
Connection connection = E->get();
for (Connection &connection : all_connections) {
if (connection.callable.get_method() != p_method) {
continue;
}
@ -116,8 +114,8 @@ Vector<String> ScriptTextEditor::get_functions() {
if (script->get_language()->validate(text, script->get_path(), &fnc)) {
//if valid rewrite functions to latest
functions.clear();
for (List<String>::Element *E = fnc.front(); E; E = E->next()) {
functions.push_back(E->get());
for (String &E : fnc) {
functions.push_back(E);
}
}
@ -203,8 +201,7 @@ void ScriptTextEditor::_set_theme_for_script() {
List<String> strings;
script->get_language()->get_string_delimiters(&strings);
text_edit->clear_string_delimiters();
for (List<String>::Element *E = strings.front(); E; E = E->next()) {
String string = E->get();
for (String &string : strings) {
String beg = string.get_slice(" ", 0);
String end = string.get_slice_count(" ") > 1 ? string.get_slice(" ", 1) : String();
text_edit->add_string_delimiter(beg, end, end == "");
@ -213,8 +210,7 @@ void ScriptTextEditor::_set_theme_for_script() {
List<String> comments;
script->get_language()->get_comment_delimiters(&comments);
text_edit->clear_comment_delimiters();
for (List<String>::Element *E = comments.front(); E; E = E->next()) {
String comment = E->get();
for (String &comment : comments) {
String beg = comment.get_slice(" ", 0);
String end = comment.get_slice_count(" ") > 1 ? comment.get_slice(" ", 1) : String();
text_edit->add_comment_delimiter(beg, end, end == "");
@ -417,8 +413,8 @@ void ScriptTextEditor::_validate_script() {
}
functions.clear();
for (List<String>::Element *E = fnc.front(); E; E = E->next()) {
functions.push_back(E->get());
for (String &E : fnc) {
functions.push_back(E);
}
script_is_valid = true;
}
@ -432,9 +428,7 @@ void ScriptTextEditor::_validate_script() {
Node *base = get_tree()->get_edited_scene_root();
if (base && missing_connections.size() > 0) {
warnings_panel->push_table(1);
for (List<Connection>::Element *E = missing_connections.front(); E; E = E->next()) {
Connection connection = E->get();
for (Connection &connection : missing_connections) {
String base_path = base->get_name();
String source_path = base == connection.signal.get_object() ? base_path : base_path + "/" + base->get_path_to(Object::cast_to<Node>(connection.signal.get_object()));
String target_path = base == connection.callable.get_object() ? base_path : base_path + "/" + base->get_path_to(Object::cast_to<Node>(connection.callable.get_object()));
@ -456,9 +450,7 @@ void ScriptTextEditor::_validate_script() {
// Add script warnings.
warnings_panel->push_table(3);
for (List<ScriptLanguage::Warning>::Element *E = warnings.front(); E; E = E->next()) {
ScriptLanguage::Warning w = E->get();
for (ScriptLanguage::Warning &w : warnings) {
Dictionary ignore_meta;
ignore_meta["line"] = w.start_line;
ignore_meta["code"] = w.string_code.to_lower();
@ -488,9 +480,7 @@ void ScriptTextEditor::_validate_script() {
errors_panel->clear();
errors_panel->push_table(2);
for (List<ScriptLanguage::ScriptError>::Element *E = errors.front(); E; E = E->next()) {
ScriptLanguage::ScriptError err = E->get();
for (ScriptLanguage::ScriptError &err : errors) {
errors_panel->push_cell();
errors_panel->push_meta(err.line - 1);
errors_panel->push_color(warnings_panel->get_theme_color(SNAME("error_color"), SNAME("Editor")));
@ -511,8 +501,8 @@ void ScriptTextEditor::_validate_script() {
if (errors.is_empty()) {
te->set_line_background_color(i, Color(0, 0, 0, 0));
} else {
for (List<ScriptLanguage::ScriptError>::Element *E = errors.front(); E; E = E->next()) {
bool error_line = i == E->get().line - 1;
for (ScriptLanguage::ScriptError &E : errors) {
bool error_line = i == E.line - 1;
te->set_line_background_color(i, error_line ? marked_line_color : Color(0, 0, 0, 0));
if (error_line) {
break;
@ -910,8 +900,7 @@ void ScriptTextEditor::_update_connected_methods() {
List<Connection> connections;
nodes[i]->get_signals_connected_to_this(&connections);
for (List<Connection>::Element *E = connections.front(); E; E = E->next()) {
Connection connection = E->get();
for (Connection &connection : connections) {
if (!(connection.flags & CONNECT_PERSIST)) {
continue;
}
@ -1286,8 +1275,7 @@ void ScriptTextEditor::_edit_option_toggle_inline_comment() {
List<String> comment_delimiters;
script->get_language()->get_comment_delimiters(&comment_delimiters);
for (List<String>::Element *E = comment_delimiters.front(); E; E = E->next()) {
String script_delimiter = E->get();
for (String &script_delimiter : comment_delimiters) {
if (script_delimiter.find(" ") == -1) {
delimiter = script_delimiter;
break;

Some files were not shown because too many files have changed in this diff Show More