mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-09 19:04:36 +01:00
Select correct entries in level selector when clicking them
This commit is contained in:
parent
56995440a2
commit
70fe577788
2 changed files with 5 additions and 2 deletions
2
main.gd
2
main.gd
|
@ -107,12 +107,14 @@ func repopulate_levels():
|
||||||
level_select.clear()
|
level_select.clear()
|
||||||
for level in levels.chapters[current_chapter].levels:
|
for level in levels.chapters[current_chapter].levels:
|
||||||
level_select.add_item(level.slug)
|
level_select.add_item(level.slug)
|
||||||
|
level_select.select(current_level)
|
||||||
|
|
||||||
func repopulate_chapters():
|
func repopulate_chapters():
|
||||||
levels.reload()
|
levels.reload()
|
||||||
chapter_select.clear()
|
chapter_select.clear()
|
||||||
for c in levels.chapters:
|
for c in levels.chapters:
|
||||||
chapter_select.add_item(c.slug)
|
chapter_select.add_item(c.slug)
|
||||||
|
chapter_select.select(current_chapter)
|
||||||
|
|
||||||
func update_repos():
|
func update_repos():
|
||||||
for r in repositories:
|
for r in repositories:
|
||||||
|
|
|
@ -157,8 +157,9 @@ func update_node_positions():
|
||||||
objects[ref].position = Vector2(target.position.x ,target.position.y - 100)
|
objects[ref].position = Vector2(target.position.x ,target.position.y - 100)
|
||||||
|
|
||||||
var target_reference = objects["HEAD"].children.keys()[0]
|
var target_reference = objects["HEAD"].children.keys()[0]
|
||||||
var target = objects[target_reference]
|
if objects.has(target_reference):
|
||||||
objects["HEAD"].position = Vector2(target.position.x ,target.position.y - 100)
|
var target = objects[target_reference]
|
||||||
|
objects["HEAD"].position = Vector2(target.position.x ,target.position.y - 100)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue