Skip to content

Commit

Permalink
make buttons in hex selection movable
Browse files Browse the repository at this point in the history
  • Loading branch information
xzxADIxzx committed Jan 2, 2023
1 parent 58d8186 commit 1d7794e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mod.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ A mod that increases the schematic size limit to 512 blocks! Adds admins, render
",
author: "[#0096FF]xzxADIxzx",
minGameVersion: 140.4,
version: 2.7.9hf,
version: 2.7.10hf,
hidden: true,
main: scheme.Main
5 changes: 4 additions & 1 deletion src/java/scheme/ui/HexSelection.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ public void add(String icon, Cons<TextButton> listener) {
table.button(icon, Styles.cleart, () -> listener.get(buttons[i])).with(button -> {
buttons[i] = button;

button.setTranslation(vertices[i].x - half, vertices[i].y - half);
button.getLabel().setWrap(false); // someone can use non-single-character tags
button.update(() -> {
Vec2 offset = selectedIndex == i ? vertices[i].cpy().limit(stroke / 3f) : Vec2.ZERO;
button.setTranslation(vertices[i].x + offset.x - half, vertices[i].y + offset.y - half);
});
}).minSize(24f); // unscaled stroke;
}));
}
Expand Down

0 comments on commit 1d7794e

Please sign in to comment.