Run godot --convert-3to4 (automated conversion)
Apply Godot 4.6 automated conversion: renames Spatial.translate->position, margin_*->offset_*, tool->@tool, .empty()->.is_empty(), DynamicFont->FontFile, onready->@onready, export()->@export, and many more. 127 files changed by the tool. Manual fixes still required for: - godot_db_manager plugin (incompatible APIs: WindowDialog, Tabs, etc.) - lod plugin (Spatial -> Node3D renames) - ResourceLoader.load_interactive removed -> load_threaded_request - OS.set_window_fullscreen removed -> DisplayServer - Viewport.set_size_override removed Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
@tool
|
||||
"""
|
||||
class GDDBNewDBDlg
|
||||
"""
|
||||
|
||||
class_name GDDBNewTableDlg
|
||||
|
||||
tool
|
||||
extends WindowDialog
|
||||
extends Window
|
||||
|
||||
signal create_new_table
|
||||
signal cancel_dialog
|
||||
@@ -16,10 +16,10 @@ var m_current_table_name = ""
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
$v_layout/buttons/ok_btn.connect("pressed", self, "on_ok_btn_pressed")
|
||||
$v_layout/buttons/cancel_btn.connect("pressed", self, "on_cancel_btn_pressed")
|
||||
$v_layout/table_info/table_edt.connect("text_changed", self, "on_text_changed")
|
||||
$v_layout/table_info/table_edt.connect("text_entered", self, "on_text_confirmed")
|
||||
$v_layout/buttons/ok_btn.connect("pressed", Callable(self, "on_ok_btn_pressed"))
|
||||
$v_layout/buttons/cancel_btn.connect("pressed", Callable(self, "on_cancel_btn_pressed"))
|
||||
$v_layout/table_info/table_edt.connect("text_changed", Callable(self, "on_text_changed"))
|
||||
$v_layout/table_info/table_edt.connect("text_submitted", Callable(self, "on_text_confirmed"))
|
||||
m_current_table_name = ""
|
||||
|
||||
# sets the type of the dialog
|
||||
@@ -58,18 +58,18 @@ func on_text_changed(new_text: String) -> void:
|
||||
m_current_table_name = $v_layout/table_info/table_edt.get_text()
|
||||
else:
|
||||
$v_layout/table_info/table_edt.set_text(m_current_table_name)
|
||||
$v_layout/table_info/table_edt.set_cursor_position(m_current_table_name.length())
|
||||
$v_layout/table_info/table_edt.set_caret_column(m_current_table_name.length())
|
||||
|
||||
# called when the user presses the ENTER key
|
||||
func on_text_confirmed(text : String) -> void:
|
||||
if(m_current_table_name.empty()):
|
||||
if(m_current_table_name.is_empty()):
|
||||
return
|
||||
handle_table_name()
|
||||
hide()
|
||||
|
||||
# called when the OK button is pressed
|
||||
func on_ok_btn_pressed() -> void:
|
||||
if(!m_current_table_name.empty()):
|
||||
if(!m_current_table_name.is_empty()):
|
||||
handle_table_name()
|
||||
hide()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user