Move to global undo and combined map action state
This commit is contained in:
+18
-13
@@ -3,6 +3,8 @@ import Action from "../actions/Action";
|
||||
import { DrawingState } from "./Drawing";
|
||||
import { FogState } from "./Fog";
|
||||
import { Grid } from "./Grid";
|
||||
import { Notes } from "./Note";
|
||||
import { TokenStates } from "./TokenState";
|
||||
|
||||
export type MapToolId =
|
||||
| "map"
|
||||
@@ -59,18 +61,21 @@ export type FileMap = BaseMap & {
|
||||
|
||||
export type Map = DefaultMap | FileMap;
|
||||
|
||||
export type MapActions = {
|
||||
mapDrawActions: Action<DrawingState>[];
|
||||
mapDrawActionIndex: number;
|
||||
fogDrawActions: Action<FogState>[];
|
||||
fogDrawActionIndex: number;
|
||||
export type DrawingsAction = {
|
||||
type: "drawings";
|
||||
action: Action<DrawingState>;
|
||||
};
|
||||
export type FogsAction = { type: "fogs"; action: Action<FogState> };
|
||||
export type TokensAction = { type: "tokens"; action: Action<TokenStates> };
|
||||
export type NotesAction = { type: "notes"; action: Action<Notes> };
|
||||
|
||||
export type MapActionsKey = keyof Pick<
|
||||
MapActions,
|
||||
"mapDrawActions" | "fogDrawActions"
|
||||
>;
|
||||
export type MapActionsIndexKey = keyof Pick<
|
||||
MapActions,
|
||||
"mapDrawActionIndex" | "fogDrawActionIndex"
|
||||
>;
|
||||
export type MapAction =
|
||||
| DrawingsAction
|
||||
| FogsAction
|
||||
| TokensAction
|
||||
| NotesAction;
|
||||
|
||||
export type MapActions = {
|
||||
actions: MapAction[][];
|
||||
actionIndex: number;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user