mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
17bf7b3807
* new file : HistoryManager.js * can undo (ctrl-z) and redo (ctrl-y) changes performed through the tools * history states are recorded per frame * a new state is recorder each time a tool is released (introduced TOOL_RELEASED event for this purpose) * a duplicated frame doesn't inherit the history states of the original frame * there is no limit to the number of states that can be stored per frame * actions such as creating/duplicating/deleting a frame are not concerned by this update
33 lines
1.0 KiB
JavaScript
33 lines
1.0 KiB
JavaScript
Events = {
|
|
|
|
TOOL_SELECTED : "TOOL_SELECTED",
|
|
TOOL_RELEASED : "TOOL_RELEASED",
|
|
COLOR_SELECTED: "COLOR_SELECTED",
|
|
COLOR_USED: "COLOR_USED",
|
|
|
|
/**
|
|
* When this event is emitted, a request is sent to the localstorage
|
|
* Service to save the current framesheet. The storage service
|
|
* may not immediately store data (internal throttling of requests).
|
|
*/
|
|
LOCALSTORAGE_REQUEST: "LOCALSTORAGE_REQUEST",
|
|
|
|
CANVAS_RIGHT_CLICKED: "CANVAS_RIGHT_CLICKED",
|
|
CANVAS_RIGHT_CLICK_RELEASED: "CANVAS_RIGHT_CLICK_RELEASED",
|
|
|
|
/**
|
|
* Event to request a refresh of the display.
|
|
* A bit overkill but, it's just workaround in our current drawing system.
|
|
* TODO: Remove or rework when redraw system is refactored.
|
|
*/
|
|
REFRESH: "REFRESH",
|
|
|
|
/**
|
|
* The framesheet was reseted and is now probably drastically different.
|
|
* Number of frames, content of frames, color used for the palette may have changed.
|
|
*/
|
|
FRAMESHEET_RESET: "FRAMESHEET_RESET",
|
|
|
|
SHOW_NOTIFICATION: "SHOW_NOTIFICATION",
|
|
HIDE_NOTIFICATION: "HIDE_NOTIFICATION"
|
|
}; |