diff --git a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/TestDialog.tscn-editstate-9a1426d8120a9e3f5688085c7d40127b.cfg b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/TestDialog.tscn-editstate-9a1426d8120a9e3f5688085c7d40127b.cfg new file mode 100644 index 0000000..fe92dad --- /dev/null +++ b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/TestDialog.tscn-editstate-9a1426d8120a9e3f5688085c7d40127b.cfg @@ -0,0 +1,170 @@ +[editor_states] + +Anim={ +"visible": false +} +2D={ +"grid_offset": Vector2(0, 0), +"grid_snap_active": false, +"grid_step": Vector2(8, 8), +"grid_visibility": 1, +"ofs": Vector2(-165, -110), +"primary_grid_steps": 8, +"show_edit_locks": true, +"show_guides": true, +"show_helpers": false, +"show_origin": true, +"show_rulers": true, +"show_transformation_gizmos": true, +"show_viewport": true, +"show_zoom_control": true, +"smart_snap_active": false, +"snap_guides": true, +"snap_node_anchors": true, +"snap_node_center": true, +"snap_node_parent": true, +"snap_node_sides": true, +"snap_other_nodes": true, +"snap_pixel": true, +"snap_relative": false, +"snap_rotation": false, +"snap_rotation_offset": 0.0, +"snap_rotation_step": 0.261799, +"snap_scale": false, +"snap_scale_step": 0.1, +"zoom": 1.0 +} +3D={ +"fov": 70.01, +"gizmos_status": { +"AudioListener3D": 0, +"AudioStreamPlayer3D": 0, +"CPUParticles3D": 0, +"CSGShape3D": 0, +"Camera3D": 0, +"CollisionObject3D": 0, +"CollisionPolygon3D": 0, +"CollisionShape3D": 0, +"Decal": 0, +"FogVolume": 0, +"GPUParticles3D": 0, +"GPUParticlesCollision3D": 0, +"Joint3D": 0, +"Light3D": 0, +"LightmapGI": 0, +"LightmapProbe": 0, +"Marker3D": 0, +"NavigationLink3D": 0, +"NavigationRegion3D": 0, +"OccluderInstance3D": 0, +"Path3D": 0, +"PhysicalBone3D": 0, +"RayCast3D": 0, +"ReflectionProbe": 0, +"ShapeCast3D": 0, +"Skeleton3D": 0, +"SoftBody3D": 0, +"SpringArm3D": 0, +"VehicleWheel3D": 0, +"VisibleOnScreenNotifier3D": 0, +"VoxelGI": 0 +}, +"local_coords": false, +"preview_sun_env": { +"environ_ao_enabled": false, +"environ_enabled": true, +"environ_energy": 1.0, +"environ_gi_enabled": false, +"environ_glow_enabled": true, +"environ_ground_color": Color(0.2, 0.169, 0.133, 1), +"environ_sky_color": Color(0.385, 0.454, 0.55, 1), +"environ_tonemap_enabled": true, +"sun_color": Color(1, 1, 1, 1), +"sun_enabled": true, +"sun_energy": 1.0, +"sun_max_distance": 100.0, +"sun_rotation": Vector2(-1.0472, 2.61799) +}, +"rotate_snap": 15.0, +"scale_snap": 10.0, +"show_grid": true, +"show_origin": true, +"snap_enabled": false, +"translate_snap": 1.0, +"viewport_mode": 1, +"viewports": [{ +"auto_orthogonal": false, +"auto_orthogonal_enabled": true, +"cinematic_preview": false, +"display_mode": 20, +"distance": 4.0, +"doppler": false, +"frame_time": false, +"gizmos": true, +"half_res": false, +"information": false, +"listener": true, +"position": Vector3(0, 0, 0), +"use_environment": false, +"use_orthogonal": false, +"view_type": 0, +"x_rotation": 0.5, +"y_rotation": -0.5 +}, { +"auto_orthogonal": false, +"auto_orthogonal_enabled": true, +"cinematic_preview": false, +"display_mode": 20, +"distance": 4.0, +"doppler": false, +"frame_time": false, +"gizmos": true, +"half_res": false, +"information": false, +"listener": false, +"position": Vector3(0, 0, 0), +"use_environment": false, +"use_orthogonal": false, +"view_type": 0, +"x_rotation": 0.5, +"y_rotation": -0.5 +}, { +"auto_orthogonal": false, +"auto_orthogonal_enabled": true, +"cinematic_preview": false, +"display_mode": 20, +"distance": 4.0, +"doppler": false, +"frame_time": false, +"gizmos": true, +"half_res": false, +"information": false, +"listener": false, +"position": Vector3(0, 0, 0), +"use_environment": false, +"use_orthogonal": false, +"view_type": 0, +"x_rotation": 0.5, +"y_rotation": -0.5 +}, { +"auto_orthogonal": false, +"auto_orthogonal_enabled": true, +"cinematic_preview": false, +"display_mode": 20, +"distance": 4.0, +"doppler": false, +"frame_time": false, +"gizmos": true, +"half_res": false, +"information": false, +"listener": false, +"position": Vector3(0, 0, 0), +"use_environment": false, +"use_orthogonal": false, +"view_type": 0, +"x_rotation": 0.5, +"y_rotation": -0.5 +}], +"zfar": 4000.01, +"znear": 0.05 +} diff --git a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/TestDialog.tscn-folding-9a1426d8120a9e3f5688085c7d40127b.cfg b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/TestDialog.tscn-folding-9a1426d8120a9e3f5688085c7d40127b.cfg new file mode 100644 index 0000000..1d019fa --- /dev/null +++ b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/TestDialog.tscn-folding-9a1426d8120a9e3f5688085c7d40127b.cfg @@ -0,0 +1,5 @@ +[folding] + +node_unfolds=[] +resource_unfolds=[] +nodes_folded=[] diff --git a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/dialog_system.gd-folding-86b47f511c23dd8ba557a5bcde7bd80d.cfg b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/dialog_system.gd-folding-86b47f511c23dd8ba557a5bcde7bd80d.cfg new file mode 100644 index 0000000..e860dd4 --- /dev/null +++ b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/dialog_system.gd-folding-86b47f511c23dd8ba557a5bcde7bd80d.cfg @@ -0,0 +1,3 @@ +[folding] + +sections_unfolded=PackedStringArray() diff --git a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/editor_layout.cfg b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/editor_layout.cfg index 58554f4..d369e88 100644 --- a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/editor_layout.cfg +++ b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/editor_layout.cfg @@ -16,11 +16,11 @@ dock_5="Inspector,Node,History" [EditorNode] -open_scenes=["res://screens/MainMenu.tscn", "res://GenresSubstitution/TestDB.tscn"] +open_scenes=["res://screens/MainMenu.tscn", "res://GenresSubstitution/TestDB.tscn", "res://Dialog/TestDialog.tscn"] [ScriptEditor] -open_scripts=["res://GenresSubstitution/genre_sub.gd"] +open_scripts=["res://GenresSubstitution/genre_sub.gd", "res://Dialog/dialog_system.gd"] open_help=[] script_split_offset=150 list_split_offset=0 diff --git a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/favorites b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/favorites new file mode 100644 index 0000000..e69de29 diff --git a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/filesystem_cache8 b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/filesystem_cache8 index da99e67..49187ff 100644 --- a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/filesystem_cache8 +++ b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/filesystem_cache8 @@ -1,5 +1,5 @@ 2a60927148abd1d33b818b535e306557 -::res://::1682270223 +::res://::1682875387 default_env.tres::Environment::-1::1680461469::0::1::::<><>:: icon.png::CompressedTexture2D::1663579034843721578::1659896126::1681665020::1::::<><>:: README.txt::TextFile::-1::1679251181::0::1::::<><>:: @@ -37,11 +37,11 @@ LiberationSerif-BoldItalic.ttf::FontFile::6973589459942031632::1679252065::16816 LiberationSerif-Italic.ttf::FontFile::3429051925918376143::1679252065::1681665020::1::::<><>:: LiberationSerif-Regular.ttf::FontFile::3437532725077625275::1679252065::1681665020::1::::<><>:: ::res://CharacterCreator/::1659895857 -::res://databases/::1681669600 +::res://databases/::1682874550 ::res://Dialog/::1659895847 -::res://GenresSubstitution/::1681669646 -genre_sub.gd::GDScript::-1::1681669598::0::1::::<>Node<>:: -TestDB.tscn::PackedScene::3353206590719512815::1681669646::0::1::::<><>::res://GenresSubstitution/genre_sub.gd +::res://GenresSubstitution/::1682274676 +genre_sub.gd::GDScript::-1::1682274676::0::1::::<>Node<>:: +TestDB.tscn::PackedScene::3353206590719512815::1682274676::0::1::::<><>::res://GenresSubstitution/genre_sub.gd ::res://globalScripts/::1679252065 DiceRoller.gd::GDScript::-1::1679252065::0::1::::<>Control<>:: ::res://Grammar/::1659895937 diff --git a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/filesystem_update4 b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/filesystem_update4 index 912b6f1..162aee3 100644 --- a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/filesystem_update4 +++ b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/filesystem_update4 @@ -1,2 +1,3 @@ -res://GenresSubstitution/TestDB.tscn +res://Dialog/TestDialog.tscn +res://Dialog/dialog_system.gd res://GenresSubstitution/genre_sub.gd diff --git a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/project_metadata.cfg b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/project_metadata.cfg index c8c30df..fa3d84f 100644 --- a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/project_metadata.cfg +++ b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/project_metadata.cfg @@ -10,4 +10,8 @@ run_reload_scripts=true [recent_files] scenes=["res://GenresSubstitution/TestDB.tscn", "res://screens/MainMenu.tscn"] -scripts=["res://GenresSubstitution/genre_sub.gd"] +scripts=["res://Dialog/dialog_system.gd", "res://GenresSubstitution/genre_sub.gd"] + +[script_setup] + +last_selected_language="GDScript" diff --git a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/script_editor_cache.cfg b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/script_editor_cache.cfg index 2ed3dea..1f18c4d 100644 --- a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/script_editor_cache.cfg +++ b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/editor/script_editor_cache.cfg @@ -3,11 +3,25 @@ state={ "bookmarks": PackedInt32Array(), "breakpoints": PackedInt32Array(), -"column": 25, +"column": 42, "folded_lines": Array[int]([]), "h_scroll_position": 0, -"row": 104, -"scroll_position": 87.5, +"row": 49, +"scroll_position": 35.0, +"selection": false, +"syntax_highlighter": "GDScript" +} + +[res://Dialog/dialog_system.gd] + +state={ +"bookmarks": PackedInt32Array(), +"breakpoints": PackedInt32Array(), +"column": 32, +"folded_lines": Array[int]([]), +"h_scroll_position": 0, +"row": 84, +"scroll_position": 72.0, "selection": false, "syntax_highlighter": "GDScript" } diff --git a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/uid_cache.bin b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/uid_cache.bin index eb2fe1d..35fb5b9 100644 Binary files a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/uid_cache.bin and b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/.godot/uid_cache.bin differ diff --git a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/Dialog/TestDialog.tscn b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/Dialog/TestDialog.tscn new file mode 100644 index 0000000..429eb60 --- /dev/null +++ b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/Dialog/TestDialog.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://b8nsv6rdahxk1"] + +[ext_resource type="Script" path="res://Dialog/dialog_system.gd" id="1_k1ism"] + +[node name="TestDialog" type="Node2D"] +script = ExtResource("1_k1ism") diff --git a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/Dialog/dialog_system.gd b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/Dialog/dialog_system.gd new file mode 100644 index 0000000..f256422 --- /dev/null +++ b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/Dialog/dialog_system.gd @@ -0,0 +1,106 @@ +extends Node + + +# initialize the DB connection. +# All Databases will be under res/databases/{Desired Database} + +#How to init the connection with Godot 3.5+ +#const SQLite = preload("res://addons/godot-sqlite/bin/gdsqlite.gdns") +#var db + +#How to init the connection with godot 4+ +var db : SQLite = null +const verbosity_level : int = SQLite.VERBOSE +var db_name = "res://databases/dialog_system" +# + + +# A tag is a string used to identify a dialog option. +# Examples of how to use createTag +# createItem("streetVendor1InMainCityGreetingA") +# createItem("dreamSequence1EndingOptionB") +func createTag(inputNameString): + db.open_db() + var tableName = "Tag" + var dict : Dictionary = Dictionary() + dict["tagName"] = inputNameString + db.insert_row(tableName,dict) + print(dict) + + +# A collection will contain the ID of the item in question, followed by the genre name, and the alias provided. +# Examples of how to use createCollection +# createCollection(3, "SciFi", "Plasma Pistol") +# createCollection(3, "ModernDay", "9MM Handgun") +# createCollection(3, "Fantasy", "Shortbow") +func createDialog(dialogText, tagID): + db.open_db() + var tableName = "Dialog" + var dict : Dictionary = Dictionary() + dict["dialogText"] = dialogText + dict["tagID"] = tagID + db.insert_row(tableName,dict) + print(dict) + + +#This will read all tags in the entire database. +#Just call this function to return them. +func readTags(): + db.open_db() + var tableName = "Tag" + db.query("select * from " + tableName) + for i in range(0, db.query_result.size()): + print("Query results ", db.query_result[i]["tagName"], db.query_result[i]["primaryKey"]) + return db.query_result + + +#This will read all Dialogs in the entire database. +#Just call this function to return them. +func readDialogs(): + db.open_db() + var tableName = "Dialog" + db.query("select * from " + tableName) + for i in range(0, db.query_result.size()): + print("Query results ", db.query_result[i]["dialogText"], db.query_result[i]["tagID"], db.query_result[i]["primaryKey"]) + return db.query_result + +#Updating a tab may be useful when the name needs to be changed. +#Example of how to use updateTagByID: +#updateTagByID(23, introToNPCLisa) +func updateTagByID(id, feedText): + db.open_db() + var tableName = "Tag" + db.query("update " + str(tableName) + " set tagName = " + "\"" + str(feedText) + "\"" + " where primaryKey = " + str(id) + ";") + return db.query_result + +#Updating a dialog option may be useful when the content or context needs to be changed. +#Example of how to updateDialogByID +#updateDialogByID(47, "What'cha Buying, What'cha Selling?") +func updateDialogByID(id, feedText): + db.open_db() + var tableName = "Dialog" + db.query("update " + str(tableName) + " set dialogText = " + "\"" + str(feedText) + "\"" + " where primaryKey = " + str(id) + ";") + return db.query_result + +#Example of how to updateTagByID +#updateTagByID(23) +func deleteTagByID(id): + db.open_db() + var tableName = "Tag" + db.query("delete from " + tableName + " where primaryKey = " + str(id)) + print("Deleted Tag by ID " + str(id) + ".") + +#Example of how to deleteDialogByID +#updateDialogByID(47) +func deleteDialogByID(id): + db.open_db() + var tableName = "Dialog" + db.query("delete from " + tableName + " where primaryKey = " + str(id)) + print("Deleted Dialog by ID " + str(id) + ".") + + +# Called when the node enters the scene tree for the first time. +func _ready(): + db = SQLite.new() + db.path = db_name + pass # Replace with function body. diff --git a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/GenresSubstitution/genre_sub.gd b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/GenresSubstitution/genre_sub.gd index ec0b1b7..2724a81 100644 --- a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/GenresSubstitution/genre_sub.gd +++ b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/GenresSubstitution/genre_sub.gd @@ -144,5 +144,4 @@ func deleteCollectionByID(id): func _ready(): db = SQLite.new() db.path = db_name - updateCollectionGenreByID(1, "Cowboys VS Aliens") pass # Replace with function body. diff --git a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/globalScripts/DiceRoller.gd b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/GenresSubstitution/globalScripts/DiceRoller.gd similarity index 100% rename from Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/globalScripts/DiceRoller.gd rename to Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/GenresSubstitution/globalScripts/DiceRoller.gd diff --git a/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/databases/dialog_system.db b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/databases/dialog_system.db new file mode 100644 index 0000000..efce57c Binary files /dev/null and b/Phase2/Godot_Toolset/CodeSandboxes/ToolsetProjectTemplate/databases/dialog_system.db differ