Skip to content

Commit 1fe6bd6

Browse files
committed
Add image import, pattern fill, and palette sync features
Introduces 'Import Image to Tileset' for BMP/PNG import, pattern fill from tileset selection in MapCanvas, random sprite export, and a grid layout for Sprite Editor frames. Palette operations are now synchronized across all tileset palettes. Also includes performance improvements for Redo, updates versioning to 0.1.2, and various bug fixes and documentation updates.
1 parent 17d9ee8 commit 1fe6bd6

12 files changed

Lines changed: 645 additions & 91 deletions

File tree

.github/workflows/build.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Java CI with Gradle
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
submodules: recursive
20+
21+
- name: Set up JDK 21
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: '21'
25+
distribution: 'temurin'
26+
27+
- name: Setup Gradle
28+
uses: gradle/actions/setup-gradle@v3
29+
30+
- name: Grant execute permission for gradlew
31+
run: chmod +x gradlew
32+
33+
- name: Build with Gradle Wrapper
34+
run: ./gradlew build

CHANGELOG.md

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

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

5+
## [0.1.2] - 2025-12-25
6+
7+
### Added
8+
- **Import Image to Tileset**: New feature in `Tileset Tools` menu allowing users to import BMP/PNG images directly into the tileset. Supports appending or overwriting, and automatically matches or adds colors to the palette.
9+
- **Pattern Fill**: `MapCanvas` now supports filling a selection with a pattern from the tileset selection (tiling).
10+
- **Random Sprite Export**: Added "Export Random Sprites" to Sprite Editor to export sprites marked as random.
11+
- **Grid Layout**: Sprite Editor now displays frames in a responsive grid layout instead of a single line.
12+
- **Palette Synchronization**: Implemented synchronized sorting and color addition across all tileset palettes to maintain consistency when modifying the master palette.
13+
14+
### Changed
15+
- **Optimized Redo**: Improved performance of the Redo operation in `MapCanvas`.
16+
- **Documentation**: Updated `dashboard.md`, `LLM_INSTRUCTIONS.md`, and `ROADMAP.md`.
17+
- **Versioning**: Project now references `VERSION.md`.
18+
19+
### Fixed
20+
- Fixed `GameSave.java` compilation errors (previous session).
21+
- Fixed `SEFrameCanvas` painting logic.
22+
523
## [0.1.1] - 2025-12-25
624

725
### Fixed

VERSION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.1
1+
0.1.2

docs/todo.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ only copy enabled layers a-ctrl-shift-c
1010

1111
fill undo on load map
1212

13-
redo faster
13+
redo faster - done
1414

15-
paste into selection from tileset
15+
paste into selection from tileset - done
1616

17-
sprite editor lay out frames in grid
17+
sprite editor lay out frames in grid - done
1818

19-
need random sprite output.
19+
need random sprite output. - done
2020

21-
also need to import bmp to tiles that would be nice
21+
also need to import bmp to tiles that would be nice - done
2222

23-
palette synchronize for all tilesets (sort add colors.. easy)
23+
palette synchronize for all tilesets (sort add colors.. easy) - done
2424
need merge maps/tilesets/palettes into one.
2525

2626
make undo better/not wrap around/skip

src/main/java/com/bobsgame/EditorMain.java

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public static void main(String[] args) {
8282
insertTilesetRows,
8383
findFirstMapWithSelectedTile,
8484
listDoorsThatAreBroken,
85+
importImageToTileset,
8586

8687

8788

@@ -211,7 +212,7 @@ public static void main(String[] args) {
211212
public EditorMain()
212213
{//===============================================================================================
213214

214-
super("bgEdit 20170623");
215+
super("bgEdit v0.1.2");
215216

216217

217218

@@ -597,6 +598,10 @@ public EditorMain()
597598
listDoorsThatAreBroken.addActionListener(this);
598599
listDoorsThatAreBroken.setEnabled(true);
599600

601+
importImageToTileset = new JMenuItem("Import Image to Tileset...");
602+
importImageToTileset.addActionListener(this);
603+
importImageToTileset.setEnabled(true);
604+
600605

601606
//tilesetMenu.add(newTileset);
602607
//tilesetMenu.add(renameTileset);
@@ -625,6 +630,7 @@ public EditorMain()
625630
tilesetMenu.add(findFirstMapWithSelectedTile);
626631
tilesetMenu.add(setBlankTilesToSelectedColor);
627632
tilesetMenu.add(listDoorsThatAreBroken);
633+
tilesetMenu.add(importImageToTileset);
628634

629635

630636

@@ -1620,6 +1626,7 @@ public void moveMapUp()
16201626
mapCanvas.setSizedoLayout();
16211627

16221628
mapCanvas.updateAndRepaintAllLayerImagesIntoMapCanvasImageAndRepaintMapCanvas();
1629+
mapCanvas.fillUndoArray();
16231630
}
16241631
//===============================================================================================
16251632
public void moveMapDown()
@@ -1642,6 +1649,7 @@ public void moveMapDown()
16421649
mapCanvas.setSizedoLayout();
16431650

16441651
mapCanvas.updateAndRepaintAllLayerImagesIntoMapCanvasImageAndRepaintMapCanvas();
1652+
mapCanvas.fillUndoArray();
16451653
}
16461654

16471655
//===============================================================================================
@@ -1675,6 +1683,7 @@ public void moveStateUp()
16751683
mapCanvas.setSizedoLayout();
16761684

16771685
mapCanvas.updateAndRepaintAllLayerImagesIntoMapCanvasImageAndRepaintMapCanvas();
1686+
mapCanvas.fillUndoArray();
16781687
}
16791688
//===============================================================================================
16801689
public void moveStateDown()
@@ -1706,6 +1715,7 @@ public void moveStateDown()
17061715
mapCanvas.setSizedoLayout();
17071716

17081717
mapCanvas.updateAndRepaintAllLayerImagesIntoMapCanvasImageAndRepaintMapCanvas();
1718+
mapCanvas.fillUndoArray();
17091719
}
17101720

17111721
//===============================================================================================
@@ -1729,6 +1739,7 @@ public void duplicateState()
17291739
mapCanvas.setSizedoLayout();
17301740

17311741
mapCanvas.updateAndRepaintAllLayerImagesIntoMapCanvasImageAndRepaintMapCanvas();
1742+
mapCanvas.fillUndoArray();
17321743
}
17331744

17341745
//===============================================================================================
@@ -1752,6 +1763,7 @@ public void duplicateMap()
17521763
mapCanvas.setSizedoLayout();
17531764

17541765
mapCanvas.updateAndRepaintAllLayerImagesIntoMapCanvasImageAndRepaintMapCanvas();
1766+
mapCanvas.fillUndoArray();
17551767
}
17561768

17571769
//===============================================================================================
@@ -1861,6 +1873,7 @@ public void newProject()
18611873
mapCanvas.zoomOut();
18621874
mapCanvas.zoomIn();
18631875
mapCanvas.updateAndRepaintAllLayerImagesIntoMapCanvasImageAndRepaintMapCanvas();
1876+
mapCanvas.fillUndoArray();
18641877

18651878
}
18661879
}
@@ -1891,6 +1904,7 @@ public void appendNewMap()
18911904
mapCanvas.setSizedoLayout();
18921905

18931906
mapCanvas.updateAndRepaintAllLayerImagesIntoMapCanvasImageAndRepaintMapCanvas();
1907+
mapCanvas.fillUndoArray();
18941908

18951909
}
18961910

@@ -1917,6 +1931,7 @@ public void newState()
19171931
mapCanvas.setSizedoLayout();
19181932

19191933
mapCanvas.updateAndRepaintAllLayerImagesIntoMapCanvasImageAndRepaintMapCanvas();
1934+
mapCanvas.fillUndoArray();
19201935

19211936
}
19221937

@@ -1933,6 +1948,7 @@ public void newPalette()
19331948
tileCanvas.updateAllTiles();
19341949
tileCanvas.paint();
19351950
mapCanvas.updateAndRepaintAllLayerImagesIntoMapCanvasImageAndRepaintMapCanvas();
1951+
mapCanvas.fillUndoArray();
19361952

19371953
}
19381954

@@ -2063,6 +2079,7 @@ public void openProject(String s)
20632079
mapCanvas.zoomOut();
20642080
mapCanvas.zoomIn();
20652081
mapCanvas.updateAndRepaintAllLayerImagesIntoMapCanvasImageAndRepaintMapCanvas();
2082+
mapCanvas.fillUndoArray();
20662083

20672084

20682085

@@ -2165,6 +2182,7 @@ public void mapChoice()
21652182

21662183
//definitely have to update everything
21672184
mapCanvas.updateAndRepaintAllLayerImagesIntoMapCanvasImageAndRepaintMapCanvas();
2185+
mapCanvas.fillUndoArray();
21682186

21692187
//start all mapsprite animation timers
21702188
for(int n=0;n<Project.getSelectedMap().getNumEntities();n++)
@@ -2220,6 +2238,7 @@ public void stateChoice()
22202238

22212239
//definitely have to update everything
22222240
mapCanvas.updateAndRepaintAllLayerImagesIntoMapCanvasImageAndRepaintMapCanvas();
2241+
mapCanvas.fillUndoArray();
22232242

22242243
//start all mapsprite animation timers
22252244
for(int n=0;n<Project.getSelectedMap().getNumEntities();n++)
@@ -2249,6 +2268,7 @@ public void paletteChoice()
22492268

22502269
//definitely have to update everything
22512270
mapCanvas.updateAndRepaintAllLayerImagesIntoMapCanvasImageAndRepaintMapCanvas();
2271+
mapCanvas.fillUndoArray();
22522272

22532273
}
22542274
}
@@ -2302,6 +2322,7 @@ public void actionPerformed(ActionEvent ae)
23022322

23032323
else if(ae.getSource() == duplicatePalette)duplicatePalette();
23042324
else if(ae.getSource() == insertTilesetRows)Project.tileset.insertTilesetRows(this);
2325+
else if(ae.getSource() == importImageToTileset)Project.tileset.importImageToTileset(this);
23052326
else if(ae.getSource() == deleteMap)deleteMap();
23062327
else if(ae.getSource() == deletePalette)deletePalette();
23072328
else if(ae.getSource() == viewZoomIn)mapCanvas.zoomIn();
@@ -2414,7 +2435,14 @@ public void keyPressed(KeyEvent ke)
24142435

24152436
if(ke.getKeyCode() == KeyEvent.VK_C && ke.isControlDown())
24162437
{
2417-
mapCanvas.mapSelectionArea.copy();
2438+
if(ke.isShiftDown())
2439+
{
2440+
mapCanvas.mapSelectionArea.copyEnabledLayers();
2441+
}
2442+
else
2443+
{
2444+
mapCanvas.mapSelectionArea.copy();
2445+
}
24182446
}
24192447

24202448

0 commit comments

Comments
 (0)