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

(1.21.x) feat: Add dropShadow support to drawCenteredString and drawScrollingString #1493

Open
wants to merge 4 commits into
base: 1.21.x
Choose a base branch
from

Conversation

baileyholl
Copy link
Contributor

@baileyholl baileyholl commented Aug 26, 2024

  • Copies the vanilla drawCenteredString methods and adds a dropShadow param, as vanilla does not expose it.
  • Adds overloads to supply a dropShadow boolean for renderScrollingString and drawScrollingString

@neoforged-pr-publishing
Copy link

  • Publish PR to GitHub Packages

@baileyholl baileyholl changed the title feat: Add drawShadow support to drawCenteredString methods (1.21.x) feat: Add drawShadow support to drawCenteredString methods Aug 26, 2024
@baileyholl baileyholl marked this pull request as draft August 26, 2024 23:13
@baileyholl baileyholl changed the title (1.21.x) feat: Add drawShadow support to drawCenteredString methods (1.21.x) feat: Add drawShadow support to drawCenteredString and drawScrollingString Aug 26, 2024
@baileyholl baileyholl changed the title (1.21.x) feat: Add drawShadow support to drawCenteredString and drawScrollingString (1.21.x) feat: Add dropShadow support to drawCenteredString and drawScrollingString Aug 26, 2024
@baileyholl baileyholl marked this pull request as ready for review August 26, 2024 23:33
@Matyrobbrt Matyrobbrt added enhancement New (or improvement to existing) feature or request rendering Related to rendering 1.21.1 Targeted at Minecraft 1.21.1 labels Aug 27, 2024
protected abstract void renderWidget(GuiGraphics p_282139_, int p_268034_, int p_268009_, float p_268085_);

public static void renderScrollingString(
+ GuiGraphics p_281620_, Font p_282651_, Component p_281467_, int p_283621_, int p_282084_, int p_283398_, int p_281938_, int p_283471_, boolean dropShadow
Copy link
Member

Choose a reason for hiding this comment

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

More of a nitpick, but can you re-order these overloads like this:

  • Original 8-param method
  • 8-param method with added shadow parameter
  • Original 9-param method
  • 9-param method with added shadow parameter

This should make the patch a bit easier to read

self().drawString(font, string, x - font.width(string) / 2, y, color, dropShadow);
}

default void drawCenteredString(Font font, Component p_282456_, int x, int y, int color, boolean dropShadow) {
Copy link
Member

Choose a reason for hiding this comment

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

Please use a proper name for the Component parameter

self().drawString(font, formattedcharsequence, x - font.width(formattedcharsequence) / 2, y, color, dropShadow);
}

default void drawCenteredString(Font font, FormattedCharSequence p_281854_, int x, int y, int color, boolean dropShadow) {
Copy link
Member

Choose a reason for hiding this comment

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

Please use a proper name for the FormattedCharSequence parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.1 Targeted at Minecraft 1.21.1 enhancement New (or improvement to existing) feature or request rendering Related to rendering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants