diff --git a/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/.import/CharacterOutput.csv-6828cb1a69df1af9479e2aa693ac7602.md5 b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/.import/CharacterOutput.csv-6828cb1a69df1af9479e2aa693ac7602.md5 new file mode 100644 index 0000000..343f0af --- /dev/null +++ b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/.import/CharacterOutput.csv-6828cb1a69df1af9479e2aa693ac7602.md5 @@ -0,0 +1 @@ +source_md5="0300125e58b492e346b177ce259fd215" diff --git a/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/.import/Template.csv-f248b3401a97fc55d69177d777df35f5.md5 b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/.import/Template.csv-f248b3401a97fc55d69177d777df35f5.md5 new file mode 100644 index 0000000..8cd8255 --- /dev/null +++ b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/.import/Template.csv-f248b3401a97fc55d69177d777df35f5.md5 @@ -0,0 +1,3 @@ +source_md5="3b37741efaad37471d3be79926341120" +dest_md5="6703f1e11659db139e8690f3df1a5a0d" + diff --git a/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/_userFiles/CharacterOutput.csv b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/_userFiles/CharacterOutput.csv new file mode 100644 index 0000000..f7eb8e9 --- /dev/null +++ b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/_userFiles/CharacterOutput.csv @@ -0,0 +1,9 @@ +Name, +Profession, +Strength, +Intellegence, +Willpower, +Charm, +Weapon, +Armor, +Quote, diff --git a/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/_userFiles/CharacterOutput.csv.import b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/_userFiles/CharacterOutput.csv.import new file mode 100644 index 0000000..df8cf87 --- /dev/null +++ b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/_userFiles/CharacterOutput.csv.import @@ -0,0 +1,13 @@ +[remap] + +importer="csv_translation" +type="Translation" +valid=false + +[deps] + +source_file="res://_userFiles/CharacterOutput.csv" +[params] + +compress=true +delimiter=0 diff --git a/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/_userFiles/characterFiles/Template.csv b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/_userFiles/characterFiles/Template.csv new file mode 100644 index 0000000..80bc4f9 --- /dev/null +++ b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/_userFiles/characterFiles/Template.csv @@ -0,0 +1,10 @@ +keys,en +Name,Thickly Goes +Profession,Brawler +Strength,Excessive +Intellect,Diminished +Willpower,Variable +Charm,Lacking +Weapon,Meaty Fists +Armor,Leather Jacket and Chaps +A Quote,You talkin to me?! \ No newline at end of file diff --git a/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/_userFiles/characterFiles/Template.csv.import b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/_userFiles/characterFiles/Template.csv.import new file mode 100644 index 0000000..7aaf8fb --- /dev/null +++ b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/_userFiles/characterFiles/Template.csv.import @@ -0,0 +1,16 @@ +[remap] + +importer="csv_translation" +type="Translation" + +[deps] + +files=[ "res://_userFiles/characterFiles/Template.en.translation" ] + +source_file="res://_userFiles/characterFiles/Template.csv" +dest_files=[ "res://_userFiles/characterFiles/Template.en.translation" ] + +[params] + +compress=true +delimiter=0 diff --git a/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/_userFiles/characterFiles/Template.en.translation b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/_userFiles/characterFiles/Template.en.translation new file mode 100644 index 0000000..3abaa88 Binary files /dev/null and b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/_userFiles/characterFiles/Template.en.translation differ diff --git a/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/screens/Character_Add.gd b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/screens/Character_Add.gd index c651539..9b034ab 100644 --- a/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/screens/Character_Add.gd +++ b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/screens/Character_Add.gd @@ -3,31 +3,51 @@ # it into the character object extends Control +var originalPath = "res://_userFiles/Template.csv" +var rows + onready var settings = get_node("/root/GlobalSaveInstance").settingsInstance - +onready var SaveButton = get_node("HBoxContainer/VBoxContainer/SaveButton") onready var nameVar = get_node("HBoxContainer/VBoxContainer/LabelName/LineEditName") -onready var profVar = get_node("HBoxContainer/VBoxContainer/LabelProf/LineEditProf") +onready var profVar = get_node("HBoxContainer/VBoxContainer/LabelProfession/LineEditProf") onready var strengthVar = get_node("HBoxContainer/VBoxContainer/LabelStrength/LineEditStrength") onready var intelVar = get_node("HBoxContainer/VBoxContainer/LabelIntellect/LineEditIntel") onready var willpowerVar = get_node("HBoxContainer/VBoxContainer2/LabelWillpower/LineEditWill") onready var charmVar = get_node("HBoxContainer/VBoxContainer2/LabelCharm/LineEditCharm") onready var weaponVar = get_node("HBoxContainer/VBoxContainer2/LabelWeapon/LineEditWeapon") onready var armorVar = get_node("HBoxContainer/VBoxContainer2/LabelArmor/LineEditArmor") -onready var quoteVar = get_node("HBoxContainer/VBoxContainer/LabelQuote/LineEditQuote") +onready var quoteVar = get_node("HBoxContainer/VBoxContainer2/LabelQuote/LineEditQuote") func writeToCSV(nameV, profV, strengthV, intelV, willpowerV, charmV, weaponV, armorV, quoteV): - pass - - + var f = File.new() + f.open("res://_userFiles/CharacterOutput.csv", File.WRITE) + var ArrayStrings = [PoolStringArray()] + + f.store_csv_line(["Name", nameV]) + f.store_csv_line(["Profession", profV]) + f.store_csv_line(["Strength", strengthV]) + f.store_csv_line(["Intellegence", intelV]) + f.store_csv_line(["Willpower", willpowerV]) + f.store_csv_line(["Charm", charmV]) + f.store_csv_line(["Weapon", weaponV]) + f.store_csv_line(["Armor", armorV]) + f.store_csv_line(["Quote", quoteV]) + f.close() + + +func _process(delta): + if SaveButton.pressed == true: + $Title/FileDialog.popup() + + writeToCSV(nameVar.get_text(), profVar.get_text(), + strengthVar.get_text(), intelVar.get_text(), willpowerVar.get_text(), + charmVar.get_text(), weaponVar.get_text(), armorVar.get_text(), quoteVar.get_text()) + func _ready() -> void: theme=load(settings.themeFile) - $Title/But_SaveChar.grab_focus() - -func _on_But_SaveChar_pressed() -> void: - $Title/FileDialog.popup() - + #DKM TEMP: just text for now from text edit func _on_FileDialog_file_selected(path: String) -> void: var pc = get_node("/root/PlayerCharacter") diff --git a/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/screens/Character_Add.tscn b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/screens/Character_Add.tscn index ccd1d91..786edc2 100644 --- a/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/screens/Character_Add.tscn +++ b/Phase2/Godot ===(Game Code)===/MergedMaster/bcirpg_mergedMaster_20220918ALuke/screens/Character_Add.tscn @@ -63,12 +63,12 @@ margin_bottom = 388.0 custom_constants/separation = 40 [node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"] -margin_right = 81.0 +margin_right = 105.0 margin_bottom = 358.0 custom_constants/separation = 20 [node name="LabelName" type="Label" parent="HBoxContainer/VBoxContainer"] -margin_right = 81.0 +margin_right = 105.0 margin_bottom = 31.0 text = "NAME " @@ -79,8 +79,8 @@ margin_right = 58.0 margin_bottom = 24.0 [node name="LabelProfession" type="Label" parent="HBoxContainer/VBoxContainer"] -margin_top = 60.0 -margin_right = 81.0 +margin_top = 51.0 +margin_right = 105.0 margin_bottom = 82.0 text = "PROFESSION " @@ -91,8 +91,8 @@ margin_right = 58.0 margin_bottom = 24.0 [node name="LabelStrength" type="Label" parent="HBoxContainer/VBoxContainer"] -margin_top = 120.0 -margin_right = 81.0 +margin_top = 102.0 +margin_right = 105.0 margin_bottom = 133.0 text = "STRENGTH " @@ -103,8 +103,8 @@ margin_right = 58.0 margin_bottom = 24.0 [node name="LabelIntellect" type="Label" parent="HBoxContainer/VBoxContainer"] -margin_top = 180.0 -margin_right = 81.0 +margin_top = 153.0 +margin_right = 105.0 margin_bottom = 184.0 text = "INTELLECT " @@ -114,9 +114,15 @@ margin_top = 25.0 margin_right = 58.0 margin_bottom = 24.0 +[node name="SaveButton" type="Button" parent="HBoxContainer/VBoxContainer"] +margin_top = 204.0 +margin_right = 105.0 +margin_bottom = 224.0 +text = "Save Character" + [node name="VBoxContainer2" type="VBoxContainer" parent="HBoxContainer"] -margin_left = 121.0 -margin_right = 200.0 +margin_left = 145.0 +margin_right = 224.0 margin_bottom = 358.0 custom_constants/separation = 30 @@ -132,7 +138,7 @@ margin_right = 58.0 margin_bottom = 24.0 [node name="LabelCharm" type="Label" parent="HBoxContainer/VBoxContainer2"] -margin_top = 60.0 +margin_top = 61.0 margin_right = 79.0 margin_bottom = 75.0 text = "CHARM" @@ -143,7 +149,7 @@ margin_right = 58.0 margin_bottom = 24.0 [node name="LabelWeapon" type="Label" parent="HBoxContainer/VBoxContainer2"] -margin_top = 120.0 +margin_top = 105.0 margin_right = 79.0 margin_bottom = 136.0 text = "WEAPON @@ -155,7 +161,7 @@ margin_right = 58.0 margin_bottom = 24.0 [node name="LabelArmor" type="Label" parent="HBoxContainer/VBoxContainer2"] -margin_top = 180.0 +margin_top = 166.0 margin_right = 79.0 margin_bottom = 180.0 text = "ARMOR" @@ -166,7 +172,7 @@ margin_right = 58.0 margin_bottom = 24.0 [node name="LabelQuote" type="Label" parent="HBoxContainer/VBoxContainer2"] -margin_top = 240.0 +margin_top = 210.0 margin_right = 79.0 margin_bottom = 224.0 text = "QUOTE"