Skip to content

Commit e27695e

Browse files
committed
Add more missing properties/methods to the converter.
icon_align -> icon_alignment rect_min_size -> custom_minimum_size get_tree().set_input_as_handled() -> get_viewport().set_input_as_handled() _unhandled_key_input(event: InputEventKey) -> _unhandled_key_input(event: InputEvent) And C# equivalents
1 parent 621e329 commit e27695e

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

editor/project_converter_3_to_4.cpp

+29-1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ static const char *gdscript_function_renames[][2] = {
210210
// { "set_v_offset", "set_drag_vertical_offset" }, // Camera2D broke Camera3D, PathFollow3D, PathFollow2D
211211
// {"get_points","get_points_id"},// Astar, broke Line2D, Convexpolygonshape
212212
// {"get_v_scroll","get_v_scroll_bar"},//ItemList, broke TextView
213+
// { "get_stylebox", "get_theme_stylebox" }, // Control - Will rename the method in Theme as well, skipping
213214
{ "_about_to_show", "_about_to_popup" }, // ColorPickerButton
214215
{ "_get_configuration_warning", "_get_configuration_warnings" }, // Node
215216
{ "_set_current", "set_current" }, // Camera2D
@@ -665,6 +666,7 @@ static const char *csharp_function_renames[][2] = {
665666
// { "SetVOffset", "SetDragVerticalOffset" }, // Camera2D broke Camera3D, PathFollow3D, PathFollow2D
666667
// {"GetPoints","GetPointsId"},// Astar, broke Line2D, Convexpolygonshape
667668
// {"GetVScroll","GetVScrollBar"},//ItemList, broke TextView
669+
// { "GetStylebox", "GetThemeStylebox" }, // Control - Will rename the method in Theme as well, skipping
668670
{ "AddSpatialGizmoPlugin", "AddNode3dGizmoPlugin" }, // EditorPlugin
669671
{ "RenderingServer", "GetTabAlignment" }, // Tab
670672
{ "_AboutToShow", "_AboutToPopup" }, // ColorPickerButton
@@ -1078,6 +1080,7 @@ static const char *gdscript_properties_renames[][2] = {
10781080
// { "zfar", "far" }, // Camera3D
10791081
// { "znear", "near" }, // Camera3D
10801082
// { "filename", "scene_file_path" }, // Node
1083+
// { "pressed", "button_pressed" }, // BaseButton - Will also rename the signal, skipping for now
10811084
{ "as_normalmap", "as_normal_map" }, // NoiseTexture
10821085
{ "bbcode_text", "text" }, // RichTextLabel
10831086
{ "bg", "panel" }, // Theme
@@ -1113,6 +1116,7 @@ static const char *gdscript_properties_renames[][2] = {
11131116
{ "gravity_vec", "gravity_direction" }, // Area2D
11141117
{ "hint_tooltip", "tooltip_text" }, // Control
11151118
{ "hseparation", "h_separation" }, // Theme
1119+
{ "icon_align", "icon_alignment" }, // Button
11161120
{ "iterations_per_second", "physics_ticks_per_second" }, // Engine
11171121
{ "invert_enable", "invert_enabled" }, // Polygon2D
11181122
{ "margin_bottom", "offset_bottom" }, // Control broke NinePatchRect, StyleBox
@@ -1137,7 +1141,7 @@ static const char *gdscript_properties_renames[][2] = {
11371141
{ "rect_position", "position" }, // Control
11381142
{ "rect_global_position", "global_position" }, // Control
11391143
{ "rect_size", "size" }, // Control
1140-
{ "rect_min_size", "minimum_size" }, // Control
1144+
{ "rect_min_size", "custom_minimum_size" }, // Control
11411145
{ "rect_rotation", "rotation" }, // Control
11421146
{ "rect_scale", "scale" }, // Control
11431147
{ "rect_pivot_offset", "pivot_offset" }, // Control
@@ -1192,6 +1196,7 @@ static const char *csharp_properties_renames[][2] = {
11921196
// { "WrapEnabled", "WrapMode" }, // TextEdit
11931197
// { "Zfar", "Far" }, // Camera3D
11941198
// { "Znear", "Near" }, // Camera3D
1199+
// { "Pressed", "ButtonPressed" }, // BaseButton - Will also rename the signal, skipping for now
11951200
{ "AsNormalmap", "AsNormalMap" }, // NoiseTexture
11961201
{ "BbcodeText", "Text" }, // RichTextLabel
11971202
{ "CaretBlinkSpeed", "CaretBlinkInterval" }, // TextEdit, LineEdit
@@ -1221,6 +1226,7 @@ static const char *csharp_properties_renames[][2] = {
12211226
{ "GravityVec", "GravityDirection" }, // Area2D
12221227
{ "HintTooltip", "TooltipText" }, // Control
12231228
{ "Hseparation", "HSeparation" }, // Theme
1229+
{ "IconAlign", "IconAlignment" }, // Button
12241230
{ "IterationsPerSecond", "PhysicsTicksPerSecond" }, // Engine
12251231
{ "InvertEnable", "InvertEnabled" }, // Polygon2D
12261232
{ "MarginBottom", "OffsetBottom" }, // Control broke NinePatchRect, StyleBox
@@ -3880,11 +3886,33 @@ void ProjectConverter3To4::process_gdscript_line(String &line, const RegExContai
38803886
if (line.contains("OS.set_window_title")) {
38813887
line = line.replace("OS.set_window_title", "get_window().set_title");
38823888
}
3889+
3890+
// get_tree().set_input_as_handled() -> get_viewport().set_input_as_handled()
3891+
if (line.contains("get_tree().set_input_as_handled()")) {
3892+
line = line.replace("get_tree().set_input_as_handled()", "get_viewport().set_input_as_handled()");
3893+
}
3894+
3895+
// Fix the simple case of using _unhandled_key_input
3896+
// func _unhandled_key_input(event: InputEventKey) -> _unhandled_key_input(event: InputEvent)
3897+
if (line.contains("_unhandled_key_input(event: InputEventKey)")) {
3898+
line = line.replace("_unhandled_key_input(event: InputEventKey)", "_unhandled_key_input(event: InputEvent)");
3899+
}
38833900
}
38843901

38853902
void ProjectConverter3To4::process_csharp_line(String &line, const RegExContainer &reg_container) {
38863903
line = line.replace("OS.GetWindowSafeArea()", "DisplayServer.ScreenGetUsableRect()");
38873904

3905+
// GetTree().SetInputAsHandled() -> GetViewport().SetInputAsHandled()
3906+
if (line.contains("GetTree().SetInputAsHandled()")) {
3907+
line = line.replace("GetTree().SetInputAsHandled()", "GetViewport().SetInputAsHandled()");
3908+
}
3909+
3910+
// Fix the simple case of using _UnhandledKeyInput
3911+
// func _UnhandledKeyInput(InputEventKey @event) -> _UnhandledKeyInput(InputEvent @event)
3912+
if (line.contains("_UnhandledKeyInput(InputEventKey @event)")) {
3913+
line = line.replace("_UnhandledKeyInput(InputEventKey @event)", "_UnhandledKeyInput(InputEvent @event)");
3914+
}
3915+
38883916
// -- Connect(,,,things) -> Connect(,Callable(,),things) Object
38893917
if (line.contains("Connect(")) {
38903918
int start = line.find("Connect(");

0 commit comments

Comments
 (0)