changed it so help message doesnt go off screen when typing commands rapidly. Does make it look a bit weird though
This commit is contained in:
@@ -57,10 +57,10 @@ func InputDelChar() -> void:
|
||||
func EnterCommand() -> void:
|
||||
var fullText = terminalLine.text
|
||||
var userInput = fullText.trim_prefix("user@work " + directory).strip_edges()
|
||||
var parts = userInput.to_lower().split(" ")
|
||||
|
||||
if historyContainer.get_child_count() <22:
|
||||
CreateHistoryEntry(fullText)
|
||||
var parts = userInput.to_lower().split(" ")
|
||||
|
||||
match parts[0]:
|
||||
"ls", "list":
|
||||
@@ -116,16 +116,16 @@ func CreateHistoryEntry(content: String) -> void:
|
||||
label.label_settings.font_size = 42
|
||||
label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
label.custom_minimum_size = Vector2(1400, 0)
|
||||
|
||||
if terminalLine.text.length() > 200:
|
||||
for child in historyContainer.get_children():
|
||||
if child != terminalLine:
|
||||
child.queue_free()
|
||||
#
|
||||
#if terminalLine.text.length() > 200:
|
||||
#for child in historyContainer.get_children():
|
||||
#if child != terminalLine:
|
||||
#child.queue_free()
|
||||
historyContainer.add_child(label)
|
||||
historyContainer.move_child(label, historyContainer.get_child_count() - 2)
|
||||
|
||||
# Limit history to 15 entries + 1 active line
|
||||
if historyContainer.get_child_count() > 22:
|
||||
if historyContainer.get_child_count() > 17:
|
||||
historyContainer.get_child(0).queue_free()
|
||||
|
||||
func ResolvePath(current: String, target: String) -> String:
|
||||
|
||||
Reference in New Issue
Block a user