some minor fixups

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40782
This commit is contained in:
David Anderson
2007-05-13 04:41:10 +00:00
parent 5aabd81406
commit d9b06e298c
5 changed files with 27 additions and 15 deletions
+8 -2
View File
@@ -368,7 +368,7 @@ IMenuDisplay *MenuManager::RenderMenu(int client, menu_states_t &md, ItemOrder o
/* There were no items to draw! */
if (!foundItems)
{
delete display;
display->DeleteThis();
return NULL;
}
@@ -520,9 +520,15 @@ skip_search:
slots[position].type = ItemSel_None;
}
}
ItemDrawInfo dr(text, 0);
/* Put a fake spacer before control stuff, if possible */
{
ItemDrawInfo draw("", ITEMDRAW_RAWLINE|ITEMDRAW_SPACER);
display->DrawItem(draw);
}
/* PREVIOUS */
ItemDrawInfo dr(text, 0);
if (displayPrev || canDrawDisabled)
{
CorePlayerTranslate(client, text, sizeof(text), "Back", NULL);
+2 -2
View File
@@ -376,7 +376,7 @@ bool BaseMenuStyle::DoClientMenu(int client, CBaseMenu *menu, IMenuHandler *mh,
SendDisplay(client, display);
/* Free the display pointer */
delete display;
display->DeleteThis();
/* We can be interrupted again! */
player->bAutoIgnore = false;
@@ -403,7 +403,7 @@ bool BaseMenuStyle::RedoClientMenu(int client, ItemOrder order)
SendDisplay(client, display);
delete display;
display->DeleteThis();
player->bAutoIgnore = false;
+5
View File
@@ -177,6 +177,11 @@ CValveMenuDisplay::CValveMenuDisplay(CValveMenu *pMenu)
m_pKv->SetString("title", pMenu->m_IntroMsg);
}
void CValveMenuDisplay::DeleteThis()
{
delete this;
}
CValveMenuDisplay::~CValveMenuDisplay()
{
m_pKv->deleteThis();
+3 -1
View File
@@ -81,6 +81,7 @@ public:
bool SetExtOption(MenuOption option, const void *valuePtr);
bool CanDrawItem(unsigned int drawFlags);
void SendRawDisplay(int client, int priority, unsigned int time);
void DeleteThis();
private:
KeyValues *m_pKv;
unsigned int m_NextPos;
@@ -92,13 +93,14 @@ class CValveMenu : public CBaseMenu
friend class CValveMenuDisplay;
public:
CValveMenu();
public:
public: //IBaseMenu
bool SetExtOption(MenuOption option, const void *valuePtr);
IMenuDisplay *CreateDisplay();
bool GetExitButton();
bool SetExitButton(bool set);
bool SetPagination(unsigned int itemsPerPage);
bool Display(int client, IMenuHandler *handler, unsigned int time);
public: //CBaseMenu
void Cancel_Finally();
private:
Color m_IntroColor;