mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-14 14:34:16 +01:00
rename to doRender
This commit is contained in:
parent
6ef310a5c2
commit
486b2f6cca
@ -40,7 +40,7 @@ public abstract class AbstractSimiWidget extends AbstractWidget implements Ticka
|
|||||||
protected AbstractSimiWidget(int x, int y, int width, int height, Component message) {
|
protected AbstractSimiWidget(int x, int y, int width, int height, Component message) {
|
||||||
super(x, y, width, height, message);
|
super(x, y, width, height, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ClientTooltipPositioner createTooltipPositioner() {
|
protected ClientTooltipPositioner createTooltipPositioner() {
|
||||||
return DefaultTooltipPositioner.INSTANCE;
|
return DefaultTooltipPositioner.INSTANCE;
|
||||||
@ -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) {
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
@ -148,7 +148,7 @@ public class BoxWidget extends ElementWidget {
|
|||||||
|
|
||||||
return getX() - padX <= mX && getY() - padY <= mY && mX < getX() + padX + width && mY < getY() + padY + height;
|
return getX() - padX <= mX && getY() - padY <= mY && mX < getX() + padX + width && mY < getY() + padY + height;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean clicked(double pMouseX, double pMouseY) {
|
protected boolean clicked(double pMouseX, double pMouseY) {
|
||||||
if (!active || !visible)
|
if (!active || !visible)
|
||||||
|
@ -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);
|
||||||
|
@ -14,14 +14,14 @@ public class IconButton extends AbstractSimiWidget {
|
|||||||
public IconButton(int x, int y, ScreenElement icon) {
|
public IconButton(int x, int y, ScreenElement icon) {
|
||||||
this(x, y, 18, 18, icon);
|
this(x, y, 18, 18, icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IconButton(int x, int y, int w, int h, ScreenElement icon) {
|
public IconButton(int x, int y, int w, int h, ScreenElement icon) {
|
||||||
super(x, y, w, h);
|
super(x, y, w, h);
|
||||||
this.icon = icon;
|
this.icon = icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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)
|
||||||
|
@ -83,9 +83,9 @@ 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);
|
||||||
|
|
||||||
new BoxElement()
|
new BoxElement()
|
||||||
|
Loading…
Reference in New Issue
Block a user