formatting
This commit is contained in:
parent
709859abad
commit
45919dc5ae
@ -86,6 +86,7 @@ func get_card_data_from_id(id: String) -> Dictionary:
|
|||||||
|
|
||||||
return _get_card_data_from_bulk(_search_results_generic("id", id))
|
return _get_card_data_from_bulk(_search_results_generic("id", id))
|
||||||
|
|
||||||
|
|
||||||
func _search_results_name(search_query: String) -> Dictionary:
|
func _search_results_name(search_query: String) -> Dictionary:
|
||||||
var selected_entry = null
|
var selected_entry = null
|
||||||
for entry in _bulk_data:
|
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.make_dir_recursive("user://card_cache/" + dict_entry["id"] + "/")
|
||||||
dir = null
|
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.store_line(JSON.stringify(dict_entry, "\t"))
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ func _write_to_decks(_decks: Array) -> void:
|
|||||||
file.store_line(JSON.stringify(_decks))
|
file.store_line(JSON.stringify(_decks))
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
|
|
||||||
func load_decks() -> Array:
|
func load_decks() -> Array:
|
||||||
if !FileAccess.file_exists("user://decks.json"):
|
if !FileAccess.file_exists("user://decks.json"):
|
||||||
return []
|
return []
|
||||||
@ -25,6 +26,7 @@ func load_decks() -> Array:
|
|||||||
file.close()
|
file.close()
|
||||||
return JSON.parse_string(file_text)
|
return JSON.parse_string(file_text)
|
||||||
|
|
||||||
|
|
||||||
func _convert_mtgo_to_cache_lookup(decklist: String) -> Dictionary:
|
func _convert_mtgo_to_cache_lookup(decklist: String) -> Dictionary:
|
||||||
var _cards = {}
|
var _cards = {}
|
||||||
var lines = decklist.split("\n")
|
var lines = decklist.split("\n")
|
||||||
|
@ -7,6 +7,7 @@ var fields: Array[Node] = []
|
|||||||
|
|
||||||
var decks: Array[Dictionary]
|
var decks: Array[Dictionary]
|
||||||
|
|
||||||
|
|
||||||
# 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() -> void:
|
func _ready() -> void:
|
||||||
# The first field in the array will be the player's own field.
|
# The first field in the array will be the player's own field.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user