Commit Graph

57 Commits

Author SHA1 Message Date
Benjamin Popp
807d276d34 Implement flipping
Also make dragging / copy / paste work correctly for 16-bit images (like intro-oak)
2020-11-25 12:12:19 -06:00
Benjamin Popp
cf60efb5cd Allow image editor to edit shiny palettes 2020-11-24 22:16:42 -06:00
Benjamin Popp
92751d5812 Add support for selection movement in tilemaps
When moving blocks around within a tilemap, there's no easy way to guarantee that the user is moving in tile increments, and multilpe tiles may employ different palettes.

As such, conisder that moving a block around moves the *index* of the palette being used, not the color. This will mostly work as expected, but can cause colors to change as they enter or exit regions that use different palettes.
2020-11-24 22:13:36 -06:00
Benjamin Popp
7387a45374 Implement eyedropper behavior for tilemaps
* Only allow eyedropper to do 1x1, 2x2, 4x4, or 8x8 regions.
* If eyedropper does a region smaller than 8x8, only allow it to work on tiles that use that palette.
* If eyedropper does a region 8x8 (or 8x8 tile is selected), allow it to work on tiles that use any palette.
2020-11-23 20:13:33 -06:00
Benjamin Popp
cbf52e4eb5 Implement more tilemap editing support
* can edit palettes for tiles
* can draw in valid tiles only (can't draw if the tile has a different palette)
* can bucket in valid tiles only
* eyedropper switches to the correct palette
2020-11-15 22:32:04 -06:00
Benjamin Popp
a1591219eb Draft support for tilemap palette editing
Doesn't actually work yet, but this includes the core tests, logic, and UI.
2020-11-14 21:21:33 -06:00
Benjamin Popp
28603e4ae7 Fix bug in fill algorithm
Fill needs to use the palette-index-plus-palette-page value to set the parent.pixels, but needs to use just palette-index when picking the color to fill the parent.PixelData.
2020-11-10 22:09:39 -06:00
Benjamin Popp
2bf3792b2f Implement multi-page sprite import
Import now works for wide/tall images, where all the pages of an image are stored in the same image.
2020-11-07 22:29:39 -06:00
Benjamin Popp
3476e4d98f Usability improvements
Update mini-sprite when palette changes
Update tooltips in palette tool
Update icon colors in image editor
2020-11-04 21:52:21 -06:00
Benjamin Popp
e417496c20 Fix some image editor bugs
Also add some tables / scripts found by Fred / Phoenix
2020-11-04 21:05:49 -06:00
Benjamin Popp
90253ac3ea Add color mixer
* Fix a few crashes
* Provide a tooltip for the image editor tab header (the name of the first element in the dropdown)
* Add a color mixer into the image editor, which is a free palette that you can use for whatever you want. It's not tied to the game data, it isn't saved anywhere when you exit, but you can play with the colors freely and it's shared between all image editors for the life of the app.
* If you open the mixer in one tab, it'll be open in other tabs.
* Press delete to clear a color
2020-10-30 23:26:13 -05:00
Benjamin Popp
77a5383471 Add support for editing multiple images in the image editor 2020-10-23 22:32:37 -05:00
Benjamin Popp
f5f79385d0 Fix right-click during fill tool 2020-10-22 21:18:16 -05:00
Benjamin Popp
296598c9df Allow disjoint selection
This changes the way we handle selection. Thing can no longer only care about the selection start/end: they have to check each element to see if it's selected.
2020-10-17 22:49:59 -05:00
Benjamin Popp
b7889abcd2 Allow for copying blocks using grab tool
You can now select larger regions to copy at will, whether with the draw or the grab tool.
2020-10-17 21:59:19 -05:00
Benjamin Popp
83c458cb0f Allow non-square selections from eyedropper 2020-10-17 00:24:13 -05:00
Benjamin Popp
a48ed064fc Make palette control more aware of repoints
This requires that the palette control recognize a pointer to the current palette, instead of just the address of the current palette. But since palettes can't be used by the game without a pointer, it's reasonable that there will always be a pointer for any palette being edited.
* Update table tool / sprite tool / image editor palette addresses when palettes get repointed.
2020-10-15 22:21:43 -05:00
Benjamin Popp
b0b7a769d9 Updates from usability testing
Fix zoom limits
Fix selection move limits
Fix issue with 0 draw size when hovering with draw tool
Add tooltip for lz compression start token
Import from default TOML files on version upgrade.
Goto -> potion -> should work
File -> Save -> should work from image editor
Don't double-include the current table as a "related table" when searching for palette tables for a sprite.
2020-10-13 20:51:16 -05:00
Benjamin Popp
958f8d5432 Make buttons for horizontal / vertical flip 2020-10-10 20:24:05 -05:00
Benjamin Popp
51c808523b Add core logic for vertical/horizontal flips 2020-10-07 22:12:31 -05:00
Benjamin Popp
b4ae694e11 Implement the easy cases for sprite copy/paste
If all the colors are in the original image, it works perfectly.

If not all the colors are in the original image, the non-existing colors are replaced with 'transparent'. This needs to be improved with cautious/smart/lazy options.
2020-10-07 21:34:05 -05:00
Benjamin Popp
3a87de086f allow larger zoom 2020-10-06 22:18:06 -05:00
Benjamin Popp
841d32fe1b Allow editing of 256-color image with 16-color palettes
example: new game professor
2020-10-06 21:18:52 -05:00
Benjamin Popp
f0870a7d1b bugfix: allow panning based on pixel height 2020-10-06 07:24:45 -05:00
Benjamin Popp
22a4982295 Keep selection after undo 2020-10-06 07:00:10 -05:00
Benjamin Popp
e9794d61c5 fix crash
don't crash when filling with a reverse-gradient (start after end)
2020-10-06 06:59:56 -05:00
Benjamin Popp
14a7f129ec Add UI for switching sprite / palette pages in the tool 2020-10-03 23:29:31 -05:00
Benjamin Popp
4136ae8df8 Implement ViewModel for switching pages directly from the Image Editor 2020-10-03 08:21:24 -05:00
Benjamin Popp
36a3ff1b4e Support editing later palettes
useful for multi-palette images like the frontier pass image, or type icons, or castform
2020-10-02 22:48:55 -05:00
Benjamin Popp
f8cdbce616 ImageEditor -> allow editing other pages of a sprite 2020-10-01 22:04:38 -05:00
Benjamin Popp
eeeef17c8d Add test to show that palette relocation works with the image editor
This is implemented via the palette collection, so the image editor gets it for free.
2020-09-28 22:37:43 -05:00
Benjamin Popp
0b70b2bb7b Zoom In / Zoom out buttons and shortcuts 2020-09-27 22:48:53 -05:00
Benjamin Popp
615f172619 Add gradient fill
Gradient fill as a circle around the selected start point, using selected colors ranging from the first-to-last selected colors.
2020-09-21 22:05:28 -05:00
Benjamin Popp
407db89b00 Allow drawing blocks of a color via the draw tool 2020-09-20 21:41:52 -05:00
Benjamin Popp
9268275d83 Improve eyedropper selection UI
allow eyedropper to show selection during drag operations
show the selected block that we can draw
2020-09-18 22:38:56 -05:00
Benjamin Popp
d130eac740 Image Editor UI Improvements
* Use icons and tooltips in the buttons
* Use keyboard shortcuts
2020-09-17 22:39:52 -05:00
Benjamin Popp
8e232761ca Hover over a palette color shows where that color is used 2020-09-17 15:49:36 -05:00
Benjamin Popp
b69541a590 Improve Undo experience
Undo causes refresh
Tool interactions cause discrete undo actions
Fill tool shows selection
2020-09-17 14:34:22 -05:00
Benjamin Popp
6279ab41c3 Improve performance of ShowSelectionRect 2020-09-17 08:01:22 -05:00
Benjamin Popp
052434250e don't switch tool when selecting new palette colors during fill tool 2020-09-16 21:48:03 -05:00
Benjamin Popp
5685dfaaad Fix layout rounding / add middle-click pan 2020-09-16 21:45:07 -05:00
Benjamin Popp
5411c746c2 Draw selection when draw tool selected 2020-09-15 22:20:44 -05:00
Benjamin Popp
1044d69c80 Refresh from model updates pixels 2020-09-15 21:11:26 -05:00
Benjamin Popp
42ce843496 Selection and Eyedropper updates
- selection rect updates mid selection
- eyedropper left-click tool works
- can draw blocks with draw tool after eyedropper grab
2020-09-15 20:44:52 -05:00
Benjamin Popp
536bfdad2a Refactor: Strategy Pattern 2020-09-15 15:24:49 -05:00
Benjamin Popp
f08fba9134 Implement selection
pixels under current selection are remembered
2020-09-15 13:19:42 -05:00
Benjamin Popp
aadec6eb6a start working on selection 2020-09-14 19:39:47 -05:00
Benjamin Popp
396c2c8ca8 Start looking at hover rect during draw 2020-09-14 11:54:20 -05:00
Benjamin Popp
19cd7420c9 Draw improvements 2020-09-14 08:13:17 -05:00
Benjamin Popp
1726f98c9c Make tool work if content repoints
Also, notify the UI after drawing pixels
2020-09-13 22:20:07 -05:00