wait we can just finish the card cache check rn

This commit is contained in:
Nathan Singer 2025-04-22 13:45:45 -04:00
parent a67f2e1096
commit fcf736af92

View File

@ -11,8 +11,9 @@ var card_name = "placeholder_name"
var card_type = "placeholder_card_type"
var oracle_text = "placeholder_oracle_text"
func _check_cache() -> bool:
## want to check the cache before we make any scryfall calls
func _check_cache(id) -> bool:
if (FileAccess.file_exists("user://card_cache/" + id + ".json")):
return true
return false
func _do_scryfall_get(id) -> void:
@ -30,7 +31,7 @@ func _do_scryfall_get(id) -> void:
func load_card(id) -> void:
if !(_check_cache()):
if !(_check_cache(id)):
_do_scryfall_get(id)
var ondisk_card = FileAccess.open("user://card_cache/" + id + ".json", FileAccess.READ)