Skip to content

ConsoleOutputHandler spell() improvements #12

Description

@liam027

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();
            }
        }
    }

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?

Metadata

Metadata

Labels

bugSomething isn't workingenhancementNew feature or requesthelp wantedExtra attention is needed

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions