Retera / WarsmashModEngine

An emulation engine to improve Warcraft III modding
GNU Affero General Public License v3.0
231 stars 42 forks source link

Line breaks in text messages from JASS functions are not translated in the UI #40

Open tdauth opened 1 year ago

tdauth commented 1 year ago

Play the beginning of the War Chasers map. The line breaks are not shown.

It should be in MeleeUI:

public void showGameMessage(final String message, final float expireTime) {
        this.rootFrame.setText(this.gameMessagesFrame, message);
        this.gameMessagesFrame.setVisible(true);
        final long millis = TimeUtils.millis();

        this.lastGameMessageExpireTime = millis + (long) (expireTime * 1000);
        this.lastGameMessageFadeTime = millis + (long) (expireTime * 900);
        this.gameMessagesFrame.setAlpha(1.0f);
    }

which calls StringFrame.setText and I think the text is then used in StringFrame.createInternalFrames which already handles |n and color codes, so I am not sure why it is not displayed properly. I am not sure how these singleStringFrame should work.

Retera commented 1 year ago

The entire system for showing game messages is lacking because there is not a scrolling history in the manner we come to expect. So, if two messages are sent to the screen, only the latest shows. Ideally it would be rewritten to fix this.