Add sandbox button to the title, and add CLI badge explainer

This commit is contained in:
blinry 2021-02-04 15:19:54 +01:00
parent cab8a9837c
commit 13dc516edf
9 changed files with 30 additions and 8 deletions

View file

@ -1,3 +1,7 @@
title = Empty sandbox title = Empty sandbox
[description]
This is an empty sandbox you can play around in.
[setup] [setup]

2
levels/sandbox/sequence Normal file
View file

@ -0,0 +1,2 @@
empty
three-commits

View file

@ -1,4 +1,5 @@
title = Three commits title = Sandbox
cards = checkout add reset-file checkout-file commit merge rebase
[setup] [setup]
@ -16,9 +17,9 @@ git branch not_main
[description] [description]
That's all for now! Here's a sandbox you can play around in. Here's a sandbox you can play around in.
Did you see the black terminal at the very bottom? All cards you play translate into actual commands, and there'a a real Git repo behind this! Fun things to try: You can use both the playing cards, as well as the terminal. Fun things to try:
- Make a commit that merges three timelines together at once! - Make a commit that merges three timelines together at once!
- Create some tags! - Create some tags!

View file

@ -3,3 +3,4 @@ files
branches branches
merge merge
index index
sandbox

View file

@ -54,6 +54,9 @@ func reload():
badge.sparkling = false badge.sparkling = false
level_list.add_child(hb) level_list.add_child(hb)
if badge.active:
game.notify("You get a golden badge for each level you solve without using the playing cards! Can you solve them all using the command line?", badge, "cli-badge")
level_id += 1 level_id += 1
chapter_id += 1 chapter_id += 1

View file

@ -18,7 +18,7 @@ func _ready():
path = game.tmp_prefix+"/repos/sandbox/" path = game.tmp_prefix+"/repos/sandbox/"
helpers.careful_delete(path) helpers.careful_delete(path)
game.global_shell.run("mkdir " + path) game.global_shell.run("mkdir '%s'" % path)
game.global_shell.cd(path) game.global_shell.cd(path)
game.global_shell.run("git init") game.global_shell.run("git init")
game.global_shell.run("git symbolic-ref HEAD refs/heads/main") game.global_shell.run("git symbolic-ref HEAD refs/heads/main")

View file

@ -3,8 +3,7 @@
[ext_resource path="res://scenes/terminal.tscn" type="PackedScene" id=1] [ext_resource path="res://scenes/terminal.tscn" type="PackedScene" id=1]
[ext_resource path="res://scenes/repository.tscn" type="PackedScene" id=2] [ext_resource path="res://scenes/repository.tscn" type="PackedScene" id=2]
[ext_resource path="res://styles/theme.tres" type="Theme" id=3] [ext_resource path="res://styles/theme.tres" type="Theme" id=3]
[ext_resource path="res://sandbox.gd" type="Script" id=4] [ext_resource path="res://scenes/sandbox.gd" type="Script" id=4]
[node name="Sandbox" type="Control"] [node name="Sandbox" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
@ -41,7 +40,6 @@ anchor_bottom = 0.0
margin_right = 949.0 margin_right = 949.0
margin_bottom = 1070.0 margin_bottom = 1070.0
size_flags_horizontal = 3 size_flags_horizontal = 3
editable_path = true
[node name="Terminal" parent="Columns" instance=ExtResource( 1 )] [node name="Terminal" parent="Columns" instance=ExtResource( 1 )]
anchor_right = 0.0 anchor_right = 0.0

View file

@ -14,3 +14,9 @@ func levels():
func on_survey_pressed(): func on_survey_pressed():
game.open_survey() game.open_survey()
func sandbox():
game.current_chapter = levels.chapters.size() - 1
game.current_level = levels.chapters[game.current_chapter].levels.size() -1
get_tree().change_scene("res://scenes/main.tscn")

View file

@ -71,10 +71,17 @@ margin_right = 351.0
margin_bottom = 39.0 margin_bottom = 39.0
text = "Levels" text = "Levels"
[node name="Button2" type="Button" parent="VBoxContainer"] [node name="Button3" type="Button" parent="VBoxContainer"]
margin_top = 44.0 margin_top = 44.0
margin_right = 351.0 margin_right = 351.0
margin_bottom = 83.0 margin_bottom = 83.0
text = "Sandbox"
[node name="Button2" type="Button" parent="VBoxContainer"]
margin_top = 88.0
margin_right = 351.0
margin_bottom = 127.0
text = "Quit" text = "Quit"
[connection signal="pressed" from="VBoxContainer/Button" to="." method="levels"] [connection signal="pressed" from="VBoxContainer/Button" to="." method="levels"]
[connection signal="pressed" from="VBoxContainer/Button3" to="." method="sandbox"]
[connection signal="pressed" from="VBoxContainer/Button2" to="." method="quit"] [connection signal="pressed" from="VBoxContainer/Button2" to="." method="quit"]