forked from SmileYzn/RePugMod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Menu.h
43 lines (33 loc) · 965 Bytes
/
Menu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#define MENU_PAGE_OPTION 7
typedef struct
{
int Info;
std::string Text;
bool Disabled;
int Extra;
} P_MENU_ITEM, *LP_MENU_ITEM;
class CMenu
{
public:
void Clear();
void Create(std::string Title, bool Exit, void* CallbackFunction);
void AddItem(int Info, std::string Text);
void AddItem(int Info, std::string Text, bool Disabled);
void AddItem(int Info, std::string Text, bool Disabled, int Extra);
void AddList(std::vector<std::string> List);
void Show(int EntityIndex);
void Hide(int EntityIndex);
bool Handle(int EntityIndex, int Key);
private:
void Display(int EntityIndex, int Page);
void ShowMenu(int EntityIndex, int Slots, int Time, std::string MenuText);
void HideMenu(int EntityIndex);
std::string m_Text;
std::vector<P_MENU_ITEM> m_Data;
int m_Page = 0;
bool m_Exit = false;
int m_PageOption = MENU_PAGE_OPTION;
void* m_Func = nullptr;
};
extern CMenu gMenu[MAX_CLIENTS+1];