Skip to content

Fix compact chat scrolling #185

Description

@Alexdoru

When removing ChatLines from the drawChatLines of GuiNewWhat, if you have your chat opened and scrolled up somewhere, your whole chat will move.

This part of the code needs to be changed :

Current :

chatLinesWrapped.remove(index);
index--;

Fixed :

chatLinesWrapped.remove(index);
index--;
if (mc.ingameGUI.getChatGUI().getChatOpen()) {
    mc.ingameGUI.getChatGUI().scroll(-1);
}

In the method GuiNewChat.setLine, you can see that the vanilla code is doing the opposite operation to avoid the same problem when adding chat lines.

if (this.getChatOpen() && this.scrollPos > 0)
{
    this.isScrolled = true;
    this.scroll(1);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions