Commit 9026e825 authored by Vinzent Rittel's avatar Vinzent Rittel
Browse files

fix debugging errors

parent 42d483e4
......@@ -33,10 +33,10 @@ func on_prompt_screen_quit(screen_node: Node, game_stage: Node):
destroy(screen_node)
game_stage.modulate = Color(1,1,1)
func load_instructions_from_xml(filename: String):
func load_instructions_from_xml(_filename: String):
return {1: "cool", 2: "dude"}
func load_prompt_from_xml(filename: String):
func load_prompt_from_xml(_filename: String):
return "My new prompt"
func destroy(node: Node):
......
......@@ -31,6 +31,10 @@ func add_instruction(id: int, instruction: String, below: Node=null):
code_container.add_child(instruction_node)
return instruction_node
func remove_instruction(node: Node):
code_container.remove_child(node)
node.queue_free()
func on_hovered_instruction(sender: Node):
if dragged_instruction and sender != dragged_instruction:
swap(dragged_instruction, sender)
......@@ -43,7 +47,8 @@ func on_dropped_instruction(_sender: Node):
func on_pressed_instruction(sender: Node):
if sender.id == 0 and sender.get_text() == "nop":
code_container.remove_child(sender)
remove_instruction(sender)
print(collect_results())
else:
add_instruction(0, "nop", sender)
......
......@@ -20,8 +20,8 @@ var should_release = false
var lock_progress = 0.0
var dragged = false
func init(id: int, text: String):
self.id = id
func init(new_id: int, text: String):
id = new_id
set_text(text)
return self
......
......@@ -16,6 +16,8 @@ func set_text(text):
func shrink():
rect_size.y = 0
if not is_inside_tree():
yield(self, "tree_entered")
rect_size.x = get_viewport_rect().size.x
rect_position = Vector2(0,0)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment