some small fixes, mtgo is done
This commit is contained in:
parent
b9a07a8c47
commit
f5edba7402
2
card.gd
2
card.gd
@ -17,7 +17,7 @@ func _card_error(error_type: String) -> String:
|
|||||||
return "ERROR::CARD::%s::%s::%s::\n" % [card_id, card_name, error_type]
|
return "ERROR::CARD::%s::%s::%s::\n" % [card_id, card_name, error_type]
|
||||||
|
|
||||||
|
|
||||||
func init(id) -> void:
|
func _init(id) -> void:
|
||||||
card_id = id
|
card_id = id
|
||||||
|
|
||||||
|
|
||||||
|
17
deck_input.gd
Normal file
17
deck_input.gd
Normal 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
1
deck_input.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://c0vxigp5y302o
|
@ -1,6 +1,7 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
var player_class = preload("res://player.gd")
|
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.
|
# Called when the node enters the scene tree for the first time.
|
||||||
@ -10,6 +11,10 @@ func _ready() -> void:
|
|||||||
var player = player_class.new()
|
var player = player_class.new()
|
||||||
add_child(player)
|
add_child(player)
|
||||||
move_child(player, 0)
|
move_child(player, 0)
|
||||||
|
|
||||||
|
var deck = deck_input.new()
|
||||||
|
add_child(deck)
|
||||||
|
|
||||||
|
|
||||||
pass # Replace with function body.
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user