From daa80955aca142ea88e11a0e15861c43ce6ecf72 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 20 May 2020 11:34:00 -0400 Subject: [PATCH 1/2] Update CONTRIBUTING.md --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 199aa17bf6..50f94d22f6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,6 +26,7 @@ This means: - 4 spaces indentation - `camelCase`, **even for constants or enums**. Why? Because `SCREAMING_CASE` is ugly, annoying to type and does not achieve anything useful. Constants are *less* dangerous than variables, not more. - No underscores for anything. (Yes, I know `Bindings` violates this principle, but that's for legacy reasons and really should be cleaned up some day) +- Do not use braceless `if/else` statements. `if(x) statement else statement2` should **never** be done. In very specific situations, having braceless if-statements on one line is allowed: `if(cond) return;` would be valid. Import [this style file](.github/Mindustry-CodeStyle-IJ.xml) into IntelliJ to get correct formatting when developing Mindustry. From 7030f69bc606ea57ec17ef1694d58d6576346231 Mon Sep 17 00:00:00 2001 From: zethnest <16971676+zethnest@users.noreply.github.com> Date: Wed, 20 May 2020 23:34:49 +0800 Subject: [PATCH 2/2] Chat on Minimap Implementation (#2092) * chat on minimap implementation * add braces --- core/src/mindustry/ui/fragments/ChatFragment.java | 2 +- core/src/mindustry/ui/fragments/MinimapFragment.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/ui/fragments/ChatFragment.java b/core/src/mindustry/ui/fragments/ChatFragment.java index 7a13cdb977..f279178fd7 100644 --- a/core/src/mindustry/ui/fragments/ChatFragment.java +++ b/core/src/mindustry/ui/fragments/ChatFragment.java @@ -62,7 +62,7 @@ public class ChatFragment extends Table{ update(() -> { - if(net.active() && input.keyTap(Binding.chat) && (scene.getKeyboardFocus() == chatfield || scene.getKeyboardFocus() == null)){ + if(net.active() && input.keyTap(Binding.chat) && (scene.getKeyboardFocus() == chatfield || scene.getKeyboardFocus() == null || ui.minimapfrag.shown())){ toggle(); } diff --git a/core/src/mindustry/ui/fragments/MinimapFragment.java b/core/src/mindustry/ui/fragments/MinimapFragment.java index 5405d14959..12195af8a9 100644 --- a/core/src/mindustry/ui/fragments/MinimapFragment.java +++ b/core/src/mindustry/ui/fragments/MinimapFragment.java @@ -43,8 +43,10 @@ public class MinimapFragment extends Fragment{ elem.visible(() -> shown); elem.update(() -> { - elem.requestKeyboard(); - elem.requestScroll(); + if(!ui.chatfrag.shown()){ + elem.requestKeyboard(); + elem.requestScroll(); + } elem.setFillParent(true); elem.setBounds(0, 0, Core.graphics.getWidth(), Core.graphics.getHeight());