Sort magic tools by ..._get_order() value, when possible

Tools in n_pt_persp plugin provide orders.  (More coming!)
This commit is contained in:
Bill Kendrick 2024-01-16 20:33:58 -08:00
parent f7972d04a7
commit ff9eff4e60
3 changed files with 31 additions and 5 deletions

View file

@ -16,7 +16,7 @@
by Bill Kendrick <bill@newbreedsoftware.com>
December 12, 2023 - January 14, 2024
December 12, 2023 - January 16, 2024
*/
#include <stdio.h>
@ -70,6 +70,7 @@ enum
NUM_TOOLS
};
#ifdef DEBUG
char * tool_debug_names[NUM_TOOLS] = {
/* 1-point perspective */
@ -306,6 +307,7 @@ int n_pt_persp_get_tool_count(magic_api * api);
SDL_Surface *n_pt_persp_get_icon(magic_api * api, int which);
char *n_pt_persp_get_name(magic_api * api, int which);
int n_pt_persp_get_group(magic_api * api, int which);
int n_pt_persp_get_order(int which);
char *n_pt_persp_get_description(magic_api * api, int which, int mode);
int n_pt_persp_requires_colors(magic_api * api, int which);
int n_pt_persp_modes(magic_api * api, int which);
@ -501,6 +503,11 @@ int n_pt_persp_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U
return (MAGIC_TYPE_PROJECTIONS);
}
int n_pt_persp_get_order(int which) {
/* Use the order they appear in the TOOL... enum */
return which;
}
char *n_pt_persp_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED)
{