Allow configuration of minimum and maximum camera distance in main game screen (#7603)

* Variable min and max zoom

* Variable min and max zoom

* Variable min and max zoom

---------

Co-authored-by: ivan <ikamyshan@evolution.com>
Co-authored-by: Anuken <arnukren@gmail.com>
This commit is contained in:
ivan71kmayshan27
2025-02-10 22:09:35 +01:00
committed by GitHub
parent 0db7c1e36a
commit 0d96a68e84
3 changed files with 28 additions and 3 deletions

View File

@@ -42,8 +42,11 @@ public class Renderer implements ApplicationListener{
public FrameBuffer effectBuffer = new FrameBuffer();
public boolean animateShields, drawWeather = true, drawStatus, enableEffects, drawDisplays = true, drawLight = true, pixelate = false;
public float weatherAlpha;
/** minZoom = zooming out, maxZoom = zooming in */
/** minZoom = zooming out, maxZoom = zooming in, used by cutscenes */
public float minZoom = 1.5f, maxZoom = 6f;
/** minZoom = zooming out, maxZoom = zooming in, used by actual gameplay zoom and regulated by settings **/
public float minZoomInGame = 0.5f, maxZoomInGame = 6f;
public Seq<EnvRenderer> envRenderers = new Seq<>();
public ObjectMap<String, Runnable> customBackgrounds = new ObjectMap<>();
public TextureRegion[] bubbles = new TextureRegion[16], splashes = new TextureRegion[12];
@@ -165,6 +168,8 @@ public class Renderer implements ApplicationListener{
drawStatus = settings.getBool("blockstatus");
enableEffects = settings.getBool("effects");
drawDisplays = !settings.getBool("hidedisplays");
maxZoomInGame = settings.getFloat("maxzoomingamemultiplier", 1) * maxZoom;
minZoomInGame = minZoom / settings.getFloat("minzoomingamemultiplier", 1);
drawLight = settings.getBool("drawlight", true);
pixelate = settings.getBool("pixelate");
@@ -486,11 +491,13 @@ public class Renderer implements ApplicationListener{
}
public float minScale(){
return Scl.scl(minZoom);
if(control.input.logicCutscene) return Scl.scl(minZoom);
return Scl.scl(minZoomInGame);
}
public float maxScale(){
return Mathf.round(Scl.scl(maxZoom));
if(control.input.logicCutscene) return Mathf.round(Scl.scl(maxZoom));
return Mathf.round(Scl.scl(maxZoomInGame));
}
public float getScale(){

View File

@@ -397,8 +397,23 @@ public class SettingsMenuDialog extends BaseDialog{
}
return s + "%";
});
graphics.sliderPref("unitlaseropacity", 100, 0, 100, 5, s -> s + "%");
graphics.sliderPref("bridgeopacity", 100, 0, 100, 5, s -> s + "%");
graphics.sliderPref("maxmagnificationmultiplierpercent", 100, 100, 200, 25, s -> {
if(ui.settings != null){
Core.settings.put("maxzoomingamemultiplier", (float)s / 100.0f);
}
return s + "%";
});
graphics.sliderPref("minmagnificationmultiplierpercent", 100, 100, 300, 25, s -> {
if(ui.settings != null){
Core.settings.put("minzoomingamemultiplier", (float)s / 100.0f);
}
return s + "%";
});
if(!mobile){
graphics.checkPref("vsync", true, b -> Core.graphics.setVSync(b));