mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-11-30 09:50:41 +00:00
[saco] Implement/match CMenuPool::GetTextPointer(...)
* Implement/match `CMenu::GetMenuItem(...)` * Implement/match `CMenu::GetMenuTitle()` * Implement/match `CMenu::GetMenuHeader(...)`
This commit is contained in:
parent
b734328b5e
commit
ad0b31deb5
@ -55,6 +55,21 @@ void CMenu::Hide()
|
||||
ScriptCommand(&remove_panel, m_dwPanel);
|
||||
}
|
||||
|
||||
PCHAR CMenu::GetMenuItem(BYTE byteColumn, BYTE byteRow)
|
||||
{
|
||||
return m_charItems[byteRow][byteColumn];
|
||||
}
|
||||
|
||||
PCHAR CMenu::GetMenuTitle()
|
||||
{
|
||||
return m_charTitle;
|
||||
}
|
||||
|
||||
PCHAR CMenu::GetMenuHeader(BYTE byteColumn)
|
||||
{
|
||||
return m_charHeader[byteColumn];
|
||||
}
|
||||
|
||||
PCHAR CMenu::MS(BYTE byteRow, BYTE byteColumn)
|
||||
{
|
||||
if (m_charItems[byteRow][byteColumn][0]) return g_szMenuItems[byteRow][byteColumn];
|
||||
|
@ -42,5 +42,8 @@ public:
|
||||
|
||||
void Show();
|
||||
void Hide();
|
||||
PCHAR GetMenuItem(BYTE byteColumn, BYTE byteRow);
|
||||
PCHAR GetMenuTitle();
|
||||
PCHAR GetMenuHeader(BYTE byteColumn);
|
||||
PCHAR MS(BYTE byteColumn, BYTE byteRow);
|
||||
};
|
||||
|
@ -100,3 +100,20 @@ void CMenuPool::HideMenu(BYTE byteMenuID)
|
||||
m_byteCurrentMenu = MAX_MENUS;
|
||||
}
|
||||
|
||||
PCHAR CMenuPool::GetTextPointer(PCHAR szName)
|
||||
{
|
||||
if (m_byteCurrentMenu == MAX_MENUS) return NULL;
|
||||
CMenu* pMenu = m_pMenus[m_byteCurrentMenu];
|
||||
if (!pMenu) return NULL;
|
||||
|
||||
if (!strcmp(szName, "HED")) return pMenu->GetMenuTitle();
|
||||
if (!strcmp(szName, "RW1")) return pMenu->GetMenuHeader(0);
|
||||
if (!strcmp(szName, "RW2")) return pMenu->GetMenuHeader(1);
|
||||
for (BYTE i = 0; i < MAX_MENU_ITEMS; i++)
|
||||
{
|
||||
if (!strcmp(szName, g_szMenuItems[i][0] + 4)) return pMenu->GetMenuItem(0, i);
|
||||
if (!strcmp(szName, g_szMenuItems[i][1] + 4)) return pMenu->GetMenuItem(1, i);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@ public:
|
||||
|
||||
void ShowMenu(BYTE byteMenuID);
|
||||
void HideMenu(BYTE byteMenuID);
|
||||
|
||||
PCHAR GetTextPointer(PCHAR szName);
|
||||
|
||||
};
|
||||
|
||||
//----------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user