Made console a setting
This commit is contained in:
@@ -10,6 +10,7 @@ import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.world.meta.*;
|
||||
|
||||
import static arc.Core.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class ContentInfoDialog extends BaseDialog{
|
||||
@@ -31,7 +32,7 @@ public class ContentInfoDialog extends BaseDialog{
|
||||
|
||||
table.table(title1 -> {
|
||||
title1.image(content.uiIcon).size(iconXLarge).scaling(Scaling.fit);
|
||||
title1.add("[accent]" + content.localizedName + (enableConsole ? "\n[gray]" + content.name : "")).padLeft(5);
|
||||
title1.add("[accent]" + content.localizedName + (settings.getBool("console") ? "\n[gray]" + content.name : "")).padLeft(5);
|
||||
});
|
||||
|
||||
table.row();
|
||||
|
||||
@@ -17,6 +17,7 @@ import mindustry.type.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
import static arc.Core.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class DatabaseDialog extends BaseDialog{
|
||||
@@ -98,7 +99,7 @@ public class DatabaseDialog extends BaseDialog{
|
||||
ui.content.show(unlock);
|
||||
}
|
||||
});
|
||||
image.addListener(new Tooltip(t -> t.background(Tex.button).add(unlock.localizedName + (enableConsole ? "\n[gray]" + unlock.name : ""))));
|
||||
image.addListener(new Tooltip(t -> t.background(Tex.button).add(unlock.localizedName + (settings.getBool("console") ? "\n[gray]" + unlock.name : ""))));
|
||||
}
|
||||
|
||||
if((++count) % cols == 0){
|
||||
|
||||
@@ -358,6 +358,10 @@ public class SettingsMenuDialog extends BaseDialog{
|
||||
}
|
||||
}
|
||||
|
||||
if(!mobile){
|
||||
game.checkPref("console", false);
|
||||
}
|
||||
|
||||
int[] lastUiScale = {settings.getInt("uiscale", 100)};
|
||||
|
||||
graphics.sliderPref("uiscale", 100, 25, 300, 25, s -> {
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ChatFragment extends Table{
|
||||
|
||||
update(() -> {
|
||||
|
||||
if(net.active() && input.keyTap(Binding.chat) && (scene.getKeyboardFocus() == chatfield || scene.getKeyboardFocus() == null || ui.minimapfrag.shown()) && !ui.scriptfrag.shown()){
|
||||
if(net.active() && input.keyTap(Binding.chat) && (scene.getKeyboardFocus() == chatfield || scene.getKeyboardFocus() == null || ui.minimapfrag.shown()) && !ui.consolefrag.shown()){
|
||||
toggle();
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import mindustry.ui.*;
|
||||
import static arc.Core.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class ScriptConsoleFragment extends Table{
|
||||
public class ConsoleFragment extends Table{
|
||||
private static final int messagesShown = 30;
|
||||
private Seq<String> messages = new Seq<>();
|
||||
private boolean open = false, shown;
|
||||
@@ -33,14 +33,14 @@ public class ScriptConsoleFragment extends Table{
|
||||
private int historyPos = 0;
|
||||
private int scrollPos = 0;
|
||||
|
||||
public ScriptConsoleFragment(){
|
||||
public ConsoleFragment(){
|
||||
setFillParent(true);
|
||||
font = Fonts.def;
|
||||
|
||||
visible(() -> {
|
||||
if(input.keyTap(Binding.console) && (scene.getKeyboardFocus() == chatfield || scene.getKeyboardFocus() == null) && !ui.chatfrag.shown()){
|
||||
if(input.keyTap(Binding.console) && settings.getBool("console") && (scene.getKeyboardFocus() == chatfield || scene.getKeyboardFocus() == null) && !ui.chatfrag.shown()){
|
||||
shown = !shown;
|
||||
if(shown && !open && enableConsole){
|
||||
if(shown && !open && settings.getBool("console")){
|
||||
toggle();
|
||||
}
|
||||
if(shown){
|
||||
@@ -53,7 +53,7 @@ public class ScriptConsoleFragment extends Table{
|
||||
});
|
||||
|
||||
update(() -> {
|
||||
if(input.keyTap(Binding.chat) && enableConsole && (scene.getKeyboardFocus() == chatfield || scene.getKeyboardFocus() == null)){
|
||||
if(input.keyTap(Binding.chat) && settings.getBool("console") && (scene.getKeyboardFocus() == chatfield || scene.getKeyboardFocus() == null)){
|
||||
toggle();
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public class PlacementFragment{
|
||||
}
|
||||
}
|
||||
|
||||
if(ui.chatfrag.shown() || Core.scene.hasKeyboard()) return false;
|
||||
if(ui.chatfrag.shown() || ui.consolefrag.shown() || Core.scene.hasKeyboard()) return false;
|
||||
|
||||
for(int i = 0; i < blockSelect.length; i++){
|
||||
if(Core.input.keyTap(blockSelect[i])){
|
||||
|
||||
Reference in New Issue
Block a user