Fixed Console erasing input when pressing down arrow key

This commit is contained in:
2019-08-08 20:34:18 -05:00
parent 9ab019f1bc
commit 3b662090fc

View File

@@ -80,8 +80,8 @@ class IMICFPS
when Gosu::KbDown when Gosu::KbDown
@command_history_index += 1 @command_history_index += 1
if @command_history_index > @command_history.size - 1 if @command_history_index > @command_history.size - 1
@text_input.text = "" unless @command_history_index > @command_history.size
@command_history_index = @command_history.size @command_history_index = @command_history.size
@text_input.text = ""
else else
@text_input.text = @command_history[@command_history_index] @text_input.text = @command_history[@command_history_index]
end end