mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-12-22 20:32:38 +01:00
Levels specify which cards should be displayed
This commit is contained in:
parent
f19d2bee8a
commit
3437b89ffc
11 changed files with 23 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
title = Parallelism
|
title = Parallelism
|
||||||
|
cards = checkout commit-auto reset-hard
|
||||||
|
|
||||||
[description]
|
[description]
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
title = Contradictions
|
title = Contradictions
|
||||||
|
cards = checkout commit-auto reset-hard merge
|
||||||
|
|
||||||
[description]
|
[description]
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
title = Merging timelines
|
title = Merging timelines
|
||||||
|
cards = checkout commit-auto reset-hard merge
|
||||||
|
|
||||||
[description]
|
[description]
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
title = Helping each other
|
title = Helping each other
|
||||||
|
cards = checkout commit-auto reset-hard pull push
|
||||||
|
|
||||||
[description]
|
[description]
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
title = Rebasing
|
title = Rebasing
|
||||||
|
cards = checkout commit-auto reset-hard rebase
|
||||||
|
|
||||||
[description]
|
[description]
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
title = Reordering events
|
title = Reordering events
|
||||||
|
cards = checkout commit-auto reset-hard rebase-interactive cherry-pick
|
||||||
|
|
||||||
[description]
|
[description]
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
title = Welcome!
|
title = Welcome!
|
||||||
|
cards = checkout commit-auto reset-hard
|
||||||
|
|
||||||
[description]
|
[description]
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ var cards
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
load_card_store()
|
load_card_store()
|
||||||
redraw_all_cards()
|
#redraw_all_cards()
|
||||||
arrange_cards()
|
arrange_cards()
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -43,6 +43,15 @@ func draw_card(card):
|
||||||
add_child(new_card)
|
add_child(new_card)
|
||||||
arrange_cards()
|
arrange_cards()
|
||||||
|
|
||||||
|
func draw(ids):
|
||||||
|
for card in get_tree().get_nodes_in_group("cards"):
|
||||||
|
card.queue_free()
|
||||||
|
|
||||||
|
for id in ids:
|
||||||
|
draw_card(card_store[id])
|
||||||
|
|
||||||
|
arrange_cards()
|
||||||
|
|
||||||
func arrange_cards():
|
func arrange_cards():
|
||||||
var t = Timer.new()
|
var t = Timer.new()
|
||||||
t.wait_time = 0.05
|
t.wait_time = 0.05
|
||||||
|
@ -81,5 +90,7 @@ func redraw_all_cards():
|
||||||
for card in card_store:
|
for card in card_store:
|
||||||
draw_card(card_store[card])
|
draw_card(card_store[card])
|
||||||
|
|
||||||
|
arrange_cards()
|
||||||
|
|
||||||
func add_card(command):
|
func add_card(command):
|
||||||
draw_card({"command": command, "description": "", "arg_number": 0, "energy": 0})
|
draw_card({"command": command, "description": "", "arg_number": 0, "energy": 0})
|
||||||
|
|
|
@ -14,6 +14,7 @@ __meta__ = {
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="Button" type="Button" parent="."]
|
[node name="Button" type="Button" parent="."]
|
||||||
|
visible = false
|
||||||
anchor_left = 1.0
|
anchor_left = 1.0
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
margin_left = -172.0
|
margin_left = -172.0
|
||||||
|
|
|
@ -5,6 +5,7 @@ var slug
|
||||||
var title
|
var title
|
||||||
var description
|
var description
|
||||||
var congrats
|
var congrats
|
||||||
|
var cards
|
||||||
var repos = {}
|
var repos = {}
|
||||||
|
|
||||||
# The path is an outer path.
|
# The path is an outer path.
|
||||||
|
@ -20,6 +21,7 @@ func load(path):
|
||||||
title = config.get("title", slug)
|
title = config.get("title", slug)
|
||||||
description = config.get("description", "(no description)")
|
description = config.get("description", "(no description)")
|
||||||
congrats = config.get("congrats", "Good job, you solved the level!\n\nFeel free to try a few more things or click 'Next Level'.")
|
congrats = config.get("congrats", "Good job, you solved the level!\n\nFeel free to try a few more things or click 'Next Level'.")
|
||||||
|
cards = Array(config.get("cards", "checkout commit-auto merge rebase rebase-interactive reset-hard cherry-pick").split(" "))
|
||||||
|
|
||||||
var keys = config.keys()
|
var keys = config.keys()
|
||||||
var repo_setups = []
|
var repo_setups = []
|
||||||
|
|
|
@ -63,6 +63,7 @@ func load_level(level_id):
|
||||||
level_description.bbcode_text = level.description
|
level_description.bbcode_text = level.description
|
||||||
level_congrats.bbcode_text = level.congrats
|
level_congrats.bbcode_text = level.congrats
|
||||||
level_name.text = level.title
|
level_name.text = level.title
|
||||||
|
cards.draw(levels.chapters[current_chapter].levels[current_level].cards)
|
||||||
|
|
||||||
for r in repositories_node.get_children():
|
for r in repositories_node.get_children():
|
||||||
r.queue_free()
|
r.queue_free()
|
||||||
|
@ -131,6 +132,5 @@ func update_repos():
|
||||||
if levels.chapters[current_chapter].levels[current_level].check_win():
|
if levels.chapters[current_chapter].levels[current_level].check_win():
|
||||||
show_win_status()
|
show_win_status()
|
||||||
|
|
||||||
|
|
||||||
func toggle_cards():
|
func toggle_cards():
|
||||||
cards.visible = not cards.visible
|
cards.visible = not cards.visible
|
||||||
|
|
Loading…
Reference in a new issue