Prepare feature: add cards mentioned in the description

This commit is contained in:
Sebastian Morr 2020-10-15 16:41:42 +02:00
parent f0383eb393
commit a7495ce054
2 changed files with 10 additions and 0 deletions

View file

@ -92,6 +92,7 @@ func _ready():
redraw_all_cards()
arrange_cards()
pass
func _process(delta):
if $Energy:
@ -165,3 +166,6 @@ func redraw_all_cards():
# draw_rand_card()
for card in cards:
draw_card(card)
func add_card(command):
draw_card({"command": command, "description": "", "arg_number": 0, "energy": 0})

View file

@ -64,6 +64,12 @@ func load_level(level_id):
level_congrats.bbcode_text = level.congrats
level_name.text = level.title
# var code_regex = RegEx.new()
# code_regex.compile("\\[code\\]([^\\[]*)\\[/code\\]")
# var matches = code_regex.search_all(level.description)
# for m in matches:
# cards.add_card(m.get_string(1))
for r in repositories_node.get_children():
r.queue_free()
repositories = {}