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,10 +1,10 @@
|
||||
@tool
|
||||
"""
|
||||
class GDDBDataPanel
|
||||
"""
|
||||
|
||||
class_name GDDBDataPanel
|
||||
|
||||
tool
|
||||
extends PopupPanel
|
||||
|
||||
signal select_data
|
||||
@@ -16,8 +16,8 @@ var m_table = null
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
connect("about_to_show", self, "on_about_to_show")
|
||||
$ItemList.connect("item_selected", self, "on_item_selected")
|
||||
connect("about_to_popup", Callable(self, "on_about_to_show"))
|
||||
$ItemList.connect("item_selected", Callable(self, "on_item_selected"))
|
||||
|
||||
# sets property id
|
||||
func set_prop_id(prop_id : int) -> void :
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://addons/godot_db_manager/dlgs/data_dlg.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_12.tres" type="DynamicFont" id=2]
|
||||
|
||||
[node name="data_dlg" type="PopupPanel"]
|
||||
anchor_right = 0.285625
|
||||
anchor_bottom = 0.351111
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ItemList" type="ItemList" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 4.0
|
||||
margin_top = 4.0
|
||||
margin_right = -4.0
|
||||
margin_bottom = -4.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
items = [ "ababab", null, false, "cdcdcd", null, false, "efefef", null, false ]
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://addons/godot_db_manager/dlgs/data_dlg.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_12.tres" type="FontFile" id=2]
|
||||
|
||||
[node name="data_dlg" type="PopupPanel"]
|
||||
anchor_right = 0.285625
|
||||
anchor_bottom = 0.351111
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ItemList" type="ItemList" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 4.0
|
||||
offset_top = 4.0
|
||||
offset_right = -4.0
|
||||
offset_bottom = -4.0
|
||||
theme_override_fonts/font = ExtResource( 2 )
|
||||
items = [ "ababab", null, false, "cdcdcd", null, false, "efefef", null, false ]
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
"""
|
||||
class GDDBDeletePropDlg
|
||||
"""
|
||||
|
||||
class_name GDDBDeletePropDlg
|
||||
|
||||
tool
|
||||
extends WindowDialog
|
||||
|
||||
signal delete_prop
|
||||
|
||||
var m_prop_id = gddb_constants.c_invalid_id
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void :
|
||||
$v_layout/buttons/ok_btn.connect("pressed", self, "on_ok_btn_pressed")
|
||||
$v_layout/buttons/cancel_btn.connect("pressed", self, "on_cancel_btn_pressed")
|
||||
|
||||
# sets the property id
|
||||
func set_prop_id(prop_id : int) -> void :
|
||||
m_prop_id = prop_id
|
||||
|
||||
# returns the property id
|
||||
func get_prop_id() -> int :
|
||||
return m_prop_id
|
||||
|
||||
func set_prop_name(prop_name : String) -> void:
|
||||
var text = "Delete property with name \"" + prop_name + "\" ?"
|
||||
$v_layout/prop_info/prop_lbl.set_text(text)
|
||||
|
||||
# returns the table id
|
||||
func get_table_id() -> int :
|
||||
return m_prop_id
|
||||
|
||||
# called when the OK button is pressed
|
||||
func on_ok_btn_pressed() -> void :
|
||||
emit_signal("delete_prop")
|
||||
hide()
|
||||
|
||||
func on_cancel_btn_pressed() -> void:
|
||||
hide()
|
||||
@tool
|
||||
"""
|
||||
class GDDBDeletePropDlg
|
||||
"""
|
||||
|
||||
class_name GDDBDeletePropDlg
|
||||
|
||||
extends Window
|
||||
|
||||
signal delete_prop
|
||||
|
||||
var m_prop_id = gddb_constants.c_invalid_id
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void :
|
||||
$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"))
|
||||
|
||||
# sets the property id
|
||||
func set_prop_id(prop_id : int) -> void :
|
||||
m_prop_id = prop_id
|
||||
|
||||
# returns the property id
|
||||
func get_prop_id() -> int :
|
||||
return m_prop_id
|
||||
|
||||
func set_prop_name(prop_name : String) -> void:
|
||||
var text = "Delete property with name \"" + prop_name + "\" ?"
|
||||
$v_layout/prop_info/prop_lbl.set_text(text)
|
||||
|
||||
# returns the table id
|
||||
func get_table_id() -> int :
|
||||
return m_prop_id
|
||||
|
||||
# called when the OK button is pressed
|
||||
func on_ok_btn_pressed() -> void :
|
||||
emit_signal("delete_prop")
|
||||
hide()
|
||||
|
||||
func on_cancel_btn_pressed() -> void:
|
||||
hide()
|
||||
|
||||
@@ -1,66 +1,66 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/godot_db_manager/dlgs/delete_prop_dlg.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_14.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_12.tres" type="DynamicFont" id=3]
|
||||
|
||||
[node name="delete_prop_dlg" type="WindowDialog"]
|
||||
visible = true
|
||||
anchor_right = 0.257
|
||||
anchor_bottom = 0.084
|
||||
margin_right = 0.799988
|
||||
margin_bottom = 0.399994
|
||||
focus_next = NodePath("v_layout/buttons/ok_btn")
|
||||
focus_mode = 1
|
||||
custom_fonts/title_font = ExtResource( 2 )
|
||||
popup_exclusive = true
|
||||
window_title = "Delete property"
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="v_layout" type="VBoxContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_constants/separation = 10
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="prop_info" type="HBoxContainer" parent="v_layout"]
|
||||
margin_top = 13.0
|
||||
margin_right = 412.0
|
||||
margin_bottom = 30.0
|
||||
alignment = 1
|
||||
|
||||
[node name="prop_lbl" type="Label" parent="v_layout/prop_info"]
|
||||
margin_left = 152.0
|
||||
margin_right = 259.0
|
||||
margin_bottom = 17.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Property name: "
|
||||
|
||||
[node name="buttons" type="HBoxContainer" parent="v_layout"]
|
||||
margin_top = 40.0
|
||||
margin_right = 412.0
|
||||
margin_bottom = 61.0
|
||||
custom_constants/separation = 50
|
||||
alignment = 1
|
||||
|
||||
[node name="ok_btn" type="Button" parent="v_layout/buttons"]
|
||||
margin_left = 81.0
|
||||
margin_right = 181.0
|
||||
margin_bottom = 21.0
|
||||
rect_min_size = Vector2( 100, 0 )
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "OK"
|
||||
|
||||
[node name="cancel_btn" type="Button" parent="v_layout/buttons"]
|
||||
margin_left = 231.0
|
||||
margin_right = 331.0
|
||||
margin_bottom = 21.0
|
||||
rect_min_size = Vector2( 100, 0 )
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Cancel"
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/godot_db_manager/dlgs/delete_prop_dlg.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_14.tres" type="FontFile" id=2]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_12.tres" type="FontFile" id=3]
|
||||
|
||||
[node name="delete_prop_dlg" type="Window"]
|
||||
visible = true
|
||||
anchor_right = 0.257
|
||||
anchor_bottom = 0.084
|
||||
offset_right = 0.799988
|
||||
offset_bottom = 0.399994
|
||||
focus_next = NodePath("v_layout/buttons/ok_btn")
|
||||
focus_mode = 1
|
||||
theme_override_fonts/title_font = ExtResource( 2 )
|
||||
exclusive = true
|
||||
window_title = "Delete property"
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="v_layout" type="VBoxContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
theme_override_constants/separation = 10
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="prop_info" type="HBoxContainer" parent="v_layout"]
|
||||
offset_top = 13.0
|
||||
offset_right = 412.0
|
||||
offset_bottom = 30.0
|
||||
alignment = 1
|
||||
|
||||
[node name="prop_lbl" type="Label" parent="v_layout/prop_info"]
|
||||
offset_left = 152.0
|
||||
offset_right = 259.0
|
||||
offset_bottom = 17.0
|
||||
theme_override_fonts/font = ExtResource( 2 )
|
||||
text = "Property name: "
|
||||
|
||||
[node name="buttons" type="HBoxContainer" parent="v_layout"]
|
||||
offset_top = 40.0
|
||||
offset_right = 412.0
|
||||
offset_bottom = 61.0
|
||||
theme_override_constants/separation = 50
|
||||
alignment = 1
|
||||
|
||||
[node name="ok_btn" type="Button" parent="v_layout/buttons"]
|
||||
offset_left = 81.0
|
||||
offset_right = 181.0
|
||||
offset_bottom = 21.0
|
||||
custom_minimum_size = Vector2( 100, 0 )
|
||||
theme_override_fonts/font = ExtResource( 3 )
|
||||
text = "OK"
|
||||
|
||||
[node name="cancel_btn" type="Button" parent="v_layout/buttons"]
|
||||
offset_left = 231.0
|
||||
offset_right = 331.0
|
||||
offset_bottom = 21.0
|
||||
custom_minimum_size = Vector2( 100, 0 )
|
||||
theme_override_fonts/font = ExtResource( 3 )
|
||||
text = "Cancel"
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
"""
|
||||
class GDDBDeleteTableDlg
|
||||
"""
|
||||
|
||||
class_name GDDBDeleteTableDlg
|
||||
|
||||
tool
|
||||
extends WindowDialog
|
||||
|
||||
signal delete_table
|
||||
|
||||
var m_table_id = gddb_constants.c_invalid_id
|
||||
|
||||
# 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")
|
||||
|
||||
# sets the table id
|
||||
func set_table_id(table_id : int) -> void:
|
||||
m_table_id = table_id
|
||||
|
||||
func set_table_name(table_name : String) -> void:
|
||||
var text = "Delete table with name \"" + table_name + "\" ?"
|
||||
$v_layout/table_info/table_lbl.set_text(text)
|
||||
|
||||
# returns the table id
|
||||
func get_table_id() -> int:
|
||||
return m_table_id
|
||||
|
||||
# called when the OK button is pressed
|
||||
func on_ok_btn_pressed() -> void:
|
||||
emit_signal("delete_table")
|
||||
hide()
|
||||
|
||||
func on_cancel_btn_pressed() -> void:
|
||||
hide()
|
||||
@tool
|
||||
"""
|
||||
class GDDBDeleteTableDlg
|
||||
"""
|
||||
|
||||
class_name GDDBDeleteTableDlg
|
||||
|
||||
extends Window
|
||||
|
||||
signal delete_table
|
||||
|
||||
var m_table_id = gddb_constants.c_invalid_id
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
$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"))
|
||||
|
||||
# sets the table id
|
||||
func set_table_id(table_id : int) -> void:
|
||||
m_table_id = table_id
|
||||
|
||||
func set_table_name(table_name : String) -> void:
|
||||
var text = "Delete table with name \"" + table_name + "\" ?"
|
||||
$v_layout/table_info/table_lbl.set_text(text)
|
||||
|
||||
# returns the table id
|
||||
func get_table_id() -> int:
|
||||
return m_table_id
|
||||
|
||||
# called when the OK button is pressed
|
||||
func on_ok_btn_pressed() -> void:
|
||||
emit_signal("delete_table")
|
||||
hide()
|
||||
|
||||
func on_cancel_btn_pressed() -> void:
|
||||
hide()
|
||||
|
||||
@@ -1,66 +1,66 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/godot_db_manager/dlgs/delete_table_dlg.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_14.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_12.tres" type="DynamicFont" id=3]
|
||||
|
||||
[node name="delete_table_dlg" type="WindowDialog"]
|
||||
visible = true
|
||||
anchor_right = 0.257
|
||||
anchor_bottom = 0.084
|
||||
margin_right = 0.799988
|
||||
margin_bottom = 0.399994
|
||||
focus_next = NodePath("v_layout/buttons/ok_btn")
|
||||
focus_mode = 1
|
||||
custom_fonts/title_font = ExtResource( 2 )
|
||||
popup_exclusive = true
|
||||
window_title = "Delete table"
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="v_layout" type="VBoxContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_constants/separation = 10
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="table_info" type="HBoxContainer" parent="v_layout"]
|
||||
margin_top = 13.0
|
||||
margin_right = 412.0
|
||||
margin_bottom = 30.0
|
||||
alignment = 1
|
||||
|
||||
[node name="table_lbl" type="Label" parent="v_layout/table_info"]
|
||||
margin_left = 162.0
|
||||
margin_right = 249.0
|
||||
margin_bottom = 17.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Table name: "
|
||||
|
||||
[node name="buttons" type="HBoxContainer" parent="v_layout"]
|
||||
margin_top = 40.0
|
||||
margin_right = 412.0
|
||||
margin_bottom = 61.0
|
||||
custom_constants/separation = 50
|
||||
alignment = 1
|
||||
|
||||
[node name="ok_btn" type="Button" parent="v_layout/buttons"]
|
||||
margin_left = 81.0
|
||||
margin_right = 181.0
|
||||
margin_bottom = 21.0
|
||||
rect_min_size = Vector2( 100, 0 )
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "OK"
|
||||
|
||||
[node name="cancel_btn" type="Button" parent="v_layout/buttons"]
|
||||
margin_left = 231.0
|
||||
margin_right = 331.0
|
||||
margin_bottom = 21.0
|
||||
rect_min_size = Vector2( 100, 0 )
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Cancel"
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/godot_db_manager/dlgs/delete_table_dlg.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_14.tres" type="FontFile" id=2]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_12.tres" type="FontFile" id=3]
|
||||
|
||||
[node name="delete_table_dlg" type="Window"]
|
||||
visible = true
|
||||
anchor_right = 0.257
|
||||
anchor_bottom = 0.084
|
||||
offset_right = 0.799988
|
||||
offset_bottom = 0.399994
|
||||
focus_next = NodePath("v_layout/buttons/ok_btn")
|
||||
focus_mode = 1
|
||||
theme_override_fonts/title_font = ExtResource( 2 )
|
||||
exclusive = true
|
||||
window_title = "Delete table"
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="v_layout" type="VBoxContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
theme_override_constants/separation = 10
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="table_info" type="HBoxContainer" parent="v_layout"]
|
||||
offset_top = 13.0
|
||||
offset_right = 412.0
|
||||
offset_bottom = 30.0
|
||||
alignment = 1
|
||||
|
||||
[node name="table_lbl" type="Label" parent="v_layout/table_info"]
|
||||
offset_left = 162.0
|
||||
offset_right = 249.0
|
||||
offset_bottom = 17.0
|
||||
theme_override_fonts/font = ExtResource( 2 )
|
||||
text = "Table name: "
|
||||
|
||||
[node name="buttons" type="HBoxContainer" parent="v_layout"]
|
||||
offset_top = 40.0
|
||||
offset_right = 412.0
|
||||
offset_bottom = 61.0
|
||||
theme_override_constants/separation = 50
|
||||
alignment = 1
|
||||
|
||||
[node name="ok_btn" type="Button" parent="v_layout/buttons"]
|
||||
offset_left = 81.0
|
||||
offset_right = 181.0
|
||||
offset_bottom = 21.0
|
||||
custom_minimum_size = Vector2( 100, 0 )
|
||||
theme_override_fonts/font = ExtResource( 3 )
|
||||
text = "OK"
|
||||
|
||||
[node name="cancel_btn" type="Button" parent="v_layout/buttons"]
|
||||
offset_left = 231.0
|
||||
offset_right = 331.0
|
||||
offset_bottom = 21.0
|
||||
custom_minimum_size = Vector2( 100, 0 )
|
||||
theme_override_fonts/font = ExtResource( 3 )
|
||||
text = "Cancel"
|
||||
|
||||
@@ -1,59 +1,59 @@
|
||||
"""
|
||||
class GDDBEditStringDlg
|
||||
"""
|
||||
|
||||
class_name GDDBEditStringDlg
|
||||
|
||||
tool
|
||||
extends WindowDialog
|
||||
|
||||
signal string_edited
|
||||
|
||||
var m_prop_id = gddb_constants.c_invalid_id
|
||||
var m_row_idx = gddb_constants.c_invalid_id
|
||||
var m_data_text = ""
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
$v_layout/btns/ok_btn.connect("pressed", self, "on_ok_btn_pressed")
|
||||
$v_layout/btns/cancel_btn.connect("pressed", self, "on_cancel_btn_pressed")
|
||||
|
||||
$v_layout/text.connect("text_changed", self, "on_text_changed")
|
||||
|
||||
# sets property id
|
||||
func set_prop_id(prop_id : int) -> void:
|
||||
m_prop_id = prop_id
|
||||
|
||||
# returns property id
|
||||
func get_prop_id() -> int :
|
||||
return m_prop_id
|
||||
|
||||
# sets row index
|
||||
func set_row_idx(row_idx : int) -> void :
|
||||
m_row_idx = row_idx
|
||||
|
||||
# returns row index
|
||||
func get_row_idx() -> int :
|
||||
return m_row_idx
|
||||
|
||||
# sets data text
|
||||
func set_data_text(text : String) -> void :
|
||||
m_data_text = text
|
||||
$v_layout/text.set_text(text)
|
||||
|
||||
# returns data text
|
||||
func get_data_text() -> String :
|
||||
return m_data_text
|
||||
|
||||
# Called when the OK button is pressed
|
||||
func on_ok_btn_pressed() -> void :
|
||||
emit_signal("string_edited")
|
||||
hide()
|
||||
|
||||
# Called when the Cancel button is pressed
|
||||
func on_cancel_btn_pressed() -> void :
|
||||
hide()
|
||||
|
||||
# Called when text is changed
|
||||
func on_text_changed() -> void:
|
||||
m_data_text = $v_layout/text.get_text()
|
||||
@tool
|
||||
"""
|
||||
class GDDBEditStringDlg
|
||||
"""
|
||||
|
||||
class_name GDDBEditStringDlg
|
||||
|
||||
extends Window
|
||||
|
||||
signal string_edited
|
||||
|
||||
var m_prop_id = gddb_constants.c_invalid_id
|
||||
var m_row_idx = gddb_constants.c_invalid_id
|
||||
var m_data_text = ""
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
$v_layout/btns/ok_btn.connect("pressed", Callable(self, "on_ok_btn_pressed"))
|
||||
$v_layout/btns/cancel_btn.connect("pressed", Callable(self, "on_cancel_btn_pressed"))
|
||||
|
||||
$v_layout/text.connect("text_changed", Callable(self, "on_text_changed"))
|
||||
|
||||
# sets property id
|
||||
func set_prop_id(prop_id : int) -> void:
|
||||
m_prop_id = prop_id
|
||||
|
||||
# returns property id
|
||||
func get_prop_id() -> int :
|
||||
return m_prop_id
|
||||
|
||||
# sets row index
|
||||
func set_row_idx(row_idx : int) -> void :
|
||||
m_row_idx = row_idx
|
||||
|
||||
# returns row index
|
||||
func get_row_idx() -> int :
|
||||
return m_row_idx
|
||||
|
||||
# sets data text
|
||||
func set_data_text(text : String) -> void :
|
||||
m_data_text = text
|
||||
$v_layout/text.set_text(text)
|
||||
|
||||
# returns data text
|
||||
func get_data_text() -> String :
|
||||
return m_data_text
|
||||
|
||||
# Called when the OK button is pressed
|
||||
func on_ok_btn_pressed() -> void :
|
||||
emit_signal("string_edited")
|
||||
hide()
|
||||
|
||||
# Called when the Cancel button is pressed
|
||||
func on_cancel_btn_pressed() -> void :
|
||||
hide()
|
||||
|
||||
# Called when text is changed
|
||||
func on_text_changed() -> void:
|
||||
m_data_text = $v_layout/text.get_text()
|
||||
|
||||
@@ -1,60 +1,60 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/godot_db_manager/dlgs/edit_string_dlg.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_14.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_12.tres" type="DynamicFont" id=3]
|
||||
|
||||
[node name="edit_string_dlg" type="WindowDialog"]
|
||||
anchor_right = 0.430625
|
||||
anchor_bottom = 0.423333
|
||||
focus_next = NodePath("v_layout/text")
|
||||
custom_fonts/title_font = ExtResource( 3 )
|
||||
window_title = "Edit string"
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": true
|
||||
}
|
||||
|
||||
[node name="v_layout" type="VBoxContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="edit_text_btns" type="HBoxContainer" parent="v_layout"]
|
||||
margin_right = 689.0
|
||||
margin_bottom = 30.0
|
||||
rect_min_size = Vector2( 0, 30 )
|
||||
|
||||
[node name="text" type="TextEdit" parent="v_layout"]
|
||||
margin_top = 34.0
|
||||
margin_right = 689.0
|
||||
margin_bottom = 334.0
|
||||
rect_min_size = Vector2( 0, 300 )
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
caret_blink = true
|
||||
|
||||
[node name="btns" type="HBoxContainer" parent="v_layout"]
|
||||
margin_top = 338.0
|
||||
margin_right = 689.0
|
||||
margin_bottom = 368.0
|
||||
rect_min_size = Vector2( 0, 30 )
|
||||
custom_constants/separation = 200
|
||||
alignment = 1
|
||||
|
||||
[node name="ok_btn" type="Button" parent="v_layout/btns"]
|
||||
margin_left = 144.0
|
||||
margin_right = 244.0
|
||||
margin_bottom = 30.0
|
||||
rect_min_size = Vector2( 100, 0 )
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "OK"
|
||||
|
||||
[node name="cancel_btn" type="Button" parent="v_layout/btns"]
|
||||
margin_left = 444.0
|
||||
margin_right = 544.0
|
||||
margin_bottom = 30.0
|
||||
rect_min_size = Vector2( 100, 0 )
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Cancel"
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/godot_db_manager/dlgs/edit_string_dlg.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_14.tres" type="FontFile" id=2]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_12.tres" type="FontFile" id=3]
|
||||
|
||||
[node name="edit_string_dlg" type="Window"]
|
||||
anchor_right = 0.430625
|
||||
anchor_bottom = 0.423333
|
||||
focus_next = NodePath("v_layout/text")
|
||||
theme_override_fonts/title_font = ExtResource( 3 )
|
||||
window_title = "Edit string"
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": true
|
||||
}
|
||||
|
||||
[node name="v_layout" type="VBoxContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="edit_text_btns" type="HBoxContainer" parent="v_layout"]
|
||||
offset_right = 689.0
|
||||
offset_bottom = 30.0
|
||||
custom_minimum_size = Vector2( 0, 30 )
|
||||
|
||||
[node name="text" type="TextEdit" parent="v_layout"]
|
||||
offset_top = 34.0
|
||||
offset_right = 689.0
|
||||
offset_bottom = 334.0
|
||||
custom_minimum_size = Vector2( 0, 300 )
|
||||
theme_override_fonts/font = ExtResource( 2 )
|
||||
caret_blink = true
|
||||
|
||||
[node name="btns" type="HBoxContainer" parent="v_layout"]
|
||||
offset_top = 338.0
|
||||
offset_right = 689.0
|
||||
offset_bottom = 368.0
|
||||
custom_minimum_size = Vector2( 0, 30 )
|
||||
theme_override_constants/separation = 200
|
||||
alignment = 1
|
||||
|
||||
[node name="ok_btn" type="Button" parent="v_layout/btns"]
|
||||
offset_left = 144.0
|
||||
offset_right = 244.0
|
||||
offset_bottom = 30.0
|
||||
custom_minimum_size = Vector2( 100, 0 )
|
||||
theme_override_fonts/font = ExtResource( 3 )
|
||||
text = "OK"
|
||||
|
||||
[node name="cancel_btn" type="Button" parent="v_layout/btns"]
|
||||
offset_left = 444.0
|
||||
offset_right = 544.0
|
||||
offset_bottom = 30.0
|
||||
custom_minimum_size = Vector2( 100, 0 )
|
||||
theme_override_fonts/font = ExtResource( 3 )
|
||||
text = "Cancel"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
[gd_scene format=2]
|
||||
|
||||
[node name="error_dlg" type="AcceptDialog"]
|
||||
visible = true
|
||||
anchor_right = 0.139
|
||||
anchor_bottom = 0.099
|
||||
margin_right = 0.599976
|
||||
margin_bottom = -0.100006
|
||||
popup_exclusive = true
|
||||
window_title = "Error"
|
||||
dialog_autowrap = true
|
||||
[gd_scene format=2]
|
||||
|
||||
[node name="error_dlg" type="AcceptDialog"]
|
||||
visible = true
|
||||
anchor_right = 0.139
|
||||
anchor_bottom = 0.099
|
||||
offset_right = 0.599976
|
||||
offset_bottom = -0.100006
|
||||
exclusive = true
|
||||
window_title = "Error"
|
||||
dialog_autowrap = true
|
||||
|
||||
@@ -1,76 +1,76 @@
|
||||
"""
|
||||
class GDDBLoadResourcePathDlg
|
||||
"""
|
||||
|
||||
class_name GDDBLoadResourcePathDlg
|
||||
|
||||
tool
|
||||
extends FileDialog
|
||||
|
||||
# TODO: put this list in a config file
|
||||
const file_filters = [
|
||||
# Godot resource file types
|
||||
"*.res, *.tres ; Godot resource file types",
|
||||
|
||||
# Godot scene files
|
||||
"*.scn, *.tscn, *escn ; Godot scene file types",
|
||||
|
||||
# Code file types
|
||||
"*.gd, *.cs, *.h, *.c, *.hpp, *.cpp ; Code file types",
|
||||
|
||||
# Shader file types
|
||||
"*.shader ; Shader file types",
|
||||
|
||||
# material file types
|
||||
"*.mat ; Material file types",
|
||||
|
||||
# mesh file types
|
||||
"*.dae, *.gltf, *.obj, *.fbx ; Mesh file types",
|
||||
|
||||
# animation file types
|
||||
"*.anim ; Animation file types",
|
||||
|
||||
# font file types
|
||||
"*.ttf, *.otf ; Font file types",
|
||||
|
||||
# image file types
|
||||
"*.png, *.jpg, *.jpeg, *.tiff, *.tga, *.bmp, *.webp, *.gif, *.hdr ; Images file types",
|
||||
|
||||
# soung file types
|
||||
"*.snd, *.wav, *.ogg, *.mp3 ; Sound file types",
|
||||
|
||||
# video file types
|
||||
"*.ogg, *.mpg, *.mpeg, *.avi, *.mov, *.mp4, *.webm ; Video file types",
|
||||
|
||||
# text file types
|
||||
"*.txt, *.csv, *.json, *.xml, *.cfg, *.ini ; Text file types",
|
||||
|
||||
# document file types
|
||||
"*.doc, *.docx, *.xls, *.xlsx, *.odt, *.ods, *.pdf ; Doc file types",
|
||||
|
||||
# binary data file types
|
||||
"*.dat, *.raw ; Binary data file types"
|
||||
]
|
||||
|
||||
var m_prop_id = gddb_constants.c_invalid_id
|
||||
var m_row_idx = gddb_constants.c_invalid_id
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
set_filters(PoolStringArray(file_filters))
|
||||
|
||||
# sets the property id
|
||||
func set_prop_id(prop_id : int) -> void :
|
||||
m_prop_id = prop_id
|
||||
|
||||
# returns the property id
|
||||
func get_prop_id() -> int :
|
||||
return m_prop_id
|
||||
|
||||
# sets the row index
|
||||
func set_row_idx(row_idx : int) -> void :
|
||||
m_row_idx = row_idx
|
||||
|
||||
# returns the row index
|
||||
func get_row_idx() -> int :
|
||||
return m_row_idx
|
||||
@tool
|
||||
"""
|
||||
class GDDBLoadResourcePathDlg
|
||||
"""
|
||||
|
||||
class_name GDDBLoadResourcePathDlg
|
||||
|
||||
extends FileDialog
|
||||
|
||||
# TODO: put this list in a config file
|
||||
const file_filters = [
|
||||
# Godot resource file types
|
||||
"*.res, *.tres ; Godot resource file types",
|
||||
|
||||
# Godot scene files
|
||||
"*.scn, *.tscn, *escn ; Godot scene file types",
|
||||
|
||||
# Code file types
|
||||
"*.gd, *.cs, *.h, *.c, *.hpp, *.cpp ; Code file types",
|
||||
|
||||
# Shader file types
|
||||
"*.shader ; Shader file types",
|
||||
|
||||
# material file types
|
||||
"*.mat ; Material file types",
|
||||
|
||||
# mesh file types
|
||||
"*.dae, *.gltf, *.obj, *.fbx ; Mesh file types",
|
||||
|
||||
# animation file types
|
||||
"*.anim ; Animation file types",
|
||||
|
||||
# font file types
|
||||
"*.ttf, *.otf ; Font file types",
|
||||
|
||||
# image file types
|
||||
"*.png, *.jpg, *.jpeg, *.tiff, *.tga, *.bmp, *.webp, *.gif, *.hdr ; Images file types",
|
||||
|
||||
# soung file types
|
||||
"*.snd, *.wav, *.ogg, *.mp3 ; Sound file types",
|
||||
|
||||
# video file types
|
||||
"*.ogg, *.mpg, *.mpeg, *.avi, *.mov, *.mp4, *.webm ; Video file types",
|
||||
|
||||
# text file types
|
||||
"*.txt, *.csv, *.json, *.xml, *.cfg, *.ini ; Text file types",
|
||||
|
||||
# document file types
|
||||
"*.doc, *.docx, *.xls, *.xlsx, *.odt, *.ods, *.pdf ; Doc file types",
|
||||
|
||||
# binary data file types
|
||||
"*.dat, *.raw ; Binary data file types"
|
||||
]
|
||||
|
||||
var m_prop_id = gddb_constants.c_invalid_id
|
||||
var m_row_idx = gddb_constants.c_invalid_id
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
set_filters(PackedStringArray(file_filters))
|
||||
|
||||
# sets the property id
|
||||
func set_prop_id(prop_id : int) -> void :
|
||||
m_prop_id = prop_id
|
||||
|
||||
# returns the property id
|
||||
func get_prop_id() -> int :
|
||||
return m_prop_id
|
||||
|
||||
# sets the row index
|
||||
func set_row_idx(row_idx : int) -> void :
|
||||
m_row_idx = row_idx
|
||||
|
||||
# returns the row index
|
||||
func get_row_idx() -> int :
|
||||
return m_row_idx
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/godot_db_manager/dlgs/load_res_path_dlg.gd" type="Script" id=1]
|
||||
|
||||
[node name="load_res_path_dlg" type="FileDialog"]
|
||||
anchor_right = 0.404
|
||||
anchor_bottom = 0.431
|
||||
margin_right = -0.400024
|
||||
margin_bottom = 0.0999756
|
||||
window_title = "Open a File"
|
||||
resizable = true
|
||||
mode = 0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/godot_db_manager/dlgs/load_res_path_dlg.gd" type="Script" id=1]
|
||||
|
||||
[node name="load_res_path_dlg" type="FileDialog"]
|
||||
anchor_right = 0.404
|
||||
anchor_bottom = 0.431
|
||||
offset_right = -0.400024
|
||||
offset_bottom = 0.0999756
|
||||
window_title = "Open a File"
|
||||
resizable = true
|
||||
mode = 0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
@@ -1,63 +1,63 @@
|
||||
"""
|
||||
class GDDBNewDBDlg
|
||||
"""
|
||||
|
||||
class_name GDDBNewDBDlg
|
||||
|
||||
tool
|
||||
extends WindowDialog
|
||||
|
||||
signal create_new_db
|
||||
|
||||
var m_current_db_name = ""
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void :
|
||||
$v_layout/buttons/ok_btn.connect("pressed", self, "on_ok_btn_pressed")
|
||||
$v_layout/buttons/cancel_btn.connect("pressed", self, "on_cancel_btn_pressed")
|
||||
connect("about_to_show", self, "on_about_to_show")
|
||||
$v_layout/db_info/db_edt.connect("text_changed", self, "on_text_changed")
|
||||
$v_layout/db_info/db_edt.connect("text_entered", self, "on_text_confirmed")
|
||||
|
||||
# Called when the node is about to be shown.
|
||||
func on_about_to_show() -> void :
|
||||
m_current_db_name = ""
|
||||
$v_layout/db_info/db_edt.set_text(m_current_db_name)
|
||||
|
||||
# called everytime the text is changed
|
||||
func on_text_changed(new_text: String) -> void :
|
||||
var change_text = true
|
||||
if(!gddb_globals.check_db_name(new_text)):
|
||||
change_text = false
|
||||
else:
|
||||
if(new_text.length() > gddb_constants.c_max_db_name_len):
|
||||
change_text = false
|
||||
else:
|
||||
change_text = true
|
||||
|
||||
if(change_text):
|
||||
m_current_db_name = $v_layout/db_info/db_edt.get_text()
|
||||
else:
|
||||
$v_layout/db_info/db_edt.set_text(m_current_db_name)
|
||||
$v_layout/db_info/db_edt.set_cursor_position(m_current_db_name.length())
|
||||
|
||||
# called when the user presses the ENTER key
|
||||
func on_text_confirmed(text : String) -> void :
|
||||
# print("GDDBNewDBDlg::on_text_confirmed(" + text + ")")
|
||||
if(m_current_db_name.empty()):
|
||||
return
|
||||
handle_db_name()
|
||||
hide()
|
||||
|
||||
# called when the OK button is pressed
|
||||
func on_ok_btn_pressed() -> void :
|
||||
if(!m_current_db_name.empty()):
|
||||
handle_db_name()
|
||||
|
||||
# called when the Cancel button is pressed
|
||||
func on_cancel_btn_pressed() -> void :
|
||||
hide()
|
||||
|
||||
# handles the name of the database
|
||||
func handle_db_name() -> void :
|
||||
emit_signal("create_new_db", m_current_db_name)
|
||||
@tool
|
||||
"""
|
||||
class GDDBNewDBDlg
|
||||
"""
|
||||
|
||||
class_name GDDBNewDBDlg
|
||||
|
||||
extends Window
|
||||
|
||||
signal create_new_db
|
||||
|
||||
var m_current_db_name = ""
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void :
|
||||
$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"))
|
||||
connect("about_to_popup", Callable(self, "on_about_to_show"))
|
||||
$v_layout/db_info/db_edt.connect("text_changed", Callable(self, "on_text_changed"))
|
||||
$v_layout/db_info/db_edt.connect("text_submitted", Callable(self, "on_text_confirmed"))
|
||||
|
||||
# Called when the node is about to be shown.
|
||||
func on_about_to_show() -> void :
|
||||
m_current_db_name = ""
|
||||
$v_layout/db_info/db_edt.set_text(m_current_db_name)
|
||||
|
||||
# called everytime the text is changed
|
||||
func on_text_changed(new_text: String) -> void :
|
||||
var change_text = true
|
||||
if(!gddb_globals.check_db_name(new_text)):
|
||||
change_text = false
|
||||
else:
|
||||
if(new_text.length() > gddb_constants.c_max_db_name_len):
|
||||
change_text = false
|
||||
else:
|
||||
change_text = true
|
||||
|
||||
if(change_text):
|
||||
m_current_db_name = $v_layout/db_info/db_edt.get_text()
|
||||
else:
|
||||
$v_layout/db_info/db_edt.set_text(m_current_db_name)
|
||||
$v_layout/db_info/db_edt.set_caret_column(m_current_db_name.length())
|
||||
|
||||
# called when the user presses the ENTER key
|
||||
func on_text_confirmed(text : String) -> void :
|
||||
# print("GDDBNewDBDlg::on_text_confirmed(" + text + ")")
|
||||
if(m_current_db_name.is_empty()):
|
||||
return
|
||||
handle_db_name()
|
||||
hide()
|
||||
|
||||
# called when the OK button is pressed
|
||||
func on_ok_btn_pressed() -> void :
|
||||
if(!m_current_db_name.is_empty()):
|
||||
handle_db_name()
|
||||
|
||||
# called when the Cancel button is pressed
|
||||
func on_cancel_btn_pressed() -> void :
|
||||
hide()
|
||||
|
||||
# handles the name of the database
|
||||
func handle_db_name() -> void :
|
||||
emit_signal("create_new_db", m_current_db_name)
|
||||
|
||||
@@ -1,82 +1,82 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_14.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://addons/godot_db_manager/dlgs/new_db_dlg.gd" type="Script" id=2]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_12.tres" type="DynamicFont" id=3]
|
||||
|
||||
[node name="new_db_dlg" type="WindowDialog"]
|
||||
visible = true
|
||||
anchor_right = 0.257
|
||||
anchor_bottom = 0.1
|
||||
margin_right = 0.799988
|
||||
focus_next = NodePath("v_layout/db_info/db_edt")
|
||||
focus_mode = 2
|
||||
custom_fonts/title_font = ExtResource( 1 )
|
||||
popup_exclusive = true
|
||||
window_title = "New database (max 16 characters)"
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_horizontal_guides_": [ 90.0781 ],
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="v_layout" type="VBoxContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_constants/separation = 20
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="db_info" type="HBoxContainer" parent="v_layout"]
|
||||
margin_top = 11.0
|
||||
margin_right = 412.0
|
||||
margin_bottom = 38.0
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="db_lbl" type="Label" parent="v_layout/db_info"]
|
||||
margin_left = 18.0
|
||||
margin_top = 5.0
|
||||
margin_right = 89.0
|
||||
margin_bottom = 22.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "DB name: "
|
||||
|
||||
[node name="db_edt" type="LineEdit" parent="v_layout/db_info"]
|
||||
margin_left = 93.0
|
||||
margin_right = 393.0
|
||||
margin_bottom = 27.0
|
||||
rect_min_size = Vector2( 300, 20 )
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
caret_blink = true
|
||||
caret_blink_speed = 0.5
|
||||
|
||||
[node name="buttons" type="HBoxContainer" parent="v_layout"]
|
||||
margin_top = 58.0
|
||||
margin_right = 412.0
|
||||
margin_bottom = 79.0
|
||||
custom_constants/separation = 80
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ok_btn" type="Button" parent="v_layout/buttons"]
|
||||
margin_left = 66.0
|
||||
margin_right = 166.0
|
||||
margin_bottom = 21.0
|
||||
rect_min_size = Vector2( 100, 0 )
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "OK"
|
||||
|
||||
[node name="cancel_btn" type="Button" parent="v_layout/buttons"]
|
||||
margin_left = 246.0
|
||||
margin_right = 346.0
|
||||
margin_bottom = 21.0
|
||||
rect_min_size = Vector2( 100, 0 )
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Cancel"
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_14.tres" type="FontFile" id=1]
|
||||
[ext_resource path="res://addons/godot_db_manager/dlgs/new_db_dlg.gd" type="Script" id=2]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_12.tres" type="FontFile" id=3]
|
||||
|
||||
[node name="new_db_dlg" type="Window"]
|
||||
visible = true
|
||||
anchor_right = 0.257
|
||||
anchor_bottom = 0.1
|
||||
offset_right = 0.799988
|
||||
focus_next = NodePath("v_layout/db_info/db_edt")
|
||||
focus_mode = 2
|
||||
theme_override_fonts/title_font = ExtResource( 1 )
|
||||
exclusive = true
|
||||
window_title = "New database (max 16 characters)"
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_horizontal_guides_": [ 90.0781 ],
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="v_layout" type="VBoxContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
theme_override_constants/separation = 20
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="db_info" type="HBoxContainer" parent="v_layout"]
|
||||
offset_top = 11.0
|
||||
offset_right = 412.0
|
||||
offset_bottom = 38.0
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="db_lbl" type="Label" parent="v_layout/db_info"]
|
||||
offset_left = 18.0
|
||||
offset_top = 5.0
|
||||
offset_right = 89.0
|
||||
offset_bottom = 22.0
|
||||
theme_override_fonts/font = ExtResource( 1 )
|
||||
text = "DB name: "
|
||||
|
||||
[node name="db_edt" type="LineEdit" parent="v_layout/db_info"]
|
||||
offset_left = 93.0
|
||||
offset_right = 393.0
|
||||
offset_bottom = 27.0
|
||||
custom_minimum_size = Vector2( 300, 20 )
|
||||
theme_override_fonts/font = ExtResource( 1 )
|
||||
caret_blink = true
|
||||
caret_blink_interval = 0.5
|
||||
|
||||
[node name="buttons" type="HBoxContainer" parent="v_layout"]
|
||||
offset_top = 58.0
|
||||
offset_right = 412.0
|
||||
offset_bottom = 79.0
|
||||
theme_override_constants/separation = 80
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ok_btn" type="Button" parent="v_layout/buttons"]
|
||||
offset_left = 66.0
|
||||
offset_right = 166.0
|
||||
offset_bottom = 21.0
|
||||
custom_minimum_size = Vector2( 100, 0 )
|
||||
theme_override_fonts/font = ExtResource( 3 )
|
||||
text = "OK"
|
||||
|
||||
[node name="cancel_btn" type="Button" parent="v_layout/buttons"]
|
||||
offset_left = 246.0
|
||||
offset_right = 346.0
|
||||
offset_bottom = 21.0
|
||||
custom_minimum_size = Vector2( 100, 0 )
|
||||
theme_override_fonts/font = ExtResource( 3 )
|
||||
text = "Cancel"
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -1,73 +1,73 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_12.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://addons/godot_db_manager/dlgs/new_table_dlg.gd" type="Script" id=2]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_14.tres" type="DynamicFont" id=3]
|
||||
|
||||
[node name="new_table_dlg" type="WindowDialog"]
|
||||
visible = true
|
||||
anchor_right = 0.257
|
||||
anchor_bottom = 0.084
|
||||
margin_right = 0.799988
|
||||
margin_bottom = 0.399994
|
||||
focus_next = NodePath("v_layout/table_info/table_edt")
|
||||
focus_mode = 1
|
||||
custom_fonts/title_font = ExtResource( 3 )
|
||||
popup_exclusive = true
|
||||
window_title = "New table (max 16 characters)"
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="v_layout" type="VBoxContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_constants/separation = 10
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="table_info" type="HBoxContainer" parent="v_layout"]
|
||||
margin_top = 8.0
|
||||
margin_right = 412.0
|
||||
margin_bottom = 35.0
|
||||
alignment = 1
|
||||
|
||||
[node name="table_lbl" type="Label" parent="v_layout/table_info"]
|
||||
margin_left = 10.0
|
||||
margin_top = 5.0
|
||||
margin_right = 97.0
|
||||
margin_bottom = 22.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Table name: "
|
||||
|
||||
[node name="table_edt" type="LineEdit" parent="v_layout/table_info"]
|
||||
margin_left = 101.0
|
||||
margin_right = 401.0
|
||||
margin_bottom = 27.0
|
||||
rect_min_size = Vector2( 300, 20 )
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
caret_blink = true
|
||||
caret_blink_speed = 0.5
|
||||
|
||||
[node name="buttons" type="HBoxContainer" parent="v_layout"]
|
||||
margin_top = 45.0
|
||||
margin_right = 412.0
|
||||
margin_bottom = 66.0
|
||||
custom_constants/separation = 80
|
||||
alignment = 1
|
||||
|
||||
[node name="ok_btn" type="Button" parent="v_layout/buttons"]
|
||||
margin_left = 66.0
|
||||
margin_right = 166.0
|
||||
margin_bottom = 21.0
|
||||
rect_min_size = Vector2( 100, 0 )
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "OK"
|
||||
|
||||
[node name="cancel_btn" type="Button" parent="v_layout/buttons"]
|
||||
margin_left = 246.0
|
||||
margin_right = 346.0
|
||||
margin_bottom = 21.0
|
||||
rect_min_size = Vector2( 100, 0 )
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Cancel"
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_12.tres" type="FontFile" id=1]
|
||||
[ext_resource path="res://addons/godot_db_manager/dlgs/new_table_dlg.gd" type="Script" id=2]
|
||||
[ext_resource path="res://addons/godot_db_manager/assets/fnt/roboto_14.tres" type="FontFile" id=3]
|
||||
|
||||
[node name="new_table_dlg" type="Window"]
|
||||
visible = true
|
||||
anchor_right = 0.257
|
||||
anchor_bottom = 0.084
|
||||
offset_right = 0.799988
|
||||
offset_bottom = 0.399994
|
||||
focus_next = NodePath("v_layout/table_info/table_edt")
|
||||
focus_mode = 1
|
||||
theme_override_fonts/title_font = ExtResource( 3 )
|
||||
exclusive = true
|
||||
window_title = "New table (max 16 characters)"
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="v_layout" type="VBoxContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
theme_override_constants/separation = 10
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="table_info" type="HBoxContainer" parent="v_layout"]
|
||||
offset_top = 8.0
|
||||
offset_right = 412.0
|
||||
offset_bottom = 35.0
|
||||
alignment = 1
|
||||
|
||||
[node name="table_lbl" type="Label" parent="v_layout/table_info"]
|
||||
offset_left = 10.0
|
||||
offset_top = 5.0
|
||||
offset_right = 97.0
|
||||
offset_bottom = 22.0
|
||||
theme_override_fonts/font = ExtResource( 3 )
|
||||
text = "Table name: "
|
||||
|
||||
[node name="table_edt" type="LineEdit" parent="v_layout/table_info"]
|
||||
offset_left = 101.0
|
||||
offset_right = 401.0
|
||||
offset_bottom = 27.0
|
||||
custom_minimum_size = Vector2( 300, 20 )
|
||||
theme_override_fonts/font = ExtResource( 3 )
|
||||
caret_blink = true
|
||||
caret_blink_interval = 0.5
|
||||
|
||||
[node name="buttons" type="HBoxContainer" parent="v_layout"]
|
||||
offset_top = 45.0
|
||||
offset_right = 412.0
|
||||
offset_bottom = 66.0
|
||||
theme_override_constants/separation = 80
|
||||
alignment = 1
|
||||
|
||||
[node name="ok_btn" type="Button" parent="v_layout/buttons"]
|
||||
offset_left = 66.0
|
||||
offset_right = 166.0
|
||||
offset_bottom = 21.0
|
||||
custom_minimum_size = Vector2( 100, 0 )
|
||||
theme_override_fonts/font = ExtResource( 1 )
|
||||
text = "OK"
|
||||
|
||||
[node name="cancel_btn" type="Button" parent="v_layout/buttons"]
|
||||
offset_left = 246.0
|
||||
offset_right = 346.0
|
||||
offset_bottom = 21.0
|
||||
custom_minimum_size = Vector2( 100, 0 )
|
||||
theme_override_fonts/font = ExtResource( 1 )
|
||||
text = "Cancel"
|
||||
|
||||
Reference in New Issue
Block a user