Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Emojicord's emoji context calculation #539

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

Meldexun
Copy link
Contributor

Emojicord calls Thread.currentThread().getStackTrace() to calculate the emoji context whenever text gets rendered. For example, in the hotkey menu, there is a huge FPS drop. Also, see Team-Fruit/Emojicord#23.

This PR fixes this issue by setting a flag at the start of GuiChat#drawScreen and GuiNewChat#drawChat which eliminates the need to check the stack trace.

Copy link

what-the-diff bot commented Aug 21, 2024

PR Summary

  • New Dependency Added
    We've included a new dependency for emojicord in the dependencies.gradle file.
  • Debug Support
    In gradle.properties, a debug flag has been added for emojicord to support troubleshooting.
  • Configuration Settings Update
    We've introduced a new emojicord category with a boolean configuration property in UTConfigMods.java to provide more control over this functionality.
  • Plugin Loading Update
    In UTLoadingPlugin.java, we've added a field to check if the EmojicordCorePlugin is loaded, and included a condition for new mixin configuration related to emojicord.
  • New Component Development
    We have added a new class EmojiFontRendererContext.java for managing font rendering context for emojis.
  • Mixin Class Additions
    Three new mixin classes (UTEmojiFontRendererMixin.java, UTGuiChatMixin.java, UTGuiNewChatMixin.java) have been added for expanding functionality and interaction with emojis.
  • Localization Improvement
    A new translation for emojicord has been added to the en_us.lang file to enhance user interface experience.
  • Mixin Configuration Update
    A new emojicord related mixin configuration has been added in mixins.mods.emojicord.emojicontext.json for better control over emojicord interactions.

Copy link
Owner

@ACGaming ACGaming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a readme entry for this? Otherwise, this is good to merge!

@Meldexun
Copy link
Contributor Author

Can you add a readme entry for this? Otherwise, this is good to merge!

Done.

By the way I forgot to mention that I added the mixin config to UTLoadingPlugin because the EmojiFontRenderer class and the GuiChat class are loaded early and thus require IEarlyMixinLoader. I noticed that all other mod mixin configs are added to UTMixinLoader. Just wanted to tell you because I'm not sure if what I did is correct and might be overlooked easily.

@Meldexun Meldexun requested a review from ACGaming August 21, 2024 19:32
Copy link
Owner

@ACGaming ACGaming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these are essentially vanilla injections which require EmojiFontRendererContext, UTLoadingPlugin should be the right choice. Regular mod detection would not work at this stage but this is already handled via reflection class checking.

@ACGaming ACGaming merged commit 375034f into ACGaming:main Aug 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants