Skip to content

Commit 59cd97d

Browse files
committed
feat(editor): add scene2d rotation overview navigation (v2.0.6)
1 parent 46b5287 commit 59cd97d

4 files changed

Lines changed: 50 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [2.0.6] - 2026-04-05
6+
7+
### Added
8+
- **Scene2D Rotation Overview:** `CustomGameEditor.java` now builds a clickable rotation overview strip with per-rotation occupied-cell counts, allowing direct selection instead of only cycling next/previous.
9+
10+
### Changed
11+
- Bumped `VERSION.md` to `2.0.6`.
12+
13+
### Validation
14+
- `./gradlew compileJava`
15+
516
## [2.0.5] - 2026-04-05
617

718
### Added

HANDOFF.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ This session focused on the newer Scene2D `CustomGameEditor` so the Java port ha
4747
- Added duplicate-piece and duplicate-rotation actions to the Scene2D custom editor.
4848
- Bumped the Java repo version again to `2.0.5`.
4949

50+
### Additional Follow-Up - 2026-04-05 (Rotation Overview)
51+
- Added clickable rotation overview buttons with occupied-cell counts to the Scene2D custom editor.
52+
- Bumped the Java repo version again to `2.0.6`.
53+
5054
### Recommended Next Steps
5155
1. Add color/block-type controls to the Scene2D editor.
5256
2. Bridge Scene2D custom editor state into the older TWL editor stack where useful.

VERSION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.5
1+
2.0.6

src/main/java/com/bobsgame/client/engine/game/gui/customGameEditor/CustomGameEditor.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public class CustomGameEditor extends Scene2DPanel {
3131
private final Label rotationLabel;
3232
private final Label summaryLabel;
3333
private final Label hintLabel;
34+
private final Label rotationOverviewLabel;
35+
private final Table rotationOverviewTable;
3436

3537
private final GameType currentGameType = new GameType();
3638
private int selectedPieceIndex = -1;
@@ -51,6 +53,8 @@ public CustomGameEditor(Engine engine) {
5153
rotationLabel = new Label("Rotation: none", skin);
5254
summaryLabel = new Label("No custom piece data yet.", skin);
5355
hintLabel = new Label("Build piece shapes with the 4x4 grid. Add pieces and rotations to sketch rules live.", skin);
56+
rotationOverviewLabel = new Label("Rotation Overview", skin);
57+
rotationOverviewTable = new Table();
5458
hintLabel.setWrap(true);
5559
summaryLabel.setWrap(true);
5660

@@ -187,6 +191,8 @@ public void clicked(InputEvent event, float x, float y) {
187191
mainTable.add(pieceLabel).left().row();
188192
mainTable.add(rotationLabel).left().row();
189193
mainTable.add(gridTable).left().padTop(8).row();
194+
mainTable.add(rotationOverviewLabel).left().padTop(8).row();
195+
mainTable.add(rotationOverviewTable).left().row();
190196
mainTable.add(summaryLabel).width(520).left().padTop(10).row();
191197

192198
addPiece();
@@ -380,6 +386,33 @@ private Piece.Rotation getSelectedRotation() {
380386
return pieceType.rotationSet.get(selectedRotationIndex);
381387
}
382388

389+
private void rebuildRotationOverview(PieceType pieceType) {
390+
rotationOverviewTable.clearChildren();
391+
if (pieceType == null || pieceType.rotationSet == null || pieceType.rotationSet.size() == 0) {
392+
rotationOverviewTable.add(new Label("No rotations yet.", engine.uiSkin)).left();
393+
return;
394+
}
395+
396+
rotationOverviewTable.defaults().pad(4);
397+
for (int i = 0; i < pieceType.rotationSet.size(); i++) {
398+
final int rotationIndex = i;
399+
final Piece.Rotation rotation = pieceType.rotationSet.get(i);
400+
String prefix = (rotationIndex == selectedRotationIndex) ? "> " : "";
401+
TextButton button = new TextButton(prefix + "R" + rotationIndex + " (" + getFilledCellCount(rotation) + ")", engine.uiSkin);
402+
button.addListener(new ClickListener() {
403+
@Override
404+
public void clicked(InputEvent event, float x, float y) {
405+
selectedRotationIndex = rotationIndex;
406+
refreshEditorState();
407+
}
408+
});
409+
rotationOverviewTable.add(button).left();
410+
if ((i + 1) % 4 == 0) {
411+
rotationOverviewTable.row();
412+
}
413+
}
414+
}
415+
383416
private int getFilledCellCount(Piece.Rotation rotation) {
384417
return rotation == null ? 0 : rotation.blockOffsets.size();
385418
}
@@ -398,6 +431,7 @@ private void refreshEditorState() {
398431

399432
pieceLabel.setText(pieceType == null ? "Piece: none" : "Piece: " + pieceType.name + " (" + (selectedPieceIndex + 1) + "/" + currentGameType.pieceTypes.size() + ")");
400433
rotationLabel.setText(rotation == null ? "Rotation: none" : "Rotation: " + selectedRotationIndex + " (" + getFilledCellCount(rotation) + " blocks)");
434+
rebuildRotationOverview(pieceType);
401435

402436
for (int y = 0; y < 4; y++) {
403437
for (int x = 0; x < 4; x++) {

0 commit comments

Comments
 (0)