changed IMenuDisplay/CreateDisplay to IMenuPanel/CreatePanel
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40793
This commit is contained in:
		
							parent
							
								
									ae8b06194f
								
							
						
					
					
						commit
						0b45984017
					
				| @ -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; | ||||
|  | ||||
| @ -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); | ||||
|  | ||||
| @ -62,7 +62,7 @@ namespace SourceMod | ||||
| 	}; | ||||
| 
 | ||||
| 	class IBaseMenu; | ||||
| 	class IMenuDisplay; | ||||
| 	class IMenuPanel; | ||||
| 	class IMenuHandler; | ||||
| 
 | ||||
| 	/**
 | ||||
| @ -109,10 +109,10 @@ namespace SourceMod | ||||
| 	 */ | ||||
| 	enum MenuCancelReason | ||||
| 	{ | ||||
| 		MenuCancel_Disconnect = -1,	/** Client dropped from the server */ | ||||
| 		MenuCancel_Interrupt = -2,	/** Client was interrupted with another menu */ | ||||
| 		MenuCancel_Exit = -3,		/** Client selected "exit" on a paginated menu */ | ||||
| 		MenuCancel_NoDisplay = -4,	/** Menu could not be displayed to the client */ | ||||
| 		MenuCancel_Disconnect = -1,	/**< Client dropped from the server */ | ||||
| 		MenuCancel_Interrupt = -2,	/**< Client was interrupted with another menu */ | ||||
| 		MenuCancel_Exit = -3,		/**< Client selected "exit" on a paginated menu */ | ||||
| 		MenuCancel_NoDisplay = -4,	/**< Menu could not be displayed to the client */ | ||||
| 	}; | ||||
| 
 | ||||
| 	#define MENU_NO_PAGINATION			0		/**< Menu should not be paginated (10 items max) */ | ||||
| @ -140,7 +140,7 @@ namespace SourceMod | ||||
| 		MenuSource_None = 0,					/**< No menu is being displayed */ | ||||
| 		MenuSource_External = 1,				/**< External menu, no pointer */ | ||||
| 		MenuSource_BaseMenu = 2,				/**< An IBaseMenu pointer. */ | ||||
| 		MenuSource_Display = 3,					/**< IMenuDisplay source, no pointer */ | ||||
| 		MenuSource_Display = 3,					/**< IMenuPanel source, no pointer */ | ||||
| 	}; | ||||
| 
 | ||||
| 	class IMenuStyle; | ||||
| @ -148,7 +148,7 @@ namespace SourceMod | ||||
| 	/**
 | ||||
| 	 * @brief Sets how a raw menu should be drawn. | ||||
| 	 */ | ||||
| 	class IMenuDisplay | ||||
| 	class IMenuPanel | ||||
| 	{ | ||||
| 	public: | ||||
| 		/**
 | ||||
| @ -250,13 +250,13 @@ namespace SourceMod | ||||
| 		virtual const char *GetStyleName() =0; | ||||
| 
 | ||||
| 		/**
 | ||||
| 		 * @brief Creates an IMenuDisplay object. | ||||
| 		 * @brief Creates an IMenuPanel object. | ||||
| 		 * | ||||
| 		 * Note: the object should be freed using ::DeleteThis. | ||||
| 		 * | ||||
| 		 * @return				IMenuDisplay object. | ||||
| 		 * @return				IMenuPanel object. | ||||
| 		 */ | ||||
| 		virtual IMenuDisplay *CreateDisplay() =0; | ||||
| 		virtual IMenuPanel *CreatePanel() =0; | ||||
| 
 | ||||
| 		/**
 | ||||
| 		 * @brief Creates an IBaseMenu object of this style. | ||||
| @ -397,14 +397,14 @@ namespace SourceMod | ||||
| 		virtual bool SetExtOption(MenuOption option, const void *valuePtr) =0; | ||||
| 
 | ||||
| 		/**
 | ||||
| 		 * @brief Creates a new IMenuDisplay object using extended options specific | ||||
| 		 * @brief Creates a new IMenuPanel object using extended options specific | ||||
| 		 * to the IMenuStyle parent.  Titles, items, etc, are not copied. | ||||
| 		 * | ||||
| 		 * Note: The object should be freed with IMenuDisplay::DeleteThis. | ||||
| 		 * Note: The object should be freed with IMenuPanel::DeleteThis. | ||||
| 		 * | ||||
| 		 * @return				IMenuDisplay pointer. | ||||
| 		 * @return				IMenuPanel pointer. | ||||
| 		 */ | ||||
| 		virtual IMenuDisplay *CreateDisplay() =0; | ||||
| 		virtual IMenuPanel *CreatePanel() =0; | ||||
| 
 | ||||
| 		/**
 | ||||
| 		 * @brief Returns whether or not the menu should have an "Exit" button for | ||||
| @ -479,9 +479,9 @@ namespace SourceMod | ||||
| 		 * | ||||
| 		 * @param menu			Menu pointer. | ||||
| 		 * @param client		Client index. | ||||
| 		 * @param display		IMenuDisplay pointer. | ||||
| 		 * @param display		IMenuPanel pointer. | ||||
| 		 */ | ||||
| 		virtual void OnMenuDisplay(IBaseMenu *menu, int client, IMenuDisplay *display) | ||||
| 		virtual void OnMenuDisplay(IBaseMenu *menu, int client, IMenuPanel *display) | ||||
| 		{ | ||||
| 		} | ||||
| 
 | ||||
| @ -630,9 +630,9 @@ namespace SourceMod | ||||
| 		 * @return				IDisplay pointer, or NULL if no items could be  | ||||
| 		 *						found in the IBaseMenu pointer, or NULL if any | ||||
| 		 *						other error occurred.  Any valid pointer must | ||||
| 		 *						be freed using IMenuDisplay::DeleteThis. | ||||
| 		 *						be freed using IMenuPanel::DeleteThis. | ||||
| 		 */ | ||||
| 		virtual IMenuDisplay *RenderMenu(int client, menu_states_t &states, ItemOrder order) =0; | ||||
| 		virtual IMenuPanel *RenderMenu(int client, menu_states_t &states, ItemOrder order) =0; | ||||
| 	}; | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user