mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-05-18 12:17:46 +02:00
Compare commits
3 commits
dad6c9b39d
...
8f2a27c3fa
Author | SHA1 | Date | |
---|---|---|---|
8f2a27c3fa | |||
9da0bd1fbd | |||
1fa435eedd |
|
@ -21,7 +21,7 @@ Wanna build your own level? Great! Here's how to do it:
|
|||
1. Run the game – the easiest way to do so is to run `godot scenes/main.tscn` from the project directory.
|
||||
1. Get a bit familiar with the levels which are currently there.
|
||||
1. Take a look into the `levels` directory. It's split into chapters, and each level is a file.
|
||||
1. Make a copy of an existing level or start writing your own. See the documention of the format below.
|
||||
1. Make a copy of an existing level or start writing your own. See the documentation of the format below.
|
||||
1. Write and test your level. If you're happy with it, feel free to send it to us in a pull request! <3
|
||||
|
||||
### Level format
|
||||
|
|
|
@ -35,4 +35,4 @@ test "$(git show main^:c)" != "c"
|
|||
|
||||
[congrats]
|
||||
|
||||
Well done! Try tavelling between the commits using `git checkout`, so you can look at their contents again!
|
||||
Well done! Try travelling between the commits using `git checkout`, so you can look at their contents again!
|
||||
|
|
|
@ -39,7 +39,7 @@ git add recipe
|
|||
|
||||
[win]
|
||||
|
||||
# Did you resolve the confict and commit?
|
||||
# Did you resolve the conflict and commit?
|
||||
{ git show HEAD | grep "Flour"; } && { git show HEAD | grep "Salt"; }
|
||||
|
||||
# Did you clear stash stack?
|
||||
|
|
|
@ -74,7 +74,7 @@ func shell_received(text):
|
|||
|
||||
func _notification(what):
|
||||
if what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST:
|
||||
#get_tree().quit() # default behavio
|
||||
#get_tree().quit() # default behavior
|
||||
get_tree().change_scene("res://scenes/survey.tscn")
|
||||
|
||||
|
||||
|
|
|
@ -34,29 +34,14 @@ func _ready():
|
|||
history_position = game.state["history"].size()
|
||||
|
||||
func _input(event):
|
||||
if not input.has_focus():
|
||||
if not input.has_focus() or not event.is_pressed():
|
||||
return
|
||||
|
||||
if game.state["history"].size() > 0:
|
||||
if event.is_action_pressed("ui_up"):
|
||||
if history_position > 0:
|
||||
history_position -= 1
|
||||
input.text = game.state["history"][history_position]
|
||||
input.caret_position = input.text.length()
|
||||
# This prevents the Input taking the arrow as a "skip to beginning" command.
|
||||
get_tree().set_input_as_handled()
|
||||
if event.is_action_pressed("ui_down"):
|
||||
if history_position < game.state["history"].size()-1:
|
||||
history_position += 1
|
||||
input.text = game.state["history"][history_position]
|
||||
input.caret_position = input.text.length()
|
||||
get_tree().set_input_as_handled()
|
||||
|
||||
if event.is_action_pressed("tab_complete"):
|
||||
if event.is_action("tab_complete"):
|
||||
if completions.visible:
|
||||
completions.get_root().get_children().select(0)
|
||||
get_tree().set_input_as_handled()
|
||||
if event.is_action_pressed("delete_word"):
|
||||
elif event.is_action("delete_word"):
|
||||
var first_half = input.text.substr(0,input.caret_position)
|
||||
var second_half = input.text.substr(input.caret_position)
|
||||
|
||||
|
@ -66,9 +51,32 @@ func _input(event):
|
|||
input.caret_position = idx+1
|
||||
else:
|
||||
input.text = "" + second_half
|
||||
if event.is_action_pressed("clear"):
|
||||
elif event.is_action("clear"):
|
||||
clear()
|
||||
|
||||
elif event.is_action("ui_page_up"):
|
||||
var scroll = output.get_v_scroll()
|
||||
scroll.set_value(scroll.value - output.get_rect().size.y / 2)
|
||||
elif event.is_action("ui_page_down"):
|
||||
var scroll = output.get_v_scroll()
|
||||
scroll.set_value(scroll.value + output.get_rect().size.y / 2)
|
||||
elif game.state["history"].size() > 0:
|
||||
if event.is_action("ui_up"):
|
||||
if history_position > 0:
|
||||
history_position -= 1
|
||||
input.text = game.state["history"][history_position]
|
||||
input.caret_position = input.text.length()
|
||||
# This prevents the Input taking the arrow as a "skip to beginning" command.
|
||||
get_tree().set_input_as_handled()
|
||||
elif event.is_action("ui_down"):
|
||||
if history_position < game.state["history"].size():
|
||||
history_position += 1
|
||||
if history_position == game.state["history"].size():
|
||||
input.text = ""
|
||||
else:
|
||||
input.text = game.state["history"][history_position]
|
||||
input.caret_position = input.text.length()
|
||||
get_tree().set_input_as_handled()
|
||||
|
||||
func load_command(id):
|
||||
input.text = premade_commands[id]
|
||||
input.caret_position = input.text.length()
|
||||
|
|
Loading…
Reference in a new issue