diff --git a/paint/assets/icons.png b/paint/assets/icons.png index 1120d14b..0ebbaab8 100755 Binary files a/paint/assets/icons.png and b/paint/assets/icons.png differ diff --git a/paint/assets/icons05x.png b/paint/assets/icons05x.png index bb4217f9..eeabcb44 100755 Binary files a/paint/assets/icons05x.png and b/paint/assets/icons05x.png differ diff --git a/paint/assets/icons2x.png b/paint/assets/icons2x.png index 0e48027e..def5e92c 100755 Binary files a/paint/assets/icons2x.png and b/paint/assets/icons2x.png differ diff --git a/paint/sources/enums.h b/paint/sources/enums.h index 0df19fc6..96864cb1 100644 --- a/paint/sources/enums.h +++ b/paint/sources/enums.h @@ -439,6 +439,18 @@ typedef enum { ICON_TERMINAL = 129, ICON_TRANSLATE = 130, ICON_UPLOAD = 131, + ICON_RESERVED0 = 132, + ICON_RESERVED1 = 133, + ICON_RESERVED2 = 134, + ICON_RESERVED3 = 135, + ICON_RESERVED4 = 136, + ICON_RESERVED5 = 137, + ICON_UVSPHERE = 138, + ICON_PLANE = 139, + ICON_TORUS = 140, + ICON_CYLINDER = 141, + ICON_CONE = 142, + ICON_BOX = 143, } icon_t; typedef enum { diff --git a/paint/sources/ui/tab_meshes.c b/paint/sources/ui/tab_meshes.c index f6442ba4..58f89e04 100644 --- a/paint/sources/ui/tab_meshes.c +++ b/paint/sources/ui/tab_meshes.c @@ -421,9 +421,26 @@ void tab_meshes_append_shape(char *mesh_name) { any_array_push(g_project->_->paint_objects, mo); } -void tab_meshes_draw_append_shape() { +static icon_t tab_meshes_mesh_name_to_icon(char *s) { + if (starts_with(s, "box")) + return ICON_CUBE; + if (starts_with(s, "cone")) + return ICON_CONE; + if (starts_with(s, "cylinder")) + return ICON_CYLINDER; + if (starts_with(s, "torus")) + return ICON_TORUS; + if (starts_with(s, "plane")) + return ICON_PLANE; + if (starts_with(s, "sphere")) + return ICON_UVSPHERE; + return ICON_NONE; +} + +void tab_meshes_draw_new() { + project_fetch_default_meshes(); for (i32 i = 0; i < project_default_mesh_list->length; ++i) { - if (ui_menu_button(project_default_mesh_list->buffer[i], "", ICON_NONE)) { + if (ui_menu_button(project_default_mesh_list->buffer[i], "", tab_meshes_mesh_name_to_icon(project_default_mesh_list->buffer[i]))) { tab_meshes_append_shape(project_default_mesh_list->buffer[i]); } } @@ -433,14 +450,9 @@ void tab_meshes_draw_import() { if (ui_menu_button(tr("Replace Existing"), any_map_get(g_keymap, "file_import_assets"), ICON_NONE)) { project_import_mesh(true, NULL); } - if (ui_menu_button(tr("Append File"), "", ICON_NONE)) { + if (ui_menu_button(tr("Append"), "", ICON_NONE)) { project_append_mesh(); } - - if (ui_menu_button(tr("Append Shape"), "", ICON_NONE)) { - project_fetch_default_meshes(); - ui_menu_draw(&tab_meshes_draw_append_shape, -1, -1); - } } static vec4_t aabb_center(mesh_data_t *raw) { @@ -768,10 +780,14 @@ void tab_meshes_draw(ui_handle_t *htab) { (f32[]){ -70, -70, + -70, }, - 2); + 3); ui_row(row); + if (ui_icon_button(tr("New"), ICON_PLUS, UI_ALIGN_CENTER)) { + ui_menu_draw(&tab_meshes_draw_new, -1, -1); + } if (ui_icon_button(tr("Import"), ICON_IMPORT, UI_ALIGN_CENTER)) { ui_menu_draw(&tab_meshes_draw_import, -1, -1); }