mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-12 08:48:09 +07:00
Added smooth camera option
This commit is contained in:
@ -673,6 +673,7 @@ setting.milliseconds = {0} milliseconds
|
|||||||
setting.fullscreen.name = Fullscreen
|
setting.fullscreen.name = Fullscreen
|
||||||
setting.borderlesswindow.name = Borderless Window[lightgray] (restart may be required)
|
setting.borderlesswindow.name = Borderless Window[lightgray] (restart may be required)
|
||||||
setting.fps.name = Show FPS & Ping
|
setting.fps.name = Show FPS & Ping
|
||||||
|
setting.smoothcamera.name = Smooth Camera
|
||||||
setting.blockselectkeys.name = Show Block Select Keys
|
setting.blockselectkeys.name = Show Block Select Keys
|
||||||
setting.vsync.name = VSync
|
setting.vsync.name = VSync
|
||||||
setting.pixelate.name = Pixelate
|
setting.pixelate.name = Pixelate
|
||||||
|
@ -63,6 +63,7 @@ public class Weathers implements ContentList{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//TODO should apply wet effect
|
||||||
rain = new Weather("rain"){
|
rain = new Weather("rain"){
|
||||||
float yspeed = 5f, xspeed = 1.5f, padding = 16f, size = 40f, density = 1200f;
|
float yspeed = 5f, xspeed = 1.5f, padding = 16f, size = 40f, density = 1200f;
|
||||||
TextureRegion[] splashes = new TextureRegion[12];
|
TextureRegion[] splashes = new TextureRegion[12];
|
||||||
@ -158,7 +159,7 @@ public class Weathers implements ContentList{
|
|||||||
sandstorm = new Weather("sandstorm"){
|
sandstorm = new Weather("sandstorm"){
|
||||||
TextureRegion region;
|
TextureRegion region;
|
||||||
float yspeed = 0.3f, xspeed = 6f, padding = 110f, size = 110f, invDensity = 800f;
|
float yspeed = 0.3f, xspeed = 6f, padding = 110f, size = 110f, invDensity = 800f;
|
||||||
Vec2 force = new Vec2(0.35f, 0.01f);
|
Vec2 force = new Vec2(0.4f, 0.01f);
|
||||||
Color color = Color.valueOf("f7cba4");
|
Color color = Color.valueOf("f7cba4");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -179,6 +179,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
ui.listfrag.toggle();
|
ui.listfrag.toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO awful UI state checking code
|
||||||
if((player.dead() || state.isPaused()) && !ui.chatfrag.shown()){
|
if((player.dead() || state.isPaused()) && !ui.chatfrag.shown()){
|
||||||
if(!(scene.getKeyboardFocus() instanceof TextField) && !scene.hasDialog()){
|
if(!(scene.getKeyboardFocus() instanceof TextField) && !scene.hasDialog()){
|
||||||
//move camera around
|
//move camera around
|
||||||
@ -191,7 +192,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(!player.dead()){
|
}else if(!player.dead()){
|
||||||
Core.camera.position.lerpDelta(player, 0.08f);
|
Core.camera.position.lerpDelta(player, Core.settings.getBool("smoothcamera") ? 0.08f : 1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldShoot = true;
|
shouldShoot = true;
|
||||||
|
@ -326,6 +326,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
graphics.checkPref("blockstatus", false);
|
graphics.checkPref("blockstatus", false);
|
||||||
graphics.checkPref("playerchat", true);
|
graphics.checkPref("playerchat", true);
|
||||||
graphics.checkPref("minimap", !mobile);
|
graphics.checkPref("minimap", !mobile);
|
||||||
|
graphics.checkPref("smoothcamera", true);
|
||||||
graphics.checkPref("position", false);
|
graphics.checkPref("position", false);
|
||||||
graphics.checkPref("fps", false);
|
graphics.checkPref("fps", false);
|
||||||
if(!mobile){
|
if(!mobile){
|
||||||
@ -343,6 +344,8 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
Core.settings.put("bloom", false);
|
Core.settings.put("bloom", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
graphics.checkPref("pixelate", false, val -> {
|
graphics.checkPref("pixelate", false, val -> {
|
||||||
if(val){
|
if(val){
|
||||||
Events.fire(Trigger.enablePixelation);
|
Events.fire(Trigger.enablePixelation);
|
||||||
|
Reference in New Issue
Block a user