Made console a setting
This commit is contained in:
@@ -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