mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-03 16:13:34 +08:00
[saco] Implement/match CMenuPool destructor
* Implement/match `CMenu::Hide()`
This commit is contained in:
parent
4c0831a806
commit
37642d51d4
@ -25,3 +25,8 @@ CMenu::CMenu(float fX, float fY, BYTE byteColumns, float fCol1Width, float fCol2
|
||||
m_dwPanel = 0;
|
||||
}
|
||||
|
||||
void CMenu::Hide()
|
||||
{
|
||||
ScriptCommand(&remove_panel, m_dwPanel);
|
||||
}
|
||||
|
||||
|
@ -40,4 +40,5 @@ public:
|
||||
|
||||
CMenu(float fX, float fY, BYTE byteColumns, float fCol1Width, float fCol2Width, MENU_INT *MenuInteraction);
|
||||
|
||||
void Hide();
|
||||
};
|
||||
|
@ -81,6 +81,7 @@ const SCRIPT_COMMAND text_clear_all = { 0x00be, "" };
|
||||
|
||||
const SCRIPT_COMMAND create_radar_marker_icon = { 0x0570, "fffiv" };
|
||||
|
||||
const SCRIPT_COMMAND remove_panel = { 0x08DA, "i" };
|
||||
|
||||
const SCRIPT_COMMAND restore_camera_to_user_defined = { 0x925, "" };
|
||||
const SCRIPT_COMMAND set_camera_position_to = { 0x936, "ffffffii" };
|
||||
|
@ -16,6 +16,21 @@ CMenuPool::CMenuPool()
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
CMenuPool::~CMenuPool()
|
||||
{
|
||||
if (m_byteCurrentMenu != MAX_MENUS) m_pMenus[m_byteCurrentMenu]->Hide();
|
||||
for (BYTE byteMenuID = 0; byteMenuID < MAX_MENUS; byteMenuID++)
|
||||
{
|
||||
if (m_pMenus[byteMenuID])
|
||||
{
|
||||
delete m_pMenus[byteMenuID];
|
||||
m_pMenus[byteMenuID] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
CMenu* CMenuPool::New(BYTE byteMenuID, float fX, float fY, BYTE byteColumns, float fCol1Width, float fCol2Width, MENU_INT *MenuInteraction)
|
||||
{
|
||||
SAFE_DELETE(m_pMenus[byteMenuID]);
|
||||
|
@ -14,6 +14,7 @@ private:
|
||||
|
||||
public:
|
||||
CMenuPool();
|
||||
~CMenuPool();
|
||||
|
||||
CMenu* New(BYTE byteMenuID, float fX, float fY, BYTE byteColumns, float fCol1Width, float fCol2Width, MENU_INT *MenuInteraction);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user