Console can now be turned off or on, off by default

This commit is contained in:
Paul Black 2023-07-15 19:04:45 -06:00
parent 0a76f14556
commit fc5ffdd8d2

View file

@ -2,18 +2,20 @@ extends Node
var scenePlayground = "res://scenes/playground.tscn"
var sceneTutorial = "res://scenes/tutorial.tscn"
var consoleEnabled = false
func _ready():
pass
func _process(delta):
if not Global.consoleOpen:
self.queue_free()
if Input.is_action_just_pressed("console_send"):
Global.consoleCommand = $consoleEdit.text
print ("Console command run: ", Global.consoleCommand)
run_command(Global.consoleCommand)
if consoleEnabled == true:
if not Global.consoleOpen:
self.queue_free()
if Input.is_action_just_pressed("console_send"):
Global.consoleCommand = $consoleEdit.text
print ("Console command run: ", Global.consoleCommand)
run_command(Global.consoleCommand)
func run_command(command):
if command == "tele playground":