diff --git a/mod.hjson b/mod.hjson index 424729f..94e7ca6 100644 --- a/mod.hjson +++ b/mod.hjson @@ -30,6 +30,6 @@ author: ''' Port: 00SunRay00 & RE2b2m22 ''' minGameVersion: 157 -version: 2.1.2 +version: 2.1.3 hidden: true main: scheme.Main diff --git a/src/java/scheme/Main.java b/src/java/scheme/Main.java index 3e625ec..16f6871 100644 --- a/src/java/scheme/Main.java +++ b/src/java/scheme/Main.java @@ -43,7 +43,7 @@ public void init() { MessageQueue.load(); RainbowTeam.load(); SBinding.load(); - new com.xpdustry.claj.client.Main().init(); + if(mods.getMod("claj") == null || !mods.getMod("claj").enabled())new com.xpdustry.claj.client.Main().init(); ui.schematics = schemas; ui.listfrag = listfrag; diff --git a/src/java/scheme/ServerIntegration.java b/src/java/scheme/ServerIntegration.java index 117d132..161f2d0 100644 --- a/src/java/scheme/ServerIntegration.java +++ b/src/java/scheme/ServerIntegration.java @@ -3,6 +3,7 @@ import arc.Core; import arc.Events; import arc.struct.IntMap; +import arc.util.Log; import arc.util.Strings; import arc.util.Time; import mindustry.game.EventType.*; @@ -47,18 +48,28 @@ public static void load() { }); netServer.addPacketHandler("MySubtitle", (target, args) -> { - SSUsers.put(target.id, args); - IntMap single = new IntMap<>(1); - single.put(target.id, args); - Call.clientPacketReliable("Subtitles", JsonIO.write(single)); - - if (SSUsers.size > 1) { - Call.clientPacketReliable(target.con, "Subtitles", JsonIO.write(SSUsers)); + try { + if (args != null && args.length() > 256) return; + SSUsers.put(target.id, args); + IntMap single = new IntMap<>(1); + single.put(target.id, args); + Call.clientPacketReliable("Subtitles", JsonIO.write(single)); + + if (SSUsers.size > 1) { + Call.clientPacketReliable(target.con, "Subtitles", JsonIO.write(SSUsers)); + } + } catch (Exception e) { + Log.warn("Invalid MySubtitle packet from @", target.name, e); } }); netServer.addBinaryPacketHandler("schemesize.available", (player, data) -> { - Call.clientBinaryPacketReliable(player.con, "schemesize.available", data); + try { + if (data == null || data.length > 64) return; + Call.clientBinaryPacketReliable(player.con, "schemesize.available", data); + } catch (Exception e) { + Log.warn("Invalid schemesize.available packet from @", player.name, e); + } }); // endregion @@ -68,23 +79,38 @@ public static void load() { Events.run(ClientPreConnectEvent.class, ServerIntegration::clear); netClient.addPacketHandler("SendMeSubtitle", args -> { - Call.serverPacketReliable("MySubtitle", settings.getString("subtitle")); - if (args != null) hostID = Strings.parseInt(args, -1); + try { + Call.serverPacketReliable("MySubtitle", settings.getString("subtitle")); + if (args != null) hostID = Strings.parseInt(args, -1); + } catch (Exception e) { + Log.warn("Invalid SendMeSubtitle packet", e); + } }); netClient.addPacketHandler("Subtitles", args -> { - IntMap received = JsonIO.read(IntMap.class, args); - for (var entry : received) { - if (entry.value == null || entry.value.isEmpty()) SSUsers.remove(entry.key); - else SSUsers.put(entry.key, entry.value); + try { + if (args == null || args.isEmpty()) return; + IntMap received = JsonIO.read(IntMap.class, args); + if (received == null) return; + for (var entry : received) { + if (entry.value == null || entry.value.isEmpty()) SSUsers.remove(entry.key); + else SSUsers.put(entry.key, entry.value); + } + hasData = true; + } catch (Exception e) { + Log.warn("Invalid Subtitles packet", e); } - hasData = true; }); netClient.addBinaryPacketHandler("schemesize.available", (data) -> { - schemeAvailable = true; - DisabledTools.clear(); - DisabledTools.set(data); + try { + if (data == null || data.length == 0) return; + schemeAvailable = true; + DisabledTools.clear(); + DisabledTools.set(data); + } catch (Exception e) { + Log.warn("Invalid schemesize.available packet", e); + } }); Events.on(WorldLoadEndEvent.class, e -> { diff --git a/src/java/scheme/moded/ModedDesktopInput.java b/src/java/scheme/moded/ModedDesktopInput.java index 6253da1..e362ed1 100644 --- a/src/java/scheme/moded/ModedDesktopInput.java +++ b/src/java/scheme/moded/ModedDesktopInput.java @@ -19,6 +19,7 @@ import mindustry.input.*; import mindustry.input.Placement.NormalizeDrawResult; import mindustry.input.Placement.NormalizeResult; +import mindustry.gen.Building; import mindustry.gen.Mechc; import scheme.tools.DisabledTools; import mindustry.world.Block; @@ -47,6 +48,7 @@ public class ModedDesktopInput extends DesktopInput implements ModedInputHandler public Vec2 shootXY = new Vec2(); public boolean ctrlMove; public Vec2 mi2uMove = new Vec2(); + public Building forceTapped = null; @Override protected void removeSelection(int x1, int y1, int x2, int y2, int maxLength) { @@ -98,6 +100,15 @@ public void drawTop() { drawCommanded(); + if (settings.getBool("forceTapTile") && block == null && !scene.hasMouse()) { + Vec2 vec = input.mouseWorld(getMouseX(), getMouseY()); + Building build = world.buildWorld(vec.x, vec.y); + if (build != null && build.team != player.team()) { + build.drawSelect(); + if (!build.enabled && build.block.drawDisabled) build.drawDisabled(); + } + } + Draw.reset(); } @@ -151,6 +162,17 @@ public void update() { if (scene.hasKeyboard()) return; + if (input.keyTap(Binding.select) && !scene.hasMouse() && corefrag.choosesNode) corefrag.trySetNode(tileX(getMouseX()), tileY(getMouseY())); + + if (settings.getBool("forceTapTile") && input.keyTap(Binding.select) && !scene.hasMouse()) { + if (player.dead()) { + var build = world.buildWorld(input.mouseWorldX(), input.mouseWorldY()); + forceTap(build, true); + } else { + forceTap(prevSelected == null ? null : prevSelected.build, false); + } + } + modedInput(); buildInput(); @@ -334,6 +356,41 @@ public void move(Vec2 movement) { mi2uMove.set(movement); } + private void forceTap(Building build, boolean includeSelfTeam) { + if (build == null) return; + if (!includeSelfTeam && build.interactable(player.team())) return; + + if (build == forceTapped) { + inv.hide(); + config.hideConfig(); + forceTapped = null; + return; + } + + var ptm = state.playtestingMap; + state.playtestingMap = state.map; + + if (build.block.configurable) { + if ((!config.isShown() && build.shouldShowConfigure(player)) + || (config.isShown() && config.getSelected().onConfigureBuildTapped(build))) { + config.showConfig(build); + } + } else if (!config.hasConfigMouse()) { + if (config.isShown() && config.getSelected().onConfigureBuildTapped(build)) { + config.hideConfig(); + } + } + + if (build.block.synthetic() && build.block.allowConfigInventory) { + if (build.block.hasItems && build.items.total() > 0) { + inv.showFor(build); + } + } + + forceTapped = build; + state.playtestingMap = ptm; + } + @Override public void clear() { ctrlBoost = false; diff --git a/src/java/scheme/moded/ModedMobileInput.java b/src/java/scheme/moded/ModedMobileInput.java index 2f9bd85..3f6f20a 100644 --- a/src/java/scheme/moded/ModedMobileInput.java +++ b/src/java/scheme/moded/ModedMobileInput.java @@ -13,6 +13,7 @@ import mindustry.gen.Mechc; import mindustry.gen.Player; import mindustry.gen.Unit; +import mindustry.gen.Building; import mindustry.input.*; import mindustry.input.Placement.NormalizeResult; import mindustry.world.blocks.power.PowerNode; @@ -39,6 +40,7 @@ public class ModedMobileInput extends MobileInput implements ModedInputHandler, public Vec2 shootXY = new Vec2(); public boolean ctrlMove; public Vec2 mi2uMove = new Vec2(); + public Building forceTapped = null; private boolean isRelease() { return lastTouched && !input.isTouched(0); @@ -89,6 +91,14 @@ else if (mode == rebuildSelect) drawEditSelection(lastX, lastY, build.size); drawCommanded(); + + if (settings.getBool("forceTapTile") && !scene.hasMouse()) { + var build = world.buildWorld(input.mouseWorldX(), input.mouseWorldY()); + if (build != null && build.team != player.team()) { + build.drawSelect(); + if (!build.enabled && build.block.drawDisabled) build.drawDisabled(); + } + } } @Override @@ -114,6 +124,13 @@ public void update() { if (input.isTouched(0) && !scene.hasMouse()) observed = null; } + if (isTap() && !scene.hasMouse() && corefrag.choosesNode) corefrag.trySetNode(tileX(), tileY()); + + if (settings.getBool("forceTapTile") && isTap() && !scene.hasMouse()) { + var build = world.buildWorld(input.mouseWorldX(), input.mouseWorldY()); + forceTap(build, player.dead()); + } + buildInput(); if (movementLocked) { if (player.unit() == null) return; @@ -265,6 +282,41 @@ public void move(Vec2 movement) { mi2uMove.set(movement); } + private void forceTap(Building build, boolean includeSelfTeam) { + if (build == null) return; + if (!includeSelfTeam && build.interactable(player.team())) return; + + if (build == forceTapped) { + inv.hide(); + config.hideConfig(); + forceTapped = null; + return; + } + + var ptm = state.playtestingMap; + state.playtestingMap = state.map; + + if (build.block.configurable) { + if ((!config.isShown() && build.shouldShowConfigure(player)) + || (config.isShown() && config.getSelected().onConfigureBuildTapped(build))) { + config.showConfig(build); + } + } else if (!config.hasConfigMouse()) { + if (config.isShown() && config.getSelected().onConfigureBuildTapped(build)) { + config.hideConfig(); + } + } + + if (build.block.synthetic() && build.block.allowConfigInventory) { + if (build.block.hasItems && build.items.total() > 0) { + inv.showFor(build); + } + } + + forceTapped = build; + state.playtestingMap = ptm; + } + @Override public void clear() { ctrlBoost = false; diff --git a/src/java/scheme/tools/BuildingTools.java b/src/java/scheme/tools/BuildingTools.java index eed4978..854b3c7 100644 --- a/src/java/scheme/tools/BuildingTools.java +++ b/src/java/scheme/tools/BuildingTools.java @@ -19,6 +19,8 @@ import mindustry.type.Item; import mindustry.world.Block; import mindustry.world.Tile; +import mindustry.world.blocks.environment.Prop; +import mindustry.world.blocks.environment.StaticWall; import mindustry.world.modules.ItemModule; import scheme.Main; @@ -40,13 +42,17 @@ public class BuildingTools { public Cons iterator; public Block iterated; public int ibsize; + public TileLayer tileLayer; + + public boolean schemesAllowed; public BuildingTools() { this.input = m_input.asHandler(); this.useful = Seq.with(Mode.drop, Mode.replace, Mode.remove, Mode.connect); Events.on(WorldLoadEvent.class, event -> { - if (settings.getBool("hardscheme")) state.rules.schematicsAllowed = true; + schemesAllowed = state.rules.schematicsAllowed; + if (settings.getBool("hardscheme") && !net.client()) state.rules.schematicsAllowed = true; }); } @@ -72,13 +78,39 @@ public void replace(int x, int y) { if (block() == null) return; Tile tile = world.tile(x, y); - if (tile == null || tile.build == null) return; + if (tile == null) return; + + if (block().isFloor() && !block().isOverlay()) { + iterated = tile.floor(); + if (iterated == null || block() == iterated) return; + tileLayer = TileLayer.floor; + try { iterateTile(tile); } catch (Throwable e) { Main.error(e); } + return; + } + + if (block().isOverlay()) { + iterated = tile.overlay(); + if (iterated == null || block() == iterated) return; + tileLayer = TileLayer.overlay; + try { iterateTile(tile); } catch (Throwable e) { Main.error(e); } + return; + } + if (block() instanceof Prop || block() instanceof StaticWall || block() == mindustry.content.Blocks.removeWall) { + iterated = tile.block(); + if (!(iterated instanceof Prop) && !(iterated instanceof StaticWall)) return; + if (block() == iterated) return; + tileLayer = TileLayer.block; + try { iterateTile(tile); } catch (Throwable e) { Main.error(e); } + return; + } + + if (tile.build == null) return; iterator = build -> plan(build.tileX(), build.tileY(), build.rotation); iterated = tile.block(); ibsize = iterated.size; - try { // StackOverflowException was here + try { if (block().size == iterated.size && block() != iterated) iterate(tile); } catch (Throwable e) { Main.error(e); } } @@ -96,7 +128,7 @@ public void remove(int x, int y) { private void iterate(Tile tile){ if (tile.block() != iterated) return; - + int bx = tile.build.tileX(), by = tile.build.tileY(); if (plan.contains(plan -> plan.x == bx && plan.y == by)) return; iterator.get(tile.build); @@ -107,6 +139,25 @@ private void iterate(Tile tile){ for (int y = by - ibsize + 1; y <= by + ibsize - 1; y += ibsize) iterate(world.tile(bx - ibsize, y)); } // bruhness is everywhere bruhness is everywhere bruhness is everywhere bruhness is everywhere bruhness + private Block tileBlockAt(Tile tile) { + if (tileLayer == TileLayer.floor) return tile.floor(); + if (tileLayer == TileLayer.overlay) return tile.overlay(); + return tile.block(); + } + + private void iterateTile(Tile tile) { + if (tile == null) return; + if (tileBlockAt(tile) != iterated) return; + if (plan.contains(p -> p.x == tile.x && p.y == tile.y)) return; + + plan(tile.x, tile.y, 0); + + iterateTile(world.tile(tile.x + 1, tile.y)); + iterateTile(world.tile(tile.x - 1, tile.y)); + iterateTile(world.tile(tile.x, tile.y + 1)); + iterateTile(world.tile(tile.x, tile.y - 1)); + } + public void connect(int x, int y, Cons2 callback) { if (block() == null) return; @@ -206,4 +257,8 @@ private Block block() { public enum Mode { none, drop, replace, remove, connect, fill, square, circle, pick, edit, brush; } + + public enum TileLayer { + floor, overlay, block; + } } diff --git a/src/java/scheme/tools/RendererTools.java b/src/java/scheme/tools/RendererTools.java index f245f88..ef14ab7 100644 --- a/src/java/scheme/tools/RendererTools.java +++ b/src/java/scheme/tools/RendererTools.java @@ -79,12 +79,10 @@ public void draw() { } drawBar(unit, 3f, Pal.darkishGray, 1f); - drawBar(unit, 3f, Pal.health, Mathf.clamp(unit.healthf())); + drawBar(unit, 3f, Pal.health, Mathf.clamp(unit.health)); - if (!state.rules.unitAmmo) return; - - drawBar(unit, -3f, unit.type.ammoType.color(), 1f); - drawBar(unit, -3f, Pal.darkishGray, 1f - Mathf.clamp(unit.ammof())); + drawBar(unit, -3f, Pal.accent, 1f); + drawBar(unit, -3f, Pal.darkishGray, 1f - Mathf.clamp(unit.shield)); })); if (unitRadius) Draw.draw(Layer.overlayUI, () -> units.each(unit -> Drawf.circles(unit.x, unit.y, unit.range(), unit.team.color))); diff --git a/src/java/scheme/tools/admins/Internal.java b/src/java/scheme/tools/admins/Internal.java index 6ecdcb8..d1353f3 100644 --- a/src/java/scheme/tools/admins/Internal.java +++ b/src/java/scheme/tools/admins/Internal.java @@ -184,14 +184,21 @@ public void brush(int x, int y, int radius) { public void flush(Seq plans) { plans.each(plan -> { - if (plan.block.isFloor() && !plan.block.isOverlay()) - edit(plan.block, null, null, null, plan.x, plan.y); - else if (plan.block instanceof Prop || plan.block instanceof StaticWall) - edit(null, plan.block, null, null, plan.x, plan.y); - else if (plan.block.isOverlay()) - edit(null, null, plan.block, null, plan.x, plan.y); - else if (plan.block instanceof Block) - edit(null, null, null, plan.block, plan.x, plan.y); + Tile t = world.tile(plan.x, plan.y); + if (t == null) return; + if (plan.block.isFloor() && !plan.block.isOverlay()) { + if (t.floor() != plan.block) t.setFloorNet(plan.block, t.overlay()); + } else if (plan.block instanceof Prop || plan.block instanceof StaticWall) { + if (t.block() != plan.block) t.setNet(plan.block); + } else if (plan.block.isOverlay()) { + if (t.overlay() != plan.block) t.setFloorNet(t.floor(), plan.block); + } else if (plan.block == Blocks.removeWall) { + if (!t.block().hasBuilding()) t.setNet(Blocks.air, player.team(), 0); + } else if (plan.block == Blocks.removeOre) { + t.setFloorNet(t.floor(), null); + } else if (t.block() != plan.block) { + t.setNet(plan.block, player.team(), 0); + } }); } diff --git a/src/java/scheme/tools/admins/Mindurka.java b/src/java/scheme/tools/admins/Mindurka.java index 451aa66..df4bb04 100644 --- a/src/java/scheme/tools/admins/Mindurka.java +++ b/src/java/scheme/tools/admins/Mindurka.java @@ -67,7 +67,7 @@ public void manageTeamRuleStr(int teamId, String value, String name) { public void manageUnit() { if (unusable()) return; unit.select(false, true, false, (target, team, unit, amount) -> { - send("unit", unit.id, "#" + target.id); + send("unit", unit.name, "#" + target.id); units.refresh(); }); } @@ -76,23 +76,27 @@ public void spawnUnits() { if (unusable()) return; unit.select(true, false, true, (target, team, unit, amount) -> { if (amount == 0f) { - send("despawn"); + if(unit!=null) send("despawntype",unit.name); + else send("depsawn"); return; } - send("spawn", unit.id, amount.intValue(), team.id); + send("spawn", unit.name, amount.intValue(), team.id); units.refresh(); }); } public void manageEffect() { if (unusable()) return; - effect.select(true, true, false, (target, team, effect, amount) -> send("effect", effect.id, amount.intValue() / 60, "#" + target.id)); + effect.select(true, true, false, (target, team, effect, amount) -> { + if (target.unit() != null) send("effect", effect.name, amount.intValue() / 60, target.unit().id); + else send("effect", effect.name, amount.intValue() / 60); + }); } public void manageItem() { if (unusable()) return; - item.select(true, false, true, (target, team, item, amount) -> send("give", item.id, amount.intValue(), team.id)); + item.select(true, false, true, (target, team, item, amount) -> send("give", item.name, amount.intValue(), team.id)); } public void manageTeam() { @@ -123,7 +127,8 @@ public void placeCore() { public void despawn(Player target) { if (unusable()) return; - send("despawn", "#" + target.id); + if (target.unit() != null) send("despawn",target.team().id, "#" + target.unit().id); + else if(target==null) send("despawn"); } public void teleport(Position pos) { @@ -176,16 +181,57 @@ public void edit(Floor floorPlace, Block blockPlace, Floor overlayPlace, Block b public void flush(Seq plans) { if (unusable()) return; - plans.each(plan -> { - if (plan.block.isFloor() && !plan.block.isOverlay()) - edit(plan.block.asFloor(), null, null, null, plan.x, plan.y); - else if (plan.block instanceof Prop || plan.block instanceof StaticWall) - edit(null, plan.block, null, null, plan.x, plan.y); - else if (plan.block.isOverlay()) - edit(null, null, plan.block.asFloor(), null, plan.x, plan.y); - else if (plan.block instanceof Block) - edit(null, null, null, plan.block, plan.x, plan.y); - }); + + var groups = new java.util.LinkedHashMap>(); + for (int i = 0; i < plans.size; i++) { + BuildPlan plan = plans.get(i); + String blockId, floorId, overlayId; + if (plan.block.isFloor() && !plan.block.isOverlay()) { + blockId = "null"; floorId = id(plan.block); overlayId = "null"; + } else if (plan.block instanceof Prop || plan.block instanceof StaticWall) { + blockId = id(plan.block); floorId = "null"; overlayId = "null"; + } else if (plan.block.isOverlay()) { + blockId = "null"; floorId = "null"; overlayId = id(plan.block); + } else { + blockId = id(plan.block); floorId = "null"; overlayId = "null"; + } + String key = blockId + " " + floorId + " " + overlayId; + groups.computeIfAbsent(key, k -> new Seq<>()).add(new int[]{plan.x, plan.y}); + } + + for (var entry : groups.entrySet()) { + String[] params = entry.getKey().split(" "); + Seq points = entry.getValue(); + + points.sort((a, b) -> a[1] != b[1] ? a[1] - b[1] : a[0] - b[0]); + + Seq segs = new Seq<>(); + int i = 0; + while (i < points.size) { + int sx = points.get(i)[0], sy = points.get(i)[1], ex = sx; + while (i + 1 < points.size && points.get(i + 1)[1] == sy && points.get(i + 1)[0] == ex + 1) { + ex = points.get(++i)[0]; + } + segs.add(new int[]{sx, sy, ex - sx, 0}); + i++; + } + + for (int j = 0; j < segs.size; j++) { + int[] s = segs.get(j); + for (int k = j + 1; k < segs.size; ) { + int[] n = segs.get(k); + if (n[0] == s[0] && n[2] == s[2] && n[1] == s[1] + s[3] + 1) { + s[3] = n[1] - s[1]; + segs.remove(k); + } else k++; + } + } + + for (int j = 0; j < segs.size; j++) { + int[] s = segs.get(j); + sendPacket("schemesize.fill", params[0], 0, params[1], params[2], s[0], s[1], s[2], s[3]); + } + } } public boolean unusable() { diff --git a/src/java/scheme/ui/CoreInfoFragment.java b/src/java/scheme/ui/CoreInfoFragment.java index 2946748..11bbe56 100644 --- a/src/java/scheme/ui/CoreInfoFragment.java +++ b/src/java/scheme/ui/CoreInfoFragment.java @@ -124,8 +124,13 @@ public void build(Group parent) { }, true, () -> !timer.check(0, 240f)); } - public void trySetNode(int x, int y) { - if (choosesNode && power.setNode(world.build(x, y))) choosesNode = false; + public boolean trySetNode(int x, int y) { + if (!choosesNode) return false; + if (power.setNode(world.build(x, y))) { + choosesNode = false; + return true; + } + return false; } public void nextLayer() { diff --git a/src/java/scheme/ui/HudFragment.java b/src/java/scheme/ui/HudFragment.java index 5fcd737..f6b1713 100644 --- a/src/java/scheme/ui/HudFragment.java +++ b/src/java/scheme/ui/HudFragment.java @@ -17,10 +17,12 @@ import arc.scene.ui.layout.*; import arc.struct.Seq; import arc.util.Align; +import arc.util.Log; import arc.util.Scaling; import arc.util.Time; import mindustry.Vars; import mindustry.game.EventType.*; +import mindustry.game.Rules; import mindustry.gen.Icon; import mindustry.gen.Tex; import mindustry.gen.Unit; @@ -40,6 +42,7 @@ import static mindustry.Vars.*; import static scheme.SchemeVars.*; import static scheme.ai.GammaAI.Updater.*; +import static scheme.tools.admins.AdminsTools.restricted; public class HudFragment { @@ -209,6 +212,7 @@ public void build(Group parent) { if (mobile) return; else { cont.button("@schematics", Icon.paste, Styles.squareTogglet, () -> { + if(net.client() && !build.schemesAllowed) {ui.showInfoFade(restricted); return;} // not on servers if (shortfrag.visible) shortfrag.hide(); else shortfrag.show(graphics.getWidth() - (int) Scl.scl(15f), graphics.getHeight() / 2); }).size(155f, 50f).margin(8f).checked(t -> shortfrag.visible) diff --git a/src/java/scheme/ui/dialogs/RuleSetterDialog.java b/src/java/scheme/ui/dialogs/RuleSetterDialog.java index 6b9bae6..cae18fd 100644 --- a/src/java/scheme/ui/dialogs/RuleSetterDialog.java +++ b/src/java/scheme/ui/dialogs/RuleSetterDialog.java @@ -207,6 +207,7 @@ private FieldCell check(Table t, String key, boolean value, arc.func.Boolc onCha String label = bundle.has(key) ? bundle.get(key) : key; Cell cell = t.check(label, value, val -> { onChange.get(val); + rebuild(); }).pad(6).left(); t.row(); return new FieldCell(cell); @@ -226,6 +227,7 @@ public void keyboardFocusChanged(FocusListener.FocusEvent event, arc.scene.Eleme if (!focused && field.isValid()) { float f = Strings.parseFloat(field.getText(), value); onChange.get(f); + rebuild(); } } }); @@ -248,6 +250,7 @@ public void keyboardFocusChanged(FocusListener.FocusEvent event, arc.scene.Eleme if (!focused && field.isValid()) { int i = Strings.parseInt(field.getText(), value); onChange.get(i); + rebuild(); } } }); diff --git a/src/java/scheme/ui/dialogs/SettingsMenuDialog.java b/src/java/scheme/ui/dialogs/SettingsMenuDialog.java index abebb86..9ceb134 100644 --- a/src/java/scheme/ui/dialogs/SettingsMenuDialog.java +++ b/src/java/scheme/ui/dialogs/SettingsMenuDialog.java @@ -23,6 +23,7 @@ public SettingsMenuDialog() { table.checkPref("hardscheme", false); table.checkPref("approachenabled", true); table.checkPref("welcome", false); // no oce care + table.checkPref("forceTapTile", false); table.checkPref("check4update", true); table.areaTextPref("subtitle", "I am using Scheme Size btw"); diff --git a/src/resources/bundles/bundle.properties b/src/resources/bundles/bundle.properties index fcb76e0..b475910 100644 --- a/src/resources/bundles/bundle.properties +++ b/src/resources/bundles/bundle.properties @@ -50,6 +50,8 @@ setting.mobilebuttons.name = Mobile Buttons setting.mobilebuttons.description = Restart required to apply changes. setting.hardscheme.name = Schematics Always Allowed setting.hardscheme.description = Allows schematics even if they are disabled in the current game.\nYou may be kicked/banned in certain servers. +setting.forceTapTile.name = Force Cross-team Interaction +setting.forceTapTile.description = Allows interacting with buildings of other teams (view config, inventory). setting.approachenabled.name = Notify about Approaching Wave setting.approachenabled.description = You can also find out some information about the wave in this notification. setting.welcome.name = Show Welcome Message diff --git a/src/resources/bundles/bundle_ru.properties b/src/resources/bundles/bundle_ru.properties index e2bbf27..f201f03 100644 --- a/src/resources/bundles/bundle_ru.properties +++ b/src/resources/bundles/bundle_ru.properties @@ -50,6 +50,8 @@ setting.mobilebuttons.name = Мобильные кнопки setting.mobilebuttons.description = Требуется перезагрузка для применения изменений. setting.hardscheme.name = Схемы всегда разрешены setting.hardscheme.description = Позволяет использовать схемы, даже если они отключены в текущей игре.\nВас могут выгнать/забанить на некоторых серверах. +setting.forceTapTile.name = Взаимодействие с чужими зданиями +setting.forceTapTile.description = Позволяет взаимодействовать со зданиями других команд (просмотр конфига, инвентаря). setting.approachenabled.name = Уведомлять о приближении волны setting.approachenabled.description = Вы также можете узнать немного информации о волне в этом уведомлении. setting.welcome.name = Показать приветственное сообщение