GlitchCog / ChatGameFontificator

A Twitch chat display that uses the fonts of various video games
The Unlicense
91 stars 13 forks source link

Chat log does not update when Twitch badges are disabled #8

Closed TheOpponent closed 7 years ago

TheOpponent commented 7 years ago

In the version dated January 27, 2017, no messages from users with Twitch badges are written to the window when Twitch badges are hidden. They only appear after re-enabling them. A possible workaround for this version is to disable badges, save the configuration and re-open the program, then re-enable the badges, where the badges will still not show but messages are written to the log.

GlitchCog commented 7 years ago

Thank you for finding and reporting this. The bug seems to occur whenever there are no badges loaded in the configuration (neither Twitch nor FrankerFaceZ) when the program first starts up and connects. If either type of badge is enabled, the messages will be displayed. If neither is enabled, as you said, no messages will be displayed until either one is enabled. After enabling one or the other, the program begins to work as it is expected to, with the Twitch and FrankerFaceZ Badge check boxes correctly enabling and disabling those badge types without affecting whether messages are displayed. It also seems that when the program first starts with no badges displayed, the screen is never refreshed at all, so even adjusting the size of the window will not cause a border redraw to occur. I'll see what I can do to get this fixed in the next few days. Thanks again!

GlitchCog commented 7 years ago

It looks like this this bug was introduced back in June 14, 2016 with the addition of FrankerFaceZ Badge support. In the Message class, in the getIndexUsername(ConfigMessage messageConfig) method, I switched out an integer that counted how many badges preceded the message with a call to .size() off a collection of all the badges for the message. If no badges are enabled at all, that collection remains null, and the call to .size() throws an exception.

GlitchCog commented 7 years ago

It should be fixed now. I tested it out myself, but please let me know whether you think the bug has been corrected. There is a new JAR checked in with the code change, which is here, and also on the main README page's Download link. Thanks!

TheOpponent commented 7 years ago

It seems to work properly now. Thank you for your attention on the issue.