Better Android keyboard support
This commit is contained in:
@@ -13,13 +13,7 @@ public class ControlsDialog extends KeybindDialog{
|
||||
setFillParent(true);
|
||||
title.setAlignment(Align.center);
|
||||
titleTable.row();
|
||||
titleTable.add(new Image())
|
||||
.growX().height(3f).pad(4f).get().setColor(Pal.accent);
|
||||
if(Vars.mobile){
|
||||
cont.row();
|
||||
cont.add("$keybinds.mobile")
|
||||
.center().growX().wrap().get().setAlignment(Align.center);
|
||||
}
|
||||
titleTable.add(new Image()).growX().height(3f).pad(4f).get().setColor(Pal.accent);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,6 +17,7 @@ import io.anuke.mindustry.core.GameState.*;
|
||||
import io.anuke.mindustry.game.EventType.*;
|
||||
import io.anuke.mindustry.gen.*;
|
||||
import io.anuke.mindustry.graphics.*;
|
||||
import io.anuke.mindustry.input.*;
|
||||
import io.anuke.mindustry.ui.*;
|
||||
|
||||
import static io.anuke.arc.Core.bundle;
|
||||
@@ -202,8 +203,20 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
game.screenshakePref();
|
||||
if(mobile){
|
||||
game.checkPref("autotarget", true);
|
||||
game.checkPref("keyboard", false);
|
||||
game.checkPref("keyboard", false, val -> control.setInput(val ? new DesktopInput() : new MobileInput()));
|
||||
if(Core.settings.getBool("keyboard")){
|
||||
control.setInput(new DesktopInput());
|
||||
}
|
||||
}
|
||||
//the issue with touchscreen support on desktop is that:
|
||||
//1) I can't test it
|
||||
//2) the SDL backend doesn't support multitouch
|
||||
/*else{
|
||||
game.checkPref("touchscreen", false, val -> control.setInput(!val ? new DesktopInput() : new MobileInput()));
|
||||
if(Core.settings.getBool("touchscreen")){
|
||||
control.setInput(new MobileInput());
|
||||
}
|
||||
}*/
|
||||
game.sliderPref("saveinterval", 60, 10, 5 * 120, i -> Core.bundle.format("setting.seconds", i));
|
||||
|
||||
if(!mobile){
|
||||
|
||||
Reference in New Issue
Block a user