mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-09 23:27:56 +01:00
5efeedbad9
## About The Pull Request This PR adds a universal framework for editing sprites, and adds an example implementation by way of porting paint canvases to it. This should have no impact on serializing paintings in the database. As part of this canvas refactor, zooming in and out of a canvas is now handled entirely on the client side. The paint palette component has also been refactored to allow a variable number of colors up to the specified maximum, instead of populating all color slots to start out with. Some features of the sprite editing framework are unused in this PR, as they were not necessary for feature parity with the current implementation of paintings. However, they remain present for use in future PRs, such as a PDA painting app that was separated out of this branch for atomicity. These features include: - Eraser tool - Undo history - Layers - Multi-dir icon support Support for animated icons is not present, but planned to be added when a new feature needs it. ### New Painting UI Screenshot: <img width="1210" height="596" alt="NewCanvasUiDemo" src="https://github.com/user-attachments/assets/4181745b-716b-4068-b3a2-d2491e5abf09" /> ## Why It's Good For The Game This framework opens the possibility for a wide variety of new features, such as Goofball's planned tailoring mechanic. Additionally, the consolidation of all the controls into a single window should make painting more user-friendly. ## Changelog 🆑 refactor: Painting has been significantly refactored with a new UI that should provide every painting control you need without having to unfocus the UI window. Please report any issues. refactor: Items that can store paint palettes now start with no colors. Colors can be added to and removed from the item's palette, up to the number of colors they previously stored. /🆑 --------- Co-authored-by: Jordan Dominion <dominion@tgstation13.org>
18 lines
546 B
Plaintext
18 lines
546 B
Plaintext
// Color modes
|
|
/// Full RGBA color picker
|
|
#define SPRITE_EDITOR_COLOR_MODE_RGBA "rgba"
|
|
/// RGB color picker without alpha
|
|
#define SPRITE_EDITOR_COLOR_MODE_RGB "rgb"
|
|
/// Greyscale color picker with a single value
|
|
#define SPRITE_EDITOR_COLOR_MODE_GREYSCALE "greyscale"
|
|
|
|
// Config flags
|
|
#define SPRITE_EDITOR_ALLOW_LAYERS (1<<0)
|
|
#define SPRITE_EDITOR_ALLOW_UNDO (1<<1)
|
|
|
|
// Tool flags
|
|
#define SPRITE_EDITOR_TOOL_PENCIL (1<<0)
|
|
#define SPRITE_EDITOR_TOOL_ERASER (1<<1)
|
|
#define SPRITE_EDITOR_TOOL_DROPPER (1<<2)
|
|
#define SPRITE_EDITOR_TOOL_BUCKET (1<<3)
|