Compare commits

...
Author SHA1 Message Date
BalaM314 beaa1da276 Allow closing the console after you've disabled it (#12737)
* Allow closing the console after you've disabled it

* Close the console immediately when disabled
2026-10-03 12:35:04 -04:00
2 changed files with 11 additions and 2 deletions
@@ -563,7 +563,11 @@ public class SettingsMenuDialog extends BaseDialog{
Core.settings.put("swapdiagonal", false);
}
dev.checkPref("console", false);
dev.checkPref("console", false, val -> {
if(val == false && ui.consolefrag != null){
ui.consolefrag.close();
}
});
dev.checkPref("drawhitboxes", false);
dev.checkPref("showperformance", false);
@@ -40,7 +40,7 @@ public class ConsoleFragment extends Table{
font = Fonts.def;
visible(() -> {
if(input.keyTap(Binding.console) && settings.getBool("console") && (scene.getKeyboardFocus() == chatfield || !(scene.getKeyboardFocus() instanceof TextField)) && !ui.chatfrag.shown()){
if(input.keyTap(Binding.console) && (settings.getBool("console") || shown) && (scene.getKeyboardFocus() == chatfield || !(scene.getKeyboardFocus() instanceof TextField)) && !ui.chatfrag.shown()){
shown = !shown;
if(shown && !open && settings.getBool("console")){
toggle();
@@ -227,6 +227,11 @@ public class ConsoleFragment extends Table{
open = false; //never true on mobile
}
public void close(){
shown = false;
open = false;
}
public void toggle(){
if(!open){