Added setting to disable lighting

This commit is contained in:
Anuken
2023-09-02 11:49:34 -04:00
parent bff4097c88
commit 2e1b4934ad
4 changed files with 6 additions and 3 deletions

View File

@@ -1112,6 +1112,7 @@ setting.position.name = Show Player Position
setting.mouseposition.name = Show Mouse Position setting.mouseposition.name = Show Mouse Position
setting.musicvol.name = Music Volume setting.musicvol.name = Music Volume
setting.atmosphere.name = Show Planet Atmosphere setting.atmosphere.name = Show Planet Atmosphere
setting.drawlight.name = Draw Darkness/Lighting
setting.ambientvol.name = Ambient Volume setting.ambientvol.name = Ambient Volume
setting.mutemusic.name = Mute Music setting.mutemusic.name = Mute Music
setting.sfxvol.name = SFX Volume setting.sfxvol.name = SFX Volume

View File

@@ -46,7 +46,7 @@ public class Renderer implements ApplicationListener{
public @Nullable Bloom bloom; public @Nullable Bloom bloom;
public @Nullable FrameBuffer backgroundBuffer; public @Nullable FrameBuffer backgroundBuffer;
public FrameBuffer effectBuffer = new FrameBuffer(); public FrameBuffer effectBuffer = new FrameBuffer();
public boolean animateShields, drawWeather = true, drawStatus, enableEffects, drawDisplays = true; public boolean animateShields, drawWeather = true, drawStatus, enableEffects, drawDisplays = true, drawLight = true;
public float weatherAlpha; public float weatherAlpha;
/** minZoom = zooming out, maxZoom = zooming in */ /** minZoom = zooming out, maxZoom = zooming in */
public float minZoom = 1.5f, maxZoom = 6f; public float minZoom = 1.5f, maxZoom = 6f;
@@ -180,6 +180,7 @@ public class Renderer implements ApplicationListener{
drawStatus = settings.getBool("blockstatus"); drawStatus = settings.getBool("blockstatus");
enableEffects = settings.getBool("effects"); enableEffects = settings.getBool("effects");
drawDisplays = !settings.getBool("hidedisplays"); drawDisplays = !settings.getBool("hidedisplays");
drawLight = settings.getBool("drawlight", true);
if(landTime > 0){ if(landTime > 0){
if(!state.isPaused()){ if(!state.isPaused()){
@@ -337,7 +338,7 @@ public class Renderer implements ApplicationListener{
} }
} }
if(state.rules.lighting){ if(state.rules.lighting && drawLight){
Draw.draw(Layer.light, lights::draw); Draw.draw(Layer.light, lights::draw);
} }

View File

@@ -182,7 +182,7 @@ public class LightRenderer{
} }
public boolean enabled(){ public boolean enabled(){
return state.rules.lighting && state.rules.ambientLight.a > 0.0001f; return state.rules.lighting && state.rules.ambientLight.a > 0.0001f && renderer.drawLight;
} }
public void draw(){ public void draw(){

View File

@@ -440,6 +440,7 @@ public class SettingsMenuDialog extends BaseDialog{
graphics.checkPref("effects", true); graphics.checkPref("effects", true);
graphics.checkPref("atmosphere", !mobile); graphics.checkPref("atmosphere", !mobile);
graphics.checkPref("drawlight", true);
graphics.checkPref("destroyedblocks", true); graphics.checkPref("destroyedblocks", true);
graphics.checkPref("blockstatus", false); graphics.checkPref("blockstatus", false);
graphics.checkPref("playerchat", true); graphics.checkPref("playerchat", true);