Skip to content

Commit

Permalink
Reorganized settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Jul 12, 2021
1 parent f36d47c commit ce6c39b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions core/src/mindustry/ui/dialogs/SettingsMenuDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ void addSettings(){
sound.sliderPref("sfxvol", bundle.get("setting.sfxvol.name", "SFX Volume"), 100, 0, 100, 1, i -> i + "%");
sound.sliderPref("ambientvol", bundle.get("setting.ambientvol.name", "Ambient Volume"), 100, 0, 100, 1, i -> i + "%");

game.screenshakePref();
game.sliderPref("saveinterval", 60, 10, 5 * 120, 10, i -> Core.bundle.format("setting.seconds", i));

if(mobile){
game.checkPref("autotarget", true);
game.checkPref("keyboard", false, val -> {
Expand All @@ -308,7 +309,6 @@ void addSettings(){
control.setInput(new MobileInput());
}
}*/
game.sliderPref("saveinterval", 60, 10, 5 * 120, 10, i -> Core.bundle.format("setting.seconds", i));

if(!mobile){
game.checkPref("crashreport", true);
Expand Down Expand Up @@ -351,6 +351,8 @@ void addSettings(){
Core.settings.put("uiscalechanged", s != lastUiScale[0]);
return s + "%";
});

graphics.sliderPref("screenshake", 4, 0, 8, i -> (i / 4f) + "x");
graphics.sliderPref("fpscap", 240, 15, 245, 5, s -> (s > 240 ? Core.bundle.get("setting.fpscap.none") : Core.bundle.format("setting.fpscap.text", s)));
graphics.sliderPref("chatopacity", 100, 0, 100, 5, s -> s + "%");
graphics.sliderPref("lasersopacity", 100, 0, 100, 5, s -> {
Expand Down Expand Up @@ -560,10 +562,6 @@ public void pref(Setting setting){
rebuild();
}

public void screenshakePref(){
sliderPref("screenshake", bundle.get("setting.screenshake.name", "Screen Shake"), 4, 0, 8, i -> (i / 4f) + "x");
}

public SliderSetting sliderPref(String name, String title, int def, int min, int max, StringProcessor s){
return sliderPref(name, title, def, min, max, 1, s);
}
Expand Down Expand Up @@ -701,7 +699,7 @@ public void add(SettingsTable table){

slider.change();

table.stack(slider, value).width(420f).left().padTop(4);
table.stack(slider, value).width(Math.min(Core.graphics.getWidth() / 1.2f, 460f)).left().padTop(4);
table.row();
}
}
Expand Down

0 comments on commit ce6c39b

Please sign in to comment.