Skip to content

Commit

Permalink
Created a defualt name scheme for Character Sheets
Browse files Browse the repository at this point in the history
  • Loading branch information
PersonGuyGit committed Apr 14, 2024
1 parent 4ada339 commit 6164320
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Expand Up @@ -46,6 +46,7 @@ func _prep_PlayerCharacter_Template():

func save_data_to_csv(data: Array, file_path: String):
var file = File.new()

if file.open(file_path, File.WRITE) == OK:
for row in data:
file.store_string(format_row(row))
Expand All @@ -69,7 +70,13 @@ func _on_But_SaveChar_pressed():

_prep_PlayerCharacter_Template()

var file_path = "user://character_data.csv"
var file_path = ""

if pSingleton.name != "":
file_path = "user://" + pSingleton.name + "_data.csv"

else:
file_path = "user://character_data.csv"

# To Do. Format data into the correct table.

Expand Down
Expand Up @@ -28,8 +28,6 @@ func _prep_PlayerCharacter_Template(loadedCSVData):
pSingleton.armor = loadedCSVData[6]
pSingleton.quote = loadedCSVData[7]

print("P Singleton")
print(pSingleton)


func load_csv_data(path):
Expand Down

0 comments on commit 6164320

Please sign in to comment.