From aecd883f70564aa7b1e8cc6dadbacf4debfae74b Mon Sep 17 00:00:00 2001 From: MEEP of Faith Date: Fri, 27 May 2022 10:31:16 -0700 Subject: [PATCH 1/5] Fix TC on Erekir (Mobile) --- scripts/main.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/scripts/main.js b/scripts/main.js index c2a6673..ebec670 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -23,17 +23,13 @@ function addTable(table){ l.color(Tmp.c1.lerp(cols, (s.getValue() + 8) / 16)); }); })); - table.fillParent = true; + table.name = "tc-slider"; table.visibility = () => { - if(!Vars.ui.hudfrag.shown) return false; - if(Vars.ui.minimapfrag.shown()) return false; + if(!Vars.ui.hudfrag.shown || Vars.ui.minimapfrag.shown()) return false; if(!Vars.mobile) return true; - if(Vars.player.unit().isBuilding()) return false; - if(Vars.control.input.block != null) return false; - if(Vars.control.input.mode == PlaceMode.breaking) return false; - //todo port to v7 - //if(Vars.control.input.selectRequests != null && !Vars.control.input.selectRequests.isEmpty() && Vars.control.input.lastSchematic != null && !Vars.control.input.selectRequests.isEmpty()) return false; - return true; + + let input = Vars.control.input; + return input.lastSchematic == null || input.selectPlans.isEmpty(); }; } @@ -44,5 +40,6 @@ if(!Vars.headless){ tc.bottom().left(); addTable(tc); Vars.ui.hudGroup.addChild(tc); + tc.moveBy(0, Vars.mobile ? Scl.scl(48) : 0); }); } From 92f3a2471887f771a8f476d13b2627be4f452d98 Mon Sep 17 00:00:00 2001 From: MEEP of Faith Date: Fri, 27 May 2022 10:31:52 -0700 Subject: [PATCH 2/5] i forgor --- scripts/main.js | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/main.js b/scripts/main.js index ebec670..9568266 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -23,7 +23,6 @@ function addTable(table){ l.color(Tmp.c1.lerp(cols, (s.getValue() + 8) / 16)); }); })); - table.name = "tc-slider"; table.visibility = () => { if(!Vars.ui.hudfrag.shown || Vars.ui.minimapfrag.shown()) return false; if(!Vars.mobile) return true; From 3da65ce0251c984ed665f1797efe4bc55c61cc07 Mon Sep 17 00:00:00 2001 From: MEEP of Faith Date: Sun, 29 May 2022 12:55:51 -0700 Subject: [PATCH 3/5] Set min width for slider - Squished on mobile I've seen a screenshot. TC is pretty much unusable on mobile due to how short the slider becomes. --- scripts/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/main.js b/scripts/main.js index 9568266..1138b06 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -16,7 +16,7 @@ function addTable(table){ }).growX().width(8.5 * 8).color(Pal.accent); let b = t.button(new TextureRegionDrawable(Icon.refresh), 24, () => s.setValue(0)).padLeft(6).get(); b.getStyle().imageUpColor = Pal.accent; - t.add(s).padLeft(6); + t.add(s).padLeft(6).minWidth(120); s.moved(v => { let t = Math.pow(2, v); Time.setDeltaProvider(() => Math.min(Core.graphics.getDeltaTime() * 60 * t, 3 * t)); From 70e7c669ffbda94032361314dd1b680da5c5c41c Mon Sep 17 00:00:00 2001 From: MEEP of Faith Date: Sun, 29 May 2022 13:01:30 -0700 Subject: [PATCH 4/5] General Sliderous, you're shorter than I expected --- scripts/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/main.js b/scripts/main.js index 1138b06..c8fbcbe 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -16,7 +16,7 @@ function addTable(table){ }).growX().width(8.5 * 8).color(Pal.accent); let b = t.button(new TextureRegionDrawable(Icon.refresh), 24, () => s.setValue(0)).padLeft(6).get(); b.getStyle().imageUpColor = Pal.accent; - t.add(s).padLeft(6).minWidth(120); + t.add(s).padLeft(6).minWidth(200); s.moved(v => { let t = Math.pow(2, v); Time.setDeltaProvider(() => Math.min(Core.graphics.getDeltaTime() * 60 * t, 3 * t)); From ce736a400ab819b1892b604bfc8fabb9d3d6a7d6 Mon Sep 17 00:00:00 2001 From: MEEP of Faith Date: Thu, 2 Jun 2022 12:49:45 -0700 Subject: [PATCH 5/5] Sk, functionality is more important, deal with how it looks later --- scripts/main.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/main.js b/scripts/main.js index c8fbcbe..31bf2d7 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -2,8 +2,7 @@ let cols = [Pal.lancerLaser, Pal.accent, Color.valueOf("cc6eaf")]; function addTable(table){ - table.table(Styles.black5, cons(t => { - t.background(Tex.buttonEdge3); + table.table(Tex.pane, t => { let s = new Slider(-8, 8, 1, false); s.setValue(0); let l = t.label(() => { @@ -22,7 +21,7 @@ function addTable(table){ Time.setDeltaProvider(() => Math.min(Core.graphics.getDeltaTime() * 60 * t, 3 * t)); l.color(Tmp.c1.lerp(cols, (s.getValue() + 8) / 16)); }); - })); + }); table.visibility = () => { if(!Vars.ui.hudfrag.shown || Vars.ui.minimapfrag.shown()) return false; if(!Vars.mobile) return true; @@ -39,6 +38,6 @@ if(!Vars.headless){ tc.bottom().left(); addTable(tc); Vars.ui.hudGroup.addChild(tc); - tc.moveBy(0, Vars.mobile ? Scl.scl(48) : 0); + if(Vars.mobile) tc.moveBy(0, Scl.scl(46)); }); }