changed IMenuDisplay/CreateDisplay to IMenuPanel/CreatePanel
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40793
This commit is contained in:
@@ -44,7 +44,7 @@ void BroadcastHandler::OnMenuCancel(IBaseMenu *menu, int client, MenuCancelReaso
|
||||
m_pHandler->OnMenuCancel(menu, client, reason);
|
||||
}
|
||||
|
||||
void BroadcastHandler::OnMenuDisplay(IBaseMenu *menu, int client, IMenuDisplay *display)
|
||||
void BroadcastHandler::OnMenuDisplay(IBaseMenu *menu, int client, IMenuPanel *display)
|
||||
{
|
||||
numClients++;
|
||||
m_pHandler->OnMenuDisplay(menu, client, display);
|
||||
@@ -214,7 +214,7 @@ IMenuStyle *MenuManager::FindStyleByName(const char *name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline bool IsSlotItem(IMenuDisplay *display,
|
||||
inline bool IsSlotItem(IMenuPanel *display,
|
||||
unsigned int style)
|
||||
{
|
||||
if (!display->CanDrawItem(style))
|
||||
@@ -233,7 +233,7 @@ inline bool IsSlotItem(IMenuDisplay *display,
|
||||
return true;
|
||||
}
|
||||
|
||||
IMenuDisplay *MenuManager::RenderMenu(int client, menu_states_t &md, ItemOrder order)
|
||||
IMenuPanel *MenuManager::RenderMenu(int client, menu_states_t &md, ItemOrder order)
|
||||
{
|
||||
IBaseMenu *menu = md.menu;
|
||||
|
||||
@@ -290,7 +290,7 @@ IMenuDisplay *MenuManager::RenderMenu(int client, menu_states_t &md, ItemOrder o
|
||||
}
|
||||
|
||||
/* Get our Display pointer and initialize some crap */
|
||||
IMenuDisplay *display = menu->CreateDisplay();
|
||||
IMenuPanel *display = menu->CreatePanel();
|
||||
IMenuHandler *mh = md.mh;
|
||||
bool foundExtra = false;
|
||||
unsigned int extraItem = 0;
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ class BroadcastHandler : public IMenuHandler
|
||||
public:
|
||||
BroadcastHandler(IMenuHandler *handler);
|
||||
public: //IMenuHandler
|
||||
void OnMenuDisplay(IBaseMenu *menu, int client, IMenuDisplay *display);
|
||||
void OnMenuDisplay(IBaseMenu *menu, int client, IMenuPanel *display);
|
||||
void OnMenuSelect(IBaseMenu *menu, int client, unsigned int item);
|
||||
void OnMenuEnd(IBaseMenu *menu);
|
||||
void OnMenuCancel(IBaseMenu *menu, int client, MenuCancelReason reason);
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
IMenuStyle *GetDefaultStyle();
|
||||
void AddStyle(IMenuStyle *style);
|
||||
bool SetDefaultStyle(IMenuStyle *style);
|
||||
IMenuDisplay *RenderMenu(int client, menu_states_t &states, ItemOrder order);
|
||||
IMenuPanel *RenderMenu(int client, menu_states_t &states, ItemOrder order);
|
||||
protected:
|
||||
void FreeBroadcastHandler(BroadcastHandler *bh);
|
||||
void FreeVoteHandler(VoteHandler *vh);
|
||||
|
||||
@@ -251,7 +251,7 @@ void BaseMenuStyle::ClientPressedKey(int client, unsigned int key_press)
|
||||
mh->OnMenuEnd(menu);
|
||||
}
|
||||
|
||||
bool BaseMenuStyle::DoClientMenu(int client, IMenuDisplay *menu, IMenuHandler *mh, unsigned int time)
|
||||
bool BaseMenuStyle::DoClientMenu(int client, IMenuPanel *menu, IMenuHandler *mh, unsigned int time)
|
||||
{
|
||||
CPlayer *pPlayer = g_Players.GetPlayerByIndex(client);
|
||||
if (!pPlayer || pPlayer->IsFakeClient() || !pPlayer->IsInGame())
|
||||
@@ -355,7 +355,7 @@ bool BaseMenuStyle::DoClientMenu(int client, CBaseMenu *menu, IMenuHandler *mh,
|
||||
states.mh = mh;
|
||||
states.apiVers = SMINTERFACE_MENUMANAGER_VERSION;
|
||||
|
||||
IMenuDisplay *display = g_Menus.RenderMenu(client, states, ItemOrder_Ascending);
|
||||
IMenuPanel *display = g_Menus.RenderMenu(client, states, ItemOrder_Ascending);
|
||||
if (!display)
|
||||
{
|
||||
player->bAutoIgnore = false;
|
||||
@@ -393,7 +393,7 @@ bool BaseMenuStyle::RedoClientMenu(int client, ItemOrder order)
|
||||
menu_states_t &states = player->states;
|
||||
|
||||
player->bAutoIgnore = true;
|
||||
IMenuDisplay *display = g_Menus.RenderMenu(client, states, order);
|
||||
IMenuPanel *display = g_Menus.RenderMenu(client, states, order);
|
||||
if (!display)
|
||||
{
|
||||
if (player->menuHoldTime)
|
||||
|
||||
@@ -69,10 +69,10 @@ public: //IClientListener
|
||||
void OnClientDisconnected(int client);
|
||||
public: //what derived must implement
|
||||
virtual CBaseMenuPlayer *GetMenuPlayer(int client) =0;
|
||||
virtual void SendDisplay(int client, IMenuDisplay *display) =0;
|
||||
virtual void SendDisplay(int client, IMenuPanel *display) =0;
|
||||
public: //what derived may implement
|
||||
virtual bool DoClientMenu(int client, CBaseMenu *menu, IMenuHandler *mh, unsigned int time);
|
||||
virtual bool DoClientMenu(int client, IMenuDisplay *menu, IMenuHandler *mh, unsigned int time);
|
||||
virtual bool DoClientMenu(int client, IMenuPanel *menu, IMenuHandler *mh, unsigned int time);
|
||||
virtual void AddClientToWatch(int client);
|
||||
virtual void RemoveClientFromWatch(int client);
|
||||
virtual void ProcessWatchList();
|
||||
|
||||
@@ -117,13 +117,13 @@ void CRadioStyle::OnUserMessageSent(int msg_id)
|
||||
g_last_client_count = 0;
|
||||
}
|
||||
|
||||
void CRadioStyle::SendDisplay(int client, IMenuDisplay *display)
|
||||
void CRadioStyle::SendDisplay(int client, IMenuPanel *display)
|
||||
{
|
||||
CRadioDisplay *rDisplay = (CRadioDisplay *)display;
|
||||
rDisplay->SendRawDisplay(client, m_players[client].menuHoldTime);
|
||||
}
|
||||
|
||||
IMenuDisplay *CRadioStyle::CreateDisplay()
|
||||
IMenuPanel *CRadioStyle::CreatePanel()
|
||||
{
|
||||
return new CRadioDisplay();
|
||||
}
|
||||
@@ -301,7 +301,7 @@ bool CRadioMenu::SetExtOption(MenuOption option, const void *valuePtr)
|
||||
return false;
|
||||
}
|
||||
|
||||
IMenuDisplay *CRadioMenu::CreateDisplay()
|
||||
IMenuPanel *CRadioMenu::CreatePanel()
|
||||
{
|
||||
return new CRadioDisplay(this);
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ public: //SMGlobalClass
|
||||
void OnSourceModShutdown();
|
||||
public: //BaseMenuStyle
|
||||
CBaseMenuPlayer *GetMenuPlayer(int client);
|
||||
void SendDisplay(int client, IMenuDisplay *display);
|
||||
void SendDisplay(int client, IMenuPanel *display);
|
||||
public: //IMenuStyle
|
||||
const char *GetStyleName();
|
||||
IMenuDisplay *CreateDisplay();
|
||||
IMenuPanel *CreatePanel();
|
||||
IBaseMenu *CreateMenu();
|
||||
unsigned int GetMaxPageItems();
|
||||
public: //IUserMessageListener
|
||||
@@ -55,12 +55,12 @@ private:
|
||||
|
||||
class CRadioMenu;
|
||||
|
||||
class CRadioDisplay : public IMenuDisplay
|
||||
class CRadioDisplay : public IMenuPanel
|
||||
{
|
||||
public:
|
||||
CRadioDisplay();
|
||||
CRadioDisplay(CRadioMenu *menu);
|
||||
public: //IMenuDisplay
|
||||
public: //IMenuPanel
|
||||
IMenuStyle *GetParentStyle();
|
||||
void Reset();
|
||||
void DrawTitle(const char *text, bool onlyIfEmpty=false);
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
CRadioMenu();
|
||||
public:
|
||||
bool SetExtOption(MenuOption option, const void *valuePtr);
|
||||
IMenuDisplay *CreateDisplay();
|
||||
IMenuPanel *CreatePanel();
|
||||
bool Display(int client, IMenuHandler *handler, unsigned int time);
|
||||
void Cancel_Finally();
|
||||
};
|
||||
|
||||
@@ -104,7 +104,7 @@ void ValveMenuStyle::OnSourceModVSPReceived(IServerPluginCallbacks *iface)
|
||||
g_pVSPHandle = iface;
|
||||
}
|
||||
|
||||
IMenuDisplay *ValveMenuStyle::CreateDisplay()
|
||||
IMenuPanel *ValveMenuStyle::CreatePanel()
|
||||
{
|
||||
return new CValveMenuDisplay();
|
||||
}
|
||||
@@ -124,14 +124,14 @@ unsigned int ValveMenuStyle::GetMaxPageItems()
|
||||
return 8;
|
||||
}
|
||||
|
||||
void ValveMenuStyle::SendDisplay(int client, IMenuDisplay *display)
|
||||
void ValveMenuStyle::SendDisplay(int client, IMenuPanel *display)
|
||||
{
|
||||
m_players[client].curPrioLevel--;
|
||||
CValveMenuDisplay *vDisplay = (CValveMenuDisplay *)display;
|
||||
vDisplay->SendRawDisplay(client, m_players[client].curPrioLevel, m_players[client].menuHoldTime);
|
||||
}
|
||||
|
||||
bool ValveMenuStyle::DoClientMenu(int client, IMenuDisplay *menu, IMenuHandler *mh, unsigned int time)
|
||||
bool ValveMenuStyle::DoClientMenu(int client, IMenuPanel *menu, IMenuHandler *mh, unsigned int time)
|
||||
{
|
||||
if (!g_pVSPHandle)
|
||||
{
|
||||
@@ -354,7 +354,7 @@ bool CValveMenu::Display(int client, IMenuHandler *handler, unsigned int time)
|
||||
return g_ValveMenuStyle.DoClientMenu(client, this, handler, time);
|
||||
}
|
||||
|
||||
IMenuDisplay *CValveMenu::CreateDisplay()
|
||||
IMenuPanel *CValveMenu::CreatePanel()
|
||||
{
|
||||
return new CValveMenuDisplay(this);
|
||||
}
|
||||
|
||||
@@ -45,16 +45,16 @@ public:
|
||||
bool OnClientCommand(int client);
|
||||
public: //BaseMenuStyle
|
||||
CBaseMenuPlayer *GetMenuPlayer(int client);
|
||||
void SendDisplay(int client, IMenuDisplay *display);
|
||||
void SendDisplay(int client, IMenuPanel *display);
|
||||
bool DoClientMenu(int client, CBaseMenu *menu, IMenuHandler *mh, unsigned int time);
|
||||
bool DoClientMenu(int client, IMenuDisplay *menu, IMenuHandler *mh, unsigned int time);
|
||||
bool DoClientMenu(int client, IMenuPanel *menu, IMenuHandler *mh, unsigned int time);
|
||||
public: //SMGlobalClass
|
||||
void OnSourceModAllInitialized();
|
||||
void OnSourceModShutdown();
|
||||
void OnSourceModVSPReceived(IServerPluginCallbacks *iface);
|
||||
public: //IMenuStyle
|
||||
const char *GetStyleName();
|
||||
IMenuDisplay *CreateDisplay();
|
||||
IMenuPanel *CreatePanel();
|
||||
IBaseMenu *CreateMenu();
|
||||
unsigned int GetMaxPageItems();
|
||||
private:
|
||||
@@ -65,7 +65,7 @@ private:
|
||||
|
||||
class CValveMenu;
|
||||
|
||||
class CValveMenuDisplay : public IMenuDisplay
|
||||
class CValveMenuDisplay : public IMenuPanel
|
||||
{
|
||||
public:
|
||||
CValveMenuDisplay();
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
CValveMenu();
|
||||
public: //IBaseMenu
|
||||
bool SetExtOption(MenuOption option, const void *valuePtr);
|
||||
IMenuDisplay *CreateDisplay();
|
||||
IMenuPanel *CreatePanel();
|
||||
bool GetExitButton();
|
||||
bool SetExitButton(bool set);
|
||||
bool SetPagination(unsigned int itemsPerPage);
|
||||
|
||||
Reference in New Issue
Block a user