Enable files' drop area, two levels about the index

This commit is contained in:
blinry 2020-11-09 20:45:39 +01:00
parent a893cba9d3
commit 8760ad7178
8 changed files with 87 additions and 6 deletions

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=5 format=2]
[ext_resource path="res://scenes/file_browser_item.gd" type="Script" id=1]
[ext_resource path="res://fonts/default.tres" type="DynamicFont" id=2]
[ext_resource path="res://nodes/document.svg" type="Texture" id=3]
[ext_resource path="res://scenes/drop_area.tscn" type="PackedScene" id=4]
[node name="Control" type="Control"]
anchor_right = 0.104
@ -79,3 +80,6 @@ custom_fonts/font = ExtResource( 2 )
text = "filename"
align = 1
autowrap = true
[node name="DropArea" parent="." instance=ExtResource( 4 )]
position = Vector2( 88.6643, 48.5029 )

View file

@ -21,7 +21,9 @@ func load(path):
title = config.get("title", slug)
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'.")
cards = Array(config.get("cards", "checkout commit-auto merge rebase rebase-interactive reset-hard cherry-pick add").split(" "))
cards = Array(config.get("cards", "").split(" "))
if cards == [""]:
cards = []
var keys = config.keys()
var repo_setups = []

View file

@ -65,7 +65,10 @@ func load_level(level_id):
level_description.bbcode_text = level.description
level_congrats.bbcode_text = level.congrats
level_name.text = level.title
cards.draw(levels.chapters[current_chapter].levels[current_level].cards)
if levels.chapters[current_chapter].levels[current_level].cards.size() == 0:
cards.redraw_all_cards()
else:
cards.draw(levels.chapters[current_chapter].levels[current_level].cards)
for r in repositories_node.get_children():
r.queue_free()

View file

@ -197,7 +197,7 @@ margin_right = 633.0
margin_bottom = 582.0
size_flags_vertical = 3
size_flags_stretch_ratio = 0.5
title = "Next Commit:"
title = "Plan for the next commit"
mode = 2
[node name="FileBrowser" parent="Rows/Columns/RightSide" instance=ExtResource( 5 )]