Merge pull request #5558 from TropheusJ/mc1.20.1/rename-renderButton

rename AbstractSimiWidget#renderButton
This commit is contained in:
simibubi 2023-10-22 12:05:55 +02:00 committed by GitHub
commit 2b2b6cf044
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 15 additions and 15 deletions

View File

@ -72,7 +72,7 @@ public abstract class AbstractSimiWidget extends AbstractWidget implements Ticka
@Override @Override
public void renderWidget(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { public void renderWidget(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
beforeRender(graphics, mouseX, mouseY, partialTicks); beforeRender(graphics, mouseX, mouseY, partialTicks);
renderButton(graphics, mouseX, mouseY, partialTicks); doRender(graphics, mouseX, mouseY, partialTicks);
afterRender(graphics, mouseX, mouseY, partialTicks); afterRender(graphics, mouseX, mouseY, partialTicks);
wasHovered = isHoveredOrFocused(); wasHovered = isHoveredOrFocused();
} }
@ -81,7 +81,7 @@ public abstract class AbstractSimiWidget extends AbstractWidget implements Ticka
graphics.pose().pushPose(); graphics.pose().pushPose();
} }
protected void renderButton(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { protected void doRender(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
} }
protected void afterRender(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { protected void afterRender(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {

View File

@ -121,7 +121,7 @@ public class BoxWidget extends ElementWidget {
} }
@Override @Override
public void renderButton(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { public void doRender(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
float fadeValue = fade.getValue(partialTicks); float fadeValue = fade.getValue(partialTicks);
if (fadeValue < .1f) if (fadeValue < .1f)
return; return;
@ -133,7 +133,7 @@ public class BoxWidget extends ElementWidget {
.withBounds(width, height) .withBounds(width, height)
.render(graphics); .render(graphics);
super.renderButton(graphics, mouseX, mouseY, partialTicks); super.doRender(graphics, mouseX, mouseY, partialTicks);
wasHovered = isHovered; wasHovered = isHovered;
} }

View File

@ -130,7 +130,7 @@ public class ElementWidget extends AbstractSimiWidget {
} }
@Override @Override
public void renderButton(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { public void doRender(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
PoseStack ms = graphics.pose(); PoseStack ms = graphics.pose();
ms.pushPose(); ms.pushPose();
ms.translate(getX() + paddingX, getY() + paddingY, z); ms.translate(getX() + paddingX, getY() + paddingY, z);

View File

@ -21,7 +21,7 @@ public class IconButton extends AbstractSimiWidget {
} }
@Override @Override
public void renderButton(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { public void doRender(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
if (visible) { if (visible) {
isHovered = mouseX >= getX() && mouseY >= getY() && mouseX < getX() + width && mouseY < getY() + height; isHovered = mouseX >= getX() && mouseY >= getY() && mouseX < getX() + width && mouseY < getY() + height;

View File

@ -71,7 +71,7 @@ public class Label extends AbstractSimiWidget {
} }
@Override @Override
protected void renderButton(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { protected void doRender(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
if (text == null || text.getString().isEmpty()) if (text == null || text.getString().isEmpty())
return; return;

View File

@ -31,7 +31,7 @@ public class ChapterLabel extends AbstractSimiWidget {
graphics.drawString(Minecraft.getInstance().font, chapter.getTitle(), getX() + 50, graphics.drawString(Minecraft.getInstance().font, chapter.getTitle(), getX() + 50,
getY() + 20, Theme.i(Theme.Key.TEXT_ACCENT_SLIGHT), false); getY() + 20, Theme.i(Theme.Key.TEXT_ACCENT_SLIGHT), false);
button.renderButton(graphics, mouseX, mouseY, partialTicks); button.doRender(graphics, mouseX, mouseY, partialTicks);
super.render(graphics, mouseX, mouseY, partialTicks); super.render(graphics, mouseX, mouseY, partialTicks);
} }

View File

@ -88,8 +88,8 @@ public class PonderButton extends BoxWidget {
} }
@Override @Override
public void renderButton(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { public void doRender(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
super.renderButton(graphics, mouseX, mouseY, partialTicks); super.doRender(graphics, mouseX, mouseY, partialTicks);
float fadeValue = fade.getValue(); float fadeValue = fade.getValue();
if (fadeValue < .1f) if (fadeValue < .1f)

View File

@ -83,7 +83,7 @@ public class PonderProgressBar extends AbstractSimiWidget {
} }
@Override @Override
public void renderButton(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { public void doRender(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
PoseStack ms = graphics.pose(); PoseStack ms = graphics.pose();
isHovered = clicked(mouseX, mouseY); isHovered = clicked(mouseX, mouseY);