diff options
Diffstat (limited to 'src')
33 files changed, 209 insertions, 195 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/RecipeCategory.java b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java index a20c505e2..3ddbf84cb 100644 --- a/src/main/java/me/shedaniel/rei/api/RecipeCategory.java +++ b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java @@ -28,8 +28,8 @@ public interface RecipeCategory<T extends RecipeDisplay> { default void drawCategoryBackground(Rectangle bounds, int mouseX, int mouseY, float delta) { new RecipeBaseWidget(bounds).render(); - DrawableHelper.drawRect(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, RecipeViewingScreen.SUB_COLOR.getRGB()); - DrawableHelper.drawRect(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, RecipeViewingScreen.SUB_COLOR.getRGB()); + DrawableHelper.fill(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, RecipeViewingScreen.SUB_COLOR.getRGB()); + DrawableHelper.fill(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, RecipeViewingScreen.SUB_COLOR.getRGB()); } default DisplaySettings getDisplaySettings() { diff --git a/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java b/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java index 038af95e6..ecbd9c481 100644 --- a/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java +++ b/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java @@ -77,7 +77,7 @@ public class ContainerScreenOverlay extends ScreenComponent { } @Override - public void onFocusChanged(boolean boolean_1) { + public void onFocusChanged(boolean boolean_1, boolean boolean_2) { } }); widgets.add(buttonRight = new ButtonWidget(rectangle.x + rectangle.width - 18, rectangle.y + 5, 16, 16, new TranslatableTextComponent("text.rei.right_arrow")) { @@ -95,7 +95,7 @@ public class ContainerScreenOverlay extends ScreenComponent { } @Override - public void onFocusChanged(boolean boolean_1) { + public void onFocusChanged(boolean boolean_1, boolean boolean_2) { } }); if (setPage) @@ -103,7 +103,7 @@ public class ContainerScreenOverlay extends ScreenComponent { widgets.add(new ButtonWidget(RoughlyEnoughItemsCore.getConfigManager().getConfig().mirrorItemPanel ? window.getScaledWidth() - 30 : 10, 10, 20, 20, "") { @Override public void onPressed() { - if (Screen.isShiftPressed()) { + if (Screen.hasShiftDown()) { ClientHelper.setCheating(!ClientHelper.isCheating()); return; } @@ -115,10 +115,10 @@ public class ContainerScreenOverlay extends ScreenComponent { super.render(mouseX, mouseY, partialTicks); GuiLighting.disable(); if (ClientHelper.isCheating()) - drawRect(getBounds().x, getBounds().y, getBounds().x + 20, getBounds().y + 20, new Color(255, 0, 0, 42).getRGB()); + fill(getBounds().x, getBounds().y, getBounds().x + 20, getBounds().y + 20, new Color(255, 0, 0, 42).getRGB()); MinecraftClient.getInstance().getTextureManager().bindTexture(CHEST_GUI_TEXTURE); GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); - drawTexturedRect(getBounds().x + 3, getBounds().y + 3, 0, 0, 14, 14); + blit(getBounds().x + 3, getBounds().y + 3, 0, 0, 14, 14); } @Override @@ -133,7 +133,7 @@ public class ContainerScreenOverlay extends ScreenComponent { } @Override - public void onFocusChanged(boolean boolean_1) { + public void onFocusChanged(boolean boolean_1, boolean boolean_2) { } }); if (RoughlyEnoughItemsCore.getConfigManager().getConfig().showUtilsButtons) { @@ -155,7 +155,7 @@ public class ContainerScreenOverlay extends ScreenComponent { } @Override - public void onFocusChanged(boolean boolean_1) { + public void onFocusChanged(boolean boolean_1, boolean boolean_2) { } }); widgets.add(new ButtonWidget(RoughlyEnoughItemsCore.getConfigManager().getConfig().mirrorItemPanel ? window.getScaledWidth() - 80 : 60, 10, 20, 20, "") { @@ -170,7 +170,7 @@ public class ContainerScreenOverlay extends ScreenComponent { GuiLighting.disable(); MinecraftClient.getInstance().getTextureManager().bindTexture(CHEST_GUI_TEXTURE); GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); - drawTexturedRect(getBounds().x + 3, getBounds().y + 3, getCurrentWeather().getId() * 14, 14, 14, 14); + blit(getBounds().x + 3, getBounds().y + 3, getCurrentWeather().getId() * 14, 14, 14, 14); } @Override @@ -179,7 +179,7 @@ public class ContainerScreenOverlay extends ScreenComponent { } @Override - public void onFocusChanged(boolean boolean_1) { + public void onFocusChanged(boolean boolean_1, boolean boolean_2) { } }); } @@ -203,7 +203,7 @@ public class ContainerScreenOverlay extends ScreenComponent { } @Override - public void onFocusChanged(boolean boolean_1) { + public void onFocusChanged(boolean boolean_1, boolean boolean_2) { } }); if (ScreenHelper.searchField == null) @@ -327,7 +327,7 @@ public class ContainerScreenOverlay extends ScreenComponent { if (!(currentScreen instanceof RecipeViewingScreen) || !((RecipeViewingScreen) currentScreen).choosePageActivated) QUEUED_TOOLTIPS.stream().filter(queuedTooltip -> queuedTooltip != null).forEach(queuedTooltip -> { GlStateManager.translatef(0, 0, 600); - MinecraftClient.getInstance().currentScreen.drawTooltip(queuedTooltip.getText(), queuedTooltip.getLocation().x, queuedTooltip.getLocation().y); + MinecraftClient.getInstance().currentScreen.renderTooltip(queuedTooltip.getText(), queuedTooltip.getLocation().x, queuedTooltip.getLocation().y); GlStateManager.translatef(0, 0, -600); }); QUEUED_TOOLTIPS.clear(); @@ -442,14 +442,14 @@ public class ContainerScreenOverlay extends ScreenComponent { public boolean charTyped(char char_1, int int_1) { if (!ScreenHelper.isOverlayVisible()) return false; - for(InputListener listener : getInputListeners()) + for(InputListener listener : children()) if (listener.charTyped(char_1, int_1)) return true; return super.charTyped(char_1, int_1); } @Override - public List<? extends InputListener> getInputListeners() { + public List<? extends InputListener> children() { return widgets; } diff --git a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java index 46271d5eb..876e6391e 100644 --- a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java @@ -78,19 +78,18 @@ public class RecipeViewingScreen extends Screen { public boolean keyPressed(int int_1, int int_2, int int_3) { if (int_1 == 256 && choosePageActivated) { choosePageActivated = false; - onInitialized(); + init(); return true; } - if ((int_1 == 256 || this.client.options.keyInventory.matchesKey(int_1, int_2)) && this.doesEscapeKeyClose()) { + if ((int_1 == 256 || this.minecraft.options.keyInventory.matchesKey(int_1, int_2)) && this.shouldCloseOnEsc()) { MinecraftClient.getInstance().openScreen(ScreenHelper.getLastContainerScreen()); ScreenHelper.getLastOverlay().onInitialized(); return true; } if (int_1 == 258) { - if (isShiftPressed()) - this.focusPrevious(); - else - this.focusNext(); + boolean boolean_1 = !hasShiftDown(); + if (!this.method_20087(boolean_1)) + this.method_20087(boolean_1); return true; } if (choosePageActivated) { @@ -98,6 +97,9 @@ public class RecipeViewingScreen extends Screen { return true; return false; } + for(Widget widget : widgets) + if (widget.keyPressed(int_1, int_2, int_3)) + return true; return super.keyPressed(int_1, int_2, int_3); } @@ -107,9 +109,9 @@ public class RecipeViewingScreen extends Screen { } @Override - public void onInitialized() { - super.onInitialized(); - this.listeners.clear(); + public void init() { + super.init(); + this.children.clear(); this.tabs.clear(); this.widgets.clear(); this.largestWidth = window.getScaledWidth() - 100; @@ -129,7 +131,7 @@ public class RecipeViewingScreen extends Screen { selectedCategory = categories.get(currentCategoryIndex); categoryPages = MathHelper.floor(currentCategoryIndex / 6d); page = 0; - RecipeViewingScreen.this.onInitialized(); + RecipeViewingScreen.this.init(); } @Override @@ -164,7 +166,7 @@ public class RecipeViewingScreen extends Screen { selectedCategory = categories.get(currentCategoryIndex); categoryPages = MathHelper.floor(currentCategoryIndex / 6d); page = 0; - RecipeViewingScreen.this.onInitialized(); + RecipeViewingScreen.this.init(); } @Override @@ -181,7 +183,7 @@ public class RecipeViewingScreen extends Screen { page--; if (page < 0) page = getTotalPages(selectedCategory) - 1; - RecipeViewingScreen.this.onInitialized(); + RecipeViewingScreen.this.init(); } @Override @@ -204,7 +206,7 @@ public class RecipeViewingScreen extends Screen { public void onLabelClicked() { MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F)); RecipeViewingScreen.this.choosePageActivated = true; - RecipeViewingScreen.this.onInitialized(); + RecipeViewingScreen.this.init(); } }); widgets.add(recipeNext = new ButtonWidget((int) bounds.getMaxX() - 17, (int) bounds.getY() + 21, 12, 12, new TranslatableTextComponent("text.rei.right_arrow")) { @@ -213,7 +215,7 @@ public class RecipeViewingScreen extends Screen { page++; if (page >= getTotalPages(selectedCategory)) page = 0; - RecipeViewingScreen.this.onInitialized(); + RecipeViewingScreen.this.init(); } @Override @@ -238,7 +240,7 @@ public class RecipeViewingScreen extends Screen { return false; selectedCategory = categories.get(getId() + categoryPages * 6); page = 0; - RecipeViewingScreen.this.onInitialized(); + RecipeViewingScreen.this.init(); return true; } return false; @@ -265,9 +267,9 @@ public class RecipeViewingScreen extends Screen { else recipeChoosePageWidget = null; - listeners.addAll(tabs); - listeners.add(ScreenHelper.getLastOverlay(true, false)); - listeners.addAll(widgets); + children.addAll(tabs); + children.add(ScreenHelper.getLastOverlay(true, false)); + children.addAll(widgets); } public List<Widget> getWidgets() { @@ -309,13 +311,13 @@ public class RecipeViewingScreen extends Screen { @Override public void render(int mouseX, int mouseY, float delta) { - this.drawGradientRect(0, 0, this.screenWidth, this.screenHeight, -1072689136, -804253680); + this.fillGradient(0, 0, this.width, this.height, -1072689136, -804253680); if (selectedCategory != null) selectedCategory.drawCategoryBackground(bounds, mouseX, mouseY, delta); else { new RecipeBaseWidget(bounds).render(); - drawRect(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, SUB_COLOR.getRGB()); - drawRect(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, SUB_COLOR.getRGB()); + fill(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, SUB_COLOR.getRGB()); + fill(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, SUB_COLOR.getRGB()); } tabs.stream().filter(tabWidget -> { return !tabWidget.isSelected(); @@ -331,9 +333,9 @@ public class RecipeViewingScreen extends Screen { tabs.stream().filter(TabWidget::isSelected).forEach(tabWidget -> tabWidget.render(mouseX, mouseY, delta)); ScreenHelper.getLastOverlay().drawOverlay(mouseX, mouseY, delta); if (choosePageActivated) { - zOffset = 500.0f; - this.drawGradientRect(0, 0, this.screenWidth, this.screenHeight, -1072689136, -804253680); - zOffset = 0.0f; + blitOffset = 500.0f; + this.fillGradient(0, 0, this.width, this.height, -1072689136, -804253680); + blitOffset = 0.0f; recipeChoosePageWidget.render(mouseX, mouseY, delta); } } @@ -353,7 +355,7 @@ public class RecipeViewingScreen extends Screen { return true; return false; } - for(InputListener listener : listeners) + for(InputListener listener : children()) if (listener.charTyped(char_1, int_1)) return true; return super.charTyped(char_1, int_1); @@ -381,7 +383,7 @@ public class RecipeViewingScreen extends Screen { @Override public boolean mouseScrolled(double i, double j, double amount) { - for(InputListener listener : listeners) + for(InputListener listener : children()) if (listener.mouseScrolled(i, j, amount)) return true; if (getBounds().contains(ClientUtils.getMouseLocation())) { @@ -408,14 +410,14 @@ public class RecipeViewingScreen extends Screen { return false; } else { choosePageActivated = false; - onInitialized(); + init(); return false; } - for(InputListener entry : getInputListeners()) + for(InputListener entry : children()) if (entry.mouseClicked(double_1, double_2, int_1)) { - focusOn(entry); + method_20084(entry); if (int_1 == 0) - setActive(true); + setDragging(true); return true; } return false; diff --git a/src/main/java/me/shedaniel/rei/gui/config/ItemListOrderingEntry.java b/src/main/java/me/shedaniel/rei/gui/config/ItemListOrderingEntry.java index 251320abc..11b6a344d 100644 --- a/src/main/java/me/shedaniel/rei/gui/config/ItemListOrderingEntry.java +++ b/src/main/java/me/shedaniel/rei/gui/config/ItemListOrderingEntry.java @@ -2,7 +2,6 @@ package me.shedaniel.rei.gui.config; import com.google.common.collect.Lists; import javafx.util.Pair; -import me.shedaniel.cloth.api.ClientUtils; import me.shedaniel.cloth.gui.ClothConfigScreen.ListEntry; import me.shedaniel.cloth.gui.ClothConfigScreen.ListWidget; import me.shedaniel.rei.RoughlyEnoughItemsCore; @@ -13,7 +12,6 @@ import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.resource.language.I18n; import net.minecraft.client.util.Window; -import java.awt.*; import java.util.Arrays; import java.util.List; import java.util.Optional; @@ -36,11 +34,11 @@ public class ItemListOrderingEntry extends ListEntry { currentAscending = !currentAscending; } ItemListOrderingEntry.this.value.set(new Pair<>(ItemListOrdering.values()[index], currentAscending)); - ((ListWidget) ItemListOrderingEntry.this.getParent()).getScreen().setEdited(true); + ((ListWidget) ItemListOrderingEntry.this.parent).getScreen().setEdited(true); }); this.resetButton = new ButtonWidget(0, 0, MinecraftClient.getInstance().textRenderer.getStringWidth(I18n.translate("text.cloth.reset_value")) + 6, 20, I18n.translate("text.cloth.reset_value"), (widget) -> { this.value.set((Pair) getDefaultValue().get()); - ((ListWidget) this.getParent()).getScreen().setEdited(true); + ((ListWidget) this.parent).getScreen().setEdited(true); }); this.widgets = Lists.newArrayList(this.buttonWidget, this.resetButton); } @@ -54,26 +52,26 @@ public class ItemListOrderingEntry extends ListEntry { return Optional.of(new Pair<>(ItemListOrdering.registry, true)); } - public void draw(int entryWidth, int height, int i3, int i4, boolean isSelected, float delta) { + @Override + public void draw(int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isSelected, float delta) { Window window = MinecraftClient.getInstance().window; - Point mouse = ClientUtils.getMouseLocation(); this.resetButton.active = this.getDefaultValue().isPresent() && (((Pair<ItemListOrdering, Boolean>) this.getDefaultValue().get()).getKey() != this.value.get().getKey() || ((Pair<ItemListOrdering, Boolean>) this.getDefaultValue().get()).getValue().booleanValue() != this.value.get().getValue().booleanValue()); - this.resetButton.y = this.getY(); - this.buttonWidget.y = this.getY(); + this.resetButton.y = y; + this.buttonWidget.y = y; this.buttonWidget.setMessage(I18n.translate("text.rei.config.list_ordering_button", I18n.translate(value.get().getKey().getNameTranslationKey()), I18n.translate(value.get().getValue() ? "ordering.rei.ascending" : "ordering.rei.descending"))); if (MinecraftClient.getInstance().textRenderer.isRightToLeft()) { - MinecraftClient.getInstance().textRenderer.drawWithShadow(I18n.translate(this.getFieldName(), new Object[0]), (float) (window.getScaledWidth() - this.getX() - MinecraftClient.getInstance().textRenderer.getStringWidth(I18n.translate(this.getFieldName(), new Object[0]))), (float) (this.getY() + 5), 16777215); - this.resetButton.x = this.getX(); - this.buttonWidget.x = this.getX() + this.resetButton.getWidth() + 2; + MinecraftClient.getInstance().textRenderer.drawWithShadow(I18n.translate(this.getFieldName(), new Object[0]), (float) (window.getScaledWidth() - x - MinecraftClient.getInstance().textRenderer.getStringWidth(I18n.translate(this.getFieldName(), new Object[0]))), (float) (y + 5), 16777215); + this.resetButton.x = x; + this.buttonWidget.x = x + this.resetButton.getWidth() + 2; this.buttonWidget.setWidth(150 - this.resetButton.getWidth() - 2); } else { - MinecraftClient.getInstance().textRenderer.drawWithShadow(I18n.translate(this.getFieldName(), new Object[0]), (float) this.getX(), (float) (this.getY() + 5), 16777215); - this.resetButton.x = window.getScaledWidth() - this.getX() - this.resetButton.getWidth(); - this.buttonWidget.x = window.getScaledWidth() - this.getX() - 150; + MinecraftClient.getInstance().textRenderer.drawWithShadow(I18n.translate(this.getFieldName(), new Object[0]), (float) x, (float) (y + 5), 16777215); + this.resetButton.x = window.getScaledWidth() - x - this.resetButton.getWidth(); + this.buttonWidget.x = window.getScaledWidth() - x - 150; this.buttonWidget.setWidth(150 - this.resetButton.getWidth() - 2); } - this.buttonWidget.render(mouse.x, mouse.y, delta); - this.resetButton.render(mouse.x, mouse.y, delta); + this.buttonWidget.render(mouseX, mouseY, delta); + this.resetButton.render(mouseX, mouseY, delta); } public String getYesNoText(boolean bool) { @@ -81,15 +79,15 @@ public class ItemListOrderingEntry extends ListEntry { } @Override - public List<? extends InputListener> getInputListeners() { + public List<? extends InputListener> children() { return widgets; } - public boolean isActive() { + public boolean isDragging() { return this.buttonWidget.isHovered() || this.resetButton.isHovered(); } - public void setActive(boolean b) { + public void setDragging(boolean b) { } public InputListener getFocused() { diff --git a/src/main/java/me/shedaniel/rei/gui/credits/CreditsEntry.java b/src/main/java/me/shedaniel/rei/gui/credits/CreditsEntry.java index 2ff11e701..63ec352a5 100644 --- a/src/main/java/me/shedaniel/rei/gui/credits/CreditsEntry.java +++ b/src/main/java/me/shedaniel/rei/gui/credits/CreditsEntry.java @@ -13,9 +13,7 @@ public class CreditsEntry extends EntryListWidget.Entry<CreditsEntry> { } @Override - public void draw(int entryWidth, int height, int i3, int i4, boolean isSelected, float delta) { - int x = getX(); - int y = getY(); + public void draw(int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isSelected, float delta) { MinecraftClient.getInstance().textRenderer.drawWithShadow(textComponent.getFormattedText(), x + 5, y + 5, -1); } diff --git a/src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java b/src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java index a1aaf8ce7..4deac886b 100644 --- a/src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java @@ -7,7 +7,7 @@ public class CreditsEntryListWidget extends EntryListWidget<CreditsEntry> { public CreditsEntryListWidget(MinecraftClient client, int width, int height, int startY, int endY, int entryHeight) { super(client, width, height, startY, endY, entryHeight); - setRenderSelection(false); //toggleShowSelection + field_19091 = false; // showSelection } public void creditsClearEntries() { @@ -15,7 +15,7 @@ public class CreditsEntryListWidget extends EntryListWidget<CreditsEntry> { } private CreditsEntry getEntry(int int_1) { - return this.getInputListeners().get(int_1); + return this.children().get(int_1); } public void creditsAddEntry(CreditsEntry entry) { @@ -23,13 +23,15 @@ public class CreditsEntryListWidget extends EntryListWidget<CreditsEntry> { } @Override - public int getEntryWidth() { - return width - 80; + // getRowWidth + public int method_20053() { + return field_19083 - 80; // width } @Override - protected int getScrollbarPosition() { - return width - 40; + // getScrollbarPosition + protected int method_20078() { + return field_19083 - 40; // width } } diff --git a/src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java b/src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java index 34b8827dc..c8da3f5a2 100644 --- a/src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java @@ -20,8 +20,8 @@ public class CreditsScreen extends Screen { @Override public boolean keyPressed(int int_1, int int_2, int int_3) { - if (int_1 == 256 && this.doesEscapeKeyClose()) { - this.client.openScreen(parent); + if (int_1 == 256 && this.shouldCloseOnEsc()) { + this.minecraft.openScreen(parent); if (parent instanceof ContainerScreen) ScreenHelper.getLastOverlay().onInitialized(); return true; @@ -30,16 +30,16 @@ public class CreditsScreen extends Screen { } @Override - protected void onInitialized() { - listeners.add(entryListWidget = new CreditsEntryListWidget(client, screenWidth, screenHeight, 32, screenHeight - 32, 12)); + protected void init() { + children.add(entryListWidget = new CreditsEntryListWidget(minecraft, width, height, 32, height - 32, 12)); entryListWidget.creditsClearEntries(); for(String line : I18n.translate("text.rei.credit.text").split("\n")) entryListWidget.creditsAddEntry(new CreditsEntry(new StringTextComponent(line))); entryListWidget.creditsAddEntry(new CreditsEntry(new StringTextComponent(""))); - listeners.add(buttonDone = new ButtonWidget(screenWidth / 2 - 100, screenHeight - 26, 200, 20, I18n.translate("gui.done")) { + children.add(buttonDone = new ButtonWidget(width / 2 - 100, height - 26, 200, 20, I18n.translate("gui.done")) { @Override public void onPressed() { - CreditsScreen.this.client.openScreen(parent); + CreditsScreen.this.minecraft.openScreen(parent); ScreenHelper.getLastOverlay().onInitialized(); } }); @@ -54,9 +54,9 @@ public class CreditsScreen extends Screen { @Override public void render(int int_1, int int_2, float float_1) { - this.drawTextureBackground(0); + this.renderDirtBackground(0); this.entryListWidget.render(int_1, int_2, float_1); - this.drawStringCentered(this.fontRenderer, I18n.translate("text.rei.credits"), this.screenWidth / 2, 16, 16777215); + this.drawCenteredString(this.font, I18n.translate("text.rei.credits"), this.width / 2, 16, 16777215); super.render(int_1, int_2, float_1); } diff --git a/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java index 16c669f50..b16e38187 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java @@ -71,18 +71,18 @@ public abstract class ButtonWidget extends HighlightableWidget { GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); //Four Corners - this.drawTexturedRect(x, y, 0, 46 + textureOffset * 20, 4, 4); - this.drawTexturedRect(x + width - 4, y, 196, 46 + textureOffset * 20, 4, 4); - this.drawTexturedRect(x, y + height - 4, 0, 62 + textureOffset * 20, 4, 4); - this.drawTexturedRect(x + width - 4, y + height - 4, 196, 62 + textureOffset * 20, 4, 4); + this.blit(x, y, 0, 46 + textureOffset * 20, 4, 4); + this.blit(x + width - 4, y, 196, 46 + textureOffset * 20, 4, 4); + this.blit(x, y + height - 4, 0, 62 + textureOffset * 20, 4, 4); + this.blit(x + width - 4, y + height - 4, 196, 62 + textureOffset * 20, 4, 4); //Sides - this.drawTexturedRect(x + 4, y, 4, 46 + textureOffset * 20, width - 8, 4); - this.drawTexturedRect(x + 4, y + height - 4, 4, 62 + textureOffset * 20, width - 8, 4); + this.blit(x + 4, y, 4, 46 + textureOffset * 20, width - 8, 4); + |
