formatting

This commit is contained in:
ShyProton 2025-04-28 00:59:02 -04:00
parent 709859abad
commit 45919dc5ae
3 changed files with 17 additions and 11 deletions

View File

@ -86,6 +86,7 @@ func get_card_data_from_id(id: String) -> Dictionary:
return _get_card_data_from_bulk(_search_results_generic("id", id))
func _search_results_name(search_query: String) -> Dictionary:
var selected_entry = null
for entry in _bulk_data:
@ -120,7 +121,9 @@ func _get_card_data_from_bulk(dict_entry: Dictionary) -> Dictionary:
dir.make_dir_recursive("user://card_cache/" + dict_entry["id"] + "/")
dir = null
var file = FileAccess.open("user://card_cache/" + dict_entry["id"] + "/card.json", FileAccess.WRITE)
var file = FileAccess.open(
"user://card_cache/" + dict_entry["id"] + "/card.json", FileAccess.WRITE
)
file.store_line(JSON.stringify(dict_entry, "\t"))
file.close()

View File

@ -17,6 +17,7 @@ func _write_to_decks(_decks: Array) -> void:
file.store_line(JSON.stringify(_decks))
file.close()
func load_decks() -> Array:
if !FileAccess.file_exists("user://decks.json"):
return []
@ -25,6 +26,7 @@ func load_decks() -> Array:
file.close()
return JSON.parse_string(file_text)
func _convert_mtgo_to_cache_lookup(decklist: String) -> Dictionary:
var _cards = {}
var lines = decklist.split("\n")

View File

@ -7,6 +7,7 @@ var fields: Array[Node] = []
var decks: Array[Dictionary]
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
# The first field in the array will be the player's own field.