ConsoleOutputHandler has method spell() used to type out a message character by character:
public static void spell(String input) {
for(int i = 0; i < input.length(); i++) {
System.out.print(input.charAt(i));
try {
TimeUnit.MILLISECONDS.sleep(SPELL_DELAY);
}
catch(InterruptedException e) {
//if interrupted, clear the interrupt flag and continue
Thread.currentThread().interrupt();
}
}
}
ConsoleOutputHandler has method spell() used to type out a message character by character:
Improvements needed:
Currently, hitting enter while the message is being spelled out makes a new line and disrupts the message. This should be changed so when enter is pressed the line is immediately completed in full.
All other user input is still active during spelling (it is possible to type a command and hit enter, during spelling, and it will execute. This should be remedied so user input is accepted only when prompted?