summaryrefslogtreecommitdiff
path: root/src/editor/editor.h
diff options
context:
space:
mode:
authorkasull <qsullian@gmail.com>2026-03-05 11:38:03 -0500
committerkasull <qsullian@gmail.com>2026-03-05 11:38:03 -0500
commit7c8b5072d8441aa6a7da9bd7560c47ba8c41270b (patch)
tree7f3a076dd4c651047dfcea82dbf05aa90ea83ed0 /src/editor/editor.h
parent54bcabc374b438ee288964d6f6314f5da2121a0e (diff)
split UI components and make menubar data-driven
replace monolithic gui.cpp with focused editor UI component files shared editor_gui_internal.h for layout constants and cross-component helpers modular menubar rendering/input
Diffstat (limited to 'src/editor/editor.h')
-rw-r--r--src/editor/editor.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/editor/editor.h b/src/editor/editor.h
index b000816..6735d47 100644
--- a/src/editor/editor.h
+++ b/src/editor/editor.h
@@ -58,15 +58,15 @@ enum Editor2DViewType_t {
EDITOR_2DVIEW_FRONT_ELEVATION = 2
};
-enum EditorToolbarHit_t {
- EDITOR_TOOLBAR_HIT_NONE = -1,
- EDITOR_TOOLBAR_HIT_FILE = 0,
- EDITOR_TOOLBAR_HIT_EDIT = 1,
- EDITOR_TOOLBAR_HIT_VIEW = 2,
- EDITOR_TOOLBAR_HIT_TOOLS = 3,
- EDITOR_TOOLBAR_HIT_SAVE = 4,
- EDITOR_TOOLBAR_HIT_UNDO = 5,
- EDITOR_TOOLBAR_HIT_REDO = 6
+enum EditorMenubarEntryType_t {
+ EDITOR_MENUBAR_ENTRY_FUNCTION = 0,
+ EDITOR_MENUBAR_ENTRY_SUBMENU = 1
+};
+
+struct EDITOR_MENUBAR_ENTRY {
+ char text[64]{};
+ U8 type{};
+ LIST<EDITOR_MENUBAR_ENTRY> entries{};
};
struct GAME_EDITOR;
@@ -195,6 +195,10 @@ extern void editor_new_map_cb( void* );
extern void editor_create_map_view( GAME_EDITOR* e );
extern void editor_update_properties_column( GAME_EDITOR* e );
+extern const char* editor_tool_name();
+extern void editor_set_view_mode( I32 mode );
+extern void editor_toolbar_set_open( struct GUI_EDITOR_TOOLBAR* bar, U8 file_open, U8 edit_open );
+extern U8 editor_toolbar_menu_open( const struct GUI_EDITOR_TOOLBAR* bar );
extern void editor_undo_clear( GAME_EDITOR* e );
extern void editor_undo_record_create_walls( GAME_EDITOR* e, I32 start_idx, I32 count );
extern void editor_undo_record_create_poly( GAME_EDITOR* e, I32 start_idx );
@@ -281,9 +285,10 @@ struct GUI_EDITOR_VIEWTYPE_SEGMENT : GUI_BASE {
struct GUI_EDITOR_TOOLBAR : GUI_BASE {
U8 held{};
- I32 held_item{-1};
- U8 file_open{};
- U8 edit_open{};
+ I32 held_root{-1};
+ I32 held_sub{-1};
+ I32 open_root{-1};
+ LIST<EDITOR_MENUBAR_ENTRY> entries{};
};
extern GUI_EDITORWINDOW* gui_editorwindow( I32 w, I32 h );