Now supporting single Arguments

This commit is contained in:
Simon 2020-01-23 13:01:19 +01:00
parent bcd00c5451
commit da73f62ea7
2 changed files with 3 additions and 2 deletions

2
menu.c
View File

@ -63,7 +63,7 @@ void show_menu(const struct MenuPage* pages, const size_t page_count, const bool
{
// Perform action
system("cls");
pages[page_index].items[i].action();
pages[page_index].items[i].action(pages[page_index].items[i].param);
action_performed = true;
// Pause if requested

3
menu.h
View File

@ -6,7 +6,8 @@
struct MenuItem {
char* text;
char key;
void* (*action)(void);
void* (*action)(void* params);
void* param;
};
/// <summary>Represents a border in which a menu is displayed.</summary>