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 GDDBEditor
|
||||
"""
|
||||
|
||||
class_name GDDBEditor
|
||||
|
||||
tool
|
||||
extends Tabs
|
||||
extends TabBar
|
||||
|
||||
var m_name = ""
|
||||
var m_database = null
|
||||
@@ -14,23 +14,23 @@ var m_filepath = ""
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void :
|
||||
set_tab_align(Tabs.ALIGN_LEFT)
|
||||
set_tab_close_display_policy(Tabs.CLOSE_BUTTON_SHOW_ALWAYS)
|
||||
set_tab_alignment(TabBar.ALIGN_LEFT)
|
||||
set_tab_close_display_policy(TabBar.CLOSE_BUTTON_SHOW_ALWAYS)
|
||||
|
||||
$tables_list.connect("resize_tables_list", self, "on_resize_the_table_list")
|
||||
$tables_list.connect("add_table", self, "on_add_table")
|
||||
$tables_list.connect("edit_table_name", self, "on_edit_table")
|
||||
$tables_list.connect("delete_table", self, "on_delete_table")
|
||||
$tables_list.connect("select_table", self, "on_select_table")
|
||||
$tables_list.connect("resize_tables_list", Callable(self, "on_resize_the_table_list"))
|
||||
$tables_list.connect("add_table", Callable(self, "on_add_table"))
|
||||
$tables_list.connect("edit_table_name", Callable(self, "on_edit_table"))
|
||||
$tables_list.connect("delete_table", Callable(self, "on_delete_table"))
|
||||
$tables_list.connect("select_table", Callable(self, "on_select_table"))
|
||||
|
||||
$table_editor.connect("set_dirty", self, "on_set_dirty")
|
||||
$table_editor.connect("set_dirty", Callable(self, "on_set_dirty"))
|
||||
|
||||
$delete_table_dlg.connect("delete_table", self, "on_confirm_delete_table")
|
||||
$delete_table_dlg.connect("delete_table", Callable(self, "on_confirm_delete_table"))
|
||||
|
||||
$new_table_dlg.connect("cancel_dialog", self, "on_close_new_table_dlg")
|
||||
$new_table_dlg.get_close_button().connect("pressed", self, "on_close_new_table_dlg")
|
||||
$new_table_dlg.connect("cancel_dialog", Callable(self, "on_close_new_table_dlg"))
|
||||
$new_table_dlg.get_close_button().connect("pressed", Callable(self, "on_close_new_table_dlg"))
|
||||
|
||||
$error_dlg.connect("confirmed", self, "on_retry_create_table")
|
||||
$error_dlg.connect("confirmed", Callable(self, "on_retry_create_table"))
|
||||
|
||||
# resizing the tables list
|
||||
func on_resize_the_table_list(diff_x : float) -> void :
|
||||
@@ -56,7 +56,7 @@ func on_resize_the_table_list(diff_x : float) -> void :
|
||||
# overrides the member from base class
|
||||
func set_name(ctrl_name) -> void :
|
||||
m_name = ctrl_name
|
||||
.set_name(ctrl_name)
|
||||
super.set_name(ctrl_name)
|
||||
|
||||
# sets the database; for easy access
|
||||
func set_database(db) -> void :
|
||||
@@ -92,9 +92,9 @@ func get_db_name() -> String :
|
||||
func set_dirty(dirty) -> void :
|
||||
if(dirty):
|
||||
var title = m_name + "*"
|
||||
.set_name(title)
|
||||
super.set_name(title)
|
||||
else:
|
||||
.set_name(m_name)
|
||||
super.set_name(m_name)
|
||||
|
||||
# called when the user presses the "add_table" button from the "tables_list/tables_header"
|
||||
func on_add_table() -> void :
|
||||
@@ -102,13 +102,13 @@ func on_add_table() -> void :
|
||||
$new_table_dlg.set_dld_type(gddb_types.e_new_dlg_type_new)
|
||||
$new_table_dlg.set_table_id(gddb_constants.c_invalid_id)
|
||||
$new_table_dlg.set_init_name("")
|
||||
$new_table_dlg.connect("create_new_table", self, "on_create_table")
|
||||
$new_table_dlg.connect("create_new_table", Callable(self, "on_create_table"))
|
||||
$new_table_dlg.popup_centered()
|
||||
|
||||
# called when the user accepts the name of the table in the "new_table_dlg"
|
||||
func on_create_table(table_name : String) -> void :
|
||||
# print("GDDBEditor::on_create_table(" + table_name + ")")
|
||||
$new_table_dlg.disconnect("create_new_table", self, "on_create_table")
|
||||
$new_table_dlg.disconnect("create_new_table", Callable(self, "on_create_table"))
|
||||
var table_id = m_database.add_table(table_name)
|
||||
if(table_id == gddb_constants.c_invalid_id):
|
||||
$error_dlg.set_text("Table with the name \"" + table_name + "\" already exists" )
|
||||
@@ -132,7 +132,7 @@ func on_edit_table(table_id : int, table_name : String) -> void :
|
||||
$new_table_dlg.set_dld_type(gddb_types.e_new_dlg_type_edit)
|
||||
$new_table_dlg.set_table_id(table_id)
|
||||
$new_table_dlg.set_init_name(table_name)
|
||||
$new_table_dlg.connect("create_new_table", self, "on_table_name_edited")
|
||||
$new_table_dlg.connect("create_new_table", Callable(self, "on_table_name_edited"))
|
||||
$new_table_dlg.popup_centered()
|
||||
|
||||
# gets called when canceling the new_table_dlg
|
||||
@@ -140,9 +140,9 @@ func on_close_new_table_dlg() -> void :
|
||||
# print("GDDBEditor::on_close_new_table_dlg()")
|
||||
var dlg_type = $new_table_dlg.get_dlg_type()
|
||||
if(dlg_type == gddb_types.e_new_dlg_type_new):
|
||||
$new_table_dlg.disconnect("create_new_table", self, "on_create_table")
|
||||
$new_table_dlg.disconnect("create_new_table", Callable(self, "on_create_table"))
|
||||
elif(dlg_type == gddb_types.e_new_dlg_type_edit):
|
||||
$new_table_dlg.disconnect("create_new_table", self, "on_table_name_edited")
|
||||
$new_table_dlg.disconnect("create_new_table", Callable(self, "on_table_name_edited"))
|
||||
|
||||
# called when the user presses the "delete_table" from the "tables/list/table"
|
||||
func on_delete_table(table_id : int) -> void :
|
||||
@@ -155,7 +155,7 @@ func on_delete_table(table_id : int) -> void :
|
||||
# called when the user accepts the name of the table in the "new_table_dlg"
|
||||
func on_table_name_edited(table_name : String) -> void :
|
||||
# print("GDDBEditor::on_table_name_edited(" + table_name + ")")
|
||||
$new_table_dlg.disconnect("create_new_table", self, "on_table_name_edited")
|
||||
$new_table_dlg.disconnect("create_new_table", Callable(self, "on_table_name_edited"))
|
||||
var table_id = $new_table_dlg.get_table_id()
|
||||
if(!m_database.edit_table_name(table_name, table_id)):
|
||||
$error_dlg.set_text("Table with the name \"" + table_name + "\" already exists" )
|
||||
@@ -198,7 +198,7 @@ func save_database() -> void:
|
||||
|
||||
# returns true if the database can be saved, otherwise false
|
||||
func can_save_database() -> bool:
|
||||
return !m_database.get_db_filepath().empty()
|
||||
return !m_database.get_db_filepath().is_empty()
|
||||
|
||||
# sets the database's path
|
||||
func set_database_filepath(filepath : String) -> void:
|
||||
|
||||
Reference in New Issue
Block a user