|
4 | 4 | import com.terraformersmc.modmenu.config.ModMenuConfig; |
5 | 5 | import com.terraformersmc.modmenu.config.ModMenuConfigManager; |
6 | 6 | import net.minecraft.client.MinecraftClient; |
7 | | -import net.minecraft.client.gui.DrawContext; |
8 | 7 | import net.minecraft.client.gui.screen.Screen; |
9 | 8 | import net.minecraft.client.gui.screen.option.GameOptionsScreen; |
10 | | -import net.minecraft.client.gui.widget.OptionListWidget; |
11 | 9 | import net.minecraft.text.Text; |
12 | 10 |
|
13 | 11 | public class ModMenuOptionsScreen extends GameOptionsScreen { |
14 | 12 |
|
15 | | - private OptionListWidget list; |
16 | | - |
17 | 13 | public ModMenuOptionsScreen(Screen previous) { |
18 | 14 | super(previous, MinecraftClient.getInstance().options, Text.translatable("modmenu.options")); |
19 | 15 | } |
20 | 16 |
|
21 | | - |
22 | | - @Override |
23 | | - protected void init() { |
24 | | - this.list = this.addDrawableChild(new OptionListWidget(this.client, this.width, this)); |
25 | | - this.list.addAll(ModMenuConfig.asOptions()); |
26 | | - super.init(); |
27 | | - } |
28 | | - |
29 | 17 | @Override |
30 | 18 | protected void addOptions() { |
31 | | - // NO-OP |
32 | | - } |
33 | | - |
34 | | - @Override |
35 | | - protected void initTabNavigation() { |
36 | | - super.initTabNavigation(); |
37 | | - this.list.position(this.width, this.layout); |
38 | | - } |
39 | | - |
40 | | - @Override |
41 | | - public void render(DrawContext DrawContext, int mouseX, int mouseY, float delta) { |
42 | | - super.render(DrawContext, mouseX, mouseY, delta); |
43 | | - this.list.render(DrawContext, mouseX, mouseY, delta); |
| 19 | + if (this.body != null) { |
| 20 | + this.body.addAll(ModMenuConfig.asOptions()); |
| 21 | + } |
44 | 22 | } |
45 | 23 |
|
46 | 24 | @Override |
|
0 commit comments