some small fixes, mtgo is done

This commit is contained in:
Nathan Singer 2025-04-24 11:45:29 -04:00
parent b9a07a8c47
commit f5edba7402
4 changed files with 24 additions and 1 deletions

View File

@ -17,7 +17,7 @@ func _card_error(error_type: String) -> String:
return "ERROR::CARD::%s::%s::%s::\n" % [card_id, card_name, error_type]
func init(id) -> void:
func _init(id) -> void:
card_id = id

17
deck_input.gd Normal file
View File

@ -0,0 +1,17 @@
extends Node
func convert_mtgo_to_http(decklist: String) -> Dictionary:
var links = {}
var lines = decklist.split("\n")
for line in lines:
var words = line.split(" ", false, 1)
if words.size() != 2:
continue
words[1] = words[1].replace(" ", "+")
links["https://api.scryfall.com/cards/named?exact=" + words[1]] = words[0]
return links
func _ready() -> void:
pass

1
deck_input.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://c0vxigp5y302o

View File

@ -1,6 +1,7 @@
extends Node2D
var player_class = preload("res://player.gd")
var deck_input = preload("res://deck_input.gd")
# Called when the node enters the scene tree for the first time.
@ -10,6 +11,10 @@ func _ready() -> void:
var player = player_class.new()
add_child(player)
move_child(player, 0)
var deck = deck_input.new()
add_child(deck)
pass # Replace with function body.