Skip to content

Commit f449fcb

Browse files
committed
Fix option screen rendering
1 parent a24037a commit f449fcb

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/main/java/org/embeddedt/modernfix/screen/ModernFixConfigScreen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void onClose() {
4444
public void extractRenderState(GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTicks) {
4545
super.extractRenderState(guiGraphics, mouseX, mouseY, partialTicks);
4646
this.optionList.extractRenderState(guiGraphics, mouseX, mouseY, partialTicks);
47-
guiGraphics.centeredText(this.font, this.title, this.width / 2, 8, 16777215);
47+
guiGraphics.centeredText(this.font, this.title, this.width / 2, 8, -1);
4848
this.doneButton.setMessage(madeChanges ? Component.translatable("modernfix.config.done_restart") : CommonComponents.GUI_DONE);
4949
}
5050

src/main/java/org/embeddedt/modernfix/screen/OptionList.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ public CategoryEntry(Component component) {
108108
public void extractContent(GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, boolean isMouseOver, float partialTicks) {
109109
Font var10000 = OptionList.this.minecraft.font;
110110
float x = (float)(OptionList.this.minecraft.screen.width / 2 - this.width / 2);
111-
int y = 0 + height - 10;
112-
guiGraphics.text(var10000, this.name, (int)x, y, 16777215);
111+
int y = getY() + getHeight() - 10;
112+
guiGraphics.text(var10000, this.name, (int)x, y, -1);
113113
/*
114114
if(mouseX >= x && mouseY >= y && mouseX <= (x + this.width) && mouseY <= (y + OptionList.this.minecraft.font.lineHeight))
115115
OptionList.this.mainScreen.renderComponentHoverEffect(matrixStack, this.name.getStyle(), mouseX, mouseY);
@@ -179,13 +179,13 @@ void updateStatus() {
179179

180180
@Override
181181
public void extractContent(GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, boolean isHovering, float partialTicks) {
182-
int left = 0, top = 0;
182+
int left = getX(), top = getY();
183183
MutableComponent nameComponent = getOptionComponent(option);
184184
if(this.option.isUserDefined())
185185
nameComponent = nameComponent.withStyle(style -> style.withItalic(true)).append(Component.translatable("modernfix.config.not_default"));
186186
float textX = (float)(left + DEPTH_OFFSET * option.getDepth() + 160 - OptionList.this.maxNameWidth);
187-
float textY = (float)(top + height / 2 - 4);
188-
guiGraphics.text(OptionList.this.minecraft.font, nameComponent, (int)textX, (int)textY, 16777215);
187+
float textY = (float)(top + getHeight() / 2 - 4);
188+
guiGraphics.text(OptionList.this.minecraft.font, nameComponent, (int)textX, (int)textY, -1);
189189
this.toggleButton.setPosition(left + 175, top);
190190
this.toggleButton.setMessage(getOptionMessage(this.option));
191191
this.toggleButton.extractRenderState(guiGraphics, mouseX, mouseY, partialTicks);

0 commit comments

Comments
 (0)