Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.util.CommonColors;
import net.minecraft.world.level.GameType;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -270,7 +271,7 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
if (disabled) {
s = ChatFormatting.STRIKETHROUGH + s;
}
graphics.drawString(font, s, x + 2, y + 2, selected && !disabled ? 16777215 : 8947848, false);
graphics.drawString(font, s, x + 2, y + 2, selected && !disabled ? CommonColors.WHITE : 0xFF888888, false);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.util.CommonColors;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -295,7 +296,7 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
if (selected && containsMouse) {
REIRuntime.getInstance().queueTooltip(Tooltip.create(Component.translatable("text.rei.time_button.tooltip.entry", text)));
}
graphics.drawString(font, text, x + 2, y + 2, selected ? 16777215 : 8947848, false);
graphics.drawString(font, text, x + 2, y + 2, selected ? CommonColors.WHITE : 0xFF888888, false);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.util.CommonColors;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -304,7 +305,7 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
if (selected && containsMouse) {
REIRuntime.getInstance().queueTooltip(Tooltip.create(Component.translatable("text.rei.weather_button.tooltip.entry", text)));
}
graphics.drawString(font, text, x + 2, y + 2, selected ? 16777215 : 8947848, false);
graphics.drawString(font, text, x + 2, y + 2, selected ? CommonColors.WHITE : 0xFF888888, false);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import net.minecraft.locale.Language;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.FormattedText;
import net.minecraft.util.CommonColors;
import org.jetbrains.annotations.Nullable;

import java.util.Collections;
Expand Down Expand Up @@ -74,7 +75,7 @@ public void init() {
public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
this.rulesList.render(graphics, mouseX, mouseY, delta);
super.render(graphics, mouseX, mouseY, delta);
graphics.drawString(this.font, this.title.getVisualOrderText(), (int) (this.width / 2.0F - this.font.width(this.title) / 2.0F), 12, -1);
graphics.drawString(this.font, this.title.getVisualOrderText(), (int) (this.width / 2.0F - this.font.width(this.title) / 2.0F), 12, CommonColors.WHITE);
}

public static class AddonsList extends UpdatedListWidget<AddonEntry> {
Expand Down Expand Up @@ -143,19 +144,19 @@ public void render(GuiGraphics graphics, int index, int y, int x, int entryWidth
int i = client.font.width(title);
if (i > entryWidth - 28) {
FormattedText titleTrimmed = FormattedText.composite(client.font.substrByWidth(title, entryWidth - 28 - client.font.width("...")), FormattedText.of("..."));
graphics.drawString(client.font, Language.getInstance().getVisualOrder(titleTrimmed), x + 2, y + 1, 16777215);
graphics.drawString(client.font, Language.getInstance().getVisualOrder(titleTrimmed), x + 2, y + 1, CommonColors.WHITE);
} else {
graphics.drawString(client.font, title.getVisualOrderText(), x + 2, y + 1, 16777215);
graphics.drawString(client.font, title.getVisualOrderText(), x + 2, y + 1, CommonColors.WHITE);
}
}
{
Component subtitle = addon.getDescription();
int i = client.font.width(subtitle);
if (i > entryWidth - 28) {
FormattedText subtitleTrimmed = FormattedText.composite(client.font.substrByWidth(subtitle, entryWidth - 28 - client.font.width("...")), FormattedText.of("..."));
graphics.drawString(client.font, Language.getInstance().getVisualOrder(subtitleTrimmed), x + 2, y + 12, 8421504);
graphics.drawString(client.font, Language.getInstance().getVisualOrder(subtitleTrimmed), x + 2, y + 12, CommonColors.GRAY);
} else {
graphics.drawString(client.font, subtitle.getVisualOrderText(), x + 2, y + 12, 8421504);
graphics.drawString(client.font, subtitle.getVisualOrderText(), x + 2, y + 12, CommonColors.GRAY);
}
}
configureButton.setX(x + entryWidth - 25);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.FormattedText;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.util.CommonColors;

import java.util.*;
import java.util.function.Supplier;
Expand Down Expand Up @@ -110,7 +111,7 @@ public void resetListEntries() {
public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
super.render(graphics, mouseX, mouseY, delta);
this.listWidget.render(graphics, mouseX, mouseY, delta);
graphics.drawString(this.font, this.title.getVisualOrderText(), (int) (this.width / 2.0F - this.font.width(this.title) / 2.0F), 12, -1);
graphics.drawString(this.font, this.title.getVisualOrderText(), (int) (this.width / 2.0F - this.font.width(this.title) / 2.0F), 12, CommonColors.WHITE);
}

@Override
Expand Down Expand Up @@ -249,16 +250,16 @@ public void render(GuiGraphics graphics, int index, int y, int x, int entryWidth
}

Minecraft client = Minecraft.getInstance();
configuration.getCategory().getIcon().render(graphics, new Rectangle(x + 2, y, 16, 16), mouseY, mouseY, delta);
configuration.getCategory().getIcon().render(graphics, new Rectangle(x + 2, y, 16, 16), mouseX, mouseY, delta);
int xPos = x + 22;
{
Component title = configuration.getCategory().getTitle();
int i = client.font.width(title);
if (i > entryWidth - 28) {
FormattedText titleTrimmed = FormattedText.composite(client.font.substrByWidth(title, entryWidth - 28 - client.font.width("...")), FormattedText.of("..."));
graphics.drawString(client.font, Language.getInstance().getVisualOrder(titleTrimmed), x + 2, y + 1, 16777215);
graphics.drawString(client.font, Language.getInstance().getVisualOrder(titleTrimmed), x + 2, y + 1, CommonColors.WHITE);
} else {
graphics.drawString(client.font, title.getVisualOrderText(), xPos, y + 1, 16777215);
graphics.drawString(client.font, title.getVisualOrderText(), xPos, y + 1, CommonColors.WHITE);
}
}
{
Expand All @@ -267,24 +268,24 @@ public void render(GuiGraphics graphics, int index, int y, int x, int entryWidth
int i = client.font.width(id);
if (i > entryWidth - 28) {
FormattedText idTrimmed = FormattedText.composite(client.font.substrByWidth(id, entryWidth - 28 - client.font.width("...")), FormattedText.of("..."));
graphics.drawString(client.font, Language.getInstance().getVisualOrder(idTrimmed), x + 2, y + 12, 8421504);
graphics.drawString(client.font, Language.getInstance().getVisualOrder(idTrimmed), x + 2, y + 12, CommonColors.GRAY);
} else {
graphics.drawString(client.font, id.getVisualOrderText(), xPos, y + 12, 8421504);
graphics.drawString(client.font, id.getVisualOrderText(), xPos, y + 12, CommonColors.GRAY);
}
}
boolean shown = !hiddenCategories.contains(configuration.getCategoryIdentifier());
{
Component subtitle = Component.translatable("config.roughlyenoughitems.configureCategories.visibility." + shown)
.withStyle(shown ? ChatFormatting.GREEN : ChatFormatting.RED);
graphics.drawString(client.font, subtitle, xPos, y + 22, 8421504);
graphics.drawString(client.font, subtitle, xPos, y + 22, CommonColors.GRAY);
int i = xPos + client.font.width(subtitle);
visibilityToggleButton.getPoint().setLocation(i + 3, y + 22);
visibilityToggleButton.render(graphics, mouseX, mouseY, delta);
}
if (shown) {
Component subtitle = Component.translatable("config.roughlyenoughitems.filtering.filteringQuickCraftCategories.configure." + filteringQuickCraftCategories.getOrDefault(configuration.getCategoryIdentifier(), configuration.isQuickCraftingEnabledByDefault()))
.withStyle(ChatFormatting.GRAY);
graphics.drawString(client.font, subtitle, xPos, y + 32, 8421504);
graphics.drawString(client.font, subtitle, xPos, y + 32, CommonColors.GRAY);
int i = xPos + client.font.width(subtitle);
quickCraftToggleButton.getPoint().setLocation(i + 3, y + 32);
quickCraftToggleButton.render(graphics, mouseX, mouseY, delta);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import net.minecraft.locale.Language;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.FormattedText;
import net.minecraft.util.CommonColors;

import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -76,7 +77,7 @@ public void init() {
public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
super.render(graphics, mouseX, mouseY, delta);
this.rulesList.render(graphics, mouseX, mouseY, delta);
graphics.drawString(this.font, this.title.getVisualOrderText(), (int) (this.width / 2.0F - this.font.width(this.title) / 2.0F), 12, -1);
graphics.drawString(this.font, this.title.getVisualOrderText(), (int) (this.width / 2.0F - this.font.width(this.title) / 2.0F), 12, CommonColors.WHITE);
}

@Override
Expand Down Expand Up @@ -152,19 +153,19 @@ public void render(GuiGraphics graphics, int index, int y, int x, int entryWidth
int i = client.font.width(title);
if (i > entryWidth - 28) {
FormattedText titleTrimmed = FormattedText.composite(client.font.substrByWidth(title, entryWidth - 28 - client.font.width("...")), FormattedText.of("..."));
graphics.drawString(client.font, Language.getInstance().getVisualOrder(titleTrimmed), x + 2, y + 1, 16777215);
graphics.drawString(client.font, Language.getInstance().getVisualOrder(titleTrimmed), x + 2, y + 1, CommonColors.WHITE);
} else {
graphics.drawString(client.font, title.getVisualOrderText(), x + 2, y + 1, 16777215);
graphics.drawString(client.font, title.getVisualOrderText(), x + 2, y + 1, CommonColors.WHITE);
}
}
{
Component subtitle = ((FilteringRuleType<FilteringRule<?>>) getRule().getType()).getSubtitle(getRule());
int i = client.font.width(subtitle);
if (i > entryWidth - 28) {
FormattedText subtitleTrimmed = FormattedText.composite(client.font.substrByWidth(subtitle, entryWidth - 28 - client.font.width("...")), FormattedText.of("..."));
graphics.drawString(client.font, Language.getInstance().getVisualOrder(subtitleTrimmed), x + 2, y + 12, 8421504);
graphics.drawString(client.font, Language.getInstance().getVisualOrder(subtitleTrimmed), x + 2, y + 12, CommonColors.GRAY);
} else {
graphics.drawString(client.font, subtitle.getVisualOrderText(), x + 2, y + 12, 8421504);
graphics.drawString(client.font, subtitle.getVisualOrderText(), x + 2, y + 12, CommonColors.GRAY);
}
}
addButton.setX(x + entryWidth - 25);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.FormattedText;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.util.CommonColors;

import java.util.*;
import java.util.function.Consumer;
Expand Down Expand Up @@ -107,7 +108,7 @@ public void init() {
public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
super.render(graphics, mouseX, mouseY, delta);
this.rulesList.render(graphics, mouseX, mouseY, delta);
graphics.drawString(this.font, this.title.getVisualOrderText(), (int) (this.width / 2.0F - this.font.width(this.title) / 2.0F), 12, -1);
graphics.drawString(this.font, this.title.getVisualOrderText(), (int) (this.width / 2.0F - this.font.width(this.title) / 2.0F), 12, CommonColors.WHITE);
}

@Override
Expand Down Expand Up @@ -213,19 +214,19 @@ public void render(GuiGraphics graphics, int index, int y, int x, int entryWidth
int i = client.font.width(title);
if (i > entryWidth - 28) {
FormattedText titleTrimmed = FormattedText.composite(client.font.substrByWidth(title, entryWidth - 28 - client.font.width("...")), FormattedText.of("..."));
graphics.drawString(client.font, Language.getInstance().getVisualOrder(titleTrimmed), x + 2, y + 1, 16777215);
graphics.drawString(client.font, Language.getInstance().getVisualOrder(titleTrimmed), x + 2, y + 1, CommonColors.WHITE);
} else {
graphics.drawString(client.font, title.getVisualOrderText(), x + 2, y + 1, 16777215);
graphics.drawString(client.font, title.getVisualOrderText(), x + 2, y + 1, CommonColors.WHITE);
}
}
{
Component subtitle = ((FilteringRuleType<FilteringRule<?>>) getRule().getType()).getSubtitle(getRule());
int i = client.font.width(subtitle);
if (i > entryWidth - 28) {
FormattedText subtitleTrimmed = FormattedText.composite(client.font.substrByWidth(subtitle, entryWidth - 28 - client.font.width("...")), FormattedText.of("..."));
graphics.drawString(client.font, Language.getInstance().getVisualOrder(subtitleTrimmed), x + 2, y + 12, 8421504);
graphics.drawString(client.font, Language.getInstance().getVisualOrder(subtitleTrimmed), x + 2, y + 12, CommonColors.GRAY);
} else {
graphics.drawString(client.font, subtitle.getVisualOrderText(), x + 2, y + 12, 8421504);
graphics.drawString(client.font, subtitle.getVisualOrderText(), x + 2, y + 12, CommonColors.GRAY);
}
}
configureButton.setX(x + entryWidth - 25);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import net.minecraft.util.CommonColors;
import net.minecraft.util.Mth;
import net.minecraft.world.item.Item;
import org.jetbrains.annotations.ApiStatus;
Expand Down Expand Up @@ -257,9 +258,9 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
((ScreenOverlayImpl) REIRuntime.getInstance().getOverlay().get()).renderTooltip(graphics, tooltip);
}

graphics.drawString(this.font, this.title.getVisualOrderText(), (int) (this.width / 2.0F - this.font.width(this.title) / 2.0F), 12, -1);
graphics.drawString(this.font, this.title.getVisualOrderText(), (int) (this.width / 2.0F - this.font.width(this.title) / 2.0F), 12, CommonColors.WHITE);
Component hint = Component.translatable("config.roughlyenoughitems.filteringRulesScreen.hint").withStyle(ChatFormatting.YELLOW);
graphics.drawString(this.font, hint, this.width - this.font.width(hint) - 15, 12, -1);
graphics.drawString(this.font, hint, this.width - this.font.width(hint) - 15, 12, CommonColors.WHITE);
}

private Predicate<Rectangle> getSelection() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import net.minecraft.client.resources.language.I18n;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.util.CommonColors;
import net.minecraft.util.Tuple;
import org.jetbrains.annotations.ApiStatus;

Expand Down Expand Up @@ -154,7 +155,7 @@ public boolean mouseScrolled(double mouseX, double mouseY, double amountX, doubl
@Override
public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
super.render(graphics, mouseX, mouseY, delta);
graphics.drawCenteredString(this.font, I18n.get("text.rei.credits"), this.width / 2, 16, 16777215);
graphics.drawCenteredString(this.font, I18n.get("text.rei.credits"), this.width / 2, 16, CommonColors.WHITE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.network.chat.Component;
import net.minecraft.util.CommonColors;
import org.jetbrains.annotations.ApiStatus;

import java.util.List;
Expand Down Expand Up @@ -109,7 +110,7 @@ public boolean mouseScrolled(double mouseX, double mouseY, double amountX, doubl
@Override
public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
super.render(graphics, mouseX, mouseY, delta);
graphics.drawCenteredString(this.font, getTitle(), this.width / 2, 16, 16777215);
graphics.drawCenteredString(this.font, getTitle(), this.width / 2, 16, CommonColors.WHITE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.CommonColors;
import net.minecraft.util.FormattedCharSequence;
import net.minecraft.util.Mth;
import org.jetbrains.annotations.ApiStatus;
Expand Down Expand Up @@ -128,7 +129,7 @@ public List<GuiEventListener> _children() {
@Override
public void render(GuiGraphics graphics, int int_1, int int_2, float float_1) {
super.render(graphics, int_1, int_2, float_1);
graphics.drawCenteredString(this.font, Component.translatable("text.rei.recipe_screen_type.selection"), this.width / 2, 20, 16777215);
graphics.drawCenteredString(this.font, Component.translatable("text.rei.recipe_screen_type.selection"), this.width / 2, 20, CommonColors.WHITE);
graphics.enableScissor(0, 20 + font.lineHeight + 2, width, 20 + font.lineHeight + 2 + height - 42);
if (showTips) {
int i = 32;
Expand Down
Loading