Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,4 @@ Here is a template
3) Ask to become a collaborator:
- Send an e-mail to the owner of the project

Current version: 1.0_RC1
- Warning: this is not a final(stable) version. When using this tool, make sure to backup JSON files provided by this tool.

TODO:
see "todo.txt" file for more info
Current version: 1.0 official stable
36 changes: 29 additions & 7 deletions prj/addons/godot_db_manager/db_manager.gd
Original file line number Diff line number Diff line change
@@ -1,26 +1,48 @@
"""
class GDDBManager
"""

class_name GDDBManager

tool
extends EditorPlugin

var DBInterface = preload("./db_interface.tscn")
var db_interface : Node

func _enter_tree():
add_autoload_singleton("gd_types", "res://addons/godot_db_manager/core/db_type.gd")
add_autoload_singleton("g_constants", "res://addons/godot_db_manager/constants.gd")
add_autoload_singleton("db_types", "res://addons/godot_db_manager/core/db_types.gd")
add_autoload_singleton("g_globals", "res://addons/godot_db_manager/globals.gd")

# Initialization of the plugin goes here
db_interface = DBInterface.instance()

get_editor_interface().get_base_control().add_child(db_interface)
add_tool_menu_item("Godot Database Manager", self, "open_config")

func open_config(UD):
var window = db_interface.get_node("dlg") as WindowDialog
if(window):
#window.popup_centered_ratio(0.3)
window.popup_centered()
window = db_interface.get_node("dlg") as WindowDialog

func _exit_tree():
# Clean-up of the plugin goes here
remove_tool_menu_item("Godot Database Manager")
if(db_interface):
db_interface.queue_free()

var window:WindowDialog
var opened:bool = false
func open_config(UD):
if(window):
window.popup_centered()

func _input(event):
if event is InputEventKey:
if Input.is_key_pressed(KEY_F10):
if(window):
if !opened:
window.popup_centered()
opened = true
else:
window.hide()
opened = false


4 changes: 4 additions & 0 deletions prj/addons/godot_db_manager/table.gd
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ func on_delete_property(prop_id : int) -> void:
cell.queue_free()
elif(cell_prop_id > prop_id):
cell.set_prop_id(cell_prop_id-1)

if($tabs/structure/properties.get_child_count() == 0):
m_add_data_button.set_disabled(true)

emit_signal("delete_property", prop_id)

# create "+" button for adding new row of data
Expand Down