diff --git a/assets/bundles/bundle.properties b/assets/bundles/bundle.properties index f7d7936..7caea7a 100644 --- a/assets/bundles/bundle.properties +++ b/assets/bundles/bundle.properties @@ -25,6 +25,7 @@ mapInfo.buttons.bannedBlocks = Banned Blocks mapInfo.buttons.bannedUnits = Banned Units mapInfo.buttons.hiddenBuildItems = Hidden Build Items mapInfo.buttons.revealedBlocks = Revealed Blocks +mapInfo.buttons.objectives = Map Objectives mapInfo.buttons.objectiveFlags = Objective Flags mapInfo.buttons.mapTags = Map Tags mapInfo.buttons.expand = Expand diff --git a/assets/bundles/bundle_zh_CN.properties b/assets/bundles/bundle_zh_CN.properties index 73bed27..11b61f5 100644 --- a/assets/bundles/bundle_zh_CN.properties +++ b/assets/bundles/bundle_zh_CN.properties @@ -25,6 +25,7 @@ mapInfo.buttons.bannedBlocks = 禁用的建筑 mapInfo.buttons.bannedUnits = 禁用的单位 mapInfo.buttons.hiddenBuildItems = 隐藏的建材 mapInfo.buttons.revealedBlocks = 显示的建筑 +mapInfo.buttons.objectives = 地图游戏目标 mapInfo.buttons.objectiveFlags = 地图目标Flag mapInfo.buttons.mapTags = 地图Tag mapInfo.buttons.expand = 展开 diff --git a/src/mi2u/MI2UVars.java b/src/mi2u/MI2UVars.java index 1978340..5c3a218 100644 --- a/src/mi2u/MI2UVars.java +++ b/src/mi2u/MI2UVars.java @@ -1,6 +1,9 @@ package mi2u; +import arc.Core; import arc.func.*; +import arc.math.geom.QuadTree; +import arc.math.geom.Rect; import arc.scene.style.*; import arc.scene.ui.*; import arc.scene.ui.TextButton.*; @@ -9,8 +12,12 @@ import mi2u.ai.*; import mi2u.ui.*; import mi2u.ui.elements.*; +import mi2u.uiExtend.*; import mindustry.ui.*; +import static mindustry.Vars.state; +import static mindustry.Vars.ui; + public class MI2UVars{ public static float titleButtonSize = 32f; public static TextButtonStyle textb = Styles.flatt, textbtoggle = Styles.flatTogglet; @@ -23,6 +30,7 @@ public class MI2UVars{ public static Drawable fadeBackground; public static Seq mindow2s = new Seq<>(); + public static QuadTree snapTables = new QuadTree<>(new Rect(0, 0, Core.scene.getWidth(), Core.scene.getHeight())); public static FullAI fullAI = new FullAI(); @@ -31,4 +39,22 @@ public class MI2UVars{ public static CoreInfoMindow coreInfo = new CoreInfoMindow(); public static LogicHelperMindow logicHelper = new LogicHelperMindow(); public static MinimapMindow mindowmap = new MinimapMindow(); + + public static Seq windows = new Seq<>(); + public static TestTable1 testTable1 = new TestTable1(); + public static TestTable2 testTable2 = new TestTable2(); + public static TestTable3 testTable3 = new TestTable3(); + public static TestTable4 testTable4 = new TestTable4(); + + + public static void initTables(){ + testTable1.addTo(Core.scene.root); + testTable1.visible(() -> state.isGame() && ui.hudfrag.shown); + testTable2.addTo(Core.scene.root); + testTable2.visible(() -> state.isGame() && ui.hudfrag.shown); + testTable3.addTo(Core.scene.root); + testTable3.visible(() -> state.isGame() && ui.hudfrag.shown); + testTable4.addTo(Core.scene.root); + testTable4.visible(() -> state.isGame() && ui.hudfrag.shown); + } } diff --git a/src/mi2u/MI2Utilities.java b/src/mi2u/MI2Utilities.java index 4f3f6d0..4deb657 100644 --- a/src/mi2u/MI2Utilities.java +++ b/src/mi2u/MI2Utilities.java @@ -12,8 +12,10 @@ import mi2u.input.*; import mi2u.ui.*; import mi2u.ui.elements.*; +import mindustry.core.Logic; import mindustry.game.EventType.*; import mindustry.gen.*; +import mindustry.maps.Map; import mindustry.mod.*; import mindustry.ui.*; @@ -75,6 +77,8 @@ public MI2Utilities(){ mindowmap.visible(() -> state.isGame() && ui.hudfrag.shown); if(mi2ui.settings.getBool("showLogicHelper")) logicHelper.addTo(logicHelper.hasParent() ? logicHelper.parent : ui.logic); + MI2UVars.initTables(); + RendererExt.initBase(); ModifyFuncs.modifyVanilla(); BuildingStatsPopup.init(); @@ -84,6 +88,11 @@ public MI2Utilities(){ Time.runTask(140f, () -> { if(mi2ui.settings.getBool("enableUpdate")) checkUpdate(); }); + + Time.runTask(200f, () -> { + Map map = maps.loadInternalMap("caldera"); + control.playMap(map, map.rules()); + }); }); Events.on(FileTreeInitEvent.class, e -> Core.app.post(MI2UShaders::load)); diff --git a/src/mi2u/ui/MapInfoTable.java b/src/mi2u/ui/MapInfoTable.java index c084605..2638426 100644 --- a/src/mi2u/ui/MapInfoTable.java +++ b/src/mi2u/ui/MapInfoTable.java @@ -24,6 +24,8 @@ import mindustry.ui.dialogs.*; import mindustry.world.*; +import java.util.Arrays; + import static mi2u.MI2UVars.*; import static mi2u.struct.UnitsData.*; import static mindustry.Vars.*; @@ -411,18 +413,33 @@ public void setupDetailAttsInfo(){ }); }).with(funcSetTextb).disabled(b -> state.rules.bannedUnits.isEmpty()); - tt.row(); - tt.button("@mapInfo.buttons.revealedBlocks", textb, () -> { showIterable("@mapInfo.buttons.revealedBlocks", state.rules.revealedBlocks, null, (block, table) -> { table.image(block.uiIcon).size(32f); }); }).with(funcSetTextb).disabled(b -> state.rules.revealedBlocks.isEmpty()); + tt.row(); + + tt.button("@mapInfo.buttons.objectives", textb, () -> { + showIterable("@mapInfo.buttons.objectives", state.rules.objectives, null, (objective, table) -> { + table.table(obj -> { + int idx = state.rules.objectives.all.indexOf(objective); + obj.left().label(() -> "[" + idx + "]" + objective.typeName()).growX().row(); + obj.table(info -> { + info.label(() -> (objective.hidden? "": "[lightgray]") + "Hidden: " + objective.hidden).growX().row(); + info.label(() -> (objective.qualified()? "": "[lightgray]") + "Qualified: " + objective.qualified()).growX().row(); + if (objective.flagsAdded.length != 0) info.label(() -> "Added Flags: " + Arrays.toString(objective.flagsAdded)).growX().row(); + if (objective.flagsRemoved.length != 0) info.label(() -> "Removed Flags: " + Arrays.toString(objective.flagsRemoved)).growX().row(); + }).growX().padLeft(8f); + }).left().growX().padTop(4f).padBottom(4f); + }, 1); + }).with(funcSetTextb).disabled(b -> state.rules.objectives.all.isEmpty()); + tt.button("@mapInfo.buttons.objectiveFlags", textb, () -> { showIterable("@mapInfo.buttons.objectiveFlags", state.rules.objectiveFlags, null, (str, table) -> { - table.add(str).size(48f); - }); + table.add(str).size(0, 32f); + }, 1); }).with(funcSetTextb).disabled(b -> state.rules.objectiveFlags.isEmpty()); tt.button("@mapInfo.buttons.mapTags", textb, () -> { @@ -504,7 +521,7 @@ public void setupDetailAttsInfo(){ }); } - public void showIterable(String title, Iterable array, Boolf boolf, Cons2 cons){ + public void showIterable(String title, Iterable array, Boolf boolf, Cons2 cons, int itemPerRow){ attrsListPopup.clear(); attrsListPopup.setBackground(Styles.black3); attrsListPopup.touchable = Touchable.enabled; @@ -519,8 +536,8 @@ public void showIterable(String title, Iterable array, Boolf boolf, Co int index = 0; for(T item : array){ if(boolf != null && !boolf.get(item)) continue; - cont.table(t -> cons.get(item, t)); - if(++index >= 8){ + cont.table(t -> cons.get(item, t)).growX(); + if(++index >= itemPerRow){ index = 0; cont.row(); } @@ -538,6 +555,10 @@ public void showIterable(String title, Iterable array, Boolf boolf, Co attrsListPopup.toFront(); } + public void showIterable(String title, Iterable array, Boolf boolf, Cons2 cons){ + showIterable(title, array, boolf, cons, 8); + } + public class WaveBar extends Table{ MI2Bar bar; Table table; diff --git a/src/mi2u/uiExtend/SnapElement.java b/src/mi2u/uiExtend/SnapElement.java new file mode 100644 index 0000000..99f07a1 --- /dev/null +++ b/src/mi2u/uiExtend/SnapElement.java @@ -0,0 +1,193 @@ +package mi2u.uiExtend; + +import arc.input.KeyCode; +import arc.math.geom.QuadTree; +import arc.math.geom.Rect; +import arc.scene.Element; +import arc.scene.ui.layout.Table; +import arc.struct.Queue; +import arc.struct.Seq; +import arc.util.Align; +import arc.util.Log; +import arc.util.Tmp; +import mi2u.MI2UVars; + +import java.util.Arrays; + +import static arc.Core.input; +import static arc.util.Align.*; +import static arc.util.Align.bottom; + +public class SnapElement extends Table implements QuadTree.QuadTreeObject { + public static final float snapRange = 32f; + + public boolean dragging = false; + public float snapX = -1, snapY = -1; + public float hoverTime = 0f; + /** + * Returns the X position of the specified {@link Align alignment}. + */ + @Override + public float getX(int alignment){ + float x = this.x; + if((alignment & right) != 0) + x += width * scaleX; + else if((alignment & left) == 0) // + x += width * scaleX / 2; + return x; + } + + /** + * Returns the Y position of the specified {@link Align alignment}. + */ + @Override + public float getY(int alignment){ + float y = this.y; + if((alignment & top) != 0) + y += height * scaleY; + else if((alignment & bottom) == 0) // + y += height * scaleY / 2; + return y; + } + + @Override + public void setPosition(float x, float y, int alignment){ + if((alignment & right) != 0) + x -= width * scaleX; + else if((alignment & left) == 0) // + x -= width * scaleX / 2; + + if((alignment & top) != 0) + y -= height * scaleY; + else if((alignment & bottom) == 0) // + y -= height * scaleY / 2; + + if(this.x != x || this.y != y){ + this.x = x; + this.y = y; + } + } + + public void innerElementSnap(Element element){ + if (element == null) return; + if (Math.abs(leftBound(this) - leftBound(element)) < snapRange) snapX = leftBound(element); + if (Math.abs(bottomBound(this) - bottomBound(element)) < snapRange) snapY = bottomBound(element); + if (Math.abs(topBound(this) - topBound(element)) < snapRange) snapY = topBound(element) - height(this); + if (Math.abs(rightBound(this) - rightBound(element)) < snapRange) snapX = rightBound(element) - width(this); + } + + public void outerElementSnap(Element element){ + if (element == null) return; + if (!element.visible) return; + Tmp.r1.set(x, y, width(this), height(this)).grow(snapRange/2f); + Tmp.r2.set(element.x, element.y, width(element), height(element)).grow(snapRange/2f); + if (!Tmp.r1.overlaps(Tmp.r2)) return; + + //todo check on both dst + if (Math.abs(leftBound(this) - rightBound(element)) < snapRange) { + snapX = rightBound(element); + if (Math.abs(topBound(this) - topBound(element)) < snapRange) snapY = topBound(element) - height(this); + if (Math.abs(bottomBound(this) - bottomBound(element)) < snapRange) snapY = bottomBound(element); + } + if (Math.abs(rightBound(this) - leftBound(element)) < snapRange) { + snapX = leftBound(element) - width(this); + if (Math.abs(topBound(this) - topBound(element)) < snapRange) snapY = topBound(element) - height(this); + if (Math.abs(bottomBound(this) - bottomBound(element)) < snapRange) snapY = bottomBound(element); + } + if (Math.abs(bottomBound(this) - topBound(element)) < snapRange) { + snapY = topBound(element); + if (Math.abs(rightBound(this) - rightBound(element)) < snapRange) snapX = rightBound(element) - width(this); + if (Math.abs(leftBound(this) - leftBound(element)) < snapRange) snapX = leftBound(element); + } + if (Math.abs(topBound(this) - bottomBound(element)) < snapRange) { + snapY = bottomBound(element) - height(this); + if (Math.abs(rightBound(this) - rightBound(element)) < snapRange) snapX = rightBound(element) - width(this); + if (Math.abs(leftBound(this) - leftBound(element)) < snapRange) snapX = leftBound(element); + } + } + + public boolean isElementSnapped(Element self, Element element){ + if (element == null) return false; + if (!element.visible) return false; + Tmp.r1.set(self.x, self.y, width(self), height(self)).grow(snapRange/2f); + Tmp.r2.set(element.x, element.y, width(element), height(element)).grow(snapRange/2f); + if (!Tmp.r1.overlaps(Tmp.r2)) return false; + + return Math.abs(topBound(self) - bottomBound(element)) < snapRange/4f || + Math.abs(leftBound(self) - rightBound(element)) < snapRange/4f || + Math.abs(rightBound(self) - leftBound(element)) < snapRange/4f || + Math.abs(bottomBound(self) - topBound(element)) < snapRange/4f; + } + + public boolean isElementSnapped(Element element){ + return isElementSnapped(this, element); + } + + public Seq getAllElements() { + Seq elements = new Seq<>(); + elements.add(MI2UVars.mindow2s); + elements.add(MI2UVars.windows); + return elements; + } + + public Seq getProxySnappedElements(Element self, Seq check){ + //todo replace check with quadtree + Seq tmp = new Seq<>(); + check.each(e -> { + if (isElementSnapped(self, e)){ + tmp.add(e); + } + }); + return tmp; + } + + public void getSnappedElements(Seq out){ + Queue queue = new Queue<>(); + + out.add(this); + queue.addLast(this); + + while (!queue.isEmpty()){ + Element element = queue.removeFirst(); + for (Element proxy: getProxySnappedElements(element, getAllElements())){ + if (isElementSnapped(element, proxy) && !out.contains(proxy)){ + out.add(proxy); + queue.addLast(proxy); + } + } + } + } + + public float leftBound(Element element){ + return element.x; + } + + public float bottomBound(Element element){ + return element.y; + } + + public float rightBound(Element element){ + return element.x + element.getWidth() * element.scaleX; + } + + public float topBound(Element element){ + return element.y + element.getHeight() * element.scaleY; + } + + public float width(Element element){ + return element.getWidth() * element.scaleX; + } + + public float height(Element element){ + return element.getHeight() * element.scaleY; + } + + public void updateDragging(){ + dragging = hasMouse() && input.keyDown(KeyCode.controlLeft); + } + + @Override + public void hitbox(Rect out) { + out.set(x, y, width, hoverTime); + } +} diff --git a/src/mi2u/uiExtend/SnapWindow.java b/src/mi2u/uiExtend/SnapWindow.java new file mode 100644 index 0000000..b5a4b2d --- /dev/null +++ b/src/mi2u/uiExtend/SnapWindow.java @@ -0,0 +1,228 @@ +package mi2u.uiExtend; + +import arc.Core; +import arc.Events; +import arc.input.KeyCode; +import arc.math.Mathf; +import arc.math.geom.Vec2; +import arc.scene.Element; +import arc.scene.Group; +import arc.scene.event.InputEvent; +import arc.scene.event.InputListener; +import arc.scene.event.Touchable; +import arc.scene.ui.layout.Stack; +import arc.scene.ui.layout.Table; +import arc.struct.FloatSeq; +import arc.struct.Seq; +import arc.util.Log; +import arc.util.Time; +import arc.util.Tmp; +import mi2u.MI2UTmp; +import mi2u.MI2UVars; +import mi2u.io.SettingHandler; +import mi2u.ui.elements.Mindow2; +import mindustry.Vars; +import mindustry.game.EventType; +import mindustry.gen.Icon; +import mindustry.ui.Styles; +import mindustry.ui.dialogs.BaseDialog; + +import static arc.Core.*; +import static arc.Core.camera; +import static mi2u.MI2UVars.*; + +public class SnapWindow extends SnapElement { + public Table cont = new Table(); + public SettingHandler settings; + + public SnapWindow(String name){ + this.name = name; + registerToGlobal(); + initSettings(); + loadUISettings(); + + Events.on(EventType.ResizeEvent.class, e -> Time.run(60f, () -> { + loadUISettings(); + rebuild(); + })); + + Events.on(EventType.ClientLoadEvent.class, e -> rebuild()); + + cont.setBackground(Styles.black3); + } + + public void rebuild(){ + clear(); + + cont.touchable = Touchable.enabled; + setupCont(cont); + Table overlay = new Table(); + //todo + overlay.table(t -> { + t.background(Styles.black3); + t.center().image(Icon.move).size(32f).row(); + t.label(() -> (int)snapX + "," + (int)snapY); + }).grow().visible(() -> dragging).touchable(() -> dragging? Touchable.enabled : Touchable.disabled); + overlay.addListener(new InputListener(){ + final Vec2 mousePos = new Vec2(); + final Seq snapGroup = new Seq<>(); + final FloatSeq elementDst = new FloatSeq(); + @Override + public boolean touchDown(InputEvent event, float x, float y, int pointer, KeyCode button) { + snapGroup.clear(); + elementDst.clear(); + + mousePos.set(x, y); + if (button == KeyCode.mouseLeft){ + snapGroup.add(SnapWindow.this); + elementDst.add(0, 0); + return true; + } + if (button == KeyCode.mouseMiddle){ + getSnappedElements(snapGroup); + for (Element e : snapGroup){ + elementDst.add(e.x - SnapWindow.this.x, e.y - SnapWindow.this.y); + } + return true; + } + if (button == KeyCode.mouseRight){ + showSettings(); + return false; + } + return false; + } + + @Override + public void touchDragged(InputEvent event, float x, float y, int pointer) { + Vec2 v = localToStageCoordinates(MI2UTmp.v1.set(x, y)).sub(mousePos); + for (int i = 0; i < snapGroup.size; i++){ + Element e = snapGroup.get(i); + float w = elementDst.get(i * 2); + float h = elementDst.get(i * 2 + 1); + + if (e instanceof SnapElement snapElement){ + snapElement.snapX = v.x + w; + snapElement.snapY = v.y + h; + } + + e.x = v.x + w; + e.y = v.y + h; + } + } + + @Override + public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button) { + super.touchUp(event, x, y, pointer, button); + for (Element e : snapGroup) { + if (e instanceof SnapWindow snapWindow){ + snapWindow.setSnap(); + snapWindow.saveUISettings(); + } + } + } + }); + + Stack stack = new Stack(cont, overlay); + stack.update(this::updateDragging); + + add(stack).growX(); + + setTransform(true); + } + + /** + * called when rebuild Mindow2, should be overridden + */ + public void setupCont(Table cont){} + + @Override + public void act(float delta){ + super.act(delta); + if (!dragging){ + if (snapX >= 0f) x = Mathf.lerp(x, snapX, 0.3f); + if (snapY >= 0f) y = Mathf.lerp(y, snapY, 0.3f); + } + + keepInStage(); + invalidate(); + pack(); + } + + public void setSnap(){ + Element minimap = Vars.ui.hudGroup.find("minimap"); + outerElementSnap(minimap); + //todo use quadtree + mindow2s.each(this::outerElementSnap); + windows.each(this::outerElementSnap); + innerElementSnap(parent); + } + + public void addTo(Group newParent){ + if(newParent == null){ + this.remove(); + return; + } + newParent.addChild(this); + } + + /// Settings should be set in Seq: settings, will be shown and configurable in SettingsDialog + public void showSettings(){ + new BaseDialog("@settings.meta.dialogTitle"){ + { + addCloseButton(); + this.cont.pane(t -> { + t.button("@settings.meta.mindowHelp", Icon.info, () -> new BaseDialog(""){ + { + addCloseButton(); + this.cont.pane(t1 -> t1.add("@" + SnapWindow.this.name + ".help").padBottom(60f).left().width(graphics.getWidth() / 1.5f).get().setWrap(true)); + show(); + } + }).disabled(!bundle.has(SnapWindow.this.name + ".help")).width(300f).height(150f).get().setStyle(textb); + t.row(); + t.table(tt -> settings.buildList(tt)).width(Math.min(600, Core.graphics.getWidth())); + }).grow().row(); + this.cont.addChild(new Table(){ + { + touchable = Touchable.disabled; + update(() -> { + cont.stageToLocalCoordinates(MI2UTmp.v3.set(Core.input.mouse())); + this.setPosition(MI2UTmp.v3.x, MI2UTmp.v3.y + 100); + }); + } + }); + show(); + } + }; + } + + /// can be overridden, should use super.initSettings(), called in rebuild() + public void initSettings(){ + if(name == null || name.isEmpty()) return; + if(settings == null) settings = new SettingHandler(name); + settings.list.clear(); + var sScl = settings.sliderPref("scale", 100, 20, 400, 10, s -> s + "%", scl -> setScale(scl / 100f)); + sScl.title = bundle.get("settings.mindow.scale"); + sScl.description = bundle.getOrNull("settings.mindow.scale.description"); + } + + public void loadUISettings(){ + if(name == null || name.isEmpty()) return; + setScale(settings.getInt("scale", 100) / 100f); + x = settings.getInt("tableX", (int) (camera.width/2f)); + y = settings.getInt("tableY", (int) (camera.height/2f)); + } + + /// Override this method for custom UI settings save + public void saveUISettings(){ + if(name == null || name.isEmpty()) return; + settings.putInt("scale", (int)(scaleX * 100)); + settings.putInt("tableX", (int) snapX); + settings.putInt("tableY", (int) snapY); + } + + public void registerToGlobal(){ + if(name != null && !name.isEmpty() && !mindow2s.contains(m -> m.name.equals(this.name))){ + windows.add(this); + } + } +} diff --git a/src/mi2u/uiExtend/TestTable1.java b/src/mi2u/uiExtend/TestTable1.java new file mode 100644 index 0000000..dfba273 --- /dev/null +++ b/src/mi2u/uiExtend/TestTable1.java @@ -0,0 +1,26 @@ +package mi2u.uiExtend; + +import arc.scene.ui.layout.Table; +import mindustry.ui.Styles; + +public class TestTable1 extends SnapWindow{ + public TestTable1() { + super("test-1"); + } + + @Override + public void setupCont(Table cont) { + cont.clear(); + + cont.table(t -> { + t.pane(Styles.smallPane, table -> { + table.label(() -> "TEST LABEL 1"); + }).size(200, 150).scrollX(false); + }).maxHeight(150); + } + + @Override + public void initSettings() { + super.initSettings(); + } +} diff --git a/src/mi2u/uiExtend/TestTable2.java b/src/mi2u/uiExtend/TestTable2.java new file mode 100644 index 0000000..91b8803 --- /dev/null +++ b/src/mi2u/uiExtend/TestTable2.java @@ -0,0 +1,27 @@ +package mi2u.uiExtend; + +import arc.scene.ui.layout.Table; +import mindustry.ui.Styles; + +public class TestTable2 extends SnapWindow{ + public TestTable2() { + super("test-2"); + } + + @Override + public void setupCont(Table cont) { + cont.clear(); + + cont.table(t -> { + t.pane(Styles.smallPane, table -> { + table.label(() -> "TEST LABEL 2"); + }).size(200, 200).scrollX(false); + }).maxHeight(150); + } + + @Override + public void initSettings() { + super.initSettings(); + } +} + diff --git a/src/mi2u/uiExtend/TestTable3.java b/src/mi2u/uiExtend/TestTable3.java new file mode 100644 index 0000000..88944ad --- /dev/null +++ b/src/mi2u/uiExtend/TestTable3.java @@ -0,0 +1,27 @@ +package mi2u.uiExtend; + +import arc.scene.ui.layout.Table; +import mindustry.ui.Styles; + +public class TestTable3 extends SnapWindow{ + public TestTable3() { + super("test-3"); + } + + @Override + public void setupCont(Table cont) { + cont.clear(); + + cont.table(t -> { + t.pane(Styles.smallPane, table -> { + table.label(() -> "TEST LABEL 3"); + }).size(200, 300).scrollX(false); + }).maxHeight(150); + } + + @Override + public void initSettings() { + super.initSettings(); + } +} + diff --git a/src/mi2u/uiExtend/TestTable4.java b/src/mi2u/uiExtend/TestTable4.java new file mode 100644 index 0000000..42d76c3 --- /dev/null +++ b/src/mi2u/uiExtend/TestTable4.java @@ -0,0 +1,27 @@ +package mi2u.uiExtend; + +import arc.scene.ui.layout.Table; +import mindustry.ui.Styles; + +public class TestTable4 extends SnapWindow{ + public TestTable4() { + super("test-4"); + } + + @Override + public void setupCont(Table cont) { + cont.clear(); + + cont.table(t -> { + t.pane(Styles.smallPane, table -> { + table.label(() -> "TEST LABEL 4"); + }).size(200, 400).scrollX(false); + }).maxHeight(150); + } + + @Override + public void initSettings() { + super.initSettings(); + } +} +