diff options
Diffstat (limited to 'src/editor/editor.h')
| -rw-r--r-- | src/editor/editor.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/editor/editor.h b/src/editor/editor.h index b506d9c..3d27951 100644 --- a/src/editor/editor.h +++ b/src/editor/editor.h @@ -36,11 +36,16 @@ enum EditorSelectType_t { enum EditorActionType_t { EDITOR_UNDO_NONE = 0, - EDITOR_UNDO_CREATE_WALLS = 1, - EDITOR_UNDO_CREATE_POLY = 2, - EDITOR_UNDO_CREATE_SPRITES = 3, - EDITOR_UNDO_CREATE_ENTITIES = 4, - EDITOR_UNDO_EDITPROPS = 5 + EDITOR_UNDO_CREATE_WALLS = 1 << 1, + EDITOR_UNDO_CREATE_POLY = 1 << 2, + EDITOR_UNDO_CREATE_SPRITES = 1 << 3, + EDITOR_UNDO_CREATE_ENTITIES = 1 << 4, + EDITOR_UNDO_EDITPROPS = 1 << 5, + EDITOR_UNDO_CREATE_MAPPROP = 1 << 6, + + + + EDITOR_UNDO_CREATE_EOBJ = EDITOR_UNDO_CREATE_WALLS | EDITOR_UNDO_CREATE_POLY | EDITOR_UNDO_CREATE_SPRITES | EDITOR_UNDO_CREATE_ENTITIES, }; enum EditorInfoBoxType_t { @@ -140,10 +145,15 @@ struct EDITOR_UNDO_CREATE { LIST<MAP_ENTITY> entities{}; }; +struct EDITOR_UNDO_MAPPROP { + MAP_PROPREF ref; +}; + struct EDITOR_UNDO_ACTION { - U8 type; + U64 typemask; EDITOR_UNDO_PROPS props; EDITOR_UNDO_CREATE create; + EDITOR_UNDO_MAPPROP mapprop; }; struct GAME_EDITOR { @@ -247,6 +257,7 @@ extern LIST<GUI_LIST_ENTRY>* editor_get_map_list( GAME_EDITOR* e ); extern void editor_load_map_cb( void* ); extern void editor_new_map_cb( void* ); +extern void editor_push_undo_action( GAME_EDITOR* e, EDITOR_UNDO_ACTION action ); extern void editor_create_map_view( GAME_EDITOR* e ); extern void editor_update_properties_column( GAME_EDITOR* e ); extern const char* editor_tool_name(); @@ -317,6 +328,7 @@ struct GUI_EDITOR_PROPVIEW : GUI_VIEW { LIST<PROPVIEW_SELECT> curselect; LIST<EDITOR_PROP*> curprops; GUI_VIEW* itemview; + EDITOR_UNDO_ACTION pending_undo; }; struct GUI_EDITOR_TOOLVIEW : GUI_VIEW { @@ -348,6 +360,7 @@ struct GUI_EDITOR_TEXTUREPICKER : GUI_WINDOW { GUI_LABEL* densitylabel; GUI_CALLBACK cb; + GUI_CALLBACK pre_cb; void* cbextra; }; |
