iw4x-client/src/Components/Modules/Menus.hpp

46 lines
1.2 KiB
C++
Raw Normal View History

2017-01-20 08:36:52 -05:00
#pragma once
2017-01-19 16:23:59 -05:00
#define MAX_SOURCEFILES 64
#define MAX_MENUS_IN_CONTEXT 640
2017-01-19 16:23:59 -05:00
#undef LoadMenu
namespace Components
{
class Menus : public Component
{
public:
Menus();
~Menus();
static void FreeEverything();
static void RegisterMenuLists();
2017-01-19 16:23:59 -05:00
// used to load assets for zonebuilder
static std::vector<Game::menuDef_t*> LoadMenu(const std::string& file);
2017-01-19 16:23:59 -05:00
private:
static std::unordered_map<std::string, Game::menuDef_t*> DiskMenuList;
// Loading
static int ReserveSourceHandle();
static bool IsValidSourceHandle(int handle);
static Game::menuDef_t* ParseMenu(int handle);
static Game::script_t* LoadMenuScript(const std::string& name, const std::string& buffer);
static int LoadMenuSource(const std::string& name, const std::string& buffer);
// Freeing
2017-01-19 16:23:59 -05:00
static void FreeMenuSource(int handle);
static void FreeDiskMenu(Game::menuDef_t* menudef);
2017-01-19 16:23:59 -05:00
// Etc.
2017-01-19 16:23:59 -05:00
static bool IsMenuVisible(Game::UiContext *dc, Game::menuDef_t *menu);
// Manage menus in uiContext
static void AddMenuListToContext(Game::UiContext* ctx, Game::MenuList* list, int close);
static void ResetContextHook(int a1);
2017-01-19 16:23:59 -05:00
// Ugly!
static int KeywordHash(char* key);
};
}