1.1 --- a/core/MenuStyle_Valve.h Fri Mar 28 06:21:34 2008 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,138 +0,0 @@
1.4 -/**
1.5 - * vim: set ts=4 :
1.6 - * =============================================================================
1.7 - * SourceMod
1.8 - * Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
1.9 - * =============================================================================
1.10 - *
1.11 - * This program is free software; you can redistribute it and/or modify it under
1.12 - * the terms of the GNU General Public License, version 3.0, as published by the
1.13 - * Free Software Foundation.
1.14 - *
1.15 - * This program is distributed in the hope that it will be useful, but WITHOUT
1.16 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1.17 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1.18 - * details.
1.19 - *
1.20 - * You should have received a copy of the GNU General Public License along with
1.21 - * this program. If not, see <http://www.gnu.org/licenses/>.
1.22 - *
1.23 - * As a special exception, AlliedModders LLC gives you permission to link the
1.24 - * code of this program (as well as its derivative works) to "Half-Life 2," the
1.25 - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
1.26 - * by the Valve Corporation. You must obey the GNU General Public License in
1.27 - * all respects for all other code used. Additionally, AlliedModders LLC grants
1.28 - * this exception to all derivative works. AlliedModders LLC defines further
1.29 - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
1.30 - * or <http://www.sourcemod.net/license.php>.
1.31 - *
1.32 - * Version: $Id$
1.33 - */
1.34 -
1.35 -#ifndef _INCLUDE_MENUSTYLE_VALVE_H
1.36 -#define _INCLUDE_MENUSTYLE_VALVE_H
1.37 -
1.38 -#include "sm_globals.h"
1.39 -#include "MenuManager.h"
1.40 -#include "MenuStyle_Base.h"
1.41 -#include "sourcemm_api.h"
1.42 -#include "KeyValues.h"
1.43 -#include "sm_fastlink.h"
1.44 -#include <compat_wrappers.h>
1.45 -
1.46 -using namespace SourceMod;
1.47 -
1.48 -class CValveMenuPlayer : public CBaseMenuPlayer
1.49 -{
1.50 -public:
1.51 - CValveMenuPlayer() : curPrioLevel(1)
1.52 - {
1.53 - }
1.54 - int curPrioLevel;
1.55 -};
1.56 -
1.57 -class CValveMenu;
1.58 -class CValveMenuDisplay;
1.59 -
1.60 -class ValveMenuStyle :
1.61 - public SMGlobalClass,
1.62 - public BaseMenuStyle
1.63 -{
1.64 -public:
1.65 - ValveMenuStyle();
1.66 - bool OnClientCommand(int client, const char *cmdname, const CCommand &cmd);
1.67 -public: //BaseMenuStyle
1.68 - CBaseMenuPlayer *GetMenuPlayer(int client);
1.69 - void SendDisplay(int client, IMenuPanel *display);
1.70 - bool DoClientMenu(int client, CBaseMenu *menu, unsigned int first_item, IMenuHandler *mh, unsigned int time);
1.71 - bool DoClientMenu(int client, IMenuPanel *menu, IMenuHandler *mh, unsigned int time);
1.72 -public: //SMGlobalClass
1.73 - void OnSourceModAllInitialized();
1.74 - void OnSourceModShutdown();
1.75 -public: //IMenuStyle
1.76 - const char *GetStyleName();
1.77 - IMenuPanel *CreatePanel();
1.78 - IBaseMenu *CreateMenu(IMenuHandler *pHandler, IdentityToken_t *pOwner);
1.79 - unsigned int GetMaxPageItems();
1.80 -private:
1.81 - void HookCreateMessage(edict_t *pEdict, DIALOG_TYPE type, KeyValues *kv, IServerPluginCallbacks *plugin);
1.82 -private:
1.83 - CValveMenuPlayer *m_players;
1.84 -};
1.85 -
1.86 -class CValveMenu;
1.87 -
1.88 -class CValveMenuDisplay : public IMenuPanel
1.89 -{
1.90 -public:
1.91 - CValveMenuDisplay();
1.92 - CValveMenuDisplay(CValveMenu *pMenu);
1.93 - ~CValveMenuDisplay();
1.94 -public:
1.95 - IMenuStyle *GetParentStyle();
1.96 - void Reset();
1.97 - void DrawTitle(const char *text, bool onlyIfEmpty=false);
1.98 - unsigned int DrawItem(const ItemDrawInfo &item);
1.99 - bool DrawRawLine(const char *rawline);
1.100 - bool SendDisplay(int client, IMenuHandler *handler, unsigned int time);
1.101 - bool SetExtOption(MenuOption option, const void *valuePtr);
1.102 - bool CanDrawItem(unsigned int drawFlags);
1.103 - void SendRawDisplay(int client, int priority, unsigned int time);
1.104 - void DeleteThis();
1.105 - bool SetSelectableKeys(unsigned int keymap);
1.106 - unsigned int GetCurrentKey();
1.107 - bool SetCurrentKey(unsigned int key);
1.108 - int GetAmountRemaining();
1.109 -private:
1.110 - KeyValues *m_pKv;
1.111 - unsigned int m_NextPos;
1.112 - bool m_TitleDrawn;
1.113 -};
1.114 -
1.115 -class CValveMenu : public CBaseMenu
1.116 -{
1.117 - friend class CValveMenuDisplay;
1.118 -public:
1.119 - CValveMenu(IMenuHandler *pHandler, IdentityToken_t *pOwner);
1.120 -public: //IBaseMenu
1.121 - bool SetExtOption(MenuOption option, const void *valuePtr);
1.122 - IMenuPanel *CreatePanel();
1.123 - bool GetExitButton();
1.124 - bool SetExitButton(bool set);
1.125 - bool SetPagination(unsigned int itemsPerPage);
1.126 - bool Display(int client, unsigned int time, IMenuHandler *alt_handler=NULL);
1.127 - bool DisplayAtItem(int client,
1.128 - unsigned int time,
1.129 - unsigned int start_item,
1.130 - IMenuHandler *alt_handler/* =NULL */);
1.131 - void SetMenuOptionFlags(unsigned int flags);
1.132 -public: //CBaseMenu
1.133 - void Cancel_Finally();
1.134 -private:
1.135 - Color m_IntroColor;
1.136 - char m_IntroMsg[128];
1.137 -};
1.138 -
1.139 -extern ValveMenuStyle g_ValveMenuStyle;
1.140 -
1.141 -#endif //_INCLUDE_MENUSTYLE_VALVE_H