diff --git a/Phase2/Godot_Toolset/Luke/DataStorage/database.db b/Phase2/Godot_Toolset/Luke/DataStorage/database.db index 5052b2d..999edae 100644 Binary files a/Phase2/Godot_Toolset/Luke/DataStorage/database.db and b/Phase2/Godot_Toolset/Luke/DataStorage/database.db differ diff --git a/Phase2/Godot_Toolset/Luke/MainSystem.gd b/Phase2/Godot_Toolset/Luke/MainSystem.gd index 28bf572..b4b99ab 100644 --- a/Phase2/Godot_Toolset/Luke/MainSystem.gd +++ b/Phase2/Godot_Toolset/Luke/MainSystem.gd @@ -8,18 +8,36 @@ func CommitDataToDB(): db = SQLite.new() db.path = db_name db.open_db() - var tableName = "DialogStorage" + var tableName = "DataStorage" var dict : Dictionary = Dictionary() dict["ConvoID"] = 1 dict["LayerID"] = 1 dict["BranchID"] = 1 dict["Text"] = "The best riff from Freebird plays at 202 dB." - db.insert_row(tableName.dict) + db.insert_row(tableName,dict) + +func readFromDB(): + db = SQLite.new() + db.path = db_name + db.open_db() + var tableName = "DataStorage" + db.query("select * from " + tableName + ";") + for i in range(0, db.query_result.size()): + print("Query Results: ", db.query_result[i]["ConvoID"], db.query_result[i]["LayerID"], db.query_result[i]["BranchID"],db.query_result[i]["Text"]) + + +func DeleteFromDBByID(idNum): + var idStr = str(idNum) + db = SQLite.new() + db.path = db_name + db.open_db() + var tableName = "DataStorage" + db.query("delete from " + tableName + " where ConvoID = " + idStr + ";") # Called when the node enters the scene tree for the first time. func _ready(): - CommitDataToDB() + DeleteFromDBByID(1) diff --git a/Phase2/Godot_Toolset/Luke/default.db b/Phase2/Godot_Toolset/Luke/default.db new file mode 100644 index 0000000..e69de29 diff --git a/Phase2/Godot_Toolset/Luke/project.godot b/Phase2/Godot_Toolset/Luke/project.godot index 02b5c33..a1802e1 100644 --- a/Phase2/Godot_Toolset/Luke/project.godot +++ b/Phase2/Godot_Toolset/Luke/project.godot @@ -87,6 +87,7 @@ _global_script_class_icons={ [application] config/name="DialogSetup" +run/main_scene="res://Scenes/DialogEditor.tscn" config/icon="res://icon.png" [editor_plugins]