Fixes to the 2to3 project exporter
This commit is contained in:
parent
408f91024c
commit
63a9b02131
@ -143,12 +143,12 @@ static const char *globals_renames[][2] = {
|
|||||||
/* [physics_2d] */
|
/* [physics_2d] */
|
||||||
{ "physics_2d/thread_model", "physics/2d/thread_model" },
|
{ "physics_2d/thread_model", "physics/2d/thread_model" },
|
||||||
//{ "physics_2d/motion_fix_enabled", "" },
|
//{ "physics_2d/motion_fix_enabled", "" },
|
||||||
{ "physics_2d/sleep_threashold_linear", "physics/2d/sleep_threshold_linear" }, // FIXME: Typo in 2.1 and master, fix in master
|
{ "physics_2d/sleep_threashold_linear", "physics/2d/sleep_threshold_linear" },
|
||||||
{ "physics_2d/sleep_threshold_angular", "physics/2d/sleep_threshold_angular" },
|
{ "physics_2d/sleep_threshold_angular", "physics/2d/sleep_threshold_angular" },
|
||||||
{ "physics_2d/time_before_sleep", "physics/2d/time_before_sleep" },
|
{ "physics_2d/time_before_sleep", "physics/2d/time_before_sleep" },
|
||||||
{ "physics_2d/bp_hash_table_size", "physics/2d/bp_hash_table_size" },
|
{ "physics_2d/bp_hash_table_size", "physics/2d/bp_hash_table_size" },
|
||||||
{ "physics_2d/cell_size", "physics/2d/cell_size" },
|
{ "physics_2d/cell_size", "physics/2d/cell_size" },
|
||||||
{ "physics_2d/large_object_surface_treshold_in_cells", "physics/2d/large_object_surface_threshold_in_cells" }, // FIXME: Typo in 2.1 and master, fix in master
|
{ "physics_2d/large_object_surface_treshold_in_cells", "physics/2d/large_object_surface_threshold_in_cells" },
|
||||||
{ "physics_2d/default_gravity", "physics/2d/default_gravity" },
|
{ "physics_2d/default_gravity", "physics/2d/default_gravity" },
|
||||||
{ "physics_2d/default_gravity_vector", "physics/2d/default_gravity" },
|
{ "physics_2d/default_gravity_vector", "physics/2d/default_gravity" },
|
||||||
{ "physics_2d/default_linear_damp", "physics/2d/default_linear_damp" },
|
{ "physics_2d/default_linear_damp", "physics/2d/default_linear_damp" },
|
||||||
@ -475,6 +475,7 @@ static const char *prop_renames[][2] = {
|
|||||||
{ "cell/center_y", "cell_center_y" },
|
{ "cell/center_y", "cell_center_y" },
|
||||||
{ "cell/center_z", "cell_center_z" },
|
{ "cell/center_z", "cell_center_z" },
|
||||||
{ "cell/scale", "cell_scale" },
|
{ "cell/scale", "cell_scale" },
|
||||||
|
{ "region", "region_enabled" },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -490,10 +491,12 @@ static const char *type_renames[][2] = {
|
|||||||
{ "Particles2D", "Node2D" },
|
{ "Particles2D", "Node2D" },
|
||||||
{ "SampleLibrary", "Resource" },
|
{ "SampleLibrary", "Resource" },
|
||||||
{ "TextureFrame", "TextureRect" },
|
{ "TextureFrame", "TextureRect" },
|
||||||
|
{ "Patch9Frame", "NinePatchRect" },
|
||||||
{ "FixedMaterial", "SpatialMaterial" },
|
{ "FixedMaterial", "SpatialMaterial" },
|
||||||
{ "ColorRamp", "Gradient" },
|
{ "ColorRamp", "Gradient" },
|
||||||
{ "CanvasItemShader", "Shader" },
|
{ "CanvasItemShader", "Shader" },
|
||||||
{ "CanvasItemMaterial", "ShaderMaterial" },
|
{ "CanvasItemMaterial", "ShaderMaterial" },
|
||||||
|
{ "TestCube", "MeshInstance" },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -513,6 +516,7 @@ static const char *signal_renames[][2] = {
|
|||||||
{ "modal_close", "modal_closed" },
|
{ "modal_close", "modal_closed" },
|
||||||
{ "enter_tree", "tree_entered" },
|
{ "enter_tree", "tree_entered" },
|
||||||
{ "exit_tree", "tree_exited" },
|
{ "exit_tree", "tree_exited" },
|
||||||
|
{ "input_event", "gui_input" },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -543,6 +547,19 @@ void EditorExportGodot3::_rename_properties(const String &p_type, List<ExportDat
|
|||||||
if (E->get().name == "rotation_deg") {
|
if (E->get().name == "rotation_deg") {
|
||||||
E->get().value = E->get().value.operator real_t() * -1.0;
|
E->get().value = E->get().value.operator real_t() * -1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Anchors changed from Begin,End,Ratio,Center to Begin,End,Center
|
||||||
|
if (E->get().name.begins_with("anchor_")) {
|
||||||
|
switch (E->get().value.operator int()) {
|
||||||
|
case 0: // Begin
|
||||||
|
case 1: // End
|
||||||
|
break;
|
||||||
|
case 2: // Ratio
|
||||||
|
E->get().value = 0;
|
||||||
|
case 3: // Center
|
||||||
|
E->get().value = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1321,6 +1338,14 @@ void EditorExportGodot3::_save_text(const String &p_path, ExportData &resource)
|
|||||||
node_txt += " instance=" + prop + "";
|
node_txt += " instance=" + prop + "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!resource.nodes[i].groups.empty()) {
|
||||||
|
node_txt += " groups=[\n";
|
||||||
|
for (int j = 0; j < resource.nodes[i].groups.size(); j++) {
|
||||||
|
node_txt += "\"" + resource.nodes[i].groups[j] + "\",\n";
|
||||||
|
}
|
||||||
|
node_txt += "]";
|
||||||
|
}
|
||||||
|
|
||||||
node_txt += "]\n";
|
node_txt += "]\n";
|
||||||
f->store_line(node_txt);
|
f->store_line(node_txt);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user