From 1651dc520c034ddd4ee10d800eb39fe99faad9f4 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 9 Nov 2022 13:56:53 -0500 Subject: [PATCH] Better inset borders for phones --- core/assets-raw/sprites/ui/pane-left.9.png | Bin 0 -> 185 bytes core/assets-raw/sprites/ui/pane-right.9.png | Bin 0 -> 191 bytes core/src/mindustry/input/MobileInput.java | 9 ++++++++- core/src/mindustry/ui/fragments/HudFragment.java | 7 +++++++ .../mindustry/ui/fragments/PlacementFragment.java | 9 +++++++++ 5 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 core/assets-raw/sprites/ui/pane-left.9.png create mode 100644 core/assets-raw/sprites/ui/pane-right.9.png diff --git a/core/assets-raw/sprites/ui/pane-left.9.png b/core/assets-raw/sprites/ui/pane-left.9.png new file mode 100644 index 0000000000000000000000000000000000000000..8019c41497dd86e74150055271d7c3f228a2aa4e GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0y~yU{GUVV36ftV_;x7)*yF)fq{XsILO_JVcj{ImkbOH z#hxyXArY-_uWjT#pupo2n6Q7gvUMu&bRD^`FR?&^t}osD`c0|g5wex77C z=l-rG+pbl`m^`;Rxqx3r*)rjD;*`T0?SXuYW!!jwDg0mh?${>gGPb|ke<3UxH_M(P miBNMLrA^XtQ}0GZns5Cq8qmUBww{53fx*+&&t;ucLK6U*`$eSy literal 0 HcmV?d00001 diff --git a/core/assets-raw/sprites/ui/pane-right.9.png b/core/assets-raw/sprites/ui/pane-right.9.png new file mode 100644 index 0000000000000000000000000000000000000000..62f65042dd16e3f282f38673efeed0751e295388 GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0y~yU{GUVV36ftV_;x7)*yF)fq{XsILO_JVcj{ImkbOH zm7Xq+ArY-_uWjUQFyLVgR8QJEC9ZjH0xv%Yuc(s8bql?Js|C1Dp7hOlmlxs^ld^ZW z`Hua$=MOvDnQRu8`?CALL~{M!ELpatff7p%yb`Az(r68w8+Rh|m0wQj0iWgny&$X} pkT}=kS8c9GUbXqBs)t?UwX+s!@8=A3U|?Wi@O1TaS?83{1OT4yM4 { commandMode = !commandMode; - }).width(155f).height(50f).margin(12f).checked(b -> commandMode); + }).width(155f).height(50f).margin(12f).checked(b -> commandMode).row(); + + //for better looking insets + t.rect((x, y, w, h) -> { + if(Core.scene.marginBottom > 0){ + Tex.paneRight.draw(x, 0, w, y); + } + }).fillX().row(); }); group.fill(t -> { diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index bda2c93c23..6b1fe1b2d6 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -129,6 +129,13 @@ public class HudFragment{ cont.top().left(); if(mobile){ + //for better inset visuals + cont.rect((x, y, w, h) -> { + if(Core.scene.marginTop > 0){ + Tex.paneRight.draw(x, y, w, Core.scene.marginTop); + } + }).fillX().row(); + cont.table(select -> { select.name = "mobile buttons"; select.left(); diff --git a/core/src/mindustry/ui/fragments/PlacementFragment.java b/core/src/mindustry/ui/fragments/PlacementFragment.java index a18d3af0c1..dc1eba79b5 100644 --- a/core/src/mindustry/ui/fragments/PlacementFragment.java +++ b/core/src/mindustry/ui/fragments/PlacementFragment.java @@ -421,6 +421,15 @@ public class PlacementFragment{ frame.add(mainStack).colspan(3).fill(); + frame.row(); + + //for better inset visuals at the bottom + frame.rect((x, y, w, h) -> { + if(Core.scene.marginBottom > 0){ + Tex.paneLeft.draw(x, 0, w, y); + } + }).colspan(3).fillX().row(); + //commandTable: commanded units { commandTable.touchable = Touchable.enabled;