From 72fc103e16c1225c8359e1912d796d466dd6c5cb Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 23 Jul 2020 17:37:45 -0400 Subject: [PATCH] UI cleanup --- core/assets/bundles/bundle.properties | 2 +- core/src/mindustry/core/UI.java | 10 +++---- .../src/mindustry/editor/MapEditorDialog.java | 2 +- .../mindustry/editor/MapGenerateDialog.java | 2 +- core/src/mindustry/editor/MapView.java | 2 +- core/src/mindustry/editor/WaveInfoDialog.java | 2 +- core/src/mindustry/input/DesktopInput.java | 6 ++-- core/src/mindustry/input/InputHandler.java | 2 +- core/src/mindustry/ui/BorderImage.java | 4 +-- core/src/mindustry/ui/Minimap.java | 2 +- core/src/mindustry/ui/MultiReqImage.java | 6 ++-- .../mindustry/ui/dialogs/DatabaseDialog.java | 2 +- .../src/mindustry/ui/dialogs/FileChooser.java | 2 +- core/src/mindustry/ui/dialogs/JoinDialog.java | 4 +-- .../mindustry/ui/dialogs/PlanetDialog.java | 4 +-- .../mindustry/ui/dialogs/ResearchDialog.java | 18 ++++++------ .../ui/dialogs/SchematicsDialog.java | 4 +-- .../ui/fragments/BlockConfigFragment.java | 8 +++--- .../ui/fragments/BlockInventoryFragment.java | 8 +++--- .../mindustry/ui/fragments/ChatFragment.java | 4 +-- .../ui/fragments/FadeInFragment.java | 2 +- .../mindustry/ui/fragments/HudFragment.java | 28 +++++++++---------- .../ui/fragments/LoadingFragment.java | 18 ++++++------ .../mindustry/ui/fragments/MenuFragment.java | 4 +-- .../ui/fragments/MinimapFragment.java | 2 +- .../ui/fragments/OverlayFragment.java | 2 +- .../ui/fragments/PlacementFragment.java | 2 +- .../ui/fragments/ScriptConsoleFragment.java | 4 +-- 28 files changed, 78 insertions(+), 78 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 4418f3db5d..3cceedd082 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -474,7 +474,7 @@ uncover = Uncover configure = Configure Loadout #TODO loadout = Loadout -resources = Resources +resources = Resources bannedblocks = Banned Blocks addall = Add All configure.invalid = Amount must be a number between 0 and {0}. diff --git a/core/src/mindustry/core/UI.java b/core/src/mindustry/core/UI.java index 8dfcefdad9..196937d548 100644 --- a/core/src/mindustry/core/UI.java +++ b/core/src/mindustry/core/UI.java @@ -182,10 +182,10 @@ public class UI implements ApplicationListener, Loadable{ Group group = Core.scene.root; menuGroup.setFillParent(true); - menuGroup.touchable(Touchable.childrenOnly); + menuGroup.touchable = Touchable.childrenOnly; menuGroup.visible(() -> state.isMenu()); hudGroup.setFillParent(true); - hudGroup.touchable(Touchable.childrenOnly); + hudGroup.touchable = Touchable.childrenOnly; hudGroup.visible(() -> state.isGame()); Core.scene.add(menuGroup); @@ -292,7 +292,7 @@ public class UI implements ApplicationListener, Loadable{ public void showInfoToast(String info, float duration){ Table table = new Table(); table.setFillParent(true); - table.touchable(Touchable.disabled); + table.touchable = Touchable.disabled; table.update(() -> { if(state.isMenu()) table.remove(); }); @@ -305,7 +305,7 @@ public class UI implements ApplicationListener, Loadable{ public void showInfoPopup(String info, float duration, int align, int top, int left, int bottom, int right){ Table table = new Table(); table.setFillParent(true); - table.touchable(Touchable.disabled); + table.touchable = Touchable.disabled; table.update(() -> { if(state.isMenu()) table.remove(); }); @@ -318,7 +318,7 @@ public class UI implements ApplicationListener, Loadable{ public void showLabel(String info, float duration, float worldx, float worldy){ Table table = new Table(); table.setFillParent(true); - table.touchable(Touchable.disabled); + table.touchable = Touchable.disabled; table.update(() -> { if(state.isMenu()) table.remove(); }); diff --git a/core/src/mindustry/editor/MapEditorDialog.java b/core/src/mindustry/editor/MapEditorDialog.java index a8caf77d8c..8fcd9f8d44 100644 --- a/core/src/mindustry/editor/MapEditorDialog.java +++ b/core/src/mindustry/editor/MapEditorDialog.java @@ -475,7 +475,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ mode.setColor(Pal.remove); mode.update(() -> mode.setText(tool.mode == -1 ? "" : "M" + (tool.mode + 1) + " ")); mode.setAlignment(Align.bottomRight, Align.bottomRight); - mode.touchable(Touchable.disabled); + mode.touchable = Touchable.disabled; tools.stack(button, mode); }; diff --git a/core/src/mindustry/editor/MapGenerateDialog.java b/core/src/mindustry/editor/MapGenerateDialog.java index c7d7d86ae4..ff372999d1 100644 --- a/core/src/mindustry/editor/MapGenerateDialog.java +++ b/core/src/mindustry/editor/MapGenerateDialog.java @@ -214,7 +214,7 @@ public class MapGenerateDialog extends BaseDialog{ } void rebuildFilters(){ - int cols = Math.max((int)(Math.max(filterTable.getParent().getWidth(), Core.graphics.getWidth()/2f * 0.9f) / Scl.scl(290f)), 1); + int cols = Math.max((int)(Math.max(filterTable.parent.getWidth(), Core.graphics.getWidth()/2f * 0.9f) / Scl.scl(290f)), 1); filterTable.clearChildren(); filterTable.top().left(); int i = 0; diff --git a/core/src/mindustry/editor/MapView.java b/core/src/mindustry/editor/MapView.java index 728a5a2440..45dfa8d73a 100644 --- a/core/src/mindustry/editor/MapView.java +++ b/core/src/mindustry/editor/MapView.java @@ -46,7 +46,7 @@ public class MapView extends Element implements GestureListener{ } Core.input.getInputProcessors().insert(0, new GestureDetector(20, 0.5f, 2, 0.15f, this)); - touchable(Touchable.enabled); + this.touchable = Touchable.enabled; Point2 firstTouch = new Point2(); diff --git a/core/src/mindustry/editor/WaveInfoDialog.java b/core/src/mindustry/editor/WaveInfoDialog.java index 7f1867f92a..d3c8cbc693 100644 --- a/core/src/mindustry/editor/WaveInfoDialog.java +++ b/core/src/mindustry/editor/WaveInfoDialog.java @@ -93,7 +93,7 @@ public class WaveInfoDialog extends BaseDialog{ }).growX().height(70f); }), new Label("$waves.none"){{ visible(() -> groups.isEmpty()); - touchable(Touchable.disabled); + this.touchable = Touchable.disabled; setWrap(true); setAlignment(Align.center, Align.center); }}).width(390f).growY(); diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index bb3970a71e..5be37fd2a2 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -49,11 +49,11 @@ public class DesktopInput extends InputHandler{ group.fill(t -> { t.bottom(); t.visible(() -> { - t.getColor().a = Mathf.lerpDelta(t.getColor().a, player.builder().isBuilding() ? 1f : 0f, 0.15f); + t.color.a = Mathf.lerpDelta(t.color.a, player.builder().isBuilding() ? 1f : 0f, 0.15f); - return Core.settings.getBool("hints") && selectRequests.isEmpty() && t.getColor().a > 0.01f; + return Core.settings.getBool("hints") && selectRequests.isEmpty() && t.color.a > 0.01f; }); - t.touchable(() -> t.getColor().a < 0.1f ? Touchable.disabled : Touchable.childrenOnly); + t.touchable(() -> t.color.a < 0.1f ? Touchable.disabled : Touchable.childrenOnly); t.table(Styles.black6, b -> { b.defaults().left(); b.label(() -> Core.bundle.format(!isBuilding ? "resumebuilding" : "pausebuilding", Core.keybinds.get(Binding.pause_building).key.toString())).style(Styles.outlineLabel); diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index e92b3d1961..9afc12d0c6 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -890,7 +890,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } uiGroup = new WidgetGroup(); - uiGroup.touchable(Touchable.childrenOnly); + uiGroup.touchable = Touchable.childrenOnly; uiGroup.setFillParent(true); ui.hudGroup.addChild(uiGroup); buildUI(uiGroup); diff --git a/core/src/mindustry/ui/BorderImage.java b/core/src/mindustry/ui/BorderImage.java index df077a0c13..525d2743c8 100644 --- a/core/src/mindustry/ui/BorderImage.java +++ b/core/src/mindustry/ui/BorderImage.java @@ -37,8 +37,8 @@ public class BorderImage extends Image{ public void draw(){ super.draw(); - float scaleX = getScaleX(); - float scaleY = getScaleY(); + float scaleX = this.scaleX; + float scaleY = this.scaleY; Draw.color(borderColor); Draw.alpha(parentAlpha); diff --git a/core/src/mindustry/ui/Minimap.java b/core/src/mindustry/ui/Minimap.java index cac2f08993..dfec82c9fd 100644 --- a/core/src/mindustry/ui/Minimap.java +++ b/core/src/mindustry/ui/Minimap.java @@ -15,7 +15,7 @@ public class Minimap extends Table{ public Minimap(){ background(Tex.pane); float margin = 5f; - touchable(Touchable.enabled); + this.touchable = Touchable.enabled; add(new Element(){ { diff --git a/core/src/mindustry/ui/MultiReqImage.java b/core/src/mindustry/ui/MultiReqImage.java index 53308eb51c..ebbb4fc359 100644 --- a/core/src/mindustry/ui/MultiReqImage.java +++ b/core/src/mindustry/ui/MultiReqImage.java @@ -19,14 +19,14 @@ public class MultiReqImage extends Stack{ time += Time.delta / 60f; - displays.each(req -> req.visible(false)); + displays.each(req -> req.visible = false); ReqImage valid = displays.find(ReqImage::valid); if(valid != null){ - valid.visible(true); + valid.visible = true; }else{ if(displays.size > 0){ - displays.get((int)(time) % displays.size).visible(true); + displays.get((int)time % displays.size).visible = true; } } } diff --git a/core/src/mindustry/ui/dialogs/DatabaseDialog.java b/core/src/mindustry/ui/dialogs/DatabaseDialog.java index fa15d4aba8..df76054322 100644 --- a/core/src/mindustry/ui/dialogs/DatabaseDialog.java +++ b/core/src/mindustry/ui/dialogs/DatabaseDialog.java @@ -62,7 +62,7 @@ public class DatabaseDialog extends BaseDialog{ image.addListener(listener); if(!Vars.mobile && unlocked(unlock)){ image.addListener(new HandCursorListener()); - image.update(() -> image.getColor().lerp(!listener.isOver() ? Color.lightGray : Color.white, 0.4f * Time.delta)); + image.update(() -> image.color.lerp(!listener.isOver() ? Color.lightGray : Color.white, 0.4f * Time.delta)); } if(unlocked(unlock)){ diff --git a/core/src/mindustry/ui/dialogs/FileChooser.java b/core/src/mindustry/ui/dialogs/FileChooser.java index 57efc91636..ef299cf656 100644 --- a/core/src/mindustry/ui/dialogs/FileChooser.java +++ b/core/src/mindustry/ui/dialogs/FileChooser.java @@ -76,7 +76,7 @@ public class FileChooser extends BaseDialog{ cancel.clicked(this::hide); navigation = new TextField(""); - navigation.touchable(Touchable.disabled); + navigation.touchable = Touchable.disabled; files = new Table(); files.marginRight(10); diff --git a/core/src/mindustry/ui/dialogs/JoinDialog.java b/core/src/mindustry/ui/dialogs/JoinDialog.java index f6a2cbc503..30144e65e8 100644 --- a/core/src/mindustry/ui/dialogs/JoinDialog.java +++ b/core/src/mindustry/ui/dialogs/JoinDialog.java @@ -286,12 +286,12 @@ public class JoinDialog extends BaseDialog{ pad = 6; } - Cell cell = ((Table)pane.getParent()).getCell(button); + Cell cell = ((Table)pane.parent).getCell(button); if(!Mathf.equal(cell.minWidth(), pw)){ cell.width(pw); cell.padLeft(pad); - pane.getParent().invalidateHierarchy(); + pane.parent.invalidateHierarchy(); } }); } diff --git a/core/src/mindustry/ui/dialogs/PlanetDialog.java b/core/src/mindustry/ui/dialogs/PlanetDialog.java index 4d008d96e4..b34a68a008 100644 --- a/core/src/mindustry/ui/dialogs/PlanetDialog.java +++ b/core/src/mindustry/ui/dialogs/PlanetDialog.java @@ -416,12 +416,12 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{ stable.update(() -> { if(selected != null){ if(launching){ - stable.getColor().sub(0, 0, 0, 0.05f * Time.delta); + stable.color.sub(0, 0, 0, 0.05f * Time.delta); }else{ //fade out UI when not facing selected sector Tmp.v31.set(selected.tile.v).rotate(Vec3.Y, -planets.planet.getRotation()).scl(-1f).nor(); float dot = planets.cam.direction.dot(Tmp.v31); - stable.getColor().a = Math.max(dot, 0f)*2f; + stable.color.a = Math.max(dot, 0f)*2f; if(dot*2f <= -0.1f){ stable.remove(); selected = null; diff --git a/core/src/mindustry/ui/dialogs/ResearchDialog.java b/core/src/mindustry/ui/dialogs/ResearchDialog.java index f9e7e15392..ed7b7bc32b 100644 --- a/core/src/mindustry/ui/dialogs/ResearchDialog.java +++ b/core/src/mindustry/ui/dialogs/ResearchDialog.java @@ -64,7 +64,7 @@ public class ResearchDialog extends BaseDialog{ addListener(new InputListener(){ @Override public boolean scrolled(InputEvent event, float x, float y, float amountX, float amountY){ - view.setScale(Mathf.clamp(view.getScaleX() - amountY / 10f * view.getScaleX(), 0.25f, 1f)); + view.setScale(Mathf.clamp(view.scaleX - amountY / 10f * view.scaleX, 0.25f, 1f)); view.setOrigin(Align.center); view.setTransform(true); return true; @@ -81,7 +81,7 @@ public class ResearchDialog extends BaseDialog{ @Override public void zoom(InputEvent event, float initialDistance, float distance){ if(view.lastZoom < 0){ - view.lastZoom = view.getScaleX(); + view.lastZoom = view.scaleX; } view.setScale(Mathf.clamp(distance / initialDistance * view.lastZoom, 0.25f, 1f)); @@ -91,13 +91,13 @@ public class ResearchDialog extends BaseDialog{ @Override public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button){ - view.lastZoom = view.getScaleX(); + view.lastZoom = view.scaleX; } @Override public void pan(InputEvent event, float x, float y, float deltaX, float deltaY){ - view.panX += deltaX / view.getScaleX(); - view.panY += deltaY / view.getScaleY(); + view.panX += deltaX / view.scaleX; + view.panY += deltaY / view.scaleY; view.moved = true; view.clamp(); } @@ -180,7 +180,7 @@ public class ResearchDialog extends BaseDialog{ Table table = new Table(); table.actions(Actions.fadeOut(0.5f, Interp.fade), Actions.remove()); table.top().add(info); - table.setName("toast"); + table.name = "toast"; table.update(() -> { table.toFront(); table.setPosition(Core.graphics.getWidth() / 2f, Core.graphics.getHeight() - 21, Align.top); @@ -230,7 +230,7 @@ public class ResearchDialog extends BaseDialog{ Table infoTable = new Table(); { - infoTable.touchable(Touchable.enabled); + infoTable.touchable = Touchable.enabled; for(TechTreeNode node : nodes){ ImageButton button = new ImageButton(node.node.content.icon(Cicon.medium), Styles.nodei); @@ -273,7 +273,7 @@ public class ResearchDialog extends BaseDialog{ } }); button.touchable(() -> !node.visible ? Touchable.disabled : Touchable.enabled); - button.setUserObject(node.node); + button.userObject = node.node; button.setSize(nodeSize); button.update(() -> { float offset = (Core.graphics.getHeight() % 2) / 2f; @@ -335,7 +335,7 @@ public class ResearchDialog extends BaseDialog{ if(button == null) return; - TechNode node = (TechNode)button.getUserObject(); + TechNode node = (TechNode)button.userObject; infoTable.exited(() -> { if(hoverNode == button && !infoTable.hasMouse() && !hoverNode.hasMouse()){ diff --git a/core/src/mindustry/ui/dialogs/SchematicsDialog.java b/core/src/mindustry/ui/dialogs/SchematicsDialog.java index e26ab13a93..53b0c437dc 100644 --- a/core/src/mindustry/ui/dialogs/SchematicsDialog.java +++ b/core/src/mindustry/ui/dialogs/SchematicsDialog.java @@ -277,8 +277,8 @@ public class SchematicsDialog extends BaseDialog{ @Override public void draw(){ - boolean checked = getParent().getParent() instanceof Button - && ((Button)getParent().getParent()).isOver(); + boolean checked = parent.parent instanceof Button + && ((Button)parent.parent).isOver(); boolean wasSet = set; if(!set){ diff --git a/core/src/mindustry/ui/fragments/BlockConfigFragment.java b/core/src/mindustry/ui/fragments/BlockConfigFragment.java index b111a9c551..41f5d58770 100644 --- a/core/src/mindustry/ui/fragments/BlockConfigFragment.java +++ b/core/src/mindustry/ui/fragments/BlockConfigFragment.java @@ -17,7 +17,7 @@ public class BlockConfigFragment extends Fragment{ @Override public void build(Group parent){ - table.visible(false); + table.visible = false; parent.addChild(table); //hacky way to hide block config when in menu @@ -27,7 +27,7 @@ public class BlockConfigFragment extends Fragment{ public void act(float delta){ super.act(delta); if(state.isMenu()){ - table.visible(false); + table.visible = false; configTile = null; } } @@ -35,7 +35,7 @@ public class BlockConfigFragment extends Fragment{ } public boolean isShown(){ - return table.isVisible() && configTile != null; + return table.visible && configTile != null; } public Building getSelectedTile(){ @@ -46,7 +46,7 @@ public class BlockConfigFragment extends Fragment{ if(tile.configTapped()){ configTile = tile; - table.visible(true); + table.visible = true; table.clear(); tile.buildConfiguration(table); table.pack(); diff --git a/core/src/mindustry/ui/fragments/BlockInventoryFragment.java b/core/src/mindustry/ui/fragments/BlockInventoryFragment.java index 4ec5a83e5f..4569b326cc 100644 --- a/core/src/mindustry/ui/fragments/BlockInventoryFragment.java +++ b/core/src/mindustry/ui/fragments/BlockInventoryFragment.java @@ -65,7 +65,7 @@ public class BlockInventoryFragment extends Fragment{ @Override public void build(Group parent){ - table.setName("inventory"); + table.name = "inventory"; table.setTransform(true); parent.setTransform(true); parent.addChild(table); @@ -90,7 +90,7 @@ public class BlockInventoryFragment extends Fragment{ table.clearListeners(); table.update(null); }), Actions.visible(false)); - table.touchable(Touchable.disabled); + table.touchable = Touchable.disabled; tile = null; } @@ -103,7 +103,7 @@ public class BlockInventoryFragment extends Fragment{ table.clearChildren(); table.clearActions(); table.background(Tex.inventory); - table.touchable(Touchable.enabled); + table.touchable = Touchable.enabled; table.update(() -> { if(state.isMenu() || tile == null || !tile.isValid() || !tile.block().isAccessible() || emptyTime >= holdShrink){ @@ -209,7 +209,7 @@ public class BlockInventoryFragment extends Fragment{ updateTablePosition(); - table.visible(true); + table.visible = true; if(actions){ table.setScale(0f, 1f); diff --git a/core/src/mindustry/ui/fragments/ChatFragment.java b/core/src/mindustry/ui/fragments/ChatFragment.java index c1e780e144..71709a9173 100644 --- a/core/src/mindustry/ui/fragments/ChatFragment.java +++ b/core/src/mindustry/ui/fragments/ChatFragment.java @@ -131,8 +131,8 @@ public class ChatFragment extends Table{ float spacing = chatspace; - chatfield.visible(shown); - fieldlabel.visible(shown); + chatfield.visible = shown; + fieldlabel.visible = shown; Draw.color(shadowColor); Draw.alpha(shadowColor.a * opacity); diff --git a/core/src/mindustry/ui/fragments/FadeInFragment.java b/core/src/mindustry/ui/fragments/FadeInFragment.java index e34f234c46..e82bc75c68 100644 --- a/core/src/mindustry/ui/fragments/FadeInFragment.java +++ b/core/src/mindustry/ui/fragments/FadeInFragment.java @@ -16,7 +16,7 @@ public class FadeInFragment extends Fragment{ parent.addChild(new Element(){ { setFillParent(true); - touchable(Touchable.disabled); + this.touchable = Touchable.disabled; } @Override diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index eb5f94dbae..df8ac3c4d0 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -69,14 +69,14 @@ public class HudFragment extends Fragment{ //paused table parent.fill(t -> { - t.top().visible(() -> state.isPaused() && !state.isOutOfTime()).touchable(Touchable.disabled); + t.top().visible(() -> state.isPaused() && !state.isOutOfTime()).touchable = Touchable.disabled; t.table(Styles.black5, top -> top.add("$paused").style(Styles.outlineLabel).pad(8f)).growX(); }); //TODO tear this all down //menu at top left parent.fill(cont -> { - cont.setName("overlaymarker"); + cont.name = "overlaymarker"; cont.top().left(); if(mobile){ @@ -189,7 +189,7 @@ public class HudFragment extends Fragment{ //fps display cont.table(info -> { - info.touchable(Touchable.disabled); + info.touchable = Touchable.disabled; info.top().left().margin(4).visible(() -> Core.settings.getBool("fps") && shown); info.update(() -> info.setTranslation(state.rules.waves || state.isEditor() ? 0f : -Scl.scl(dsize * 4 + 3), 0)); IntFormat fps = new IntFormat("fps"); @@ -221,7 +221,7 @@ public class HudFragment extends Fragment{ //spawner warning parent.fill(t -> { - t.touchable(Touchable.disabled); + t.touchable = Touchable.disabled; t.table(Styles.black, c -> c.add("$nearpoint") .update(l -> l.setColor(Tmp.c1.set(Color.white).lerp(Color.scarlet, Mathf.absin(Time.time(), 10f, 1f)))) .get().setAlignment(Align.center, Align.center)) @@ -235,7 +235,7 @@ public class HudFragment extends Fragment{ //'core is under attack' table parent.fill(t -> { - t.touchable(Touchable.disabled); + t.touchable = Touchable.disabled; float notifDuration = 240f; float[] coreAttackTime = {0}; float[] coreAttackOpacity = {0}; @@ -250,7 +250,7 @@ public class HudFragment extends Fragment{ return false; } - t.getColor().a = coreAttackOpacity[0]; + t.color.a = coreAttackOpacity[0]; if(coreAttackTime[0] > 0){ coreAttackOpacity[0] = Mathf.lerpDelta(coreAttackOpacity[0], 1f, 0.1f); }else{ @@ -262,7 +262,7 @@ public class HudFragment extends Fragment{ return coreAttackOpacity[0] > 0; }); t.table(Tex.button, top -> top.add("$coreattack").pad(2) - .update(label -> label.getColor().set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time(), 2f, 1f)))).touchable(Touchable.disabled); + .update(label -> label.color.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time(), 2f, 1f)))).touchable(Touchable.disabled); }); //paused table for when the player is out of time @@ -324,7 +324,7 @@ public class HudFragment extends Fragment{ showHudText = false; } }); - p.touchable(Touchable.disabled); + p.touchable = Touchable.disabled; }); //TODO DEBUG: rate table @@ -519,7 +519,7 @@ public class HudFragment extends Fragment{ public void showLaunchDirect(){ Image image = new Image(); - image.getColor().a = 0f; + image.color.a = 0f; image.setFillParent(true); image.actions(Actions.fadeIn(launchDuration / 60f, Interp.pow2In), Actions.delay(8f / 60f), Actions.remove()); Core.scene.add(image); @@ -527,7 +527,7 @@ public class HudFragment extends Fragment{ public void showLaunch(){ Image image = new Image(); - image.getColor().a = 0f; + image.color.a = 0f; image.setFillParent(true); image.actions(Actions.fadeIn(40f / 60f)); image.update(() -> { @@ -540,8 +540,8 @@ public class HudFragment extends Fragment{ public void showLand(){ Image image = new Image(); - image.getColor().a = 1f; - image.touchable(Touchable.disabled); + image.color.a = 1f; + image.touchable = Touchable.disabled; image.setFillParent(true); image.actions(Actions.fadeOut(0.8f), Actions.remove()); image.update(() -> { @@ -614,11 +614,11 @@ public class HudFragment extends Fragment{ }); table.clearChildren(); - table.touchable(Touchable.enabled); + table.touchable = Touchable.enabled; StringBuilder builder = new StringBuilder(); - table.setName("waves"); + table.name = "waves"; table.labelWrap(() -> { builder.setLength(0); builder.append(wavef.get(state.wave)); diff --git a/core/src/mindustry/ui/fragments/LoadingFragment.java b/core/src/mindustry/ui/fragments/LoadingFragment.java index 8af45aa79c..da666cbf98 100644 --- a/core/src/mindustry/ui/fragments/LoadingFragment.java +++ b/core/src/mindustry/ui/fragments/LoadingFragment.java @@ -18,8 +18,8 @@ public class LoadingFragment extends Fragment{ @Override public void build(Group parent){ parent.fill(Styles.black8, t -> { - t.visible(false); - t.touchable(Touchable.enabled); + t.visible = false; + t.touchable = Touchable.enabled; t.add().height(133f).row(); t.add(new WarningBar()).growX().height(24f); t.row(); @@ -37,12 +37,12 @@ public class LoadingFragment extends Fragment{ public void setProgress(Floatp progress){ bar.reset(0f); - bar.visible(true); + bar.visible = true; bar.set(() -> ((int)(progress.get() * 100) + "%"), progress, Pal.accent); } public void setButton(Runnable listener){ - button.visible(true); + button.visible = true; button.getListeners().remove(button.getListeners().size - 1); button.clicked(listener); } @@ -58,19 +58,19 @@ public class LoadingFragment extends Fragment{ public void show(String text){ table.