Use initializer list in Arrays
This commit is contained in:
@@ -1940,15 +1940,7 @@ CodeTextEditor::CodeTextEditor() {
|
||||
text_editor->connect("caret_changed", callable_mp(this, &CodeTextEditor::_line_col_changed));
|
||||
text_editor->connect(SceneStringName(text_changed), callable_mp(this, &CodeTextEditor::_text_changed));
|
||||
text_editor->connect("code_completion_requested", callable_mp(this, &CodeTextEditor::_complete_request));
|
||||
TypedArray<String> cs;
|
||||
cs.push_back(".");
|
||||
cs.push_back(",");
|
||||
cs.push_back("(");
|
||||
cs.push_back("=");
|
||||
cs.push_back("$");
|
||||
cs.push_back("@");
|
||||
cs.push_back("\"");
|
||||
cs.push_back("\'");
|
||||
TypedArray<String> cs = { ".", ",", "(", "=", "$", "@", "\"", "\'" };
|
||||
text_editor->set_code_completion_prefixes(cs);
|
||||
idle->connect("timeout", callable_mp(this, &CodeTextEditor::_text_changed_idle_timeout));
|
||||
|
||||
|
||||
@@ -301,12 +301,11 @@ Dictionary DebugAdapterParser::req_threads(const Dictionary &p_params) const {
|
||||
Dictionary response = prepare_success_response(p_params), body;
|
||||
response["body"] = body;
|
||||
|
||||
Array arr;
|
||||
DAP::Thread thread;
|
||||
|
||||
thread.id = 1; // Hardcoded because Godot only supports debugging one thread at the moment
|
||||
thread.name = "Main";
|
||||
arr.push_back(thread.to_json());
|
||||
Array arr = { thread.to_json() };
|
||||
body["threads"] = arr;
|
||||
|
||||
return response;
|
||||
@@ -383,13 +382,12 @@ Dictionary DebugAdapterParser::req_breakpointLocations(const Dictionary &p_param
|
||||
response["body"] = body;
|
||||
Dictionary args = p_params["arguments"];
|
||||
|
||||
Array locations;
|
||||
DAP::BreakpointLocation location;
|
||||
location.line = args["line"];
|
||||
if (args.has("endLine")) {
|
||||
location.endLine = args["endLine"];
|
||||
}
|
||||
locations.push_back(location.to_json());
|
||||
Array locations = { location.to_json() };
|
||||
|
||||
body["breakpoints"] = locations;
|
||||
return response;
|
||||
@@ -595,8 +593,7 @@ Dictionary DebugAdapterParser::ev_stopped_breakpoint(const int &p_id) const {
|
||||
body["reason"] = "breakpoint";
|
||||
body["description"] = "Breakpoint";
|
||||
|
||||
Array breakpoints;
|
||||
breakpoints.push_back(p_id);
|
||||
Array breakpoints = { p_id };
|
||||
body["hitBreakpointIds"] = breakpoints;
|
||||
|
||||
return event;
|
||||
|
||||
@@ -205,9 +205,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
x.value = rtos(vec.x);
|
||||
y.value = rtos(vec.y);
|
||||
|
||||
Array arr;
|
||||
arr.push_back(x.to_json());
|
||||
arr.push_back(y.to_json());
|
||||
Array arr = { x.to_json(), y.to_json() };
|
||||
variable_list.insert(id, arr);
|
||||
return id;
|
||||
}
|
||||
@@ -230,11 +228,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
w.value = rtos(rect.size.x);
|
||||
h.value = rtos(rect.size.y);
|
||||
|
||||
Array arr;
|
||||
arr.push_back(x.to_json());
|
||||
arr.push_back(y.to_json());
|
||||
arr.push_back(w.to_json());
|
||||
arr.push_back(h.to_json());
|
||||
Array arr = { x.to_json(), y.to_json(), w.to_json(), h.to_json() };
|
||||
variable_list.insert(id, arr);
|
||||
return id;
|
||||
}
|
||||
@@ -254,10 +248,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
y.value = rtos(vec.y);
|
||||
z.value = rtos(vec.z);
|
||||
|
||||
Array arr;
|
||||
arr.push_back(x.to_json());
|
||||
arr.push_back(y.to_json());
|
||||
arr.push_back(z.to_json());
|
||||
Array arr = { x.to_json(), y.to_json(), z.to_json() };
|
||||
variable_list.insert(id, arr);
|
||||
return id;
|
||||
}
|
||||
@@ -279,10 +270,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
y.variablesReference = parse_variant(transform.columns[1]);
|
||||
origin.variablesReference = parse_variant(transform.columns[2]);
|
||||
|
||||
Array arr;
|
||||
arr.push_back(x.to_json());
|
||||
arr.push_back(y.to_json());
|
||||
arr.push_back(origin.to_json());
|
||||
Array arr = { x.to_json(), y.to_json(), origin.to_json() };
|
||||
variable_list.insert(id, arr);
|
||||
return id;
|
||||
}
|
||||
@@ -298,9 +286,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
normal.value = plane.normal;
|
||||
normal.variablesReference = parse_variant(plane.normal);
|
||||
|
||||
Array arr;
|
||||
arr.push_back(d.to_json());
|
||||
arr.push_back(normal.to_json());
|
||||
Array arr = { d.to_json(), normal.to_json() };
|
||||
variable_list.insert(id, arr);
|
||||
return id;
|
||||
}
|
||||
@@ -322,11 +308,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
z.value = rtos(quat.z);
|
||||
w.value = rtos(quat.w);
|
||||
|
||||
Array arr;
|
||||
arr.push_back(x.to_json());
|
||||
arr.push_back(y.to_json());
|
||||
arr.push_back(z.to_json());
|
||||
arr.push_back(w.to_json());
|
||||
Array arr = { x.to_json(), y.to_json(), z.to_json(), w.to_json() };
|
||||
variable_list.insert(id, arr);
|
||||
return id;
|
||||
}
|
||||
@@ -344,9 +326,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
position.variablesReference = parse_variant(aabb.position);
|
||||
size.variablesReference = parse_variant(aabb.size);
|
||||
|
||||
Array arr;
|
||||
arr.push_back(position.to_json());
|
||||
arr.push_back(size.to_json());
|
||||
Array arr = { position.to_json(), size.to_json() };
|
||||
variable_list.insert(id, arr);
|
||||
return id;
|
||||
}
|
||||
@@ -368,10 +348,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
y.variablesReference = parse_variant(basis.rows[1]);
|
||||
z.variablesReference = parse_variant(basis.rows[2]);
|
||||
|
||||
Array arr;
|
||||
arr.push_back(x.to_json());
|
||||
arr.push_back(y.to_json());
|
||||
arr.push_back(z.to_json());
|
||||
Array arr = { x.to_json(), y.to_json(), z.to_json() };
|
||||
variable_list.insert(id, arr);
|
||||
return id;
|
||||
}
|
||||
@@ -388,9 +365,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
basis.variablesReference = parse_variant(transform.basis);
|
||||
origin.variablesReference = parse_variant(transform.origin);
|
||||
|
||||
Array arr;
|
||||
arr.push_back(basis.to_json());
|
||||
arr.push_back(origin.to_json());
|
||||
Array arr = { basis.to_json(), origin.to_json() };
|
||||
variable_list.insert(id, arr);
|
||||
return id;
|
||||
}
|
||||
@@ -412,11 +387,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
b.value = rtos(color.b);
|
||||
a.value = rtos(color.a);
|
||||
|
||||
Array arr;
|
||||
arr.push_back(r.to_json());
|
||||
arr.push_back(g.to_json());
|
||||
arr.push_back(b.to_json());
|
||||
arr.push_back(a.to_json());
|
||||
Array arr = { r.to_json(), g.to_json(), b.to_json(), a.to_json() };
|
||||
variable_list.insert(id, arr);
|
||||
return id;
|
||||
}
|
||||
@@ -428,8 +399,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
size.type = Variant::get_type_name(Variant::INT);
|
||||
size.value = itos(array.size());
|
||||
|
||||
Array arr;
|
||||
arr.push_back(size.to_json());
|
||||
Array arr = { size.to_json() };
|
||||
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
DAP::Variable var;
|
||||
@@ -467,8 +437,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
size.type = Variant::get_type_name(Variant::INT);
|
||||
size.value = itos(array.size());
|
||||
|
||||
Array arr;
|
||||
arr.push_back(size.to_json());
|
||||
Array arr = { size.to_json() };
|
||||
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
DAP::Variable var;
|
||||
@@ -488,8 +457,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
size.type = Variant::get_type_name(Variant::INT);
|
||||
size.value = itos(array.size());
|
||||
|
||||
Array arr;
|
||||
arr.push_back(size.to_json());
|
||||
Array arr = { size.to_json() };
|
||||
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
DAP::Variable var;
|
||||
@@ -509,8 +477,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
size.type = Variant::get_type_name(Variant::INT);
|
||||
size.value = itos(array.size());
|
||||
|
||||
Array arr;
|
||||
arr.push_back(size.to_json());
|
||||
Array arr = { size.to_json() };
|
||||
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
DAP::Variable var;
|
||||
@@ -530,8 +497,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
size.type = Variant::get_type_name(Variant::INT);
|
||||
size.value = itos(array.size());
|
||||
|
||||
Array arr;
|
||||
arr.push_back(size.to_json());
|
||||
Array arr = { size.to_json() };
|
||||
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
DAP::Variable var;
|
||||
@@ -551,8 +517,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
size.type = Variant::get_type_name(Variant::INT);
|
||||
size.value = itos(array.size());
|
||||
|
||||
Array arr;
|
||||
arr.push_back(size.to_json());
|
||||
Array arr = { size.to_json() };
|
||||
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
DAP::Variable var;
|
||||
@@ -572,8 +537,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
size.type = Variant::get_type_name(Variant::INT);
|
||||
size.value = itos(array.size());
|
||||
|
||||
Array arr;
|
||||
arr.push_back(size.to_json());
|
||||
Array arr = { size.to_json() };
|
||||
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
DAP::Variable var;
|
||||
@@ -593,8 +557,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
size.type = Variant::get_type_name(Variant::INT);
|
||||
size.value = itos(array.size());
|
||||
|
||||
Array arr;
|
||||
arr.push_back(size.to_json());
|
||||
Array arr = { size.to_json() };
|
||||
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
DAP::Variable var;
|
||||
@@ -615,8 +578,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
size.type = Variant::get_type_name(Variant::INT);
|
||||
size.value = itos(array.size());
|
||||
|
||||
Array arr;
|
||||
arr.push_back(size.to_json());
|
||||
Array arr = { size.to_json() };
|
||||
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
DAP::Variable var;
|
||||
@@ -637,8 +599,7 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
|
||||
size.type = Variant::get_type_name(Variant::INT);
|
||||
size.value = itos(array.size());
|
||||
|
||||
Array arr;
|
||||
arr.push_back(size.to_json());
|
||||
Array arr = { size.to_json() };
|
||||
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
DAP::Variable var;
|
||||
@@ -880,8 +841,7 @@ bool DebugAdapterProtocol::process_message(const String &p_text) {
|
||||
if (parser->has_method(command)) {
|
||||
_current_request = params["command"];
|
||||
|
||||
Array args;
|
||||
args.push_back(params);
|
||||
Array args = { params };
|
||||
Dictionary response = parser->callv(command, args);
|
||||
if (!response.is_empty()) {
|
||||
_current_peer->res_queue.push_front(response);
|
||||
|
||||
@@ -158,9 +158,7 @@ struct Capabilities {
|
||||
dict["supportsTerminateRequest"] = supportsTerminateRequest;
|
||||
dict["supportsBreakpointLocationsRequest"] = supportsBreakpointLocationsRequest;
|
||||
|
||||
Array arr;
|
||||
arr.push_back(supportedChecksumAlgorithms[0]);
|
||||
arr.push_back(supportedChecksumAlgorithms[1]);
|
||||
Array arr = { supportedChecksumAlgorithms[0], supportedChecksumAlgorithms[1] };
|
||||
dict["supportedChecksumAlgorithms"] = arr;
|
||||
|
||||
return dict;
|
||||
|
||||
@@ -74,8 +74,7 @@ void EditorExpressionEvaluator::_clear() {
|
||||
}
|
||||
|
||||
void EditorExpressionEvaluator::_remote_object_selected(ObjectID p_id) {
|
||||
Array arr;
|
||||
arr.append(p_id);
|
||||
Array arr = { p_id };
|
||||
editor_debugger->emit_signal(SNAME("remote_objects_requested"), arr);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,10 +73,7 @@ using CameraOverride = EditorDebuggerNode::CameraOverride;
|
||||
void ScriptEditorDebugger::_put_msg(const String &p_message, const Array &p_data, uint64_t p_thread_id) {
|
||||
ERR_FAIL_COND(p_thread_id == Thread::UNASSIGNED_ID);
|
||||
if (is_session_active()) {
|
||||
Array msg;
|
||||
msg.push_back(p_message);
|
||||
msg.push_back(p_thread_id);
|
||||
msg.push_back(p_data);
|
||||
Array msg = { p_message, p_thread_id, p_data };
|
||||
Error err = peer->put_message(msg);
|
||||
ERR_FAIL_COND_MSG(err != OK, vformat("Failed to send message %d", err));
|
||||
}
|
||||
@@ -98,8 +95,7 @@ void ScriptEditorDebugger::debug_skip_breakpoints() {
|
||||
skip_breakpoints->set_button_icon(get_editor_theme_icon(SNAME("DebugSkipBreakpointsOff")));
|
||||
}
|
||||
|
||||
Array msg;
|
||||
msg.push_back(skip_breakpoints_value);
|
||||
Array msg = { skip_breakpoints_value };
|
||||
_put_msg("set_skip_breakpoints", msg, debugging_thread_id != Thread::UNASSIGNED_ID ? debugging_thread_id : Thread::MAIN_ID);
|
||||
}
|
||||
|
||||
@@ -111,8 +107,7 @@ void ScriptEditorDebugger::debug_ignore_error_breaks() {
|
||||
ignore_error_breaks->set_button_icon(get_theme_icon(SNAME("Notification"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
Array msg;
|
||||
msg.push_back(ignore_error_breaks_value);
|
||||
Array msg = { ignore_error_breaks_value };
|
||||
_put_msg("set_ignore_error_breaks", msg);
|
||||
}
|
||||
|
||||
@@ -170,9 +165,7 @@ void ScriptEditorDebugger::clear_style() {
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::save_node(ObjectID p_id, const String &p_file) {
|
||||
Array msg;
|
||||
msg.push_back(p_id);
|
||||
msg.push_back(p_file);
|
||||
Array msg = { p_id, p_file };
|
||||
_put_msg("scene:save_node", msg);
|
||||
}
|
||||
|
||||
@@ -265,17 +258,12 @@ const SceneDebuggerTree *ScriptEditorDebugger::get_remote_tree() {
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::request_remote_evaluate(const String &p_expression, int p_stack_frame) {
|
||||
Array msg;
|
||||
msg.push_back(p_expression);
|
||||
msg.push_back(p_stack_frame);
|
||||
Array msg = { p_expression, p_stack_frame };
|
||||
_put_msg("evaluate", msg);
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::update_remote_object(ObjectID p_obj_id, const String &p_prop, const Variant &p_value, const String &p_field) {
|
||||
Array msg;
|
||||
msg.push_back(p_obj_id);
|
||||
msg.push_back(p_prop);
|
||||
msg.push_back(p_value);
|
||||
Array msg = { p_obj_id, p_prop, p_value };
|
||||
if (p_field.is_empty()) {
|
||||
_put_msg("scene:set_object_property", msg);
|
||||
} else {
|
||||
@@ -286,9 +274,7 @@ void ScriptEditorDebugger::update_remote_object(ObjectID p_obj_id, const String
|
||||
|
||||
void ScriptEditorDebugger::request_remote_objects(const TypedArray<uint64_t> &p_obj_ids, bool p_update_selection) {
|
||||
ERR_FAIL_COND(p_obj_ids.is_empty());
|
||||
Array msg;
|
||||
msg.push_back(p_obj_ids.duplicate());
|
||||
msg.push_back(p_update_selection);
|
||||
Array msg = { p_obj_ids.duplicate(), p_update_selection };
|
||||
_put_msg("scene:inspect_objects", msg);
|
||||
}
|
||||
|
||||
@@ -300,8 +286,7 @@ void ScriptEditorDebugger::clear_inspector(bool p_send_msg) {
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::_remote_object_selected(ObjectID p_id) {
|
||||
Array arr;
|
||||
arr.append(p_id);
|
||||
Array arr = { p_id };
|
||||
emit_signal(SNAME("remote_objects_requested"), arr);
|
||||
}
|
||||
|
||||
@@ -596,11 +581,7 @@ void ScriptEditorDebugger::_msg_error(uint64_t p_thread_id, const Array &p_data)
|
||||
ERR_FAIL_COND_MSG(oe.deserialize(p_data) == false, "Failed to deserialize error message");
|
||||
|
||||
// Format time.
|
||||
Array time_vals;
|
||||
time_vals.push_back(oe.hr);
|
||||
time_vals.push_back(oe.min);
|
||||
time_vals.push_back(oe.sec);
|
||||
time_vals.push_back(oe.msec);
|
||||
Array time_vals = { oe.hr, oe.min, oe.sec, oe.msec };
|
||||
bool e;
|
||||
String time = String("%d:%02d:%02d:%03d").sprintf(time_vals, &e);
|
||||
|
||||
@@ -608,9 +589,7 @@ void ScriptEditorDebugger::_msg_error(uint64_t p_thread_id, const Array &p_data)
|
||||
bool source_is_project_file = oe.source_file.begins_with("res://");
|
||||
|
||||
// Metadata to highlight error line in scripts.
|
||||
Array source_meta;
|
||||
source_meta.push_back(oe.source_file);
|
||||
source_meta.push_back(oe.source_line);
|
||||
Array source_meta = { oe.source_file, oe.source_line };
|
||||
|
||||
// Create error tree to display above error or warning details.
|
||||
TreeItem *r = error_tree->get_root();
|
||||
@@ -710,9 +689,7 @@ void ScriptEditorDebugger::_msg_error(uint64_t p_thread_id, const Array &p_data)
|
||||
for (unsigned int i = 0; i < (unsigned int)oe.callstack.size(); i++) {
|
||||
TreeItem *stack_trace = error_tree->create_item(error);
|
||||
|
||||
Array meta;
|
||||
meta.push_back(infos[i].file);
|
||||
meta.push_back(infos[i].line);
|
||||
Array meta = { infos[i].file, infos[i].line };
|
||||
stack_trace->set_metadata(0, meta);
|
||||
|
||||
if (i == 0) {
|
||||
@@ -1068,8 +1045,7 @@ void ScriptEditorDebugger::_notification(int p_what) {
|
||||
transform.scale_basis(Size2(zoom, zoom));
|
||||
transform.columns[2] = -offset * zoom;
|
||||
|
||||
Array msg;
|
||||
msg.push_back(transform);
|
||||
Array msg = { transform };
|
||||
_put_msg("scene:transform_camera_2d", msg);
|
||||
}
|
||||
|
||||
@@ -1078,8 +1054,7 @@ void ScriptEditorDebugger::_notification(int p_what) {
|
||||
Node3DEditorViewport *viewport = Node3DEditor::get_singleton()->get_last_used_viewport();
|
||||
const Camera3D *cam = viewport->get_camera_3d();
|
||||
|
||||
Array msg;
|
||||
msg.push_back(cam->get_camera_transform());
|
||||
Array msg = { cam->get_camera_transform() };
|
||||
if (cam->get_projection() == Camera3D::PROJECTION_ORTHOGONAL) {
|
||||
msg.push_back(false);
|
||||
msg.push_back(cam->get_size());
|
||||
@@ -1266,8 +1241,7 @@ void ScriptEditorDebugger::stop() {
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::_profiler_activate(bool p_enable, int p_type) {
|
||||
Array msg_data;
|
||||
msg_data.push_back(p_enable);
|
||||
Array msg_data = { p_enable };
|
||||
switch (p_type) {
|
||||
case PROFILER_VISUAL:
|
||||
_put_msg("profiler:visual", msg_data);
|
||||
@@ -1277,11 +1251,9 @@ void ScriptEditorDebugger::_profiler_activate(bool p_enable, int p_type) {
|
||||
// Clear old script signatures. (should we move all this into the profiler?)
|
||||
profiler_signature.clear();
|
||||
// Add max funcs options to request.
|
||||
Array opts;
|
||||
int max_funcs = EDITOR_GET("debugger/profiler_frame_max_functions");
|
||||
bool include_native = EDITOR_GET("debugger/profile_native_calls");
|
||||
opts.push_back(CLAMP(max_funcs, 16, 512));
|
||||
opts.push_back(include_native);
|
||||
Array opts = { CLAMP(max_funcs, 16, 512), include_native };
|
||||
msg_data.push_back(opts);
|
||||
}
|
||||
_put_msg("profiler:servers", msg_data);
|
||||
@@ -1323,8 +1295,7 @@ String ScriptEditorDebugger::get_var_value(const String &p_var) const {
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::_resources_reimported(const PackedStringArray &p_resources) {
|
||||
Array msg;
|
||||
msg.push_back(p_resources);
|
||||
Array msg = { p_resources };
|
||||
_put_msg("scene:reload_cached_files", msg);
|
||||
}
|
||||
|
||||
@@ -1337,9 +1308,7 @@ int ScriptEditorDebugger::_get_node_path_cache(const NodePath &p_path) {
|
||||
last_path_id++;
|
||||
|
||||
node_path_cache[p_path] = last_path_id;
|
||||
Array msg;
|
||||
msg.push_back(p_path);
|
||||
msg.push_back(last_path_id);
|
||||
Array msg = { p_path, last_path_id };
|
||||
_put_msg("scene:live_node_path", msg);
|
||||
|
||||
return last_path_id;
|
||||
@@ -1355,9 +1324,7 @@ int ScriptEditorDebugger::_get_res_path_cache(const String &p_path) {
|
||||
last_path_id++;
|
||||
|
||||
res_path_cache[p_path] = last_path_id;
|
||||
Array msg;
|
||||
msg.push_back(p_path);
|
||||
msg.push_back(last_path_id);
|
||||
Array msg = { p_path, last_path_id };
|
||||
_put_msg("scene:live_res_path", msg);
|
||||
|
||||
return last_path_id;
|
||||
@@ -1381,9 +1348,7 @@ void ScriptEditorDebugger::_method_changed(Object *p_base, const StringName &p_n
|
||||
NodePath path = EditorNode::get_singleton()->get_edited_scene()->get_path_to(node);
|
||||
int pathid = _get_node_path_cache(path);
|
||||
|
||||
Array msg;
|
||||
msg.push_back(pathid);
|
||||
msg.push_back(p_name);
|
||||
Array msg = { pathid, p_name };
|
||||
for (int i = 0; i < p_argcount; i++) {
|
||||
//no pointers, sorry
|
||||
msg.push_back(*p_args[i]);
|
||||
@@ -1399,9 +1364,7 @@ void ScriptEditorDebugger::_method_changed(Object *p_base, const StringName &p_n
|
||||
String respath = res->get_path();
|
||||
int pathid = _get_res_path_cache(respath);
|
||||
|
||||
Array msg;
|
||||
msg.push_back(pathid);
|
||||
msg.push_back(p_name);
|
||||
Array msg = { pathid, p_name };
|
||||
for (int i = 0; i < p_argcount; i++) {
|
||||
//no pointers, sorry
|
||||
msg.push_back(*p_args[i]);
|
||||
@@ -1426,17 +1389,11 @@ void ScriptEditorDebugger::_property_changed(Object *p_base, const StringName &p
|
||||
if (p_value.is_ref_counted()) {
|
||||
Ref<Resource> res = p_value;
|
||||
if (res.is_valid() && !res->get_path().is_empty()) {
|
||||
Array msg;
|
||||
msg.push_back(pathid);
|
||||
msg.push_back(p_property);
|
||||
msg.push_back(res->get_path());
|
||||
Array msg = { pathid, p_property, res->get_path() };
|
||||
_put_msg("scene:live_node_prop_res", msg);
|
||||
}
|
||||
} else {
|
||||
Array msg;
|
||||
msg.push_back(pathid);
|
||||
msg.push_back(p_property);
|
||||
msg.push_back(p_value);
|
||||
Array msg = { pathid, p_property, p_value };
|
||||
_put_msg("scene:live_node_prop", msg);
|
||||
}
|
||||
|
||||
@@ -1452,17 +1409,11 @@ void ScriptEditorDebugger::_property_changed(Object *p_base, const StringName &p
|
||||
if (p_value.is_ref_counted()) {
|
||||
Ref<Resource> res2 = p_value;
|
||||
if (res2.is_valid() && !res2->get_path().is_empty()) {
|
||||
Array msg;
|
||||
msg.push_back(pathid);
|
||||
msg.push_back(p_property);
|
||||
msg.push_back(res2->get_path());
|
||||
Array msg = { pathid, p_property, res2->get_path() };
|
||||
_put_msg("scene:live_res_prop_res", msg);
|
||||
}
|
||||
} else {
|
||||
Array msg;
|
||||
msg.push_back(pathid);
|
||||
msg.push_back(p_property);
|
||||
msg.push_back(p_value);
|
||||
Array msg = { pathid, p_property, p_value };
|
||||
_put_msg("scene:live_res_prop", msg);
|
||||
}
|
||||
|
||||
@@ -1508,8 +1459,7 @@ int ScriptEditorDebugger::get_stack_script_frame() const {
|
||||
bool ScriptEditorDebugger::request_stack_dump(const int &p_frame) {
|
||||
ERR_FAIL_COND_V(!is_session_active() || p_frame < 0, false);
|
||||
|
||||
Array msg;
|
||||
msg.push_back(p_frame);
|
||||
Array msg = { p_frame };
|
||||
_put_msg("get_stack_frame_vars", msg, debugging_thread_id);
|
||||
return true;
|
||||
}
|
||||
@@ -1553,8 +1503,7 @@ void ScriptEditorDebugger::_live_edit_clear() {
|
||||
void ScriptEditorDebugger::update_live_edit_root() {
|
||||
NodePath np = EditorNode::get_editor_data().get_edited_scene_live_edit_root();
|
||||
|
||||
Array msg;
|
||||
msg.push_back(np);
|
||||
Array msg = { np };
|
||||
if (EditorNode::get_singleton()->get_edited_scene()) {
|
||||
msg.push_back(EditorNode::get_singleton()->get_edited_scene()->get_scene_file_path());
|
||||
} else {
|
||||
@@ -1566,67 +1515,49 @@ void ScriptEditorDebugger::update_live_edit_root() {
|
||||
|
||||
void ScriptEditorDebugger::live_debug_create_node(const NodePath &p_parent, const String &p_type, const String &p_name) {
|
||||
if (live_debug) {
|
||||
Array msg;
|
||||
msg.push_back(p_parent);
|
||||
msg.push_back(p_type);
|
||||
msg.push_back(p_name);
|
||||
Array msg = { p_parent, p_type, p_name };
|
||||
_put_msg("scene:live_create_node", msg);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::live_debug_instantiate_node(const NodePath &p_parent, const String &p_path, const String &p_name) {
|
||||
if (live_debug) {
|
||||
Array msg;
|
||||
msg.push_back(p_parent);
|
||||
msg.push_back(p_path);
|
||||
msg.push_back(p_name);
|
||||
Array msg = { p_parent, p_path, p_name };
|
||||
_put_msg("scene:live_instantiate_node", msg);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::live_debug_remove_node(const NodePath &p_at) {
|
||||
if (live_debug) {
|
||||
Array msg;
|
||||
msg.push_back(p_at);
|
||||
Array msg = { p_at };
|
||||
_put_msg("scene:live_remove_node", msg);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::live_debug_remove_and_keep_node(const NodePath &p_at, ObjectID p_keep_id) {
|
||||
if (live_debug) {
|
||||
Array msg;
|
||||
msg.push_back(p_at);
|
||||
msg.push_back(p_keep_id);
|
||||
Array msg = { p_at, p_keep_id };
|
||||
_put_msg("scene:live_remove_and_keep_node", msg);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::live_debug_restore_node(ObjectID p_id, const NodePath &p_at, int p_at_pos) {
|
||||
if (live_debug) {
|
||||
Array msg;
|
||||
msg.push_back(p_id);
|
||||
msg.push_back(p_at);
|
||||
msg.push_back(p_at_pos);
|
||||
Array msg = { p_id, p_at, p_at_pos };
|
||||
_put_msg("scene:live_restore_node", msg);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::live_debug_duplicate_node(const NodePath &p_at, const String &p_new_name) {
|
||||
if (live_debug) {
|
||||
Array msg;
|
||||
msg.push_back(p_at);
|
||||
msg.push_back(p_new_name);
|
||||
Array msg = { p_at, p_new_name };
|
||||
_put_msg("scene:live_duplicate_node", msg);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::live_debug_reparent_node(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos) {
|
||||
if (live_debug) {
|
||||
Array msg;
|
||||
msg.push_back(p_at);
|
||||
msg.push_back(p_new_place);
|
||||
msg.push_back(p_new_name);
|
||||
msg.push_back(p_at_pos);
|
||||
Array msg = { p_at, p_new_place, p_new_name, p_at_pos };
|
||||
_put_msg("scene:live_reparent_node", msg);
|
||||
}
|
||||
}
|
||||
@@ -1636,8 +1567,7 @@ bool ScriptEditorDebugger::get_debug_mute_audio() const {
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::set_debug_mute_audio(bool p_mute) {
|
||||
Array msg;
|
||||
msg.push_back(p_mute);
|
||||
Array msg = { p_mute };
|
||||
_put_msg("scene:debug_mute_audio", msg);
|
||||
debug_mute_audio = p_mute;
|
||||
}
|
||||
@@ -1647,19 +1577,17 @@ CameraOverride ScriptEditorDebugger::get_camera_override() const {
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::set_camera_override(CameraOverride p_override) {
|
||||
Array msg;
|
||||
msg.push_back(p_override != CameraOverride::OVERRIDE_NONE);
|
||||
msg.push_back(p_override == CameraOverride::OVERRIDE_EDITORS);
|
||||
Array msg = {
|
||||
p_override != CameraOverride::OVERRIDE_NONE,
|
||||
p_override == CameraOverride::OVERRIDE_EDITORS
|
||||
};
|
||||
_put_msg("scene:override_cameras", msg);
|
||||
|
||||
camera_override = p_override;
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::set_breakpoint(const String &p_path, int p_line, bool p_enabled) {
|
||||
Array msg;
|
||||
msg.push_back(p_path);
|
||||
msg.push_back(p_line);
|
||||
msg.push_back(p_enabled);
|
||||
Array msg = { p_path, p_line, p_enabled };
|
||||
_put_msg("breakpoint", msg, debugging_thread_id != Thread::UNASSIGNED_ID ? debugging_thread_id : Thread::MAIN_ID);
|
||||
|
||||
TreeItem *path_item = breakpoints_tree->search_item_text(p_path);
|
||||
@@ -1992,9 +1920,7 @@ void ScriptEditorDebugger::send_message(const String &p_message, const Array &p_
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::toggle_profiler(const String &p_profiler, bool p_enable, const Array &p_data) {
|
||||
Array msg_data;
|
||||
msg_data.push_back(p_enable);
|
||||
msg_data.append_array(p_data);
|
||||
Array msg_data = { p_enable, p_data };
|
||||
_put_msg("profiler:" + p_profiler, msg_data);
|
||||
}
|
||||
|
||||
|
||||
@@ -1031,8 +1031,7 @@ void EditorResourcePicker::_gather_resources_to_duplicate(const Ref<Resource> p_
|
||||
p_item->set_icon(0, EditorNode::get_singleton()->get_object_icon(p_resource.ptr()));
|
||||
p_item->set_editable(0, true);
|
||||
|
||||
Array meta;
|
||||
meta.append(p_resource);
|
||||
Array meta = { p_resource };
|
||||
p_item->set_metadata(0, meta);
|
||||
|
||||
if (!p_property_name.is_empty()) {
|
||||
|
||||
@@ -321,9 +321,7 @@ void FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory
|
||||
if (main_scene == file_metadata) {
|
||||
file_item->set_custom_color(0, get_theme_color(SNAME("accent_color"), EditorStringName(Editor)));
|
||||
}
|
||||
Array udata;
|
||||
udata.push_back(tree_update_id);
|
||||
udata.push_back(file_item);
|
||||
Array udata = { tree_update_id, file_item };
|
||||
EditorResourcePreview::get_singleton()->queue_resource_preview(file_metadata, this, "_tree_thumbnail_done", udata);
|
||||
}
|
||||
} else {
|
||||
@@ -437,9 +435,7 @@ void FileSystemDock::_update_tree(const Vector<String> &p_uncollapsed_paths, boo
|
||||
ti->set_metadata(0, favorite);
|
||||
|
||||
if (!favorite.ends_with("/")) {
|
||||
Array udata;
|
||||
udata.push_back(tree_update_id);
|
||||
udata.push_back(ti);
|
||||
Array udata = { tree_update_id, ti };
|
||||
EditorResourcePreview::get_singleton()->queue_resource_preview(favorite, this, "_tree_thumbnail_done", udata);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,8 +512,7 @@ void SceneTreeEditor::_update_node(Node *p_node, TreeItem *p_item, bool p_part_o
|
||||
|
||||
String msg_temp;
|
||||
if (num_connections >= 1) {
|
||||
Array arr;
|
||||
arr.push_back(num_connections);
|
||||
Array arr = { num_connections };
|
||||
msg_temp += TTRN("Node has one connection.", "Node has {num} connections.", num_connections).format(arr, "{num}");
|
||||
if (num_groups >= 1) {
|
||||
msg_temp += "\n";
|
||||
|
||||
@@ -118,9 +118,7 @@ int EditorImportPlugin::get_format_version() const {
|
||||
}
|
||||
|
||||
void EditorImportPlugin::get_import_options(const String &p_path, List<ResourceImporter::ImportOption> *r_options, int p_preset) const {
|
||||
Array needed;
|
||||
needed.push_back("name");
|
||||
needed.push_back("default_value");
|
||||
Array needed = { "name", "default_value" };
|
||||
TypedArray<Dictionary> options;
|
||||
if (GDVIRTUAL_CALL(_get_import_options, p_path, p_preset, options)) {
|
||||
for (int i = 0; i < options.size(); i++) {
|
||||
|
||||
@@ -240,8 +240,7 @@ void ThemeItemImportTree::_update_items_tree() {
|
||||
}
|
||||
|
||||
if (color_amount > 0) {
|
||||
Array arr;
|
||||
arr.push_back(color_amount);
|
||||
Array arr = { color_amount };
|
||||
select_colors_label->set_text(TTRN("1 color", "{num} colors", color_amount).format(arr, "{num}"));
|
||||
select_all_colors_button->set_visible(true);
|
||||
select_full_colors_button->set_visible(true);
|
||||
@@ -254,8 +253,7 @@ void ThemeItemImportTree::_update_items_tree() {
|
||||
}
|
||||
|
||||
if (constant_amount > 0) {
|
||||
Array arr;
|
||||
arr.push_back(constant_amount);
|
||||
Array arr = { constant_amount };
|
||||
select_constants_label->set_text(TTRN("1 constant", "{num} constants", constant_amount).format(arr, "{num}"));
|
||||
select_all_constants_button->set_visible(true);
|
||||
select_full_constants_button->set_visible(true);
|
||||
@@ -268,8 +266,7 @@ void ThemeItemImportTree::_update_items_tree() {
|
||||
}
|
||||
|
||||
if (font_amount > 0) {
|
||||
Array arr;
|
||||
arr.push_back(font_amount);
|
||||
Array arr = { font_amount };
|
||||
select_fonts_label->set_text(TTRN("1 font", "{num} fonts", font_amount).format(arr, "{num}"));
|
||||
select_all_fonts_button->set_visible(true);
|
||||
select_full_fonts_button->set_visible(true);
|
||||
@@ -282,8 +279,7 @@ void ThemeItemImportTree::_update_items_tree() {
|
||||
}
|
||||
|
||||
if (font_size_amount > 0) {
|
||||
Array arr;
|
||||
arr.push_back(font_size_amount);
|
||||
Array arr = { font_size_amount };
|
||||
select_font_sizes_label->set_text(TTRN("1 font size", "{num} font sizes", font_size_amount).format(arr, "{num}"));
|
||||
select_all_font_sizes_button->set_visible(true);
|
||||
select_full_font_sizes_button->set_visible(true);
|
||||
@@ -296,8 +292,7 @@ void ThemeItemImportTree::_update_items_tree() {
|
||||
}
|
||||
|
||||
if (icon_amount > 0) {
|
||||
Array arr;
|
||||
arr.push_back(icon_amount);
|
||||
Array arr = { icon_amount };
|
||||
select_icons_label->set_text(TTRN("1 icon", "{num} icons", icon_amount).format(arr, "{num}"));
|
||||
select_all_icons_button->set_visible(true);
|
||||
select_full_icons_button->set_visible(true);
|
||||
@@ -312,8 +307,7 @@ void ThemeItemImportTree::_update_items_tree() {
|
||||
}
|
||||
|
||||
if (stylebox_amount > 0) {
|
||||
Array arr;
|
||||
arr.push_back(stylebox_amount);
|
||||
Array arr = { stylebox_amount };
|
||||
select_styleboxes_label->set_text(TTRN("1 stylebox", "{num} styleboxes", stylebox_amount).format(arr, "{num}"));
|
||||
select_all_styleboxes_button->set_visible(true);
|
||||
select_full_styleboxes_button->set_visible(true);
|
||||
@@ -460,8 +454,7 @@ void ThemeItemImportTree::_update_total_selected(Theme::DataType p_data_type) {
|
||||
if (count == 0) {
|
||||
total_selected_items_label->hide();
|
||||
} else {
|
||||
Array arr;
|
||||
arr.push_back(count);
|
||||
Array arr = { count };
|
||||
total_selected_items_label->set_text(TTRN("{num} currently selected", "{num} currently selected", count).format(arr, "{num}"));
|
||||
total_selected_items_label->show();
|
||||
}
|
||||
@@ -756,9 +749,7 @@ void ThemeItemImportTree::_import_selected() {
|
||||
// Arbitrary number of items to skip from reporting.
|
||||
// Reduces the number of UI updates that this causes when copying large themes.
|
||||
if (idx % 10 == 0) {
|
||||
Array arr;
|
||||
arr.push_back(idx + 1);
|
||||
arr.push_back(selected_items.size());
|
||||
Array arr = { idx + 1, selected_items.size() };
|
||||
ProgressDialog::get_singleton()->task_step("import_theme_items", TTR("Importing items {n}/{n}").format(arr, "{n}"), idx);
|
||||
}
|
||||
|
||||
|
||||
@@ -220,8 +220,7 @@ void GenericTilePolygonEditor::_base_control_draw() {
|
||||
color = color.darkened(0.3);
|
||||
}
|
||||
color.a = 0.5;
|
||||
Vector<Color> v_color;
|
||||
v_color.push_back(color);
|
||||
Vector<Color> v_color = { color };
|
||||
base_control->draw_polygon(polygon, v_color);
|
||||
|
||||
color.a = 0.7;
|
||||
@@ -1483,8 +1482,7 @@ void TileDataOcclusionShapeEditor::draw_over_tile(CanvasItem *p_canvas_item, Tra
|
||||
}
|
||||
color.a *= 0.5;
|
||||
|
||||
Vector<Color> debug_occlusion_color;
|
||||
debug_occlusion_color.push_back(color);
|
||||
Vector<Color> debug_occlusion_color = { color };
|
||||
|
||||
RenderingServer::get_singleton()->canvas_item_add_set_transform(p_canvas_item->get_canvas_item(), p_transform);
|
||||
for (int i = 0; i < tile_data->get_occluder_polygons_count(occlusion_layer); i++) {
|
||||
@@ -2065,14 +2063,12 @@ void TileDataTerrainsEditor::forward_draw_over_atlas(TileAtlasView *p_tile_atlas
|
||||
}
|
||||
|
||||
Vector2 end = p_transform.affine_inverse().xform(p_canvas_item->get_local_mouse_position());
|
||||
Vector<Point2> mouse_pos_rect_polygon;
|
||||
mouse_pos_rect_polygon.push_back(drag_start_pos);
|
||||
mouse_pos_rect_polygon.push_back(Vector2(end.x, drag_start_pos.y));
|
||||
mouse_pos_rect_polygon.push_back(end);
|
||||
mouse_pos_rect_polygon.push_back(Vector2(drag_start_pos.x, end.y));
|
||||
Vector<Point2> mouse_pos_rect_polygon = {
|
||||
drag_start_pos, Vector2(end.x, drag_start_pos.y),
|
||||
end, Vector2(drag_start_pos.x, end.y)
|
||||
};
|
||||
|
||||
Vector<Color> color;
|
||||
color.push_back(Color(1.0, 1.0, 1.0, 0.5));
|
||||
Vector<Color> color = { Color(1.0, 1.0, 1.0, 0.5) };
|
||||
|
||||
p_canvas_item->draw_set_transform_matrix(p_transform);
|
||||
|
||||
@@ -2132,8 +2128,7 @@ void TileDataTerrainsEditor::forward_draw_over_alternatives(TileAtlasView *p_til
|
||||
Transform2D xform;
|
||||
xform.set_origin(position);
|
||||
|
||||
Vector<Color> color;
|
||||
color.push_back(Color(1.0, 1.0, 1.0, 0.5));
|
||||
Vector<Color> color = { Color(1.0, 1.0, 1.0, 0.5) };
|
||||
|
||||
Vector<Vector2> polygon = tile_set->get_terrain_polygon(terrain_set);
|
||||
if (Geometry2D::is_point_in_polygon(xform.affine_inverse().xform(mouse_pos), polygon)) {
|
||||
@@ -2548,11 +2543,10 @@ void TileDataTerrainsEditor::forward_painting_atlas_gui_input(TileAtlasView *p_t
|
||||
}
|
||||
}
|
||||
|
||||
Vector<Point2> mouse_pos_rect_polygon;
|
||||
mouse_pos_rect_polygon.push_back(drag_start_pos);
|
||||
mouse_pos_rect_polygon.push_back(Vector2(mb->get_position().x, drag_start_pos.y));
|
||||
mouse_pos_rect_polygon.push_back(mb->get_position());
|
||||
mouse_pos_rect_polygon.push_back(Vector2(drag_start_pos.x, mb->get_position().y));
|
||||
Vector<Point2> mouse_pos_rect_polygon = {
|
||||
drag_start_pos, Vector2(mb->get_position().x, drag_start_pos.y),
|
||||
mb->get_position(), Vector2(drag_start_pos.x, mb->get_position().y)
|
||||
};
|
||||
|
||||
undo_redo->create_action(TTR("Painting Terrain"));
|
||||
for (const TileMapCell &E : edited) {
|
||||
@@ -3031,8 +3025,7 @@ void TileDataNavigationEditor::draw_over_tile(CanvasItem *p_canvas_item, Transfo
|
||||
Color random_variation_color;
|
||||
random_variation_color.set_hsv(color.get_h() + rand.random(-1.0, 1.0) * 0.05, color.get_s(), color.get_v() + rand.random(-1.0, 1.0) * 0.1);
|
||||
random_variation_color.a = color.a;
|
||||
Vector<Color> colors;
|
||||
colors.push_back(random_variation_color);
|
||||
Vector<Color> colors = { random_variation_color };
|
||||
|
||||
RenderingServer::get_singleton()->canvas_item_add_polygon(p_canvas_item->get_canvas_item(), vertices, colors);
|
||||
}
|
||||
|
||||
@@ -4285,10 +4285,7 @@ void TileMapLayerEditor::forward_canvas_draw_over_viewport(Control *p_overlay) {
|
||||
|
||||
if (!source || !source->has_tile(tile_atlas_coords) || !source->has_alternative_tile(tile_atlas_coords, tile_alternative_tile)) {
|
||||
// Generate a random color from the hashed identifier of the tiles.
|
||||
Array to_hash;
|
||||
to_hash.push_back(tile_source_id);
|
||||
to_hash.push_back(tile_atlas_coords);
|
||||
to_hash.push_back(tile_alternative_tile);
|
||||
Array to_hash = { tile_source_id, tile_atlas_coords, tile_alternative_tile };
|
||||
uint32_t hash = RandomPCG(to_hash.hash()).rand();
|
||||
|
||||
Color color;
|
||||
|
||||
@@ -1473,9 +1473,7 @@ void TileSetAtlasSourceEditor::_end_dragging() {
|
||||
undo_redo->add_do_method(tile_set_atlas_source, "move_tile_in_atlas", drag_start_tile_shape.position, drag_current_tile, tile_set_atlas_source->get_tile_size_in_atlas(drag_current_tile));
|
||||
undo_redo->add_do_method(this, "_set_selection_from_array", _get_selection_as_array());
|
||||
undo_redo->add_undo_method(tile_set_atlas_source, "move_tile_in_atlas", drag_current_tile, drag_start_tile_shape.position, drag_start_tile_shape.size);
|
||||
Array array;
|
||||
array.push_back(drag_start_tile_shape.position);
|
||||
array.push_back(0);
|
||||
Array array = { drag_start_tile_shape.position, 0 };
|
||||
undo_redo->add_undo_method(this, "_set_selection_from_array", array);
|
||||
undo_redo->commit_action(false);
|
||||
}
|
||||
@@ -1573,9 +1571,7 @@ void TileSetAtlasSourceEditor::_end_dragging() {
|
||||
undo_redo->add_do_method(tile_set_atlas_source, "move_tile_in_atlas", drag_start_tile_shape.position, drag_current_tile, tile_set_atlas_source->get_tile_size_in_atlas(drag_current_tile));
|
||||
undo_redo->add_do_method(this, "_set_selection_from_array", _get_selection_as_array());
|
||||
undo_redo->add_undo_method(tile_set_atlas_source, "move_tile_in_atlas", drag_current_tile, drag_start_tile_shape.position, drag_start_tile_shape.size);
|
||||
Array array;
|
||||
array.push_back(drag_start_tile_shape.position);
|
||||
array.push_back(0);
|
||||
Array array = { drag_start_tile_shape.position, 0 };
|
||||
undo_redo->add_undo_method(this, "_set_selection_from_array", array);
|
||||
undo_redo->commit_action(false);
|
||||
}
|
||||
@@ -1664,9 +1660,7 @@ void TileSetAtlasSourceEditor::_menu_option(int p_option) {
|
||||
case TILE_CREATE: {
|
||||
undo_redo->create_action(TTR("Create a tile"));
|
||||
undo_redo->add_do_method(tile_set_atlas_source, "create_tile", menu_option_coords);
|
||||
Array array;
|
||||
array.push_back(menu_option_coords);
|
||||
array.push_back(0);
|
||||
Array array = { menu_option_coords, 0 };
|
||||
undo_redo->add_do_method(this, "_set_selection_from_array", array);
|
||||
undo_redo->add_undo_method(tile_set_atlas_source, "remove_tile", menu_option_coords);
|
||||
undo_redo->add_undo_method(this, "_set_selection_from_array", _get_selection_as_array());
|
||||
@@ -2803,11 +2797,9 @@ void EditorPropertyTilePolygon::_polygons_changed() {
|
||||
}
|
||||
} else {
|
||||
// Multiple array of vertices or OccluderPolygon2D.
|
||||
Vector<String> changed_properties;
|
||||
Array values;
|
||||
Vector<String> changed_properties = { count_property };
|
||||
int count = generic_tile_polygon_editor->get_polygon_count();
|
||||
changed_properties.push_back(count_property);
|
||||
values.push_back(count);
|
||||
Array values = { count };
|
||||
for (int i = 0; i < count; i++) {
|
||||
changed_properties.push_back(vformat(element_pattern, i));
|
||||
if (base_type.is_empty()) {
|
||||
@@ -2941,8 +2933,7 @@ bool EditorInspectorPluginTileData::parse_property(Object *p_object, const Varia
|
||||
if (components[1] == "polygons_count") {
|
||||
EditorPropertyTilePolygon *ep = memnew(EditorPropertyTilePolygon);
|
||||
ep->setup_multiple_mode(vformat("physics_layer_%d/polygons", layer_index), vformat("physics_layer_%d/polygons_count", layer_index), vformat("physics_layer_%d/polygon_%%d/points", layer_index), "");
|
||||
Vector<String> properties;
|
||||
properties.push_back(p_path);
|
||||
Vector<String> properties = { p_path };
|
||||
int count = p_object->get(vformat("physics_layer_%d/polygons_count", layer_index));
|
||||
for (int i = 0; i < count; i++) {
|
||||
properties.push_back(vformat(vformat("physics_layer_%d/polygon_%d/points", layer_index, i)));
|
||||
|
||||
@@ -210,13 +210,14 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
|
||||
Ref<FontVariation> japanese_font_bold = make_bold_font(japanese_font, embolden_strength, &fallbacks_bold);
|
||||
|
||||
if (OS::get_singleton()->has_feature("system_fonts")) {
|
||||
PackedStringArray emoji_font_names;
|
||||
emoji_font_names.push_back("Apple Color Emoji");
|
||||
emoji_font_names.push_back("Segoe UI Emoji");
|
||||
emoji_font_names.push_back("Noto Color Emoji");
|
||||
emoji_font_names.push_back("Twitter Color Emoji");
|
||||
emoji_font_names.push_back("OpenMoji");
|
||||
emoji_font_names.push_back("EmojiOne Color");
|
||||
PackedStringArray emoji_font_names = {
|
||||
"Apple Color Emoji",
|
||||
"Segoe UI Emoji",
|
||||
"Noto Color Emoji",
|
||||
"Twitter Color Emoji",
|
||||
"OpenMoji",
|
||||
"EmojiOne Color"
|
||||
};
|
||||
Ref<SystemFont> emoji_font = load_system_font(emoji_font_names, font_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps, false);
|
||||
fallbacks.push_back(emoji_font);
|
||||
fallbacks_bold.push_back(emoji_font);
|
||||
@@ -238,8 +239,7 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
|
||||
if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) {
|
||||
Ref<FontFile> custom_font = load_external_font(custom_font_path, font_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps);
|
||||
{
|
||||
TypedArray<Font> fallback_custom;
|
||||
fallback_custom.push_back(default_font);
|
||||
TypedArray<Font> fallback_custom = { default_font };
|
||||
custom_font->set_fallbacks(fallback_custom);
|
||||
}
|
||||
default_fc->set_base_font(custom_font);
|
||||
@@ -255,8 +255,7 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
|
||||
if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) {
|
||||
Ref<FontFile> custom_font = load_external_font(custom_font_path, font_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps, font_allow_msdf);
|
||||
{
|
||||
TypedArray<Font> fallback_custom;
|
||||
fallback_custom.push_back(default_font_msdf);
|
||||
TypedArray<Font> fallback_custom = { default_font_msdf };
|
||||
custom_font->set_fallbacks(fallback_custom);
|
||||
}
|
||||
default_fc_msdf->set_base_font(custom_font);
|
||||
@@ -272,16 +271,14 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
|
||||
if (custom_font_path_bold.length() > 0 && dir->file_exists(custom_font_path_bold)) {
|
||||
Ref<FontFile> custom_font = load_external_font(custom_font_path_bold, font_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps);
|
||||
{
|
||||
TypedArray<Font> fallback_custom;
|
||||
fallback_custom.push_back(default_font_bold);
|
||||
TypedArray<Font> fallback_custom = { default_font_bold };
|
||||
custom_font->set_fallbacks(fallback_custom);
|
||||
}
|
||||
bold_fc->set_base_font(custom_font);
|
||||
} else if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) {
|
||||
Ref<FontFile> custom_font = load_external_font(custom_font_path, font_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps);
|
||||
{
|
||||
TypedArray<Font> fallback_custom;
|
||||
fallback_custom.push_back(default_font_bold);
|
||||
TypedArray<Font> fallback_custom = { default_font_bold };
|
||||
custom_font->set_fallbacks(fallback_custom);
|
||||
}
|
||||
bold_fc->set_base_font(custom_font);
|
||||
@@ -298,16 +295,14 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
|
||||
if (custom_font_path_bold.length() > 0 && dir->file_exists(custom_font_path_bold)) {
|
||||
Ref<FontFile> custom_font = load_external_font(custom_font_path_bold, font_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps, font_allow_msdf);
|
||||
{
|
||||
TypedArray<Font> fallback_custom;
|
||||
fallback_custom.push_back(default_font_bold_msdf);
|
||||
TypedArray<Font> fallback_custom = { default_font_bold_msdf };
|
||||
custom_font->set_fallbacks(fallback_custom);
|
||||
}
|
||||
bold_fc_msdf->set_base_font(custom_font);
|
||||
} else if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) {
|
||||
Ref<FontFile> custom_font = load_external_font(custom_font_path, font_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps, font_allow_msdf);
|
||||
{
|
||||
TypedArray<Font> fallback_custom;
|
||||
fallback_custom.push_back(default_font_bold_msdf);
|
||||
TypedArray<Font> fallback_custom = { default_font_bold_msdf };
|
||||
custom_font->set_fallbacks(fallback_custom);
|
||||
}
|
||||
bold_fc_msdf->set_base_font(custom_font);
|
||||
@@ -324,8 +319,7 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
|
||||
if (custom_font_path_source.length() > 0 && dir->file_exists(custom_font_path_source)) {
|
||||
Ref<FontFile> custom_font = load_external_font(custom_font_path_source, font_mono_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps);
|
||||
{
|
||||
TypedArray<Font> fallback_custom;
|
||||
fallback_custom.push_back(default_font_mono);
|
||||
TypedArray<Font> fallback_custom = { default_font_mono };
|
||||
custom_font->set_fallbacks(fallback_custom);
|
||||
}
|
||||
mono_fc->set_base_font(custom_font);
|
||||
|
||||
Reference in New Issue
Block a user