Skip to content

Commit dd638f0

Browse files
author
xCollateral
committed
Update to 1.20.3 + Video settings screen update
1 parent 4640831 commit dd638f0

File tree

4 files changed

+458
-274
lines changed

4 files changed

+458
-274
lines changed

src/main/java/net/vulkanmod/config/OptionList2.java

Lines changed: 0 additions & 259 deletions
This file was deleted.

src/main/java/net/vulkanmod/config/OptionScreenV.java

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
import java.util.Optional;
2626

2727
public class OptionScreenV extends Screen {
28-
private final List<OptionList2> optionLists;
29-
private Option<?>[] videoOpts;
30-
private Option<?>[] graphicsOpts;
31-
private Option<?>[] otherOpts;
28+
private final List<VOptionList> optionLists;
29+
private final Option<?>[] videoOpts;
30+
private final Option<?>[] graphicsOpts;
31+
private final Option<?>[] otherOpts;
3232
private final Screen parent;
33-
private OptionList2 currentList;
33+
private VOptionList currentList;
3434

3535
private CustomButtonWidget videoButton;
3636
private CustomButtonWidget graphicsButton;
@@ -62,16 +62,21 @@ protected void init() {
6262
int bottom = 32;
6363

6464
this.optionLists.clear();
65-
OptionList2 optionList = new OptionList2(this.minecraft, this.width, this.height, top, this.height - bottom, 25);
65+
VOptionList optionList = new VOptionList(this.minecraft, this.width, this.height, top, bottom, 25);
6666
optionList.addAll(this.videoOpts);
6767
this.optionLists.add(optionList);
68-
optionList = new OptionList2(this.minecraft, this.width, this.height, top, this.height - bottom, 25);
68+
optionList = new VOptionList(this.minecraft, this.width, this.height, top, bottom, 25);
6969
optionList.addAll(this.graphicsOpts);
7070
this.optionLists.add(optionList);
71-
optionList = new OptionList2(this.minecraft, this.width, this.height, top, this.height - bottom, 25);
71+
optionList = new VOptionList(this.minecraft, this.width, this.height, top, bottom, 25);
7272
optionList.addAll(this.otherOpts);
7373
this.optionLists.add(optionList);
7474

75+
// this.optionLists2.clear();
76+
// VOptionList optionList2 = new VOptionList(this.minecraft, this.width, this.height, top, bottom, 25);
77+
// optionList2.addAll(this.videoOpts);
78+
// this.optionLists2.add(optionList2);
79+
7580
this.videoButton = new CustomButtonWidget(20, 6, 60, 20, Component.literal("Video"), button -> this.setOptionList(button, optionLists.get(0)));
7681
this.graphicsButton = new CustomButtonWidget(81, 6, 60, 20, Component.literal("Graphics"), button -> this.setOptionList(button, optionLists.get(1)));
7782
this.otherButton = new CustomButtonWidget(142, 6, 60, 20, Component.literal("Other"), button -> this.setOptionList(button, optionLists.get(2)));
@@ -155,10 +160,12 @@ public void onClose() {
155160
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) {
156161
this.updateStatus();
157162

163+
this.renderBackground(guiGraphics, 0, 0, 0);
164+
158165
this.currentList.render(guiGraphics, mouseX, mouseY, delta);
159166
renderButtons(guiGraphics, mouseX, mouseY, delta);
160167

161-
List<FormattedCharSequence> list = getHoveredButtonTooltip(this.currentList, mouseX, mouseY);
168+
List<FormattedCharSequence> list = getHoveredButtonTooltip2(this.currentList, mouseX, mouseY);
162169
if (list != null) {
163170
guiGraphics.renderTooltip(this.minecraft.font, list, mouseX, mouseY);
164171
}
@@ -170,7 +177,7 @@ public void renderButtons(GuiGraphics guiGraphics, int mouseX, int mouseY, float
170177
}
171178
}
172179

173-
private List<FormattedCharSequence> getHoveredButtonTooltip(OptionList2 buttonList, int mouseX, int mouseY) {
180+
private List<FormattedCharSequence> getHoveredButtonTooltip2(VOptionList buttonList, int mouseX, int mouseY) {
174181
Optional<OptionWidget> optional = buttonList.getHoveredButton(mouseX, mouseY);
175182
if (optional.isPresent()) {
176183
if(optional.get().getTooltip() == null) return null;
@@ -195,7 +202,7 @@ public void updateStatus() {
195202
this.applyButton.active = modified;
196203
}
197204

198-
public void setOptionList(CustomButtonWidget button, OptionList2 optionList) {
205+
public void setOptionList(CustomButtonWidget button, VOptionList optionList) {
199206
this.currentList = optionList;
200207

201208
this.buildPage();

0 commit comments

Comments
 (0)