Load custom menus ingame.

This commit is contained in:
momo5502 2016-01-08 15:03:38 +01:00
parent 7aa73a4d2f
commit b83306cc20
3 changed files with 6 additions and 2 deletions

View File

@ -266,7 +266,7 @@ namespace Components
}
// Load custom menus
if (std::string(menuList->name) == "ui_mp/menus.txt")
if (std::string(menuList->name) == "ui_mp/code.txt") // Should be menus, but code is loaded ingame
{
for (auto menu : Menus::CustomMenus)
{
@ -478,7 +478,7 @@ namespace Components
void Menus::AddMenuListHook(Game::UiContext *dc, Game::MenuList *menuList, int close)
{
Game::MenuList* menus = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_MENUFILE, "ui_mp/menus.txt").menuList;
Game::MenuList* menus = Game::UI_LoadMenus("ui_mp/menus.txt", 3);
Game::UI_AddMenuList(dc, menus, close);
Game::UI_AddMenuList(dc, menuList, close);

View File

@ -105,6 +105,7 @@ namespace Game
Sys_IsMainThread_t Sys_IsMainThread = (Sys_IsMainThread_t)0x4C37D0;
UI_AddMenuList_t UI_AddMenuList = (UI_AddMenuList_t)0x4533C0;
UI_LoadMenus_t UI_LoadMenus = (UI_LoadMenus_t)0x641460;
UI_DrawHandlePic_t UI_DrawHandlePic = (UI_DrawHandlePic_t)0x4D0EA0;
Win_GetLanguage_t Win_GetLanguage = (Win_GetLanguage_t)0x45CBA0;

View File

@ -232,6 +232,9 @@ namespace Game
typedef void(__cdecl * UI_AddMenuList_t)(UiContext *dc, MenuList *menuList, int close);
extern UI_AddMenuList_t UI_AddMenuList;
typedef MenuList *(__cdecl * UI_LoadMenus_t)(const char *menuFile, int imageTrack);
extern UI_LoadMenus_t UI_LoadMenus;
typedef void(__cdecl * UI_DrawHandlePic_t)(/*ScreenPlacement*/void *scrPlace, float x, float y, float w, float h, int horzAlign, int vertAlign, const float *color, Material *material);
extern UI_DrawHandlePic_t UI_DrawHandlePic;