]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blobdiff - src/main/java/com/irtimaled/bbor/client/gui/SettingsScreen.java
Add "Fast Render" option to configure culling behaviors
[BoundingBoxOutlineReloaded.git] / src / main / java / com / irtimaled / bbor / client / gui / SettingsScreen.java
index 958194c71e63b24dae6b18fd5d7913a64055739f..a4b135ae57c7473c086773234b65d5f57ac543a6 100644 (file)
@@ -6,6 +6,7 @@ import com.irtimaled.bbor.client.interop.ClientInterop;
 import com.irtimaled.bbor.common.BoundingBoxType;
 import net.minecraft.SharedConstants;
 import net.minecraft.client.gui.screen.Screen;
+import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder;
 import net.minecraft.client.resource.language.I18n;
 
 public class SettingsScreen extends ListScreen {
@@ -31,11 +32,16 @@ public class SettingsScreen extends ListScreen {
     protected ControlList buildList(int top, int bottom) {
         String version = SharedConstants.getGameVersion().getName();
         ControlList controlList = new ControlList(this.width, this.height, top, bottom);
-        if (this.minecraft.world != null) controlList.setTransparentBackground();
+        if (this.client.world != null) controlList.setTransparentBackground();
 
         controlList
                 .section(null,
-                        width -> new BoolButton(width, I18n.translate("bbor.options.active"), this.minecraft.world != null) {
+                        width -> new BoolButton(width, I18n.translate("bbor.options.active"), this.client.world != null) {
+                            @Override
+                            public void appendNarrations(NarrationMessageBuilder narrationMessageBuilder) {
+                                this.appendDefaultNarrations(narrationMessageBuilder);
+                            }
+
                             @Override
                             public void onPressed() {
                                 ClientRenderer.toggleActive();
@@ -47,7 +53,11 @@ public class SettingsScreen extends ListScreen {
                             }
                         },
                         width -> new BoolSettingButton(width, I18n.translate("bbor.options.outerBoxOnly"), ConfigManager.outerBoxesOnly),
-                        width -> new BoolSettingButton(width, I18n.translate("bbor.options.fill"), ConfigManager.fill))
+                        width -> new BoolSettingButton(width, I18n.translate("bbor.options.fill"), ConfigManager.fill),
+                        width -> new IntSettingSlider(width, 0, 2, "bbor.options.fastRender", ConfigManager.fastRender)
+                                .addDisplayValue(0, I18n.translate("bbor.options.fastRender.0"))
+                                .addDisplayValue(1, I18n.translate("bbor.options.fastRender.1"))
+                                .addDisplayValue(2, I18n.translate("bbor.options.fastRender.2")))
                 .section(I18n.translate("bbor.features.spawnChunks"),
                         width -> new BoundingBoxTypeButton(width, I18n.translate("bbor.features.spawnChunks"), BoundingBoxType.WorldSpawn),
                         width -> new BoundingBoxTypeButton(width, I18n.translate("bbor.features.lazyChunks"), BoundingBoxType.LazySpawnChunks),