fixed some topmenus, completed initial test
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401503
This commit is contained in:
parent
61ac102fe2
commit
3d3db1d3a2
@ -59,14 +59,13 @@ TopMenu::TopMenu(ITopMenuObjectCallbacks *callbacks)
|
|||||||
TopMenu::~TopMenu()
|
TopMenu::~TopMenu()
|
||||||
{
|
{
|
||||||
/* Delete all categories */
|
/* Delete all categories */
|
||||||
size_t i = 1;
|
while (m_Categories.size())
|
||||||
while (i >= m_Categories.size())
|
|
||||||
{
|
{
|
||||||
RemoveFromMenu(m_Categories[i - 1]->obj->object_id);
|
RemoveFromMenu(m_Categories[0]->obj->object_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove all objects */
|
/* Remove all objects */
|
||||||
for (i = 0; i < m_Objects.size(); i++)
|
for (size_t i = 0; i < m_Objects.size(); i++)
|
||||||
{
|
{
|
||||||
assert(m_Objects[i]->is_free == true);
|
assert(m_Objects[i]->is_free == true);
|
||||||
delete m_Objects[i];
|
delete m_Objects[i];
|
||||||
@ -75,13 +74,13 @@ TopMenu::~TopMenu()
|
|||||||
m_pTitle->OnTopMenuObjectRemoved(this, 0);
|
m_pTitle->OnTopMenuObjectRemoved(this, 0);
|
||||||
|
|
||||||
/* Delete all cached config entries */
|
/* Delete all cached config entries */
|
||||||
for (i = 0; i < m_Config.cats.size(); i++)
|
for (size_t i = 0; i < m_Config.cats.size(); i++)
|
||||||
{
|
{
|
||||||
delete m_Config.cats[i];
|
delete m_Config.cats[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sweep players */
|
/* Sweep players */
|
||||||
for (i = 0; i <= (size_t)m_max_clients; i++)
|
for (size_t i = 0; i <= (size_t)m_max_clients; i++)
|
||||||
{
|
{
|
||||||
TearDownClient(&m_clients[i]);
|
TearDownClient(&m_clients[i]);
|
||||||
}
|
}
|
||||||
@ -597,7 +596,7 @@ void TopMenu::UpdateClientRoot(int client, IGamePlayer *pGamePlayer)
|
|||||||
qsort(item_list, m_UnsortedCats.size(), sizeof(obj_by_name_t), _SortObjectNamesDescending);
|
qsort(item_list, m_UnsortedCats.size(), sizeof(obj_by_name_t), _SortObjectNamesDescending);
|
||||||
|
|
||||||
/* Add the new sorted categories */
|
/* Add the new sorted categories */
|
||||||
for (size_t i = 0; i < m_SortedCats.size(); i++)
|
for (size_t i = 0; i < m_UnsortedCats.size(); i++)
|
||||||
{
|
{
|
||||||
if (m_Categories[item_list[i].obj_index]->obj_list.size() == 0)
|
if (m_Categories[item_list[i].obj_index]->obj_list.size() == 0)
|
||||||
{
|
{
|
||||||
|
@ -199,7 +199,7 @@ static cell_t AddToTopMenu(IPluginContext *pContext, const cell_t *params)
|
|||||||
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
|
return pContext->ThrowNativeError("Invalid Handle %x (error: %d)", params[1], err);
|
||||||
}
|
}
|
||||||
|
|
||||||
IPluginFunction *func = pContext->GetFunctionById(params[1]);
|
IPluginFunction *func = pContext->GetFunctionById(params[4]);
|
||||||
if (func == NULL)
|
if (func == NULL)
|
||||||
{
|
{
|
||||||
return pContext ->ThrowNativeError("Invalid function specified");
|
return pContext ->ThrowNativeError("Invalid function specified");
|
||||||
|
Loading…
Reference in New Issue
Block a user