adds quick comment and some code for the images
This commit is contained in:
parent
fcf736af92
commit
3808955237
3
card.gd
3
card.gd
@ -10,6 +10,7 @@ var card_id = "placedholder_id"
|
|||||||
var card_name = "placeholder_name"
|
var card_name = "placeholder_name"
|
||||||
var card_type = "placeholder_card_type"
|
var card_type = "placeholder_card_type"
|
||||||
var oracle_text = "placeholder_oracle_text"
|
var oracle_text = "placeholder_oracle_text"
|
||||||
|
var image_path = "placeholder_image_path"
|
||||||
|
|
||||||
func _check_cache(id) -> bool:
|
func _check_cache(id) -> bool:
|
||||||
if (FileAccess.file_exists("user://card_cache/" + id + ".json")):
|
if (FileAccess.file_exists("user://card_cache/" + id + ".json")):
|
||||||
@ -28,6 +29,7 @@ func _do_scryfall_get(id) -> void:
|
|||||||
var card_cache = FileAccess.open("user://card_cache/" + id + ".json", FileAccess.WRITE)
|
var card_cache = FileAccess.open("user://card_cache/" + id + ".json", FileAccess.WRITE)
|
||||||
card_cache.store_string(card_content)
|
card_cache.store_string(card_content)
|
||||||
card_cache = null # closes the file
|
card_cache = null # closes the file
|
||||||
|
# store image at the same spot ("user://card_cache/id.png")
|
||||||
|
|
||||||
|
|
||||||
func load_card(id) -> void:
|
func load_card(id) -> void:
|
||||||
@ -40,6 +42,7 @@ func load_card(id) -> void:
|
|||||||
card_name = "loaded_cardname"
|
card_name = "loaded_cardname"
|
||||||
card_type = "loaded_type"
|
card_type = "loaded_type"
|
||||||
oracle_text = "loaded_oracletext"
|
oracle_text = "loaded_oracletext"
|
||||||
|
image_path = "loaded_image_path"
|
||||||
|
|
||||||
ondisk_card = null
|
ondisk_card = null
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user