2015-12-23 21:26:46 -05:00
|
|
|
#define MAX_SOURCEFILES 64
|
|
|
|
|
2015-12-23 16:21:03 -05:00
|
|
|
namespace Components
|
|
|
|
{
|
|
|
|
class Menus : public Component
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Menus();
|
2015-12-23 21:26:46 -05:00
|
|
|
~Menus();
|
2015-12-23 16:21:03 -05:00
|
|
|
const char* GetName() { return "Menus"; };
|
2015-12-23 21:26:46 -05:00
|
|
|
|
2015-12-25 15:42:35 -05:00
|
|
|
static void FreeEverything();
|
|
|
|
|
2015-12-23 21:26:46 -05:00
|
|
|
private:
|
|
|
|
static std::vector<Game::menuDef_t*> MenuList;
|
|
|
|
static std::vector<Game::MenuList*> MenuListList;
|
|
|
|
|
|
|
|
static Game::XAssetHeader MenuFileLoad(Game::XAssetType type, const char* filename);
|
|
|
|
static Game::MenuList* LoadMenuList(Game::MenuList* menuList);
|
2015-12-24 06:00:29 -05:00
|
|
|
static std::vector<Game::menuDef_t*> LoadMenu(Game::menuDef_t* menudef);
|
|
|
|
|
|
|
|
static Game::script_t* LoadMenuScript(const char* name, std::string buffer);
|
|
|
|
static int LoadMenuSource(const char* name, std::string buffer);
|
2015-12-23 21:26:46 -05:00
|
|
|
|
|
|
|
static int ReserveSourceHandle();
|
2015-12-24 06:00:29 -05:00
|
|
|
static bool IsValidSourceHandle(int handle);
|
|
|
|
|
|
|
|
static Game::menuDef_t* ParseMenu(int handle);
|
2015-12-23 21:26:46 -05:00
|
|
|
|
|
|
|
static void FreeMenuSource(int handle);
|
|
|
|
|
|
|
|
static void FreeMenuList(Game::MenuList* menuList);
|
|
|
|
static void FreeMenu(Game::menuDef_t* menudef);
|
|
|
|
|
2015-12-24 08:28:08 -05:00
|
|
|
static void RemoveMenu(Game::menuDef_t* menudef);
|
|
|
|
static void RemoveMenuList(Game::MenuList* menuList);
|
|
|
|
|
2015-12-25 16:34:05 -05:00
|
|
|
static void AddMenuListHook(Game::UiContext *dc, Game::MenuList *menuList, int close);
|
|
|
|
|
|
|
|
static Game::menuDef_t* FindMenuByName(Game::UiContext* dc, const char* name);
|
2015-12-24 06:00:29 -05:00
|
|
|
|
|
|
|
// Ugly!
|
|
|
|
static int KeywordHash(char* key);
|
2015-12-23 16:21:03 -05:00
|
|
|
};
|
|
|
|
}
|