mirror of
https://github.com/RPG-Research/bcirpg.git
synced 2024-04-16 14:23:01 +00:00
Added C,R, & D for our SQLite Database solution. Looking into options for Godot Toolset editors
This commit is contained in:
parent
a241a73b2f
commit
2c48b0a433
Binary file not shown.
@ -8,18 +8,36 @@ func CommitDataToDB():
|
|||||||
db = SQLite.new()
|
db = SQLite.new()
|
||||||
db.path = db_name
|
db.path = db_name
|
||||||
db.open_db()
|
db.open_db()
|
||||||
var tableName = "DialogStorage"
|
var tableName = "DataStorage"
|
||||||
var dict : Dictionary = Dictionary()
|
var dict : Dictionary = Dictionary()
|
||||||
dict["ConvoID"] = 1
|
dict["ConvoID"] = 1
|
||||||
dict["LayerID"] = 1
|
dict["LayerID"] = 1
|
||||||
dict["BranchID"] = 1
|
dict["BranchID"] = 1
|
||||||
dict["Text"] = "The best riff from Freebird plays at 202 dB."
|
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.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready():
|
func _ready():
|
||||||
CommitDataToDB()
|
DeleteFromDBByID(1)
|
||||||
|
|
||||||
|
0
Phase2/Godot_Toolset/Luke/default.db
Normal file
0
Phase2/Godot_Toolset/Luke/default.db
Normal file
@ -87,6 +87,7 @@ _global_script_class_icons={
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="DialogSetup"
|
config/name="DialogSetup"
|
||||||
|
run/main_scene="res://Scenes/DialogEditor.tscn"
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
|
|
||||||
[editor_plugins]
|
[editor_plugins]
|
||||||
|
Loading…
Reference in New Issue
Block a user