Delete SpyCustom directory

This commit is contained in:
0TheSpy
2021-06-16 18:41:43 +03:00
committed by GitHub
parent 083d42295a
commit 9cb9fd6180
407 changed files with 0 additions and 160383 deletions

View File

@ -1,31 +0,0 @@
#ifndef ANALOGCODE_H
#define ANALOGCODE_H
#ifdef _WIN32
#pragma once
#endif
#include "InputEnums.h"
#define JOYSTICK_AXIS_INTERNAL( _joystick, _axis ) ( JOYSTICK_FIRST_AXIS + ((_joystick) * MAX_JOYSTICK_AXES) + (_axis) )
#define JOYSTICK_AXIS( _joystick, _axis ) ( (AnalogCode_t)JOYSTICK_AXIS_INTERNAL( _joystick, _axis ) )
enum AnalogCode_t
{
ANALOG_CODE_INVALID = -1,
MOUSE_X = 0,
MOUSE_Y,
MOUSE_XY,
MOUSE_WHEEL,
JOYSTICK_FIRST_AXIS,
JOYSTICK_LAST_AXIS = JOYSTICK_AXIS_INTERNAL(MAX_JOYSTICKS - 1, MAX_JOYSTICK_AXES - 1),
ANALOG_CODE_LAST,
};
#endif

View File

@ -1,143 +0,0 @@
#ifndef VGUI_BUILDGROUP_H
#define VGUI_BUILDGROUP_H
#ifdef _WIN32
#pragma once
#endif
#include "utlvector.h"
#include "utlsymbol.h"
#include "vgui.h"
#include "Dar.h"
#include "Cursor.h"
#include "IScheme.h"
#include "Controls.h"
#include "PHandle.h"
#include "utlhandletable.h"
class KeyValues;
namespace vgui
{
class BuildGroup
{
DECLARE_HANDLES(BuildGroup, 20);
public:
BuildGroup(Panel* parentPanel, Panel* contextPanel);
~BuildGroup();
virtual void SetEnabled(bool state);
virtual bool IsEnabled();
virtual Panel* GetCurrentPanel();
virtual void LoadControlSettings(const char* controlResourceName, const char* pathID = NULL, KeyValues* pPreloadedKeyValues = NULL, KeyValues* pConditions = NULL);
void ReloadControlSettings();
void ChangeControlSettingsFile(const char* controlResourceName);
virtual bool SaveControlSettings();
virtual void ApplySettings(KeyValues* resourceData);
virtual void GetSettings(KeyValues* resourceData);
virtual void RemoveSettings();
void GetNewFieldName(char* newFieldName, int newFieldNameSize, Panel* newPanel);
Panel* FieldNameTaken(const char* fieldName);
Panel* NewControl(KeyValues* controlKeys, int x = 0, int y = 0);
Panel* NewControl(const char* name, int x = 0, int y = 0);
virtual void SetContextPanel(Panel* contextPanel);
virtual Panel* GetContextPanel();
CUtlVector<PHandle>* GetPanelList();
virtual const char* GetResourceName(void) { return m_pResourceName; }
void PanelAdded(Panel* panel);
void PanelRemoved(Panel* panel);
virtual bool MousePressed(MouseCode code, Panel* panel);
virtual bool MouseReleased(MouseCode code, Panel* panel);
virtual CUtlVector<PHandle>* GetControlGroup();
virtual void ToggleRulerDisplay();
virtual void SetRulerLabelsVisible(bool state);
virtual bool HasRulersOn();
virtual void DrawRulers();
void RegisterControlSettingsFile(const char* controlResourceName, const char* pathID = NULL);
int GetRegisteredControlSettingsFileCount();
const char* GetRegisteredControlSettingsFileByIndex(int index);
KeyValues* GetDialogVariables();
void ProcessConditionalKeys(KeyValues* pDat, KeyValues* pConditions);
protected:
virtual bool CursorMoved(int x, int y, Panel* panel);
virtual bool MouseDoublePressed(MouseCode code, Panel* panel);
virtual bool KeyCodeTyped(KeyCode code, Panel* panel);
virtual bool KeyCodeReleased(KeyCode code, Panel* panel);
virtual void ApplySchemeSettings(IScheme* pScheme);
virtual bool KeyTyped(wchar_t unichar, Panel* panel);
virtual HCursor GetCursor(Panel* panel);
private:
void ApplySnap(Panel* panel);
Panel* CreateBuildDialog();
void ActivateBuildDialog();
void DeleteAllControlsCreatedByControlSettingsFile();
bool _enabled;
int _snapX;
int _snapY;
HCursor _cursor_sizenwse;
HCursor _cursor_sizenesw;
HCursor _cursor_sizewe;
HCursor _cursor_sizens;
HCursor _cursor_sizeall;
bool _dragging;
MouseCode _dragMouseCode;
int _dragStartPanelPos[2];
int _dragStartCursorPos[2];
int _dragStartPanelSize[2];
Panel* _currentPanel;
CUtlVector<PHandle> _panelDar;
char* m_pResourceName;
char* m_pResourcePathID;
PHandle m_hBuildDialog;
Panel* m_pBuildContext;
Panel* m_pParentPanel;
CUtlVector<PHandle> _controlGroup;
CUtlVector<int> _groupDeltaX;
CUtlVector<int> _groupDeltaY;
Label* _rulerNumber[4];
bool _showRulers;
CUtlVector<CUtlSymbol> m_RegisteredControlSettingsFiles;
friend class Panel;
};
typedef CUtlHandle<BuildGroup> HBuildGroup;
}
#endif

View File

@ -1,185 +0,0 @@
#ifndef BUTTON_H
#define BUTTON_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "Dar.h"
#include "Color.h"
#include "Label.h"
#include "MouseCode.h"
namespace vgui
{
class Button : public Label
{
DECLARE_CLASS_SIMPLE(Button, Label);
public:
Button(Panel* parent, const char* panelName, const char* text, Panel* pActionSignalTarget = NULL, const char* pCmd = NULL);
Button(Panel* parent, const char* panelName, const wchar_t* text, Panel* pActionSignalTarget = NULL, const char* pCmd = NULL);
~Button();
private:
void Init();
public:
virtual void SetArmed(bool state);
virtual bool IsArmed(void);
virtual bool IsDepressed();
virtual void ForceDepressed(bool state);
virtual void RecalculateDepressedState(void);
virtual void SetSelected(bool state);
virtual bool IsSelected(void);
virtual void SetBlink(bool state);
virtual bool IsBlinking(void);
virtual void SetUseCaptureMouse(bool state);
virtual bool IsUseCaptureMouseEnabled(void);
MESSAGE_FUNC(DoClick, "PressButton");
MESSAGE_FUNC(OnHotkey, "Hotkey")
{
DoClick();
}
virtual void SetMouseClickEnabled(MouseCode code, bool state);
virtual bool IsMouseClickEnabled(MouseCode code);
enum ActivationType_t
{
ACTIVATE_ONPRESSEDANDRELEASED,
ACTIVATE_ONPRESSED,
ACTIVATE_ONRELEASED,
};
virtual void SetButtonActivationType(ActivationType_t activationType);
virtual void FireActionSignal(void);
virtual void PerformLayout();
virtual bool RequestInfo(KeyValues* data);
virtual bool CanBeDefaultButton(void);
MESSAGE_FUNC_INT(SetAsDefaultButton, "SetAsDefaultButton", state);
MESSAGE_FUNC_INT(SetAsCurrentDefaultButton, "SetAsCurrentDefaultButton", state);
virtual void OnSetFocus();
virtual void OnKillFocus();
virtual void SetButtonBorderEnabled(bool state);
virtual void SetDefaultColor(Color fgColor, Color bgColor);
virtual void SetArmedColor(Color fgColor, Color bgColor);
virtual void SetSelectedColor(Color fgColor, Color bgColor);
virtual void SetDepressedColor(Color fgColor, Color bgColor);
virtual void SetBlinkColor(Color fgColor);
virtual Color GetButtonFgColor();
virtual Color GetButtonBgColor();
Color GetButtonDefaultFgColor() { return _defaultFgColor; }
Color GetButtonDefaultBgColor() { return _defaultBgColor; }
Color GetButtonArmedFgColor() { return _armedFgColor; }
Color GetButtonArmedBgColor() { return _armedBgColor; }
Color GetButtonSelectedFgColor() { return _selectedFgColor; }
Color GetButtonSelectedBgColor() { return _selectedBgColor; }
Color GetButtonDepressedFgColor() { return _depressedFgColor; }
Color GetButtonDepressedBgColor() { return _depressedBgColor; }
virtual void SetDefaultBorder(IBorder* border);
virtual void SetDepressedBorder(IBorder* border);
virtual void SetKeyFocusBorder(IBorder* border);
virtual void SetCommand(const char* command);
virtual void SetCommand(KeyValues* message);
void SetArmedSound(const char* sound);
void SetDepressedSound(const char* sound);
void SetReleasedSound(const char* sound);
virtual void OnCursorEntered();
virtual void OnCursorExited();
virtual void SizeToContents();
virtual KeyValues* GetCommand();
bool IsDrawingFocusBox();
void DrawFocusBox(bool bEnable);
bool ShouldPaint() { return _paint; }
void SetShouldPaint(bool paint) { _paint = paint; }
virtual void ApplySettings(KeyValues* inResourceData);
virtual void NavigateTo();
virtual void NavigateFrom();
protected:
virtual void DrawFocusBorder(int tx0, int ty0, int tx1, int ty1);
virtual void Paint(void);
virtual IBorder* GetBorder(bool depressed, bool armed, bool selected, bool keyfocus);
virtual void ApplySchemeSettings(IScheme* pScheme);
MESSAGE_FUNC_INT(OnSetState, "SetState", state);
virtual void OnMousePressed(MouseCode code);
virtual void OnMouseDoublePressed(MouseCode code);
virtual void OnMouseReleased(MouseCode code);
virtual void OnKeyCodePressed(KeyCode code);
virtual void OnKeyCodeReleased(KeyCode code);
virtual void GetSettings(KeyValues* outResourceData);
virtual const char* GetDescription(void);
KeyValues* GetActionMessage();
void PlayButtonReleasedSound();
protected:
enum ButtonFlags_t
{
ARMED = 0x0001,
DEPRESSED = 0x0002,
FORCE_DEPRESSED = 0x0004,
BUTTON_BORDER_ENABLED = 0x0008,
USE_CAPTURE_MOUSE = 0x0010,
BUTTON_KEY_DOWN = 0x0020,
DEFAULT_BUTTON = 0x0040,
SELECTED = 0x0080,
DRAW_FOCUS_BOX = 0x0100,
BLINK = 0x0200,
ALL_FLAGS = 0xFFFF,
};
CUtlFlags< unsigned short > _buttonFlags;
int _mouseClickMask;
KeyValues* _actionMessage;
ActivationType_t _activationType;
IBorder* _defaultBorder;
IBorder* _depressedBorder;
IBorder* _keyFocusBorder;
Color _defaultFgColor, _defaultBgColor;
Color _armedFgColor, _armedBgColor;
Color _selectedFgColor, _selectedBgColor;
Color _depressedFgColor, _depressedBgColor;
Color _keyboardFocusColor;
Color _blinkFgColor;
bool _paint;
unsigned short m_sArmedSoundName, m_sDepressedSoundName, m_sReleasedSoundName;
bool m_bSelectionStateSaved;
bool m_bStaySelectedOnClick;
};
}
#endif

View File

@ -1,364 +0,0 @@
#ifndef BUTTONCODE_H
#define BUTTONCODE_H
#ifdef _WIN32
#pragma once
#endif
#include "InputEnums.h"
#include "mathlib.h"
enum
{
JOYSTICK_MAX_BUTTON_COUNT = 32,
JOYSTICK_POV_BUTTON_COUNT = 4,
JOYSTICK_AXIS_BUTTON_COUNT = MAX_JOYSTICK_AXES * 2,
};
#define JOYSTICK_BUTTON_INTERNAL( _joystick, _button ) ( JOYSTICK_FIRST_BUTTON + ((_joystick) * JOYSTICK_MAX_BUTTON_COUNT) + (_button) )
#define JOYSTICK_POV_BUTTON_INTERNAL( _joystick, _button ) ( JOYSTICK_FIRST_POV_BUTTON + ((_joystick) * JOYSTICK_POV_BUTTON_COUNT) + (_button) )
#define JOYSTICK_AXIS_BUTTON_INTERNAL( _joystick, _button ) ( JOYSTICK_FIRST_AXIS_BUTTON + ((_joystick) * JOYSTICK_AXIS_BUTTON_COUNT) + (_button) )
#define JOYSTICK_BUTTON( _joystick, _button ) ( (ButtonCode_t)JOYSTICK_BUTTON_INTERNAL( _joystick, _button ) )
#define JOYSTICK_POV_BUTTON( _joystick, _button ) ( (ButtonCode_t)JOYSTICK_POV_BUTTON_INTERNAL( _joystick, _button ) )
#define JOYSTICK_AXIS_BUTTON( _joystick, _button ) ( (ButtonCode_t)JOYSTICK_AXIS_BUTTON_INTERNAL( _joystick, _button ) )
enum ButtonCode_t
{
BUTTON_CODE_INVALID = -1,
BUTTON_CODE_NONE = 0,
KEY_FIRST = 0,
KEY_NONE = KEY_FIRST,
KEY_0,
KEY_1,
KEY_2,
KEY_3,
KEY_4,
KEY_5,
KEY_6,
KEY_7,
KEY_8,
KEY_9,
KEY_A,
KEY_B,
KEY_C,
KEY_D,
KEY_E,
KEY_F,
KEY_G,
KEY_H,
KEY_I,
KEY_J,
KEY_K,
KEY_L,
KEY_M,
KEY_N,
KEY_O,
KEY_P,
KEY_Q,
KEY_R,
KEY_S,
KEY_T,
KEY_U,
KEY_V,
KEY_W,
KEY_X,
KEY_Y,
KEY_Z,
KEY_PAD_0,
KEY_PAD_1,
KEY_PAD_2,
KEY_PAD_3,
KEY_PAD_4,
KEY_PAD_5,
KEY_PAD_6,
KEY_PAD_7,
KEY_PAD_8,
KEY_PAD_9,
KEY_PAD_DIVIDE,
KEY_PAD_MULTIPLY,
KEY_PAD_MINUS,
KEY_PAD_PLUS,
KEY_PAD_ENTER,
KEY_PAD_DECIMAL,
KEY_LBRACKET,
KEY_RBRACKET,
KEY_SEMICOLON,
KEY_APOSTROPHE,
KEY_BACKQUOTE,
KEY_COMMA,
KEY_PERIOD,
KEY_SLASH,
KEY_BACKSLASH,
KEY_MINUS,
KEY_EQUAL,
KEY_ENTER,
KEY_SPACE,
KEY_BACKSPACE,
KEY_TAB,
KEY_CAPSLOCK,
KEY_NUMLOCK,
KEY_ESCAPE,
KEY_SCROLLLOCK,
KEY_INSERT,
KEY_DELETE,
KEY_HOME,
KEY_END,
KEY_PAGEUP,
KEY_PAGEDOWN,
KEY_BREAK,
KEY_LSHIFT,
KEY_RSHIFT,
KEY_LALT,
KEY_RALT,
KEY_LCONTROL,
KEY_RCONTROL,
KEY_LWIN,
KEY_RWIN,
KEY_APP,
KEY_UP,
KEY_LEFT,
KEY_DOWN,
KEY_RIGHT,
KEY_F1,
KEY_F2,
KEY_F3,
KEY_F4,
KEY_F5,
KEY_F6,
KEY_F7,
KEY_F8,
KEY_F9,
KEY_F10,
KEY_F11,
KEY_F12,
KEY_CAPSLOCKTOGGLE,
KEY_NUMLOCKTOGGLE,
KEY_SCROLLLOCKTOGGLE,
KEY_LAST = KEY_SCROLLLOCKTOGGLE,
KEY_COUNT = KEY_LAST - KEY_FIRST + 1,
MOUSE_FIRST = KEY_LAST + 1,
MOUSE_LEFT = MOUSE_FIRST,
MOUSE_RIGHT,
MOUSE_MIDDLE,
MOUSE_4,
MOUSE_5,
MOUSE_WHEEL_UP,
MOUSE_WHEEL_DOWN,
MOUSE_LAST = MOUSE_WHEEL_DOWN,
MOUSE_COUNT = MOUSE_LAST - MOUSE_FIRST + 1,
JOYSTICK_FIRST = MOUSE_LAST + 1,
JOYSTICK_FIRST_BUTTON = JOYSTICK_FIRST,
JOYSTICK_LAST_BUTTON = JOYSTICK_BUTTON_INTERNAL(MAX_JOYSTICKS - 1, JOYSTICK_MAX_BUTTON_COUNT - 1),
JOYSTICK_FIRST_POV_BUTTON,
JOYSTICK_LAST_POV_BUTTON = JOYSTICK_POV_BUTTON_INTERNAL(MAX_JOYSTICKS - 1, JOYSTICK_POV_BUTTON_COUNT - 1),
JOYSTICK_FIRST_AXIS_BUTTON,
JOYSTICK_LAST_AXIS_BUTTON = JOYSTICK_AXIS_BUTTON_INTERNAL(MAX_JOYSTICKS - 1, JOYSTICK_AXIS_BUTTON_COUNT - 1),
JOYSTICK_LAST = JOYSTICK_LAST_AXIS_BUTTON,
#if !defined ( _X360 )
NOVINT_FIRST = JOYSTICK_LAST + 2,
NOVINT_LOGO_0 = NOVINT_FIRST,
NOVINT_TRIANGLE_0,
NOVINT_BOLT_0,
NOVINT_PLUS_0,
NOVINT_LOGO_1,
NOVINT_TRIANGLE_1,
NOVINT_BOLT_1,
NOVINT_PLUS_1,
NOVINT_LAST = NOVINT_PLUS_1,
#endif
BUTTON_CODE_LAST,
BUTTON_CODE_COUNT = BUTTON_CODE_LAST - KEY_FIRST + 1,
KEY_XBUTTON_UP = JOYSTICK_FIRST_POV_BUTTON,
KEY_XBUTTON_RIGHT,
KEY_XBUTTON_DOWN,
KEY_XBUTTON_LEFT,
KEY_XBUTTON_A = JOYSTICK_FIRST_BUTTON,
KEY_XBUTTON_B,
KEY_XBUTTON_X,
KEY_XBUTTON_Y,
KEY_XBUTTON_LEFT_SHOULDER,
KEY_XBUTTON_RIGHT_SHOULDER,
KEY_XBUTTON_BACK,
KEY_XBUTTON_START,
KEY_XBUTTON_STICK1,
KEY_XBUTTON_STICK2,
KEY_XSTICK1_RIGHT = JOYSTICK_FIRST_AXIS_BUTTON,
KEY_XSTICK1_LEFT,
KEY_XSTICK1_DOWN,
KEY_XSTICK1_UP,
KEY_XBUTTON_LTRIGGER,
KEY_XBUTTON_RTRIGGER,
KEY_XSTICK2_RIGHT,
KEY_XSTICK2_LEFT,
KEY_XSTICK2_DOWN,
KEY_XSTICK2_UP,
};
inline bool IsAlpha(ButtonCode_t code)
{
return (code >= KEY_A) && (code <= KEY_Z);
}
inline bool IsAlphaNumeric(ButtonCode_t code)
{
return (code >= KEY_0) && (code <= KEY_Z);
}
inline bool IsSpace(ButtonCode_t code)
{
return (code == KEY_ENTER) || (code == KEY_TAB) || (code == KEY_SPACE);
}
inline bool IsKeypad(ButtonCode_t code)
{
return (code >= MOUSE_FIRST) && (code <= KEY_PAD_DECIMAL);
}
inline bool IsPunctuation(ButtonCode_t code)
{
return (code >= KEY_0) && (code <= KEY_SPACE) && !IsAlphaNumeric(code) && !IsSpace(code) && !IsKeypad(code);
}
inline bool IsKeyCode(ButtonCode_t code)
{
return (code >= KEY_FIRST) && (code <= KEY_LAST);
}
inline bool IsMouseCode(ButtonCode_t code)
{
return (code >= MOUSE_FIRST) && (code <= MOUSE_LAST);
}
inline bool IsNovintCode(ButtonCode_t code)
{
#if !defined ( _X360 )
return ((code >= NOVINT_FIRST) && (code <= NOVINT_LAST));
#else
return false;
#endif
}
inline bool IsNovintButtonCode(ButtonCode_t code)
{
#if !defined ( _X360 )
return IsNovintCode(code);
#else
return false;
#endif
}
inline bool IsJoystickCode(ButtonCode_t code)
{
return (((code >= JOYSTICK_FIRST) && (code <= JOYSTICK_LAST)) || IsNovintCode(code));
}
inline bool IsJoystickButtonCode(ButtonCode_t code)
{
return (((code >= JOYSTICK_FIRST_BUTTON) && (code <= JOYSTICK_LAST_BUTTON)) || IsNovintButtonCode(code));
}
inline bool IsJoystickPOVCode(ButtonCode_t code)
{
return (code >= JOYSTICK_FIRST_POV_BUTTON) && (code <= JOYSTICK_LAST_POV_BUTTON);
}
inline bool IsJoystickAxisCode(ButtonCode_t code)
{
return (code >= JOYSTICK_FIRST_AXIS_BUTTON) && (code <= JOYSTICK_LAST_AXIS_BUTTON);
}
inline ButtonCode_t GetBaseButtonCode(ButtonCode_t code)
{
if (IsJoystickButtonCode(code))
{
int offset = (code - JOYSTICK_FIRST_BUTTON) % JOYSTICK_MAX_BUTTON_COUNT;
return (ButtonCode_t)(JOYSTICK_FIRST_BUTTON + offset);
}
if (IsJoystickPOVCode(code))
{
int offset = (code - JOYSTICK_FIRST_POV_BUTTON) % JOYSTICK_POV_BUTTON_COUNT;
return (ButtonCode_t)(JOYSTICK_FIRST_POV_BUTTON + offset);
}
if (IsJoystickAxisCode(code))
{
int offset = (code - JOYSTICK_FIRST_AXIS_BUTTON) % JOYSTICK_AXIS_BUTTON_COUNT;
return (ButtonCode_t)(JOYSTICK_FIRST_AXIS_BUTTON + offset);
}
return code;
}
inline int GetJoystickForCode(ButtonCode_t code)
{
if (!IsJoystickCode(code))
return 0;
if (IsJoystickButtonCode(code))
{
int offset = (code - JOYSTICK_FIRST_BUTTON) / JOYSTICK_MAX_BUTTON_COUNT;
return offset;
}
if (IsJoystickPOVCode(code))
{
int offset = (code - JOYSTICK_FIRST_POV_BUTTON) / JOYSTICK_POV_BUTTON_COUNT;
return offset;
}
if (IsJoystickAxisCode(code))
{
int offset = (code - JOYSTICK_FIRST_AXIS_BUTTON) / JOYSTICK_AXIS_BUTTON_COUNT;
return offset;
}
return 0;
}
inline ButtonCode_t ButtonCodeToJoystickButtonCode(ButtonCode_t code, int nDesiredJoystick)
{
if (!IsJoystickCode(code) || nDesiredJoystick == 0)
return code;
nDesiredJoystick = ::clamp<int>(nDesiredJoystick, 0, MAX_JOYSTICKS - 1);
code = GetBaseButtonCode(code);
if (IsJoystickButtonCode(code))
{
int nOffset = code - JOYSTICK_FIRST_BUTTON;
return JOYSTICK_BUTTON(nDesiredJoystick, nOffset);
}
if (IsJoystickPOVCode(code))
{
int nOffset = code - JOYSTICK_FIRST_POV_BUTTON;
return JOYSTICK_POV_BUTTON(nDesiredJoystick, nOffset);
}
if (IsJoystickAxisCode(code))
{
int nOffset = code - JOYSTICK_FIRST_AXIS_BUTTON;
return JOYSTICK_AXIS_BUTTON(nDesiredJoystick, nOffset);
}
return code;
}
#endif

View File

@ -1,48 +0,0 @@
#pragma once
class ECommandMsgBoxSlot;
class KeyValues;
class IPanel;
class CGameUI {
public:
virtual void Initialize(void* (*)(char const*, int*)) = 0;
virtual void PostInit(void) = 0;
virtual void Connect(void* (*)(char const*, int*)) = 0;
virtual void Start(void) = 0;
virtual void Shutdown(void) = 0;
virtual void RunFrame(void) = 0;
virtual void OnGameUIActivated(void) = 0;
virtual void OnGameUIHidden(void) = 0;
virtual void OLD_OnConnectToServer(char const*, int, int) = 0;
virtual void OnDisconnectFromServer_OLD(unsigned char, char const*) = 0;
virtual void OnLevelLoadingStarted(char const*, bool) = 0;
virtual void OnLevelLoadingFinished(bool, char const*, char const*) = 0;
virtual void StartLoadingScreenForCommand(char const*) = 0;
virtual void StartLoadingScreenForKeyValues(KeyValues*) = 0;
virtual void UpdateProgressBar(float, char const*, bool) = 0;
virtual void SetShowProgressText(bool) = 0;
virtual void UpdateSecondaryProgressBar(float, wchar_t const*) = 0;
virtual void SetProgressLevelName(char const*) = 0;
virtual void ShowMessageDialog(unsigned int, IPanel*) = 0;
virtual void ShowMessageDialog(char const*, char const*) = 0;
virtual void CreateCommandMsgBox(char const*, char const*, bool, bool, char const*, char const*, char const*, char const*, char const*) = 0;
virtual void CreateCommandMsgBoxInSlot(ECommandMsgBoxSlot, char const*, char const*, bool, bool, char const*, char const*, char const*, char const*) = 0;
virtual void SetLoadingBackgroundDialog(unsigned long long) = 0;
virtual void OnConnectToServer2(char const*, int, int, int) = 0;
virtual void SetProgressOnStart(void) = 0;
virtual void OnDisconnectFromServer(unsigned char) = 0;
virtual void NeedConnectionProblemWaitScreen(void) = 0;
virtual void ShowPasswordUI(char const*) = 0;
virtual void LoadingProgressWantsIsolatedRender(bool) = 0;
virtual bool IsPlayingFullScreenVideo(void) = 0;
virtual bool IsTransitionEffectEnabled(void) = 0;
virtual bool IsInLevel(void) = 0;
virtual void RestoreTopLevelMenu(void) = 0;
virtual void StartProgressBar(void) = 0;
virtual void ContinueProgressBar(float, bool) = 0;
virtual void StopProgressBar(bool, char const*, char const*) = 0;
virtual void SetProgressBarStatusText(char const*, bool) = 0;
virtual void SetSecondaryProgressBar(float) = 0;
virtual void SetSecondaryProgressBarText(wchar_t const*) = 0;
};

View File

@ -1,85 +0,0 @@
#ifndef CHECKBUTTON_H
#define CHECKBUTTON_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "ToggleButton.h"
#include "TextImage.h"
namespace vgui
{
class TextImage;
class CheckImage : public TextImage
{
public:
CheckImage(CheckButton* CheckButton) : TextImage("g")
{
_CheckButton = CheckButton;
SetSize(20, 13);
}
virtual void Paint();
virtual void SetColor(Color color)
{
_borderColor1 = color;
_borderColor2 = color;
_checkColor = color;
}
Color _borderColor1;
Color _borderColor2;
Color _checkColor;
Color _bgColor;
private:
CheckButton* _CheckButton;
};
class CheckButton : public ToggleButton
{
DECLARE_CLASS_SIMPLE(CheckButton, ToggleButton);
public:
CheckButton(Panel* parent, const char* panelName, const char* text);
~CheckButton();
virtual void SetSelected(bool state);
virtual void SetCheckButtonCheckable(bool state);
virtual bool IsCheckButtonCheckable() const { return m_bCheckButtonCheckable; }
Color GetDisabledFgColor() { return _disabledFgColor; }
Color GetDisabledBgColor() { return _disabledBgColor; }
CheckImage* GetCheckImage() { return _checkBoxImage; }
virtual void SetHighlightColor(Color fgColor);
protected:
virtual void ApplySchemeSettings(IScheme* pScheme);
MESSAGE_FUNC_PTR(OnCheckButtonChecked, "CheckButtonChecked", panel);
virtual Color GetButtonFgColor();
virtual IBorder* GetBorder(bool depressed, bool armed, bool selected, bool keyfocus);
private:
enum { CHECK_INSET = 6 };
bool m_bCheckButtonCheckable;
CheckImage* _checkBoxImage;
Color _disabledFgColor;
Color _disabledBgColor;
Color _highlightFgColor;
};
}
#endif

View File

@ -1,85 +0,0 @@
#ifndef COLOR_H
#define COLOR_H
#ifdef _WIN32
#pragma once
#endif
class Color
{
public:
Color()
{
*((int*)this) = 0;
}
Color(int _r, int _g, int _b)
{
SetColor(_r, _g, _b, 0);
}
Color(int _r, int _g, int _b, int _a)
{
SetColor(_r, _g, _b, _a);
}
void SetColor(int _r, int _g, int _b, int _a = 0)
{
_color[0] = (unsigned char)_r;
_color[1] = (unsigned char)_g;
_color[2] = (unsigned char)_b;
_color[3] = (unsigned char)_a;
}
void GetColor(int& _r, int& _g, int& _b, int& _a) const
{
_r = _color[0];
_g = _color[1];
_b = _color[2];
_a = _color[3];
}
void SetRawColor(int color32)
{
*((int*)this) = color32;
}
int GetRawColor() const
{
return *((int*)this);
}
inline int r() const { return _color[0]; }
inline int g() const { return _color[1]; }
inline int b() const { return _color[2]; }
inline int a() const { return _color[3]; }
unsigned char& operator[](int index)
{
return _color[index];
}
const unsigned char& operator[](int index) const
{
return _color[index];
}
bool operator == (const Color& rhs) const
{
return (*((int*)this) == *((int*)&rhs));
}
bool operator != (const Color& rhs) const
{
return !(operator==(rhs));
}
Color& operator=(const Color& rhs)
{
SetRawColor(rhs.GetRawColor());
return *this;
}
unsigned char _color[4];
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,107 +0,0 @@
#ifndef CONFIG
#define CONFIG
#pragma once
#include "Options.hpp"
#include "Singleton.hpp"
#include <fstream>
#include <sstream>
std::vector<char> HexToBytes(const std::string& hex) {
std::vector<char> res;
for (auto i = 0u; i < hex.length(); i += 2) {
std::string byteString = hex.substr(i, 2);
char byte = (char)strtol(byteString.c_str(), NULL, 16);
res.push_back(byte);
}
return res;
}
std::string BytesToString(unsigned char* data, int len) {
constexpr char hexmap[] = { '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
std::string res(len * 2, ' ');
for (int i = 0; i < len; ++i) {
res[2 * i] = hexmap[(data[i] & 0xF0) >> 4];
res[2 * i + 1] = hexmap[data[i] & 0x0F];
}
return res;
}
std::vector<std::string> Split(const std::string& str, const char* delim) {
std::vector<std::string> res;
char* pTempStr = _strdup(str.c_str());
char* context = NULL;
char* pWord = strtok_s(pTempStr, delim, &context);
while (pWord != NULL) {
res.push_back(pWord);
pWord = strtok_s(NULL, delim, &context);
}
free(pTempStr);
return res;
}
class Config : public Singleton<Config> {
public:
void Save() {
std::ofstream fout("seaside210616.cfg", std::ios::binary);
const auto sz = sizeof(Options);
const auto var_sz = sizeof(Var<bool>);
const auto cnt = sz / var_sz;
for (auto i = 0; i < cnt; i++) {
const auto el = &(*(Var<int>*)(&g_Options)) + i;
auto name = el->name;
auto val = el->value;
auto sizeof_val = el->size;
fout << name << "\t" << BytesToString((unsigned char*)*(int*)&val, sizeof_val) << std::endl;
}
fout.close();
}
bool file_exists(std::string filename) {
std::ifstream ifile(filename);
return (bool)ifile;
}
void Load() {
opt.loading = 1;
if (file_exists("seaside210616.cfg") ) {
std::ifstream fin("seaside210616.cfg", std::ios::binary);
std::stringstream ss;
ss << fin.rdbuf();
auto lines = Split(ss.str(), "\n");
for (auto line : lines) {
auto data = Split(line, "\t");
const auto sz = sizeof(Options);
const auto var_sz = sizeof(Var<bool>);
const auto cnt = sz / var_sz;
for (auto i = 0; i < cnt; i++) {
const auto& el = &(*(Var<bool>*)(&g_Options)) + i;
if (data[0] == el->name) {
auto bytes = HexToBytes(data[1]);
memcpy(*(void**)&el->value, bytes.data(), el->size);
}
}
}
fin.close();
OnLoadCfg();
}
else iff.g_pGameUI->CreateCommandMsgBox("Seaside Error", "Unable to find configuration file!", true, false, "", "", "", "", "");
}
};
#endif

View File

@ -1,103 +0,0 @@
#ifndef CONTROLS_H
#define CONTROLS_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "IPanel.h"
#include "IKeyValuesSystem.h"
#include "interface.h"
#include "MouseCode.h"
#include "KeyCode.h"
#include "tier3.h"
namespace vgui
{
bool VGui_InitInterfacesList(const char* moduleName, CreateInterfaceFn* factoryList, int numFactories);
const char* GetControlsModuleName();
class IPanel;
class IInput;
class ISchemeManager;
class ISurface;
class ISystem;
class IVGui;
class AnalogBar;
class AnimatingImagePanel;
class AnimationController;
class BuildModeDialog;
class Button;
class CheckButton;
class CheckButtonList;
class CircularProgressBar;
template< class T >class CvarToggleCheckButton;
class ComboBox;
class DirectorySelectDialog;
class Divider;
class EditablePanel;
class FileOpenDialog;
class Frame;
class GraphPanel;
class HTML;
class ImagePanel;
class Label;
class ListPanel;
class ListViewPanel;
class Menu;
class MenuBar;
class MenuButton;
class MenuItem;
class MessageBox;
class Panel;
class PanelListPanel;
class ProgressBar;
class ProgressBox;
class PropertyDialog;
class PropertyPage;
class PropertySheet;
class QueryBox;
class RadioButton;
class RichText;
class ScalableImagePanel;
class ScrollBar;
class ScrollBarSlider;
class SectionedListPanel;
class Slider;
class Splitter;
class TextEntry;
class ToggleButton;
class BaseTooltip;
class TextTooltip;
class TreeView;
class CTreeViewListControl;
class URLLabel;
class WizardPanel;
class WizardSubPanel;
class BuildGroup;
class FocusNavGroup;
class IBorder;
class IImage;
class Image;
class ImageList;
class TextImage;
}
#define VGUI_HOTKEYS_ENABLED
#define USING_BUILD_FACTORY( className ) \
extern className *g_##className##LinkerHack; \
className *g_##className##PullInModule = g_##className##LinkerHack;
#define USING_BUILD_FACTORY_ALIAS( className, factoryName ) \
extern className *g_##factoryName##LinkerHack; \
className *g_##factoryName##PullInModule = g_##factoryName##LinkerHack;
#endif

View File

@ -1,40 +0,0 @@
#ifndef CURSOR_H
#define CURSOR_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
namespace vgui
{
enum CursorCode
{
dc_user,
dc_none,
dc_arrow,
dc_ibeam,
dc_hourglass,
dc_waitarrow,
dc_crosshair,
dc_up,
dc_sizenwse,
dc_sizenesw,
dc_sizewe,
dc_sizens,
dc_sizeall,
dc_no,
dc_hand,
dc_blank,
dc_last,
dc_alwaysvisible_push,
dc_alwaysvisible_pop,
};
typedef unsigned long HCursor;
}
#endif

View File

@ -1,121 +0,0 @@
#ifndef DAR_H
#define DAR_H
#ifdef _WIN32
#pragma once
#endif
#include <stdlib.h>
#include <string.h>
#include "VGUI.h"
#include "utlvector.h"
#include "memdbgon.h"
namespace vgui
{
template<class ELEMTYPE> class Dar : public CUtlVector< ELEMTYPE >
{
typedef CUtlVector< ELEMTYPE > BaseClass;
public:
Dar()
{
}
Dar(int initialCapacity) :
BaseClass(0, initialCapacity)
{
}
public:
void SetCount(int count)
{
this->EnsureCount(count);
}
int GetCount()
{
return this->Count();
}
int AddElement(ELEMTYPE elem)
{
return this->AddToTail(elem);
}
void MoveElementToEnd(ELEMTYPE elem)
{
if (this->Count() == 0)
return;
if (this->Element(this->Count() - 1) == elem)
return;
int idx = this->GetOffset(elem);
if (idx == this->InvalidIndex())
return;
this->Remove(idx);
this->AddToTail(elem);
}
int FindElement(ELEMTYPE elem)
{
return this->GetOffset(elem);
}
bool HasElement(ELEMTYPE elem)
{
if (this->FindElement(elem) != this->InvalidIndex())
{
return true;
}
return false;
}
int PutElement(ELEMTYPE elem)
{
int index = this->FindElement(elem);
if (index >= 0)
{
return index;
}
return this->AddElement(elem);
}
void InsertElementAt(ELEMTYPE elem, int index)
{
this->InsertBefore(index, elem);
}
void SetElementAt(ELEMTYPE elem, int index)
{
this->EnsureCount(index + 1);
this->Element(index) = elem;
}
void RemoveElementAt(int index)
{
this->Remove(index);
}
void RemoveElementsBefore(int index)
{
if (index <= 0)
return;
this->RemoveMultiple(0, index - 1);
}
void RemoveElement(ELEMTYPE elem)
{
this->FindAndRemove(elem);
}
void* GetBaseData()
{
return this->Base();
}
void CopyFrom(Dar<ELEMTYPE>& dar)
{
this->CopyArray(dar.Base(), dar.Count());
}
};
}
#include "memdbgoff.h"
#endif

View File

@ -1,98 +0,0 @@
#ifndef EDITABLEPANEL_H
#define EDITABLEPANEL_H
#ifdef _WIN32
#pragma once
#endif
#include "Panel.h"
#include "FocusNavGroup.h"
namespace vgui
{
class EditablePanel : public Panel
{
DECLARE_CLASS_SIMPLE(EditablePanel, Panel);
public:
EditablePanel(Panel* parent, const char* panelName);
EditablePanel(Panel* parent, const char* panelName, HScheme hScheme);
virtual ~EditablePanel();
virtual void LoadControlSettings(const char* dialogResourceName, const char* pathID = NULL, KeyValues* pPreloadedKeyValues = NULL, KeyValues* pConditions = NULL);
virtual void ApplySettings(KeyValues* inResourceData);
virtual void LoadUserConfig(const char* configName, int dialogID = 0);
virtual void SaveUserConfig();
virtual void LoadControlSettingsAndUserConfig(const char* dialogResourceName, int dialogID = 0);
virtual void ActivateBuildMode();
virtual BuildGroup* GetBuildGroup();
virtual Panel* CreateControlByName(const char* controlName);
virtual void SetControlString(const char* controlName, const char* string);
virtual void SetControlString(const char* controlName, const wchar_t* string);
virtual void SetControlInt(const char* controlName, int state);
virtual int GetControlInt(const char* controlName, int defaultState);
virtual const char* GetControlString(const char* controlName, const char* defaultString = "");
virtual void GetControlString(const char* controlName, char* buf, int bufSize, const char* defaultString = "");
virtual void SetControlEnabled(const char* controlName, bool enabled);
virtual void SetControlVisible(const char* controlName, bool visible);
virtual void SetDialogVariable(const char* varName, const char* value);
virtual void SetDialogVariable(const char* varName, const wchar_t* value);
virtual void SetDialogVariable(const char* varName, int value);
virtual void SetDialogVariable(const char* varName, float value);
virtual void RequestFocus(int direction = 0);
virtual bool RequestFocusNext(VPANEL panel);
virtual bool RequestFocusPrev(VPANEL panel);
virtual void OnSetFocus();
virtual void OnRequestFocus(VPANEL subFocus, VPANEL defaultPanel);
virtual VPANEL GetCurrentKeyFocus();
virtual Panel* HasHotkey(wchar_t key);
virtual void OnKeyCodePressed(KeyCode code);
virtual bool RequestInfo(KeyValues* data);
virtual void RegisterControlSettingsFile(const char* dialogResourceName, const char* pathID = NULL);
KeyValues* GetDialogVariables();
protected:
virtual void PaintBackground();
virtual FocusNavGroup& GetFocusNavGroup();
MESSAGE_FUNC_HANDLE(OnDefaultButtonSet, "DefaultButtonSet", button);
MESSAGE_FUNC_HANDLE(OnCurrentDefaultButtonSet, "CurrentDefaultButtonSet", button);
MESSAGE_FUNC(OnFindDefaultButton, "FindDefaultButton");
virtual void OnChildAdded(VPANEL child);
virtual void OnSizeChanged(int wide, int tall);
virtual void OnClose();
virtual void ApplyUserConfigSettings(KeyValues* userConfig);
virtual void GetUserConfigSettings(KeyValues* userConfig);
private:
void ForceSubPanelsToUpdateWithNewDialogVariables();
BuildGroup* _buildGroup;
FocusNavGroup m_NavGroup;
KeyValues* m_pDialogVariables;
char* m_pszConfigName;
int m_iConfigID;
bool m_bShouldSkipAutoResize;
};
}
#endif

View File

@ -1,407 +0,0 @@
#ifndef EVENTLISTEN
#define EVENTLISTEN
#pragma once
#pragma comment( lib, "Winmm.lib" )
#include "Interfaces.hpp"
#include "c_baseentity.h"
#include "Options.hpp"
struct bullet
{
bullet(int userID, Vector pos, int dmg, bool hs, float curtime)
{
this->userid = userid;
this->hs = hs;
this->curtime = curtime;
this->time = curtime + 0.0f;
this->pos = pos;
this->dmg = dmg;
}
int userid;
bool hs;
float time;
float curtime;
Vector pos;
int dmg;
};
std::vector<bullet> bulletdata;
#define PI 3.14159265
class EventListener : public IGameEventListener2
{
public:
EventListener()
{
if (!iff.g_pGameEvents->AddListener(this, "bullet_impact", false))
{
#ifdef DEBUG
std::cout << "Can't add listener bullet_impact\n";
#endif
}
if (!iff.g_pGameEvents->AddListener(this, "player_hurt", false))
{
#ifdef DEBUG
std::cout << "Can't add listener player_hurt\n";
#endif
}
if (!iff.g_pGameEvents->AddListener(this, "vote_cast", false))
{
#ifdef DEBUG
std::cout << "Can't add listener vote_cast\n";
#endif
}
if (!iff.g_pGameEvents->AddListener(this, "game_newmap", false))
{
#ifdef DEBUG
std::cout << "Can't add listener game_newmap\n";
#endif
}
#ifdef DEBUG
std::cout << "Event Listener created\n";
#endif
}
~EventListener()
{
iff.g_pGameEvents->RemoveListener(this);
}
int GetEventDebugID() override
{
return EVENT_DEBUG_ID_INIT;
}
virtual void FireGameEvent(IGameEvent* event)
{
if (*g_Options.hitmarker || *g_Options.hitsound) {
if (!strcmp(event->GetName(), "player_hurt"))
{
short hitgroup = event->GetInt("hitgroup");
short attacker = event->GetInt("attacker");
short userid = event->GetInt("userid");
short dmg_health = event->GetInt("dmg_health");
if (iff.g_pEngineClient->GetPlayerForUserID(attacker) == iff.g_pEngineClient->GetLocalPlayer()) {
int pid = iff.g_pEngineClient->GetPlayerForUserID(userid);
C_BasePlayer* pEntity = (C_BasePlayer*)iff.g_pEntityList->GetClientEntity(pid);
Vector pos = pEntity->GetBonePosition(8);
if (hitgroup == 1)
{
bool badInput = false;
int i_dec = 0;
if (*g_Options.hitsound) {
try
{
i_dec = std::stoi(g_Options.hspath.value->mystring);
}
catch (...)
{
badInput = true;
PlaySoundA(g_Options.hspath.value->mystring, NULL, SND_ASYNC);
}
if (!badInput && FindResource(opt.hModuleGlobal, MAKEINTRESOURCE(i_dec), "WAVE")) {
PlaySoundA((char*)i_dec, opt.hModuleGlobal, SND_RESOURCE | SND_ASYNC);
}
}
if (*g_Options.hitmarker)
bulletdata.push_back(bullet(userid, pos, dmg_health, 1, iff.g_pGlobals->curtime));
}
else
{
bool badInput = false;
int i_dec = 0;
if (*g_Options.hitsound) {
try
{
i_dec = std::stoi(g_Options.obpath.value->mystring);
}
catch (...)
{
badInput = true;
PlaySoundA(g_Options.obpath.value->mystring, NULL, SND_ASYNC);
}
if (!badInput && FindResource(opt.hModuleGlobal, MAKEINTRESOURCE(i_dec), "WAVE")) {
PlaySoundA((char*)i_dec, opt.hModuleGlobal, SND_RESOURCE | SND_ASYNC);
}
}
if (*g_Options.hitmarker)
bulletdata.push_back(bullet(userid, pos, dmg_health, 0, iff.g_pGlobals->curtime));
}
}
}
}
if (!strcmp(event->GetName(), "bullet_impact"))
{
short userid = event->GetInt("userid");
int localplayer = iff.g_pEngineClient->GetLocalPlayer();
if (iff.g_pEngineClient->GetPlayerForUserID(userid) == localplayer) {
float x = event->GetFloat("x");
float y = event->GetFloat("y");
float z = event->GetFloat("z");
C_BasePlayer* pEntity = (C_BasePlayer*)iff.g_pEntityList->GetClientEntity(localplayer);
Vector src = pEntity->GetOrigin() + pEntity->GetViewOffset();
Vector dst = { x,y,z };
Vector ang = pEntity->GetAngles();
ang.x -= 90.0f; ang.y -= 90.0f;
static float margin = 3.0f;
static float coeff = 1.5f;
src.x += cos(ang.x * PI / 180) * margin * sin(ang.y * PI / 180) + cos(ang.y * PI / 180) * margin * coeff;
src.y += -cos(ang.x * PI / 180) * margin * cos(ang.y * PI / 180) + sin(ang.y * PI / 180) * margin * coeff;
src.z += sin(ang.x * PI / 180) * margin;
if (*g_Options.beamtrace) {
BeamInfo_t beamInfo;
beamInfo.m_nType = *g_Options.beamtype;
beamInfo.m_pszModelName = g_Options.beampath.value->mystring;
beamInfo.m_nModelIndex = -1;
beamInfo.m_flHaloScale = 0.0f;
beamInfo.m_pStartEnt = pEntity;
beamInfo.m_pEndEnt = NULL;
beamInfo.m_vecEnd = dst;
beamInfo.m_vecStart = src;
beamInfo.m_flLife = *g_Options.beamlife;
beamInfo.m_flFadeLength = *g_Options.beamfadelength;
beamInfo.m_flAmplitude = *g_Options.beamamplitude;
beamInfo.m_nSegments = *g_Options.beamsegments;
beamInfo.m_bRenderable = true;
beamInfo.m_flSpeed = *g_Options.beamspeed;
beamInfo.m_nStartFrame = *g_Options.beamstartframe;
beamInfo.m_flFrameRate = *g_Options.beamframerate;
beamInfo.m_flWidth = *g_Options.beamwidth;
beamInfo.m_flEndWidth = *g_Options.beamwidth;
beamInfo.m_flBlue = g_Options.beamcolor.value->b * 255.0f;
beamInfo.m_flGreen = g_Options.beamcolor.value->g * 255.0f;
beamInfo.m_flRed = g_Options.beamcolor.value->r * 255.0f;
beamInfo.m_flBrightness = g_Options.beamcolor.value->a * 255.0f;
beamInfo.m_nFlags = *g_Options.beamflags;
Beam_t* myBeam = iff.g_pViewRenderBeams->CreateBeamPoints(beamInfo);
if (myBeam) iff.g_pViewRenderBeams->DrawBeam(myBeam);
else
{
}
}
if (*g_Options.attacheffects) {
switch (g_Options.effects.value->type) {
case 0:
{
switch (g_Options.effects.value->selectedc)
{
case 0:
{
iff.g_pEffects->Smoke(dst, -1, g_Options.effects.value->fx_fsize, g_Options.effects.value->fx_fspeed);
break;
}
case 2:
{
iff.g_pEffects->Dust(dst, Vector(0.0f, 0.0f, 1.0f), g_Options.effects.value->fx_fsize, g_Options.effects.value->fx_fspeed);
break;
}
case 1:
{
iff.g_pEffects->Sparks(dst, g_Options.effects.value->fx_magnitude, g_Options.effects.value->fx_traillength);
break;
}
case 3:
{
iff.g_pEffects->MuzzleFlash(dst, CalcAngle(dst, src), g_Options.effects.value->fx_fsize, g_Options.effects.value->fx_itype);
break;
}
case 4:
{
iff.g_pEffects->MetalSparks(dst, Vector( 0.0f, 0.0f, 0.0f ) );
break;
}
case 6:
{
iff.g_pEffects->Ricochet(dst, Vector(0.0f, 0.0f, 1.0f));
break;
}
case 5:
{
iff.g_pEffects->EnergySplash(dst, src, g_Options.effects.value->fx_bexplosive);
break;
}
}
break;
}
case 1:
{
CEffectData asscock;
asscock.m_fFlags = g_Options.effects.value->fflags;
asscock.m_vOrigin = dst;
asscock.m_vStart = src;
asscock.m_vNormal.Init(0.0f, 0.0f, 1.0f);
asscock.m_flScale = g_Options.effects.value->fscale;
asscock.m_nColor = g_Options.effects.value->icolors;
asscock.m_flMagnitude = g_Options.effects.value->fmagtinude;
asscock.m_flRadius = g_Options.effects.value->fradius;
iff.DispatchEffect(opt.DispatchEffect.at(g_Options.effects.value->selectedc).c_str(), asscock);
break;
}
case 2:
{
switch (g_Options.effects.value->selectedc)
{
case 0:
{
CTeslaInfo teslaInfo;
teslaInfo.m_flBeamWidth = g_Options.effects.value->fbeamwidth;
teslaInfo.m_flRadius = g_Options.effects.value->teslaradius;
teslaInfo.m_nEntIndex = -1;
teslaInfo.m_vColor.Init(g_Options.effects.value->teslacolor[0], g_Options.effects.value->teslacolor[1], g_Options.effects.value->teslacolor[2]);
teslaInfo.m_vPos = dst;
teslaInfo.m_flTimeVisible = g_Options.effects.value->fltimevisible;
teslaInfo.m_nBeams = g_Options.effects.value->ibeams;
teslaInfo.m_pszSpriteName = g_Options.effects.value->szSpriteName;
iff.FX_Tesla(teslaInfo);
break;
}
case 1:
{
dlight_t* pDlight = iff.g_pEfx->CL_AllocDlight(1);
pDlight->origin = dst;
pDlight->radius = g_Options.effects.value->frad;
pDlight->color.r = g_Options.effects.value->dlightcolor[0]*255.0f;
pDlight->color.g = g_Options.effects.value->dlightcolor[1] * 255.0f;
pDlight->color.b = g_Options.effects.value->dlightcolor[2] * 255.0f;
pDlight->color.exponent = 5;
pDlight->die = iff.g_pGlobals->curtime + g_Options.effects.value->fdie;
pDlight->decay = 0;
pDlight->key = g_Options.effects.value->key;
pDlight->style = g_Options.effects.value->style;
break;
}
}
break;
}
}
}
}
}
if (*g_Options.votereveal) {
if (!strcmp(event->GetName(), "vote_cast"))
{
int vote = event->GetInt("vote_option");
int id = event->GetInt("entityid");
if (iff.g_pChatElement)
{
player_info_t pinfo;
iff.g_pEngineClient->GetPlayerInfo(id, &pinfo);
if (pinfo.name) {
#ifdef DEBUG
printf("%s voted %d\n", pinfo.name, vote);
#endif
iff.g_pChatElement->ChatPrintf2(0, 0, std::string("").
append(" \x06").
append(pinfo.name).
append(" \x01").
append("voted").
append((vote == 0 ? std::string(" \x04").append("YES") : std::string(" \x02").append("NO"))).c_str());
}
}
}
}
if (!strcmp(event->GetName(), "game_newmap"))
{
#ifdef DEBUG
printf("game_newmap\n");
#endif
OnLevelInit();
}
}
};
#endif

View File

@ -1,49 +0,0 @@
#ifndef FOCUSNAVGROUP_H
#define FOCUSNAVGROUP_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "PHandle.h"
namespace vgui
{
class Panel;
class FocusNavGroup
{
public:
FocusNavGroup(Panel* panel);
~FocusNavGroup();
virtual Panel* GetDefaultPanel();
virtual void SetDefaultButton(Panel* panel);
virtual VPANEL GetDefaultButton();
virtual VPANEL GetCurrentDefaultButton();
virtual Panel* FindPanelByHotkey(wchar_t key);
virtual bool RequestFocusPrev(VPANEL panel = NULL);
virtual bool RequestFocusNext(VPANEL panel = NULL);
virtual Panel* GetCurrentFocus();
virtual VPANEL SetCurrentFocus(VPANEL panel, VPANEL defaultPanel);
virtual void SetFocusTopLevel(bool state);
virtual void SetCurrentDefaultButton(VPANEL panel, bool sendCurrentDefaultButtonMessage = true);
private:
bool CanButtonBeDefault(VPANEL panel);
VPanelHandle _defaultButton;
VPanelHandle _currentDefaultButton;
VPanelHandle _currentFocus;
Panel* _mainPanel;
bool _topLevelFocus;
};
}
#endif

View File

@ -1,198 +0,0 @@
#ifndef VGUI_FRAME_H
#define VGUI_FRAME_H
#ifdef _WIN32
#pragma once
#endif
#include "vgui.h"
#include "Dar.h"
#include "Panel.h"
#include "EditablePanel.h"
#include "FocusNavGroup.h"
namespace vgui
{
class FrameButton;
class FrameSystemButton;
class Frame : public EditablePanel
{
DECLARE_CLASS_SIMPLE(Frame, EditablePanel);
public:
Frame(Panel* parent, const char* panelName, bool showTaskbarIcon = true, bool bPopup = true);
virtual ~Frame();
virtual void SetTitle(const char* title, bool surfaceTitle);
virtual void SetTitle(const wchar_t* title, bool surfaceTitle);
virtual void Activate();
virtual void ActivateMinimized();
MESSAGE_FUNC(Close, "Close");
MESSAGE_FUNC(CloseModal, "CloseModal");
virtual void SetDeleteSelfOnClose(bool state);
virtual void MoveToCenterOfScreen();
virtual void SetMoveable(bool state);
virtual bool IsMoveable();
virtual void SetSizeable(bool state);
virtual bool IsSizeable();
virtual void SetMenuButtonVisible(bool state);
void SetMenuButtonResponsive(bool state);
virtual void SetMinimizeButtonVisible(bool state);
virtual void SetMaximizeButtonVisible(bool state);
virtual void SetMinimizeToSysTrayButtonVisible(bool state);
virtual void SetCloseButtonVisible(bool state);
virtual bool IsMinimized();
virtual void FlashWindow();
virtual void FlashWindowStop();
virtual void OnCommand(const char* command);
virtual Menu* GetSysMenu();
virtual void SetSysMenu(Menu* menu);
void SetImages(const char* pEnabledImage, const char* pDisabledImage = NULL);
virtual void SetTitleBarVisible(bool state);
virtual void SetClipToParent(bool state);
virtual bool GetClipToParent() const;
virtual void SetSmallCaption(bool state);
virtual bool IsSmallCaption() const;
virtual int GetDraggerSize();
virtual int GetCornerSize();
virtual int GetBottomRightSize();
virtual int GetCaptionHeight();
virtual void LoadControlSettings(const char* dialogResourceName, const char* pathID = NULL, KeyValues* pPreloadedKeyValues = NULL, KeyValues* pConditions = NULL);
void SetChainKeysToParent(bool state);
bool CanChainKeysToParent() const;
virtual void DoModal();
void PlaceUnderCursor();
void DisableFadeEffect(void);
void SetFadeEffectDisableOverride(bool disabled);
virtual void OnGripPanelMoved(int nNewX, int nNewY, int nNewW, int nNewH);
virtual void OnGripPanelMoveFinished() {}
protected:
virtual void OnMousePressed(MouseCode code);
virtual void OnKeyCodeTyped(KeyCode code);
virtual void OnKeyTyped(wchar_t unichar);
virtual void OnKeyCodeReleased(KeyCode code);
virtual void OnKeyFocusTicked();
virtual void ApplySchemeSettings(IScheme* pScheme);
virtual void PerformLayout();
virtual void OnClose();
virtual void OnFinishedClose();
MESSAGE_FUNC(OnMinimize, "Minimize");
virtual void OnMinimizeToSysTray();
MESSAGE_FUNC(OnCloseFrameButtonPressed, "CloseFrameButtonPressed");
virtual void OnChildAdded(VPANEL child);
virtual void ApplySettings(KeyValues* inResourceData);
virtual void GetSettings(KeyValues* outResourceData);
virtual const char* GetDescription(void);
virtual bool GetDefaultScreenPosition(int& x, int& y, int& wide, int& tall);
virtual void PaintBackground();
virtual void OnThink();
virtual void OnScreenSizeChanged(int iOldWide, int iOldTall);
virtual void GetClientArea(int& x, int& y, int& wide, int& tall);
virtual void ApplyUserConfigSettings(KeyValues* userConfig);
virtual void GetUserConfigSettings(KeyValues* userConfig);
virtual bool HasUserConfigSettings();
virtual void GetSizerClientArea(int& x, int& y, int& wide, int& tall);
private:
MESSAGE_FUNC_CHARPTR(InternalSetTitle, "SetTitle", text);
MESSAGE_FUNC(InternalFlashWindow, "FlashWindow");
MESSAGE_FUNC_PARAMS(OnDialogVariablesChanged, "DialogVariables", dialogVariables);
void SetupResizeCursors();
void LayoutProportional(FrameButton* bt);
void FinishClose();
void OnFrameFocusChanged(bool bHasFocus);
Color _titleBarBgColor;
Color _titleBarDisabledBgColor;
Color _titleBarFgColor;
Color _titleBarDisabledFgColor;
Color m_InFocusBgColor;
Color m_OutOfFocusBgColor;
TextImage* _title;
#if !defined( _GAMECONSOLE )
Panel* _topGrip;
Panel* _bottomGrip;
Panel* _leftGrip;
Panel* _rightGrip;
Panel* _topLeftGrip;
Panel* _topRightGrip;
Panel* _bottomLeftGrip;
Panel* _bottomRightGrip;
Panel* _captionGrip;
FrameButton* _minimizeButton;
FrameButton* _maximizeButton;
FrameButton* _minimizeToSysTrayButton;
FrameButton* _closeButton;
FrameSystemButton* _menuButton;
Menu* _sysMenu;
#endif
float m_flTransitionEffectTime;
float m_flFocusTransitionEffectTime;
int m_iClientInsetX;
int m_iClientInsetY;
int m_iTitleTextInsetX;
int m_nGripperWidth;
VPANEL m_hPreviousModal;
HFont m_hCustomTitleFont;
bool _sizeable : 1;
bool _moveable : 1;
bool m_bHasFocus : 1;
bool _flashWindow : 1;
bool _nextFlashState : 1;
bool _drawTitleBar : 1;
bool m_bPreviouslyVisible : 1;
bool m_bFadingOut : 1;
bool m_bDeleteSelfOnClose : 1;
bool m_bDisableFadeEffect : 1;
bool m_bClipToParent : 1;
bool m_bSmallCaption : 1;
bool m_bChainKeysToParent : 1;
bool m_bPrimed : 1;
bool m_iClientInsetXOverridden : 1;
CPanelAnimationVarAliasType(int, m_iTitleTextInsetXOverride, "titletextinsetX", "0", "proportional_int");
CPanelAnimationVarAliasType(int, m_iTitleTextInsetYOverride, "titletextinsetY", "0", "proportional_int");
};
}
#endif

View File

@ -1,52 +0,0 @@
#ifndef GAME_EVENT_LISTENER_H
#define GAME_EVENT_LISTENER_H
#ifdef _WIN32
#pragma once
#endif
#include "igameevents.h"
extern IGameEventManager2* gameeventmanager;
class CGameEventListener : public IGameEventListener2
{
public:
CGameEventListener() : m_bRegisteredForEvents(false)
{
}
~CGameEventListener()
{
StopListeningForAllEvents();
}
void ListenForGameEvent(const char* name)
{
m_bRegisteredForEvents = true;
#ifdef CLIENT_DLL
bool bServerSide = false;
#else
bool bServerSide = true;
#endif
if (gameeventmanager)
gameeventmanager->AddListener(this, name, bServerSide);
}
void StopListeningForAllEvents()
{
if (m_bRegisteredForEvents)
{
if (gameeventmanager)
gameeventmanager->RemoveListener(this);
m_bRegisteredForEvents = false;
}
}
virtual void FireGameEvent(IGameEvent* event) = 0;
private:
bool m_bRegisteredForEvents;
};
#endif

View File

@ -1,157 +0,0 @@
#if !defined ( GAMEEVENTMANAGER_H )
#define GAMEEVENTMANAGER_H
#ifdef _WIN32
#pragma once
#endif
#include "igameevents.h"
#include "utlvector.h"
#include "KeyValues.h"
#include "networkstringtabledefs.h"
#include "utlsymbol.h"
#include "bitbuf.h"
class SVC_GameEventList;
class CLC_ListenEvents;
class CGameEventCallback
{
public:
void* m_pCallback;
int m_nListenerType;
};
class CGameEventDescriptor
{
public:
CGameEventDescriptor()
{
name[0] = 0;
eventid = -1;
keys = NULL;
local = false;
reliable = true;
}
public:
char name[MAX_EVENT_NAME_LENGTH];
int eventid;
KeyValues* keys;
bool local;
bool reliable;
CUtlVector<CGameEventCallback*> listeners;
};
class CGameEvent : public IGameEvent
{
public:
CGameEvent(CGameEventDescriptor* descriptor);
virtual ~CGameEvent();
const char* GetName() const;
bool IsEmpty(const char* keyName = NULL);
bool IsLocal() const;
bool IsReliable() const;
bool GetBool(const char* keyName = NULL, bool defaultValue = false);
int GetInt(const char* keyName = NULL, int defaultValue = 0);
float GetFloat(const char* keyName = NULL, float defaultValue = 0.0f);
const char* GetString(const char* keyName = NULL, const char* defaultValue = "");
void SetBool(const char* keyName, bool value);
void SetInt(const char* keyName, int value);
void SetFloat(const char* keyName, float value);
void SetString(const char* keyName, const char* value);
CGameEventDescriptor* m_pDescriptor;
KeyValues* m_pDataKeys;
};
class CGameEventManager : public IGameEventManager2
{
friend class CGameEventManagerOld;
public:
enum
{
SERVERSIDE = 0,
CLIENTSIDE,
CLIENTSTUB,
SERVERSIDE_OLD,
CLIENTSIDE_OLD,
};
enum
{
TYPE_LOCAL = 0,
TYPE_STRING,
TYPE_FLOAT,
TYPE_LONG,
TYPE_SHORT,
TYPE_BYTE,
TYPE_BOOL
};
CGameEventManager();
virtual ~CGameEventManager();
int LoadEventsFromFile(const char* filename);
void Reset();
bool AddListener(IGameEventListener2* listener, const char* name, bool bServerSide);
bool FindListener(IGameEventListener2* listener, const char* name);
void RemoveListener(IGameEventListener2* listener);
IGameEvent* CreateEvent(const char* name, bool bForce = false);
IGameEvent* DuplicateEvent(IGameEvent* event);
bool FireEvent(IGameEvent* event, bool bDontBroadcast = false);
bool FireEventClientSide(IGameEvent* event);
void FreeEvent(IGameEvent* event);
bool SerializeEvent(IGameEvent* event, bf_write* buf);
IGameEvent* UnserializeEvent(bf_read* buf);
public:
bool Init();
void Shutdown();
void ReloadEventDefinitions();
bool AddListener(void* listener, CGameEventDescriptor* descriptor, int nListenerType);
CGameEventDescriptor* GetEventDescriptor(const char* name);
CGameEventDescriptor* GetEventDescriptor(IGameEvent* event);
CGameEventDescriptor* GetEventDescriptor(int eventid);
void WriteEventList(SVC_GameEventList* msg);
bool ParseEventList(SVC_GameEventList* msg);
void WriteListenEventList(CLC_ListenEvents* msg);
bool HasClientListenersChanged(bool bReset = true);
void ConPrintEvent(IGameEvent* event);
bool AddListenerAll(void* listener, int nListenerType);
void RemoveListenerOld(void* listener);
protected:
IGameEvent* CreateEvent(CGameEventDescriptor* descriptor);
bool RegisterEvent(KeyValues* keys);
void UnregisterEvent(int index);
bool FireEventIntern(IGameEvent* event, bool bServerSide, bool bClientOnly);
CGameEventCallback* FindEventListener(void* listener);
CUtlVector<CGameEventDescriptor> m_GameEvents;
CUtlVector<CGameEventCallback*> m_Listeners;
CUtlSymbolTable m_EventFiles;
CUtlVector<CUtlSymbol> m_EventFileNames;
bool m_bClientListenersChanged;
};
extern CGameEventManager& g_GameEventManager;
#endif

View File

@ -1,56 +0,0 @@
#ifndef GETVFUNC
#define GETVFUNC
#pragma once
inline void**& getvtable(void* inst, size_t offset = 0)
{
return *reinterpret_cast<void***>((size_t)inst + offset);
}
inline const void** getvtable(const void* inst, size_t offset = 0)
{
return *reinterpret_cast<const void***>((size_t)inst + offset);
}
template<typename Fn>
inline Fn getvfunc(const void* inst, size_t index, size_t offset = 0)
{
return reinterpret_cast<Fn>(getvtable(inst, offset)[index]);
}
template <typename Fn = void*>
Fn get_vfunc(void* class_base, const size_t index)
{
return (*reinterpret_cast<Fn**>(class_base))[index];
}
#include <string>
#include <memory>
inline char* MakeControlChars(char str[1024]) {
char name[1024];
strcpy(name, str);
for (int i = 0; i < 1024; i++)
{
if (name[i] == 0x5C && name[i + 1] == 0x78)
{
char controlchar[3]; controlchar[0] = name[i + 2]; controlchar[1] = name[i + 3]; controlchar[2] = 0x0;
short x = std::stoul(controlchar, nullptr, 16);
name[i] = x;
for (int j = i + 4; j < 1024; j++)
{
name[j - 3] = name[j];
if (name[j] == 0x0)
break;
}
}
if (name[i] == 0x0)
break;
}
return name;
}
#endif

View File

@ -1,201 +0,0 @@
#pragma once
VMTHook* SoundHook = nullptr;
void __fastcall hkEmitSound1(void* _this, int edx, IRecipientFilter& filter, int iEntIndex, int iChannel, char* pSoundEntry, unsigned int nSoundEntryHash, const char* pSample, float flVolume, int nSeed, float flAttenuation, int iFlags, int iPitch, const Vector* pOrigin, const Vector* pDirection, void* pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity, int unk) {
static auto ofunc = SoundHook->GetOriginal<decltype(&hkEmitSound1)>(5);
if (*g_Options.soundhook_count) {
soundlist vv = GetCfgWavpathBySoundHash(nSoundEntryHash);
if (vv.cfgindex != -1)
{
Sounds ff = g_Options.models.value->arr[vv.cfgindex].sounds[vv.sndindex];
return ofunc(iff.g_pEngineSound, edx, filter, iEntIndex, iChannel, pSoundEntry, -1, ff.wavpath, ff.volume, nSeed, flAttenuation, 0, ff.pitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity, unk);
}
}
return ofunc(iff.g_pEngineSound, edx, filter, iEntIndex, iChannel, pSoundEntry, nSoundEntryHash, pSample, flVolume, nSeed, flAttenuation, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity, unk);
}
VMTHook* DMEHook = nullptr;
void replacemat(int d)
{
IMaterial* material;
if (g_Options.materials.value->arr[d].customtextureselected != -1)
if (g_Options.customtextures.value->arr[g_Options.materials.value->arr[d].customtextureselected].texturelink != nullptr)
material = (IMaterial*)g_Options.customtextures.value->arr[g_Options.materials.value->arr[d].customtextureselected].texturelink;
else material = iff.g_pMaterialSystem->FindMaterial("__err", TEXTURE_GROUP_MODEL);
else
material = iff.g_pMaterialSystem->FindMaterial(g_Options.materials.value->arr[d].texture, TEXTURE_GROUP_MODEL);
material->SetMaterialVarFlag(MATERIAL_VAR_WIREFRAME, g_Options.materials.value->arr[d].wireframe);
material->SetMaterialVarFlag(MATERIAL_VAR_FLAT, g_Options.materials.value->arr[d].flat);
material->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, g_Options.materials.value->arr[d].nodraw);
material->ColorModulate(g_Options.materials.value->arr[d].coloralpha.x, g_Options.materials.value->arr[d].coloralpha.y, g_Options.materials.value->arr[d].coloralpha.z);
material->AlphaModulate(g_Options.materials.value->arr[d].coloralpha.w);
iff.g_pMdlRender->ForcedMaterialOverride(material);
}
void __stdcall DrawModelExecute(IMatRenderContext* ctx, const DrawModelState_t& state, const ModelRenderInfo_t& pInfo, matrix3x4_t* pCustomBoneToWorld)
{
static auto ofunc = DMEHook->GetOriginal<void(__thiscall*)(IVModelRender*, IMatRenderContext*, const DrawModelState_t&, const ModelRenderInfo_t&, matrix3x4_t*)>(21);
if (iff.g_pMdlRender->IsForcedMaterialOverride() || opt.loading || !*g_Options.dmeloop_count)
return ofunc(iff.g_pMdlRender, ctx, state, pInfo, pCustomBoneToWorld);
const char* szName = iff.g_pMdlInfo->GetModelName(pInfo.pModel);
if (g_Options.materials.value->arr[3].active)
if (strstr(szName, "player/legacy/t") != nullptr)
replacemat(3);
if (g_Options.materials.value->arr[4].active)
if (strstr(szName, "player/legacy/ct") != nullptr)
replacemat(4);
if (strstr(szName, "weapons/v_")) {
int namehash = fnv2::hashRuntime(szName);
bool is_arm = strstr(szName, "arms") != nullptr;
bool is_sleeve = strstr(szName, "sleeve") != nullptr;
bool is_wep = !is_arm && !is_sleeve;
for (int d = 0; d < g_Options.materials.value->itemcount; d++)
{
if (d == 1 && !is_arm) continue;
if (d == 2 && !is_sleeve) continue;
if (d == 0 && !is_wep) continue;
if (d == 3 || d == 4) continue;
if ((d > 2 && d != 5) && namehash != g_Options.materials.value->arr[d].model_hash) continue;
if (d == 5 && !strstr(szName, "knife")) continue;
if (g_Options.materials.value->arr[d].active) {
replacemat(d);
}
}
}
ofunc(iff.g_pMdlRender, ctx, state, pInfo, pCustomBoneToWorld);
iff.g_pMdlRender->ForcedMaterialOverride(nullptr);
}
VMTHook* CacheHook = nullptr;
MDLHandle_t __fastcall hkFindMDL(void* ecx, void* edx, char* FilePath)
{
static auto oFindMDL = CacheHook->GetOriginal<MDLHandle_t(__thiscall*)(void*, char*)>(10);
if (g_Options.models.value->arr[2].active && strstr(FilePath, "models/weapons/v_models/arms") && !strstr(FilePath, "gloves"))
{
#ifdef DEBUG
printf("Replacing %s with %s\n", FilePath, g_Options.models.value->arr[2].vmodel_repl);
#endif
sprintf(FilePath, g_Options.models.value->arr[2].vmodel_repl);
}
if (g_Options.models.value->arr[3].active && strstr(FilePath, "models/weapons/v_knife"))
{
#ifdef DEBUG
printf("Replacing %s with %s\n", FilePath, g_Options.models.value->arr[3].vmodel_repl);
#endif
sprintf(FilePath, g_Options.models.value->arr[3].vmodel_repl);
}
for (int i = 4; i < g_Options.models.value->itemcount; i++)
{
if (g_Options.models.value->arr[i].active && g_Options.models.value->arr[i].findMDLmethode && strstr(FilePath, g_Options.models.value->arr[i].vmodel_orig))
{
#ifdef DEBUG
printf("Replacing %s with %s\n", FilePath, g_Options.models.value->arr[i].vmodel_repl);
#endif
sprintf(FilePath, g_Options.models.value->arr[i].vmodel_repl);
}
}
return oFindMDL(ecx, FilePath);
}
VMTHook* ClientModeHook = nullptr;
static void __stdcall hkdoPostScreenEffects(void* param) noexcept
{
static auto ofunc = ClientModeHook->GetOriginal<void(__thiscall*)(IClientMode*, void*)>(44);
if (*g_Options.entityloop_count) {
if (iff.g_pEngineClient->IsInGame())
{
int localplayer_index = iff.g_pEngineClient->GetLocalPlayer();
C_BasePlayer* localplayer = static_cast<C_BasePlayer*>(iff.g_pEntityList->GetClientEntity(localplayer_index));
for (int i = iff.g_pEngineClient->GetMaxClients() + 1; i <= iff.g_pEntityList->GetHighestEntityIndex(); ++i)
{
C_BasePlayer* pEntity = (C_BasePlayer*)iff.g_pEntityList->GetClientEntity(i);
if (!pEntity)
continue;
bool bDormant = pEntity->IsDormant();
if (bDormant)
continue;
int cfgindex = GetCfgIndexByClassId(fnv2::hashRuntime(pEntity->GetClientClass()->GetName()));
if (cfgindex != -1)
{
if (g_Options.models.value->arr[cfgindex].active_scale)
pEntity->GetModelScale() = g_Options.models.value->arr[cfgindex].scale;
if (g_Options.models.value->arr[cfgindex].active_w)
{
char* model = g_Options.models.value->arr[cfgindex].wmodel_repl;
pEntity->SetModelIndex(iff.g_pMdlInfo->GetModelIndex(model));
if (const auto modelprecache = iff.g_pNetworkStringTableContainer->FindTable("modelprecache"))
modelprecache->AddString(false, model);
}
}
}
}
}
ofunc(iff.g_ClientMode, param);
}
VMTHook* VGUISurfHook = nullptr;
void __fastcall hkLockCursor(void* _this)
{
static auto ofunc = VGUISurfHook->GetOriginal<decltype(&hkLockCursor)>(67);
if (opt.show) {
iff.g_pVGuiSurface->UnlockCursor();
iff.g_pInputSystem->ResetInputState();
return;
}
ofunc(iff.g_pVGuiSurface);
}
VMTHook* FileSystemHook = nullptr;
int __stdcall hkGetUnverifiedFileHashes(void* _this, void* someclass, int nMaxFiles)
{
return 0;
}

View File

@ -1,84 +0,0 @@
#ifndef IAPPSYSTEM_H
#define IAPPSYSTEM_H
#ifdef COMPILER_MSVC
#pragma once
#endif
#include "interface.h"
struct AppSystemInfo_t
{
const char* m_pModuleName;
const char* m_pInterfaceName;
};
enum InitReturnVal_t
{
INIT_FAILED = 0,
INIT_OK,
INIT_LAST_VAL,
};
enum AppSystemTier_t
{
APP_SYSTEM_TIER0 = 0,
APP_SYSTEM_TIER1,
APP_SYSTEM_TIER2,
APP_SYSTEM_TIER3,
APP_SYSTEM_TIER_OTHER,
};
abstract_class IAppSystem
{
public:
virtual bool Connect(CreateInterfaceFn factory) = 0;
virtual void Disconnect() = 0;
virtual void* QueryInterface(const char* pInterfaceName) = 0;
virtual InitReturnVal_t Init() = 0;
virtual void Shutdown() = 0;
virtual const AppSystemInfo_t* GetDependencies() { return NULL; }
virtual AppSystemTier_t GetTier() { return APP_SYSTEM_TIER_OTHER; }
virtual void Reconnect(CreateInterfaceFn factory, const char* pInterfaceName) {}
virtual bool IsSingleton() { return true; }
};
template< class IInterface >
class CBaseAppSystem : public IInterface
{
public:
virtual bool Connect(CreateInterfaceFn factory) { return true; }
virtual void Disconnect() {}
virtual void* QueryInterface(const char* pInterfaceName) { return NULL; }
virtual InitReturnVal_t Init() { return INIT_OK; }
virtual void Shutdown() {}
virtual const AppSystemInfo_t* GetDependencies() { return NULL; }
virtual AppSystemTier_t GetTier() { return APP_SYSTEM_TIER_OTHER; }
virtual void Reconnect(CreateInterfaceFn factory, const char* pInterfaceName);
};
template< class IInterface >
class CTier0AppSystem : public CBaseAppSystem< IInterface >
{
};
#endif

View File

@ -1,54 +0,0 @@
#ifndef IBORDER_H
#define IBORDER_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
class KeyValues;
namespace vgui
{
class IScheme;
class IBorder
{
public:
IBorder() {}
virtual ~IBorder() {}
virtual void Paint(VPANEL panel) = 0;
virtual void Paint(int x0, int y0, int x1, int y1) = 0;
virtual void Paint(int x0, int y0, int x1, int y1, int breakSide, int breakStart, int breakStop) = 0;
virtual void SetInset(int left, int top, int right, int bottom) = 0;
virtual void GetInset(int& left, int& top, int& right, int& bottom) = 0;
virtual void ApplySchemeSettings(IScheme* pScheme, KeyValues* inResourceData) = 0;
virtual const char* GetName() = 0;
virtual void SetName(const char* name) = 0;
enum backgroundtype_e
{
BACKGROUND_FILLED,
BACKGROUND_TEXTURED,
BACKGROUND_ROUNDEDCORNERS,
};
virtual backgroundtype_e GetBackgroundType() = 0;
enum sides_e
{
SIDE_LEFT = 0,
SIDE_TOP = 1,
SIDE_RIGHT = 2,
SIDE_BOTTOM = 3
};
virtual bool PaintFirst(void) = 0;
};
}
#endif

View File

@ -1,52 +0,0 @@
#if !defined( ICLIENTLEAFSYSTEM_H )
#define ICLIENTLEAFSYSTEM_H
#ifdef _WIN32
#pragma once
#endif
#include "platform.h"
#include "client_render_handle.h"
#include "ivmodelinfo.h"
#define CLIENTLEAFSYSTEM_INTERFACE_VERSION "ClientLeafSystem002"
enum RenderableModelType_t
{
RENDERABLE_MODEL_UNKNOWN_TYPE = -1,
RENDERABLE_MODEL_ENTITY = 0,
RENDERABLE_MODEL_STUDIOMDL,
RENDERABLE_MODEL_STATIC_PROP,
RENDERABLE_MODEL_BRUSH,
};
enum RenderGroup_t
{
RENDER_GROUP_OPAQUE = 0,
RENDER_GROUP_TRANSLUCENT,
RENDER_GROUP_TRANSLUCENT_IGNOREZ,
RENDER_GROUP_COUNT,
};
abstract_class IClientLeafSystemEngine
{
public:
virtual void CreateRenderableHandle(IClientRenderable* pRenderable, bool bRenderWithViewModels, RenderableTranslucencyType_t nType, RenderableModelType_t nModelType, UINT32 nSplitscreenEnabled = 0xFFFFFFFF) = 0;
virtual void RemoveRenderable(ClientRenderHandle_t handle) = 0;
virtual void AddRenderableToLeaves(ClientRenderHandle_t renderable, int nLeafCount, unsigned short* pLeaves) = 0;
virtual void SetTranslucencyType(ClientRenderHandle_t handle, RenderableTranslucencyType_t nType) = 0;
};
#endif

View File

@ -1,71 +0,0 @@
#ifndef ICLIENTPANEL_H
#define ICLIENTPANEL_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#ifdef GetClassName
#undef GetClassName
#endif
class KeyValues;
namespace vgui
{
class Panel;
class SurfaceBase;
enum EInterfaceID
{
ICLIENTPANEL_STANDARD_INTERFACE = 0,
};
class IClientPanel
{
public:
virtual VPANEL GetVPanel() = 0;
virtual void Think() = 0;
virtual void PerformApplySchemeSettings() = 0;
virtual void PaintTraverse(bool forceRepaint, bool allowForce) = 0;
virtual void Repaint() = 0;
virtual VPANEL IsWithinTraverse(int x, int y, bool traversePopups) = 0;
virtual void GetInset(int& top, int& left, int& right, int& bottom) = 0;
virtual void GetClipRect(int& x0, int& y0, int& x1, int& y1) = 0;
virtual void OnChildAdded(VPANEL child) = 0;
virtual void OnSizeChanged(int newWide, int newTall) = 0;
virtual void InternalFocusChanged(bool lost) = 0;
virtual bool RequestInfo(KeyValues* outputData) = 0;
virtual void RequestFocus(int direction) = 0;
virtual bool RequestFocusPrev(VPANEL existingPanel) = 0;
virtual bool RequestFocusNext(VPANEL existingPanel) = 0;
virtual void OnMessage(const KeyValues* params, VPANEL ifromPanel) = 0;
virtual VPANEL GetCurrentKeyFocus() = 0;
virtual int GetTabPosition() = 0;
virtual const char* GetName() = 0;
virtual const char* GetClassName() = 0;
virtual HScheme GetScheme() = 0;
virtual bool IsProportional() = 0;
virtual bool IsAutoDeleteSet() = 0;
virtual void DeletePanel() = 0;
virtual void* QueryInterface(EInterfaceID id) = 0;
virtual Panel* GetPanel() = 0;
virtual const char* GetModuleName() = 0;
virtual void OnTick() = 0;
};
}
#endif

View File

@ -1,58 +0,0 @@
#ifndef ENGINE_ICOLLIDEABLE_H
#define ENGINE_ICOLLIDEABLE_H
#ifdef _WIN32
#pragma once
#endif
enum SolidType_t;
class IHandleEntity;
struct Ray_t;
struct model_t;
class Vector;
class QAngle;
class CGameTrace;
typedef CGameTrace trace_t;
class IClientUnknown;
abstract_class ICollideable
{
public:
virtual IHandleEntity * GetEntityHandle() = 0;
virtual const Vector& OBBMinsPreScaled() const = 0;
virtual const Vector& OBBMaxsPreScaled() const = 0;
virtual const Vector& OBBMins() const = 0;
virtual const Vector& OBBMaxs() const = 0;
virtual void WorldSpaceTriggerBounds(Vector* pVecWorldMins, Vector* pVecWorldMaxs) const = 0;
virtual bool TestCollision(const Ray_t& ray, unsigned int fContentsMask, trace_t& tr) = 0;
virtual bool TestHitboxes(const Ray_t& ray, unsigned int fContentsMask, trace_t& tr) = 0;
virtual int GetCollisionModelIndex() = 0;
virtual const model_t* GetCollisionModel() = 0;
virtual const Vector& GetCollisionOrigin() const = 0;
virtual const QAngle& GetCollisionAngles() const = 0;
virtual const matrix3x4_t& CollisionToWorldTransform() const = 0;
virtual SolidType_t GetSolid() const = 0;
virtual int GetSolidFlags() const = 0;
virtual IClientUnknown* GetIClientUnknown() = 0;
virtual int GetCollisionGroup() const = 0;
virtual void WorldSpaceSurroundingBounds(Vector* pVecMins, Vector* pVecMaxs) = 0;
virtual bool ShouldTouchTrigger(int triggerSolidFlags) const = 0;
virtual const matrix3x4_t* GetRootParentToWorldTransform() const = 0;
};
#endif

View File

@ -1,66 +0,0 @@
#ifndef ICOLORCORRECTION_H
#define ICOLORCORRECTION_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "imageformat.h"
typedef unsigned int ColorCorrectionHandle_t;
struct ShaderColorCorrectionInfo_t;
#define COLORCORRECTION_INTERFACE_VERSION "COLORCORRECTION_VERSION_1"
abstract_class IColorCorrectionSystem
{
public:
virtual void Init() = 0;
virtual void Shutdown() = 0;
virtual ColorCorrectionHandle_t AddLookup(const char* pName) = 0;
virtual bool RemoveLookup(ColorCorrectionHandle_t handle) = 0;
virtual void SetLookupWeight(ColorCorrectionHandle_t handle, float flWeight) = 0;
virtual float GetLookupWeight(ColorCorrectionHandle_t handle) = 0;
virtual float GetLookupWeight(int i) = 0;
virtual void LockLookup() = 0;
virtual void LockLookup(ColorCorrectionHandle_t handle) = 0;
virtual void UnlockLookup() = 0;
virtual void UnlockLookup(ColorCorrectionHandle_t handle) = 0;
virtual void SetLookup(RGBX5551_t inColor, color24 outColor) = 0;
virtual void SetLookup(ColorCorrectionHandle_t handle, RGBX5551_t inColor, color24 outColor) = 0;
virtual color24 GetLookup(RGBX5551_t inColor) = 0;
virtual color24 GetLookup(ColorCorrectionHandle_t handle, RGBX5551_t inColor) = 0;
virtual void LoadLookup(const char* pLookupName) = 0;
virtual void LoadLookup(ColorCorrectionHandle_t handle, const char* pLookupName) = 0;
virtual void CopyLookup(const color24* pSrcColorCorrection) = 0;
virtual void CopyLookup(ColorCorrectionHandle_t handle, const color24* pSrcColorCorrection) = 0;
virtual void ResetLookup(ColorCorrectionHandle_t handle) = 0;
virtual void ResetLookup() = 0;
virtual void ReleaseTextures() = 0;
virtual void RestoreTextures() = 0;
virtual void ResetLookupWeights() = 0;
virtual int GetNumLookups() = 0;
virtual color24 ConvertToColor24(RGBX5551_t inColor) = 0;
virtual void SetResetable(ColorCorrectionHandle_t handle, bool bResetable) = 0;
virtual void EnableColorCorrection(bool bEnable) = 0;
virtual void GetCurrentColorCorrection(ShaderColorCorrectionInfo_t* pInfo) = 0;
};
#endif

View File

@ -1,52 +0,0 @@
#ifndef IEFFECTS_H
#define IEFFECTS_H
#ifdef _WIN32
#pragma once
#endif
#include "basetypes.h"
#include "vector.h"
#include "interface.h"
#include "ipredictionsystem.h"
enum ShakeCommand_t;
class Vector;
class CGameTrace;
typedef CGameTrace trace_t;
#define IEFFECTS_INTERFACE_VERSION "IEffects001"
abstract_class IEffects : public IPredictionSystem
{
public:
virtual ~IEffects() {};
virtual void Beam(const Vector & Start, const Vector & End, int nModelIndex,
int nHaloIndex, unsigned char frameStart, unsigned char frameRate,
float flLife, unsigned char width, unsigned char endWidth, unsigned char fadeLength,
unsigned char noise, unsigned char red, unsigned char green,
unsigned char blue, unsigned char brightness, unsigned char speed) = 0;
virtual void Smoke(const Vector& origin, int modelIndex, float scale, float framerate) = 0;
virtual void Sparks(const Vector& position, int nMagnitude = 1, int nTrailLength = 1, const Vector* pvecDir = NULL) = 0;
virtual void Dust(const Vector& pos, const Vector& dir, float size, float speed) = 0;
virtual void MuzzleFlash(const Vector& vecOrigin, const Vector& vecAngles, float flScale, int iType) = 0;
virtual void MetalSparks(const Vector& position, const Vector& direction) = 0;
virtual void EnergySplash(const Vector& position, const Vector& direction, bool bExplosive = false) = 0;
virtual void Ricochet(const Vector& position, const Vector& direction) = 0;
virtual float Time() = 0;
virtual bool IsServer() = 0;
virtual void SuppressEffectsSounds(bool bSuppress) = 0;
};
#endif

View File

@ -1,123 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Client-server neutral sound interface
//
// $NoKeywords: $
//=============================================================================//
#ifndef IENGINESOUND_H
#define IENGINESOUND_H
#ifdef _WIN32
#pragma once
#endif
#include "basetypes.h"
#include "interface.h"
#include "soundflags.h"
#include "irecipientfilter.h"
#include "utlvector.h"
#include "SndInfo.h"
//-----------------------------------------------------------------------------
// forward declaration
//-----------------------------------------------------------------------------
class Vector;
// Handy defines for EmitSound
#define SOUND_FROM_UI_PANEL -2 // Sound being played inside a UI panel on the client
#define SOUND_FROM_LOCAL_PLAYER -1
#define SOUND_FROM_WORLD 0
// These are used to feed a soundlevel to the sound system and have it use
// goldsrc-type attenuation. We should use this as little as possible and
// phase it out as soon as possible.
// Take a regular sndlevel and convert it to compatibility mode.
#define SNDLEVEL_TO_COMPATIBILITY_MODE( x ) ((soundlevel_t)(int)( (x) + 256 ))
// Take a compatibility-mode sndlevel and get the REAL sndlevel out of it.
#define SNDLEVEL_FROM_COMPATIBILITY_MODE( x ) ((soundlevel_t)(int)( (x) - 256 ))
// Tells if the given sndlevel is marked as compatibility mode.
#define SNDLEVEL_IS_COMPATIBILITY_MODE( x ) ( (x) >= soundlevel_t(256) )
//-----------------------------------------------------------------------------
// Client-server neutral effects interface
//-----------------------------------------------------------------------------
#define IENGINESOUND_CLIENT_INTERFACE_VERSION "IEngineSoundClient003"
#define IENGINESOUND_SERVER_INTERFACE_VERSION "IEngineSoundServer003"
abstract_class IEngineSound
{
public:
// Precache a particular sample
virtual bool PrecacheSound(const char* pSample, bool bPreload = false, bool bIsUISound = false) = 0;
virtual bool IsSoundPrecached(const char* pSample) = 0;
virtual void PrefetchSound(const char* pSample) = 0;
// Just loads the file header and checks for duration (not hooked up for .mp3's yet)
// Is accessible to server and client though
virtual float GetSoundDuration(const char* pSample) = 0;
// Pitch of 100 is no pitch shift. Pitch > 100 up to 255 is a higher pitch, pitch < 100
// down to 1 is a lower pitch. 150 to 70 is the realistic range.
// EmitSound with pitch != 100 should be used sparingly, as it's not quite as
// fast (the pitchshift mixer is not native coded).
// NOTE: setting iEntIndex to -1 will cause the sound to be emitted from the local
// player (client-side only)
virtual void EmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char* pSample,
float flVolume, float flAttenuation, int iFlags = 0, int iPitch = PITCH_NORM, int iSpecialDSP = 0,
const Vector* pOrigin = NULL, const Vector* pDirection = NULL, CUtlVector< Vector >* pUtlVecOrigins = NULL, bool bUpdatePositions = true, float soundtime = 0.0f, int speakerentity = -1) = 0;
virtual void EmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char* pSample,
float flVolume, soundlevel_t iSoundlevel, int iFlags = 0, int iPitch = PITCH_NORM, int iSpecialDSP = 0,
const Vector* pOrigin = NULL, const Vector* pDirection = NULL, CUtlVector< Vector >* pUtlVecOrigins = NULL, bool bUpdatePositions = true, float soundtime = 0.0f, int speakerentity = -1) = 0;
virtual void EmitSentenceByIndex(IRecipientFilter& filter, int iEntIndex, int iChannel, int iSentenceIndex,
float flVolume, soundlevel_t iSoundlevel, int iFlags = 0, int iPitch = PITCH_NORM,int iSpecialDSP = 0,
const Vector* pOrigin = NULL, const Vector* pDirection = NULL, CUtlVector< Vector >* pUtlVecOrigins = NULL, bool bUpdatePositions = true, float soundtime = 0.0f, int speakerentity = -1) = 0;
virtual void StopSound(int iEntIndex, int iChannel, const char* pSample) = 0;
// stop all active sounds (client only)
virtual void StopAllSounds(bool bClearBuffers) = 0;
// Set the room type for a player (client only)
virtual void SetRoomType(IRecipientFilter& filter, int roomType) = 0;
// Set the dsp preset for a player (client only)
virtual void SetPlayerDSP(IRecipientFilter& filter, int dspType, bool fastReset) = 0;
// emit an "ambient" sound that isn't spatialized
// only available on the client, assert on server
virtual void EmitAmbientSound(const char* pSample, float flVolume, int iPitch = PITCH_NORM, int flags = 0, float soundtime = 0.0f) = 0;
// virtual EntChannel_t CreateEntChannel() = 0;
virtual float GetDistGainFromSoundLevel(soundlevel_t soundlevel, float dist) = 0;
// Client .dll only functions
virtual int GetGuidForLastSoundEmitted() = 0;
virtual bool IsSoundStillPlaying(int guid) = 0;
virtual void StopSoundByGuid(int guid) = 0;
// Set's master volume (0.0->1.0)
virtual void SetVolumeByGuid(int guid, float fvol) = 0;
// Retrieves list of all active sounds
virtual void GetActiveSounds(CUtlVector< SndInfo_t >& sndlist) = 0;
virtual void PrecacheSentenceGroup(const char* pGroupName) = 0;
virtual void NotifyBeginMoviePlayback() = 0;
virtual void NotifyEndMoviePlayback() = 0;
};
#endif // IENGINESOUND_H

View File

@ -1,55 +0,0 @@
#if !defined( IENGINEVGUI_H )
#define IENGINEVGUI_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "VGUI.h"
namespace vgui
{
class Panel;
};
enum VGuiPanel_t
{
PANEL_ROOT = 0,
PANEL_GAMEUIDLL,
PANEL_CLIENTDLL,
PANEL_TOOLS,
PANEL_INGAMESCREENS,
PANEL_GAMEDLL,
PANEL_CLIENTDLL_TOOLS
};
enum PaintMode_t
{
PAINT_UIPANELS = (1 << 0),
PAINT_INGAMEPANELS = (1 << 1),
PAINT_CURSOR = (1 << 2),
};
abstract_class IEngineVGui
{
public:
virtual ~IEngineVGui(void) { }
virtual vgui::VPANEL GetPanel(VGuiPanel_t type) = 0;
virtual bool IsGameUIVisible() = 0;
};
#define VENGINE_VGUI_VERSION "VEngineVGui001"
#if defined(_STATIC_LINKED) && defined(CLIENT_DLL)
namespace Client
{
extern IEngineVGui* enginevgui;
}
#else
extern IEngineVGui* g_pEnginevgui;
#endif
#endif

View File

@ -1,186 +0,0 @@
#ifndef IGAMESYSTEM_H
#define IGAMESYSTEM_H
#ifdef _WIN32
#pragma once
#endif
class IGameSystem
{
public:
virtual char const* Name() = 0;
virtual bool Init() = 0;
virtual void PostInit() = 0;
virtual void Shutdown() = 0;
virtual void LevelInitPreEntity() = 0;
virtual void LevelInitPostEntity() = 0;
virtual void LevelShutdownPreClearSteamAPIContext() {};
virtual void LevelShutdownPreEntity() = 0;
virtual void LevelShutdownPostEntity() = 0;
virtual void OnSave() = 0;
virtual void OnRestore() = 0;
virtual void SafeRemoveIfDesired() = 0;
virtual bool IsPerFrame() = 0;
virtual ~IGameSystem();
static char const* MapName();
static void Add(IGameSystem* pSys);
static void Remove(IGameSystem* pSys);
static void RemoveAll();
static bool InitAllSystems();
static void PostInitAllSystems();
static void ShutdownAllSystems();
static void LevelInitPreEntityAllSystems(char const* pMapName);
static void LevelInitPostEntityAllSystems();
static void LevelShutdownPreClearSteamAPIContextAllSystems();
static void LevelShutdownPreEntityAllSystems();
static void LevelShutdownPostEntityAllSystems();
static void OnSaveAllSystems();
static void OnRestoreAllSystems();
static void SafeRemoveIfDesiredAllSystems();
#ifdef CLIENT_DLL
static void PreRenderAllSystems();
static void UpdateAllSystems(float frametime);
static void PostRenderAllSystems();
#else
static void FrameUpdatePreEntityThinkAllSystems();
static void FrameUpdatePostEntityThinkAllSystems();
static void PreClientUpdateAllSystems();
static CBasePlayer* RunCommandPlayer();
static CUserCmd* RunCommandUserCmd();
#endif
};
class IGameSystemPerFrame : public IGameSystem
{
public:
virtual ~IGameSystemPerFrame();
#ifdef CLIENT_DLL
virtual void PreRender() = 0;
virtual void Update(float frametime) = 0;
virtual void PostRender() = 0;
#else
virtual void FrameUpdatePreEntityThink() = 0;
virtual void FrameUpdatePostEntityThink() = 0;
virtual void PreClientUpdate() = 0;
#endif
};
class CBaseGameSystem : public IGameSystem
{
public:
virtual char const* Name() { return "unnamed"; }
virtual bool Init() { return true; }
virtual void PostInit() {}
virtual void Shutdown() {}
virtual void LevelInitPreEntity() {}
virtual void LevelInitPostEntity() {}
virtual void LevelShutdownPreClearSteamAPIContext() {}
virtual void LevelShutdownPreEntity() {}
virtual void LevelShutdownPostEntity() {}
virtual void OnSave() {}
virtual void OnRestore() {}
virtual void SafeRemoveIfDesired() {}
virtual bool IsPerFrame() { return false; }
private:
#ifdef CLIENT_DLL
virtual void PreRender() {}
virtual void Update(float frametime) {}
virtual void PostRender() {}
#else
virtual void FrameUpdatePreEntityThink() {}
virtual void FrameUpdatePostEntityThink() {}
virtual void PreClientUpdate() {}
#endif
};
class CBaseGameSystemPerFrame : public IGameSystemPerFrame
{
public:
virtual char const* Name() { return "unnamed"; }
virtual bool Init() { return true; }
virtual void PostInit() {}
virtual void Shutdown() {}
virtual void LevelInitPreEntity() {}
virtual void LevelInitPostEntity() {}
virtual void LevelShutdownPreClearSteamAPIContext() {}
virtual void LevelShutdownPreEntity() {}
virtual void LevelShutdownPostEntity() {}
virtual void OnSave() {}
virtual void OnRestore() {}
virtual void SafeRemoveIfDesired() {}
virtual bool IsPerFrame() { return true; }
#ifdef CLIENT_DLL
virtual void PreRender() { }
virtual void Update(float frametime) { }
virtual void PostRender() { }
#else
virtual void FrameUpdatePreEntityThink() { }
virtual void FrameUpdatePostEntityThink() { }
virtual void PreClientUpdate() { }
#endif
};
class CAutoGameSystem : public CBaseGameSystem
{
public:
CAutoGameSystem(char const* name = NULL);
CAutoGameSystem* m_pNext;
virtual char const* Name() { return m_pszName ? m_pszName : "unnamed"; }
private:
char const* m_pszName;
};
class CAutoGameSystemPerFrame : public CBaseGameSystemPerFrame
{
public:
CAutoGameSystemPerFrame(char const* name = NULL);
CAutoGameSystemPerFrame* m_pNext;
virtual char const* Name() { return m_pszName ? m_pszName : "unnamed"; }
private:
char const* m_pszName;
};
class IToolFrameworkServer
{
public:
virtual void PreSetupVisibility() = 0;
};
#endif

View File

@ -1,94 +0,0 @@
#ifndef IGAMEUI_H
#define IGAMEUI_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "IPanel.h"
#if !defined( _X360 )
#include "xboxstubs.h"
#endif
enum ESteamLoginFailure
{
STEAMLOGINFAILURE_NONE,
STEAMLOGINFAILURE_BADTICKET,
STEAMLOGINFAILURE_NOSTEAMLOGIN,
STEAMLOGINFAILURE_VACBANNED,
STEAMLOGINFAILURE_LOGGED_IN_ELSEWHERE
};
enum ESystemNotify
{
SYSTEMNOTIFY_STORAGEDEVICES_CHANGED,
SYSTEMNOTIFY_USER_SIGNEDIN,
SYSTEMNOTIFY_USER_SIGNEDOUT,
SYSTEMNOTIFY_XUIOPENING,
SYSTEMNOTIFY_XUICLOSED,
SYSTEMNOTIFY_INVITE_SHUTDOWN,
};
abstract_class IGameUI
{
public:
virtual void Initialize(CreateInterfaceFn appFactory) = 0;
virtual void PostInit() = 0;
virtual void Connect(CreateInterfaceFn gameFactory) = 0;
virtual void Start() = 0;
virtual void Shutdown() = 0;
virtual void RunFrame() = 0;
virtual void OnGameUIActivated() = 0;
virtual void OnGameUIHidden() = 0;
virtual void OLD_OnConnectToServer(const char* game, int IP, int port) = 0;
virtual void OnDisconnectFromServer_OLD(uint8 eSteamLoginFailure, const char* username) = 0;
virtual void OnLevelLoadingStarted(bool bShowProgressDialog) = 0;
virtual void OnLevelLoadingFinished(bool bError, const char* failureReason, const char* extendedReason) = 0;
virtual bool UpdateProgressBar(float progress, const char* statusText) = 0;
virtual bool SetShowProgressText(bool show) = 0;
virtual void ShowNewGameDialog(int chapter) = 0;
virtual void SessionNotification(const int notification, const int param = 0) = 0;
virtual void SystemNotification(const int notification) = 0;
virtual void ShowMessageDialog(const uint nType, vgui::Panel* pOwner) = 0;
virtual void UpdatePlayerInfo(uint64 nPlayerId, const char* pName, int nTeam, byte cVoiceState, int nPlayersNeeded, bool bHost) = 0;
virtual void SessionSearchResult(int searchIdx, void* pHostData, XSESSION_SEARCHRESULT* pResult, int ping) = 0;
virtual void OnCreditsFinished(void) = 0;
virtual void SetLoadingBackgroundDialog(vgui::VPANEL panel) = 0;
virtual void BonusMapUnlock(const char* pchFileName = NULL, const char* pchMapName = NULL) = 0;
virtual void BonusMapComplete(const char* pchFileName = NULL, const char* pchMapName = NULL) = 0;
virtual void BonusMapChallengeUpdate(const char* pchFileName, const char* pchMapName, const char* pchChallengeName, int iBest) = 0;
virtual void BonusMapChallengeNames(char* pchFileName, char* pchMapName, char* pchChallengeName) = 0;
virtual void BonusMapChallengeObjectives(int& iBronze, int& iSilver, int& iGold) = 0;
virtual void BonusMapDatabaseSave(void) = 0;
virtual int BonusMapNumAdvancedCompleted(void) = 0;
virtual void BonusMapNumMedals(int piNumMedals[3]) = 0;
virtual void OnConnectToServer2(const char* game, int IP, int connectionPort, int queryPort) = 0;
virtual bool ValidateStorageDevice(int* pStorageDeviceValidated) = 0;
virtual void SetProgressOnStart() = 0;
virtual void OnDisconnectFromServer(uint8 eSteamLoginFailure) = 0;
virtual void OnConfirmQuit(void) = 0;
virtual bool IsMainMenuVisible(void) = 0;
virtual void SetMainMenuOverride(vgui::VPANEL panel) = 0;
virtual void SendMainMenuCommand(const char* pszCommand) = 0;
};
#define GAMEUI_INTERFACE_VERSION "GameUI011"
#endif

View File

@ -1,151 +0,0 @@
#ifndef IHTML_H
#define IHTML_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "MouseCode.h"
#include "KeyCode.h"
#include "Cursor.h"
#include "IImage.h"
namespace vgui
{
class IHTML
{
public:
virtual void OpenURL(const char*) = 0;
virtual bool StopLoading() = 0;
virtual bool Refresh() = 0;
virtual bool Show(bool shown) = 0;
virtual const char* GetOpenedPage() = 0;
virtual void Obsolete_OnSize(int x, int y, int w, int h) = 0;
virtual void GetHTMLSize(int& wide, int& tall) = 0;
virtual void Clear() = 0;
virtual void AddText(const char* text) = 0;
enum MOUSE_STATE { UP, DOWN, MOVE, DBLCLICK };
virtual void Obsolete_OnMouse(MouseCode code, MOUSE_STATE s, int x, int y) = 0;
virtual void Obsolete_OnChar(wchar_t unichar) = 0;
virtual void Obsolete_OnKeyDown(KeyCode code) = 0;
virtual vgui::IImage* GetBitmap() = 0;
virtual void SetVisible(bool state) = 0;
virtual void SetSize(int wide, int tall) = 0;
virtual void OnMouse(MouseCode code, MOUSE_STATE s, int x, int y, bool bPopupMenuMenu) = 0;
virtual void OnChar(wchar_t unichar, bool bPopupMenu) = 0;
virtual void OnKeyDown(KeyCode code, bool bPopupMenu) = 0;
virtual void ScrollV(int nPixels) = 0;
virtual void ScrollH(int nPixels) = 0;
virtual void OnMouseWheeled(int delta, bool bPopupMenu) = 0;
virtual void OnKeyUp(KeyCode code, bool bPopupMenu) = 0;
virtual void PostURL(const char* pchURL, const char* pchPostData) = 0;
virtual void RunJavascript(const char* pchScript) = 0;
virtual void SetMousePosition(int x, int y, bool bPopupMenu) = 0;
virtual void SetUserAgentInfo(const wchar_t* pwchUserAgent) = 0;
virtual void AddHeader(const char* pchHeader, const char* pchValue) = 0;
virtual void SetFileDialogChoice(const char* pchFileName) = 0;
virtual void HidePopup() = 0;
virtual void SetHTMLFocus() = 0;
virtual void KillHTMLFocus() = 0;
virtual void HorizontalScrollBarSize(int& x, int& y, int& wide, int& tall) = 0;
virtual void VerticalScrollBarSize(int& x, int& y, int& wide, int& tall) = 0;
virtual int HorizontalScroll() = 0;
virtual int VerticalScroll() = 0;
virtual int HorizontalScrollMax() = 0;
virtual int VerticalScrollMax() = 0;
virtual bool IsHorizontalScrollBarVisible() = 0;
virtual bool IsVeritcalScrollBarVisible() = 0;
virtual void SetHorizontalScroll(int scroll) = 0;
virtual void SetVerticalScroll(int scroll) = 0;
virtual void ViewSource() = 0;
virtual void Copy() = 0;
virtual void Paste() = 0;
virtual bool IsIERender() = 0;
virtual void GetIDispatchPtr(void** pIDispatch) = 0;
virtual void GetHTMLScroll(int& top, int& left) = 0;
};
enum EWebPageLoadError
{
eLoadErrorNone = 0,
eMimeTypeNotSupported,
eCacheMiss,
eBadURL,
eConnectionProblem,
eProxyConnectionProblem,
eLoadErrorUnknown,
};
class IHTMLEvents
{
public:
virtual bool Obsolete_OnStartURL(const char* url, const char* target, bool first) = 0;
virtual void Obsolete_OnFinishURL(const char* url) = 0;
virtual void Obsolete_OnProgressURL(long current, long maximum) = 0;
virtual void Obsolete_OnSetStatusText(const char* text) = 0;
virtual void Obsolete_OnUpdate() = 0;
virtual void Obsolete_OnLink() = 0;
virtual void Obsolete_OffLink() = 0;
virtual void OnURLChanged(const char* url, const char* pchPostData, bool bIsRedirect) = 0;
virtual void OnFinishRequest(const char* url, const char* pageTitle) = 0;
virtual bool OnStartRequestInternal(const char* url, const char* target, const char* pchPostData, bool bIsRedirect) = 0;
virtual void ShowPopup(int x, int y, int wide, int tall) = 0;
virtual void HidePopup() = 0;
virtual bool OnPopupHTMLWindow(const char* pchURL, int x, int y, int wide, int tall) = 0;
virtual void SetHTMLTitle(const char* pchTitle) = 0;
virtual void OnLoadingResource(const char* pchURL) = 0;
virtual void OnSetStatusText(const char* text) = 0;
virtual void OnSetCursor(vgui::CursorCode cursor) = 0;
virtual void OnFileLoadDialog(const char* pchTitle, const char* pchInitialFile) = 0;
virtual void OnShowToolTip(const char* pchText) = 0;
virtual void OnUpdateToolTip(const char* pchText) = 0;
virtual void OnHideToolTip() = 0;
virtual bool BOnCreateNewWindow(void** ppDispatch) = 0;
virtual void OnLink() = 0;
virtual void OffLink() = 0;
virtual void OnCloseWindow() = 0;
virtual void OnUpdate() = 0;
virtual void OnProgressRequest(long current, long maximum) = 0;
virtual bool OnOpenNewTab(const char* pchURL, bool bForeground) = 0;
};
}
#endif

View File

@ -1,54 +0,0 @@
#ifndef IIMAGE_H
#define IIMAGE_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
class Color;
namespace vgui
{
typedef unsigned long HTexture;
enum iimage_rotation_t
{
ROTATED_UNROTATED = 0,
ROTATED_CLOCKWISE_90,
ROTATED_ANTICLOCKWISE_90,
ROTATED_FLIPPED,
};
class IImage
{
public:
virtual void Paint() = 0;
virtual void SetPos(int x, int y) = 0;
virtual void GetContentSize(int& wide, int& tall) = 0;
virtual void GetSize(int& wide, int& tall) = 0;
virtual void SetSize(int wide, int tall) = 0;
virtual void SetColor(Color col) = 0;
virtual ~IImage() {}
virtual bool Evict() = 0;
virtual int GetNumFrames() = 0;
virtual void SetFrame(int nFrame) = 0;
virtual HTexture GetID() = 0;
virtual void SetRotation(int iRotation) = 0;
};
}
#endif

View File

@ -1,156 +0,0 @@
#ifndef VGUI_IINPUT_H
#define VGUI_IINPUT_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "interface.h"
#include "MouseCode.h"
#include "KeyCode.h"
namespace vgui
{
class Cursor;
typedef unsigned long HCursor;
#define VGUI_GCS_COMPREADSTR 0x0001
#define VGUI_GCS_COMPREADATTR 0x0002
#define VGUI_GCS_COMPREADCLAUSE 0x0004
#define VGUI_GCS_COMPSTR 0x0008
#define VGUI_GCS_COMPATTR 0x0010
#define VGUI_GCS_COMPCLAUSE 0x0020
#define VGUI_GCS_CURSORPOS 0x0080
#define VGUI_GCS_DELTASTART 0x0100
#define VGUI_GCS_RESULTREADSTR 0x0200
#define VGUI_GCS_RESULTREADCLAUSE 0x0400
#define VGUI_GCS_RESULTSTR 0x0800
#define VGUI_GCS_RESULTCLAUSE 0x1000
#define VGUI_CS_INSERTCHAR 0x2000
#define VGUI_CS_NOMOVECARET 0x4000
#define MESSAGE_CURSOR_POS -1
#define MESSAGE_CURRENT_KEYFOCUS -2
class IInput : public IBaseInterface
{
public:
virtual void SetMouseFocus(VPANEL newMouseFocus) = 0;
virtual void SetMouseCapture(VPANEL panel) = 0;
virtual void GetKeyCodeText(KeyCode code, OUT_Z_BYTECAP(buflen) char* buf, int buflen) = 0;
virtual VPANEL GetFocus() = 0;
virtual VPANEL GetCalculatedFocus() = 0;
virtual VPANEL GetMouseOver() = 0;
virtual void SetCursorPos(int x, int y) = 0;
virtual void GetCursorPos(int& x, int& y) = 0;
virtual bool WasMousePressed(MouseCode code) = 0;
virtual bool WasMouseDoublePressed(MouseCode code) = 0;
virtual bool IsMouseDown(MouseCode code) = 0;
virtual void SetCursorOveride(HCursor cursor) = 0;
virtual HCursor GetCursorOveride() = 0;
virtual bool WasMouseReleased(MouseCode code) = 0;
virtual bool WasKeyPressed(KeyCode code) = 0;
virtual bool IsKeyDown(KeyCode code) = 0;
virtual bool WasKeyTyped(KeyCode code) = 0;
virtual bool WasKeyReleased(KeyCode code) = 0;
virtual VPANEL GetAppModalSurface() = 0;
virtual void SetAppModalSurface(VPANEL panel) = 0;
virtual void ReleaseAppModalSurface() = 0;
virtual void GetCursorPosition(int& x, int& y) = 0;
virtual void SetIMEWindow(void* hwnd) = 0;
virtual void* GetIMEWindow() = 0;
virtual void OnChangeIME(bool forward) = 0;
virtual int GetCurrentIMEHandle() = 0;
virtual int GetEnglishIMEHandle() = 0;
virtual void GetIMELanguageName(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t* buf, int unicodeBufferSizeInBytes) = 0;
virtual void GetIMELanguageShortCode(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t* buf, int unicodeBufferSizeInBytes) = 0;
struct LanguageItem
{
wchar_t shortname[4];
wchar_t menuname[128];
int handleValue;
bool active;
};
struct ConversionModeItem
{
wchar_t menuname[128];
int handleValue;
bool active;
};
struct SentenceModeItem
{
wchar_t menuname[128];
int handleValue;
bool active;
};
virtual int GetIMELanguageList(LanguageItem* dest, int destcount) = 0;
virtual int GetIMEConversionModes(ConversionModeItem* dest, int destcount) = 0;
virtual int GetIMESentenceModes(SentenceModeItem* dest, int destcount) = 0;
virtual void OnChangeIMEByHandle(int handleValue) = 0;
virtual void OnChangeIMEConversionModeByHandle(int handleValue) = 0;
virtual void OnChangeIMESentenceModeByHandle(int handleValue) = 0;
virtual void OnInputLanguageChanged() = 0;
virtual void OnIMEStartComposition() = 0;
virtual void OnIMEComposition(int flags) = 0;
virtual void OnIMEEndComposition() = 0;
virtual void OnIMEShowCandidates() = 0;
virtual void OnIMEChangeCandidates() = 0;
virtual void OnIMECloseCandidates() = 0;
virtual void OnIMERecomputeModes() = 0;
virtual int GetCandidateListCount() = 0;
virtual void GetCandidate(int num, OUT_Z_BYTECAP(destSizeBytes) wchar_t* dest, int destSizeBytes) = 0;
virtual int GetCandidateListSelectedItem() = 0;
virtual int GetCandidateListPageSize() = 0;
virtual int GetCandidateListPageStart() = 0;
virtual void SetCandidateWindowPos(int x, int y) = 0;
virtual bool GetShouldInvertCompositionString() = 0;
virtual bool CandidateListStartsAtOne() = 0;
virtual void SetCandidateListPageStart(int start) = 0;
virtual void SetMouseCaptureEx(VPANEL panel, MouseCode captureStartMouseCode) = 0;
virtual void RegisterKeyCodeUnhandledListener(VPANEL panel) = 0;
virtual void UnregisterKeyCodeUnhandledListener(VPANEL panel) = 0;
virtual void OnKeyCodeUnhandled(int keyCode) = 0;
virtual void SetModalSubTree(VPANEL subTree, VPANEL unhandledMouseClickListener, bool restrictMessagesToSubTree = true) = 0;
virtual void ReleaseModalSubTree() = 0;
virtual VPANEL GetModalSubTree() = 0;
virtual void SetModalSubTreeReceiveMessages(bool state) = 0;
virtual bool ShouldModalSubTreeReceiveMessages() const = 0;
virtual VPANEL GetMouseCapture() = 0;
};
#define VGUI_INPUT_INTERFACE_VERSION "VGUI_Input005"
}
#endif

View File

@ -1,34 +0,0 @@
#ifndef VSTDLIB_IKEYVALUESSYSTEM_H
#define VSTDLIB_IKEYVALUESSYSTEM_H
#ifdef _WIN32
#pragma once
#endif
#include "vstdlib.h"
typedef int HKeySymbol;
#define INVALID_KEY_SYMBOL (-1)
class IKeyValuesSystem
{
public:
virtual void RegisterSizeofKeyValues(int size) = 0;
virtual void* AllocKeyValuesMemory(int size) = 0;
virtual void FreeKeyValuesMemory(void* pMem) = 0;
virtual HKeySymbol GetSymbolForString(const char* name, bool bCreate = true) = 0;
virtual const char* GetStringForSymbol(HKeySymbol symbol) = 0;
virtual void AddKeyValuesToMemoryLeakList(void* pMem, HKeySymbol name) = 0;
virtual void RemoveKeyValuesFromMemoryLeakList(void* pMem) = 0;
virtual void SetKeyValuesExpressionSymbol(const char* name, bool bValue) = 0;
virtual bool GetKeyValuesExpressionSymbol(const char* name) = 0;
virtual HKeySymbol GetSymbolForStringCaseSensitive(HKeySymbol& hCaseInsensitiveSymbol, const char* name, bool bCreate = true) = 0;
};
VSTDLIB_INTERFACE IKeyValuesSystem* KeyValuesSystem();
#endif

View File

@ -1,371 +0,0 @@
#ifndef ILOCALIZE_H
#define ILOCALIZE_H
#ifdef _WIN32
#pragma once
#endif
#include "IAppSystem.h"
#include "KeyValues.h"
#if !defined(_WCHAR_T_DEFINED) && !defined(GNUC)
typedef unsigned short wchar_t;
#define _WCHAR_T_DEFINED
#endif
typedef unsigned long StringIndex_t;
const unsigned long INVALID_LOCALIZE_STRING_INDEX = (StringIndex_t)-1;
abstract_class ILocalize
{
public:
virtual bool AddFile(const char* fileName, const char* pPathID = NULL, bool bIncludeFallbackSearchPaths = false) = 0;
virtual void RemoveAll() = 0;
virtual wchar_t* Find(char const* tokenName) = 0;
virtual StringIndex_t FindIndex(const char* tokenName) = 0;
virtual const char* GetNameByIndex(StringIndex_t index) = 0;
virtual wchar_t* GetValueByIndex(StringIndex_t index) = 0;
virtual StringIndex_t GetFirstStringIndex() = 0;
virtual StringIndex_t GetNextStringIndex(StringIndex_t index) = 0;
virtual void AddString(const char* tokenName, wchar_t* unicodeString, const char* fileName) = 0;
virtual void SetValueByIndex(StringIndex_t index, wchar_t* newValue) = 0;
virtual bool SaveToFile(const char* fileName) = 0;
virtual int GetLocalizationFileCount() = 0;
virtual const char* GetLocalizationFileName(int index) = 0;
virtual const char* GetFileNameByIndex(StringIndex_t index) = 0;
virtual void ReloadLocalizationFiles() = 0;
virtual const char* FindAsUTF8(const char* pchTokenName) = 0;
virtual void ConstructString(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t* unicodeOutput, int unicodeBufferSizeInBytes, const char* tokenName, KeyValues* localizationVariables) = 0;
virtual void ConstructString(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t* unicodeOutput, int unicodeBufferSizeInBytes, StringIndex_t unlocalizedTextSymbol, KeyValues* localizationVariables) = 0;
static int ConvertANSIToUnicode(const char* ansi, OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t* unicode, int unicodeBufferSizeInBytes);
static int ConvertUnicodeToANSI(const wchar_t* unicode, OUT_Z_BYTECAP(ansiBufferSize) char* ansi, int ansiBufferSize);
template < typename T >
static void ConstructString(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) T* unicodeOuput, int unicodeBufferSizeInBytes, const T* formatString, int numFormatParameters, ...)
{
va_list argList;
va_start(argList, numFormatParameters);
ConstructStringVArgsInternal(unicodeOuput, unicodeBufferSizeInBytes, formatString, numFormatParameters, argList);
va_end(argList);
}
template < typename T >
static void ConstructStringVArgs(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) T* unicodeOuput, int unicodeBufferSizeInBytes, const T* formatString, int numFormatParameters, va_list argList)
{
ConstructStringVArgsInternal(unicodeOuput, unicodeBufferSizeInBytes, formatString, numFormatParameters, argList);
}
template < typename T >
static void ConstructString(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) T* unicodeOutput, int unicodeBufferSizeInBytes, const T* formatString, KeyValues* localizationVariables)
{
ConstructStringKeyValuesInternal(unicodeOutput, unicodeBufferSizeInBytes, formatString, localizationVariables);
}
private:
static void ConstructStringVArgsInternal(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) char* unicodeOutput, int unicodeBufferSizeInBytes, const char* formatString, int numFormatParameters, va_list argList);
static void ConstructStringVArgsInternal(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t* unicodeOutput, int unicodeBufferSizeInBytes, const wchar_t* formatString, int numFormatParameters, va_list argList);
static void ConstructStringKeyValuesInternal(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) char* unicodeOutput, int unicodeBufferSizeInBytes, const char* formatString, KeyValues* localizationVariables);
static void ConstructStringKeyValuesInternal(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t* unicodeOutput, int unicodeBufferSizeInBytes, const wchar_t* formatString, KeyValues* localizationVariables);
};
#ifdef GC
typedef char locchar_t;
#define loc_snprintf Q_snprintf
#define loc_sprintf_safe V_sprintf_safe
#define loc_sncat Q_strncat
#define loc_scat_safe V_strcat_safe
#define loc_sncpy Q_strncpy
#define loc_scpy_safe V_strcpy_safe
#define loc_strlen Q_strlen
#define LOCCHAR( x ) x
#else
typedef wchar_t locchar_t;
#define loc_snprintf V_snwprintf
#define loc_sprintf_safe V_swprintf_safe
#define loc_sncat V_wcsncat
#define loc_scat_safe V_wcscat_safe
#define loc_sncpy Q_wcsncpy
#define loc_scpy_safe V_wcscpy_safe
#define loc_strlen Q_wcslen
#define LOCCHAR(x) L ## x
#endif
template < typename T >
class TypedKeyValuesStringHelper
{
public:
static const T* Read(KeyValues* pKeyValues, const char* pKeyName, const T* pDefaultValue);
static void Write(KeyValues* pKeyValues, const char* pKeyName, const T* pValue);
};
template < >
class TypedKeyValuesStringHelper<char>
{
public:
static const char* Read(KeyValues* pKeyValues, const char* pKeyName, const char* pDefaultValue) { return pKeyValues->GetString(pKeyName, pDefaultValue); }
static void Write(KeyValues* pKeyValues, const char* pKeyName, const char* pValue) { pKeyValues->SetString(pKeyName, pValue); }
};
template < >
class TypedKeyValuesStringHelper<wchar_t>
{
public:
static const wchar_t* Read(KeyValues* pKeyValues, const char* pKeyName, const wchar_t* pDefaultValue) { return pKeyValues->GetWString(pKeyName, pDefaultValue); }
static void Write(KeyValues* pKeyValues, const char* pKeyName, const wchar_t* pValue) { pKeyValues->SetWString(pKeyName, pValue); }
};
template < typename T >
class CLocalizedStringArg;
template < typename T >
class CLocalizedStringArgStringImpl
{
public:
enum { kIsValid = true };
CLocalizedStringArgStringImpl(const locchar_t* pStr) : m_pStr(pStr) { }
const locchar_t* GetLocArg() const { Assert(m_pStr); return m_pStr; }
private:
const locchar_t* m_pStr;
};
template < typename T >
class CLocalizedStringArg<T*> : public CLocalizedStringArgStringImpl<T>
{
public:
CLocalizedStringArg(const locchar_t* pStr) : CLocalizedStringArgStringImpl<T>(pStr) { }
};
template < typename T >
class CLocalizedStringArgPrintfImpl
{
public:
enum { kIsValid = true };
CLocalizedStringArgPrintfImpl(T value, const locchar_t* loc_Format) { loc_snprintf(m_cBuffer, kBufferSize, loc_Format, value); }
const locchar_t* GetLocArg() const { return m_cBuffer; }
private:
enum { kBufferSize = 128, };
locchar_t m_cBuffer[kBufferSize];
};
template < >
class CLocalizedStringArg<uint16> : public CLocalizedStringArgPrintfImpl<uint16>
{
public:
CLocalizedStringArg(uint16 unValue) : CLocalizedStringArgPrintfImpl<uint16>(unValue, LOCCHAR("%u")) { }
};
template < >
class CLocalizedStringArg<uint32> : public CLocalizedStringArgPrintfImpl<uint32>
{
public:
CLocalizedStringArg(uint32 unValue) : CLocalizedStringArgPrintfImpl<uint32>(unValue, LOCCHAR("%u")) { }
};
template < >
class CLocalizedStringArg<uint64> : public CLocalizedStringArgPrintfImpl<uint64>
{
public:
CLocalizedStringArg(uint64 unValue) : CLocalizedStringArgPrintfImpl<uint64>(unValue, LOCCHAR("%llu")) { }
};
template < >
class CLocalizedStringArg<float> : public CLocalizedStringArgPrintfImpl<float>
{
public:
CLocalizedStringArg(float fValue)
: CLocalizedStringArgPrintfImpl<float>(fValue,
fabsf(fValue) <= FLT_EPSILON || fabsf(fValue) >= 1.0f ? LOCCHAR("%.0f") : LOCCHAR("%.1f"))
{
}
};
class CConstructLocalizedString
{
public:
template < typename T >
CConstructLocalizedString(const locchar_t* loc_Format, T arg0)
{
COMPILE_TIME_ASSERT(CLocalizedStringArg<T>::kIsValid);
m_loc_Buffer[0] = '\0';
if (loc_Format)
{
::ILocalize::ConstructString(m_loc_Buffer, sizeof(m_loc_Buffer), loc_Format, 1, CLocalizedStringArg<T>(arg0).GetLocArg());
}
}
template < typename T, typename U >
CConstructLocalizedString(const locchar_t* loc_Format, T arg0, U arg1)
{
COMPILE_TIME_ASSERT(CLocalizedStringArg<T>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<U>::kIsValid);
m_loc_Buffer[0] = '\0';
if (loc_Format)
{
::ILocalize::ConstructString(m_loc_Buffer, sizeof(m_loc_Buffer), loc_Format, 2, CLocalizedStringArg<T>(arg0).GetLocArg(), CLocalizedStringArg<U>(arg1).GetLocArg());
}
}
template < typename T, typename U, typename V >
CConstructLocalizedString(const locchar_t* loc_Format, T arg0, U arg1, V arg2)
{
COMPILE_TIME_ASSERT(CLocalizedStringArg<T>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<U>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<V>::kIsValid);
m_loc_Buffer[0] = '\0';
if (loc_Format)
{
::ILocalize::ConstructString(m_loc_Buffer,
sizeof(m_loc_Buffer),
loc_Format,
3,
CLocalizedStringArg<T>(arg0).GetLocArg(),
CLocalizedStringArg<U>(arg1).GetLocArg(),
CLocalizedStringArg<V>(arg2).GetLocArg());
}
}
template < typename T, typename U, typename V, typename W >
CConstructLocalizedString(const locchar_t* loc_Format, T arg0, U arg1, V arg2, W arg3)
{
COMPILE_TIME_ASSERT(CLocalizedStringArg<T>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<U>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<V>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<W>::kIsValid);
m_loc_Buffer[0] = '\0';
if (loc_Format)
{
::ILocalize::ConstructString(m_loc_Buffer,
sizeof(m_loc_Buffer),
loc_Format,
4,
CLocalizedStringArg<T>(arg0).GetLocArg(),
CLocalizedStringArg<U>(arg1).GetLocArg(),
CLocalizedStringArg<V>(arg2).GetLocArg(),
CLocalizedStringArg<W>(arg3).GetLocArg());
}
}
template < typename T, typename U, typename V, typename W, typename X, typename Y >
CConstructLocalizedString(const locchar_t* loc_Format, T arg0, U arg1, V arg2, W arg3, X arg4, Y arg5)
{
COMPILE_TIME_ASSERT(CLocalizedStringArg<T>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<U>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<V>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<W>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<X>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<Y>::kIsValid);
m_loc_Buffer[0] = '\0';
if (loc_Format)
{
::ILocalize::ConstructString(m_loc_Buffer,
sizeof(m_loc_Buffer),
loc_Format,
6,
CLocalizedStringArg<T>(arg0).GetLocArg(),
CLocalizedStringArg<U>(arg1).GetLocArg(),
CLocalizedStringArg<V>(arg2).GetLocArg(),
CLocalizedStringArg<W>(arg3).GetLocArg(),
CLocalizedStringArg<X>(arg4).GetLocArg(),
CLocalizedStringArg<Y>(arg5).GetLocArg());
}
}
template < typename T, typename U, typename V, typename W, typename X, typename Y, typename Z >
CConstructLocalizedString(const locchar_t* loc_Format, T arg0, U arg1, V arg2, W arg3, X arg4, Y arg5, Z arg6)
{
COMPILE_TIME_ASSERT(CLocalizedStringArg<T>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<U>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<V>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<W>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<X>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<Y>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<Z>::kIsValid);
m_loc_Buffer[0] = '\0';
if (loc_Format)
{
::ILocalize::ConstructString(m_loc_Buffer,
sizeof(m_loc_Buffer),
loc_Format,
7,
CLocalizedStringArg<T>(arg0).GetLocArg(),
CLocalizedStringArg<U>(arg1).GetLocArg(),
CLocalizedStringArg<V>(arg2).GetLocArg(),
CLocalizedStringArg<W>(arg3).GetLocArg(),
CLocalizedStringArg<X>(arg4).GetLocArg(),
CLocalizedStringArg<Y>(arg5).GetLocArg(),
CLocalizedStringArg<Z>(arg6).GetLocArg());
}
}
CConstructLocalizedString(const locchar_t* loc_Format, KeyValues* pKeyValues)
{
m_loc_Buffer[0] = '\0';
if (loc_Format && pKeyValues)
{
::ILocalize::ConstructString(m_loc_Buffer, sizeof(m_loc_Buffer), loc_Format, pKeyValues);
}
}
operator const locchar_t* () const
{
return m_loc_Buffer;
}
private:
enum { kBufferSize = 512, };
locchar_t m_loc_Buffer[kBufferSize];
};
namespace vgui
{
class ILocalize : public ::ILocalize { };
}
#define VGUI_LOCALIZE_INTERFACE_VERSION "VGUI_Localize005"
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,118 +0,0 @@
#ifndef IPANEL_H
#define IPANEL_H
#ifdef _WIN32
#pragma once
#endif
#include "vgui.h"
#include "interface.h"
#include "utlvector.h"
#ifdef SendMessage
#undef SendMessage
#endif
class KeyValues;
struct DmxElementUnpackStructure_t;
class CDmxElement;
namespace vgui
{
class SurfacePlat;
class IClientPanel;
class Panel;
class IPanel : public IBaseInterface
{
public:
virtual void Init(VPANEL vguiPanel, IClientPanel* panel) = 0;
virtual void SetPos(VPANEL vguiPanel, int x, int y) = 0;
virtual void GetPos(VPANEL vguiPanel, int& x, int& y) = 0;
virtual void SetSize(VPANEL vguiPanel, int wide, int tall) = 0;
virtual void GetSize(VPANEL vguiPanel, int& wide, int& tall) = 0;
virtual void SetMinimumSize(VPANEL vguiPanel, int wide, int tall) = 0;
virtual void GetMinimumSize(VPANEL vguiPanel, int& wide, int& tall) = 0;
virtual void SetZPos(VPANEL vguiPanel, int z) = 0;
virtual int GetZPos(VPANEL vguiPanel) = 0;
virtual void GetAbsPos(VPANEL vguiPanel, int& x, int& y) = 0;
virtual void GetClipRect(VPANEL vguiPanel, int& x0, int& y0, int& x1, int& y1) = 0;
virtual void SetInset(VPANEL vguiPanel, int left, int top, int right, int bottom) = 0;
virtual void GetInset(VPANEL vguiPanel, int& left, int& top, int& right, int& bottom) = 0;
virtual void SetVisible(VPANEL vguiPanel, bool state) = 0;
virtual bool IsVisible(VPANEL vguiPanel) = 0;
virtual void SetParent(VPANEL vguiPanel, VPANEL newParent) = 0;
virtual int GetChildCount(VPANEL vguiPanel) = 0;
virtual VPANEL GetChild(VPANEL vguiPanel, int index) = 0;
virtual CUtlVector< VPANEL >& GetChildren(VPANEL vguiPanel) = 0;
virtual VPANEL GetParent(VPANEL vguiPanel) = 0;
virtual void MoveToFront(VPANEL vguiPanel) = 0;
virtual void MoveToBack(VPANEL vguiPanel) = 0;
virtual bool HasParent(VPANEL vguiPanel, VPANEL potentialParent) = 0;
virtual bool IsPopup(VPANEL vguiPanel) = 0;
virtual void SetPopup(VPANEL vguiPanel, bool state) = 0;
virtual bool IsFullyVisible(VPANEL vguiPanel) = 0;
virtual HScheme GetScheme(VPANEL vguiPanel) = 0;
virtual bool IsProportional(VPANEL vguiPanel) = 0;
virtual bool IsAutoDeleteSet(VPANEL vguiPanel) = 0;
virtual void DeletePanel(VPANEL vguiPanel) = 0;
virtual void SetKeyBoardInputEnabled(VPANEL vguiPanel, bool state) = 0;
virtual void SetMouseInputEnabled(VPANEL vguiPanel, bool state) = 0;
virtual bool IsKeyBoardInputEnabled(VPANEL vguiPanel) = 0;
virtual bool IsMouseInputEnabled(VPANEL vguiPanel) = 0;
virtual void Solve(VPANEL vguiPanel) = 0;
virtual const char* GetName(VPANEL vguiPanel) = 0;
virtual const char* GetClassName(VPANEL vguiPanel) = 0;
virtual void SendMessage(VPANEL vguiPanel, KeyValues* params, VPANEL ifromPanel) = 0;
virtual void Think(VPANEL vguiPanel) = 0;
virtual void PerformApplySchemeSettings(VPANEL vguiPanel) = 0;
virtual void PaintTraverse(VPANEL vguiPanel, bool forceRepaint, bool allowForce = true) = 0;
virtual void Repaint(VPANEL vguiPanel) = 0;
virtual VPANEL IsWithinTraverse(VPANEL vguiPanel, int x, int y, bool traversePopups) = 0;
virtual void OnChildAdded(VPANEL vguiPanel, VPANEL child) = 0;
virtual void OnSizeChanged(VPANEL vguiPanel, int newWide, int newTall) = 0;
virtual void InternalFocusChanged(VPANEL vguiPanel, bool lost) = 0;
virtual bool RequestInfo(VPANEL vguiPanel, KeyValues* outputData) = 0;
virtual void RequestFocus(VPANEL vguiPanel, int direction = 0) = 0;
virtual bool RequestFocusPrev(VPANEL vguiPanel, VPANEL existingPanel) = 0;
virtual bool RequestFocusNext(VPANEL vguiPanel, VPANEL existingPanel) = 0;
virtual VPANEL GetCurrentKeyFocus(VPANEL vguiPanel) = 0;
virtual int GetTabPosition(VPANEL vguiPanel) = 0;
virtual SurfacePlat* Plat(VPANEL vguiPanel) = 0;
virtual void SetPlat(VPANEL vguiPanel, SurfacePlat* Plat) = 0;
virtual Panel* GetPanel(VPANEL vguiPanel, const char* destinationModule) = 0;
virtual bool IsEnabled(VPANEL vguiPanel) = 0;
virtual void SetEnabled(VPANEL vguiPanel, bool state) = 0;
virtual bool IsTopmostPopup(VPANEL vguiPanel) = 0;
virtual void SetTopmostPopup(VPANEL vguiPanel, bool state) = 0;
virtual void SetMessageContextId(VPANEL vguiPanel, int nContextId) = 0;
virtual int GetMessageContextId(VPANEL vguiPanel) = 0;
virtual const DmxElementUnpackStructure_t* GetUnpackStructure(VPANEL vguiPanel) const = 0;
virtual void OnUnserialized(VPANEL vguiPanel, CDmxElement* pElement) = 0;
virtual void SetSiblingPin(VPANEL vguiPanel, VPANEL newSibling, byte iMyCornerToPin = 0, byte iSiblingCornerToPinTo = 0) = 0;
};
}
#endif

View File

@ -1,85 +0,0 @@
#ifndef ISCHEME_H
#define ISCHEME_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "interface.h"
class Color;
class KeyValues;
namespace vgui
{
typedef unsigned long HScheme;
typedef unsigned long HTexture;
class IBorder;
class IImage;
class IScheme : public IBaseInterface
{
public:
virtual const char* GetResourceString(const char* stringName) = 0;
virtual IBorder* GetBorder(const char* borderName) = 0;
virtual HFont GetFont(const char* fontName, bool proportional = false) = 0;
virtual char const* GetFontName(const HFont& font) = 0;
virtual Color GetColor(const char* colorName, Color defaultColor) = 0;
virtual int GetBorderCount() const = 0;
virtual IBorder* GetBorderAtIndex(int iIndex) = 0;
virtual int GetFontCount() const = 0;
virtual HFont GetFontAtIndex(int iIndex) = 0;
virtual const KeyValues* GetColorData() const = 0;
};
class ISchemeManager : public IBaseInterface
{
public:
virtual HScheme LoadSchemeFromFile(const char* fileName, const char* tag) = 0;
virtual void ReloadSchemes() = 0;
virtual void ReloadFonts() = 0;
virtual HScheme GetDefaultScheme() = 0;
virtual HScheme GetScheme(const char* tag) = 0;
virtual IImage* GetImage(const char* imageName, bool hardwareFiltered) = 0;
virtual HTexture GetImageID(const char* imageName, bool hardwareFiltered) = 0;
virtual IScheme* GetIScheme(HScheme scheme) = 0;
virtual void Shutdown(bool full = true) = 0;
virtual int GetProportionalScaledValue(int normalizedValue) = 0;
virtual int GetProportionalNormalizedValue(int scaledValue) = 0;
virtual HScheme LoadSchemeFromFileEx(VPANEL sizingPanel, const char* fileName, const char* tag) = 0;
virtual int GetProportionalScaledValueEx(HScheme scheme, int normalizedValue) = 0;
virtual int GetProportionalNormalizedValueEx(HScheme scheme, int scaledValue) = 0;
virtual bool DeleteImage(const char* pImageName) = 0;
};
#define VGUI_SCHEME_INTERFACE_VERSION "VGUI_Scheme010"
}
#endif

View File

@ -1,378 +0,0 @@
#ifndef ISURFACE_H
#define ISURFACE_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "IHTML.h"
#include "interface.h"
#include "imageformat.h"
#include "IAppSystem.h"
#include "vector2d.h"
#include "ichromehtmlwrapper.h"
#include "IVguiMatInfo.h"
#ifdef CreateFont
#undef CreateFont
#endif
#ifdef PlaySound
#undef PlaySound
#endif
class Color;
class ITexture;
namespace vgui
{
class IImage;
class Image;
class Point;
typedef unsigned long HCursor;
typedef unsigned long HTexture;
typedef unsigned long HFont;
struct Vertex_t
{
Vertex_t() {}
Vertex_t(const Vector2D& pos, const Vector2D& coord = Vector2D(0, 0))
{
m_Position = pos;
m_TexCoord = coord;
}
void Init(const Vector2D& pos, const Vector2D& coord = Vector2D(0, 0))
{
m_Position = pos;
m_TexCoord = coord;
}
Vector2D m_Position;
Vector2D m_TexCoord;
};
enum FontDrawType_t
{
FONT_DRAW_DEFAULT = 0,
FONT_DRAW_NONADDITIVE,
FONT_DRAW_ADDITIVE,
FONT_DRAW_TYPE_COUNT = 2,
};
struct CharRenderInfo
{
int x, y;
Vertex_t* verts;
int textureId;
int abcA;
int abcB;
int abcC;
int fontTall;
HFont currentFont;
FontDrawType_t drawType;
wchar_t ch;
bool valid;
bool shouldclip;
};
struct IntRect
{
int x0;
int y0;
int x1;
int y1;
};
struct DrawTexturedRectParms_t
{
DrawTexturedRectParms_t()
{
s0 = t0 = 0;
s1 = t1 = 1.0f;
alpha_ul = alpha_ur = alpha_lr = alpha_ll = 255;
angle = 0;
}
int x0;
int y0;
int x1;
int y1;
float s0;
float t0;
float s1;
float t1;
unsigned char alpha_ul;
unsigned char alpha_ur;
unsigned char alpha_lr;
unsigned char alpha_ll;
float angle;
};
class ISurface : public IAppSystem
{
public:
virtual void Shutdown() = 0;
virtual void RunFrame() = 0;
virtual VPANEL GetEmbeddedPanel() = 0;
virtual void SetEmbeddedPanel(VPANEL pPanel) = 0;
virtual void PushMakeCurrent(VPANEL panel, bool useInsets) = 0;
virtual void PopMakeCurrent(VPANEL panel) = 0;
virtual void DrawSetColor(int r, int g, int b, int a) = 0;
virtual void DrawSetColor(Color col) = 0;
virtual void DrawFilledRect(int x0, int y0, int x1, int y1) = 0;
virtual void DrawFilledRectArray(IntRect* pRects, int numRects) = 0;
virtual void DrawOutlinedRect(int x0, int y0, int x1, int y1) = 0;
virtual void DrawLine(int x0, int y0, int x1, int y1) = 0;
virtual void DrawPolyLine(int* px, int* py, int numPoints) = 0;
virtual void DrawSetApparentDepth(float depth) = 0;
virtual void DrawClearApparentDepth() = 0;
virtual void DrawSetTextFont(HFont font) = 0;
virtual void DrawSetTextColor(int r, int g, int b, int a) = 0;
virtual void DrawSetTextColor(Color col) = 0;
virtual void DrawSetTextPos(int x, int y) = 0;
virtual void DrawGetTextPos(int& x, int& y) = 0;
virtual void DrawPrintText(const wchar_t* text, int textLen, FontDrawType_t drawType = FONT_DRAW_DEFAULT) = 0;
virtual void DrawUnicodeChar(wchar_t wch, FontDrawType_t drawType = FONT_DRAW_DEFAULT) = 0;
virtual void DrawFlushText() = 0;
virtual IHTML* CreateHTMLWindow(vgui::IHTMLEvents* events, VPANEL context) = 0;
virtual void PaintHTMLWindow(vgui::IHTML* htmlwin) = 0;
virtual void DeleteHTMLWindow(IHTML* htmlwin) = 0;
enum ETextureFormat
{
eTextureFormat_RGBA,
eTextureFormat_BGRA,
eTextureFormat_BGRA_Opaque,
};
virtual int DrawGetTextureId(char const* filename) = 0;
virtual bool DrawGetTextureFile(int id, char* filename, int maxlen) = 0;
virtual void DrawSetTextureFile(int id, const char* filename, int hardwareFilter, bool forceReload) = 0;
virtual void DrawSetTextureRGBA(int id, const unsigned char* rgba, int wide, int tall, int hardwareFilter, bool forceReload) = 0;
virtual void DrawSetTexture(int id) = 0;
virtual bool DeleteTextureByID(int id) = 0;
virtual void DrawGetTextureSize(int id, int& wide, int& tall) = 0;
virtual void DrawTexturedRect(int x0, int y0, int x1, int y1) = 0;
virtual bool IsTextureIDValid(int id) = 0;
virtual int CreateNewTextureID(bool procedural = false) = 0;
virtual void GetScreenSize(int& wide, int& tall) = 0;
virtual void SetAsTopMost(VPANEL panel, bool state) = 0;
virtual void BringToFront(VPANEL panel) = 0;
virtual void SetForegroundWindow(VPANEL panel) = 0;
virtual void SetPanelVisible(VPANEL panel, bool state) = 0;
virtual void SetMinimized(VPANEL panel, bool state) = 0;
virtual bool IsMinimized(VPANEL panel) = 0;
virtual void FlashWindow(VPANEL panel, bool state) = 0;
virtual void SetTitle(VPANEL panel, const wchar_t* title) = 0;
virtual void SetAsToolBar(VPANEL panel, bool state) = 0;
virtual void CreatePopup(VPANEL panel, bool minimised, bool showTaskbarIcon = true, bool disabled = false, bool mouseInput = true, bool kbInput = true) = 0;
virtual void SwapBuffers(VPANEL panel) = 0;
virtual void Invalidate(VPANEL panel) = 0;
virtual void SetCursor(HCursor cursor) = 0;
virtual bool IsCursorVisible() = 0;
virtual void ApplyChanges() = 0;
virtual bool IsWithin(int x, int y) = 0;
virtual bool HasFocus() = 0;
enum SurfaceFeature_e
{
ANTIALIASED_FONTS = 1,
DROPSHADOW_FONTS = 2,
ESCAPE_KEY = 3,
OPENING_NEW_HTML_WINDOWS = 4,
FRAME_MINIMIZE_MAXIMIZE = 5,
OUTLINE_FONTS = 6,
DIRECT_HWND_RENDER = 7,
};
virtual bool SupportsFeature(SurfaceFeature_e feature) = 0;
virtual void RestrictPaintToSinglePanel(VPANEL panel) = 0;
virtual void SetModalPanel(VPANEL) = 0;
virtual VPANEL GetModalPanel() = 0;
virtual void UnlockCursor() = 0;
virtual void LockCursor() = 0;
virtual void SetTranslateExtendedKeys(bool state) = 0;
virtual VPANEL GetTopmostPopup() = 0;
virtual void SetTopLevelFocus(VPANEL panel) = 0;
virtual HFont CreateFont() = 0;
enum EFontFlags
{
FONTFLAG_NONE,
FONTFLAG_ITALIC = 0x001,
FONTFLAG_UNDERLINE = 0x002,
FONTFLAG_STRIKEOUT = 0x004,
FONTFLAG_SYMBOL = 0x008,
FONTFLAG_ANTIALIAS = 0x010,
FONTFLAG_GAUSSIANBLUR = 0x020,
FONTFLAG_ROTARY = 0x040,
FONTFLAG_DROPSHADOW = 0x080,
FONTFLAG_ADDITIVE = 0x100,
FONTFLAG_OUTLINE = 0x200,
FONTFLAG_CUSTOM = 0x400,
FONTFLAG_BITMAP = 0x800,
};
virtual bool SetFontGlyphSet(HFont font, const char* windowsFontName, int tall, int weight, int blur, int scanlines, int flags, int nRangeMin = 0, int nRangeMax = 0) = 0;
virtual bool AddCustomFontFile(const char* fontName, const char* fontFileName) = 0;
virtual int GetFontTall(HFont font) = 0;
virtual int GetFontAscent(HFont font, wchar_t wch) = 0;
virtual bool IsFontAdditive(HFont font) = 0;
virtual void GetCharABCwide(HFont font, int ch, int& a, int& b, int& c) = 0;
virtual int GetCharacterWidth(HFont font, int ch) = 0;
virtual void GetTextSize(HFont font, const wchar_t* text, int& wide, int& tall) = 0;
virtual VPANEL GetNotifyPanel() = 0;
virtual void SetNotifyIcon(VPANEL context, HTexture icon, VPANEL panelToReceiveMessages, const char* text) = 0;
virtual void PlaySound(const char* fileName) = 0;
virtual int GetPopupCount() = 0;
virtual VPANEL GetPopup(int index) = 0;
virtual bool ShouldPaintChildPanel(VPANEL childPanel) = 0;
virtual bool RecreateContext(VPANEL panel) = 0;
virtual void AddPanel(VPANEL panel) = 0;
virtual void ReleasePanel(VPANEL panel) = 0;
virtual void MovePopupToFront(VPANEL panel) = 0;
virtual void MovePopupToBack(VPANEL panel) = 0;
virtual void SolveTraverse(VPANEL panel, bool forceApplySchemeSettings = false) = 0;
virtual void PaintTraverse(VPANEL panel) = 0;
virtual void EnableMouseCapture(VPANEL panel, bool state) = 0;
virtual void GetWorkspaceBounds(int& x, int& y, int& wide, int& tall) = 0;
virtual void GetAbsoluteWindowBounds(int& x, int& y, int& wide, int& tall) = 0;
virtual void GetProportionalBase(int& width, int& height) = 0;
virtual void CalculateMouseVisible() = 0;
virtual bool NeedKBInput() = 0;
virtual bool HasCursorPosFunctions() = 0;
virtual void SurfaceGetCursorPos(int& x, int& y) = 0;
virtual void SurfaceSetCursorPos(int x, int y) = 0;
virtual void DrawTexturedLine(const Vertex_t& a, const Vertex_t& b) = 0;
virtual void DrawOutlinedCircle(int x, int y, int radius, int segments) = 0;
virtual void DrawTexturedPolyLine(const Vertex_t* p, int n) = 0;
virtual void DrawTexturedSubRect(int x0, int y0, int x1, int y1, float texs0, float text0, float texs1, float text1) = 0;
virtual void DrawTexturedPolygon(int n, Vertex_t* pVertice, bool bClipVertices = true) = 0;
virtual const wchar_t* GetTitle(VPANEL panel) = 0;
virtual bool IsCursorLocked(void) const = 0;
virtual void SetWorkspaceInsets(int left, int top, int right, int bottom) = 0;
virtual void DrawWordBubble(int x0, int y0, int x1, int y1, int nBorderThickness, Color rgbaBackground, Color rgbaBorder,
bool bPointer = false, int nPointerX = 0, int nPointerY = 0, int nPointerBaseThickness = 16) = 0;
virtual bool DrawGetUnicodeCharRenderInfo(wchar_t ch, CharRenderInfo& info) = 0;
virtual void DrawRenderCharFromInfo(const CharRenderInfo& info) = 0;
virtual void DrawSetAlphaMultiplier(float alpha ) = 0;
virtual float DrawGetAlphaMultiplier() = 0;
virtual void SetAllowHTMLJavaScript(bool state) = 0;
virtual void OnScreenSizeChanged(int nOldWidth, int nOldHeight) = 0;
virtual vgui::HCursor CreateCursorFromFile(char const* curOrAniFile, char const* pPathID = 0) = 0;
virtual IVguiMatInfo* DrawGetTextureMatInfoFactory(int id) = 0;
virtual void PaintTraverseEx(VPANEL panel, bool paintPopups = false) = 0;
virtual float GetZPos() const = 0;
virtual void SetPanelForInput(VPANEL vpanel) = 0;
virtual void DrawFilledRectFastFade(int x0, int y0, int x1, int y1, int fadeStartPt, int fadeEndPt, unsigned int alpha0, unsigned int alpha1, bool bHorizontal) = 0;
virtual void DrawFilledRectFade(int x0, int y0, int x1, int y1, unsigned int alpha0, unsigned int alpha1, bool bHorizontal) = 0;
virtual void DrawSetTextureRGBAEx(int id, const unsigned char* rgba, int wide, int tall, ImageFormat imageFormat) = 0;
virtual void DrawSetTextScale(float sx, float sy) = 0;
virtual bool SetBitmapFontGlyphSet(HFont font, const char* windowsFontName, float scalex, float scaley, int flags) = 0;
virtual bool AddBitmapFontFile(const char* fontFileName) = 0;
virtual void SetBitmapFontName(const char* pName, const char* pFontFilename) = 0;
virtual const char* GetBitmapFontName(const char* pName) = 0;
virtual void ClearTemporaryFontCache(void) = 0;
virtual IImage* GetIconImageForFullPath(char const* pFullPath) = 0;
virtual void DrawUnicodeString(const wchar_t* pwString, FontDrawType_t drawType = FONT_DRAW_DEFAULT) = 0;
virtual void PrecacheFontCharacters(HFont font, const wchar_t* pCharacters) = 0;
virtual const char* GetFontName(HFont font) = 0;
virtual bool ForceScreenSizeOverride(bool bState, int wide, int tall) = 0;
virtual bool ForceScreenPosOffset(bool bState, int x, int y) = 0;
virtual void OffsetAbsPos(int& x, int& y) = 0;
virtual void SetAbsPosForContext(int id, int x, int y) = 0;
virtual void GetAbsPosForContext(int id, int& x, int& y) = 0;
virtual void ResetFontCaches() = 0;
virtual bool IsScreenSizeOverrideActive(void) = 0;
virtual bool IsScreenPosOverrideActive(void) = 0;
virtual void DestroyTextureID(int id) = 0;
virtual int GetTextureNumFrames(int id) = 0;
virtual void DrawSetTextureFrame(int id, int nFrame, unsigned int* pFrameCache) = 0;
virtual void GetClipRect(int& x0, int& y0, int& x1, int& y1) = 0;
virtual void SetClipRect(int x0, int y0, int x1, int y1) = 0;
virtual void DrawTexturedRectEx(DrawTexturedRectParms_t* pDrawParms) = 0;
virtual void GetKernedCharWidth(HFont font, wchar_t ch, wchar_t chBefore, wchar_t chAfter, float& wide, float& abcA, float& abcC) = 0;
virtual void DrawUpdateRegionTextureRGBA(int nTextureID, int x, int y, const unsigned char* pchData, int wide, int tall, ImageFormat imageFormat) = 0;
virtual bool BHTMLWindowNeedsPaint(IHTML* htmlwin) = 0;
virtual void DrawSetTextureRGBALinear(int id, const unsigned char* rgba, int wide, int tall) = 0;
virtual const char* GetWebkitHTMLUserAgentString() = 0;
virtual void* Deprecated_AccessChromeHTMLController() = 0;
};
}
#define VGUI_SURFACE_INTERFACE_VERSION "VGUI_Surface030"
#endif

View File

@ -1,86 +0,0 @@
#ifndef ISYSTEM_H
#define ISYSTEM_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "VGUI.h"
#include "KeyCode.h"
#ifdef PlaySound
#undef PlaySound
#endif
class KeyValues;
namespace vgui
{
class ISystem : public IBaseInterface
{
public:
virtual void Shutdown() = 0;
virtual void RunFrame() = 0;
virtual void ShellExecute(const char* command, const char* file) = 0;
virtual double GetFrameTime() = 0;
virtual double GetCurrentTime() = 0;
virtual long GetTimeMillis() = 0;
virtual int GetClipboardTextCount() = 0;
virtual void SetClipboardText(const char* text, int textLen) = 0;
virtual void SetClipboardText(const wchar_t* text, int textLen) = 0;
virtual int GetClipboardText(int offset, char* buf, int bufLen) = 0;
virtual int GetClipboardText(int offset, wchar_t* buf, int bufLen) = 0;
virtual bool SetRegistryString(const char* key, const char* value) = 0;
virtual bool GetRegistryString(const char* key, char* value, int valueLen) = 0;
virtual bool SetRegistryInteger(const char* key, int value) = 0;
virtual bool GetRegistryInteger(const char* key, int& value) = 0;
virtual KeyValues* GetUserConfigFileData(const char* dialogName, int dialogID) = 0;
virtual void SetUserConfigFile(const char* fileName, const char* pathName) = 0;
virtual void SaveUserConfigFile() = 0;
virtual bool SetWatchForComputerUse(bool state) = 0;
virtual double GetTimeSinceLastUse() = 0;
virtual int GetAvailableDrives(char* buf, int bufLen) = 0;
virtual bool CommandLineParamExists(const char* paramName) = 0;
virtual const char* GetFullCommandLine() = 0;
virtual KeyCode KeyCode_VirtualKeyToVGUI(int keyCode) = 0;
virtual bool GetCurrentTimeAndDate(int* year, int* month, int* dayOfWeek, int* day, int* hour, int* minute, int* second) = 0;
virtual double GetFreeDiskSpace(const char* path) = 0;
virtual bool CreateShortcut(const char* linkFileName, const char* targetPath, const char* arguments, const char* workingDirectory, const char* iconFile) = 0;
virtual bool GetShortcutTarget(const char* linkFileName, char* targetPath, char* arguments, int destBufferSizes) = 0;
virtual bool ModifyShortcutTarget(const char* linkFileName, const char* targetPath, const char* arguments, const char* workingDirectory) = 0;
virtual bool GetCommandLineParamValue(const char* paramName, char* value, int valueBufferSize) = 0;
virtual bool DeleteRegistryKey(const char* keyName) = 0;
virtual const char* GetDesktopFolderPath() = 0;
virtual void ShellExecuteEx(const char* command, const char* file, const char* pParams) = 0;
virtual void SetClipboardImage(void* pWnd, int x1, int y1, int x2, int y2) = 0;
};
}
#define VGUI_SYSTEM_INTERFACE_VERSION "VGUI_System010"
#endif

View File

@ -1,79 +0,0 @@
#ifndef IVGUI_H
#define IVGUI_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "VGUI.h"
#include "IAppSystem.h"
class KeyValues;
namespace vgui
{
typedef unsigned long HPanel;
typedef int HContext;
enum
{
DEFAULT_VGUI_CONTEXT = ((vgui::HContext)~0)
};
typedef unsigned long HPanel;
class IVGui : public IAppSystem
{
public:
virtual void Start() = 0;
virtual void Stop() = 0;
virtual bool IsRunning() = 0;
virtual void RunFrame() = 0;
virtual void ShutdownMessage(unsigned int shutdownID) = 0;
virtual VPANEL AllocPanel() = 0;
virtual void FreePanel(VPANEL panel) = 0;
virtual void DPrintf(PRINTF_FORMAT_STRING const char* format, ...) = 0;
virtual void DPrintf2(PRINTF_FORMAT_STRING const char* format, ...) = 0;
virtual void SpewAllActivePanelNames() = 0;
virtual HPanel PanelToHandle(VPANEL panel) = 0;
virtual VPANEL HandleToPanel(HPanel index) = 0;
virtual void MarkPanelForDeletion(VPANEL panel) = 0;
virtual void AddTickSignal(VPANEL panel, int intervalMilliseconds = 0) = 0;
virtual void RemoveTickSignal(VPANEL panel) = 0;
virtual void PostMessage(VPANEL target, KeyValues* params, VPANEL from, float delaySeconds = 0.0f) = 0;
virtual HContext CreateContext() = 0;
virtual void DestroyContext(HContext context) = 0;
virtual void AssociatePanelWithContext(HContext context, VPANEL pRoot) = 0;
virtual void ActivateContext(HContext context) = 0;
virtual void SetSleep(bool state) = 0;
virtual bool GetShouldVGuiControlSleep() = 0;
virtual void SetVRMode(bool bVRMode) = 0;
virtual bool GetVRMode() = 0;
virtual void AddTickSignalToHead(VPANEL panel, int intervalMilliseconds = 0) = 0;
};
#define VGUI_IVGUI_INTERFACE_VERSION "VGUI_ivgui008"
};
#endif

View File

@ -1,17 +0,0 @@
#ifndef IVGUIMATINFO_H
#define IVGUIMATINFO_H
#include "IVguiMatInfoVar.h"
class IVguiMatInfo
{
public:
virtual ~IVguiMatInfo() {}
virtual IVguiMatInfoVar* FindVarFactory(const char* varName, bool* found) = 0;
virtual int GetNumAnimationFrames() = 0;
};
#endif

View File

@ -1,15 +0,0 @@
#ifndef IVGUIMATINFOVAR_H
#define IVGUIMATINFOVAR_H
class IVguiMatInfoVar
{
public:
virtual ~IVguiMatInfoVar() {}
virtual int GetIntValue(void) const = 0;
virtual void SetIntValue(int val) = 0;
};
#endif

View File

@ -1,64 +0,0 @@
#ifndef IMAGE_H
#define IMAGE_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "Color.h"
#include "IImage.h"
namespace vgui
{
class Panel;
class Image : public IImage
{
public:
Image();
virtual ~Image();
virtual void SetPos(int x, int y);
virtual void GetPos(int& x, int& y);
virtual void GetSize(int& wide, int& tall);
virtual void GetContentSize(int& wide, int& tall);
virtual void SetColor(Color color);
virtual void SetBkColor(Color color) { DrawSetColor(color); }
virtual Color GetColor();
virtual bool Evict();
virtual int GetNumFrames();
virtual void SetFrame(int nFrame);
virtual HTexture GetID();
virtual void SetRotation(int iRotation) { return; };
protected:
virtual void SetSize(int wide, int tall);
virtual void DrawSetColor(Color color);
virtual void DrawSetColor(int r, int g, int b, int a);
virtual void DrawFilledRect(int x0, int y0, int x1, int y1);
virtual void DrawOutlinedRect(int x0, int y0, int x1, int y1);
virtual void DrawLine(int x0, int y0, int x1, int y1);
virtual void DrawPolyLine(int* px, int* py, int numPoints);
virtual void DrawSetTextFont(HFont font);
virtual void DrawSetTextColor(Color color);
virtual void DrawSetTextColor(int r, int g, int b, int a);
virtual void DrawSetTextPos(int x, int y);
virtual void DrawPrintText(const wchar_t* str, int strlen);
virtual void DrawPrintText(int x, int y, const wchar_t* str, int strlen);
virtual void DrawPrintChar(wchar_t ch);
virtual void DrawPrintChar(int x, int y, wchar_t ch);
virtual void DrawSetTexture(int id);
virtual void DrawTexturedRect(int x0, int y0, int x1, int y1);
virtual void Paint() = 0;
private:
int _pos[2];
int _size[2];
Color _color;
};
}
#endif

View File

@ -1,82 +0,0 @@
#ifndef INPUTENUMS_H
#define INPUTENUMS_H
#ifdef _WIN32
#pragma once
#endif
#define MAX_BUTTONSAMPLE 32768
#if !defined( _X360 )
#define INVALID_USER_ID -1
#else
#define INVALID_USER_ID XBX_INVALID_USER_ID
#endif
enum
{
MAX_JOYSTICKS = 1,
MOUSE_BUTTON_COUNT = 5,
MAX_NOVINT_DEVICES = 2,
};
#if defined( LINUX )
enum JoystickAxis_t
{
JOY_AXIS_X = 0,
JOY_AXIS_Y,
JOY_AXIS_Z,
JOY_AXIS_U,
JOY_AXIS_R,
JOY_AXIS_V,
MAX_JOYSTICK_AXES,
};
#else
enum JoystickAxis_t
{
JOY_AXIS_X = 0,
JOY_AXIS_Y,
JOY_AXIS_Z,
JOY_AXIS_R,
JOY_AXIS_U,
JOY_AXIS_V,
MAX_JOYSTICK_AXES,
};
#endif
enum
{
MS_WM_XBUTTONDOWN = 0x020B,
MS_WM_XBUTTONUP = 0x020C,
MS_WM_XBUTTONDBLCLK = 0x020D,
MS_MK_BUTTON4 = 0x0020,
MS_MK_BUTTON5 = 0x0040,
};
enum InputEventType_t
{
IE_ButtonPressed = 0,
IE_ButtonReleased,
IE_ButtonDoubleClicked,
IE_AnalogValueChanged,
IE_FirstSystemEvent = 100,
IE_Quit = IE_FirstSystemEvent,
IE_ControllerInserted,
IE_ControllerUnplugged,
IE_FirstVguiEvent = 1000,
IE_FirstAppEvent = 2000,
};
struct InputEvent_t
{
int m_nType;
int m_nTick;
int m_nData;
int m_nData2;
int m_nData3;
};
#endif

View File

@ -1,180 +0,0 @@
#include "Interfaces.hpp"
#include "PatternScan.hpp"
IF iff;
void* IF::GetInterface(const char* dllname, const char* interfacename)
{
tCreateInterface CreateInterface = (tCreateInterface)GetProcAddress(GetModuleHandleA(dllname), "CreateInterface");
int returnCode = 0;
void* ointerface = CreateInterface(interfacename, &returnCode);
#ifdef DEBUG
printf("%s = %x\n", interfacename, ointerface);
#endif
return ointerface;
}
PVOID FindHudElement(const char* name)
{
void* pointer1 = (void*)(FindPatternV2("client.dll", "B9 ? ? ? ? E8 ? ? ? ? 8B 5D 08") + 1);
static void* pThis = *reinterpret_cast<DWORD**>(pointer1);
void* pointer2 = (void*)(FindPatternV2("client.dll", "55 8B EC 53 8B 5D 08 56 57 8B F9 33 F6 39 77 28"));
static auto find_hud_element
= reinterpret_cast<DWORD(__thiscall*)(void*, const char*)>(
pointer2
);
return (void*)find_hud_element(pThis, name);
}
#define VTBL(classptr) (*(DWORD*)classptr)
#define PVFN_(classptr, offset) (VTBL(classptr) + offset)
#define VFN_(classptr, offset) *(DWORD*)PVFN_(classptr, offset)
#define VFN(classptr, offset) VFN_(classptr, (offset * sizeof(void*)))
void IF::Init()
{
g_pEntityList = (IClientEntityList*)GetInterface("client.dll", "VClientEntityList003");
g_pGameUI = (CGameUI*)GetInterface("client.dll", "GameUI011");
g_pVGuiPanel = (vgui::IPanel*)GetInterface("vgui2.dll", "VGUI_Panel009");
g_pGameEvents = (CGameEventManager*)GetInterface("engine.dll", "GAMEEVENTSMANAGER002");
g_pEngineClient = (IVEngineClient*)GetInterface("engine.dll", "VEngineClient014");
g_pEnginetrace = (IEngineTrace*)GetInterface("engine.dll", "EngineTraceClient004");
g_pEnginevgui = (IEngineVGui*)GetInterface("engine.dll", "VEngineVGui001");
g_pVGui = (vgui::IVGui*)GetInterface("vgui2.dll", "VGUI_ivgui008");
g_pClient = (IBaseClientDLL*)GetInterface("client.dll", "VClient018");
g_pMdlInfo = (IVModelInfoClient*)GetInterface("engine.dll", "VModelInfoClient004");
g_pMdlRender = (IVModelRender*)GetInterface("engine.dll", "VEngineModel016");
g_pMaterialSystem = (IMaterialSystem*)GetInterface("materialsystem.dll", "VMaterialSystem080");
g_pCVar = (ICvar*)GetInterface("vstdlib.dll", "VEngineCvar007");
g_pVGuiSystem = (vgui::ISystem*)GetInterface("vgui2.dll", "VGUI_System010");
g_pVGuiSchemeManager = (vgui::ISchemeManager*)GetInterface("vgui2.dll", "VGUI_Scheme010");
g_pVGuiInput = (vgui::IInput*)GetInterface("vgui2.dll", "VGUI_Input005");
g_pFullFileSystem = (IFileSystem*)GetInterface("filesystem_stdio.dll", "VFileSystem017");
g_pGameConsole = (IGameConsole*)GetInterface("client.dll", "GameConsole004");
g_pEfx = (IVEfx*)GetInterface("engine.dll", "VEngineEffects001");
g_pPhysProps = (IPhysicsSurfaceProps*)GetInterface("vphysics.dll", "VPhysicsSurfaceProps001");
g_pRenderView = (IVRenderView*)GetInterface("engine.dll", "VEngineRenderView014");
g_pDebugOverlay = (IVDebugOverlay*)GetInterface("engine.dll", "VDebugOverlay004");
g_pEffects = (IEffects*)GetInterface("client.dll", "IEffects001");
g_pStudioRender = (IStudioRender*)GetInterface("studiorender.dll", "VStudioRender026");
typedef PVOID(__cdecl* oKeyValuesSystem)();
oKeyValuesSystem pkeyValuesSystem = (oKeyValuesSystem)GetProcAddress(GetModuleHandleA("vstdlib.dll"), "KeyValuesSystem");
keyValuesSystem = (IKeyValuesSystem*)pkeyValuesSystem();
#ifdef DEBUG
printf("KeyValuesSystem = %x\n", keyValuesSystem);
#endif
myConMsg = (CONMSGPROC)GetProcAddress(GetModuleHandleA("tier0.dll"), "?ConMsg@@YAXPBDZZ");
myConColorMsg = (CONCOLORMSGPROC)GetProcAddress(GetModuleHandleA("tier0.dll"), "?ConColorMsg@@YAXABVColor@@PBDZZ");
g_pGlobals = **(CGlobalVarsBase***)(FindPatternV2("client.dll", "A1 ? ? ? ? 5E 8B 40 10") + 1);
g_pInput = *(CInput**)(FindPatternV2("client.dll", "B9 ? ? ? ? F3 0F 11 04 24 FF 50 10") + 1);
g_pViewRenderBeams = *(IViewRenderBeams**)(FindPatternV2("client.dll", "B9 ?? ?? ?? ?? A1 ?? ?? ?? ?? FF 10 A1 ?? ?? ?? ?? B9") + 0x1);
#ifdef DEBUG
printf("g_pGlobals = %x\n", g_pGlobals);
printf("g_pInput = %x\n", g_pInput);
printf("g_pViewRenderBeams = %x\n", g_pViewRenderBeams);
#endif
FX_Tesla = (FX_TeslaFn)FindPatternV2("client.dll", "55 8B EC 81 EC ? ? ? ? 56 57 8B F9 8B 47 18");
#ifdef DEBUG
printf("FX_TeslaFn %x\n", FX_Tesla);
#endif
BloodSprayFn = (FX_BloodSprayFn)FindPatternV2("client.dll", "55 8B EC 8B 4D 08 F3 0F 10 51 ? 8D");
#ifdef DEBUG
printf("FX_BloodSprayFn %x\n", BloodSprayFn);
#endif
DispatchEffect = (FXDispatchEffect)FindPatternV2("client.dll", "55 8B EC 83 E4 F8 83 EC 20 56 57 8B F9 C7 44 24");
#ifdef DEBUG
printf("DispatchEffect %x\n", DispatchEffect);
#endif
g_pChatElement = (CHudChat*)FindHudElement("CHudChat");
#ifdef DEBUG
printf("Chat element %x\n", g_pChatElement);
#endif
LoadFromFile = (void*)FindPatternV2("client.dll", "55 8B EC 83 EC 0C 53 8B 5D 08 56 8B F1 3B");
#ifdef DEBUG
printf("LoadFromFile %x\n", LoadFromFile);
#endif
g_pD3DDevice9 = **(IDirect3DDevice9***)(FindPatternV2("shaderapidx9.dll", "A1 ? ? ? ? 50 8B 08 FF 51 0C") + 1);
#ifdef DEBUG
printf("g_pD3DDevice9 %x\n", g_pD3DDevice9);
#endif
g_pMemAlloc = *(IMemAlloc**)(GetProcAddress(GetModuleHandle("tier0.dll"), "g_pMemAlloc"));
#ifdef DEBUG
printf("g_pMemAlloc %x\n", g_pMemAlloc);
#endif
g_pClientState = **reinterpret_cast<CClientState***>(getvfunc<uintptr_t>(g_pEngineClient, 12) + 0x10);
#ifdef DEBUG
printf("g_pClientState %x\n", g_pClientState);
#endif
CHudElement* g_pHudElement = (CHudElement*)FindHudElement("CCSGO_HudDeathNotice");
#ifdef DEBUG
printf("Hud element %x\n", g_pHudElement);
#endif
auto SteamClient = ((ISteamClient * (__cdecl*)(void))GetProcAddress(GetModuleHandleA("steam_api.dll"), "SteamClient"))();
g_SteamGameCoordinator = (ISteamGameCoordinator*)SteamClient->GetISteamGenericInterface((void*)1, (void*)1, "SteamGameCoordinator001");
g_SteamUser = SteamClient->GetISteamUser((void*)1, (void*)1, "SteamUser019");
#ifdef DEBUG
printf("SteamClient %X\n", SteamClient);
printf("g_SteamGameCoordinator %X\n", g_SteamGameCoordinator);
printf("g_SteamUser %X\n", g_SteamUser);
#endif
g_pClientLeafSystem = (IClientLeafSystem*)GetInterface("client.dll", "ClientLeafSystem002");
#ifdef DEBUG
printf("g_pClientLeafSystem %x\n", g_pClientLeafSystem);
#endif
g_pNetworkStringTableContainer = (INetworkStringTableContainer*)GetInterface("engine.dll", "VEngineClientStringTable001");
#ifdef DEBUG
printf("g_pNetworkStringTableContainer %x\n", g_pNetworkStringTableContainer);
#endif
getPlayerViewmodelArmConfigForPlayerModel = relativeToAbsolute<decltype(getPlayerViewmodelArmConfigForPlayerModel)>(FindPatternV2("client.dll", "E8 ? ? ? ? 89 87 ? ? ? ? 6A") + 1);
g_pMdlCache = (IMDLCache*)GetInterface("datacache.dll", "MDLCache004");
g_pEngineSound = (IEngineSound*)GetInterface("engine.dll", "IEngineSoundClient003");
g_pClientShadowMgr = *(IClientShadowMgr**)(FindPatternV2("client.dll", "A1 ? ? ? ? FF 90 ? ? ? ? 6A 00 6A 00") + 1);
#ifdef DEBUG
printf("g_pClientShadowMgr %x\n", g_pClientShadowMgr);
#endif
g_ViewRender = *(CCSViewRender**)(FindPatternV2("client.dll", "A1 ? ? ? ? B9 ? ? ? ? C7 05 ? ? ? ? ? ? ? ? FF 10") + 1);
#ifdef DEBUG
printf("g_ViewRender %x\n", g_ViewRender);
#endif
g_ClientMode = **(IClientMode***)((*(DWORD**)g_pClient)[10] + 0x5);
#ifdef DEBUG
printf("g_ClientMode %x\n", g_ClientMode);
#endif
g_pInputSystem = (IInputSystem*)GetInterface("inputsystem.dll", "InputSystemVersion001");
g_pVGuiSurface = (vgui::ISurface*)GetInterface("vguimatsurface.dll", "VGUI_Surface031");
prime = (uint8_t*)FindPatternV2("client.dll", "A1 ? ? ? ? 85 C0 75 07 83 F8 05 0F 94 C0 C3");
#ifdef DEBUG
printf("Prime found at %x\n", prime);
#endif
}
auto is_code_ptr(void* ptr) -> bool
{
constexpr const DWORD protect_flags = PAGE_EXECUTE | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY;
MEMORY_BASIC_INFORMATION out;
VirtualQuery(ptr, &out, sizeof out);
return out.Type
&& !(out.Protect & (PAGE_GUARD | PAGE_NOACCESS))
&& out.Protect & protect_flags;
}

View File

@ -1,326 +0,0 @@
#ifndef INTERFACES
#define INTERFACES
#pragma once
#define DEBUG
#define CLIENT_DLL
#include "GetVfunc.hpp"
#include <iostream>
#include <windows.h>
#include "icliententitylist.h"
#include "CGameUI.h"
#include "GameEventManager.h"
#include "cdll_int.h"
#include "ISurface.h"
#include "IEngineVgui.h"
#include "ivmodelinfo.h"
#include "idatacache.h"
#include "ILocalize.h"
#include "IGameUI.h"
#include "dt_recv.h"
#include "client_class.h"
#include "enginetrace.h"
#include "gameconsole.h"
#include "ivrenderview.h"
#include "ivdebugoverlay.h"
#include "vphysics_interface.h"
#include "iefx.h"
#include "c_input.h"
#include "IEffects.h"
#include "iviewrender_beams.h"
#include "sdk_hud_chat.h"
#include "fx.h"
#include "globalvars_base.h"
#include "IInput.h"
#include "icliententity.h"
#include "iclient.h"
#include "cdll_int.h"
#include "baseclientstate.h"
#include "imgui/imgui_impl_dx9.h"
#include "flashlighteffect.h"
#include "inetchannel.h"
#include "steam.h"
#include "animationlayer.h"
#include "clientleafsystem.h"
#include "filesystem.h"
#include "modelloader.h"
#include "IEngineSound.h"
#include "iclientshadowmgr.h"
#include "cs_view_scene.h"
#include "iclientmode.h"
#include "itexture.h"
#include "precipitation_shared.h"
#include "iinputsystem.h"
#include "vpkparser.h"
#include "itempents.h"
#include "c_te_legacytempents.h"
#include "XorStr.hpp"
PVOID FindHudElement(const char* name);
auto is_code_ptr(void* ptr) -> bool;
#include "resource.h"
class IF {
public:
IClientEntityList* g_pEntityList = nullptr;
CGameUI* g_pGameUI = nullptr;
vgui::IPanel* g_pVGuiPanel = nullptr;
CGameEventManager* g_pGameEvents = nullptr;
IVEngineClient* g_pEngineClient = nullptr;
vgui::ISurface* g_pVGuiSurface = nullptr;
IEngineVGui* g_pEnginevgui = nullptr;
vgui::IVGui* g_pVGui = nullptr;
IBaseClientDLL* g_pClient = nullptr;
IVModelInfoClient* g_pMdlInfo = nullptr;
IVModelRender* g_pMdlRender = nullptr;
IMaterialSystem* g_pMaterialSystem = nullptr;
IKeyValuesSystem* keyValuesSystem = nullptr;
ICvar* g_pCVar = nullptr;
vgui::ISystem* g_pVGuiSystem = nullptr;
vgui::ISchemeManager* g_pVGuiSchemeManager = nullptr;
vgui::IInput* g_pVGuiInput = nullptr;
IFileSystem* g_pFullFileSystem = nullptr;
vgui::ILocalize* g_pVGuiLocalize = nullptr;
IEngineTrace* g_pEnginetrace = nullptr;
IVEfx* g_pEfx = nullptr;
IGameConsole* g_pGameConsole = nullptr;
IPhysicsSurfaceProps* g_pPhysProps = nullptr;
IVRenderView* g_pRenderView = nullptr;
IVDebugOverlay* g_pDebugOverlay = nullptr;
CGlobalVarsBase* g_pGlobals = nullptr;
CInput* g_pInput = nullptr;
IEffects* g_pEffects = nullptr;
IViewRenderBeams* g_pViewRenderBeams = nullptr;
IStudioRender* g_pStudioRender = nullptr;
CHudChat* g_pChatElement = nullptr;
using FX_TeslaFn = void(__thiscall*)(CTeslaInfo&);
FX_TeslaFn FX_Tesla = nullptr;
using FX_BloodSprayFn = bool(__cdecl*)(const CEffectData&);
FX_BloodSprayFn BloodSprayFn = nullptr;
using FXDispatchEffect = int(__fastcall*)(const char* name, const CEffectData&);
FXDispatchEffect DispatchEffect = nullptr;
void Init();
void* GetInterface(const char* dllname, const char* interfacename);
typedef void(__cdecl* CONMSGPROC)(const char*, ...);
CONMSGPROC myConMsg = nullptr;
typedef void(__cdecl* CONCOLORMSGPROC)(Color& clr, const char*, ...);
CONCOLORMSGPROC myConColorMsg = nullptr;
PVOID LoadFromFile = nullptr;
IDirect3DDevice9* g_pD3DDevice9 = nullptr;
IMemAlloc* g_pMemAlloc = nullptr;
ISteamGameCoordinator* g_SteamGameCoordinator = nullptr;
ISteamUser* g_SteamUser = nullptr;
CClientState* g_pClientState = nullptr;
CHudElement* g_pHudElement = nullptr;
IClientLeafSystem* g_pClientLeafSystem = nullptr;
INetworkStringTableContainer* g_pNetworkStringTableContainer = nullptr;
std::add_pointer_t<const char** __fastcall(const char* playerModelName)> getPlayerViewmodelArmConfigForPlayerModel;
IMDLCache* g_pMdlCache = nullptr;
IModelLoader* g_ModelLoader = nullptr;
IEngineSound* g_pEngineSound = nullptr;
IClientShadowMgr* g_pClientShadowMgr = nullptr;
CCSViewRender* g_ViewRender = nullptr;
IClientMode* g_ClientMode = nullptr;
CGlobalVarsBase* g_Globals = nullptr;
IInputSystem* g_pInputSystem = nullptr;
ITempEnts* g_pTempEnts = nullptr;
uint8_t* prime;
char oldprime[5];
};
extern IF iff;
typedef void* (__cdecl* tCreateInterface)(const char* name, int* returnCode);
template <typename T>
static constexpr auto relativeToAbsolute(uintptr_t address) noexcept
{
return (T)(address + 4 + *reinterpret_cast<std::int32_t*>(address));
}
namespace vgui {
inline vgui::IInput* input()
{
return iff.g_pVGuiInput;
}
inline vgui::ISchemeManager* scheme()
{
return iff.g_pVGuiSchemeManager;
}
inline vgui::ISurface* surface()
{
return iff.g_pVGuiSurface;
}
inline vgui::ISystem* system()
{
return iff.g_pVGuiSystem;
}
inline vgui::IVGui* ivgui()
{
return iff.g_pVGui;
}
inline vgui::IPanel* ipanel()
{
return iff.g_pVGuiPanel;
}
}
class ICvar2 : public ICvar
{
public:
ConVar* FindVar2(const char* var)
{
printf("Trying to find var %s\n", var);
typedef ConVar* (*oFindVar)(void*, const char*);
return getvfunc<oFindVar>(this, 16)(this, var);
}
template <typename... Values>
void ConsoleColorPrintf2(const Color& MsgColor, const char* szMsgFormat, Values... Parameters)
{
printf("Trying to print %s\n", szMsgFormat);
typedef void(*oConsoleColorPrintf)(void*, const Color&, const char*, ...);
return getvfunc<oConsoleColorPrintf>(this, 25)(this, MsgColor, szMsgFormat, Parameters...);
}
};
struct model_t
{
void* fnHandle;
char szName[260];
__int32 nLoadFlags;
__int32 nServerCount;
__int32 type;
__int32 flags;
Vector vecMins;
Vector vecMaxs;
float radius;
char pad[0x1C];
};
void AngleVectors(const Vector& angles, Vector* forward, Vector* right, Vector* up);
enum ItemDefinitionIndex
{
ITEM_NONE = 0,
WEAPON_DEAGLE = 1,
WEAPON_ELITE = 2,
WEAPON_FIVESEVEN = 3,
WEAPON_GLOCK = 4,
WEAPON_AK47 = 7,
WEAPON_AUG = 8,
WEAPON_AWP = 9,
WEAPON_FAMAS = 10,
WEAPON_G3SG1 = 11,
WEAPON_GALILAR = 13,
WEAPON_M249 = 14,
WEAPON_M4A1 = 16,
WEAPON_MAC10 = 17,
WEAPON_P90 = 19,
WEAPON_UMP45 = 24,
WEAPON_XM1014 = 25,
WEAPON_BIZON = 26,
WEAPON_MAG7 = 27,
WEAPON_NEGEV = 28,
WEAPON_SAWEDOFF = 29,
WEAPON_TEC9 = 30,
WEAPON_TASER = 31,
WEAPON_HKP2000 = 32,
WEAPON_MP7 = 33,
WEAPON_MP9 = 34,
WEAPON_NOVA = 35,
WEAPON_P250 = 36,
WEAPON_SCAR20 = 38,
WEAPON_SG553 = 39,
WEAPON_SSG08 = 40,
WEAPON_KNIFE_GOLD = 41,
WEAPON_KNIFE = 42,
WEAPON_FLASHBANG = 43,
WEAPON_HEGRENADE = 44,
WEAPON_SMOKEGRENADE = 45,
WEAPON_MOLOTOV = 46,
WEAPON_DECOY = 47,
WEAPON_INCGRENADE = 48,
WEAPON_C4 = 49,
WEAPON_KNIFE_T = 59,
WEAPON_M4A1_SILENCER = 60,
WEAPON_USP_SILENCER = 61,
WEAPON_CZ75A = 63,
WEAPON_REVOLVER = 64,
WEAPON_KNIFE_BAYONET = 500,
WEAPON_KNIFE_FLIP = 505,
WEAPON_KNIFE_GUT = 506,
WEAPON_KNIFE_KARAMBIT = 507,
WEAPON_KNIFE_M9_BAYONET = 508,
WEAPON_KNIFE_TACTICAL = 509,
WEAPON_KNIFE_FALCHION = 512,
WEAPON_KNIFE_SURVIVAL_BOWIE = 514,
WEAPON_KNIFE_BUTTERFLY = 515,
WEAPON_KNIFE_PUSH = 516,
GLOVE_STUDDED_BLOODHOUND = 5027,
GLOVE_T_SIDE = 5028,
GLOVE_CT_SIDE = 5029,
GLOVE_SPORTY = 5030,
GLOVE_SLICK = 5031,
GLOVE_LEATHER_WRAP = 5032,
GLOVE_MOTORCYCLE = 5033,
GLOVE_SPECIALIST = 5034,
MAX_ITEMDEFINITIONINDEX
};
static int random(int min, int max) noexcept
{
return rand() % (max - min + 1) + min;
}
enum Sequence
{
SEQUENCE_DEFAULT_DRAW = 0,
SEQUENCE_DEFAULT_IDLE1 = 1,
SEQUENCE_DEFAULT_IDLE2 = 2,
SEQUENCE_DEFAULT_LIGHT_MISS1 = 3,
SEQUENCE_DEFAULT_LIGHT_MISS2 = 4,
SEQUENCE_DEFAULT_HEAVY_MISS1 = 9,
SEQUENCE_DEFAULT_HEAVY_HIT1 = 10,
SEQUENCE_DEFAULT_HEAVY_BACKSTAB = 11,
SEQUENCE_DEFAULT_LOOKAT01 = 12,
SEQUENCE_BUTTERFLY_DRAW = 0,
SEQUENCE_BUTTERFLY_DRAW2 = 1,
SEQUENCE_BUTTERFLY_LOOKAT01 = 13,
SEQUENCE_BUTTERFLY_LOOKAT03 = 15,
SEQUENCE_FALCHION_IDLE1 = 1,
SEQUENCE_FALCHION_HEAVY_MISS1 = 8,
SEQUENCE_FALCHION_HEAVY_MISS1_NOFLIP = 9,
SEQUENCE_FALCHION_LOOKAT01 = 12,
SEQUENCE_FALCHION_LOOKAT02 = 13,
SEQUENCE_DAGGERS_IDLE1 = 1,
SEQUENCE_DAGGERS_LIGHT_MISS1 = 2,
SEQUENCE_DAGGERS_LIGHT_MISS5 = 6,
SEQUENCE_DAGGERS_HEAVY_MISS2 = 11,
SEQUENCE_DAGGERS_HEAVY_MISS1 = 12,
SEQUENCE_BOWIE_IDLE1 = 1,
};
#endif

View File

@ -1,206 +0,0 @@
#ifndef KEYBINDINGMAP_H
#define KEYBINDINGMAP_H
#ifdef _WIN32
#pragma once
#endif
#include "utlvector.h"
namespace vgui
{
class Panel;
enum
{
MODIFIER_SHIFT = (1 << 0),
MODIFIER_CONTROL = (1 << 1),
MODIFIER_ALT = (1 << 2),
};
struct BoundKey_t
{
BoundKey_t();
BoundKey_t(const BoundKey_t& src);
~BoundKey_t();
BoundKey_t& operator =(const BoundKey_t& src);
bool isbuiltin;
char const* bindingname;
int keycode;
int modifiers;
};
struct KeyBindingMap_t
{
KeyBindingMap_t();
KeyBindingMap_t(const KeyBindingMap_t& src);
~KeyBindingMap_t();
char const* bindingname;
ALIGN16 MessageFunc_t func;
char const* helpstring;
char const* docstring;
bool passive;
};
#define DECLARE_KEYBINDINGMAP( className ) \
static void KB_AddToMap \
( \
char const *bindingname, \
vgui::KeyCode defaultcode, \
int default_modifiers, \
vgui::MessageFunc_t function, \
char const *helpstring, \
char const *docstring, \
bool passive \
) \
{ \
vgui::PanelKeyBindingMap *map = vgui::FindOrAddPanelKeyBindingMap( GetPanelClassName() ); \
\
vgui::KeyBindingMap_t entry; \
entry.bindingname = bindingname; \
\
entry.func = function; \
\
entry.helpstring = helpstring; \
entry.docstring = docstring; \
\
entry.passive = passive; \
\
map->entries.AddToTail( entry ); \
\
vgui::BoundKey_t kb; \
kb.isbuiltin = true; \
kb.bindingname = bindingname; \
kb.keycode = defaultcode; \
kb.modifiers = default_modifiers; \
map->defaultkeys.AddToTail( kb ); \
map->boundkeys.AddToTail( kb ); \
} \
\
static void KB_ChainToMap( void ) \
{ \
static bool chained = false; \
if ( chained ) \
return; \
chained = true; \
vgui::PanelKeyBindingMap *map = vgui::FindOrAddPanelKeyBindingMap( GetPanelClassName() ); \
map->pfnClassName = &GetPanelClassName; \
if ( map && GetPanelBaseClassName() && GetPanelBaseClassName()[0] ) \
{ \
map->baseMap = vgui::FindOrAddPanelKeyBindingMap( GetPanelBaseClassName() ); \
} \
} \
\
static void KB_AddBoundKey \
( \
char const *bindingname, \
int keycode, \
int modifiers \
) \
{ \
vgui::PanelKeyBindingMap *map = vgui::FindOrAddPanelKeyBindingMap( GetPanelClassName() ); \
vgui::BoundKey_t kb; \
kb.isbuiltin = true; \
kb.bindingname = bindingname; \
kb.keycode = keycode; \
kb.modifiers = modifiers; \
map->defaultkeys.AddToTail( kb ); \
map->boundkeys.AddToTail( kb ); \
} \
\
class className##_RegisterKBMap; \
friend class className##_RegisterKBMap; \
class className##_RegisterKBMap \
{ \
public: \
className##_RegisterKBMap() \
{ \
className::KB_ChainToMap(); \
} \
}; \
className##_RegisterKBMap m_RegisterClassKB; \
\
virtual vgui::PanelKeyBindingMap *GetKBMap() \
{ \
static vgui::PanelKeyBindingMap *s_pMap = vgui::FindOrAddPanelKeyBindingMap( GetPanelClassName() ); \
return s_pMap; \
}
#define _KBMapFuncCommonFunc( name, keycode, modifiers, function, help, doc, passive ) \
class PanelKBMapFunc_##name; \
friend class PanelKBMapFunc_##name; \
class PanelKBMapFunc_##name \
{ \
public: \
static void InitVar() \
{ \
static bool bAdded = false; \
if ( !bAdded ) \
{ \
bAdded = true; \
KB_AddToMap( #name, keycode, modifiers, (vgui::MessageFunc_t)&ThisClass::function, help, doc, passive ); \
} \
} \
PanelKBMapFunc_##name() \
{ \
PanelKBMapFunc_##name::InitVar(); \
} \
}; \
PanelKBMapFunc_##name m_##name##_register;
#define _KBBindKeyCommon( name, keycode, modifiers, _classname ) \
class PanelKBBindFunc_##_classname; \
friend class PanelKBBindFunc_##_classname; \
class PanelKBBindFunc_##_classname \
{ \
public: \
static void InitVar() \
{ \
static bool bAdded = false; \
if ( !bAdded ) \
{ \
bAdded = true; \
KB_AddBoundKey( #name, keycode, modifiers ); \
} \
} \
PanelKBBindFunc_##_classname() \
{ \
PanelKBBindFunc_##_classname::InitVar(); \
} \
}; \
PanelKBBindFunc_##_classname m_##_classname##_bindkey_register;
#define KEYBINDING_FUNC( name, keycode, modifiers, function, help, doc ) _KBMapFuncCommonFunc( name, keycode, modifiers, function, help, doc, false ); virtual void function()
#define KEYBINDING_FUNC_NODECLARE( name, keycode, modifiers, function, help, doc ) _KBMapFuncCommonFunc( name, keycode, modifiers, function, help, doc, false );
#define KEYBINDING_FUNC_PASSIVE( name, keycode, modifiers, function, help, doc ) _KBMapFuncCommonFunc( name, keycode, modifiers, function, help, doc, true ); virtual void function()
#define KEYBINDING_FUNC_PASSIVE_NODECLARE( name, keycode, modifiers, function, help, doc ) _KBMapFuncCommonFunc( name, keycode, modifiers, function, help, doc, true );
#define KEYBINDING_ADDBINDING( name, keycode, modifiers ) _KBBindKeyCommon( name, keycode, modifiers, name );
#define KEYBINDING_ADDBINDING_MULTIPLE( name, keycode, modifiers, _classname ) _KBBindKeyCommon( name, keycode, modifiers, _classname );
struct PanelKeyBindingMap
{
PanelKeyBindingMap()
{
baseMap = NULL;
pfnClassName = NULL;
processed = false;
}
CUtlVector< KeyBindingMap_t > entries;
bool processed;
PanelKeyBindingMap* baseMap;
CUtlVector< BoundKey_t > defaultkeys;
CUtlVector< BoundKey_t > boundkeys;
char const* (*pfnClassName)(void);
};
PanelKeyBindingMap* FindPanelKeyBindingMap(char const* className);
PanelKeyBindingMap* FindOrAddPanelKeyBindingMap(char const* className);
}
#endif

View File

@ -1,15 +0,0 @@
#ifndef KEYCODE_H
#define KEYCODE_H
#ifdef _WIN32
#pragma once
#endif
#include "ButtonCode.h"
namespace vgui
{
typedef ButtonCode_t KeyCode;
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,167 +0,0 @@
#ifndef LABEL_H
#define LABEL_H
#ifdef _WIN32
#pragma once
#endif
#include "utlvector.h"
#include "VGUI.h"
#include "Panel.h"
#include "PHandle.h"
namespace vgui
{
class Label : public Panel
{
DECLARE_CLASS_SIMPLE(Label, Panel);
public:
Label(Panel* parent, const char* panelName, const char* text);
Label(Panel* parent, const char* panelName, const wchar_t* wszText);
~Label();
public:
virtual void SetText(const char* tokenName);
virtual void SetText(const wchar_t* unicodeString, bool bClearUnlocalizedSymbol = false);
virtual void GetText(OUT_Z_BYTECAP(bufferLen) char* textOut, int bufferLen);
virtual void GetText(OUT_Z_BYTECAP(bufLenInBytes) wchar_t* textOut, int bufLenInBytes);
virtual void GetContentSize(int& wide, int& tall);
enum Alignment
{
a_northwest = 0,
a_north,
a_northeast,
a_west,
a_center,
a_east,
a_southwest,
a_south,
a_southeast,
};
virtual void SetContentAlignment(Alignment alignment);
virtual void SetEnabled(bool state);
virtual void SetTextInset(int xInset, int yInset);
virtual void GetTextInset(int* xInset, int* yInset);
virtual void SetFgColor(Color color);
virtual Color GetFgColor();
virtual void SetDisabledFgColor1(Color color);
virtual void SetDisabledFgColor2(Color color);
virtual Color GetDisabledFgColor1();
virtual Color GetDisabledFgColor2();
enum EColorState
{
CS_NORMAL,
CS_DULL,
CS_BRIGHT,
};
virtual void SetTextColorState(EColorState state);
virtual void SetFont(HFont font);
virtual HFont GetFont();
virtual Panel* HasHotkey(wchar_t key);
virtual void SetHotkey(wchar_t key);
virtual wchar_t GetHotKey();
virtual void SetAssociatedControl(Panel* control);
virtual int AddImage(IImage* image, int preOffset);
virtual void SetImageAtIndex(int index, IImage* image, int preOffset);
virtual void SetImagePreOffset(int index, int preOffset);
virtual IImage* GetImageAtIndex(int index);
virtual int GetImageCount();
virtual void ClearImages();
virtual void ResetToSimpleTextImage();
virtual void SetImageBounds(int index, int x, int width);
virtual TextImage* GetTextImage();
virtual int SetTextImageIndex(int newIndex);
virtual bool RequestInfo(KeyValues* outputData);
virtual void SizeToContents();
enum Padding
{
Content = 8,
};
void SetWrap(bool bWrap);
void SetCenterWrap(bool bWrap);
void SetAllCaps(bool bAllCaps);
protected:
virtual void PerformLayout();
virtual wchar_t CalculateHotkey(const char* text);
virtual wchar_t CalculateHotkey(const wchar_t* text);
virtual void ComputeAlignment(int& tx0, int& ty0, int& tx1, int& ty1);
virtual void Paint();
MESSAGE_FUNC_PARAMS(OnSetText, "SetText", params);
virtual void DrawDashedLine(int x0, int y0, int x1, int y1, int dashLen, int gapLen);
virtual void OnRequestFocus(VPANEL subFocus, VPANEL defaultPanel);
MESSAGE_FUNC(OnHotkeyPressed, "Hotkey");
virtual void OnMousePressed(MouseCode code);
virtual void OnSizeChanged(int wide, int tall);
virtual void EnsureImageCapacity(int maxIndex);
virtual void ApplySchemeSettings(IScheme* pScheme);
virtual void GetSettings(KeyValues* outResourceData);
virtual void ApplySettings(KeyValues* inResourceData);
virtual const char* GetDescription(void);
MESSAGE_FUNC_PARAMS(OnDialogVariablesChanged, "DialogVariables", dialogVariables);
void HandleAutoSizing(void);
private:
void Init();
Alignment _contentAlignment;
TextImage* _textImage;
struct TImageInfo
{
IImage* image;
short offset;
short xpos;
short width;
};
CUtlVector<TImageInfo> _imageDar;
int _textInset[2];
Color _disabledFgColor1;
Color _disabledFgColor2;
Color _associateColor;
int _textImageIndex;
EColorState _textColorState;
PHandle _associate;
char* _associateName;
char* _fontOverrideName;
wchar_t _hotkey;
bool m_bWrap;
bool m_bCenterWrap;
bool m_bAllCaps;
bool m_bAutoWideToContents;
bool m_bAutoWideDirty;
bool m_bUseProportionalInsets;
};
}
#endif

View File

@ -1,304 +0,0 @@
#ifndef LISTPANEL_H
#define LISTPANEL_H
#ifdef _WIN32
#pragma once
#endif
#include "utllinkedlist.h"
#include "utlvector.h"
#include "utlrbtree.h"
#include "VGUI.h"
#include "Panel.h"
class KeyValues;
namespace vgui
{
class ScrollBar;
class TextImage;
class ImagePanel;
class Label;
class Button;
class IDraggerEvent;
class FastSortListPanelItem;
class ListPanelItem
{
public:
ListPanelItem() :
kv(0),
userData(0),
m_pDragData(0),
m_bImage(false),
m_nImageIndex(-1),
m_nImageIndexSelected(-1),
m_pIcon(0)
{
}
KeyValues* kv;
unsigned int userData;
KeyValues* m_pDragData;
bool m_bImage;
int m_nImageIndex;
int m_nImageIndexSelected;
IImage* m_pIcon;
};
typedef int __cdecl SortFunc(
ListPanel* pPanel,
const ListPanelItem& item1,
const ListPanelItem& item2);
class ListPanel : public Panel
{
DECLARE_CLASS_SIMPLE(ListPanel, Panel);
public:
ListPanel(Panel* parent, const char* panelName);
~ListPanel();
enum ColumnFlags_e
{
COLUMN_FIXEDSIZE = 0x01,
COLUMN_RESIZEWITHWINDOW = 0x02,
COLUMN_IMAGE = 0x04,
COLUMN_HIDDEN = 0x08,
COLUMN_UNHIDABLE = 0x10,
};
virtual void AddColumnHeader(int index, const char* columnName, const char* columnText, int startingWidth, int minWidth, int maxWidth, int columnFlags = 0);
virtual void AddColumnHeader(int index, const char* columnName, const char* columnText, int width, int columnFlags = 0);
virtual void RemoveColumn(int column);
virtual int FindColumn(const char* columnName);
virtual void SetColumnHeaderHeight(int height);
virtual void SetColumnHeaderText(int column, const char* text);
virtual void SetColumnHeaderText(int column, wchar_t* text);
virtual void SetColumnHeaderImage(int column, int imageListIndex);
virtual void SetColumnHeaderTooltip(int column, const char* tooltipText);
virtual void SetColumnTextAlignment(int column, int align);
virtual int GetNumColumnHeaders() const;
virtual bool GetColumnHeaderText(int index, char* pOut, int maxLen);
virtual void SetSortFunc(int column, SortFunc* func);
virtual void SetSortColumn(int column);
virtual void SortList(void);
virtual void SetColumnSortable(int column, bool sortable);
virtual void SetColumnVisible(int column, bool visible);
int GetSortColumn() const;
virtual void SetAllowUserModificationOfColumns(bool allowed);
virtual int AddItem(const KeyValues* data, unsigned int userData, bool bScrollToItem, bool bSortOnAdd);
void SetItemDragData(int itemID, const KeyValues* data);
virtual int GetItemCount(void);
virtual int GetItem(const char* itemName);
virtual KeyValues* GetItem(int itemID);
virtual int GetItemCurrentRow(int itemID);
virtual int GetItemIDFromRow(int currentRow);
virtual unsigned int GetItemUserData(int itemID);
virtual ListPanelItem* GetItemData(int itemID);
virtual void SetUserData(int itemID, unsigned int userData);
virtual int GetItemIDFromUserData(unsigned int userData);
virtual void ApplyItemChanges(int itemID);
virtual void RemoveItem(int itemID);
virtual void RereadAllItems();
virtual void RemoveAll();
virtual void DeleteAllItems();
virtual void GetCellText(int itemID, int column, OUT_Z_BYTECAP(bufferSizeInBytes) wchar_t* buffer, int bufferSizeInBytes);
virtual IImage* GetCellImage(int itemID, int column);
virtual int FirstItem() const;
virtual int NextItem(int iItem) const;
virtual int InvalidItemID() const;
virtual bool IsValidItemID(int itemID);
virtual void SetItemVisible(int itemID, bool state);
virtual void SetItemDisabled(int itemID, bool state);
bool IsItemVisible(int itemID);
virtual void SetFont(HFont font);
virtual void SetImageList(ImageList* imageList, bool deleteImageListWhenDone);
virtual int GetSelectedItemsCount();
virtual int GetSelectedItem(int selectionIndex);
virtual void ClearSelectedItems();
virtual bool IsItemSelected(int itemID);
virtual void AddSelectedItem(int itemID);
virtual void SetSingleSelectedItem(int itemID);
virtual int GetSelectedColumn();
virtual void SetSelectIndividualCells(bool state);
void SetMultiselectEnabled(bool bState);
bool IsMultiselectEnabled() const;
virtual void SetSelectedCell(int row, int column);
virtual bool GetCellAtPos(int x, int y, int& row, int& column);
virtual bool GetCellBounds(int row, int column, int& x, int& y, int& wide, int& tall);
virtual void SetEmptyListText(const char* text);
virtual void SetEmptyListText(const wchar_t* text);
void ResetScrollBar();
virtual void OnCreateDragData(KeyValues* msg);
void SetIgnoreDoubleClick(bool state);
virtual void EnterEditMode(int itemID, int column, vgui::Panel* editPanel);
virtual void LeaveEditMode();
virtual bool IsInEditMode();
MESSAGE_FUNC_INT(ResizeColumnToContents, "ResizeColumnToContents", column);
#ifdef _X360
virtual void NavigateTo();
#endif
int m_nUserConfigFileVersion;
protected:
virtual Panel* GetCellRenderer(int row, int column);
virtual void OnMouseWheeled(int delta);
virtual void OnSizeChanged(int wide, int tall);
virtual void PerformLayout();
virtual void Paint();
virtual void PaintBackground();
virtual void ApplySchemeSettings(IScheme* pScheme);
virtual void OnMousePressed(MouseCode code);
virtual void OnMouseDoublePressed(MouseCode code);
#ifdef _X360
virtual void OnKeyCodePressed(KeyCode code);
#else
virtual void OnKeyCodePressed(KeyCode code);
#endif
MESSAGE_FUNC(OnSliderMoved, "ScrollBarSliderMoved");
MESSAGE_FUNC_INT_INT(OnColumnResized, "ColumnResized", column, delta);
MESSAGE_FUNC_INT(OnSetSortColumn, "SetSortColumn", column);
MESSAGE_FUNC(OpenColumnChoiceMenu, "OpenColumnChoiceMenu");
MESSAGE_FUNC_INT(OnToggleColumnVisible, "ToggleColumnVisible", col);
virtual float GetRowsPerPage();
virtual int GetStartItem();
virtual void ApplyUserConfigSettings(KeyValues* userConfig);
virtual void GetUserConfigSettings(KeyValues* userConfig);
virtual bool HasUserConfigSettings();
public:
virtual void SetSortColumnEx(int iPrimarySortColumn, int iSecondarySortColumn, bool bSortAscending);
void GetSortColumnEx(int& iPrimarySortColumn, int& iSecondarySortColumn, bool& bSortAscending) const;
private:
void CleanupItem(FastSortListPanelItem* data);
void IndexItem(int itemID);
void UpdateSelection(vgui::MouseCode code, int x, int y, int row, int column);
void HandleMultiSelection(int itemID, int row, int column);
void HandleAddSelection(int itemID, int row, int column);
struct IndexItem_t
{
ListPanelItem* dataItem;
int duplicateIndex;
};
typedef CUtlRBTree<IndexItem_t, int> IndexRBTree_t;
struct column_t
{
Button* m_pHeader;
int m_iMinWidth;
int m_iMaxWidth;
bool m_bResizesWithWindow;
Panel* m_pResizer;
SortFunc* m_pSortFunc;
bool m_bTypeIsText;
bool m_bHidden;
bool m_bUnhidable;
IndexRBTree_t m_SortedTree;
int m_nContentAlignment;
};
CUtlLinkedList<column_t, unsigned char> m_ColumnsData;
CUtlVector<unsigned char> m_ColumnsHistory;
CUtlVector<unsigned char> m_CurrentColumns;
int m_iColumnDraggerMoved;
int m_lastBarWidth;
CUtlLinkedList<FastSortListPanelItem*, int> m_DataItems;
CUtlVector<int> m_VisibleItems;
int m_iSortColumn;
int m_iSortColumnSecondary;
void ResortColumnRBTree(int col);
static bool RBTreeLessFunc(vgui::ListPanel::IndexItem_t& item1, vgui::ListPanel::IndexItem_t& item2);
TextImage* m_pTextImage;
ImagePanel* m_pImagePanel;
Label* m_pLabel;
ScrollBar* m_hbar;
ScrollBar* m_vbar;
int m_iSelectedColumn;
bool m_bNeedsSort : 1;
bool m_bSortAscending : 1;
bool m_bSortAscendingSecondary : 1;
bool m_bCanSelectIndividualCells : 1;
bool m_bShiftHeldDown : 1;
bool m_bMultiselectEnabled : 1;
bool m_bAllowUserAddDeleteColumns : 1;
bool m_bDeleteImageListWhenDone : 1;
bool m_bIgnoreDoubleClick : 1;
int m_iHeaderHeight;
int m_iRowHeight;
CUtlVector<int> m_SelectedItems;
int m_LastItemSelected;
int m_iTableStartX;
int m_iTableStartY;
Color m_LabelFgColor;
Color m_DisabledColor;
Color m_SelectionFgColor;
Color m_DisabledSelectionFgColor;
ImageList* m_pImageList;
TextImage* m_pEmptyListText;
PHandle m_hEditModePanel;
int m_iEditModeItemID;
int m_iEditModeColumn;
void ResetColumnHeaderCommands();
};
}
#endif

View File

@ -1,72 +0,0 @@
#ifndef MATERIALSYSTEMUTIL_H
#define MATERIALSYSTEMUTIL_H
#ifdef _WIN32
#pragma once
#endif
#include "imageformat.h"
#include "imaterialsystem.h"
class IMaterial;
class ITexture;
class KeyValues;
class KeyValues;
class CMaterialReference
{
public:
CMaterialReference(char const* pMaterialName = 0, const char* pTextureGroupName = 0, bool bComplain = true);
~CMaterialReference();
void Init(const char* pMaterialName, const char* pTextureGroupName, bool bComplain = true);
void Init(const char* pMaterialName, KeyValues* pVMTKeyValues);
void Init(IMaterial* pMaterial);
void Init(CMaterialReference& ref);
void Init(const char* pMaterialName, const char* pTextureGroupName, KeyValues* pVMTKeyValues);
void Shutdown();
bool IsValid() { return m_pMaterial != 0; }
operator IMaterial* () { return m_pMaterial; }
operator IMaterial* () const { return m_pMaterial; }
operator IMaterial const* () const { return m_pMaterial; }
IMaterial* operator->() { return m_pMaterial; }
private:
IMaterial* m_pMaterial;
};
class CTextureReference
{
public:
CTextureReference();
CTextureReference(const CTextureReference& ref);
~CTextureReference();
void Init(char const* pTexture, const char* pTextureGroupName, bool bComplain = true);
void InitProceduralTexture(const char* pTextureName, const char* pTextureGroupName, int w, int h, ImageFormat fmt, int nFlags);
void InitRenderTarget(int w, int h, RenderTargetSizeMode_t sizeMode, ImageFormat fmt, MaterialRenderTargetDepth_t depth, bool bHDR, char* pStrOptionalName = NULL);
#if defined( _X360 )
void InitRenderTargetTexture(int width, int height, RenderTargetSizeMode_t sizeMode, ImageFormat fmt, MaterialRenderTargetDepth_t depth, bool bHDR, char* pStrOptionalName = NULL);
void InitRenderTargetSurface(int width, int height, ImageFormat fmt, bool bSameAsTexture);
#endif
void Init(ITexture* pTexture);
void Shutdown(bool bDeleteIfUnReferenced = false);
bool IsValid() { return m_pTexture != 0; }
operator ITexture* () { return m_pTexture; }
operator ITexture const* () const { return m_pTexture; }
ITexture* operator->() { return m_pTexture; }
void operator=(CTextureReference& ref);
private:
ITexture* m_pTexture;
};
#endif

View File

@ -1,262 +0,0 @@
#ifndef MENU_H
#define MENU_H
#ifdef _WIN32
#pragma once
#endif
#include "Panel.h"
#include "Label.h"
#include "utllinkedlist.h"
#include "utlvector.h"
namespace vgui
{
class MenuItem;
class ScrollBar;
class MenuSeparator;
class Menu : public Panel
{
DECLARE_CLASS_SIMPLE(Menu, Panel);
friend class MenuItem;
public:
enum MenuDirection_e
{
LEFT,
RIGHT,
UP,
DOWN,
CURSOR,
ALIGN_WITH_PARENT,
};
Menu(Panel* parent, const char* panelName);
~Menu();
static void PlaceContextMenu(Panel* parent, Menu* menu);
static void OnInternalMousePressed(Panel* other, MouseCode code);
virtual void PositionRelativeToPanel(Panel* reference, MenuDirection_e direction, int nAdditionalYOffset = 0, bool showMenu = false);
virtual int AddMenuItem(const char* itemName, const char* itemText, const char* command, Panel* target, const KeyValues* userData = NULL);
virtual int AddMenuItem(const char* itemName, const wchar_t* wszItemText, const char* command, Panel* target, const KeyValues* userData = NULL);
virtual int AddMenuItem(const char* itemName, const char* itemText, KeyValues* message, Panel* target, const KeyValues* userData = NULL);
virtual int AddMenuItem(const char* itemName, const wchar_t* wszItemText, KeyValues* message, Panel* target, const KeyValues* userData = NULL);
virtual int AddMenuItem(const char* itemText, const char* command, Panel* target, const KeyValues* userData = NULL);
virtual int AddMenuItem(const char* itemText, KeyValues* message, Panel* target, const KeyValues* userData = NULL);
virtual int AddMenuItem(const char* itemText, Panel* target, const KeyValues* userData = NULL);
virtual int AddCheckableMenuItem(const char* itemName, const char* itemText, const char* command, Panel* target, const KeyValues* userData = NULL);
virtual int AddCheckableMenuItem(const char* itemName, const wchar_t* wszItemText, const char* command, Panel* target, const KeyValues* userData = NULL);
virtual int AddCheckableMenuItem(const char* itemName, const char* itemText, KeyValues* message, Panel* target, const KeyValues* userData = NULL);
virtual int AddCheckableMenuItem(const char* itemName, const wchar_t* wszItemText, KeyValues* message, Panel* target, const KeyValues* userData = NULL);
virtual int AddCheckableMenuItem(const char* itemText, const char* command, Panel* target, const KeyValues* userData = NULL);
virtual int AddCheckableMenuItem(const char* itemText, KeyValues* message, Panel* target, const KeyValues* userData = NULL);
virtual int AddCheckableMenuItem(const char* itemText, Panel* target, const KeyValues* userData = NULL);
virtual int AddCascadingMenuItem(const char* itemName, const char* itemText, const char* command, Panel* target, Menu* cascadeMenu, const KeyValues* userData = NULL);
virtual int AddCascadingMenuItem(const char* itemName, const wchar_t* wszItemText, const char* command, Panel* target, Menu* cascadeMenu, const KeyValues* userData = NULL);
virtual int AddCascadingMenuItem(const char* itemName, const char* itemText, KeyValues* message, Panel* target, Menu* cascadeMenu, const KeyValues* userData = NULL);
virtual int AddCascadingMenuItem(const char* itemName, const wchar_t* wszItemText, KeyValues* message, Panel* target, Menu* cascadeMenu, const KeyValues* userData = NULL);
virtual int AddCascadingMenuItem(const char* itemText, const char* command, Panel* target, Menu* cascadeMenu, const KeyValues* userData = NULL);
virtual int AddCascadingMenuItem(const char* itemText, KeyValues* message, Panel* target, Menu* cascadeMenu, const KeyValues* userData = NULL);
virtual int AddCascadingMenuItem(const char* itemText, Panel* target, Menu* cascadeMenu, const KeyValues* userData = NULL);
virtual int AddMenuItem(MenuItem* panel);
virtual void AddSeparator();
virtual void AddSeparatorAfterItem(int itemID);
virtual void UpdateMenuItem(int itemID, const char* itemText, KeyValues* message, const KeyValues* userData = NULL);
virtual void UpdateMenuItem(int itemID, const wchar_t* wszItemText, KeyValues* message, const KeyValues* userData = NULL);
virtual void MoveMenuItem(int itemID, int moveBeforeThisItemID);
virtual bool IsValidMenuID(int itemID);
virtual int GetInvalidMenuID();
KeyValues* GetItemUserData(int itemID);
void GetItemText(int itemID, wchar_t* text, int bufLenInBytes);
void GetItemText(int itemID, char* text, int bufLenInBytes);
virtual void SetItemEnabled(const char* itemName, bool state);
virtual void SetItemEnabled(int itemID, bool state);
virtual void SetItemVisible(const char* itemName, bool visible);
virtual void SetItemVisible(int itemID, bool visible);
void DeleteItem(int itemID);
void DeleteAllItems();
virtual void SetFixedWidth(int width);
void SetContentAlignment(Label::Alignment alignment);
virtual void SetMenuItemHeight(int itemHeight);
virtual int GetMenuItemHeight() const;
virtual void SetNumberOfVisibleItems(int numItems);
void EnableUseMenuManager(bool bUseMenuManager);
virtual void PerformLayout(void);
virtual void SetBorder(class IBorder* border);
virtual void ApplySchemeSettings(IScheme* pScheme);
enum MenuTypeAheadMode
{
COMPAT_MODE = 0,
HOT_KEY_MODE,
TYPE_AHEAD_MODE,
};
virtual void SetTypeAheadMode(MenuTypeAheadMode mode);
virtual int GetTypeAheadMode();
virtual void OnKeyTyped(wchar_t unichar);
virtual void OnKeyCodeTyped(KeyCode code);
virtual void SetVisible(bool state);
virtual void ActivateItem(int itemID);
virtual void SilentActivateItem(int itemID);
virtual void ActivateItemByRow(int row);
virtual int GetActiveItem();
virtual int GetItemCount();
virtual int GetMenuID(int index);
int GetCurrentlyVisibleItemsCount();
MenuItem* GetMenuItem(int itemID);
void CloseOtherMenus(MenuItem* item);
virtual void OnKillFocus();
int GetMenuMode();
enum MenuMode
{
MOUSE = 0,
KEYBOARD,
};
void SetCurrentlyHighlightedItem(int itemID);
int GetCurrentlyHighlightedItem();
void ClearCurrentlyHighlightedItem();
void SetMenuItemChecked(int itemID, bool state);
bool IsChecked(int index);
void SetMinimumWidth(int width);
int GetMinimumWidth();
virtual void SetFgColor(Color newColor);
virtual void SetBgColor(Color newColor);
virtual void SetFont(HFont font);
void SetCurrentKeyBinding(int itemID, char const* hotkey);
void ForceCalculateWidth();
void SetUseFallbackFont(bool bState, HFont hFallback);
protected:
int AddMenuItemCharCommand(MenuItem* item, const char* command, Panel* target, const KeyValues* userData);
int AddMenuItemKeyValuesCommand(MenuItem* item, KeyValues* message, Panel* target, const KeyValues* userData);
virtual void OnCommand(const char* command);
MESSAGE_FUNC_PTR(OnMenuItemSelected, "MenuItemSelected", panel);
virtual void AddScrollBar();
virtual void RemoveScrollBar();
MESSAGE_FUNC(OnSliderMoved, "ScrollBarSliderMoved");
virtual void Paint();
virtual void LayoutMenuBorder();
virtual void MakeItemsVisibleInScrollRange(int maxVisibleItems, int nNumPixelsAvailable);
virtual void OnMouseWheeled(int delta);
virtual void OnHotKey(wchar_t unichar);
virtual void OnTypeAhead(wchar_t unichar);
int CountVisibleItems();
void ComputeWorkspaceSize(int& workWide, int& workTall);
int ComputeFullMenuHeightWithInsets();
void CalculateWidth();
void LayoutScrollBar();
void PositionCascadingMenu();
void SizeMenuItems();
void OnCursorMoved(int x, int y);
void OnKeyCodePressed(KeyCode code);
void OnMenuClose();
MESSAGE_FUNC(OnKeyModeSet, "KeyModeSet");
void SetCurrentlySelectedItem(MenuItem* item);
void SetCurrentlySelectedItem(int itemID);
MESSAGE_FUNC_INT(OnCursorEnteredMenuItem, "CursorEnteredMenuItem", VPanel);
MESSAGE_FUNC_INT(OnCursorExitedMenuItem, "CursorExitedMenuItem", VPanel);
void MoveAlongMenuItemList(int direction, int loopCount);
enum
{
DEFAULT_MENU_ITEM_HEIGHT = 22,
MENU_UP = -1,
MENU_DOWN = 1
};
#ifdef DBGFLAG_VALIDATE
virtual void Validate(CValidator& validator, char* pchName);
#endif
private:
MenuItem* GetParentMenuItem();
int m_iMenuItemHeight;
int m_iFixedWidth;
int m_iMinimumWidth;
int m_iNumVisibleLines;
ScrollBar* m_pScroller;
CUtlLinkedList<MenuItem*, int> m_MenuItems;
CUtlVector<int> m_VisibleSortedItems;
CUtlVector<int> m_SortedItems;
CUtlVector<int> m_Separators;
CUtlVector<MenuSeparator*> m_SeparatorPanels;
bool _sizedForScrollBar : 1;
bool m_bUseFallbackFont : 1;
bool _recalculateWidth : 1;
bool m_bUseMenuManager : 1;
int _menuWide;
int m_iCurrentlySelectedItemID;
int m_iInputMode;
int m_iCheckImageWidth;
int m_iProportionalScrollBarSize;
Label::Alignment m_Alignment;
Color _borderDark;
int m_iActivatedItem;
HFont m_hItemFont;
HFont m_hFallbackItemFont;
#define TYPEAHEAD_BUFSIZE 256
MenuTypeAheadMode m_eTypeAheadMode;
wchar_t m_szTypeAheadBuf[TYPEAHEAD_BUFSIZE];
int m_iNumTypeAheadChars;
double m_fLastTypeAheadTime;
};
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,107 +0,0 @@
#ifndef MENUITEM_H
#define MENUITEM_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "Button.h"
#include "Menu.h"
namespace vgui
{
class IBorder;
class TextImage;
class Menu;
class Image;
class MenuItem : public Button
{
DECLARE_CLASS_SIMPLE(MenuItem, Button);
public:
MenuItem(Menu* parent, const char* panelName, const char* text, Menu* cascadeMenu = NULL, bool checkable = false);
MenuItem(Menu* parent, const char* panelName, const wchar_t* wszText, Menu* cascadeMenu = NULL, bool checkable = false);
~MenuItem();
virtual void Paint();
virtual void FireActionSignal();
virtual bool CanBeDefaultButton(void);
void OnCursorEntered();
void OnCursorExited();
void CloseCascadeMenu();
MESSAGE_FUNC(OnKillFocus, "MenuClose");
bool HasMenu();
void SetTextImageSize(int wide, int tall);
void GetTextImageSize(int& wide, int& tall);
void GetArrowImageSize(int& wide, int& tall);
void GetCheckImageSize(int& wide, int& tall);
Menu* GetMenu();
virtual void PerformLayout();
void OnCursorMoved(int x, int y);
MESSAGE_FUNC(ArmItem, "ArmItem");
MESSAGE_FUNC(DisarmItem, "DisarmItem");
bool IsItemArmed();
void OpenCascadeMenu();
bool IsCheckable();
bool IsChecked();
void SetChecked(bool state);
KeyValues* GetUserData();
void SetUserData(const KeyValues* kv);
int GetActiveItem() { if (m_pCascadeMenu) { return m_pCascadeMenu->GetActiveItem(); } else { return 0; } }
Menu* GetParentMenu();
void SetCurrentKeyBinding(char const* keyName);
virtual void GetContentSize(int& cw, int& ch);
protected:
void OnKeyCodeReleased(KeyCode code);
void OnMenuClose();
MESSAGE_FUNC(OnKeyModeSet, "KeyModeSet");
virtual void Init(void);
virtual void ApplySchemeSettings(IScheme* pScheme);
virtual IBorder* GetBorder(bool depressed, bool armed, bool selected, bool keyfocus);
private:
enum { CHECK_INSET = 6 };
Menu* m_pCascadeMenu;
bool m_bCheckable;
bool m_bChecked;
TextImage* m_pCascadeArrow;
Image* m_pCheck;
TextImage* m_pBlankCheck;
TextImage* m_pCurrentKeyBinding;
KeyValues* m_pUserData;
};
}
#endif

View File

@ -1,327 +0,0 @@
#ifndef MESSAGEMAP_H
#define MESSAGEMAP_H
#ifdef _WIN32
#pragma once
#endif
#include "dmxelement.h"
#pragma pointers_to_members( full_generality, virtual_inheritance )
namespace vgui
{
#ifndef ARRAYSIZE
#define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0]))
#endif
enum DataType_t
{
DATATYPE_VOID,
DATATYPE_CONSTCHARPTR,
DATATYPE_INT,
DATATYPE_FLOAT,
DATATYPE_PTR,
DATATYPE_BOOL,
DATATYPE_KEYVALUES,
DATATYPE_CONSTWCHARPTR,
DATATYPE_UINT64,
DATATYPE_HANDLE,
};
class Panel;
typedef uintp VPANEL;
typedef void (Panel::* MessageFunc_t)(void);
#pragma warning(disable:4121)
struct MessageMapItem_t
{
const char* name;
ALIGN16 MessageFunc_t func;
int numParams;
DataType_t firstParamType;
const char* firstParamName;
DataType_t secondParamType;
const char* secondParamName;
int nameSymbol;
int firstParamSymbol;
int secondParamSymbol;
};
#define DECLARE_PANELMESSAGEMAP( className ) \
static void AddToMap( char const *scriptname, vgui::MessageFunc_t function, int paramCount, int p1type, const char *p1name, int p2type, const char *p2name ) \
{ \
vgui::PanelMessageMap *map = vgui::FindOrAddPanelMessageMap( GetPanelClassName() ); \
\
vgui::MessageMapItem_t entry; \
entry.name = scriptname; \
entry.func = function; \
entry.numParams = paramCount; \
entry.firstParamType = (vgui::DataType_t)p1type; \
entry.firstParamName = p1name; \
entry.secondParamType = (vgui::DataType_t)p2type; \
entry.secondParamName = p2name; \
entry.nameSymbol = 0; \
entry.firstParamSymbol = 0; \
entry.secondParamSymbol = 0; \
\
map->entries.AddToTail( entry ); \
} \
\
static void ChainToMap( void ) \
{ \
static bool chained = false; \
if ( chained ) \
return; \
chained = true; \
vgui::PanelMessageMap *map = vgui::FindOrAddPanelMessageMap( GetPanelClassName() ); \
map->pfnClassName = &GetPanelClassName; \
if ( map && GetPanelBaseClassName() && GetPanelBaseClassName()[0] ) \
{ \
map->baseMap = vgui::FindOrAddPanelMessageMap( GetPanelBaseClassName() ); \
} \
} \
\
class className##_RegisterMap; \
friend class className##_RegisterMap; \
class className##_RegisterMap \
{ \
public: \
className##_RegisterMap() \
{ \
className::ChainToMap(); \
} \
}; \
className##_RegisterMap m_RegisterClass; \
\
virtual vgui::PanelMessageMap *GetMessageMap() \
{ \
static vgui::PanelMessageMap *s_pMap = vgui::FindOrAddPanelMessageMap( GetPanelClassName() ); \
return s_pMap; \
}
#define VGUI_USEKEYBINDINGMAPS 1
#if defined( VGUI_USEKEYBINDINGMAPS )
#define DECLARE_CLASS_SIMPLE( className, baseClassName ) \
typedef baseClassName BaseClass; \
typedef className ThisClass; \
public: \
DECLARE_PANELMESSAGEMAP( className ); \
DECLARE_PANELANIMATION( className ); \
DECLARE_KEYBINDINGMAP( className ); \
static char const *GetPanelClassName() { return #className; } \
static char const *GetPanelBaseClassName() { return #baseClassName; }
#define DECLARE_CLASS_SIMPLE_NOBASE( className ) \
typedef className ThisClass; \
public: \
DECLARE_PANELMESSAGEMAP( className ); \
DECLARE_PANELANIMATION( className ); \
DECLARE_KEYBINDINGMAP( className ); \
static char const *GetPanelClassName() { return #className; } \
static char const *GetPanelBaseClassName() { return NULL; }
#else
#define DECLARE_CLASS_SIMPLE( className, baseClassName ) \
typedef baseClassName BaseClass; \
typedef className ThisClass; \
public: \
DECLARE_PANELMESSAGEMAP( className ); \
DECLARE_PANELANIMATION( className ); \
static char const *GetPanelClassName() { return #className; } \
static char const *GetPanelBaseClassName() { return #baseClassName; }
#define DECLARE_CLASS_SIMPLE_NOBASE( className ) \
typedef className ThisClass; \
public: \
DECLARE_PANELMESSAGEMAP( className ); \
DECLARE_PANELANIMATION( className ); \
static char const *GetPanelClassName() { return #className; } \
static char const *GetPanelBaseClassName() { return NULL; }
#endif
#define _MessageFuncCommon( name, scriptname, paramCount, p1type, p1name, p2type, p2name ) \
class PanelMessageFunc_##name; \
friend class PanelMessageFunc_##name; \
class PanelMessageFunc_##name \
{ \
public: \
static void InitVar() \
{ \
static bool bAdded = false; \
if ( !bAdded ) \
{ \
bAdded = true; \
AddToMap( scriptname, (vgui::MessageFunc_t)&ThisClass::name, paramCount, p1type, p1name, p2type, p2name ); \
} \
} \
PanelMessageFunc_##name() \
{ \
PanelMessageFunc_##name::InitVar(); \
} \
}; \
PanelMessageFunc_##name m_##name##_register; \
#define MESSAGE_FUNC( name, scriptname ) _MessageFuncCommon( name, scriptname, 0, 0, 0, 0, 0 ); virtual void name( void )
#define MESSAGE_FUNC_INT( name, scriptname, p1 ) _MessageFuncCommon( name, scriptname, 1, vgui::DATATYPE_INT, #p1, 0, 0 ); virtual void name( int p1 )
#define MESSAGE_FUNC_UINT64( name, scriptname, p1 ) _MessageFuncCommon( name, scriptname, 1, vgui::DATATYPE_UINT64, #p1, 0, 0 ); virtual void name( uint64 p1 )
#define MESSAGE_FUNC_PTR( name, scriptname, p1 ) _MessageFuncCommon( name, scriptname, 1, vgui::DATATYPE_PTR, #p1, 0, 0 ); virtual void name( vgui::Panel *p1 )
#define MESSAGE_FUNC_HANDLE( name, scriptname, p1 ) _MessageFuncCommon( name, scriptname, 1, vgui::DATATYPE_HANDLE, #p1, 0, 0 ); virtual void name( vgui::VPANEL p1 )
#define MESSAGE_FUNC_FLOAT( name, scriptname, p1 ) _MessageFuncCommon( name, scriptname, 1, vgui::DATATYPE_FLOAT, #p1, 0, 0 ); virtual void name( float p1 )
#define MESSAGE_FUNC_CHARPTR( name, scriptname, p1 ) _MessageFuncCommon( name, scriptname, 1, vgui::DATATYPE_CONSTCHARPTR, #p1, 0, 0 ); virtual void name( const char *p1 )
#define MESSAGE_FUNC_WCHARPTR( name, scriptname, p1 ) _MessageFuncCommon( name, scriptname, 1, vgui::DATATYPE_CONSTWCHARPTR, #p1, 0, 0 ); virtual void name( const wchar_t *p1 )
#define MESSAGE_FUNC_INT_INT( name, scriptname, p1, p2 ) _MessageFuncCommon( name, scriptname, 2, vgui::DATATYPE_INT, #p1, vgui::DATATYPE_INT, #p2 ); virtual void name( int p1, int p2 )
#define MESSAGE_FUNC_PTR_INT( name, scriptname, p1, p2 ) _MessageFuncCommon( name, scriptname, 2, vgui::DATATYPE_PTR, #p1, vgui::DATATYPE_INT, #p2 ); virtual void name( vgui::Panel *p1, int p2 )
#define MESSAGE_FUNC_HANDLE_INT( name, scriptname, p1, p2 ) _MessageFuncCommon( name, scriptname, 2, vgui::DATATYPE_HANDLE, #p1, vgui::DATATYPE_INT, #p2 ); virtual void name( vgui::VPANEL p1, int p2 )
#define MESSAGE_FUNC_ENUM_ENUM( name, scriptname, t1, p1, t2, p2 ) _MessageFuncCommon( name, scriptname, 2, vgui::DATATYPE_PTR, #p1, vgui::DATATYPE_PTR, #p2 ); virtual void name( t1 p1, t2 p2 )
#define MESSAGE_FUNC_INT_CHARPTR( name, scriptname, p1, p2 ) _MessageFuncCommon( name, scriptname, 2, vgui::DATATYPE_INT, #p1, vgui::DATATYPE_CONSTCHARPTR, #p2 ); virtual void name( int p1, const char *p2 )
#define MESSAGE_FUNC_PTR_CHARPTR( name, scriptname, p1, p2 ) _MessageFuncCommon( name, scriptname, 2, vgui::DATATYPE_PTR, #p1, vgui::DATATYPE_CONSTCHARPTR, #p2 ); virtual void name( vgui::Panel *p1, const char *p2 )
#define MESSAGE_FUNC_HANDLE_CHARPTR( name, scriptname, p1, p2 ) _MessageFuncCommon( name, scriptname, 2, vgui::DATATYPE_HANDLE, #p1, vgui::DATATYPE_CONSTCHARPTR, #p2 ); virtual void name( vgui::VPANEL p1, const char *p2 )
#define MESSAGE_FUNC_PTR_WCHARPTR( name, scriptname, p1, p2 ) _MessageFuncCommon( name, scriptname, 2, vgui::DATATYPE_PTR, #p1, vgui::DATATYPE_CONSTWCHARPTR, #p2 ); virtual void name( vgui::Panel *p1, const wchar_t *p2 )
#define MESSAGE_FUNC_HANDLE_WCHARPTR( name, scriptname, p1, p2 ) _MessageFuncCommon( name, scriptname, 2, vgui::DATATYPE_HANDLE, #p1, vgui::DATATYPE_CONSTWCHARPTR, #p2 ); virtual void name( vgui::VPANEL p1, const wchar_t *p2 )
#define MESSAGE_FUNC_CHARPTR_CHARPTR( name, scriptname, p1, p2 ) _MessageFuncCommon( name, scriptname, 2, vgui::DATATYPE_CONSTCHARPTR, #p1, vgui::DATATYPE_CONSTCHARPTR, #p2 ); virtual void name( const char *p1, const char *p2 )
#define MESSAGE_FUNC_PARAMS( name, scriptname, p1 ) _MessageFuncCommon( name, scriptname, 1, vgui::DATATYPE_KEYVALUES, NULL, 0, 0 ); virtual void name( KeyValues *p1 )
#define MESSAGE_FUNC_NV( name, scriptname ) _MessageFuncCommon( name, scriptname, 0, 0, 0, 0, 0 ); void name( void )
#define MESSAGE_FUNC_NV_INT( name, scriptname, p1 ) _MessageFuncCommon( name, scriptname, 1, vgui::DATATYPE_INT, #p1, 0, 0 ); void name( int p1 )
#define MESSAGE_FUNC_NV_INT_INT( name, scriptname, p1, p2 ) _MessageFuncCommon( name, scriptname, 2, vgui::DATATYPE_INT, #p1, vgui::DATATYPE_INT, #p2 ); void name( int p1, int p2 )
struct PanelMessageMap
{
PanelMessageMap()
{
baseMap = NULL;
pfnClassName = NULL;
processed = false;
}
CUtlVector< MessageMapItem_t > entries;
bool processed;
PanelMessageMap* baseMap;
char const* (*pfnClassName)(void);
};
PanelMessageMap* FindPanelMessageMap(char const* className);
PanelMessageMap* FindOrAddPanelMessageMap(char const* className);
#define MAP_MESSAGE( type, name, func ) { name, (vgui::MessageFunc_t)(&type::func), 0 }
#define MAP_MESSAGE_PARAMS( type, name, func ) { name, (vgui::MessageFunc_t)(&type::func), 1, vgui::DATATYPE_KEYVALUES, NULL }
#define MAP_MESSAGE_PTR( type, name, func, param1 ) { name, (vgui::MessageFunc_t)(&type::func), 1, vgui::DATATYPE_PTR, param1 }
#define MAP_MESSAGE_INT( type, name, func, param1 ) { name, (vgui::MessageFunc_t)(&type::func), 1, vgui::DATATYPE_INT, param1 }
#define MAP_MESSAGE_BOOL( type, name, func, param1 ) { name, (vgui::MessageFunc_t)(&type::func), 1, vgui::DATATYPE_BOOL, param1 }
#define MAP_MESSAGE_FLOAT( type, name, func, param1 ) { name, (vgui::MessageFunc_t)(&type::func), 1, vgui::DATATYPE_FLOAT, param1 }
#define MAP_MESSAGE_PTR( type, name, func, param1 ) { name, (vgui::MessageFunc_t)(&type::func), 1, vgui::DATATYPE_PTR, param1 }
#define MAP_MESSAGE_CONSTCHARPTR( type, name, func, param1) { name, (vgui::MessageFunc_t)(&type::func), 1, vgui::DATATYPE_CONSTCHARPTR, param1 }
#define MAP_MESSAGE_CONSTWCHARPTR( type, name, func, param1) { name, (vgui::MessageFunc_t)(&type::func), 1, vgui::DATATYPE_CONSTWCHARPTR, param1 }
#define MAP_MESSAGE_INT_INT( type, name, func, param1, param2 ) { name, (vgui::MessageFunc_t)&type::func, 2, vgui::DATATYPE_INT, param1, vgui::DATATYPE_INT, param2 }
#define MAP_MESSAGE_PTR_INT( type, name, func, param1, param2 ) { name, (vgui::MessageFunc_t)&type::func, 2, vgui::DATATYPE_PTR, param1, vgui::DATATYPE_INT, param2 }
#define MAP_MESSAGE_INT_CONSTCHARPTR( type, name, func, param1, param2 ) { name, (vgui::MessageFunc_t)&type::func, 2, vgui::DATATYPE_INT, param1, vgui::DATATYPE_CONSTCHARPTR, param2 }
#define MAP_MESSAGE_PTR_CONSTCHARPTR( type, name, func, param1, param2 ) { name, (vgui::MessageFunc_t)&type::func, 2, vgui::DATATYPE_PTR, param1, vgui::DATATYPE_CONSTCHARPTR, param2 }
#define MAP_MESSAGE_PTR_CONSTWCHARPTR( type, name, func, param1, param2 ) { name, (vgui::MessageFunc_t)&type::func, 2, vgui::DATATYPE_PTR, param1, vgui::DATATYPE_CONSTWCHARPTR, param2 }
#define MAP_MESSAGE_CONSTCHARPTR_CONSTCHARPTR( type, name, func, param1, param2 ) { name, (vgui::MessageFunc_t)&type::func, 2, vgui::DATATYPE_CONSTCHARPTR, param1, vgui::DATATYPE_CONSTCHARPTR, param2 }
struct PanelMap_t
{
MessageMapItem_t* dataDesc;
int dataNumFields;
const char* dataClassName;
PanelMap_t* baseMap;
int processed;
};
#define DECLARE_PANELMAP() \
static vgui::PanelMap_t m_PanelMap; \
static vgui::MessageMapItem_t m_MessageMap[]; \
virtual vgui::PanelMap_t *GetPanelMap( void );
#define IMPLEMENT_PANELMAP( derivedClass, baseClass ) \
vgui::PanelMap_t derivedClass::m_PanelMap = { derivedClass::m_MessageMap, ARRAYSIZE(derivedClass::m_MessageMap), #derivedClass, &baseClass::m_PanelMap }; \
vgui::PanelMap_t *derivedClass::GetPanelMap( void ) { return &m_PanelMap; }
typedef vgui::Panel* (*PANELCREATEFUNC)(void);
class CBuildFactoryHelper
{
public:
static CBuildFactoryHelper* m_sHelpers;
public:
CBuildFactoryHelper(char const* className, PANELCREATEFUNC func);
CBuildFactoryHelper* GetNext(void);
char const* GetClassName() const;
vgui::Panel* CreatePanel();
static vgui::Panel* InstancePanel(char const* className);
static void GetFactoryNames(CUtlVector< char const* >& list);
static CDmxElement* CreatePanelDmxElement(vgui::Panel* pPanel);
static Panel* UnserializeDmxElementPanel(CDmxElement* pElement);
static bool Serialize(CUtlBuffer& buf, vgui::Panel* pPanel);
static bool Unserialize(Panel** ppPanel, CUtlBuffer& buf, const char* pFileName = NULL);
private:
static bool HasFactory(char const* className);
CBuildFactoryHelper* m_pNext;
int m_Type;
PANELCREATEFUNC m_CreateFunc;
char const* m_pClassName;
};
#define DECLARE_BUILD_FACTORY( className ) \
static vgui::Panel *Create_##className( void ) \
{ \
return new className( NULL, NULL ); \
}; \
static vgui::CBuildFactoryHelper g_##className##_Helper( #className, Create_##className );\
className *g_##className##LinkerHack = NULL;
#define DECLARE_BUILD_FACTORY_DEFAULT_TEXT( className, defaultText ) \
static vgui::Panel *Create_##className( void ) \
{ \
return new className( NULL, NULL, #defaultText ); \
}; \
static vgui::CBuildFactoryHelper g_##className##_Helper( #className, Create_##className );\
className *g_##className##LinkerHack = NULL;
#define DECLARE_BUILD_FACTORY_CUSTOM( className, createFunc ) \
static vgui::CBuildFactoryHelper g_##className##_Helper( #className, createFunc );\
className *g_##className##LinkerHack = NULL;
#define DECLARE_BUILD_FACTORY_CUSTOM_ALIAS( className, factoryName, createFunc ) \
static vgui::CBuildFactoryHelper g_##factoryName##_Helper( #factoryName, createFunc );\
className *g_##factoryName##LinkerHack = NULL;
}
#endif

View File

@ -1,15 +0,0 @@
#ifndef MOUSECODE_H
#define MOUSECODE_H
#ifdef _WIN32
#pragma once
#endif
#include "ButtonCode.h"
namespace vgui
{
typedef ButtonCode_t MouseCode;
}
#endif

View File

@ -1,57 +0,0 @@
#include "NetVarManager.hpp"
#include <cctype>
#ifdef DUMP_NETVARS
#define IF_DUMPING(...) __VA_ARGS__
#else
#define IF_DUMPING(...)
#endif
IF_DUMPING(static FILE* s_fp;)
netvar_manager::netvar_manager()
{
IF_DUMPING(fopen_s(&s_fp, "netvar_dump.txt", "w");)
for (auto clazz = iff.g_pClient->GetAllClasses(); clazz; clazz = clazz->m_pNext)
if (clazz->m_pRecvTable)
dump_recursive(clazz->m_pNetworkName, clazz->m_pRecvTable, 0);
IF_DUMPING(fclose(s_fp);)
}
auto netvar_manager::dump_recursive(const char* base_class, RecvTable* table, const std::uint16_t offset) -> void
{
for (auto i = 0; i < table->m_nProps; ++i)
{
const auto prop_ptr = &table->m_pProps[i];
if (!prop_ptr || isdigit(prop_ptr->m_pVarName[0]))
continue;
if (fnv::hash_runtime(prop_ptr->m_pVarName) == FNV("baseclass"))
continue;
if (prop_ptr->m_RecvType == DPT_DataTable &&
prop_ptr->m_pDataTable != nullptr &&
prop_ptr->m_pDataTable->m_pNetTableName[0] == 'D')
{
dump_recursive(base_class, prop_ptr->m_pDataTable, std::uint16_t(offset + prop_ptr->m_Offset));
}
char hash_name[256];
strcpy_s(hash_name, base_class);
strcat_s(hash_name, "->");
strcat_s(hash_name, prop_ptr->m_pVarName);
const auto hash = fnv::hash_runtime(hash_name);
const auto total_offset = std::uint16_t(offset + prop_ptr->m_Offset);
IF_DUMPING(fprintf(s_fp, "%s\t0x%04X\t%s\n", base_class, total_offset, prop_ptr->m_pVarName);)
m_props[hash] =
{
prop_ptr,
total_offset
};
}
}

View File

@ -1,217 +0,0 @@
#ifndef NETVARMGR
#define NETVARMGR
#pragma once
#include "cdll_int.h"
#include "dt_recv.h"
#include "client_class.h"
#include <vector>
#include "Interfaces.hpp"
#include <cstdlib>
namespace detail
{
template <typename Type, Type OffsetBasis, Type Prime>
struct size_dependant_data
{
using type = Type;
constexpr static auto k_offset_basis = OffsetBasis;
constexpr static auto k_prime = Prime;
};
template <size_t Bits>
struct size_selector;
template <>
struct size_selector<32>
{
using type = size_dependant_data<std::uint32_t, 0x811c9dc5ul, 16777619ul>;
};
template <>
struct size_selector<64>
{
using type = size_dependant_data<std::uint64_t, 0xcbf29ce484222325ull, 1099511628211ull>;
};
template <std::size_t Size>
class fnv_hash
{
private:
using data_t = typename size_selector<Size>::type;
public:
using hash = typename data_t::type;
private:
constexpr static auto k_offset_basis = data_t::k_offset_basis;
constexpr static auto k_prime = data_t::k_prime;
public:
template <std::size_t N>
static __forceinline constexpr auto hash_constexpr(const char(&str)[N], const std::size_t size = N) -> hash
{
return static_cast<hash>(1ull * (size == 1
? (k_offset_basis ^ str[0])
: (hash_constexpr(str, size - 1) ^ str[size - 1])) * k_prime);
}
static auto __forceinline hash_runtime(const char* str) -> hash
{
auto result = k_offset_basis;
do
{
result ^= *str++;
result *= k_prime;
} while (*(str - 1) != '\0');
return result;
}
};
}
namespace fnv2 {
constexpr uint32_t offsetBasis = 0x811c9dc5;
constexpr uint32_t prime = 0x1000193;
constexpr uint32_t hash(const char* str, const uint32_t value = offsetBasis) noexcept
{
return *str ? hash(str + 1, (value ^ *str) * static_cast<unsigned long long>(prime)) : value;
}
constexpr uint32_t hashRuntime(const char* str) noexcept
{
auto value = offsetBasis;
while (*str) {
value ^= *str++;
value *= prime;
}
return value;
}
}
using fnv = ::detail::fnv_hash<sizeof(void*) * 8>;
#define FNV(str) (std::integral_constant<fnv::hash, fnv::hash_constexpr(str)>::value)
#include <map>
#include <type_traits>
class netvar_manager
{
private:
struct stored_data
{
RecvProp* prop_ptr;
std::uint16_t class_relative_offset;
};
public:
static auto get() -> const netvar_manager&
{
static netvar_manager instance;
return instance;
}
auto get_offset(const fnv::hash hash) const -> std::uint16_t
{
return m_props.at(hash).class_relative_offset;
}
auto get_prop(const fnv::hash hash) const -> RecvProp*
{
return m_props.at(hash).prop_ptr;
}
__declspec(noinline) static auto get_offset_by_hash(const fnv::hash hash) -> std::uint16_t
{
return get().get_offset(hash);
}
template<fnv::hash Hash>
static auto get_offset_by_hash_cached() -> std::uint16_t
{
static auto offset = std::uint16_t(0);
if (!offset)
offset = get_offset_by_hash(Hash);
return offset;
}
private:
netvar_manager();
auto dump_recursive(const char* base_class, RecvTable* table, std::uint16_t offset) -> void;
private:
std::map<fnv::hash, stored_data> m_props;
};
#define PNETVAR_OFFSET(funcname, class_name, var_name, offset, ...) \
auto funcname() -> std::add_pointer_t<__VA_ARGS__> \
{ \
constexpr auto hash = fnv::hash_constexpr(class_name "->" var_name); \
const auto addr = std::uintptr_t(this) + offset + netvar_manager::get_offset_by_hash_cached<hash>(); \
return reinterpret_cast<std::add_pointer_t<__VA_ARGS__>>(addr); \
}
#define PNETVAR(funcname, class_name, var_name, ...) \
PNETVAR_OFFSET(funcname, class_name, var_name, 0, __VA_ARGS__)
#define NETVAR_OFFSET(funcname, class_name, var_name, offset, ...) \
auto funcname() -> std::add_lvalue_reference_t<__VA_ARGS__> \
{ \
constexpr auto hash = fnv::hash_constexpr(class_name "->" var_name); \
const auto addr = std::uintptr_t(this) + offset + netvar_manager::get_offset_by_hash_cached<hash>(); \
return *reinterpret_cast<std::add_pointer_t<__VA_ARGS__>>(addr); \
}
#define NETVAR(funcname, class_name, var_name, ...) \
NETVAR_OFFSET(funcname, class_name, var_name, 0, __VA_ARGS__)
#define NETPROP(funcname, class_name, var_name) \
static auto funcname() -> RecvProp* \
{ \
constexpr auto hash = fnv::hash_constexpr(class_name "->" var_name); \
static RecvProp* prop_ptr; \
if(!prop_ptr) prop_ptr = netvar_manager::get().get_prop(hash); \
return prop_ptr; \
}
class recv_prop_hook
{
public:
recv_prop_hook(RecvProp* prop, const RecvVarProxyFn proxy_fn) :
m_property(prop),
m_original_proxy_fn(prop->m_ProxyFn)
{
set_proxy_function(proxy_fn);
}
~recv_prop_hook()
{
m_property->m_ProxyFn = m_original_proxy_fn;
}
auto get_original_function() const -> RecvVarProxyFn
{
return m_original_proxy_fn;
}
auto set_proxy_function(const RecvVarProxyFn proxy_fn) const -> void
{
m_property->m_ProxyFn = proxy_fn;
}
private:
RecvProp* m_property;
RecvVarProxyFn m_original_proxy_fn;
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,265 +0,0 @@
#include "Other.hpp"
#include "PatternScan.hpp"
void UpdateFlashLight(CFlashlightEffect* pFlashLight, const Vector& vecPos, const Vector& vecForward, const Vector& vecRight, const Vector& vecUp)
{
typedef void(__thiscall* UpdateLight_t)(void*, int, const Vector&, const Vector&, const Vector&, const Vector&, float, float, float, bool, const char*);
static UpdateLight_t oUpdateLight = NULL;
if (!oUpdateLight)
{
DWORD callInstruction = FindPatternV2("client.dll", "E8 ? ?? ? ? 8B 06 F3 0F 10 46");
DWORD relativeAddress = *(DWORD*)(callInstruction + 1);
DWORD nextInstruction = callInstruction + 5;
oUpdateLight = (UpdateLight_t)(nextInstruction + relativeAddress);
}
oUpdateLight(pFlashLight, pFlashLight->m_nEntIndex, vecPos, vecForward, vecRight, vecUp,
pFlashLight->m_flFov, pFlashLight->m_flFarZ, pFlashLight->m_flLinearAtten, pFlashLight->m_bCastsShadows,
pFlashLight->m_textureName);
}
CFlashlightEffect* CreateFlashLight(int nEntIndex, const char* pszTextureName, float flFov, float flFarZ, float flLinearAtten)
{
CFlashlightEffect* pFlashLight = reinterpret_cast<CFlashlightEffect*>(iff.g_pMemAlloc->Alloc(sizeof(CFlashlightEffect)));
if (!pFlashLight)
return NULL;
static DWORD oConstructor = FindPatternV2("client.dll", "55 8B EC F3 0F 10 45 ? B8");
__asm
{
movss xmm3, flFov
mov ecx, pFlashLight
push flLinearAtten
push flFarZ
push pszTextureName
push nEntIndex
call oConstructor
}
pFlashLight->m_bIsOn = true;
return pFlashLight;
}
void DestroyFlashLight(CFlashlightEffect* pFlashLight)
{
static DWORD oDestructor = FindPatternV2("client.dll", "56 8B F1 E8 ? ? ? ? 8B 4E 28");
__asm
{
mov ecx, pFlashLight
push ecx
call oDestructor
}
}
void AngleVectors(const Vector& angles, Vector* forward, Vector* right, Vector* up)
{
float sr, sp, sy, cr, cp, cy;
SinCos(DEG2RAD(angles[1]), &sy, &cy);
SinCos(DEG2RAD(angles[0]), &sp, &cp);
SinCos(DEG2RAD(angles[2]), &sr, &cr);
if (forward)
{
forward->x = cp * cy;
forward->y = cp * sy;
forward->z = -sp;
}
if (right)
{
right->x = (-1 * sr * sp * cy + -1 * cr * -sy);
right->y = (-1 * sr * sp * sy + -1 * cr * cy);
right->z = -1 * sr * cp;
}
if (up)
{
up->x = (cr * sp * cy + -sr * -sy);
up->y = (cr * sp * sy + -sr * cy);
up->z = cr * cp;
}
}
static bool ToggleButton(ButtonCode_t code)
{
static int buttonPressedTick = 0;
if (iff.g_pInputSystem->IsButtonDown(code) && (GetTickCount64() - buttonPressedTick) > 300)
{
buttonPressedTick = GetTickCount64();
return true;
}
return false;
}
void FlashlightRun(C_BasePlayer* local)
{
static CFlashlightEffect* pFlashLight = NULL;
if (opt.disconnected)
{
#ifdef DEBUG
printf("nullify pFlashlight bc disconnected\n");
#endif
pFlashLight = NULL;
opt.disconnected = 0;
}
if (ToggleButton(KEY_L))
{
if (!pFlashLight)
{
#ifdef DEBUG
printf("creating fl\n");
#endif
pFlashLight = CreateFlashLight(local->GetIndex(), g_Options.flashlightTexture.value->mystring, *g_Options.flashlightFOV, *g_Options.flashlightFarZ, *g_Options.flashlightLinearAtten);
iff.g_pEngineClient->ExecuteClientCmd("play items/flashlight1.wav");
}
else
{
#ifdef DEBUG
printf("destroying fl\n");
#endif
DestroyFlashLight(pFlashLight);
pFlashLight = NULL;
iff.g_pEngineClient->ExecuteClientCmd("play items/flashlight1.wav");
}
}
if (pFlashLight)
{
Vector f, r, u;
Vector viewAngles;
iff.g_pEngineClient->GetViewAngles(viewAngles);
AngleVectors(viewAngles, &f, &r, &u);
pFlashLight->m_bIsOn = true;
pFlashLight->m_bCastsShadows = *g_Options.flashlightShadows;
pFlashLight->m_flFov = *g_Options.flashlightFOV;
UpdateFlashLight(pFlashLight, local->GetOrigin() + local->GetViewOffset(), f, r, u);
}
}
#define DRAW_SCREEN_EFFECT(material) \
{ \
const auto drawFunction = relativeToAbsolute<uintptr_t>(FindPatternV2("client.dll", "E8 ? ? ? ? 83 C4 0C 8D 4D F8") + 1); \
int w, h; \
iff.g_pVGuiSurface->GetScreenSize(w, h); \
__asm { \
__asm push h \
__asm push w \
__asm push 0 \
__asm xor edx, edx \
__asm mov ecx, material \
__asm call drawFunction \
__asm add esp, 12 \
} \
}
void NightvisionRun(C_BasePlayer* local) {
static int m_flNightVisionAlpha = NetvarSys::Get().GetOffset("DT_CSPlayer", "m_flFlashDuration") - 0x1C;
if (ToggleButton(KEY_N) )
{
if (!local->GetNightvision())
{
local->GetNightvision() = true;
*(float*)(uintptr_t(local) + m_flNightVisionAlpha) = 1.0f;
iff.g_pEngineClient->ExecuteClientCmd("play items/nvg_on.wav");
}
else
{
local->GetNightvision() = false;
*(float*)(uintptr_t(local) + m_flNightVisionAlpha) = 0;
iff.g_pEngineClient->ExecuteClientCmd("play items/nvg_off.wav");
}
}
}
void do_precipitation() {
static void* rain_networkable = nullptr;
C_Precipitation* rain_ent = (C_Precipitation*)iff.g_pEntityList->GetClientEntity(MAX_EDICTS - 1);
static ClientClass* precipitation_client_class = nullptr;
if (!iff.g_pEngineClient->IsInGame() || !iff.g_pEngineClient->IsConnected()) {
rain_networkable = rain_ent = nullptr;
return;
}
int localplayer_index = iff.g_pEngineClient->GetLocalPlayer();
C_BasePlayer* localplayer = static_cast<C_BasePlayer*>(iff.g_pEntityList->GetClientEntity(localplayer_index));
if (!localplayer) return;
if (!(localplayer->GetLifeState() == LIFE_ALIVE && localplayer->GetHealth() > 0))
return;
if (!precipitation_client_class) {
for (auto pclass = iff.g_pClient->GetAllClasses(); pclass && !precipitation_client_class; pclass = pclass->m_pNext)
if (strstr(pclass->GetName(), "CPrecipitation"))
{
#ifdef DEBUG
printf("class found %x\n", pclass);
#endif
precipitation_client_class = pclass;
}
}
else {
if (!rain_ent && precipitation_client_class && precipitation_client_class->m_pCreateFn) {
#ifdef DEBUG
printf("Creating precipitation\n");
#endif
rain_networkable = ((void* (*)(int, int))precipitation_client_class->m_pCreateFn)(MAX_EDICTS - 1, 0);
if (rain_networkable) {
rain_ent = (C_Precipitation*)iff.g_pEntityList->GetClientEntity(MAX_EDICTS - 1);
rain_ent->GetPrecipitationType() = (PrecipitationType_t)*g_Options.weathertype;
rain_ent->PreDataUpdate(DataUpdateType_t::DATA_UPDATE_CREATED);
rain_ent->OnPreDataChanged(DataUpdateType_t::DATA_UPDATE_CREATED);
rain_ent->GetMins() = Vector(-32767.0f, -32767.0f, -32767.0f);
rain_ent->GetMaxs() = Vector(32767.0f, 32767.0f, 32767.0f);
rain_ent->OnDataChanged(DataUpdateType_t::DATA_UPDATE_CREATED);
rain_ent->PostDataUpdate(DataUpdateType_t::DATA_UPDATE_CREATED);
#ifdef DEBUG
printf("Created precipitation %x\n", rain_ent);
#endif
}
}
}
}

View File

@ -1,15 +0,0 @@
#ifndef OTHER
#define OTHER
#pragma once
#include "Interfaces.hpp"
#include "Options.hpp"
#include "c_baseentity.h"
void FlashlightRun(C_BasePlayer* local);
void NightvisionRun(C_BasePlayer* local);
void do_precipitation();
#endif OTHER

View File

@ -1,70 +0,0 @@
#ifndef PHANDLE_H
#define PHANDLE_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
namespace vgui
{
class Panel;
class PHandle
{
public:
PHandle() : m_iPanelID(INVALID_PANEL) {}
Panel* Get();
Panel* Set(Panel* pPanel);
Panel* Set(HPanel hPanel);
operator Panel* () { return Get(); }
Panel* operator ->() { return Get(); }
Panel* operator = (Panel* pPanel) { return Set(pPanel); }
bool operator == (Panel* pPanel) { return (Get() == pPanel); }
operator bool() { return Get() != 0; }
private:
HPanel m_iPanelID;
};
class VPanelHandle
{
public:
VPanelHandle() : m_iPanelID(INVALID_PANEL) {}
VPANEL Get();
VPANEL Set(VPANEL pPanel);
operator VPANEL () { return Get(); }
VPANEL operator = (VPANEL pPanel) { return Set(pPanel); }
bool operator == (VPANEL pPanel) { return (Get() == pPanel); }
operator bool() { return Get() != 0; }
private:
HPanel m_iPanelID;
};
template< class PanelType >
class DHANDLE : public PHandle
{
public:
PanelType* Get() { return (PanelType*)PHandle::Get(); }
PanelType* Set(PanelType* pPanel) { return (PanelType*)PHandle::Set(pPanel); }
PanelType* Set(HPanel hPanel) { return (PanelType*)PHandle::Set(hPanel); }
operator PanelType* () { return (PanelType*)PHandle::Get(); }
PanelType* operator ->() { return (PanelType*)PHandle::Get(); }
PanelType* operator = (PanelType* pPanel) { return (PanelType*)PHandle::Set(pPanel); }
bool operator == (Panel* pPanel) { return (PHandle::Get() == pPanel); }
operator bool() { return PHandle::Get() != NULL; }
};
};
#endif

View File

@ -1,962 +0,0 @@
#ifndef PANEL_H
#define PANEL_H
#ifdef _WIN32
#pragma once
#endif
#include "utlflags.h"
#include "vgui.h"
#include "Dar.h"
#include "MessageMap.h"
#if defined( VGUI_USEKEYBINDINGMAPS )
#include "KeyBindingMap.h"
#endif
#include "IClientPanel.h"
#include "IScheme.h"
#include "Controls.h"
#include "PHandle.h"
#include "PanelAnimationVar.h"
#include "color.h"
#include "keyvalues.h"
#include "ikeyvaluessystem.h"
#include "utlsymbol.h"
#include "BuildGroup.h"
#include "dmxelement.h"
#ifdef PostMessage
#undef PostMessage
#endif
#ifdef SetCursor
#undef SetCursor
#endif
class CUtlBuffer;
struct DmxElementUnpackStructure_t;
namespace vgui
{
#if !defined( _GAMECONSOLE )
#define VGUI_USEDRAGDROP 1
#endif
#if defined( VGUI_USEKEYBINDINGMAPS )
struct PanelKeyBindingMap;
#endif
template< class T >
inline T* SETUP_PANEL(T* panel)
{
panel->MakeReadyForUse();
return panel;
}
#define CREATE_PANEL(type, parent, name) (SETUP_PANEL(new type(parent, name)))
#if defined( VGUI_USEDRAGDROP )
struct DragDrop_t;
class Menu;
#endif
class Panel;
struct SizerAddArgs_t
{
SizerAddArgs_t()
{
m_flExpandFactor = 0.0f;
m_nPadding = 5;
m_bMinorExpand = true;
m_nMinX = -1;
m_nMinY = -1;
m_bIgnoreMemberMin = false;
}
SizerAddArgs_t& Expand(float flExpandFactor) { m_flExpandFactor = flExpandFactor; return *this; }
SizerAddArgs_t& Padding(int nPadding) { m_nPadding = nPadding; return *this; }
SizerAddArgs_t& MinorExpand(bool bMinorExpand) { m_bMinorExpand = bMinorExpand; return *this; }
SizerAddArgs_t& MinSize(int nMinX, int nMinY) { m_nMinX = nMinX; m_nMinY = nMinY; return *this; }
SizerAddArgs_t& MinX(int nMinX) { m_nMinX = nMinX; return *this; }
SizerAddArgs_t& MinY(int nMinY) { m_nMinY = nMinY; return *this; }
SizerAddArgs_t& IgnoreMemberMin(bool bIgnoreMemberMin = true) { m_bIgnoreMemberMin = bIgnoreMemberMin; return *this; }
SizerAddArgs_t& FixedSize(int nX, int nY)
{
IgnoreMemberMin(true);
MinSize(nX, nY);
Expand(0.f);
MinorExpand(false);
return *this;
}
float m_flExpandFactor;
int m_nPadding;
bool m_bMinorExpand;
int m_nMinX;
int m_nMinY;
bool m_bIgnoreMemberMin;
};
enum SizerLayoutDirection_t
{
ESLD_HORIZONTAL,
ESLD_VERTICAL
};
enum SizerElementType_t
{
ESET_SIZER,
ESET_PANEL,
ESET_SPACER,
};
class CSizerBase
{
public:
CSizerBase();
virtual ~CSizerBase();
int GetElementCount() { return m_Members.Count(); }
SizerElementType_t GetElementType(int i);
Panel* GetPanel(int i);
void SetElementArgs(int nIndex, const SizerAddArgs_t& args) { m_Members[nIndex].Fill(args); }
void InsertPanel(int nIndex, Panel* pPanel, const SizerAddArgs_t& args);
void InsertSizer(int nIndex, CSizerBase* pSizer, const SizerAddArgs_t& args);
void InsertSpacer(int nIndex, const SizerAddArgs_t& args);
void AddPanel(Panel* pPanel, const SizerAddArgs_t& args) { InsertPanel(GetElementCount(), pPanel, args); }
void AddSizer(CSizerBase* pSizer, const SizerAddArgs_t& args) { InsertSizer(GetElementCount(), pSizer, args); }
void AddSpacer(const SizerAddArgs_t& args) { InsertSpacer(GetElementCount(), args); }
void RemoveElement(int i, bool bDelete);
void RemoveAllMembers(bool bDelete);
void GetMinSize(int& OutX, int& OutY);
void RecursiveInvalidateCachedSize();
virtual void DoLayout(int BaseX, int BaseY, int SizeX, int SizeY) = 0;
virtual void CalculateSize() = 0;
protected:
class CSizerMember
{
friend class CSizerBase;
public:
SizerElementType_t GetElementType() const;
Panel* GetPanel() const;
void GetMemberMinSize(int& OutX, int& OutY);
void RecursiveInvalidateCachedSize();
void Place(int BaseX, int BaseY, int SizeX, int SizeY);
float GetExpandFactor() { return m_flExpandFactor; }
bool GetMinorExpand() { return m_bMinorExpand; }
void DiscardOwnedSizer();
bool IsVisible();
void Fill(const SizerAddArgs_t& args);
private:
void RecursiveRemove(bool bDelete);
Panel* m_pPanel;
CSizerBase* m_pSizer;
int m_nPadding;
float m_flExpandFactor;
bool m_bMinorExpand;
bool m_bIgnoreMemberMin;
int m_nMinX;
int m_nMinY;
};
CUtlVector<CSizerMember> m_Members;
int m_nMinXSize;
int m_nMinYSize;
};
inline int SizerMajorAxis(SizerLayoutDirection_t Dir, int X, int Y) { return (Dir == ESLD_HORIZONTAL) ? X : Y; }
inline int SizerMinorAxis(SizerLayoutDirection_t Dir, int X, int Y) { return (Dir == ESLD_VERTICAL) ? X : Y; }
inline int SizerXAxis(SizerLayoutDirection_t Dir, int MajorAxis, int MinorAxis) { return (Dir == ESLD_HORIZONTAL) ? MajorAxis : MinorAxis; }
inline int SizerYAxis(SizerLayoutDirection_t Dir, int MajorAxis, int MinorAxis) { return (Dir == ESLD_VERTICAL) ? MajorAxis : MinorAxis; }
class CBoxSizer : public CSizerBase
{
public:
CBoxSizer(SizerLayoutDirection_t LayoutDirection);
virtual void CalculateSize();
virtual void DoLayout(int BaseX, int BaseY, int SizeX, int SizeY);
protected:
SizerLayoutDirection_t m_LayoutDirection;
};
struct OverridableColorEntry
{
char const* name() { return m_pszScriptName; }
char const* m_pszScriptName;
Color* m_pColor;
Color m_colFromScript;
UtlSymId_t m_sColorNameFromScript;
bool m_bOverridden;
};
#define REGISTER_COLOR_AS_OVERRIDABLE( name, scriptname ) \
AddToOverridableColors( &name, scriptname );
#define DECLARE_VGUI_UNPACK() \
DECLARE_DMXELEMENT_UNPACK() \
private: \
static DmxElementUnpackStructure_t *s_pUnpackParams; \
public: \
virtual const DmxElementUnpackStructure_t* GetUnpackStructure() const { return s_pUnpackParams; }
#define DECLARE_VGUI_UNPACK_NAMESPACE( _namespace ) \
template <typename T> friend DmxElementUnpackStructure_t *DmxElementUnpackInit##_namespace(T *); \
private: \
static DmxElementUnpackStructure_t *s_pUnpackParams; \
public: \
virtual const DmxElementUnpackStructure_t* GetUnpackStructure() const { return s_pUnpackParams; }
#define BEGIN_VGUI_UNPACK( _structName ) BEGIN_DMXELEMENT_UNPACK( _structName )
#define END_VGUI_UNPACK( _structName ) \
END_DMXELEMENT_UNPACK( _structName, s_pUnpackParams ) \
DmxElementUnpackStructure_t *_structName::s_pUnpackParams = _structName##_UnpackInit::s_pUnpack;
#define BEGIN_VGUI_UNPACK_NAMESPACE( _nameSpace, _structName ) BEGIN_DMXELEMENT_UNPACK_NAMESPACE( _nameSpace, _structName )
#define END_VGUI_UNPACK_NAMESPACE( _nameSpace, _structName ) \
END_DMXELEMENT_UNPACK_NAMESPACE( _nameSpace, _structName, s_pUnpackParams ) \
DmxElementUnpackStructure_t *_structName::s_pUnpackParams = _namespace##_structName##_UnpackInit::s_pUnpack;
class IPanelAnimationPropertyConverter
{
public:
virtual void GetData(Panel* panel, KeyValues* kv, PanelAnimationMapEntry* entry) = 0;
virtual void SetData(Panel* panel, KeyValues* kv, PanelAnimationMapEntry* entry) = 0;
virtual void InitFromDefault(Panel* panel, PanelAnimationMapEntry* entry) = 0;
};
#if defined( VGUI_USEKEYBINDINGMAPS )
enum KeyBindingContextHandle_t
{
INVALID_KEYBINDINGCONTEXT_HANDLE = 0xffffffff,
};
#endif
#define PANEL_ROUND_CORNER_TOP_LEFT (1 << 0)
#define PANEL_ROUND_CORNER_TOP_RIGHT (1 << 1)
#define PANEL_ROUND_CORNER_BOTTOM_LEFT (1 << 2)
#define PANEL_ROUND_CORNER_BOTTOM_RIGHT (1 << 3)
#define PANEL_ROUND_CORNER_ALL PANEL_ROUND_CORNER_TOP_LEFT | PANEL_ROUND_CORNER_TOP_RIGHT | PANEL_ROUND_CORNER_BOTTOM_LEFT | PANEL_ROUND_CORNER_BOTTOM_RIGHT
class Panel : public IClientPanel
{
DECLARE_CLASS_SIMPLE_NOBASE(Panel);
DECLARE_DMXELEMENT_UNPACK_NAMESPACE(vgui);
public:
static void InitPropertyConverters(void);
static void AddPropertyConverter(char const* typeName, IPanelAnimationPropertyConverter* converter);
Panel();
Panel(Panel* parent);
Panel(Panel* parent, const char* panelName);
Panel(Panel* parent, const char* panelName, HScheme scheme);
virtual ~Panel();
virtual VPANEL GetVPanel() { return _vpanel; }
HPanel ToHandle() const;
void SetName(const char* panelName);
const char* GetName();
const char* GetClassName();
void MakeReadyForUse();
void SetPos(int x, int y);
void GetPos(int& x, int& y);
void SetSize(int wide, int tall);
void GetSize(int& wide, int& tall);
void SetBounds(int x, int y, int wide, int tall);
void GetBounds(int& x, int& y, int& wide, int& tall);
int GetWide();
void SetWide(int wide);
int GetTall();
void SetTall(int tall);
void SetMinimumSize(int wide, int tall);
void GetMinimumSize(int& wide, int& tall);
bool IsBuildModeEditable();
void SetBuildModeEditable(bool state);
bool IsBuildModeDeletable();
void SetBuildModeDeletable(bool state);
bool IsBuildModeActive();
void SetZPos(int z);
int GetZPos(void);
void SetAlpha(int alpha);
int GetAlpha();
virtual void SetVisible(bool state);
virtual bool IsVisible();
virtual bool IsFullyVisible();
virtual VPANEL IsWithinTraverse(int x, int y, bool traversePopups);
MESSAGE_FUNC(Repaint, "Repaint");
virtual void PostMessage(VPANEL target, KeyValues* message, float delaySeconds = 0.0f);
bool IsWithin(int x, int y);
void LocalToScreen(int& x, int& y);
void ScreenToLocal(int& x, int& y);
void ParentLocalToScreen(int& x, int& y);
void MakePopup(bool showTaskbarIcon = true, bool disabled = false);
virtual void OnMove();
virtual Panel* GetParent();
virtual VPANEL GetVParent();
virtual void SetParent(Panel* newParent);
virtual void SetParent(VPANEL newParent);
virtual bool HasParent(VPANEL potentialParent);
int GetChildCount();
Panel* GetChild(int index);
int FindChildIndexByName(const char* childName);
Panel* FindChildByName(const char* childName, bool recurseDown = false);
Panel* FindSiblingByName(const char* siblingName);
void CallParentFunction(KeyValues* message);
virtual bool LookupElementBounds(const char* elementName, int& x, int& y, int& wide, int& tall) { return false; }
virtual void SetAutoDelete(bool state);
virtual bool IsAutoDeleteSet();
virtual void DeletePanel();
virtual void AddActionSignalTarget(Panel* messageTarget);
virtual void AddActionSignalTarget(VPANEL messageTarget);
virtual void RemoveActionSignalTarget(Panel* oldTarget);
virtual void PostActionSignal(KeyValues* message);
virtual bool RequestInfoFromChild(const char* childName, KeyValues* outputData);
virtual void PostMessageToChild(const char* childName, KeyValues* messsage);
virtual void PostMessage(Panel* target, KeyValues* message, float delaySeconds = 0.0f);
virtual bool RequestInfo(KeyValues* outputData);
virtual bool SetInfo(KeyValues* inputData);
virtual void SetSilentMode(bool bSilent);
virtual void InstallMouseHandler(Panel* pHandler);
virtual void SetEnabled(bool state);
virtual bool IsEnabled();
virtual bool IsPopup();
virtual void GetClipRect(int& x0, int& y0, int& x1, int& y1);
virtual void MoveToFront();
enum PinCorner_e
{
PIN_TOPLEFT = 0,
PIN_TOPRIGHT,
PIN_BOTTOMLEFT,
PIN_BOTTOMRIGHT,
PIN_NO,
PIN_CENTER_TOP,
PIN_CENTER_RIGHT,
PIN_CENTER_BOTTOM,
PIN_CENTER_LEFT,
};
enum AutoResize_e
{
AUTORESIZE_NO = 0,
AUTORESIZE_RIGHT,
AUTORESIZE_DOWN,
AUTORESIZE_DOWNANDRIGHT,
};
void SetPinCorner(PinCorner_e pinCorner, int nOffsetX, int nOffsetY);
void SetAutoResize(PinCorner_e pinCorner, AutoResize_e resizeDir, int nPinOffsetX, int nPinOffsetY, int nUnpinnedCornerOffsetX, int nUnpinnedCornerOffsetY);
AutoResize_e GetAutoResize();
PinCorner_e GetPinCorner();
void GetPinOffset(int& dx, int& dy);
void GetResizeOffset(int& dx, int& dy);
void PinToSibling(const char* pszSibling, PinCorner_e pinOurCorner, PinCorner_e pinSibling);
void UpdateSiblingPin(void);
virtual void SetBgColor(Color color);
virtual void SetFgColor(Color color);
virtual Color GetBgColor();
virtual Color GetFgColor();
virtual void SetCursor(HCursor cursor);
virtual HCursor GetCursor();
virtual void RequestFocus(int direction = 0);
virtual bool HasFocus();
virtual void InvalidateLayout(bool layoutNow = false, bool reloadScheme = false);
virtual bool RequestFocusPrev(VPANEL panel = NULL);
virtual bool RequestFocusNext(VPANEL panel = NULL);
virtual void SetTabPosition(int position);
virtual int GetTabPosition();
virtual void SetBorder(IBorder* border);
virtual IBorder* GetBorder();
virtual void SetPaintBorderEnabled(bool state);
virtual void SetPaintBackgroundEnabled(bool state);
virtual void SetPaintEnabled(bool state);
virtual void SetPostChildPaintEnabled(bool state);
virtual void SetPaintBackgroundType(int type);
virtual void GetInset(int& left, int& top, int& right, int& bottom);
virtual void GetPaintSize(int& wide, int& tall);
virtual void SetBuildGroup(BuildGroup* buildGroup);
virtual bool IsBuildGroupEnabled();
virtual bool IsCursorNone();
virtual bool IsCursorOver();
virtual void MarkForDeletion();
virtual bool IsLayoutInvalid();
virtual Panel* HasHotkey(wchar_t key);
virtual bool IsOpaque();
bool IsRightAligned();
bool IsBottomAligned();
bool IsPercentage();
virtual HScheme GetScheme();
virtual void SetScheme(const char* tag);
virtual void SetScheme(HScheme scheme);
virtual Color GetSchemeColor(const char* keyName, IScheme* pScheme);
virtual Color GetSchemeColor(const char* keyName, Color defaultColor, IScheme* pScheme);
virtual void ApplySchemeSettings(IScheme* pScheme);
virtual void ApplySettings(KeyValues* inResourceData);
virtual void OnUnserialized(CDmxElement* pElement);
virtual void GetSettings(KeyValues* outResourceData);
virtual const char* GetDescription();
virtual const char* GetModuleName();
virtual void ApplyUserConfigSettings(KeyValues* userConfig);
virtual void GetUserConfigSettings(KeyValues* userConfig);
virtual bool HasUserConfigSettings();
virtual void OnMessage(const KeyValues* params, VPANEL fromPanel);
MESSAGE_FUNC_CHARPTR(OnCommand, "Command", command);
MESSAGE_FUNC(OnMouseCaptureLost, "MouseCaptureLost");
MESSAGE_FUNC(OnSetFocus, "SetFocus");
MESSAGE_FUNC(OnKillFocus, "KillFocus");
MESSAGE_FUNC(OnDelete, "Delete");
virtual void OnThink();
virtual void OnChildAdded(VPANEL child);
virtual void OnSizeChanged(int newWide, int newTall);
virtual void OnTick();
MESSAGE_FUNC_INT_INT(OnCursorMoved, "OnCursorMoved", x, y);
virtual void OnCursorEntered();
virtual void OnCursorExited();
virtual void OnMousePressed(MouseCode code);
virtual void OnMouseDoublePressed(MouseCode code);
virtual void OnMouseReleased(MouseCode code);
virtual void OnMouseWheeled(int delta);
virtual void SetTriplePressAllowed(bool state);
virtual bool IsTriplePressAllowed() const;
virtual void OnMouseTriplePressed(MouseCode code);
static char const* KeyCodeToString(KeyCode code);
static wchar_t const* KeyCodeToDisplayString(KeyCode code);
static wchar_t const* KeyCodeModifiersToDisplayString(KeyCode code, int modifiers);
static KeyCode StringToKeyCode(char const* str);
#if defined( VGUI_USEKEYBINDINGMAPS )
static KeyBindingContextHandle_t CreateKeyBindingsContext(char const* filename, char const* pathID = 0);
virtual void SetKeyBindingsContext(KeyBindingContextHandle_t handle);
virtual KeyBindingContextHandle_t GetKeyBindingsContext() const;
virtual bool IsValidKeyBindingsContext() const;
static int GetPanelsWithKeyBindingsCount(KeyBindingContextHandle_t handle);
static Panel* GetPanelWithKeyBindings(KeyBindingContextHandle_t handle, int index);
static void RevertKeyBindings(KeyBindingContextHandle_t handle);
static void ReloadKeyBindings(KeyBindingContextHandle_t handle);
static void SaveKeyBindings(KeyBindingContextHandle_t handle);
static void SaveKeyBindingsToFile(KeyBindingContextHandle_t handle, char const* filename, char const* pathID = 0);
static void LoadKeyBindings(KeyBindingContextHandle_t handle);
static void LoadKeyBindingsForOnePanel(KeyBindingContextHandle_t handle, Panel* panelOfInterest);
virtual bool IsKeyRebound(KeyCode code, int modifiers);
virtual bool IsKeyOverridden(KeyCode code, int modifiers);
virtual void AddKeyBinding(char const* bindingName, int keycode, int modifiers);
KeyBindingMap_t* LookupBinding(char const* bindingName);
KeyBindingMap_t* LookupBindingByKeyCode(KeyCode code, int modifiers);
void LookupBoundKeys(char const* bindingName, CUtlVector< BoundKey_t* >& list);
BoundKey_t* LookupDefaultKey(char const* bindingName);
PanelKeyBindingMap* LookupMapForBinding(char const* bindingName);
int GetKeyMappingCount();
void RevertKeyBindingsToDefault();
void RemoveAllKeyBindings();
void ReloadKeyBindings();
virtual void EditKeyBindings();
void SaveKeyBindingsToBuffer(int level, CUtlBuffer& buf);
bool ParseKeyBindings(KeyValues* kv);
virtual char const* GetKeyBindingsFile() const;
virtual char const* GetKeyBindingsFilePathID() const;
void SetAllowKeyBindingChainToParent(bool state);
bool IsKeyBindingChainToParentAllowed() const;
#endif
virtual void OnKeyCodePressed(KeyCode code);
virtual void OnKeyCodeTyped(KeyCode code);
virtual void OnKeyTyped(wchar_t unichar);
virtual void OnKeyCodeReleased(KeyCode code);
virtual void OnKeyFocusTicked();
MESSAGE_FUNC(OnMouseFocusTicked, "OnMouseFocusTicked");
virtual void PaintBackground();
virtual void Paint();
virtual void PaintBorder();
virtual void PaintBuildOverlay();
virtual void PostChildPaint();
virtual void PerformLayout();
DECLARE_PANELMAP();
virtual VPANEL GetCurrentKeyFocus();
BaseTooltip* GetTooltip();
void SetTooltip(BaseTooltip* pToolTip, const char* pszText);
virtual bool IsProportional() { return _flags.IsFlagSet(IS_PROPORTIONAL); }
virtual void SetProportional(bool state);
virtual void SetMouseInputEnabled(bool state);
virtual void SetKeyBoardInputEnabled(bool state);
virtual bool IsMouseInputEnabled();
virtual bool IsKeyBoardInputEnabled();
void DisableMouseInputForThisPanel(bool bDisable);
bool IsMouseInputDisabledForThisPanel() const;
virtual void DrawTexturedBox(int x, int y, int wide, int tall, Color color, float normalizedAlpha);
virtual void DrawBox(int x, int y, int wide, int tall, Color color, float normalizedAlpha, bool hollow = false);
virtual void DrawBoxFade(int x, int y, int wide, int tall, Color color, float normalizedAlpha, unsigned int alpha0, unsigned int alpha1, bool bHorizontal, bool hollow = false);
virtual void DrawHollowBox(int x, int y, int wide, int tall, Color color, float normalizedAlpha);
virtual void DrawHollowBox(int x, int y, int wide, int tall, Color color, float normalizedAlpha, int cornerWide, int cornerTall);
unsigned char GetRoundedCorners() { return m_roundedCorners; }
void SetRoundedCorners(unsigned char cornerFlags) { m_roundedCorners = cornerFlags; }
bool ShouldDrawTopLeftCornerRounded() { return 0 != (m_roundedCorners & PANEL_ROUND_CORNER_TOP_LEFT); }
bool ShouldDrawTopRightCornerRounded() { return 0 != (m_roundedCorners & PANEL_ROUND_CORNER_TOP_RIGHT); }
bool ShouldDrawBottomLeftCornerRounded() { return 0 != (m_roundedCorners & PANEL_ROUND_CORNER_BOTTOM_LEFT); }
bool ShouldDrawBottomRightCornerRounded() { return 0 != (m_roundedCorners & PANEL_ROUND_CORNER_BOTTOM_RIGHT); }
virtual void SetDragEnabled(bool enabled);
virtual bool IsDragEnabled() const;
virtual void SetShowDragHelper(bool enabled);
virtual void OnDragFailed(CUtlVector< KeyValues* >& msglist);
virtual void SetBlockDragChaining(bool block);
virtual bool IsBlockingDragChaining() const;
virtual int GetDragStartTolerance() const;
virtual void SetDragSTartTolerance(int nTolerance);
virtual void SetDropEnabled(bool enabled, float m_flHoverContextTime = 0.0f);
virtual bool IsDropEnabled() const;
virtual bool GetDropContextMenu(Menu* menu, CUtlVector< KeyValues* >& msglist);
virtual void OnDropContextHoverShow(CUtlVector< KeyValues* >& msglist);
virtual void OnDropContextHoverHide(CUtlVector< KeyValues* >& msglist);
#if defined( VGUI_USEDRAGDROP )
virtual DragDrop_t* GetDragDropInfo();
#endif
virtual void OnGetAdditionalDragPanels(CUtlVector< Panel* >& dragabbles);
virtual void OnCreateDragData(KeyValues* msg);
virtual bool IsDroppable(CUtlVector< KeyValues* >& msglist);
virtual void OnDraggablePanelPaint();
virtual void OnDroppablePanelPaint(CUtlVector< KeyValues* >& msglist, CUtlVector< Panel* >& dragPanels);
virtual void OnPanelDropped(CUtlVector< KeyValues* >& msglist);
virtual void OnPanelEnteredDroppablePanel(CUtlVector< KeyValues* >& msglist);
virtual void OnPanelExitedDroppablePanel(CUtlVector< KeyValues* >& msglist);
virtual Panel* GetDropTarget(CUtlVector< KeyValues* >& msglist);
virtual Panel* GetDragPanel();
virtual bool IsBeingDragged();
virtual HCursor GetDropCursor(CUtlVector< KeyValues* >& msglist);
virtual HCursor GetDragFailCursor(CUtlVector< KeyValues* >& msglist) { return dc_no; }
Color GetDropFrameColor();
Color GetDragFrameColor();
virtual bool CanStartDragging(int startx, int starty, int mx, int my);
virtual void FillRectSkippingPanel(const Color clr, int x, int y, int w, int h, Panel* skipPanel);
virtual int GetPaintBackgroundType();
virtual void GetCornerTextureSize(int& w, int& h);
bool IsChildOfModalSubTree();
bool IsChildOfSurfaceModalPanel();
bool ShouldHandleInputMessage();
virtual void SetSkipChildDuringPainting(Panel* child);
void SetStartDragWhenMouseExitsPanel(bool state);
bool IsStartDragWhenMouseExitsPanel() const;
void SetMessageContextId_R(int nContextID);
void PostMessageToAllSiblings(KeyValues* msg, float delaySeconds = 0.0f);
template< class S >
void PostMessageToAllSiblingsOfType(KeyValues* msg, float delaySeconds = 0.0f);
void SetConsoleStylePanel(bool bConsoleStyle);
bool IsConsoleStylePanel() const;
enum NAV_DIRECTION { ND_UP, ND_DOWN, ND_LEFT, ND_RIGHT, ND_BACK, ND_NONE };
virtual Panel* NavigateUp();
virtual Panel* NavigateDown();
virtual Panel* NavigateLeft();
virtual Panel* NavigateRight();
virtual void NavigateTo();
virtual void NavigateFrom();
virtual void NavigateToChild(Panel* pNavigateTo);
Panel* SetNavUp(Panel* navUp);
Panel* SetNavDown(Panel* navDown);
Panel* SetNavLeft(Panel* navLeft);
Panel* SetNavRight(Panel* navRight);
NAV_DIRECTION GetLastNavDirection();
MESSAGE_FUNC_CHARPTR(OnNavigateTo, "OnNavigateTo", panelName);
MESSAGE_FUNC_CHARPTR(OnNavigateFrom, "OnNavigateFrom", panelName);
protected:
virtual void OnStartDragging();
virtual void OnContinueDragging();
virtual void OnFinishDragging(bool mousereleased, MouseCode code, bool aborted = false);
virtual void DragDropStartDragging();
virtual void GetDragData(CUtlVector< KeyValues* >& list);
virtual void CreateDragData();
virtual void PaintTraverse(bool Repaint, bool allowForce = true);
protected:
MESSAGE_FUNC_ENUM_ENUM(OnRequestFocus, "OnRequestFocus", VPANEL, subFocus, VPANEL, defaultPanel);
MESSAGE_FUNC_INT_INT(OnScreenSizeChanged, "OnScreenSizeChanged", oldwide, oldtall);
virtual void* QueryInterface(EInterfaceID id);
void AddToOverridableColors(Color* pColor, char const* scriptname)
{
int iIdx = m_OverridableColorEntries.AddToTail();
m_OverridableColorEntries[iIdx].m_pszScriptName = scriptname;
m_OverridableColorEntries[iIdx].m_pColor = pColor;
m_OverridableColorEntries[iIdx].m_bOverridden = false;
}
void ApplyOverridableColors(IScheme* pScheme);
void SetOverridableColor(Color* pColor, const Color& newColor);
protected:
void SetNavUp(const char* controlName);
void SetNavDown(const char* controlName);
void SetNavLeft(const char* controlName);
void SetNavRight(const char* controlName);
public:
Panel* GetNavUp(Panel* first = NULL);
Panel* GetNavDown(Panel* first = NULL);
Panel* GetNavLeft(Panel* first = NULL);
Panel* GetNavRight(Panel* first = NULL);
inline void SetWorldPositionCurrentFrame(bool bWorldPositionCurrentFrame) { m_bWorldPositionCurrentFrame = bWorldPositionCurrentFrame; }
inline bool GetWorldPositionCurrentFrame() { return m_bWorldPositionCurrentFrame; }
protected:
Panel* GetNavUpPanel();
Panel* GetNavDownPanel();
Panel* GetNavLeftPanel();
Panel* GetNavRightPanel();
bool m_PassUnhandledInput;
NAV_DIRECTION m_LastNavDirection;
void InternalInitDefaultValues(PanelAnimationMap* map);
private:
enum BuildModeFlags_t
{
BUILDMODE_EDITABLE = 0x01,
BUILDMODE_DELETABLE = 0x02,
BUILDMODE_SAVE_XPOS_RIGHTALIGNED = 0x04,
BUILDMODE_SAVE_XPOS_CENTERALIGNED = 0x08,
BUILDMODE_SAVE_YPOS_BOTTOMALIGNED = 0x10,
BUILDMODE_SAVE_YPOS_CENTERALIGNED = 0x20,
BUILDMODE_SAVE_WIDE_FULL = 0x40,
BUILDMODE_SAVE_TALL_FULL = 0x80,
BUILDMODE_SAVE_PROPORTIONAL_TO_PARENT = 0x100,
BUILDMODE_SAVE_PERCENTAGE = 0x200,
};
enum PanelFlags_t
{
MARKED_FOR_DELETION = 0x0001,
NEEDS_REPAINT = 0x0002,
PAINT_BORDER_ENABLED = 0x0004,
PAINT_BACKGROUND_ENABLED = 0x0008,
PAINT_ENABLED = 0x0010,
POST_CHILD_PAINT_ENABLED = 0x0020,
AUTODELETE_ENABLED = 0x0040,
NEEDS_LAYOUT = 0x0080,
NEEDS_SCHEME_UPDATE = 0x0100,
NEEDS_DEFAULT_SETTINGS_APPLIED = 0x0200,
#if defined( VGUI_USEKEYBINDINGMAPS )
ALLOW_CHAIN_KEYBINDING_TO_PARENT = 0x0400,
#endif
IN_PERFORM_LAYOUT = 0x0800,
IS_PROPORTIONAL = 0x1000,
TRIPLE_PRESS_ALLOWED = 0x2000,
DRAG_REQUIRES_PANEL_EXIT = 0x4000,
IS_MOUSE_DISABLED_FOR_THIS_PANEL_ONLY = 0x8000,
ALL_FLAGS = 0xFFFF,
};
virtual Panel* GetPanel() { return this; }
void Think();
void PerformApplySchemeSettings();
void InternalPerformLayout();
void InternalSetCursor();
MESSAGE_FUNC_INT_INT(InternalCursorMoved, "CursorMoved", xpos, ypos);
MESSAGE_FUNC(InternalCursorEntered, "CursorEntered");
MESSAGE_FUNC(InternalCursorExited, "CursorExited");
MESSAGE_FUNC_INT(InternalMousePressed, "MousePressed", code);
MESSAGE_FUNC_INT(InternalMouseDoublePressed, "MouseDoublePressed", code);
MESSAGE_FUNC_INT(InternalMouseTriplePressed, "MouseTriplePressed", code);
MESSAGE_FUNC_INT(InternalMouseReleased, "MouseReleased", code);
MESSAGE_FUNC_INT(InternalMouseWheeled, "MouseWheeled", delta);
MESSAGE_FUNC_INT(InternalKeyCodePressed, "KeyCodePressed", code);
MESSAGE_FUNC_INT(InternalKeyCodeTyped, "KeyCodeTyped", code);
MESSAGE_FUNC_INT(InternalKeyTyped, "KeyTyped", unichar);
MESSAGE_FUNC_INT(InternalKeyCodeReleased, "KeyCodeReleased", code);
MESSAGE_FUNC(InternalKeyFocusTicked, "KeyFocusTicked");
MESSAGE_FUNC(InternalMouseFocusTicked, "MouseFocusTicked");
MESSAGE_FUNC(InternalInvalidateLayout, "Invalidate");
MESSAGE_FUNC(InternalMove, "Move");
virtual void InternalFocusChanged(bool lost);
void Init(int x, int y, int wide, int tall);
void PreparePanelMap(PanelMap_t* panelMap);
bool InternalRequestInfo(PanelAnimationMap* map, KeyValues* outputData);
bool InternalSetInfo(PanelAnimationMap* map, KeyValues* inputData);
PanelAnimationMapEntry* FindPanelAnimationEntry(char const* scriptname, PanelAnimationMap* map);
void InternalApplySettings(PanelAnimationMap* map, KeyValues* inResourceData);
void ApplyAutoResizeSettings(KeyValues* inResourceData);
void FindDropTargetPanel_R(CUtlVector< VPANEL >& panelList, int x, int y, VPANEL check);
Panel* FindDropTargetPanel();
int GetProportionalScaledValue(int rootTall, int normalizedValue);
#if defined( VGUI_USEDRAGDROP )
DragDrop_t* m_pDragDrop;
Color m_clrDragFrame;
Color m_clrDropFrame;
#endif
BaseTooltip* m_pTooltips;
bool m_bToolTipOverridden;
PHandle m_SkipChild;
long m_lLastDoublePressTime;
HFont m_infoFont;
#if defined( VGUI_USEKEYBINDINGMAPS )
KeyBindingContextHandle_t m_hKeyBindingsContext;
#endif
VPANEL _vpanel;
CUtlString _panelName;
IBorder* _border;
CUtlFlags< unsigned short > _flags;
Dar<HPanel> _actionSignalTargetDar;
CUtlVector<OverridableColorEntry> m_OverridableColorEntries;
Color _fgColor;
Color _bgColor;
HBuildGroup _buildGroup;
short m_nPinDeltaX;
short m_nPinDeltaY;
short m_nResizeDeltaX;
short m_nResizeDeltaY;
HCursor _cursor;
unsigned short _buildModeFlags;
byte _pinCorner : 4;
byte _autoResizeDirection : 4;
GCC_DIAG_PUSH_OFF(overflow)
DECLARE_DMXELEMENT_BITFIELD(_pinCorner, byte, Panel)
DECLARE_DMXELEMENT_BITFIELD(_autoResizeDirection, byte, Panel)
GCC_DIAG_POP()
unsigned char _tabPosition;
HScheme m_iScheme;
bool m_bIsDMXSerialized : 1;
bool m_bUseSchemeColors : 1;
bool m_bIsSilent : 1;
bool m_bIsConsoleStylePanel : 1;
DECLARE_DMXELEMENT_BITFIELD(m_bUseSchemeColors, bool, Panel)
DECLARE_DMXELEMENT_BITFIELD(m_bIsSilent, bool, Panel)
char* _pinToSibling;
byte _pinToSiblingCorner;
byte _pinCornerToSibling;
PHandle m_pinSibling;
char* _tooltipText;
PHandle m_hMouseEventHandler;
bool m_bWorldPositionCurrentFrame;
CUtlSymbol m_sBorderName;
protected:
CUtlString m_sNavUpName;
PHandle m_NavUp;
CUtlString m_sNavDownName;
PHandle m_NavDown;
CUtlString m_sNavLeftName;
PHandle m_NavLeft;
CUtlString m_sNavRightName;
PHandle m_NavRight;
protected:
static int s_NavLock;
private:
CPanelAnimationVar(float, m_flAlpha, "alpha", "255");
CPanelAnimationVar(int, m_nPaintBackgroundType, "PaintBackgroundType", "0");
CPanelAnimationVarAliasType(int, m_nBgTextureId1, "Texture1", "vgui/hud/800corner1", "textureid");
CPanelAnimationVarAliasType(int, m_nBgTextureId2, "Texture2", "vgui/hud/800corner2", "textureid");
CPanelAnimationVarAliasType(int, m_nBgTextureId3, "Texture3", "vgui/hud/800corner3", "textureid");
CPanelAnimationVarAliasType(int, m_nBgTextureId4, "Texture4", "vgui/hud/800corner4", "textureid");
unsigned char m_roundedCorners;
friend class BuildGroup;
friend class BuildModeDialog;
friend class PHandle;
void OnOldMessage(KeyValues* params, VPANEL ifromPanel);
public:
virtual void GetSizerMinimumSize(int& wide, int& tall);
virtual void GetSizerClientArea(int& x, int& y, int& wide, int& tall);
CSizerBase* GetSizer();
void SetSizer(CSizerBase* pSizer);
protected:
CSizerBase* m_pSizer;
};
inline void Panel::DisableMouseInputForThisPanel(bool bDisable)
{
_flags.SetFlag(IS_MOUSE_DISABLED_FOR_THIS_PANEL_ONLY, bDisable);
}
inline bool Panel::IsMouseInputDisabledForThisPanel() const
{
return _flags.IsFlagSet(IS_MOUSE_DISABLED_FOR_THIS_PANEL_ONLY);
}
template< class S >
inline void Panel::PostMessageToAllSiblingsOfType(KeyValues* msg, float delaySeconds )
{
Panel* parent = GetParent();
if (parent)
{
int nChildCount = parent->GetChildCount();
for (int i = 0; i < nChildCount; ++i)
{
Panel* sibling = parent->GetChild(i);
if (sibling == this)
continue;
if (dynamic_cast<S*>(sibling))
{
PostMessage(sibling->GetVPanel(), msg->MakeCopy(), delaySeconds);
}
}
}
msg->deleteThis();
}
}
#endif

View File

@ -1,153 +0,0 @@
#ifndef PANELANIMATIONVAR_H
#define PANELANIMATIONVAR_H
#ifdef _WIN32
#pragma once
#endif
#include "utlvector.h"
#include "Panel.h"
#define DECLARE_PANELANIMATION( className ) \
static void AddToAnimationMap( char const *scriptname, char const *type, char const *var, \
char const *defaultvalue, bool array, PANELLOOKUPFUNC func ) \
{ \
PanelAnimationMap *map = FindOrAddPanelAnimationMap( GetPanelClassName() ); \
\
PanelAnimationMapEntry entry; \
entry.m_pszScriptName = scriptname; \
entry.m_pszVariable = var; \
entry.m_pszType = type; \
entry.m_pszDefaultValue = defaultvalue; \
entry.m_pfnLookup = func; \
entry.m_bArray = array; \
\
map->entries.AddToTail( entry ); \
} \
\
static void ChainToAnimationMap( void ) \
{ \
static bool chained = false; \
if ( chained ) \
return; \
chained = true; \
PanelAnimationMap *map = FindOrAddPanelAnimationMap( GetPanelClassName() ); \
map->pfnClassName = GetPanelClassName; \
if ( map && GetPanelBaseClassName() && GetPanelBaseClassName()[0] ) \
{ \
map->baseMap = FindOrAddPanelAnimationMap( GetPanelBaseClassName() ); \
} \
} \
\
class className##_Register; \
friend class className##_Register; \
class className##_Register \
{ \
public: \
className##_Register() \
{ \
className::ChainToAnimationMap(); \
} \
}; \
className##_Register m_RegisterAnimationClass; \
\
virtual PanelAnimationMap *GetAnimMap() \
{ \
return FindOrAddPanelAnimationMap( GetPanelClassName() ); \
}
typedef void* (*PANELLOOKUPFUNC)(vgui::Panel* panel);
#define CPanelAnimationVarAliasType( type, name, scriptname, defaultvalue, typealias ) \
class PanelAnimationVar_##name; \
friend class PanelAnimationVar_##name; \
static void *GetVar_##name( vgui::Panel *panel ) \
{ \
return &(( ThisClass *)panel)->name; \
} \
class PanelAnimationVar_##name \
{ \
public: \
static void InitVar() \
{ \
static bool bAdded = false; \
if ( !bAdded ) \
{ \
bAdded = true; \
AddToAnimationMap( scriptname, typealias, #name, defaultvalue, false, ThisClass::GetVar_##name ); \
} \
} \
PanelAnimationVar_##name() \
{ \
PanelAnimationVar_##name::InitVar(); \
} \
}; \
PanelAnimationVar_##name m_##name##_register; \
type name;
#define CPanelAnimationVar( type, name, scriptname, defaultvalue ) \
CPanelAnimationVarAliasType( type, name, scriptname, defaultvalue, #type )
#define CPanelAnimationStringVarAliasType( count, name, scriptname, defaultvalue, typealias ) \
class PanelAnimationVar_##name; \
friend class PanelAnimationVar_##name; \
static void *GetVar_##name( vgui::Panel *panel ) \
{ \
return &(( ThisClass *)panel)->name; \
} \
class PanelAnimationVar_##name \
{ \
public: \
static void InitVar() \
{ \
static bool bAdded = false; \
if ( !bAdded ) \
{ \
bAdded = true; \
AddToAnimationMap( scriptname, typealias, #name, defaultvalue, true, ThisClass::GetVar_##name ); \
} \
} \
PanelAnimationVar_##name() \
{ \
PanelAnimationVar_##name::InitVar(); \
} \
}; \
PanelAnimationVar_##name m_##name##_register; \
char name[ count ];
#define CPanelAnimationStringVar( count, name, scriptname, defaultvalue ) \
CPanelAnimationStringVarAliasType( count, name, scriptname, defaultvalue, "string" )
struct PanelAnimationMapEntry
{
char const* name() { return m_pszScriptName; }
char const* type() { return m_pszType; }
char const* defaultvalue() { return m_pszDefaultValue; }
bool isarray() { return m_bArray; }
char const* m_pszScriptName;
char const* m_pszVariable;
char const* m_pszType;
char const* m_pszDefaultValue;
bool m_bArray;
PANELLOOKUPFUNC m_pfnLookup;
};
struct PanelAnimationMap
{
PanelAnimationMap()
{
baseMap = NULL;
pfnClassName = NULL;
}
CUtlVector< PanelAnimationMapEntry > entries;
PanelAnimationMap* baseMap;
char const* (*pfnClassName)(void);
};
PanelAnimationMap* FindPanelAnimationMap(char const* className);
PanelAnimationMap* FindOrAddPanelAnimationMap(char const* className);
void PanelAnimationDumpVars(char const* className);
#endif

View File

@ -1,210 +0,0 @@
#ifndef PARTICLESPHERERENDERER_H
#define PARTICLESPHERERENDERER_H
#ifdef _WIN32
#pragma once
#endif
#include "particlemgr.h"
#include "particle_util.h"
class CParticleSphereRenderer
{
public:
CParticleSphereRenderer();
void Init(CParticleMgr* pParticleMgr, IMaterial* pMaterial);
void StartRender(VMatrix& effectMatrix);
void RenderParticle(
ParticleDraw* pDraw,
const Vector& vOriginalPos,
const Vector& vTransformedPos,
float flAlpha,
float flParticleSize,
float flAngle = 0.0f);
void RenderParticle_AddColor(
ParticleDraw* pDraw,
const Vector& vOriginalPos,
const Vector& vTransformedPos,
float flAlpha,
float flParticleSize,
const Vector& vToAdd0to1
);
const Vector& GetBaseColor() const;
void SetBaseColor(const Vector& vColor);
const CParticleLightInfo& GetAmbientLight() const;
void SetAmbientLight(const CParticleLightInfo& info);
const CParticleLightInfo& GetDirectionalLight() const;
void SetDirectionalLight(const CParticleLightInfo& info);
private:
void AddLightColor(
Vector const* pPos,
Vector const* pLightPos,
Vector const* pLightColor,
float flLightIntensity,
Vector* pOutColor);
inline void ClampColor(Vector& vColor);
private:
int m_iLastTickStartRenderCalled;
CParticleMgr* m_pParticleMgr;
Vector m_vBaseColor;
CParticleLightInfo m_AmbientLight;
CParticleLightInfo m_DirectionalLight;
bool m_bUsingPixelShaders;
};
inline void CParticleSphereRenderer::AddLightColor(
Vector const* pPos,
Vector const* pLightPos,
Vector const* pLightColor,
float flLightIntensity,
Vector* pOutColor)
{
if (flLightIntensity)
{
float fDist = pPos->DistToSqr(*pLightPos);
float fAmt;
if (fDist > 0.0001f)
fAmt = flLightIntensity / fDist;
else
fAmt = 1000.f;
*pOutColor += *pLightColor * fAmt;
}
}
inline void CParticleSphereRenderer::ClampColor(Vector& vColor)
{
float flMax = MAX(vColor.x, MAX(vColor.y, vColor.z));
if (flMax > 1)
{
vColor *= 255.0f / flMax;
}
else
{
vColor *= 255.0;
}
}
inline const Vector& CParticleSphereRenderer::GetBaseColor() const
{
return m_vBaseColor;
}
inline void CParticleSphereRenderer::SetBaseColor(const Vector& vColor)
{
m_vBaseColor = vColor;
}
inline const CParticleLightInfo& CParticleSphereRenderer::GetAmbientLight() const
{
return m_AmbientLight;
}
inline void CParticleSphereRenderer::SetAmbientLight(const CParticleLightInfo& info)
{
m_AmbientLight = info;
}
inline const CParticleLightInfo& CParticleSphereRenderer::GetDirectionalLight() const
{
return m_DirectionalLight;
}
inline void CParticleSphereRenderer::SetDirectionalLight(const CParticleLightInfo& info)
{
m_DirectionalLight = info;
}
inline void CParticleSphereRenderer::RenderParticle(
ParticleDraw* pDraw,
const Vector& vOriginalPos,
const Vector& vTransformedPos,
float flAlpha,
float flParticleSize,
float flAngle)
{
#ifdef _DEBUG
if (pDraw->GetMeshBuilder())
{
Assert(m_iLastTickStartRenderCalled == gpGlobals->tickcount);
}
#endif
Vector vColor = m_vBaseColor;
AddLightColor(&vOriginalPos, &m_AmbientLight.m_vPos, &m_AmbientLight.m_vColor, m_AmbientLight.m_flIntensity, &vColor);
if (!m_bUsingPixelShaders)
{
AddLightColor(&vOriginalPos, &m_DirectionalLight.m_vPos, &m_DirectionalLight.m_vColor, m_DirectionalLight.m_flIntensity, &vColor);
}
ClampColor(vColor);
RenderParticle_Color255SizeNormalAngle(
pDraw,
vTransformedPos,
vColor,
flAlpha,
flParticleSize,
vec3_origin,
flAngle);
}
inline void CParticleSphereRenderer::RenderParticle_AddColor(
ParticleDraw* pDraw,
const Vector& vOriginalPos,
const Vector& vTransformedPos,
float flAlpha,
float flParticleSize,
const Vector& vToAdd0to1
)
{
#ifdef _DEBUG
if (pDraw->GetMeshBuilder())
{
Assert(m_iLastTickStartRenderCalled == gpGlobals->tickcount);
}
#endif
Vector vColor = m_vBaseColor + vToAdd0to1;
AddLightColor(&vOriginalPos, &m_AmbientLight.m_vPos, &m_AmbientLight.m_vColor, m_AmbientLight.m_flIntensity, &vColor);
if (!m_bUsingPixelShaders)
{
AddLightColor(&vOriginalPos, &m_DirectionalLight.m_vPos, &m_DirectionalLight.m_vColor, m_DirectionalLight.m_flIntensity, &vColor);
}
ClampColor(vColor);
RenderParticle_Color255Size(
pDraw,
vTransformedPos,
vColor,
flAlpha,
flParticleSize);
}
#endif

View File

@ -1,76 +0,0 @@
#include "PatternScan.hpp"
DWORD WaitOnModuleHandle(std::string moduleName)
{
DWORD ModuleHandle = NULL;
while (!ModuleHandle)
{
ModuleHandle = (DWORD)GetModuleHandle(moduleName.c_str());
if (!ModuleHandle)
Sleep(50);
}
return ModuleHandle;
}
DWORD FindPatternV2(std::string moduleName, std::string pattern)
{
const char* pat = pattern.c_str();
DWORD firstMatch = 0;
DWORD rangeStart = (DWORD)GetModuleHandleA(moduleName.c_str());
MODULEINFO miModInfo; GetModuleInformation(GetCurrentProcess(), (HMODULE)rangeStart, &miModInfo, sizeof(MODULEINFO));
DWORD rangeEnd = rangeStart + miModInfo.SizeOfImage;
for (DWORD pCur = rangeStart; pCur < rangeEnd; pCur++)
{
if (!*pat)
return firstMatch;
if (*(PBYTE)pat == '\?' || *(BYTE*)pCur == getByte(pat))
{
if (!firstMatch)
firstMatch = pCur;
if (!pat[2])
return firstMatch;
if (*(PWORD)pat == '\?\?' || *(PBYTE)pat != '\?')
pat += 3;
else
pat += 2;
}
else
{
pat = pattern.c_str();
firstMatch = 0;
}
}
return NULL;
}
bool bCompare(const BYTE* Data, const BYTE* Mask, const char* szMask)
{
for (; *szMask; ++szMask, ++Mask, ++Data)
{
if (*szMask == 'x' && *Mask != *Data)
{
return false;
}
}
return (*szMask) == 0;
}
DWORD FindPattern(std::string moduleName, BYTE* Mask, char* szMask)
{
DWORD Address = WaitOnModuleHandle(moduleName.c_str());
MODULEINFO ModInfo; GetModuleInformation(GetCurrentProcess(), (HMODULE)Address, &ModInfo, sizeof(MODULEINFO));
DWORD Length = ModInfo.SizeOfImage;
for (DWORD c = 0; c < Length; c += 1)
{
if (bCompare((BYTE*)(Address + c), Mask, szMask))
{
return (DWORD)(Address + c);
}
}
return 0;
}

View File

@ -1,20 +0,0 @@
#ifndef PATTERNSCAN
#define PATTERNSCAN
#pragma once
#include <Windows.h>
#include <Psapi.h>
#include <string>
#define INRANGE(x,a,b) (x >= a && x <= b)
#define getBits( x ) (INRANGE((x&(~0x20)),'A','F') ? ((x&(~0x20)) - 'A' + 0xa) : (INRANGE(x,'0','9') ? x - '0' : 0))
#define getByte( x ) (getBits(x[0]) << 4 | getBits(x[1]))
DWORD WaitOnModuleHandle(std::string moduleName);
DWORD FindPatternV2(std::string moduleName, std::string pattern);
bool bCompare(const BYTE* Data, const BYTE* Mask, const char* szMask);
DWORD FindPattern(std::string moduleName, BYTE* Mask, char* szMask);
#endif

View File

@ -1,207 +0,0 @@
#include "PlayerInventory.hpp"
void CSharedObjectTypeCache::AddObject(void* obj)
{
typedef void(__thiscall* tOriginal)(void*, void*);
getvfunc<tOriginal>(this, 1)(this, obj);
}
void CSharedObjectTypeCache::RemoveObject(void* obj)
{
typedef void(__thiscall* tOriginal)(void*, void*);
getvfunc<tOriginal>(this, 3)(this, obj);
}
std::vector<CEconItem*> CSharedObjectTypeCache::GetEconItems()
{
std::vector<CEconItem*> ret;
auto size = *reinterpret_cast<size_t*>(this + 0x18);
auto data = *reinterpret_cast<uintptr_t**>(this + 0x4);
for (size_t i = 0; i < size; i++)
ret.push_back(reinterpret_cast<CEconItem*>(data[i]));
return ret;
}
template<typename TYPE>
void CEconItem::SetAttributeValue(int index, TYPE val)
{
auto v15 = (DWORD*)GetItemSchema();
auto v16 = *(DWORD*)(v15[72] + 4 * index);
static auto fnSetDynamicAttributeValue
= reinterpret_cast<int(__thiscall*)(CEconItem*, DWORD, void*)>(
FindPatternV2("client.dll", "55 8B EC 83 E4 F8 83 EC 3C 53 8B 5D 08 56 57 6A 00")
);
fnSetDynamicAttributeValue(this, v16, &val);
}
int C_EconItemDefinition::get_equipped_position()
{
return *reinterpret_cast<int*>(reinterpret_cast<uintptr_t>(this) + 0x24C);
}
const char* C_EconItemDefinition::get_world_model_name()
{
return *reinterpret_cast<const char**>(uintptr_t(this) + 0x9C);
}
uint32_t* CEconItem::GetAccountID()
{
return reinterpret_cast<uint32_t*>(this + 0x1C);
}
uint64_t* CEconItem::GetItemID()
{
return reinterpret_cast<uint64_t*>(this + 0x8);
}
uint64_t* CEconItem::GetOriginalID()
{
return reinterpret_cast<uint64_t*>(this + 0x10);
}
uint16_t* CEconItem::GetDefIndex()
{
return reinterpret_cast<uint16_t*>(this + 0x24);
}
uint32_t* CEconItem::GetInventory()
{
return reinterpret_cast<uint32_t*>(this + 0x20);
}
unsigned char* CEconItem::GetFlags()
{
return reinterpret_cast<unsigned char*>(this + 0x30);
}
unsigned short* CEconItem::GetEconItemData()
{
return reinterpret_cast<unsigned short*>(this + 0x26);
}
C_EconItemDefinition* C_EconItemView::get_static_data()
{
static auto fn = reinterpret_cast<C_EconItemDefinition * (__thiscall*)(void*)>(FindPatternV2("client.dll", "55 8B EC 51 53 8B D9 8B ? ? ? ? ? 56 57 8B ? ? ? ? ? 85 FF 74 16"));
return fn(this);
}
CEconItem* C_EconItemView::get_soc_data()
{
static auto fn = reinterpret_cast<CEconItem * (__thiscall*)(C_EconItemView*)>(FindPatternV2("client.dll", "55 8B EC 83 E4 F0 83 EC 18 56 8B F1 57 8B 86"));
return fn(this);
}
void CPlayerInventory::RemoveItem(uint64_t ID)
{
static auto fnRemoveItem
= reinterpret_cast<int(__thiscall*)(void*, int64_t)>(
FindPatternV2("client.dll", "55 8B EC 83 E4 F8 56 57 FF 75 0C 8B F1")
);
fnRemoveItem(this, ID);
}
CSharedObjectTypeCache* CPlayerInventory::GetBaseTypeCache()
{
static auto fnGCSDK_CGCClient_FindSOCache
= reinterpret_cast<uintptr_t(__thiscall*)(uintptr_t, uint64_t, uint64_t, bool)>(
FindPatternV2("client.dll", "55 8B EC 83 E4 F8 83 EC 1C 0F 10 45 08")
);
static auto fnGCSDK_CSharedObjectCache_CreateBaseTypeCache
= reinterpret_cast<CSharedObjectTypeCache * (__thiscall*)(uintptr_t, int)>(
FindPatternV2("client.dll", "55 8B EC 51 53 56 8B D9 8D 45 08")
);
static auto g_GCClientSystem = **reinterpret_cast<uintptr_t**>(FindPatternV2("client.dll", "8B 0D ? ? ? ? 6A 00 83 EC 10") + 0x2);
auto SOCahce = fnGCSDK_CGCClient_FindSOCache(g_GCClientSystem + 0x60, *reinterpret_cast<uint64_t*>(this + 0x8), *reinterpret_cast<uint64_t*>(this + 0x10), 0);
return fnGCSDK_CSharedObjectCache_CreateBaseTypeCache(SOCahce, 1);
}
void CPlayerInventory::RemoveItem(CEconItem* item)
{
RemoveItem(*item->GetItemID());
GetBaseTypeCache()->RemoveObject(item);
}
void CPlayerInventory::ClearInventory()
{
auto BaseTypeCache = this->GetBaseTypeCache();
auto items = BaseTypeCache->GetEconItems();
for (auto item : items)
{
RemoveItem(*item->GetItemID());
BaseTypeCache->RemoveObject(item);
}
}
uint32_t CPlayerInventory::GetSteamID()
{
return *reinterpret_cast<uint32_t*>(this + 0x8);
}
CUtlVector< C_EconItemView* >* CPlayerInventory::GetInventoryItems()
{
return reinterpret_cast<CUtlVector<C_EconItemView*>*>(this + 0x2C);
}
bool CPlayerInventory::AddEconItem(CEconItem* item, int a3, int a4, char a5)
{
static auto fnAddEconItem
= reinterpret_cast<C_EconItemView * (__thiscall*)(void*, CEconItem*, int, int, char)>(
FindPatternV2("client.dll", "55 8B EC 83 E4 F8 A1 ? ? ? ? 83 EC 14 53 56 57 8B F9 8B 08")
);
GetBaseTypeCache()->AddObject(item);
auto ret = fnAddEconItem(this, item, a3, a4, a5);
return ret;
}
CPlayerInventory* CSInventoryManager::GetLocalPlayerInventory()
{
static auto local_inventory_offset = *reinterpret_cast<uintptr_t*>(FindPatternV2("client.dll", "8B 8B ? ? ? ? E8 ? ? ? ? 89 44 24 18") + 0x2);
return *reinterpret_cast<CPlayerInventory**>(this + local_inventory_offset);
}
CEconItem* CreateEconItem()
{
static auto fnCreateSharedObjectSubclass_EconItem_
= reinterpret_cast<CEconItem * (__stdcall*)()>(
*reinterpret_cast<uintptr_t*>(FindPatternV2("client.dll", "C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? E8 ? ? ? ? 83 F8 FF 75 09 8D 45 E4 50 E8 ? ? ? ? 8D 45 E4 C7 45 ? ? ? ? ? 50 C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? E8 ? ? ? ? 83 F8 FF 75 09 8D 45 E4 50 E8 ? ? ? ? 8D 45 E4 C7 45 ? ? ? ? ? 50 C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? E8 ? ? ? ? 83 F8 FF 75 09 8D 45 E4 50 E8 ? ? ? ? 8D 45 E4 C7 45 ? ? ? ? ? 50 C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? C7 45 ? ? ? ? ? E8 ? ? ? ? 83 F8 FF 75 09 8D 45 E4 50 E8 ? ? ? ? 8D 45 E4") + 3)
);
return fnCreateSharedObjectSubclass_EconItem_();
}
uintptr_t GetItemSchema()
{
static auto fnGetItemSchema
= reinterpret_cast<uintptr_t(__stdcall*)()>(
FindPatternV2("client.dll", "A1 ? ? ? ? 85 C0 75 53")
);
return fnGetItemSchema();
}

View File

@ -1,138 +0,0 @@
#ifndef PLAYERINV
#define PLAYERINV
#pragma once
#include "PatternScan.hpp"
#include "Interfaces.hpp"
#include "utlvector.h"
#include "stdint.h"
#include <vector>
#include "icliententity.h"
enum ItemQuality
{
ITEM_QUALITY_DEFAULT,
ITEM_QUALITY_GENUINE,
ITEM_QUALITY_VINTAGE,
ITEM_QUALITY_UNUSUAL,
ITEM_QUALITY_SKIN,
ITEM_QUALITY_COMMUNITY,
ITEM_QUALITY_DEVELOPER,
ITEM_QUALITY_SELFMADE,
ITEM_QUALITY_CUSTOMIZED,
ITEM_QUALITY_STRANGE,
ITEM_QUALITY_COMPLETED,
ITEM_QUALITY_UNK2,
ITEM_QUALITY_TOURNAMENT
};
enum ItemRarity
{
ITEM_RARITY_DEFAULT,
ITEM_RARITY_COMMON,
ITEM_RARITY_UNCOMMON,
ITEM_RARITY_RARE,
ITEM_RARITY_MYTHICAL,
ITEM_RARITY_LEGENDARY,
ITEM_RARITY_ANCIENT,
ITEM_RARITY_IMMORTAL
};
class CEconItem
{
unsigned short* GetEconItemData();
void UpdateEquippedState(unsigned int state);
public:
uint32_t* GetInventory();
uint32_t* GetAccountID();
uint16_t* GetDefIndex();
uint64_t* GetItemID();
uint64_t* GetOriginalID();
unsigned char* GetFlags();
void SetQuality(ItemQuality quality);
void SetRarity(ItemRarity rarity);
void SetOrigin(int origin);
void SetLevel(int level);
void SetInUse(bool in_use);
void SetCustomName(const char* name);
void SetCustomDesc(const char* name);
void SetPaintSeed(float seed);
void SetPaintKit(float kit);
void SetPaintWear(float wear);
void SetStatTrak(int val);
void AddSticker(int index, int kit, float wear, float scale, float rotation);
template<typename TYPE>
void SetAttributeValue(int index, TYPE val);
};
class C_EconItemDefinition
{
public:
int get_equipped_position();
const char* get_world_model_name();
};
class C_EconItemView
{
private:
using str_32 = char[32];
public:
int32_t m_bInitialized;
int16_t m_iItemDefinitionIndex;
int32_t m_iEntityLevel;
int32_t m_iAccountID;
int32_t m_iItemIDLow;
int32_t m_iItemIDHigh;
int32_t m_iEntityQuality;
str_32 m_iCustomName;
CUtlVector<IRefCounted*>& m_CustomMaterials();
CUtlVector<IRefCounted*>& m_VisualsDataProcessors();
C_EconItemDefinition* get_static_data();
CEconItem* get_soc_data();
};
class CSharedObjectTypeCache
{
public:
void AddObject(void* obj);
void RemoveObject(void* obj);
std::vector<CEconItem*> GetEconItems();
};
class CPlayerInventory
{
public:
void RemoveItem(uint64_t ID);
void RemoveItem(CEconItem* item);
void ClearInventory();
CSharedObjectTypeCache* GetBaseTypeCache();
uint32_t GetSteamID();
CUtlVector<C_EconItemView*>* GetInventoryItems();
bool AddEconItem(CEconItem* item, int a3, int a4, char a5);
};
class CSInventoryManager
{
public:
CPlayerInventory* GetLocalPlayerInventory();
};
uintptr_t GetItemSchema();
CEconItem* CreateEconItem();
#endif

View File

@ -1,581 +0,0 @@
#pragma once
#include <cstdint>
#include <string>
#include <vector>
#define MAKE_TAG(FIELD_NUMBER, TYPE) static_cast<uint32_t>(((FIELD_NUMBER) << kTagTypeBits) | (TYPE))
#define make_struct(_name_, _size_) \
struct _name_ : ProtoWriter { \
constexpr static size_t MAX_FIELD = _size_; \
_name_() : ProtoWriter(MAX_FIELD) {} \
_name_(void* data, size_t size) : ProtoWriter(data, size, MAX_FIELD) {} \
_name_(std::string data) : ProtoWriter(data, MAX_FIELD) {}
#define make_field(_name_, _id_, _type_) \
constexpr static Tag _name_ = { _id_, _type_ }; \
void clear_##_name_() { this->clear(_name_); } \
bool has_##_name_() { return this->has(_name_); } \
Field get_##_name_() { return this->get(_name_); } \
std::vector<Field> getAll_##_name_() { return this->getAll(_name_); } \
\
void add_##_name_(std::string v) { this->add(_name_, v); } \
template<typename T> void add_##_name_(T v) { this->add(_name_, v); } \
void replace_##_name_(std::string v) { this->replace(_name_, v); } \
void replace_##_name_(std::string v, uint32_t index) { this->replace(_name_, v, index); } \
template<typename T> void replace_##_name_(T v) { this->replace(_name_, v); } \
template<typename T> void replace_##_name_(T v, uint32_t index) { this->replace(_name_, v, index); } \
template<class T> T get_##_name_() { return std::move( T(this->get(_name_).String()) ); }
struct Tag
{
unsigned field;
unsigned type;
};
enum FieldType {
TYPE_DOUBLE = 1,
TYPE_FLOAT = 2,
TYPE_INT64 = 3,
TYPE_UINT64 = 4,
TYPE_INT32 = 5,
TYPE_FIXED64 = 6,
TYPE_FIXED32 = 7,
TYPE_BOOL = 8,
TYPE_STRING = 9,
TYPE_GROUP = 10,
TYPE_MESSAGE = 11,
TYPE_BYTES = 12,
TYPE_UINT32 = 13,
TYPE_ENUM = 14,
TYPE_SFIXED32 = 15,
TYPE_SFIXED64 = 16,
TYPE_SINT32 = 17,
TYPE_SINT64 = 18,
MAX_FIELD_TYPE = 18,
};
struct Field
{
friend class ProtoWriter;
public:
inline Field& operator=(const Field& f);
Field() : tag({ 0,0 }), value(""), full("") { }
Field(unsigned field, unsigned type, std::string value, std::string full);
Field(Tag tag, std::string value);
Field(unsigned field, unsigned type, std::string value);
template<typename T>
Field(Tag tag, T value);
template<typename T>
Field(unsigned field, unsigned type, T value);
public:
static Field ReadField(void* data, size_t& bytesRead);
public:
inline float Float();
inline double Double();
inline int32_t Int32();
inline int64_t Int64();
inline uint32_t UInt32();
inline uint64_t UInt64();
inline uint32_t Fixed32();
inline uint64_t Fixed64();
inline int32_t SFixed32();
inline int64_t SFixed64();
inline bool Bool();
inline std::string String();
private:
Tag tag;
std::string value;
std::string full;
static std::string getBytesVarint32(uint32_t value);
static std::string getBytesVarint64(uint64_t value);
static uint32_t readVarUint32(void* data, size_t& bytesRead);
static uint64_t readVarUint64(void* data, size_t& bytesRead);
enum WireType {
WIRETYPE_VARINT = 0,
WIRETYPE_FIXED64 = 1,
WIRETYPE_LENGTH_DELIMITED = 2,
WIRETYPE_START_GROUP = 3,
WIRETYPE_END_GROUP = 4,
WIRETYPE_FIXED32 = 5,
};
constexpr static WireType kWireTypeForFieldType[MAX_FIELD_TYPE + 1] = {
static_cast<WireType>(-1),
WIRETYPE_FIXED64,
WIRETYPE_FIXED32,
WIRETYPE_VARINT,
WIRETYPE_VARINT,
WIRETYPE_VARINT,
WIRETYPE_FIXED64,
WIRETYPE_FIXED32,
WIRETYPE_VARINT,
WIRETYPE_LENGTH_DELIMITED,
WIRETYPE_START_GROUP,
WIRETYPE_LENGTH_DELIMITED,
WIRETYPE_LENGTH_DELIMITED,
WIRETYPE_VARINT,
WIRETYPE_VARINT,
WIRETYPE_FIXED32,
WIRETYPE_FIXED64,
WIRETYPE_VARINT,
WIRETYPE_VARINT,
};
constexpr static int kTagTypeBits = 3;
constexpr static uint32_t kTagTypeMask = (1 << kTagTypeBits) - 1;
constexpr static int kMaxVarintBytes = 10;
constexpr static int kMaxVarint32Bytes = 5;
};
class ProtoWriter
{
public:
inline ProtoWriter();
inline ProtoWriter(size_t maxFields);
inline ProtoWriter(void* data, size_t size, size_t maxFields);
inline ProtoWriter(std::string dataStr, size_t maxFields);
public:
inline void add(Field field);
inline void replace(Field field);
inline void replace(Field field, uint32_t index);
inline void clear(unsigned fieldId);
inline bool has(unsigned fieldId);
inline Field get(unsigned fieldId);
inline std::vector<Field> getAll(unsigned fieldId);
public:
inline void add(Tag tag, std::string value);
inline void replace(Tag tag, std::string value);
inline void replace(Tag tag, std::string value, uint32_t index);
inline void clear(Tag tag);
inline bool has(Tag tag);
inline Field get(Tag tag);
inline std::vector<Field> getAll(Tag tag);
template<typename T>
inline void add(Tag tag, T value);
template<typename T>
inline void replace(Tag tag, T value);
template<typename T>
inline void replace(Tag tag, T value, uint32_t index);
std::string serialize();
void print();
private:
std::vector<std::vector<Field>> fields;
};
#pragma region Helper Functions
std::string Field::getBytesVarint32(uint32_t value)
{
uint8_t bytes[kMaxVarint32Bytes];
int size = 0;
while (value > 0x7F) {
bytes[size++] = (static_cast<uint8_t>(value) & 0x7F) | 0x80;
value >>= 7;
}
bytes[size++] = static_cast<uint8_t>(value) & 0x7F;
return std::string{ reinterpret_cast<const char*>(&bytes[0]), (size_t)size };
}
std::string Field::getBytesVarint64(uint64_t value)
{
uint8_t bytes[kMaxVarintBytes];
int size = 0;
while (value > 0x7F) {
bytes[size++] = (static_cast<uint8_t>(value) & 0x7F) | 0x80;
value >>= 7;
}
bytes[size++] = static_cast<uint8_t>(value) & 0x7F;
return std::string{ reinterpret_cast<const char*>(&bytes[0]), (size_t)size };
}
uint32_t Field::readVarUint32(void* data, size_t& bytesRead)
{
auto ptr = reinterpret_cast<const uint8_t*>(data);
auto value = 0u;
auto bytes = 0u;
do {
value |= static_cast<uint32_t>(*ptr & 0x7f) << (7 * bytes);
bytes++;
} while (*(ptr++) & 0x80 && bytes <= 5);
bytesRead = bytes;
return value;
}
uint64_t Field::readVarUint64(void* data, size_t& bytesRead)
{
auto ptr = reinterpret_cast<const uint8_t*>(data);
auto value = 0ull;
auto bytes = 0u;
do
{
value |= static_cast<uint64_t>(*ptr & 0x7f) << (7 * bytes);
bytes++;
} while (*(ptr++) & 0x80 && bytes <= 10);
bytesRead = bytes;
return value;
}
Field Field::ReadField(void* data, size_t& bytesRead)
{
unsigned field = *reinterpret_cast<uint16_t*>(data);
unsigned type = field & kTagTypeMask;
if (field == 0xffff) {
bytesRead = 0;
return Field();
}
if (field & 0x80) {
field = ((field & 0x7f) | ((field & 0xff00) >> 1)) >> kTagTypeBits;
bytesRead = 2;
}
else {
field = (field & 0xff) >> kTagTypeBits;
bytesRead = 1;
}
size_t length, sizeDelimited;
std::string value, full;
switch (type)
{
case WIRETYPE_VARINT:
readVarUint64((void*)((ptrdiff_t)data + bytesRead), length);
value = std::string{ reinterpret_cast<const char*>((void*)((ptrdiff_t)data + bytesRead)), length };
full = std::string{ reinterpret_cast<const char*>(data), bytesRead + length };
bytesRead += length;
break;
case WIRETYPE_FIXED64:
value = std::string{ reinterpret_cast<const char*>((void*)((ptrdiff_t)data + bytesRead)), 8 };
full = std::string{ reinterpret_cast<const char*>(data), bytesRead + 8 };
bytesRead += 8;
break;
case WIRETYPE_LENGTH_DELIMITED:
sizeDelimited = readVarUint32((void*)((ptrdiff_t)data + bytesRead), length);
value = std::string{ reinterpret_cast<const char*>((void*)((ptrdiff_t)data + bytesRead)), length + sizeDelimited };
full = std::string{ reinterpret_cast<const char*>(data), bytesRead + length + sizeDelimited };
bytesRead += length + sizeDelimited;
break;
case WIRETYPE_START_GROUP:
throw("WIRETYPE_START_GROUP unrealised");
break;
case WIRETYPE_END_GROUP:
throw("WIRETYPE_END_GROUP unrealised");
break;
case WIRETYPE_FIXED32:
value = std::string{ reinterpret_cast<const char*>((void*)((ptrdiff_t)data + bytesRead)), 4 };
full = std::string{ reinterpret_cast<const char*>(data), bytesRead + 4 };
bytesRead += 4;
break;
default:
throw("Unknown type %i", type);
break;
}
return Field(field, type, value, full);
}
#pragma endregion
#pragma region Field Definition
Field& Field::operator=(const Field& f) {
this->tag = f.tag;
this->value = f.value;
this->full = f.full;
return *this;
}
Field::Field(unsigned field, unsigned type, std::string value, std::string full) {
this->tag = { field, type };
this->value = value;
this->full = full;
}
template<typename T>
Field::Field(Tag tag, T value) {
auto wireType = kWireTypeForFieldType[tag.type];
full = getBytesVarint32(MAKE_TAG(tag.field, wireType));
switch (wireType) {
case WIRETYPE_VARINT:
full += getBytesVarint64(static_cast<uint64_t>(value));
break;
case WIRETYPE_FIXED32:
full += std::string{ reinterpret_cast<const char*>(&value), 4 };
break;
case WIRETYPE_FIXED64:
full += std::string{ reinterpret_cast<const char*>(&value), 8 };
break;
}
}
template<typename T>
Field::Field(unsigned field, unsigned type, T value) {
auto wireType = kWireTypeForFieldType[type];
tag = { field, (unsigned)wireType };
full = getBytesVarint32(MAKE_TAG(field, wireType));
switch (wireType) {
case WIRETYPE_VARINT:
full += getBytesVarint64(static_cast<uint64_t>(value));
break;
case WIRETYPE_FIXED32:
full += std::string{ reinterpret_cast<const char*>(&value), 4 };
break;
case WIRETYPE_FIXED64:
full += std::string{ reinterpret_cast<const char*>(&value), 8 };
break;
}
}
Field::Field(Tag tag, std::string value) {
auto wireType = kWireTypeForFieldType[tag.type];
full = getBytesVarint32(MAKE_TAG(tag.field, wireType));
full += getBytesVarint32(value.size());
full += value;
}
Field::Field(unsigned field, unsigned type, std::string value) {
auto wireType = kWireTypeForFieldType[type];
tag = { field, (unsigned)wireType };
full = getBytesVarint32(MAKE_TAG(field, wireType));
full += getBytesVarint32(value.size());
full += value;
}
float Field::Float() {
return *reinterpret_cast<float*>((void*)value.data());
}
double Field::Double() {
return *reinterpret_cast<double*>((void*)value.data());
}
int32_t Field::Int32() {
size_t bytesRead;
return static_cast<int32_t>(readVarUint64((void*)value.data(), bytesRead));
}
int64_t Field::Int64() {
size_t bytesRead;
return readVarUint64((void*)value.data(), bytesRead);
}
uint32_t Field::UInt32() {
size_t bytesRead;
return readVarUint32((void*)value.data(), bytesRead);
}
uint64_t Field::UInt64() {
size_t bytesRead;
return readVarUint64((void*)value.data(), bytesRead);
}
uint32_t Field::Fixed32() {
return *reinterpret_cast<uint32_t*>((void*)value.data());
}
uint64_t Field::Fixed64() {
return *reinterpret_cast<uint64_t*>((void*)value.data());
}
int32_t Field::SFixed32() {
return *reinterpret_cast<int32_t*>((void*)value.data());
}
int64_t Field::SFixed64() {
return *reinterpret_cast<int64_t*>((void*)value.data());
}
bool Field::Bool() {
size_t bytesRead;
return !!readVarUint32((void*)value.data(), bytesRead);
}
std::string Field::String()
{
size_t bytesRead;
void* data = (void*)value.data();
auto length = readVarUint32((void*)value.data(), bytesRead);
auto value = std::string{ reinterpret_cast<const char*>((void*)((ptrdiff_t)data + bytesRead)), length };
return value;
}
#pragma endregion
#pragma region ProtoWriter Definition
ProtoWriter::ProtoWriter()
{
}
ProtoWriter::ProtoWriter(size_t maxFields)
{
size_t vector_size = maxFields + 1;
fields.resize(vector_size);
fields.reserve(vector_size);
}
ProtoWriter::ProtoWriter(void* data, size_t size, size_t maxFields) : ProtoWriter(maxFields)
{
size_t vector_size = maxFields + 1,
pos = 0,
bytesRead;
if (data == nullptr)
return;
while (pos < size) {
auto field = Field::ReadField((void*)((ptrdiff_t)data + pos), bytesRead);
if (!bytesRead) break;
auto index = field.tag.field;
if (index >= vector_size) throw("fields range error: field[%i]", index);
fields[index].push_back(field);
pos += bytesRead;
}
}
ProtoWriter::ProtoWriter(std::string dataStr, size_t maxFields) : ProtoWriter((void*)dataStr.data(), dataStr.size(), maxFields)
{
}
std::string ProtoWriter::serialize()
{
std::string result;
for (auto& f0 : fields) {
for (auto& f1 : f0) {
result += f1.full;
}
}
return result;
}
void ProtoWriter::print()
{
auto data = serialize();
void* mem = (void*)data.data();
size_t size = data.size();
int j = 0;
for (size_t i = 0; i <= size; ++i) {
printf("%.2X ", *(unsigned char*)((uintptr_t)mem + i));
j++;
if (j == 16)
{
j = 0;
printf("\n");
}
}
printf("\n");
}
void ProtoWriter::add(Field field)
{
fields[field.tag.field].push_back(field);
}
void ProtoWriter::replace(Field field)
{
fields[field.tag.field].clear();
fields[field.tag.field].push_back(field);
}
void ProtoWriter::replace(Field field, uint32_t index)
{
fields[field.tag.field][index] = field;
}
void ProtoWriter::clear(unsigned fieldId)
{
return fields[fieldId].clear();
}
bool ProtoWriter::has(unsigned fieldId)
{
return fields[fieldId].size() > 0;
}
Field ProtoWriter::get(unsigned fieldId)
{
if (fields[fieldId].empty())
return Field();
return fields[fieldId][0];
}
std::vector<Field> ProtoWriter::getAll(unsigned fieldId)
{
return fields[fieldId];
}
template<typename T>
void ProtoWriter::add(Tag tag, T value)
{
fields[tag.field].push_back(Field(tag, value));
}
template<typename T>
void ProtoWriter::replace(Tag tag, T value)
{
fields[tag.field].clear();
fields[tag.field].push_back(Field(tag, value));
}
template<typename T>
void ProtoWriter::replace(Tag tag, T value, uint32_t index)
{
fields[tag.field][index] = Field(tag, value);
}
void ProtoWriter::add(Tag tag, std::string value)
{
fields[tag.field].push_back(Field(tag, value));
}
void ProtoWriter::replace(Tag tag, std::string value)
{
fields[tag.field].clear();
fields[tag.field].push_back(Field(tag, value));
}
void ProtoWriter::replace(Tag tag, std::string value, uint32_t index)
{
fields[tag.field][index] = Field(tag, value);
}
void ProtoWriter::clear(Tag tag)
{
return fields[tag.field].clear();
}
bool ProtoWriter::has(Tag tag)
{
return fields[tag.field].size() > 0;
}
Field ProtoWriter::get(Tag tag)
{
if (fields[tag.field].empty())
return Field();
return fields[tag.field][0];
}
std::vector<Field> ProtoWriter::getAll(Tag tag)
{
return fields[tag.field];
}
#pragma endregion

View File

@ -1,105 +0,0 @@
#pragma once
#include "pbwrap.hpp"
#define k_EMsgGCCStrike15_v2_MatchmakingGC2ClientReserve 9107
#define k_EMsgGCClientWelcome 4004
#define k_EMsgGCClientHello 4006
#define k_EMsgGCAdjustItemEquippedState 1059
#define k_EMsgGCCStrike15_v2_MatchmakingClient2GCHello 9109
#define k_EMsgGCCStrike15_v2_MatchmakingGC2ClientHello 9110
#define k_EMsgGCCStrike15_v2_ClientGCRankUpdate 9194
using namespace pbwrap;
struct CMsgClientHello : pbmsg<8> {
PBMSG_CTOR;
PBFIELD(3, types::Uint32, client_session_need);
};
struct MatchmakingGC2ClientHello : pbmsg<20> {
struct PlayerRankingInfo : pbmsg<6> {
PBMSG_CTOR;
PBFIELD(1, types::Uint32, account_id);
PBFIELD(2, types::Uint32, rank_id);
PBFIELD(3, types::Uint32, wins);
PBFIELD(6, types::Uint32, rank_type_id);
};
struct PlayerCommendationInfo : pbmsg<4> {
PBMSG_CTOR;
PBFIELD(1, types::Uint32, cmd_friendly);
PBFIELD(2, types::Uint32, cmd_teaching);
PBFIELD(4, types::Uint32, cmd_leader);
};
PBMSG_CTOR;
PBFIELD(7, PlayerRankingInfo, ranking);
PBFIELD(8, PlayerCommendationInfo, commendation);
PBFIELD(17, types::Int32, player_level);
PBFIELD(18, types::Int32, player_cur_xp);
PBFIELD(4, types::Uint32, penalty_seconds);
PBFIELD(5, types::Uint32, penalty_reason);
PBFIELD(6, types::Int32, vac_banned);
};
struct CMsgGCCStrike15_v2_ClientGCRankUpdate : pbmsg<1> {
PBMSG_CTOR;
PBFIELD(1, MatchmakingGC2ClientHello::PlayerRankingInfo, ranking);
};
struct CSOEconItemEquipped : pbmsg<2> {
PBMSG_CTOR;
PBFIELD(1, types::Int32, new_class);
PBFIELD(2, types::Int32, new_slot);
};
struct CSOEconItemAttribute : pbmsg<3> {
PBMSG_CTOR;
PBFIELD(1, types::Uint32, def_index);
PBFIELD(2, types::Uint32, value);
PBFIELD(3, types::Bytes, value_bytes);
};
struct CSOEconItem : pbmsg<19> {
PBMSG_CTOR;
PBFIELD(1, types::Uint64, id);
PBFIELD(2, types::Uint32, account_id);
PBFIELD(3, types::Uint32, inventory);
PBFIELD(4, types::Int32, def_index);
PBFIELD(5, types::Uint32, quantity);
PBFIELD(6, types::Uint32, level);
PBFIELD(7, types::Uint32, quality);
PBFIELD(8, types::Uint32, flags);
PBFIELD(9, types::Uint32, origin);
PBFIELD(10, types::String, custom_name);
PBFIELD(11, types::String, custom_desc);
PBFIELD(12, CSOEconItemAttribute, attribute);
PBFIELD(14, types::Bool, in_use);
PBFIELD(15, types::Uint32, style);
PBFIELD(16, types::Uint64, original_id);
PBFIELD(18, CSOEconItemEquipped, equipped_state);
PBFIELD(19, types::Uint32, rarity);
};
struct CMsgClientWelcome : pbmsg<11> {
struct SubscribedType : pbmsg<2> {
PBMSG_CTOR;
PBFIELD(1, types::Int32, type_id);
PBFIELD(2, CSOEconItem, object_data);
};
struct CMsgSOCacheSubscribed : pbmsg<4> {
PBMSG_CTOR;
PBFIELD(2, SubscribedType, objects);
};
PBMSG_CTOR;
PBFIELD(3, CMsgSOCacheSubscribed, outofdate_subscribed_caches);
};
struct CMsgAdjustItemEquippedState : pbmsg<4> {
PBMSG_CTOR;
PBFIELD(1, types::Uint64, item_id);
PBFIELD(2, types::Uint32, new_class);
PBFIELD(3, types::Uint32, new_slot);
PBFIELD(4, types::Bool, swap);
};

View File

@ -1,234 +0,0 @@
#ifndef RICHTEXT_H
#define RICHTEXT_H
#ifdef _WIN32
#pragma once
#endif
#include "Panel.h"
#include "utlvector.h"
namespace vgui
{
class ClickPanel;
class RichText : public Panel
{
DECLARE_CLASS_SIMPLE(RichText, Panel);
public:
RichText(Panel* parent, const char* panelName);
~RichText();
virtual void SetText(const char* text);
virtual void SetText(const wchar_t* text);
void GetText(int offset, OUT_Z_BYTECAP(bufLenInBytes) wchar_t* buf, int bufLenInBytes);
void GetText(int offset, OUT_Z_BYTECAP(bufLenInBytes) char* pch, int bufLenInBytes);
void SetFont(HFont font);
void InsertChar(wchar_t ch);
void InsertString(const char* text);
void InsertString(const wchar_t* wszText);
void SelectNone();
void SelectAllText();
void SelectNoText();
MESSAGE_FUNC(CutSelected, "DoCutSelected");
MESSAGE_FUNC(CopySelected, "DoCopySelected");
void SetPanelInteractive(bool bInteractive) { m_bInteractive = bInteractive; }
void SetUnusedScrollbarInvisible(bool bInvis) { m_bUnusedScrollbarInvis = bInvis; }
void GotoTextStart();
void GotoTextEnd();
void SetVerticalScrollbar(bool state);
void SetMaximumCharCount(int maxChars);
void InsertColorChange(Color col);
void InsertIndentChange(int pixelsIndent);
void InsertClickableTextStart(const char* pchClickAction = NULL);
void InsertClickableTextEnd();
void InsertPossibleURLString(const char* text, Color URLTextColor, Color normalTextColor);
void InsertFade(float flSustain, float flLength);
void ResetAllFades(bool bHold, bool bOnlyExpired = false, float flNewSustain = -1.0f);
void SetToFullHeight();
int GetNumLines();
virtual bool RequestInfo(KeyValues* outputData);
virtual void SetFgColor(Color color);
virtual void SetDrawOffsets(int ofsx, int ofsy);
bool IsScrollbarVisible();
void SetURLClickedHandler(Panel* pPanelToHandleClickMsg);
void SetUnderlineFont(HFont font);
bool IsAllTextAlphaZero() const;
bool HasText() const;
void SetDrawTextOnly();
protected:
virtual void OnThink();
virtual void PerformLayout();
virtual void ApplySchemeSettings(IScheme* pScheme);
virtual void Paint();
virtual void ApplySettings(KeyValues* inResourceData);
virtual void GetSettings(KeyValues* outResourceData);
virtual const char* GetDescription(void);
MESSAGE_FUNC_WCHARPTR(OnSetText, "SetText", text);
MESSAGE_FUNC(OnSliderMoved, "ScrollBarSliderMoved");
virtual void OnKillFocus();
virtual void OnMouseWheeled(int delta);
virtual void OnKeyCodeTyped(KeyCode code);
MESSAGE_FUNC_INT(OnClickPanel, "ClickPanel", index);
virtual void OnCursorMoved(int x, int y);
virtual void OnMousePressed(MouseCode code);
virtual void OnMouseDoublePressed(MouseCode code);
virtual void OnMouseReleased(MouseCode code);
virtual void OnMouseFocusTicked();
virtual void OnCursorEntered();
virtual void OnCursorExited();
virtual void OnMouseCaptureLost();
virtual void OnSizeChanged(int newWide, int newTall);
virtual void OnSetFocus();
int ParseTextStringForUrls(const char* text, int startPos, char* pchURLText, int cchURLText, char* pchURL, int cchURL, bool& clickable);
virtual void OnTextClicked(const wchar_t* text);
#ifdef DBGFLAG_VALIDATE
virtual void Validate(CValidator& validator, char* pchName);
#endif
protected:
ScrollBar* _vertScrollBar;
private:
int GetLineHeight();
HFont GetDefaultFont();
const wchar_t* ResolveLocalizedTextAndVariables(char const* pchLookup, OUT_Z_BYTECAP(outbufsizeinbytes) wchar_t* outbuf, size_t outbufsizeinbytes);
void CheckRecalcLineBreaks();
void GotoWordRight();
void GotoWordLeft();
void TruncateTextStream();
bool GetSelectedRange(int& cx0, int& cx1);
void CursorToPixelSpace(int cursorPos, int& cx, int& cy);
int PixelToCursorSpace(int cx, int cy);
void AddAnotherLine(int& cx, int& cy);
void RecalculateDefaultState(int startIndex);
void LayoutVerticalScrollBarSlider();
void OpenEditMenu();
void FinishingURL(int x, int y);
int GetStartDrawIndex(int& lineBreakIndexIndex);
int GetCursorLine();
int GetClickableTextIndexStart(int startIndex);
void CreateEditMenu();
MESSAGE_FUNC_INT(MoveScrollBar, "MoveScrollBar", delta);
MESSAGE_FUNC_INT(MoveScrollBarDirect, "MoveScrollBarDirect", delta);
void InvalidateLineBreakStream();
void RecalculateLineBreaks();
struct TFade
{
float flFadeStartTime;
float flFadeLength;
float flFadeSustain;
int iOriginalAlpha;
};
struct TFormatStream
{
Color color;
int pixelsIndent;
bool textClickable;
CUtlSymbol m_sClickableTextAction;
TFade fade;
int textStreamIndex;
};
bool m_bResetFades;
bool m_bInteractive;
bool m_bUnusedScrollbarInvis;
bool m_bAllTextAlphaIsZero;
CUtlVector<wchar_t> m_TextStream;
CUtlVector<int> m_LineBreaks;
CUtlVector<TFormatStream> m_FormatStream;
bool m_bRecalcLineBreaks;
int _recalculateBreaksIndex;
bool _invalidateVerticalScrollbarSlider;
int _cursorPos;
bool _mouseSelection;
bool _mouseDragSelection;
int _select[2];
int _pixelsIndent;
int _maxCharCount;
HFont _font;
HFont m_hFontUnderline;
Color _selectionColor;
Color _selectionTextColor;
bool _currentTextClickable;
CUtlVector<ClickPanel*> _clickableTextPanels;
int _clickableTextIndex;
Color _defaultTextColor;
int _drawOffsetX;
int _drawOffsetY;
Panel* m_pInterior;
PHandle m_hPanelToHandleClickingURLs;
Menu* m_pEditMenu;
char* m_pszInitialText;
bool _recalcSavedRenderState;
struct TRenderState
{
int x, y;
Color textColor;
int pixelsIndent;
bool textClickable;
int formatStreamIndex;
};
TRenderState m_CachedRenderState;
bool UpdateRenderState(int textStreamPos, TRenderState& renderState);
void CalculateFade(TRenderState& renderState);
void GenerateRenderStateForTextStreamIndex(int textStreamIndex, TRenderState& renderState);
int FindFormatStreamIndexForTextStreamPos(int textStreamIndex);
int DrawString(int iFirst, int iLast, TRenderState& renderState, HFont font);
};
}
#endif

View File

@ -1,28 +0,0 @@
#ifndef SINGLETON
#define SINGLETON
#pragma once
template<typename T>
class Singleton
{
protected:
Singleton() {}
~Singleton() {}
Singleton(const Singleton&) = delete;
Singleton& operator=(const Singleton&) = delete;
Singleton(Singleton&&) = delete;
Singleton& operator=(Singleton&&) = delete;
public:
static T& Get()
{
static T inst{};
return inst;
}
};
#endif

View File

@ -1,427 +0,0 @@
#ifndef SKINCHANGER
#define SKINCHANGER
#pragma once
#include <vector>
#include <string>
#include "GameEventManager.h"
#include "VMT.hpp"
#include "Interfaces.hpp"
#include "Options.hpp"
#include "c_baseentity.h"
#include "PatternScan.hpp"
extern VMTHook* GameEventManagerHook;
extern VMTHook* ClientHook;
#include "NetVarManager.hpp"
extern bool needupdate;
#include "vmt_smart_hook.hpp"
struct iitem
{
iitem(int defindex1, std::string name1, std::string viewmodel1, std::string worldmodel1)
{
defindex = defindex1;
name = name1;
viewmodel = viewmodel1;
worldmodel = worldmodel1;
Preview = std::to_string(defindex1).append(": ").append(name1);
}
int defindex;
std::string name;
std::string viewmodel;
std::string worldmodel;
std::string Preview;
bool isSelected;
};
struct hud_weapons_t
{
std::int32_t* get_weapon_count()
{
return reinterpret_cast<std::int32_t*>(std::uintptr_t(this) + 0x80);
}
};
struct String_t
{
char* szBuffer;
int nCapacity;
int _unknown;
int nLength;
};
class CEconItemRarityDefinition
{
public:
int id;
int color;
String_t name;
String_t loc_key;
String_t loc_key_weapon;
String_t loot_list;
String_t recycle_list;
String_t drop_sound;
String_t endmatchitemrevealrarity;
String_t pointertosomething3;
void* pointertosomething4;
void* pointertosomething5;
char dumb10[8];
};
class CStickerKit
{
public:
int id;
int item_rarity;
String_t name;
String_t description;
String_t item_name;
String_t material_name;
String_t image_inventory;
int tournament_event_id;
int tournament_team_id;
int tournament_player_id;
bool is_custom_sticker_material;
float rotate_end;
float rotate_start;
float scale_min;
float scale_max;
float wear_min;
float wear_max;
String_t image_inventory2;
String_t image_inventory_large;
std::uint32_t pad0[4];
};
class CPaintKit
{
public:
int nID;
String_t sName;
String_t sDescriptionString;
String_t sDescriptionTag;
String_t pad;
String_t pattern;
String_t pad1;
String_t sLogoMaterial;
int bBaseDiffuseOverride;
int rarity;
int nStyle;
int color1;
int color2;
int color3;
int color4;
int logoColor1;
int logoColor2;
int logoColor3;
int logoColor4;
float flWearDefault;
float flWearRemapMin;
float flWearRemapMax;
char nFixedSeed;
char uchPhongExponent;
char uchPhongAlbedoBoost;
char uchPhongIntensity;
float flPatternScale;
float flPatternOffsetXStart;
float flPatternOffsetXEnd;
float flPatternOffsetYStart;
float flPatternOffsetYEnd;
float flPatternRotateStart;
float flPatternRotateEnd;
float flLogoScale;
float flLogoOffsetX;
float flLogoOffsetY;
float flLogoRotation;
int bIgnoreWeaponSizeScale;
int nViewModelExponentOverrideSize;
int bOnlyFirstMaterial;
float pearlescent;
int sVmtPath[4];
int kvVmtOverrides;
};
struct EconItemQualityDefinition {
int id;
const char* name;
unsigned weight;
bool explicitMatchesOnly;
bool canSupportSet;
const char* hexColor;
};
extern std::vector<iitem> rarities;
extern std::vector<iitem> knives;
extern std::vector<iitem> gloves;
extern std::vector<iitem> agents;
extern std::vector<iitem> medals;
extern std::vector<iitem> musickits;
extern std::vector <iitem> qualities;
static inline auto is_knife(const int di) -> bool
{
for (short i = 0; i < knives.size(); i++)
if (knives[i].defindex == di) return true;
return false;
}
bool __fastcall hkFireEventClientSide(void* thisptr, void* edx, IGameEvent* event);
void __fastcall hkFrameStageNotify(IBaseClientDLL* thisptr, void* edx, ClientFrameStage_t stage);
class CCStrike15ItemSchema;
class CCStrike15ItemSystem
{
public:
virtual CCStrike15ItemSchema* GetItemSchemaInterface() = 0;
};
template <typename Key, typename Value>
struct Node_t
{
int nPreviousId;
int nNextId;
void* parent;
int type;
Key iPaintKitId;
Value value;
};
template <typename Key, typename Value>
struct Head_t
{
Node_t<Key, Value>* pMemory;
int nAllocationCount;
int nGrowSize;
int nStartElement;
int nNextAvailable;
int _unknown;
int nLastElement;
};
class CEconItemDefinition
{
public:
VIRTUAL_METHOD(int, getWeaponId, 0, (), (this))
VIRTUAL_METHOD(const char*, getItemBaseName, 2, (), (this))
VIRTUAL_METHOD(const char*, getItemTypeName, 3, (), (this))
VIRTUAL_METHOD(const char*, getPlayerDisplayModel, 6, (), (this))
VIRTUAL_METHOD(const char*, getWorldDisplayModel, 7, (), (this))
VIRTUAL_METHOD(std::uint8_t, getRarity, 12, (), (this))
char pad_0x0000[0x8];
int32_t m_iItemDefinitionIndex;
char pad_0x000C[0x40];
char* m_szHudName;
char pad_0x0050[0x4];
char* m_szWeaponType;
char pad_0x0058[0x4];
char* m_szWeaponDescription;
char pad_0x0060[0x34];
char* m_szViewModel;
char pad_0x0098[0x4];
char* m_szWorldModel;
char* m_szWorldModelDropped;
char pad_0x001[0x58];
char* stickersdecalmdl;
char pad_0x002[0x0C];
char* stickersdecalmdl1;
char* inventoryicon;
char pad_0x003[0xA4];
char* m_szWeaponName1;
char pad_0x004[0x14];
char* m_szWeaponName;
char pad_0x005[0x8];
char* m_szWeaponName3;
char pad_0x01C4[0x27C];
};
void InitSkinChanger();
template <typename T>
struct UtlMemory {
T& operator[](int i) const noexcept { return memory[i]; };
T* memory;
int allocationCount;
int growSize;
};
template <typename Key, typename Value>
struct UtlMap {
auto begin() const noexcept { return memory.memory; }
auto end() const noexcept { return memory.memory + numElements; }
int find(Key key) const noexcept
{
auto curr = root;
while (curr != -1) {
const auto el = memory[curr];
if (el.iPaintKitId < key)
curr = el.nNextId;
else if (el.iPaintKitId > key)
curr = el.nPreviousId;
else
break;
}
return curr;
}
void* lessFunc;
UtlMemory<Node_t<Key, Value>> memory;
int root;
int numElements;
int firstFree;
int lastAlloc;
Node_t<Key, Value>* elements;
};
struct AlternateIconData {
String_t simpleName;
String_t largeSimpleName;
String_t iconURLSmall;
String_t iconURLLarge;
PAD(28)
};
template <typename T>
class UtlVector {
public:
constexpr T& operator[](int i) noexcept { return memory[i]; };
constexpr const T& operator[](int i) const noexcept { return memory[i]; };
T* memory;
int allocationCount;
int growSize;
int size;
T* elements;
};
struct ItemListEntry {
int itemDef;
int paintKit;
PAD(20)
auto weaponId() const noexcept
{
return itemDef;
}
};
class EconLootListDefinition {
public:
VIRTUAL_METHOD(const char*, getName, 0, (), (this))
VIRTUAL_METHOD(const UtlVector<ItemListEntry>&, getLootListContents, 1, (), (this))
};
class EconItemSetDefinition {
public:
VIRTUAL_METHOD(const char*, getLocKey, 1, (), (this))
VIRTUAL_METHOD(int, getItemCount, 4, (), (this))
VIRTUAL_METHOD(int, getItemDef, 5, (int index), (this, index))
VIRTUAL_METHOD(int, getItemPaintKit, 6, (int index), (this, index))
};
class CEconColorDefinition
{
public:
int xz;
int xz2;
};
class CEconGraffitiTintDefinition
{
public:
int xz;
int xz2;
};
class CEconMusicDefinition
{
public:
int id;
char* name;
char* desc;
char* model;
char* music;
};
template <typename T>
class MusicVector {
public:
constexpr T& operator[](int i) noexcept { return memory[i]; };
constexpr const T& operator[](int i) const noexcept { return memory[i]; };
T* memory;
PAD(0xC)
int itemcount;
};
class ItemSchema {
public:
PAD(0x64)
UtlMap<int, CEconItemRarityDefinition> rars;
UtlMap<int, EconItemQualityDefinition> qualities;
PAD(0x48)
UtlMap<int, CEconItemDefinition*> itemsSorted;
PAD(0x104)
UtlMap<std::uint64_t, AlternateIconData> alternateIcons;
PAD(0x48)
UtlMap<int, CPaintKit*> paintKits;
UtlMap<int, CStickerKit*> stickerKits;
UtlMap<const char*, CStickerKit*> sticker_kits_namekey;
int32_t pad6[24];
UtlMap<const char*, KeyValues*> prefabs;
UtlVector<CEconColorDefinition*> colors;
UtlVector<CEconGraffitiTintDefinition*> graffiti_tints;
int32_t pad7[20];
MusicVector<CEconMusicDefinition*> music_definitions;
VIRTUAL_METHOD(CEconItemDefinition*, getItemDefinitionInterface, 4, (int id), (this, id))
VIRTUAL_METHOD(int, getItemSetCount, 28, (), (this))
VIRTUAL_METHOD(EconItemSetDefinition*, getItemSet, 29, (int index), (this, index))
VIRTUAL_METHOD(EconLootListDefinition*, getLootList, 32, (int index), (this, index))
VIRTUAL_METHOD(int, getLootListCount, 34, (), (this))
VIRTUAL_METHOD(CEconItemDefinition*, getItemDefinitionByName, 42, (const char* name), (this, name))
};
class ItemSystem {
public:
VIRTUAL_METHOD(ItemSchema*, getItemSchema, 0, (), (this))
};
extern std::add_pointer_t<ItemSystem* __cdecl()> itemSystem;
#endif

View File

@ -1,678 +0,0 @@
#include "SkinChanger.hpp"
#include "Other.hpp"
VMTHook* GameEventManagerHook = nullptr;
VMTHook* ClientHook = nullptr;
std::vector<iitem> rarities;
std::vector<iitem> knives;
std::vector<iitem> gloves;
std::vector<iitem> agents;
std::vector<iitem> medals;
std::vector<iitem> musickits;
std::vector <iitem> qualities;
std::add_pointer_t<ItemSystem* __cdecl()> itemSystem;
enum class EStickerAttributeType
{
Index,
Wear,
Scale,
Rotation
};
static auto s_econ_item_interface_wrapper_offset = std::uint16_t(0);
struct GetStickerAttributeBySlotIndexFloat
{
static auto __fastcall hooked(void* thisptr, void*, const int slot,
const EStickerAttributeType attribute, const float unknown) -> float
{
auto item = reinterpret_cast<C_BaseAttributableItem*>(std::uintptr_t(thisptr) - s_econ_item_interface_wrapper_offset);
const auto defindex = item->GetItemDefinitionIndex();
int config = GetCfgIndex(defindex);
if (config != -1)
{
switch (attribute)
{
case EStickerAttributeType::Wear:
return g_Options.weapons.value->arr[config].stickers[slot].wear;
case EStickerAttributeType::Scale:
return g_Options.weapons.value->arr[config].stickers[slot].scale;
case EStickerAttributeType::Rotation:
return g_Options.weapons.value->arr[config].stickers[slot].rotation;
default:
break;
}
}
return m_original(thisptr, nullptr, slot, attribute, unknown);
}
static decltype(&hooked) m_original;
};
decltype(GetStickerAttributeBySlotIndexFloat::m_original) GetStickerAttributeBySlotIndexFloat::m_original;
struct GetStickerAttributeBySlotIndexInt
{
static auto __fastcall hooked(void* thisptr, void*, const int slot,
const EStickerAttributeType attribute, const int unknown) -> int
{
auto item = reinterpret_cast<C_BaseAttributableItem*>(std::uintptr_t(thisptr) - s_econ_item_interface_wrapper_offset);
if (attribute == EStickerAttributeType::Index)
{
const auto defindex = item->GetItemDefinitionIndex();
int config = GetCfgIndex(defindex);
if (config != -1)
return g_Options.weapons.value->arr[config].stickers[slot].stickerid;
}
return m_original(thisptr, nullptr, slot, attribute, unknown);
}
static decltype(&hooked) m_original;
};
decltype(GetStickerAttributeBySlotIndexInt::m_original) GetStickerAttributeBySlotIndexInt::m_original;
void ApplyStickers(C_BaseAttributableItem* item)
{
if (!s_econ_item_interface_wrapper_offset)
s_econ_item_interface_wrapper_offset = netvar_manager::get().get_offset(FNV("CBaseAttributableItem->m_Item")) + 0xC;
static vmt_multi_hook hook;
const auto econ_item_interface_wrapper = std::uintptr_t(item) + s_econ_item_interface_wrapper_offset;
if (hook.initialize_and_hook_instance(reinterpret_cast<void*>(econ_item_interface_wrapper)))
{
hook.apply_hook<GetStickerAttributeBySlotIndexFloat>(4);
hook.apply_hook<GetStickerAttributeBySlotIndexInt>(5);
}
}
bool __fastcall hkFireEventClientSide(void* thisptr, void* edx, IGameEvent* event)
{
static auto ofunc = GameEventManagerHook->GetOriginal<bool(__fastcall*)(void*, void*, IGameEvent*)>(9);
if (event) {
if (!strcmp(event->GetName(), "player_death") && iff.g_pEngineClient->GetPlayerForUserID(event->GetInt("attacker")) == iff.g_pEngineClient->GetLocalPlayer())
{
#ifdef DEBUG
printf("BE playerdeath with %s\n", event->GetString("weapon"));
#endif
for (int i = 0; i < g_Options.weapons.value->weaponzcount; i++)
{
if (_tcsstr(g_Options.weapons.value->arr[i].killfeedicon, event->GetString("weapon")))
{
if (g_Options.weapons.value->arr[i].active && g_Options.weapons.value->arr[i].killfeediconactive)
event->SetString("weapon", g_Options.weapons.value->arr[i].killfeediconreplace);
if (!g_Options.weapons.value->arr[i].ownerunk && g_Options.weapons.value->arr[i].stattrak != -1)
g_Options.weapons.value->arr[i].stattrak += 1;
}
}
}
}
return ofunc(thisptr, edx, event);
}
C_CS_PlayerResource** g_player_resource;
#include <array>
bool Changer()
{
static bool initinterface = 0;
if (!initinterface) {
const auto team_arr_prop = C_CS_PlayerResource::GetTeamProp();
const auto team_prop = team_arr_prop->m_pDataTable->m_pProps;
const auto proxy_addr = std::uintptr_t(team_prop->m_ProxyFn);
g_player_resource = *reinterpret_cast<C_CS_PlayerResource***>(proxy_addr + 0x10);
#ifdef DEBUG
printf("g_player_resource initiated %x\n", g_player_resource);
#endif
initinterface = 1;
}
if (!iff.g_pEngineClient->IsConnected()) {
return 0;
}
int localplayer_index = iff.g_pEngineClient->GetLocalPlayer();
C_BasePlayer* localplayer = static_cast<C_BasePlayer*>(iff.g_pEntityList->GetClientEntity(localplayer_index));
if (!localplayer)
return 0;
auto player_resource = *g_player_resource;
if (g_Options.weapons.value->arr[4].active)
player_resource->GetCoins()[localplayer_index] = g_Options.weapons.value->arr[4].modeldefindex;
if (g_Options.weapons.value->arr[5].active)
player_resource->GetMusicKits()[localplayer_index] = g_Options.weapons.value->arr[5].modeldefindex;
if (g_Options.profile_active)
{
int ranktype = player_resource->GetRankType()[localplayer_index];
int selectedrank = 0;
if (ranktype == 7) selectedrank = 1;
if (ranktype == 10) selectedrank = 2;
player_resource->GetRanks()[localplayer_index] = g_Options.rankz.value->arr[selectedrank].rank;
player_resource->GetWins()[localplayer_index] = g_Options.rankz.value->arr[selectedrank].wins;
player_resource->GetLevel()[localplayer_index] = g_Options.level;
player_resource->GetComLeader()[localplayer_index] = g_Options.comleader;
player_resource->GetComTeacher()[localplayer_index] = g_Options.comteacher;
player_resource->GetComFriendly()[localplayer_index] = g_Options.comfriendly;
}
if (g_Options.fakescore)
{
player_resource->GetMVPs()[localplayer_index] = g_Options.MVPs;
player_resource->GetScore()[localplayer_index] = g_Options.score;
player_resource->GetKills()[localplayer_index] = g_Options.kills;
player_resource->GetAssists()[localplayer_index] = g_Options.assists;
player_resource->GetDeaths()[localplayer_index] = g_Options.deaths;
}
int team = localplayer->GetTeam(); char* model = 0;
if (team == TEAM_TERRORIST && g_Options.weapons.value->arr[2].active && g_Options.weapons.value->arr[2].modelactive)
model = g_Options.weapons.value->arr[2].model;
if (team == TEAM_CT && g_Options.weapons.value->arr[3].active && g_Options.weapons.value->arr[3].modelactive)
model = g_Options.weapons.value->arr[3].model;
if (model != 0) {
localplayer->GetModelIndex() = iff.g_pMdlInfo->GetModelIndex(model);
if (const auto modelprecache = iff.g_pNetworkStringTableContainer->FindTable("modelprecache"))
{
modelprecache->AddString(false, model);
const auto viewmodelArmConfig = iff.getPlayerViewmodelArmConfigForPlayerModel(model);
modelprecache->AddString(false, viewmodelArmConfig[2]);
modelprecache->AddString(false, viewmodelArmConfig[3]);
}
const auto m_hRagdoll = (C_BaseEntity*)iff.g_pEntityList->GetClientEntityFromHandle(localplayer->Ragdoll());
if (m_hRagdoll)
m_hRagdoll->GetModelIndex() = iff.g_pMdlInfo->GetModelIndex(model);
}
if (localplayer->GetLifeState() != LIFE_ALIVE)
{
if (g_Options.weapons.value->arr[1].active && g_Options.weapons.value->arr[1].modelactive) {
auto destroyglove = iff.g_pEntityList->GetClientEntityFromHandle(localplayer->GetWearables()[0]);
if (destroyglove) {
destroyglove->GetClientNetworkable()->SetDestroyedOnRecreateEntities();
destroyglove->GetClientNetworkable()->Release();
#ifdef DEBUG
printf("destroyed glove\n");
#endif
}
}
return 0;
}
player_info_t localplayer_info;
if (!iff.g_pEngineClient->GetPlayerInfo(localplayer_index, &localplayer_info))
return 0;
CBaseHandle viewmodelHandle = localplayer->GetViewModel();
C_BaseViewModel* pViewModel = (C_BaseViewModel*)iff.g_pEntityList->GetClientEntityFromHandle(viewmodelHandle);
const auto view_model_weapon = (C_BaseAttributableItem*)iff.g_pEntityList->GetClientEntityFromHandle(pViewModel->GetWeapon());
int idi = view_model_weapon->GetItemDefinitionIndex();
if (idi == WEAPON_KNIFE) idi = WEAPON_KNIFE_T;
int modelcfgindex = GetCfgIndex2(idi);
if (modelcfgindex != -1 && g_Options.models.value->arr[modelcfgindex].active)
{
char* model = g_Options.models.value->arr[modelcfgindex].vmodel_repl;
const auto override_model_index = iff.g_pMdlInfo->GetModelIndex(model);
view_model_weapon->SetModelIndex(override_model_index) ;
pViewModel->SetModelIndex(override_model_index) ;
if (const auto modelprecache = iff.g_pNetworkStringTableContainer->FindTable("modelprecache"))
{
modelprecache->AddString(false, model);
}
}
int seqact = opt.needtogetseqact;
if (seqact)
{
int oldmodelindex = pViewModel->GetModelIndex();
pViewModel->SetModelIndex(iff.g_pMdlInfo->GetModelIndex(g_Options.models.value->arr[seqact].vmodel_orig));
for (int i = 0; i < 20; i++)
strcpy(g_Options.models.value->arr[seqact].seqs[i].seq_orig_def, (char*)pViewModel->GetSequenceActivity(i));
pViewModel->SetModelIndex(iff.g_pMdlInfo->GetModelIndex(g_Options.models.value->arr[seqact].vmodel_repl));
for (int i = 0; i < 20; i++)
{
strcpy(g_Options.models.value->arr[seqact].seqs[i].seq_repl_def, (char*)pViewModel->GetSequenceActivity(i));
char newpreview[32] = "";
strcat_s(newpreview, std::to_string(i).c_str());
strcat_s(newpreview, ": ");
strcat_s(newpreview, g_Options.models.value->arr[seqact].seqs[i].seq_repl_def);
strcpy(g_Options.models.value->arr[seqact].seqs[i].seq_repl_def_preview, newpreview);
}
pViewModel->SetModelIndex(oldmodelindex);
opt.needtogetseqact = 0;
}
if (g_Options.weapons.value->arr[1].active && g_Options.weapons.value->arr[1].modelactive)
{
auto hWearables = localplayer->GetWearables();
static int glove_handle;
C_BaseAttributableItem* glove = (C_BaseAttributableItem*)iff.g_pEntityList->GetClientEntityFromHandle(hWearables[0] );
if (!glove)
{
C_BaseAttributableItem* our_glove = (C_BaseAttributableItem*)iff.g_pEntityList->GetClientEntityFromHandle(glove_handle);
if (our_glove)
{
hWearables[0] = glove_handle;
glove = our_glove;
}
}
if (!glove)
{
static std::add_pointer_t<C_BaseEntity* __cdecl(int, int)> createWearable = nullptr;
if (!createWearable) {
createWearable = []() -> decltype(createWearable)
{
for (auto clientClass = iff.g_pClient->GetAllClasses(); clientClass; clientClass = clientClass->m_pNext)
if (clientClass->m_ClassID == 54)
return (std::add_pointer_t<C_BaseEntity* __cdecl(int, int)>)clientClass->m_pCreateFn;
return nullptr;
}();
}
const auto serial = rand() % 0x1000;
auto entry = iff.g_pEntityList->GetHighestEntityIndex() + 1;
for (int i = 65; i < iff.g_pEntityList->GetHighestEntityIndex(); i++)
{
auto pEntity = iff.g_pEntityList->GetClientEntity(i);
if (pEntity && pEntity->GetClientClass()->m_ClassID == 70)
{
entry = i;
break;
}
}
createWearable(entry, serial);
glove = (C_BaseAttributableItem*)iff.g_pEntityList->GetClientEntity(entry);
glove->initialized() = true;
hWearables[0] = entry | serial << 16;
static int(__thiscall * equipWearable)(void* wearable, void* player) = reinterpret_cast<decltype(equipWearable)>(FindPatternV2("client.dll", "55 8B EC 83 EC 10 53 8B 5D 08 57 8B F9"));
equipWearable(glove, localplayer);
localplayer->body() = 1;
glove->SetModelIndex(iff.g_pMdlInfo->GetModelIndex(g_Options.weapons.value->arr[1].worldmodel));
iff.g_pClientState->ForceFullUpdate();
}
if (glove)
{
glove->GetItemDefinitionIndex() = g_Options.weapons.value->arr[1].modeldefindex;
glove->GetItemIDHigh() = -1;
glove->GetAccountID() = localplayer_info.xuidlow;
glove->GetFallbackPaintKit() = g_Options.weapons.value->arr[1].skinid;
glove->GetFallbackSeed() = g_Options.weapons.value->arr[1].seed;
glove->GetFallbackWear() = g_Options.weapons.value->arr[1].wear;
}
}
if (g_Options.weapons.value->arr[0].active && g_Options.weapons.value->arr[0].modelactive)
{
static int lastmdlindex = -1;
int curmdlindex = pViewModel->GetModelIndex();
if (lastmdlindex != curmdlindex)
{
lastmdlindex = curmdlindex;
int defindex = view_model_weapon->GetItemDefinitionIndex();
if (!is_knife(defindex)) {
for (int i = 0; i < 20; i++)
if (_tcsstr(pViewModel->GetSequenceActivity(i), "draw"))
{
pViewModel->SendViewModelMatchingSequence(i); break;
}
}
}
if (view_model_weapon && is_knife(view_model_weapon->GetItemDefinitionIndex()))
{
const auto override_model_index = iff.g_pMdlInfo->GetModelIndex(g_Options.weapons.value->arr[0].model);
pViewModel->GetModelIndex() = override_model_index;
}
}
auto& weapons = localplayer->GetWeapons();
for (auto weapon_handle : weapons)
{
if (weapon_handle == INVALID_EHANDLE_INDEX)
break;
C_BaseAttributableItem* weapon = static_cast<C_BaseAttributableItem*>(iff.g_pEntityList->GetClientEntityFromHandle(weapon_handle));
if (!weapon)
continue;
short item_definition_index = weapon->GetItemDefinitionIndex();
if (item_definition_index == WEAPON_C4 && g_Options.weapons.value->arr[GetCfgIndex(item_definition_index)].active)
weapon->body() = 2;
if (item_definition_index == 42) item_definition_index = 59;
int configindex = GetCfgIndex(item_definition_index);
if (configindex == -1) continue;
if (g_Options.weapons.value->arr[configindex].active)
{
if (is_knife(item_definition_index) && g_Options.weapons.value->arr[0].modelactive)
{
weapon->GetItemDefinitionIndex() = g_Options.weapons.value->arr[0].modeldefindex;
short mdlindex = iff.g_pMdlInfo->GetModelIndex(g_Options.weapons.value->arr[0].model);
weapon->GetModelIndex() = mdlindex;
auto m_pWorld = (C_BaseEntity*)iff.g_pEntityList->GetClientEntityFromHandle(weapon->GetWeaponWorldModel());
m_pWorld->GetModelIndex() = mdlindex+1;
}
weapon->GetItemIDHigh() = -1;
if (!g_Options.weapons.value->arr[configindex].ownerunk)
weapon->GetAccountID() = localplayer_info.xuidlow;
weapon->GetEntityQuality() = g_Options.weapons.value->arr[configindex].quality;
snprintf(weapon->GetCustomName(), 32, "%s", g_Options.weapons.value->arr[configindex].nametag);
weapon->GetFallbackPaintKit() = g_Options.weapons.value->arr[configindex].skinid;
weapon->GetFallbackSeed() = g_Options.weapons.value->arr[configindex].seed;
weapon->GetFallbackWear() = g_Options.weapons.value->arr[configindex].wear;
weapon->GetFallbackStatTrak() = g_Options.weapons.value->arr[configindex].stattrak;
ApplyStickers(weapon);
}
}
if (*g_Options.nvgsON)
NightvisionRun(localplayer);
if (*g_Options.flashlightON)
FlashlightRun(localplayer);
if (*g_Options.weatheractive)
do_precipitation();
return 1;
}
void __fastcall hkFrameStageNotify(IBaseClientDLL* thisptr, void* edx, ClientFrameStage_t stage)
{
static auto oFrameStageNotify = ClientHook->GetOriginal<void(__thiscall*)(IBaseClientDLL*, ClientFrameStage_t stage)>(37);
if ( (*g_Options.playerloop_count || *g_Options.entityloop_count) && stage == ClientFrameStage_t::FRAME_NET_UPDATE_POSTDATAUPDATE_END)
{
for (int i = 1; i < 65; i++)
{
C_BasePlayer* pEntity = (C_BasePlayer*)iff.g_pEntityList->GetClientEntity(i);
if (i == iff.g_pEngineClient->GetLocalPlayer()) continue;
if (!pEntity || pEntity->IsDormant())
continue;
int team = pEntity->GetTeam();
if ((team < 2) | (team > 3)) continue;
team -= 2;
if (g_Options.models.value->arr[team].active) {
char* model = g_Options.models.value->arr[team].vmodel_repl;
pEntity->GetModelIndex() = iff.g_pMdlInfo->GetModelIndex(model);
if (const auto modelprecache = iff.g_pNetworkStringTableContainer->FindTable("modelprecache"))
{
modelprecache->AddString(false, model);
const auto viewmodelArmConfig = iff.getPlayerViewmodelArmConfigForPlayerModel(model);
modelprecache->AddString(false, viewmodelArmConfig[2]);
modelprecache->AddString(false, viewmodelArmConfig[3]);
}
const auto m_hRagdoll = (C_BaseEntity*)iff.g_pEntityList->GetClientEntityFromHandle(pEntity->Ragdoll());
if (m_hRagdoll)
m_hRagdoll->SetModelIndex(iff.g_pMdlInfo->GetModelIndex(model));
}
if (g_Options.models.value->arr[team].active_scale)
pEntity->GetModelScale() = g_Options.models.value->arr[team].scale;
}
}
if (stage == ClientFrameStage_t::FRAME_NET_UPDATE_POSTDATAUPDATE_START) {
Changer();
if (opt.needupdate) {
static auto clear_hud_weapon_icon_ptr = FindPatternV2("client.dll", "55 8B EC 51 53 56 8B 75 08 8B D9 57 6B FE 2C");
static auto clearHudWeapon = reinterpret_cast<std::int32_t(__thiscall*)(void*, std::int32_t)>(clear_hud_weapon_icon_ptr);
auto element = FindHudElement("CCSGO_HudWeaponSelection");
auto hud_weapons = reinterpret_cast<hud_weapons_t*>(std::uintptr_t(element) - 0xA0);
if (hud_weapons && *hud_weapons->get_weapon_count() > 0)
for (std::int32_t i = 0; i < *hud_weapons->get_weapon_count(); i++)
i = clearHudWeapon(hud_weapons, i);
opt.needupdate = 0;
}
}
oFrameStageNotify(thisptr, stage);
}
void InitSkinChanger()
{
itemSystem = relativeToAbsolute<decltype(itemSystem)>(FindPatternV2("client.dll", "E8 ? ? ? ? 0F B7 0F") + 1);
#ifdef DEBUG
printf("itemschema2 %x\n", itemSystem()->getItemSchema());
#endif
for (const auto& node : itemSystem()->getItemSchema()->itemsSorted) {
const auto item = node.value;
if (std::strcmp(item->m_szWeaponType, "#CSGO_Type_Knife") == 0)
if (item->m_szWorldModel)
knives.push_back(iitem(item->m_iItemDefinitionIndex, item->m_szWeaponName3, item->m_szViewModel, item->m_szWorldModel));
else knives.push_back(iitem(item->m_iItemDefinitionIndex, item->m_szWeaponName3, item->m_szViewModel, ""));
if (std::strcmp(item->m_szWeaponType, "#CSGO_Type_Collectible") == 0)
medals.push_back(iitem(item->m_iItemDefinitionIndex, item->m_szWeaponName3, "", ""));
if (std::strcmp(item->m_szWeaponType, "#Type_Hands") == 0)
if (item->m_szWorldModel)
gloves.push_back(iitem(item->m_iItemDefinitionIndex, item->m_szWeaponName3, item->m_szViewModel, item->m_szWorldModel));
else gloves.push_back(iitem(item->m_iItemDefinitionIndex, item->m_szWeaponName3, item->m_szViewModel, ""));
if (std::strcmp(item->m_szWeaponType, "#Type_CustomPlayer") == 0)
if (item->m_szWorldModel)
agents.push_back(iitem(item->m_iItemDefinitionIndex, item->m_szWeaponName3, item->m_szViewModel, item->m_szWorldModel));
else agents.push_back(iitem(item->m_iItemDefinitionIndex, item->m_szWeaponName3, item->m_szViewModel, ""));
}
for (const auto& node : itemSystem()->getItemSchema()->qualities) {
const auto item = node.value;
qualities.push_back(iitem(item.id, item.name, "", ""));
}
for (const auto& node : itemSystem()->getItemSchema()->rars) {
const auto item = node.value;
rarities.push_back(iitem(item.id, item.name.szBuffer, "", ""));
}
auto musickitsS = itemSystem()->getItemSchema()->music_definitions;
#ifdef DEBUG
std::cout << musickitsS.memory << " " << musickitsS.itemcount << std::endl;
#endif
for (int i = (int)musickitsS.memory; i < (int)musickitsS.memory + musickitsS.itemcount * 0x18; i += 0x18)
{
CEconMusicDefinition* music = *(CEconMusicDefinition**)(i + 0x14);
musickits.push_back(iitem(music->id, music->name, "", ""));
}
const auto& paintkitMap = itemSystem()->getItemSchema()->paintKits;
int paintkitcount = 0;
for (const auto& node : paintkitMap) {
const auto pKit = node.value;
opt.sc_skins.push_back(Options_my::skinstruct(pKit->nID, pKit->sName.szBuffer, paintkitcount, pKit->rarity, pKit->color1, pKit->color2, pKit->color3, pKit->color4, pKit->pearlescent, (DWORD)&pKit->nID));
paintkitcount++;
}
const auto& stickerMap = itemSystem()->getItemSchema()->stickerKits;
int stickercount = 0;
for (const auto& node : stickerMap) {
const auto stickerKit = node.value;
opt.sc_stickers.push_back(Options_my::stickerstruct(stickerKit->id, stickerKit->name.szBuffer, stickercount));
stickercount++;
}
#ifdef DEBUG
printf("counts %d %d %d %d %d %d %d\n",
knives.size(), gloves.size(), agents.size(), medals.size(), musickits.size(), opt.sc_skins.size(), opt.sc_stickers.size());
#endif
const auto& prefabMap = itemSystem()->getItemSchema()->prefabs;
for (const auto& node : prefabMap) {
KeyValues* kv = node.value;
int cfgindex = GetCfgIndexByPrefab(fnv2::hash(kv->GetName()));
if (cfgindex == -1) continue;
int soundcount = 0;
const char* vmodel_orig = kv->GetString("model_player");
strcpy(g_Options.models.value->arr[cfgindex].vmodel_orig, vmodel_orig);
strcpy(g_Options.models.value->arr[cfgindex].vmodel_repl_temp, vmodel_orig);
strcpy(g_Options.models.value->arr[cfgindex].vmodel_repl, vmodel_orig);
g_Options.materials.value->arr[cfgindex + 2].model_hash = fnv2::hash(vmodel_orig);
kv = kv->FindKey("visuals");
if (kv) {
char* sound_single_shot = (char*)kv->GetString("sound_single_shot");
if (sound_single_shot[0] != 0x0) {
strcpy(g_Options.models.value->arr[cfgindex].sounds[soundcount].name, sound_single_shot);
g_Options.models.value->arr[cfgindex].sounds[soundcount].hash = GenerateSoundEntryHash(sound_single_shot);
soundcount++;
}
char* sound_single_shot_accurate = (char*)kv->GetString("sound_single_shot_accurate");
if (sound_single_shot_accurate[0] != 0x0) {
strcpy(g_Options.models.value->arr[cfgindex].sounds[soundcount].name, sound_single_shot);
g_Options.models.value->arr[cfgindex].sounds[soundcount].hash = GenerateSoundEntryHash(sound_single_shot);
soundcount++;
}
char* sound_special1 = (char*)kv->GetString("sound_special1");
if (sound_special1[0] != 0x0) {
strcpy(g_Options.models.value->arr[cfgindex].sounds[soundcount].name, sound_special1);
g_Options.models.value->arr[cfgindex].sounds[soundcount].hash = GenerateSoundEntryHash(sound_special1);
soundcount++;
}
}
g_Options.models.value->arr[cfgindex].soundcount = soundcount;
}
c_vpk_archive pak01_archive;
if (pak01_archive.load("csgo/pak01_dir.vpk"))
for (auto const& pair : pak01_archive.files)
if (!pair.first.find("materials/panorama/images/icons/equipment"))
opt.killfeedicons.push_back(pair.first.substr(42, pair.first.length() - 46));
g_Options.weapons.value->arr[0].modeldefindex = knives[0].defindex;
strcpy(g_Options.weapons.value->arr[0].model, knives[0].viewmodel.c_str());
strcpy(g_Options.weapons.value->arr[0].worldmodel, knives[0].worldmodel.c_str());
g_Options.weapons.value->arr[0].modelactive = 1;
g_Options.weapons.value->arr[1].modeldefindex = gloves[0].defindex;
strcpy(g_Options.weapons.value->arr[1].model, gloves[0].viewmodel.c_str());
strcpy(g_Options.weapons.value->arr[1].worldmodel, gloves[0].worldmodel.c_str());
g_Options.weapons.value->arr[1].modelactive = 1;
g_Options.weapons.value->arr[2].modeldefindex = agents[0].defindex;
strcpy(g_Options.weapons.value->arr[2].model, agents[0].viewmodel.c_str());
g_Options.weapons.value->arr[2].modelactive = 1;
g_Options.weapons.value->arr[3].modelcount = 1;
g_Options.weapons.value->arr[3].modeldefindex = agents[1].defindex;
strcpy(g_Options.weapons.value->arr[3].model, agents[1].viewmodel.c_str());
g_Options.weapons.value->arr[3].modelactive = 1;
g_Options.weapons.value->arr[4].modeldefindex = medals[0].defindex;
g_Options.weapons.value->arr[4].modelactive = 1;
g_Options.weapons.value->arr[5].modeldefindex = musickits[0].defindex;
g_Options.weapons.value->arr[5].modelactive = 1;
g_Options.models.value->arr[2].findMDLmethode = 1;
}

View File

@ -1,51 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================
#ifndef SNDINFO_H
#define SNDINFO_H
#ifdef _WIN32
#pragma once
#endif
class Vector;
#include "utlsymbol.h"
//-----------------------------------------------------------------------------
// Purpose: Client side only
//-----------------------------------------------------------------------------
struct SndInfo_t
{
// Sound Guid
int m_nGuid;
FileNameHandle_t m_filenameHandle; // filesystem filename handle - call IFilesystem to conver this to a string
int m_nSoundSource;
int m_nChannel;
// If a sound is being played through a speaker entity (e.g., on a monitor,), this is the
// entity upon which to show the lips moving, if the sound has sentence data
int m_nSpeakerEntity;
float m_flVolume;
float m_flLastSpatializedVolume;
// Radius of this sound effect (spatialization is different within the radius)
float m_flRadius;
int m_nPitch;
Vector* m_pOrigin;
Vector* m_pDirection;
// if true, assume sound source can move and update according to entity
bool m_bUpdatePositions;
// true if playing linked sentence
bool m_bIsSentence;
// if true, bypass all dsp processing for this sound (ie: music)
bool m_bDryMix;
// true if sound is playing through in-game speaker entity.
bool m_bSpeaker;
// true if sound is playing with special DSP effect
bool m_bSpecialDSP;
// for snd_show, networked sounds get colored differently than local sounds
bool m_bFromServer;
};
#endif // SNDINFO_H

Binary file not shown.

View File

@ -1,80 +0,0 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Russian (Russia) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // Russian (Russia) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
/////////////////////////////////////////////////////////////////////////////
//
// WAVE
//
IDR_WAVE1 WAVE "cod.wav"
IDR_WAVE2 WAVE "crit.wav"
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -1,560 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{bde23281-b75d-4fb2-9b8e-08e1ae0a9bbd}</ProjectGuid>
<RootNamespace>SpyCustom</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>Seaside</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>C:\Program Files (x86)\GnuWin32\include;C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;$(IncludePath)</IncludePath>
<LibraryPath>C:\Program Files (x86)\GnuWin32\lib;C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;SPYCUSTOM_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;SPYCUSTOM_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalLibraryDirectories>Winmm.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;SPYCUSTOM_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;SPYCUSTOM_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="ai_activity.h" />
<ClInclude Include="AnalogCode.h" />
<ClInclude Include="animationlayer.h" />
<ClInclude Include="annotations.h" />
<ClInclude Include="baseclientstate.h" />
<ClInclude Include="baseentity.h" />
<ClInclude Include="baseentity_shared.h" />
<ClInclude Include="basehandle.h" />
<ClInclude Include="basetypes.h" />
<ClInclude Include="beam_flags.h" />
<ClInclude Include="bitbuf.h" />
<ClInclude Include="bittools.h" />
<ClInclude Include="bitvec.h" />
<ClInclude Include="bone_accessor.h" />
<ClInclude Include="bone_merge_cache.h" />
<ClInclude Include="bspfile.h" />
<ClInclude Include="bspflags.h" />
<ClInclude Include="BuildGroup.h" />
<ClInclude Include="bumpvects.h" />
<ClInclude Include="Button.h" />
<ClInclude Include="ButtonCode.h" />
<ClInclude Include="byteswap.h" />
<ClInclude Include="cdll_client_int.h" />
<ClInclude Include="cdll_int.h" />
<ClInclude Include="cdll_util.h" />
<ClInclude Include="CGameUI.h" />
<ClInclude Include="CheckButton.h" />
<ClInclude Include="checksum_crc.h" />
<ClInclude Include="checksum_md5.h" />
<ClInclude Include="cliententitylist.h" />
<ClInclude Include="clientleafsystem.h" />
<ClInclude Include="client_class.h" />
<ClInclude Include="client_render_handle.h" />
<ClInclude Include="client_thinklist.h" />
<ClInclude Include="client_virtualreality.h" />
<ClInclude Include="cmodel.h" />
<ClInclude Include="collisionproperty.h" />
<ClInclude Include="Color.h" />
<ClInclude Include="commonmacros.h" />
<ClInclude Include="compressed_light_cube.h" />
<ClInclude Include="compressed_vector.h" />
<ClInclude Include="Config.hpp" />
<ClInclude Include="const.h" />
<ClInclude Include="Controls.h" />
<ClInclude Include="convar.h" />
<ClInclude Include="csgosdk.h" />
<ClInclude Include="cs_achievementdefs.h" />
<ClInclude Include="cs_shareddefs.h" />
<ClInclude Include="cs_view_scene.h" />
<ClInclude Include="Cursor.h" />
<ClInclude Include="c_baseanimating.h" />
<ClInclude Include="c_baseanimatingoverlay.h" />
<ClInclude Include="c_basecombatcharacter.h" />
<ClInclude Include="c_baseentity.h" />
<ClInclude Include="c_baseflex.h" />
<ClInclude Include="c_baseplayer.h" />
<ClInclude Include="c_basetempentity.h" />
<ClInclude Include="c_input.h" />
<ClInclude Include="c_pixel_visibility.h" />
<ClInclude Include="c_playerlocaldata.h" />
<ClInclude Include="c_recipientfilter.h" />
<ClInclude Include="c_te_legacytempents.h" />
<ClInclude Include="Dar.h" />
<ClInclude Include="datamap.h" />
<ClInclude Include="dbg.h" />
<ClInclude Include="dbgflag.h" />
<ClInclude Include="deformations.h" />
<ClInclude Include="detours.h" />
<ClInclude Include="dlight.h" />
<ClInclude Include="dmattributetypes.h" />
<ClInclude Include="dmelementhandle.h" />
<ClInclude Include="dmxattribute.h" />
<ClInclude Include="dmxelement.h" />
<ClInclude Include="dmxloader.h" />
<ClInclude Include="dt_common.h" />
<ClInclude Include="dt_recv.h" />
<ClInclude Include="dt_send.h" />
<ClInclude Include="econ_item_constants.h" />
<ClInclude Include="econ_item_interface.h" />
<ClInclude Include="econ_item_schema.h" />
<ClInclude Include="econ_item_view.h" />
<ClInclude Include="edict.h" />
<ClInclude Include="EditablePanel.h" />
<ClInclude Include="ehandle.h" />
<ClInclude Include="eiface.h" />
<ClInclude Include="enginetrace.h" />
<ClInclude Include="entitylist.h" />
<ClInclude Include="entitylist_base.h" />
<ClInclude Include="EventListener.hpp" />
<ClInclude Include="expressioncalculator.h" />
<ClInclude Include="exprevaluator.h" />
<ClInclude Include="fasttimer.h" />
<ClInclude Include="filesystem.h" />
<ClInclude Include="filesystem_passthru.h" />
<ClInclude Include="flashlighteffect.h" />
<ClInclude Include="fltx4.h" />
<ClInclude Include="FocusNavGroup.h" />
<ClInclude Include="Frame.h" />
<ClInclude Include="functors.h" />
<ClInclude Include="fx.h" />
<ClInclude Include="gameconsole.h" />
<ClInclude Include="GameEventListener.h" />
<ClInclude Include="GameEventManager.h" />
<ClInclude Include="gamestringpool.h" />
<ClInclude Include="gametrace.h" />
<ClInclude Include="game_item_schema.h" />
<ClInclude Include="generichash.h" />
<ClInclude Include="GetVfunc.hpp" />
<ClInclude Include="globalvars_base.h" />
<ClInclude Include="groundlink.h" />
<ClInclude Include="Hooks.hpp" />
<ClInclude Include="htmlmessages.h" />
<ClInclude Include="hud.h" />
<ClInclude Include="hudelement.h" />
<ClInclude Include="hudtexturehandle.h" />
<ClInclude Include="hud_basechat.h" />
<ClInclude Include="hud_element_helper.h" />
<ClInclude Include="IAppSystem.h" />
<ClInclude Include="IBorder.h" />
<ClInclude Include="ichromehtmlwrapper.h" />
<ClInclude Include="iclassmap.h" />
<ClInclude Include="iclient.h" />
<ClInclude Include="icliententity.h" />
<ClInclude Include="icliententityinternal.h" />
<ClInclude Include="icliententitylist.h" />
<ClInclude Include="IClientLeafSystem.h" />
<ClInclude Include="iclientmode.h" />
<ClInclude Include="iclientnetworkable.h" />
<ClInclude Include="IClientPanel.h" />
<ClInclude Include="iclientrenderable.h" />
<ClInclude Include="iclientshadowmgr.h" />
<ClInclude Include="iclientthinkable.h" />
<ClInclude Include="iclientunknown.h" />
<ClInclude Include="iclientvirtualreality.h" />
<ClInclude Include="ICollideable.h" />
<ClInclude Include="IColorCorrection.h" />
<ClInclude Include="icommandline.h" />
<ClInclude Include="iconvar.h" />
<ClInclude Include="icvar.h" />
<ClInclude Include="idatacache.h" />
<ClInclude Include="IEffects.h" />
<ClInclude Include="iefx.h" />
<ClInclude Include="ienginetrace.h" />
<ClInclude Include="IEngineVgui.h" />
<ClInclude Include="ifilelist.h" />
<ClInclude Include="igameconsole.h" />
<ClInclude Include="igameevents.h" />
<ClInclude Include="IGameSystem.h" />
<ClInclude Include="IGameUI.h" />
<ClInclude Include="ihandleentity.h" />
<ClInclude Include="IHTML.h" />
<ClInclude Include="IImage.h" />
<ClInclude Include="IInput.h" />
<ClInclude Include="iinputsystem.h" />
<ClInclude Include="IKeyValuesSystem.h" />
<ClInclude Include="ILocalize.h" />
<ClInclude Include="Image.h" />
<ClInclude Include="imageformat.h" />
<ClInclude Include="imaterial.h" />
<ClInclude Include="imaterialsystem.h" />
<ClInclude Include="imaterialsystemhardwareconfig.h" />
<ClInclude Include="imdlcache.h" />
<ClInclude Include="IMesh.h" />
<ClInclude Include="imgui\imconfig.h" />
<ClInclude Include="imgui\imgui.h" />
<ClInclude Include="imgui\imgui_impl_dx9.h" />
<ClInclude Include="imgui\imgui_impl_win32.h" />
<ClInclude Include="imgui\imgui_internal.h" />
<ClInclude Include="imgui\imstb_rectpack.h" />
<ClInclude Include="imgui\imstb_textedit.h" />
<ClInclude Include="imgui\imstb_truetype.h" />
<ClInclude Include="imovehelper.h" />
<ClInclude Include="inetchannel.h" />
<ClInclude Include="inetchannelinfo.h" />
<ClInclude Include="inetmessage.h" />
<ClInclude Include="inetmsghandler.h" />
<ClInclude Include="InputEnums.h" />
<ClInclude Include="interface.h" />
<ClInclude Include="Interfaces.hpp" />
<ClInclude Include="interpolatedvar.h" />
<ClInclude Include="inventory_changer.h" />
<ClInclude Include="IPanel.h" />
<ClInclude Include="ipredictionsystem.h" />
<ClInclude Include="iscenetokenprocessor.h" />
<ClInclude Include="IScheme.h" />
<ClInclude Include="iserverentity.h" />
<ClInclude Include="iservernetworkable.h" />
<ClInclude Include="iserverplugin.h" />
<ClInclude Include="iserverunknown.h" />
<ClInclude Include="ishadowmgr.h" />
<ClInclude Include="ispatialpartition.h" />
<ClInclude Include="istudiorender.h" />
<ClInclude Include="ISurface.h" />
<ClInclude Include="ISystem.h" />
<ClInclude Include="itempents.h" />
<ClInclude Include="item_selection_criteria.h" />
<ClInclude Include="itexture.h" />
<ClInclude Include="itoolentity.h" />
<ClInclude Include="ivdebugoverlay.h" />
<ClInclude Include="IVGUI.h" />
<ClInclude Include="IVguiMatInfo.h" />
<ClInclude Include="IVguiMatInfoVar.h" />
<ClInclude Include="iviewrender.h" />
<ClInclude Include="iviewrender_beams.h" />
<ClInclude Include="ivmodelinfo.h" />
<ClInclude Include="ivmodelrender.h" />
<ClInclude Include="ivrenderview.h" />
<ClInclude Include="jobthread.h" />
<ClInclude Include="KeyBindingMap.h" />
<ClInclude Include="KeyCode.h" />
<ClInclude Include="keyvalues.h" />
<ClInclude Include="l2cache.h" />
<ClInclude Include="Label.h" />
<ClInclude Include="lerp_functions.h" />
<ClInclude Include="lightdesc.h" />
<ClInclude Include="ListPanel.h" />
<ClInclude Include="localflexcontroller.h" />
<ClInclude Include="logging.h" />
<ClInclude Include="MaterialSystemUtil.h" />
<ClInclude Include="mathlib.h" />
<ClInclude Include="math_pfns.h" />
<ClInclude Include="mem.h" />
<ClInclude Include="memalloc.h" />
<ClInclude Include="memdbgoff.h" />
<ClInclude Include="memdbgon.h" />
<ClInclude Include="mempool.h" />
<ClInclude Include="Menu.h" />
<ClInclude Include="Menu.hpp" />
<ClInclude Include="MenuItem.h" />
<ClInclude Include="meshreader.h" />
<ClInclude Include="meshutils.h" />
<ClInclude Include="messagebox.h" />
<ClInclude Include="MessageMap.h" />
<ClInclude Include="minidump.h" />
<ClInclude Include="modelloader.h" />
<ClInclude Include="modes.h" />
<ClInclude Include="MouseCode.h" />
<ClInclude Include="mouthinfo.h" />
<ClInclude Include="netchannel.hpp" />
<ClInclude Include="NetVarManager.hpp" />
<ClInclude Include="netvars.hpp" />
<ClInclude Include="networkvar.h" />
<ClInclude Include="Options.hpp" />
<ClInclude Include="Other.hpp" />
<ClInclude Include="particledraw.h" />
<ClInclude Include="particlemgr.h" />
<ClInclude Include="particles.h" />
<ClInclude Include="ParticleSphereRenderer.h" />
<ClInclude Include="particles_new.h" />
<ClInclude Include="particles_simple.h" />
<ClInclude Include="particle_iterators.h" />
<ClInclude Include="particle_parse.h" />
<ClInclude Include="particle_property.h" />
<ClInclude Include="particle_property_inlines.h" />
<ClInclude Include="particle_util.h" />
<ClInclude Include="PatternScan.hpp" />
<ClInclude Include="pbwrap.hpp" />
<ClInclude Include="PlayerInventory.hpp" />
<ClInclude Include="playernet_vars.h" />
<ClInclude Include="precipitation_shared.h" />
<ClInclude Include="predictableid.h" />
<ClInclude Include="predictable_entity.h" />
<ClInclude Include="predictioncopy.h" />
<ClInclude Include="ProtobuffMessages.h" />
<ClInclude Include="protobuffs.hpp" />
<ClInclude Include="ProtoParse.h" />
<ClInclude Include="proxies.hpp" />
<ClInclude Include="ragdoll.h" />
<ClInclude Include="ragdoll_shared.h" />
<ClInclude Include="rangecheckedvar.h" />
<ClInclude Include="recvproxy.h" />
<ClInclude Include="refcount.h" />
<ClInclude Include="networkstringtabledefs.h" />
<ClInclude Include="Panel.h" />
<ClInclude Include="PanelAnimationVar.h" />
<ClInclude Include="PHandle.h" />
<ClInclude Include="platform.h" />
<ClInclude Include="random.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="RichText.h" />
<ClInclude Include="sceneentity_shared.h" />
<ClInclude Include="sdk_hud_chat.h" />
<ClInclude Include="seemath.h" />
<ClInclude Include="sendproxy.h" />
<ClInclude Include="sequence_Transitioner.h" />
<ClInclude Include="shake.h" />
<ClInclude Include="shareddefs.h" />
<ClInclude Include="shared_classnames.h" />
<ClInclude Include="shattersurfacetypes.h" />
<ClInclude Include="Singleton.hpp" />
<ClInclude Include="SkinChanger.hpp" />
<ClInclude Include="smartptr.h" />
<ClInclude Include="ssemath.h" />
<ClInclude Include="steam.h" />
<ClInclude Include="SteamCommon.h" />
<ClInclude Include="steamtypes.h" />
<ClInclude Include="stringpool.h" />
<ClInclude Include="string_t.h" />
<ClInclude Include="strtools.h" />
<ClInclude Include="studio.h" />
<ClInclude Include="tempentity.h" />
<ClInclude Include="TextEntry.h" />
<ClInclude Include="TextImage.h" />
<ClInclude Include="texture_group_names.h" />
<ClInclude Include="threadtools.h" />
<ClInclude Include="tier1.h" />
<ClInclude Include="tier2.h" />
<ClInclude Include="tier2_logging.h" />
<ClInclude Include="tier3.h" />
<ClInclude Include="timedevent.h" />
<ClInclude Include="timeutils.h" />
<ClInclude Include="ToggleButton.h" />
<ClInclude Include="Tooltip.h" />
<ClInclude Include="touchlink.h" />
<ClInclude Include="trace.h" />
<ClInclude Include="tslist.h" />
<ClInclude Include="uniqueid.h" />
<ClInclude Include="usercmd.h" />
<ClInclude Include="userid.h" />
<ClInclude Include="utlblockmemory.h" />
<ClInclude Include="utlbuffer.h" />
<ClInclude Include="utldict.h" />
<ClInclude Include="utlenvelope.h" />
<ClInclude Include="utlfixedmemory.h" />
<ClInclude Include="utlflags.h" />
<ClInclude Include="utlhandletable.h" />
<ClInclude Include="utlhash.h" />
<ClInclude Include="utlintrusivelist.h" />
<ClInclude Include="utllinkedlist.h" />
<ClInclude Include="utlmap.h" />
<ClInclude Include="utlmemory.h" />
<ClInclude Include="utlobjectreference.h" />
<ClInclude Include="utlpriorityqueue.h" />
<ClInclude Include="utlqueue.h" />
<ClInclude Include="utlrbtree.h" />
<ClInclude Include="utlsoacontainer.h" />
<ClInclude Include="utlstack.h" />
<ClInclude Include="UtlStringMap.h" />
<ClInclude Include="utltshash.h" />
<ClInclude Include="UtlSortVector.h" />
<ClInclude Include="utlstring.h" />
<ClInclude Include="utlsymbol.h" />
<ClInclude Include="utlsymbollarge.h" />
<ClInclude Include="utlvector.h" />
<ClInclude Include="valve_minmax_on.h" />
<ClInclude Include="valve_off.h" />
<ClInclude Include="valve_on.h" />
<ClInclude Include="vcollide.h" />
<ClInclude Include="vcrmode.h" />
<ClInclude Include="vector.h" />
<ClInclude Include="vector2d.h" />
<ClInclude Include="vector4d.h" />
<ClInclude Include="vertexcolor.h" />
<ClInclude Include="VGUI.h" />
<ClInclude Include="vgui_basepanel.h" />
<ClInclude Include="viewrender.h" />
<ClInclude Include="view_shared.h" />
<ClInclude Include="vmatrix.h" />
<ClInclude Include="VMT.hpp" />
<ClInclude Include="vmt_smart_hook.hpp" />
<ClInclude Include="volumeculler.h" />
<ClInclude Include="vphysics_interface.h" />
<ClInclude Include="vpkparser.h" />
<ClInclude Include="vplane.h" />
<ClInclude Include="vprof.h" />
<ClInclude Include="vprof_sn.h" />
<ClInclude Include="vprof_telemetry.h" />
<ClInclude Include="vstdlib.h" />
<ClInclude Include="vtf.h" />
<ClInclude Include="wchartypes.h" />
<ClInclude Include="weapon_parse.h" />
<ClInclude Include="win32consoleio.h" />
<ClInclude Include="xboxstubs.h" />
<ClInclude Include="XorStr.hpp" />
<ClInclude Include="zip_uncompressed.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="ConVars.cpp" />
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="imgui\imgui.cpp" />
<ClCompile Include="imgui\imgui_demo.cpp" />
<ClCompile Include="imgui\imgui_draw.cpp" />
<ClCompile Include="imgui\imgui_impl_dx9.cpp" />
<ClCompile Include="imgui\imgui_impl_win32.cpp" />
<ClCompile Include="imgui\imgui_tables.cpp" />
<ClCompile Include="imgui\imgui_widgets.cpp" />
<ClCompile Include="Interfaces.cpp" />
<ClCompile Include="KeyValues.cpp" />
<ClCompile Include="NetVarManager.cpp" />
<ClCompile Include="netvars.cpp" />
<ClCompile Include="Other.cpp" />
<ClCompile Include="PatternScan.cpp" />
<ClCompile Include="PlayerInventory.cpp" />
<ClCompile Include="protobuffs.cpp" />
<ClCompile Include="Skinchanger.cpp" />
<ClCompile Include="textinputcombobox.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="SpyCustom.rc" />
</ItemGroup>
<ItemGroup>
<Media Include="cod.wav">
<DeploymentContent>true</DeploymentContent>
</Media>
<Media Include="crit.wav">
<DeploymentContent>true</DeploymentContent>
</Media>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

View File

@ -1,623 +0,0 @@
#ifndef INCLUDED_STEAM2_USERID_STRUCTS
#define INCLUDED_STEAM2_USERID_STRUCTS
#if defined(_MSC_VER) && (_MSC_VER > 1000)
#pragma once
#endif
#ifdef __cplusplus
extern "C"
{
#endif
#if defined ( _WIN32 )
#ifdef STEAM_EXPORTS
#define STEAM_API __declspec(dllexport)
#else
#define STEAM_API __declspec(dllimport)
#endif
#define STEAM_CALL __cdecl
#else
#define STEAM_API
#define STEAM_CALL
#endif
typedef void (STEAM_CALL* KeyValueIteratorCallback_t)(const char* Key, const char* Val, void* pvParam);
#define STEAM_USING_FILESYSTEM (0x00000001)
#define STEAM_USING_LOGGING (0x00000002)
#define STEAM_USING_USERID (0x00000004)
#define STEAM_USING_ACCOUNT (0x00000008)
#define STEAM_USING_ALL (0x0000000f)
#define STEAM_MAX_PATH (255)
#define STEAM_QUESTION_MAXLEN (255)
#define STEAM_SALT_SIZE (8)
#define STEAM_PROGRESS_PERCENT_SCALE (0x00001000)
#define STEAM_CARD_NUMBER_SIZE (17)
#define STEAM_CARD_HOLDERNAME_SIZE (100)
#define STEAM_CARD_EXPYEAR_SIZE (4)
#define STEAM_CARD_EXPMONTH_SIZE (2)
#define STEAM_CARD_CVV2_SIZE (5)
#define STEAM_BILLING_ADDRESS1_SIZE (128)
#define STEAM_BILLING_ADDRESS2_SIZE (128)
#define STEAM_BILLING_CITY_SIZE (50)
#define STEAM_BILLING_ZIP_SIZE (16)
#define STEAM_BILLING_STATE_SIZE (32)
#define STEAM_BILLING_COUNTRY_SIZE (32)
#define STEAM_BILLING_PHONE_SIZE (20)
#define STEAM_BILLING_EMAIL_ADDRESS_SIZE (100)
#define STEAM_TYPE_OF_PROOF_OF_PURCHASE_SIZE (20)
#define STEAM_PROOF_OF_PURCHASE_TOKEN_SIZE (200)
#define STEAM_EXTERNAL_ACCOUNTNAME_SIZE (100)
#define STEAM_EXTERNAL_ACCOUNTPASSWORD_SIZE (80)
#define STEAM_BILLING_CONFIRMATION_CODE_SIZE (22)
#define STEAM_BILLING_CARD_APPROVAL_CODE_SIZE (100)
#define STEAM_BILLING_TRANS_DATE_SIZE (9)
#define STEAM_BILLING_TRANS_TIME_SIZE (9)
typedef unsigned int SteamHandle_t;
typedef void* SteamUserIDTicketValidationHandle_t;
typedef unsigned int SteamCallHandle_t;
#if defined(_MSC_VER)
typedef unsigned __int64 SteamUnsigned64_t;
#else
typedef unsigned long long SteamUnsigned64_t;
#endif
typedef enum
{
eSteamSeekMethodSet = 0,
eSteamSeekMethodCur = 1,
eSteamSeekMethodEnd = 2
} ESteamSeekMethod;
typedef enum
{
eSteamBufferMethodFBF = 0,
eSteamBufferMethodNBF = 1
} ESteamBufferMethod;
typedef enum
{
eSteamErrorNone = 0,
eSteamErrorUnknown = 1,
eSteamErrorLibraryNotInitialized = 2,
eSteamErrorLibraryAlreadyInitialized = 3,
eSteamErrorConfig = 4,
eSteamErrorContentServerConnect = 5,
eSteamErrorBadHandle = 6,
eSteamErrorHandlesExhausted = 7,
eSteamErrorBadArg = 8,
eSteamErrorNotFound = 9,
eSteamErrorRead = 10,
eSteamErrorEOF = 11,
eSteamErrorSeek = 12,
eSteamErrorCannotWriteNonUserConfigFile = 13,
eSteamErrorCacheOpen = 14,
eSteamErrorCacheRead = 15,
eSteamErrorCacheCorrupted = 16,
eSteamErrorCacheWrite = 17,
eSteamErrorCacheSession = 18,
eSteamErrorCacheInternal = 19,
eSteamErrorCacheBadApp = 20,
eSteamErrorCacheVersion = 21,
eSteamErrorCacheBadFingerPrint = 22,
eSteamErrorNotFinishedProcessing = 23,
eSteamErrorNothingToDo = 24,
eSteamErrorCorruptEncryptedUserIDTicket = 25,
eSteamErrorSocketLibraryNotInitialized = 26,
eSteamErrorFailedToConnectToUserIDTicketValidationServer = 27,
eSteamErrorBadProtocolVersion = 28,
eSteamErrorReplayedUserIDTicketFromClient = 29,
eSteamErrorReceiveResultBufferTooSmall = 30,
eSteamErrorSendFailed = 31,
eSteamErrorReceiveFailed = 32,
eSteamErrorReplayedReplyFromUserIDTicketValidationServer = 33,
eSteamErrorBadSignatureFromUserIDTicketValidationServer = 34,
eSteamErrorValidationStalledSoAborted = 35,
eSteamErrorInvalidUserIDTicket = 36,
eSteamErrorClientLoginRateTooHigh = 37,
eSteamErrorClientWasNeverValidated = 38,
eSteamErrorInternalSendBufferTooSmall = 39,
eSteamErrorInternalReceiveBufferTooSmall = 40,
eSteamErrorUserTicketExpired = 41,
eSteamErrorCDKeyAlreadyInUseOnAnotherClient = 42,
eSteamErrorNotLoggedIn = 101,
eSteamErrorAlreadyExists = 102,
eSteamErrorAlreadySubscribed = 103,
eSteamErrorNotSubscribed = 104,
eSteamErrorAccessDenied = 105,
eSteamErrorFailedToCreateCacheFile = 106,
eSteamErrorCallStalledSoAborted = 107,
eSteamErrorEngineNotRunning = 108,
eSteamErrorEngineConnectionLost = 109,
eSteamErrorLoginFailed = 110,
eSteamErrorAccountPending = 111,
eSteamErrorCacheWasMissingRetry = 112,
eSteamErrorLocalTimeIncorrect = 113,
eSteamErrorCacheNeedsDecryption = 114,
eSteamErrorAccountDisabled = 115,
eSteamErrorCacheNeedsRepair = 116,
eSteamErrorRebootRequired = 117,
eSteamErrorNetwork = 200,
eSteamErrorOffline = 201
} ESteamError;
typedef enum
{
eNoDetailedErrorAvailable,
eStandardCerrno,
eWin32LastError,
eWinSockLastError,
eDetailedPlatformErrorCount
} EDetailedPlatformErrorType;
typedef enum
{
eSteamFindLocalOnly,
eSteamFindRemoteOnly,
eSteamFindAll
} ESteamFindFilter;
typedef struct
{
ESteamError eSteamError;
EDetailedPlatformErrorType eDetailedErrorType;
int nDetailedErrorCode;
char szDesc[STEAM_MAX_PATH];
} TSteamError;
typedef struct
{
int bIsDir;
unsigned int uSizeOrCount;
int bIsLocal;
char cszName[STEAM_MAX_PATH];
long lLastAccessTime;
long lLastModificationTime;
long lCreationTime;
} TSteamElemInfo;
typedef struct
{
unsigned int uNumSubscriptions;
unsigned int uMaxNameChars;
unsigned int uMaxApps;
} TSteamSubscriptionStats;
typedef struct
{
unsigned int uNumApps;
unsigned int uMaxNameChars;
unsigned int uMaxInstallDirNameChars;
unsigned int uMaxVersionLabelChars;
unsigned int uMaxLaunchOptions;
unsigned int uMaxLaunchOptionDescChars;
unsigned int uMaxLaunchOptionCmdLineChars;
unsigned int uMaxNumIcons;
unsigned int uMaxIconSize;
unsigned int uMaxDependencies;
} TSteamAppStats;
typedef struct
{
char* szLabel;
unsigned int uMaxLabelChars;
unsigned int uVersionId;
int bIsNotAvailable;
} TSteamAppVersion;
typedef struct
{
char* szDesc;
unsigned int uMaxDescChars;
char* szCmdLine;
unsigned int uMaxCmdLineChars;
unsigned int uIndex;
unsigned int uIconIndex;
int bNoDesktopShortcut;
int bNoStartMenuShortcut;
int bIsLongRunningUnattended;
} TSteamAppLaunchOption;
typedef struct
{
char* szName;
unsigned int uMaxNameChars;
char* szLatestVersionLabel;
unsigned int uMaxLatestVersionLabelChars;
char* szCurrentVersionLabel;
unsigned int uMaxCurrentVersionLabelChars;
char* szInstallDirName;
unsigned int uMaxInstallDirNameChars;
unsigned int uId;
unsigned int uLatestVersionId;
unsigned int uCurrentVersionId;
unsigned int uMinCacheFileSizeMB;
unsigned int uMaxCacheFileSizeMB;
unsigned int uNumLaunchOptions;
unsigned int uNumIcons;
unsigned int uNumVersions;
unsigned int uNumDependencies;
} TSteamApp;
typedef enum
{
eNoCost = 0,
eBillOnceOnly = 1,
eBillMonthly = 2,
eProofOfPrepurchaseOnly = 3,
eGuestPass = 4,
eHardwarePromo = 5,
eNumBillingTypes,
} EBillingType;
typedef struct
{
char* szName;
unsigned int uMaxNameChars;
unsigned int* puAppIds;
unsigned int uMaxAppIds;
unsigned int uId;
unsigned int uNumApps;
EBillingType eBillingType;
unsigned int uCostInCents;
unsigned int uNumDiscounts;
int bIsPreorder;
int bRequiresShippingAddress;
unsigned int uDomesticShippingCostInCents;
unsigned int uInternationalShippingCostInCents;
bool bIsCyberCafeSubscription;
unsigned int uGameCode;
char szGameCodeDesc[STEAM_MAX_PATH];
bool bIsDisabled;
bool bRequiresCD;
unsigned int uTerritoryCode;
bool bIsSteam3Subscription;
} TSteamSubscription;
typedef struct
{
char szName[STEAM_MAX_PATH];
unsigned int uDiscountInCents;
unsigned int uNumQualifiers;
} TSteamSubscriptionDiscount;
typedef struct
{
char szName[STEAM_MAX_PATH];
unsigned int uRequiredSubscription;
int bIsDisqualifier;
} TSteamDiscountQualifier;
typedef struct TSteamProgress
{
int bValid;
unsigned int uPercentDone;
char szProgress[STEAM_MAX_PATH];
} TSteamProgress;
typedef enum
{
eSteamNotifyTicketsWillExpire,
eSteamNotifyAccountInfoChanged,
eSteamNotifyContentDescriptionChanged,
eSteamNotifyPleaseShutdown,
eSteamNotifyNewContentServer,
eSteamNotifySubscriptionStatusChanged,
eSteamNotifyContentServerConnectionLost,
eSteamNotifyCacheLoadingCompleted,
eSteamNotifyCacheNeedsDecryption,
eSteamNotifyCacheNeedsRepair
} ESteamNotificationCallbackEvent;
typedef void(*SteamNotificationCallback_t)(ESteamNotificationCallbackEvent eEvent, unsigned int nData);
typedef char SteamPersonalQuestion_t[STEAM_QUESTION_MAXLEN + 1];
typedef struct
{
unsigned char uchSalt[STEAM_SALT_SIZE];
} SteamSalt_t;
typedef enum
{
eVisa = 1,
eMaster = 2,
eAmericanExpress = 3,
eDiscover = 4,
eDinnersClub = 5,
eJCB = 6
} ESteamPaymentCardType;
typedef struct
{
ESteamPaymentCardType eCardType;
char szCardNumber[STEAM_CARD_NUMBER_SIZE + 1];
char szCardHolderName[STEAM_CARD_HOLDERNAME_SIZE + 1];
char szCardExpYear[STEAM_CARD_EXPYEAR_SIZE + 1];
char szCardExpMonth[STEAM_CARD_EXPMONTH_SIZE + 1];
char szCardCVV2[STEAM_CARD_CVV2_SIZE + 1];
char szBillingAddress1[STEAM_BILLING_ADDRESS1_SIZE + 1];
char szBillingAddress2[STEAM_BILLING_ADDRESS2_SIZE + 1];
char szBillingCity[STEAM_BILLING_CITY_SIZE + 1];
char szBillingZip[STEAM_BILLING_ZIP_SIZE + 1];
char szBillingState[STEAM_BILLING_STATE_SIZE + 1];
char szBillingCountry[STEAM_BILLING_COUNTRY_SIZE + 1];
char szBillingPhone[STEAM_BILLING_PHONE_SIZE + 1];
char szBillingEmailAddress[STEAM_BILLING_EMAIL_ADDRESS_SIZE + 1];
unsigned int uExpectedCostInCents;
unsigned int uExpectedTaxInCents;
char szShippingName[STEAM_CARD_HOLDERNAME_SIZE + 1];
char szShippingAddress1[STEAM_BILLING_ADDRESS1_SIZE + 1];
char szShippingAddress2[STEAM_BILLING_ADDRESS2_SIZE + 1];
char szShippingCity[STEAM_BILLING_CITY_SIZE + 1];
char szShippingZip[STEAM_BILLING_ZIP_SIZE + 1];
char szShippingState[STEAM_BILLING_STATE_SIZE + 1];
char szShippingCountry[STEAM_BILLING_COUNTRY_SIZE + 1];
char szShippingPhone[STEAM_BILLING_PHONE_SIZE + 1];
unsigned int uExpectedShippingCostInCents;
} TSteamPaymentCardInfo;
typedef struct
{
char szTypeOfProofOfPurchase[STEAM_TYPE_OF_PROOF_OF_PURCHASE_SIZE + 1];
unsigned int uLengthOfBinaryProofOfPurchaseToken;
char cBinaryProofOfPurchaseToken[STEAM_PROOF_OF_PURCHASE_TOKEN_SIZE + 1];
} TSteamPrepurchaseInfo;
typedef struct
{
char szAccountName[STEAM_EXTERNAL_ACCOUNTNAME_SIZE + 1];
char szPassword[STEAM_EXTERNAL_ACCOUNTPASSWORD_SIZE + 1];
} TSteamExternalBillingInfo;
typedef enum
{
ePaymentCardInfo = 1,
ePrepurchasedInfo = 2,
eAccountBillingInfo = 3,
eExternalBillingInfo = 4,
ePaymentCardReceipt = 5,
ePrepurchaseReceipt = 6,
eEmptyReceipt = 7
} ESteamSubscriptionBillingInfoType;
typedef struct
{
ESteamSubscriptionBillingInfoType eBillingInfoType;
union {
TSteamPaymentCardInfo PaymentCardInfo;
TSteamPrepurchaseInfo PrepurchaseInfo;
TSteamExternalBillingInfo ExternalBillingInfo;
char bUseAccountBillingInfo;
};
} TSteamSubscriptionBillingInfo;
typedef enum
{
eSteamSubscriptionOK = 0,
eSteamSubscriptionPending = 1,
eSteamSubscriptionPreorder = 2,
eSteamSubscriptionPrepurchaseTransferred = 3,
eSteamSubscriptionPrepurchaseInvalid = 4,
eSteamSubscriptionPrepurchaseRejected = 5,
eSteamSubscriptionPrepurchaseRevoked = 6,
eSteamSubscriptionPaymentCardDeclined = 7,
eSteamSubscriptionCancelledByUser = 8,
eSteamSubscriptionCancelledByVendor = 9,
eSteamSubscriptionPaymentCardUseLimit = 10,
eSteamSubscriptionPaymentCardAlert = 11,
eSteamSubscriptionFailed = 12,
eSteamSubscriptionPaymentCardAVSFailure = 13,
eSteamSubscriptionPaymentCardInsufficientFunds = 14,
eSteamSubscriptionRestrictedCountry = 15
} ESteamSubscriptionStatus;
typedef struct
{
ESteamPaymentCardType eCardType;
char szCardLastFourDigits[4 + 1];
char szCardHolderName[STEAM_CARD_HOLDERNAME_SIZE + 1];
char szBillingAddress1[STEAM_BILLING_ADDRESS1_SIZE + 1];
char szBillingAddress2[STEAM_BILLING_ADDRESS2_SIZE + 1];
char szBillingCity[STEAM_BILLING_CITY_SIZE + 1];
char szBillingZip[STEAM_BILLING_ZIP_SIZE + 1];
char szBillingState[STEAM_BILLING_STATE_SIZE + 1];
char szBillingCountry[STEAM_BILLING_COUNTRY_SIZE + 1];
char szCardApprovalCode[STEAM_BILLING_CARD_APPROVAL_CODE_SIZE + 1];
char szTransDate[STEAM_BILLING_TRANS_DATE_SIZE + 1];
char szTransTime[STEAM_BILLING_TRANS_TIME_SIZE + 1];
unsigned int uPriceWithoutTax;
unsigned int uTaxAmount;
unsigned int uShippingCost;
} TSteamPaymentCardReceiptInfo;
typedef struct
{
char szTypeOfProofOfPurchase[STEAM_TYPE_OF_PROOF_OF_PURCHASE_SIZE + 1];
} TSteamPrepurchaseReceiptInfo;
typedef struct
{
ESteamSubscriptionStatus eStatus;
ESteamSubscriptionStatus ePreviousStatus;
ESteamSubscriptionBillingInfoType eReceiptInfoType;
char szConfirmationCode[STEAM_BILLING_CONFIRMATION_CODE_SIZE + 1];
union {
TSteamPaymentCardReceiptInfo PaymentCardReceiptInfo;
TSteamPrepurchaseReceiptInfo PrepurchaseReceiptInfo;
};
} TSteamSubscriptionReceipt;
typedef enum
{
ePhysicalBytesReceivedThisSession = 1,
eAppReadyToLaunchStatus = 2,
eAppPreloadStatus = 3,
eAppEntireDepot = 4,
eCacheBytesPresent = 5
} ESteamAppUpdateStatsQueryType;
typedef struct
{
SteamUnsigned64_t uBytesTotal;
SteamUnsigned64_t uBytesPresent;
} TSteamUpdateStats;
typedef enum
{
eSteamUserAdministrator = 0x00000001,
eSteamUserDeveloper = 0x00000002,
eSteamUserCyberCafe = 0x00000004
} ESteamUserTypeFlags;
typedef enum
{
eSteamAccountStatusDefault = 0x00000000,
eSteamAccountStatusEmailVerified = 0x00000001,
eSteamAccountDisabled = 0x00000004
} ESteamAccountStatusBitFields;
typedef enum
{
eSteamBootstrapperError = -1,
eSteamBootstrapperDontCheckForUpdate = 0,
eSteamBootstrapperCheckForUpdateAndRerun = 7
} ESteamBootStrapperClientAppResult;
typedef enum
{
eSteamOnline = 0,
eSteamOffline = 1,
eSteamNoAuthMode = 2,
eSteamBillingOffline = 3
} eSteamOfflineStatus;
typedef struct
{
int eOfflineNow;
int eOfflineNextSession;
} TSteamOfflineStatus;
typedef struct
{
unsigned int uAppId;
int bIsSystemDefined;
char szMountPath[STEAM_MAX_PATH];
} TSteamAppDependencyInfo;
typedef enum
{
eSteamOpenFileRegular = 0x0,
eSteamOpenFileIgnoreLocal = 0x1,
eSteamOpenFileChecksumReads = 0x2
} ESteamOpenFileFlags;
typedef enum
{
eSteamValveCDKeyValidationServer = 0,
eSteamHalfLifeMasterServer = 1,
eSteamFriendsServer = 2,
eSteamCSERServer = 3,
eSteamHalfLife2MasterServer = 4,
eSteamRDKFMasterServer = 5,
eMaxServerTypes = 6
} ESteamServerType;
#ifdef __cplusplus
const SteamHandle_t STEAM_INVALID_HANDLE = 0;
const SteamCallHandle_t STEAM_INVALID_CALL_HANDLE = 0;
const SteamUserIDTicketValidationHandle_t STEAM_INACTIVE_USERIDTICKET_VALIDATION_HANDLE = 0;
const unsigned int STEAM_USE_LATEST_VERSION = 0xFFFFFFFF;
#else
#define STEAM_INVALID_HANDLE ((SteamHandle_t)(0))
#define STEAM_INVALID_CALL_HANDLE ((SteamCallHandle_t)(0))
#define STEAM_INACTIVE_USERIDTICKET_VALIDATION_HANDLE ((SteamUserIDTicketValidationHandle_t)(0))
#define STEAM_USE_LATEST_VERSION (0xFFFFFFFFu);
#endif
typedef unsigned short SteamInstanceID_t;
#if defined ( _WIN32 )
typedef unsigned __int64 SteamLocalUserID_t;
#else
typedef unsigned long long SteamLocalUserID_t;
#endif
typedef struct
{
unsigned int Low32bits;
unsigned int High32bits;
} TSteamSplitLocalUserID;
typedef struct
{
SteamInstanceID_t m_SteamInstanceID;
union
{
SteamLocalUserID_t As64bits;
TSteamSplitLocalUserID Split;
} m_SteamLocalUserID;
} TSteamGlobalUserID;
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,280 +0,0 @@
#ifndef TEXTENTRY_H
#define TEXTENTRY_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "Color.h"
#include "Panel.h"
#include "Label.h"
#include "ListPanel.h"
#include "utlvector.h"
namespace vgui
{
class TextEntry : public Panel
{
DECLARE_CLASS_SIMPLE(TextEntry, Panel);
public:
TextEntry(Panel* parent, const char* panelName);
virtual ~TextEntry();
virtual void SetText(const wchar_t* wszText);
virtual void SetText(const char* text);
virtual void GetText(OUT_Z_BYTECAP(bufLenInBytes) char* buf, int bufLenInBytes);
virtual void GetText(OUT_Z_BYTECAP(bufLenInBytes) wchar_t* buf, int bufLenInBytes);
virtual int GetTextLength() const;
virtual bool IsTextFullySelected() const;
virtual void GotoLeft();
virtual void GotoRight();
virtual void GotoUp();
virtual void GotoDown();
virtual void GotoWordRight();
virtual void GotoWordLeft();
virtual void GotoFirstOfLine();
virtual void GotoEndOfLine();
virtual void GotoTextStart();
virtual void GotoTextEnd();
virtual void InsertChar(wchar_t ch);
virtual void InsertString(const char* text);
virtual void InsertString(const wchar_t* wszText);
virtual void Backspace();
virtual void Delete();
virtual void SelectNone();
virtual void OpenEditMenu();
MESSAGE_FUNC(CutSelected, "DoCutSelected");
MESSAGE_FUNC(CopySelected, "DoCopySelected");
MESSAGE_FUNC(Paste, "DoPaste");
MESSAGE_FUNC_INT(LanguageChanged, "DoLanguageChanged", handle);
MESSAGE_FUNC_INT(ConversionModeChanged, "DoConversionModeChanged", handle);
MESSAGE_FUNC_INT(SentenceModeChanged, "DoSentenceModeChanged", handle);
MESSAGE_FUNC_WCHARPTR(CompositionString, "DoCompositionString", string);
MESSAGE_FUNC(ShowIMECandidates, "DoShowIMECandidates");
MESSAGE_FUNC(HideIMECandidates, "DoHideIMECandidates");
MESSAGE_FUNC(UpdateIMECandidates, "DoUpdateIMECandidates");
virtual void DeleteSelected();
virtual void Undo();
virtual void SaveUndoState();
virtual void SetFont(HFont font);
virtual void SetTextHidden(bool bHideText);
virtual void SetEditable(bool state);
virtual bool IsEditable();
virtual void SetEnabled(bool state);
virtual void MoveCursor(int line, int pixelsAcross);
virtual void SetDisabledBgColor(Color col);
virtual void SetMultiline(bool state);
virtual bool IsMultiline();
virtual void SetVerticalScrollbar(bool state);
virtual void SetCatchEnterKey(bool state);
virtual void SendNewLine(bool send);
virtual void SetMaximumCharCount(int maxChars);
virtual int GetMaximumCharCount();
virtual void SetAutoProgressOnHittingCharLimit(bool state);
virtual void SetWrap(bool wrap);
virtual void RecalculateLineBreaks();
virtual void LayoutVerticalScrollBarSlider();
virtual bool RequestInfo(KeyValues* outputData);
void SetToFullHeight();
void SetToFullWidth();
int GetNumLines();
void SelectAllText(bool bResetCursorPos);
void SelectNoText();
void SelectAllOnFirstFocus(bool status);
void SetDrawWidth(int width);
int GetDrawWidth();
void SetHorizontalScrolling(bool status);
void SetAllowNonAsciiCharacters(bool state);
void SetAllowNumericInputOnly(bool state);
void SetDrawLanguageIDAtLeft(bool state);
virtual bool GetDropContextMenu(Menu* menu, CUtlVector< KeyValues* >& data);
virtual bool IsDroppable(CUtlVector< KeyValues* >& data);
virtual void OnPanelDropped(CUtlVector< KeyValues* >& data);
virtual Panel* GetDragPanel();
virtual void OnCreateDragData(KeyValues* msg);
void SelectAllOnFocusAlways(bool status);
void SetSelectionTextColor(const Color& clr);
void SetSelectionBgColor(const Color& clr);
void SetSelectionUnfocusedBgColor(const Color& clr);
void SetUseFallbackFont(bool bState, HFont hFallback);
protected:
virtual void ResetCursorBlink();
virtual void PerformLayout();
virtual void ApplySchemeSettings(IScheme* pScheme);
virtual void PaintBackground();
virtual int DrawChar(wchar_t ch, HFont font, int index, int x, int y);
virtual bool DrawCursor(int x, int y);
virtual void SetCharAt(wchar_t ch, int index);
virtual void ApplySettings(KeyValues* inResourceData);
virtual void GetSettings(KeyValues* outResourceData);
virtual const char* GetDescription(void);
virtual void FireActionSignal();
virtual bool GetSelectedRange(int& cx0, int& cx1);
virtual void CursorToPixelSpace(int cursorPos, int& cx, int& cy);
virtual int PixelToCursorSpace(int cx, int cy);
virtual void AddAnotherLine(int& cx, int& cy);
virtual int GetYStart();
virtual bool SelectCheck(bool fromMouse = false);
MESSAGE_FUNC_WCHARPTR(OnSetText, "SetText", text);
MESSAGE_FUNC(OnSliderMoved, "ScrollBarSliderMoved");
virtual void OnKillFocus();
virtual void OnMouseWheeled(int delta);
virtual void OnKeyCodePressed(KeyCode code);
virtual void OnKeyCodeTyped(KeyCode code);
virtual void OnKeyTyped(wchar_t unichar);
virtual void OnCursorMoved(int x, int y);
virtual void OnMousePressed(MouseCode code);
virtual void OnMouseDoublePressed(MouseCode code);
virtual void OnMouseTriplePressed(MouseCode code);
virtual void OnMouseReleased(MouseCode code);
virtual void OnKeyFocusTicked();
virtual void OnMouseFocusTicked();
virtual void OnCursorEntered();
virtual void OnCursorExited();
virtual void OnMouseCaptureLost();
virtual void OnSizeChanged(int newWide, int newTall);
virtual int GetStartDrawIndex(int& lineBreakIndexIndex);
public:
virtual float GetValueAsFloat();
virtual int GetValueAsInt();
protected:
void ScrollRight();
void ScrollLeft();
bool IsCursorOffRightSideOfWindow(int cursorPos);
bool IsCursorOffLeftSideOfWindow(int cursorPos);
void ScrollLeftForResize();
void OnSetFocus();
void OnChangeIME(bool forward);
bool NeedsEllipses(HFont font, int* pIndex);
private:
MESSAGE_FUNC_INT(OnSetState, "SetState", state);
int GetCurrentLineStart();
int GetCurrentLineEnd();
bool IsLineBreak(int index);
int GetCursorLine();
void MoveScrollBar(int delta);
void CalcBreakIndex();
void CreateEditMenu();
public:
Menu* GetEditMenu();
private:
void FlipToLastIME();
public:
virtual void GetTextRange(wchar_t* buf, int from, int numchars);
virtual void GetTextRange(char* buf, int from, int numchars);
private:
CUtlVector<wchar_t> m_TextStream;
CUtlVector<wchar_t> m_UndoTextStream;
CUtlVector<int> m_LineBreaks;
int _cursorPos;
bool _cursorIsAtEnd;
bool _putCursorAtEnd;
int _undoCursorPos;
bool _cursorBlink;
bool _hideText;
bool _editable;
bool _mouseSelection;
bool _mouseDragSelection;
int _mouseSelectCursorStart;
long _cursorNextBlinkTime;
int _cursorBlinkRate;
int _select[2];
int _pixelsIndent;
int _charCount;
int _maxCharCount;
HFont _font;
HFont _smallfont;
bool _dataChanged;
bool _multiline;
bool _verticalScrollbar;
ScrollBar* _vertScrollBar;
Color _cursorColor;
Color _disabledFgColor;
Color _disabledBgColor;
Color _selectionColor;
Color _selectionTextColor;
Color _defaultSelectionBG2Color;
int _currentStartLine;
int _currentStartIndex;
bool _horizScrollingAllowed;
Color _focusEdgeColor;
bool _catchEnterKey;
bool _wrap;
bool _sendNewLines;
int _drawWidth;
Menu* m_pEditMenu;
int _recalculateBreaksIndex;
bool _selectAllOnFirstFocus : 1;
bool _selectAllOnFocusAlways : 1;
bool _firstFocusStatus;
bool m_bAllowNumericInputOnly;
bool m_bAllowNonAsciiCharacters;
bool m_bAutoProgressOnHittingCharLimit;
enum
{
MAX_COMPOSITION_STRING = 256,
};
wchar_t m_szComposition[MAX_COMPOSITION_STRING];
Menu* m_pIMECandidates;
int m_hPreviousIME;
bool m_bDrawLanguageIDAtLeft;
int m_nLangInset;
bool m_bUseFallbackFont : 1;
HFont m_hFallbackFont;
};
}
#endif

View File

@ -1,118 +0,0 @@
#ifndef TEXTIMAGE_H
#define TEXTIMAGE_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "ILocalize.h"
#include "Image.h"
#include "utlvector.h"
#include "UtlSortVector.h"
class KeyValues;
namespace vgui
{
struct label_colorchange_t
{
Color color;
int textStreamIndex;
};
class CColorChangeListLess
{
public:
bool Less(const label_colorchange_t& src1, const label_colorchange_t& src2, void* pCtx)
{
if (src1.textStreamIndex < src2.textStreamIndex)
return true;
return false;
}
};
class TextImage : public Image
{
public:
TextImage(const char* text);
TextImage(const wchar_t* wszText);
~TextImage();
public:
virtual void SetText(const char* text);
virtual void SetText(const wchar_t* text, bool bClearUnlocalizedSymbol = false);
virtual void GetText(char* buffer, int bufferSize);
virtual void GetText(wchar_t* buffer, int bufferLength);
virtual void GetUnlocalizedText(char* buffer, int bufferSize);
virtual StringIndex_t GetUnlocalizedTextSymbol();
virtual void SetFont(vgui::HFont font);
virtual vgui::HFont GetFont();
void SetDrawWidth(int width);
void GetDrawWidth(int& width);
void ResizeImageToContent();
void ResizeImageToContentMaxWidth(int nMaxWidth);
virtual void SetSize(int wide, int tall);
virtual void GetContentSize(int& wide, int& tall);
virtual void Paint();
void SetWrap(bool bWrap);
void RecalculateNewLinePositions();
void SetUseFallbackFont(bool bState, HFont hFallback);
void SetAllCaps(bool bAllCaps);
void SetCenterWrap(bool bWrap);
void RecalculateCenterWrapIndents();
const wchar_t* GetUText(void) { return _utext; }
void AddColorChange(Color col, int iTextStreamIndex);
void SetColorChangeStream(CUtlSortVector<label_colorchange_t, CColorChangeListLess>* pUtlVecStream);
void ClearColorChangeStream(void) { m_ColorChangeStream.Purge(); }
const wchar_t* GetEllipsesPosition(void) const { return m_pwszEllipsesPosition; }
bool IsWrapping() const { return m_LineBreaks.Count() != 0; }
protected:
void SizeText(wchar_t* tempText, int stringLength);
virtual void GetTextSize(int& wide, int& tall);
private:
void RecalculateEllipsesPosition();
wchar_t* _utext;
short _textBufferLen;
short _textLen;
vgui::HFont _font;
vgui::HFont _fallbackFont;
int _drawWidth;
StringIndex_t _unlocalizedTextSymbol;
wchar_t* m_pwszEllipsesPosition;
bool m_bRecalculateTruncation : 1;
bool m_bWrap : 1;
bool m_bUseFallbackFont : 1;
bool m_bRenderUsingFallbackFont : 1;
bool m_bAllCaps : 1;
CUtlVector<wchar_t*> m_LineBreaks;
bool m_bWrapCenter;
CUtlVector<int> m_LineXIndent;
CUtlSortVector<label_colorchange_t, CColorChangeListLess> m_ColorChangeStream;
};
}
#endif

View File

@ -1,38 +0,0 @@
#ifndef TOGGLEBUTTON_H
#define TOGGLEBUTTON_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "Button.h"
namespace vgui
{
class ToggleButton : public Button
{
DECLARE_CLASS_SIMPLE(ToggleButton, Button);
public:
ToggleButton(Panel* parent, const char* panelName, const char* text);
virtual void DoClick();
protected:
virtual void OnMouseDoublePressed(MouseCode code);
virtual Color GetButtonFgColor();
virtual void ApplySchemeSettings(IScheme* pScheme);
virtual bool CanBeDefaultButton(void);
virtual void OnKeyCodePressed(KeyCode code);
private:
Color _selectedColor;
};
}
#endif

View File

@ -1,66 +0,0 @@
#ifndef TOOLTIP_H
#define TOOLTIP_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "Controls.h"
#include "utlvector.h"
namespace vgui
{
class BaseTooltip
{
public:
BaseTooltip(Panel* parent, const char* text = NULL);
virtual void SetText(const char* text);
virtual const char* GetText();
virtual void ShowTooltip(Panel* currentPanel);
virtual void HideTooltip();
bool ShouldLayout(void);
virtual void PerformLayout() { return; }
virtual void PositionWindow(Panel* pTipPanel);
void ResetDelay();
void SetTooltipFormatToSingleLine();
void SetTooltipFormatToMultiLine();
void SetTooltipDelay(int tooltipDelayMilliseconds);
int GetTooltipDelay();
void SetEnabled(bool bState);
private:
Panel* m_pParent;
virtual void ApplySchemeSettings(IScheme* pScheme) {};
protected:
CUtlVector<char> m_Text;
int _delay;
int _tooltipDelay;
bool _makeVisible : 1;
bool _displayOnOneLine : 1;
bool _isDirty : 1;
bool _enabled : 1;
};
class TextTooltip : public BaseTooltip
{
public:
TextTooltip(Panel* parent, const char* text = NULL);
~TextTooltip();
virtual void SetText(const char* text);
virtual void ShowTooltip(Panel* currentPanel);
virtual void HideTooltip();
virtual void SizeTextWindow();
virtual void PerformLayout();
virtual void ApplySchemeSettings(IScheme* pScheme);
};
};
#endif

View File

@ -1,316 +0,0 @@
#ifndef UTLSORTVECTOR_H
#define UTLSORTVECTOR_H
#ifdef _WIN32
#pragma once
#endif
#include "utlvector.h"
#ifndef _WIN32
extern void* g_pUtlSortVectorQSortContext;
#endif
template <class T>
class CUtlSortVectorDefaultLess
{
public:
bool Less(const T& lhs, const T& rhs, void*)
{
return lhs < rhs;
}
};
template <class T, class LessFunc = CUtlSortVectorDefaultLess<T>, class BaseVector = CUtlVector<T> >
class CUtlSortVector : public BaseVector
{
typedef BaseVector BaseClass;
public:
CUtlSortVector(int nGrowSize = 0, int initSize = 0);
CUtlSortVector(T* pMemory, int numElements);
int Insert(const T& src);
int InsertIfNotFound(const T& src);
template< typename TKey >
int Find(const TKey& search) const;
template< typename TKey >
int FindLessOrEqual(const TKey& search) const;
template< typename TKey >
int FindLess(const TKey& search) const;
void Remove(const T& search);
void Remove(int i);
void SetLessContext(void* pCtx);
int InsertNoSort(const T& src);
void RedoSort(bool bForceSort = false);
int InsertAfter(int nElemIndex, const T& src);
template< typename TKey >
int FindUnsorted(const TKey& src) const;
protected:
CUtlSortVector(const CUtlSortVector<T, LessFunc>&);
int AddToHead();
int AddToTail();
int InsertBefore(int elem);
int InsertAfter(int elem);
int InsertBefore(int elem, const T& src);
int AddToHead(const T& src);
int AddToTail(const T& src);
int AddMultipleToHead(int num);
int AddMultipleToTail(int num, const T* pToCopy = NULL);
int InsertMultipleBefore(int elem, int num, const T* pToCopy = NULL);
int InsertMultipleAfter(int elem, int num);
int AddVectorToTail(CUtlVector<T> const& src);
struct QSortContext_t
{
void* m_pLessContext;
LessFunc* m_pLessFunc;
};
#ifdef _WIN32
static int CompareHelper(void* context, const T* lhs, const T* rhs)
{
QSortContext_t* ctx = reinterpret_cast<QSortContext_t*>(context);
if (ctx->m_pLessFunc->Less(*lhs, *rhs, ctx->m_pLessContext))
return -1;
if (ctx->m_pLessFunc->Less(*rhs, *lhs, ctx->m_pLessContext))
return 1;
return 0;
}
#else
static int CompareHelper(const T* lhs, const T* rhs)
{
QSortContext_t* ctx = reinterpret_cast<QSortContext_t*>(g_pUtlSortVectorQSortContext);
if (ctx->m_pLessFunc->Less(*lhs, *rhs, ctx->m_pLessContext))
return -1;
if (ctx->m_pLessFunc->Less(*rhs, *lhs, ctx->m_pLessContext))
return 1;
return 0;
}
#endif
void* m_pLessContext;
bool m_bNeedsSort;
private:
private:
template< typename TKey >
int FindLessOrEqual(const TKey& search, bool* pFound) const;
void QuickSort(LessFunc& less, int X, int I);
};
template <class T, class LessFunc, class BaseVector>
CUtlSortVector<T, LessFunc, BaseVector>::CUtlSortVector(int nGrowSize, int initSize) :
m_pLessContext(NULL), BaseVector(nGrowSize, initSize), m_bNeedsSort(false)
{
}
template <class T, class LessFunc, class BaseVector>
CUtlSortVector<T, LessFunc, BaseVector>::CUtlSortVector(T* pMemory, int numElements) :
m_pLessContext(NULL), BaseVector(pMemory, numElements), m_bNeedsSort(false)
{
}
template <class T, class LessFunc, class BaseVector>
void CUtlSortVector<T, LessFunc, BaseVector>::SetLessContext(void* pCtx)
{
m_pLessContext = pCtx;
}
template <class T, class LessFunc, class BaseVector>
int CUtlSortVector<T, LessFunc, BaseVector>::Insert(const T& src)
{
AssertFatal(!m_bNeedsSort);
int pos = FindLessOrEqual(src) + 1;
this->GrowVector();
this->ShiftElementsRight(pos);
CopyConstruct<T>(&this->Element(pos), src);
return pos;
}
template <class T, class LessFunc, class BaseVector>
int CUtlSortVector<T, LessFunc, BaseVector>::InsertNoSort(const T& src)
{
m_bNeedsSort = true;
int lastElement = BaseVector::m_Size;
this->GrowVector();
this->ShiftElementsRight(lastElement);
CopyConstruct(&this->Element(lastElement), src);
return lastElement;
}
template <class T, class LessFunc, class BaseVector>
int CUtlSortVector<T, LessFunc, BaseVector>::InsertIfNotFound(const T& src)
{
AssertFatal(!m_bNeedsSort);
bool bFound;
int pos = FindLessOrEqual(src, &bFound);
if (bFound)
return pos;
++pos;
this->GrowVector();
this->ShiftElementsRight(pos);
CopyConstruct<T>(&this->Element(pos), src);
return pos;
}
template <class T, class LessFunc, class BaseVector>
int CUtlSortVector<T, LessFunc, BaseVector>::InsertAfter(int nIndex, const T& src)
{
int nInsertedIndex = this->BaseClass::InsertAfter(nIndex, src);
#ifdef DEBUG
LessFunc less;
if (nInsertedIndex > 0)
{
Assert(less.Less(this->Element(nInsertedIndex - 1), src, m_pLessContext));
}
if (nInsertedIndex < BaseClass::Count() - 1)
{
Assert(less.Less(src, this->Element(nInsertedIndex + 1), m_pLessContext));
}
#endif
return nInsertedIndex;
}
template <class T, class LessFunc, class BaseVector>
template < typename TKey >
int CUtlSortVector<T, LessFunc, BaseVector>::Find(const TKey& src) const
{
AssertFatal(!m_bNeedsSort);
LessFunc less;
int start = 0, end = this->Count() - 1;
while (start <= end)
{
int mid = (start + end) >> 1;
if (less.Less(this->Element(mid), src, m_pLessContext))
{
start = mid + 1;
}
else if (less.Less(src, this->Element(mid), m_pLessContext))
{
end = mid - 1;
}
else
{
return mid;
}
}
return -1;
}
template< class T, class LessFunc, class BaseVector >
template < typename TKey >
int CUtlSortVector<T, LessFunc, BaseVector>::FindUnsorted(const TKey& src) const
{
LessFunc less;
int nCount = this->Count();
for (int i = 0; i < nCount; ++i)
{
if (less.Less(this->Element(i), src, m_pLessContext))
continue;
if (less.Less(src, this->Element(i), m_pLessContext))
continue;
return i;
}
return -1;
}
template <class T, class LessFunc, class BaseVector>
template < typename TKey >
int CUtlSortVector<T, LessFunc, BaseVector>::FindLessOrEqual(const TKey& src, bool* pFound) const
{
AssertFatal(!m_bNeedsSort);
LessFunc less;
int start = 0, end = this->Count() - 1;
while (start <= end)
{
int mid = (start + end) >> 1;
if (less.Less(this->Element(mid), src, m_pLessContext))
{
start = mid + 1;
}
else if (less.Less(src, this->Element(mid), m_pLessContext))
{
end = mid - 1;
}
else
{
*pFound = true;
return mid;
}
}
*pFound = false;
return end;
}
template <class T, class LessFunc, class BaseVector>
template < typename TKey >
int CUtlSortVector<T, LessFunc, BaseVector>::FindLessOrEqual(const TKey& src) const
{
bool bFound;
return FindLessOrEqual(src, &bFound);
}
template <class T, class LessFunc, class BaseVector>
template < typename TKey >
int CUtlSortVector<T, LessFunc, BaseVector>::FindLess(const TKey& src) const
{
AssertFatal(!m_bNeedsSort);
LessFunc less;
int start = 0, end = this->Count() - 1;
while (start <= end)
{
int mid = (start + end) >> 1;
if (less.Less(this->Element(mid), src, m_pLessContext))
{
start = mid + 1;
}
else
{
end = mid - 1;
}
}
return end;
}
template <class T, class LessFunc, class BaseVector>
void CUtlSortVector<T, LessFunc, BaseVector>::Remove(const T& search)
{
AssertFatal(!m_bNeedsSort);
int pos = Find(search);
if (pos != -1)
{
BaseVector::Remove(pos);
}
}
template <class T, class LessFunc, class BaseVector>
void CUtlSortVector<T, LessFunc, BaseVector>::Remove(int i)
{
BaseVector::Remove(i);
}
#endif

View File

@ -1,90 +0,0 @@
#ifndef UTLSTRINGMAP_H
#define UTLSTRINGMAP_H
#ifdef _WIN32
#pragma once
#endif
#include "utlsymbol.h"
template <class T>
class CUtlStringMap
{
public:
CUtlStringMap(bool caseInsensitive = true) : m_SymbolTable(0, 32, caseInsensitive)
{
}
T& operator[](const char* pString)
{
CUtlSymbol symbol = m_SymbolTable.AddString(pString);
int index = (int)(UtlSymId_t)symbol;
if (m_Vector.Count() <= index)
{
m_Vector.EnsureCount(index + 1);
}
return m_Vector[index];
}
T& operator[](UtlSymId_t n)
{
Assert(n >= 0 && n <= m_Vector.Count());
return m_Vector[n];
}
const T& operator[](UtlSymId_t n) const
{
Assert(n >= 0 && n <= m_Vector.Count());
return m_Vector[n];
}
bool Defined(const char* pString) const
{
return m_SymbolTable.Find(pString) != UTL_INVAL_SYMBOL;
}
UtlSymId_t Find(const char* pString) const
{
return m_SymbolTable.Find(pString);
}
static UtlSymId_t InvalidIndex()
{
return UTL_INVAL_SYMBOL;
}
int GetNumStrings(void) const
{
return m_SymbolTable.GetNumStrings();
}
const char* String(int n) const
{
return m_SymbolTable.String(n);
}
void Clear()
{
m_Vector.RemoveAll();
m_SymbolTable.RemoveAll();
}
void Purge()
{
m_Vector.Purge();
m_SymbolTable.RemoveAll();
}
void PurgeAndDeleteElements()
{
m_Vector.PurgeAndDeleteElements();
m_SymbolTable.RemoveAll();
}
private:
CUtlVector<T> m_Vector;
CUtlSymbolTable m_SymbolTable;
};
#endif

View File

@ -1,60 +0,0 @@
#ifndef VGUI_H
#define VGUI_H
#ifdef _WIN32
#pragma once
#endif
#define null 0L
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif
#pragma warning( disable: 4800 )
#pragma warning( disable: 4786 )
#pragma warning( disable: 4355 )
#pragma warning( disable: 4097 )
#pragma warning( disable: 4514 )
#pragma warning( disable: 4100 )
#pragma warning( disable: 4127 )
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
#ifndef _WCHAR_T_DEFINED
#if !defined( __x86_64__ ) && !defined( __WCHAR_TYPE__ )
typedef unsigned short wchar_t;
#define _WCHAR_T_DEFINED
#endif
#endif
namespace vgui
{
typedef unsigned int VPANEL;
typedef unsigned long HScheme;
typedef unsigned long HTexture;
typedef unsigned long HCursor;
typedef unsigned long HPanel;
const HPanel INVALID_PANEL = 0xffffffff;
typedef unsigned long HFont;
const HFont INVALID_FONT = 0;
}
#include "strtools.h"
#if 0
#define USE_GETKERNEDCHARWIDTH 1
#else
#define USE_GETKERNEDCHARWIDTH 0
#endif
#endif

View File

@ -1,75 +0,0 @@
#pragma once
#include <cstdint>
#include <Windows.h>
#include <iostream>
class VMTHook
{
public:
VMTHook(void* classptr)
{
this->class_pointer = reinterpret_cast<uintptr_t**>(classptr);
int table_size = 0;
while (reinterpret_cast<uintptr_t*>(*this->class_pointer)[table_size])
table_size++;
original_pointer = *this->class_pointer;
new_table_pointer = new uintptr_t[sizeof(uintptr_t) * table_size];
memcpy(new_table_pointer, original_pointer, sizeof(uintptr_t) * table_size);
}
~VMTHook()
{
RestoreOldTable();
delete original_pointer;
delete new_table_pointer;
}
void SwapPointer(size_t index, void* new_function)
{
#ifdef DEBUG
printf("Swapping pointer 0x%X to 0x%X\n", new_table_pointer[index], reinterpret_cast<uintptr_t>(new_function));
#endif
new_table_pointer[index] = reinterpret_cast<uintptr_t>(new_function);
#ifdef DEBUG
printf("Swapped pointer!\n");
#endif
}
void ApplyNewTable()
{
#ifdef DEBUG
printf("Applying new table... (0x%X to 0x%X)\n", reinterpret_cast<uintptr_t>(*class_pointer), reinterpret_cast<uintptr_t>(new_table_pointer));
#endif
*class_pointer = new_table_pointer;
#ifdef DEBUG
printf("New table applyed!\n");
#endif
}
void RestoreOldTable()
{
#ifdef DEBUG
printf("Restoring old table... (0x%X to 0x%X)\n", reinterpret_cast<uintptr_t>(*class_pointer), reinterpret_cast<uintptr_t>(original_pointer));
#endif
*class_pointer = original_pointer;
#ifdef DEBUG
printf("Old table restored!\n");
#endif
}
template<typename T>
T GetOriginal(size_t index)
{
return reinterpret_cast<T>(original_pointer[index]);
}
private:
uintptr_t** class_pointer = nullptr;
uintptr_t* original_pointer = nullptr;
uintptr_t* new_table_pointer = nullptr;
};

View File

@ -1,109 +0,0 @@
#pragma once
#include <string>
#include <array>
#include <cstdarg>
#define BEGIN_NAMESPACE( x ) namespace x {
#define END_NAMESPACE }
BEGIN_NAMESPACE(XorCompileTime)
constexpr auto time = __TIME__;
constexpr auto seed = static_cast<int>(time[7]) + static_cast<int>(time[6]) * 10 + static_cast<int>(time[4]) * 60 + static_cast<int>(time[3]) * 600 + static_cast<int>(time[1]) * 3600 + static_cast<int>(time[0]) * 36000;
template < int N >
struct RandomGenerator {
private:
static constexpr unsigned a = 16807;
static constexpr unsigned m = 2147483647;
static constexpr unsigned s = RandomGenerator< N - 1 >::value;
static constexpr unsigned lo = a * (s & 0xFFFF);
static constexpr unsigned hi = a * (s >> 16);
static constexpr unsigned lo2 = lo + ((hi & 0x7FFF) << 16);
static constexpr unsigned hi2 = hi >> 15;
static constexpr unsigned lo3 = lo2 + hi;
public:
static constexpr unsigned max = m;
static constexpr unsigned value = lo3 > m ? lo3 - m : lo3;
};
template <>
struct RandomGenerator< 0 > {
static constexpr unsigned value = seed;
};
template < int N, int M >
struct RandomInt {
static constexpr auto value = RandomGenerator< N + 1 >::value % M;
};
template < int N >
struct RandomChar {
static const char value = static_cast<char>(1 + RandomInt< N, 0x7F - 1 >::value);
};
template < size_t N, int K >
struct XorString {
private:
const char _key;
std::array< char, N + 1 > _encrypted;
constexpr char enc(char c) const {
return c ^ _key;
}
char dec(char c) const {
return c ^ _key;
}
public:
template < size_t... Is >
constexpr __forceinline XorString(const char* str, std::index_sequence< Is... >) : _key(RandomChar< K >::value), _encrypted{ enc(str[Is])... } {
}
__forceinline decltype(auto) decrypt(void) {
for (size_t i = 0; i < N; ++i) {
_encrypted[i] = dec(_encrypted[i]);
}
_encrypted[N] = '\0';
return _encrypted.data();
}
};
static auto w_printf = [](const char* fmt, ...) {
va_list args;
va_start(args, fmt);
vprintf_s(fmt, args);
va_end(args);
};
static auto w_printf_s = [](const char* fmt, ...) {
va_list args;
va_start(args, fmt);
vprintf_s(fmt, args);
va_end(args);
};
static auto w_sprintf = [](char* buf, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
vsprintf(buf, fmt, args);
va_end(args);
};
static auto w_sprintf_s = [](char* buf, size_t buf_size, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
vsprintf_s(buf, buf_size, fmt, args);
va_end(args);
};
#ifdef NDEBUG
#define XorStr( s ) ( XorCompileTime::XorString< sizeof( s ) - 1, __COUNTER__ >( s, std::make_index_sequence< sizeof( s ) - 1>() ).decrypt() )
#else
#define XorStr( s ) ( s )
#endif
END_NAMESPACE

File diff suppressed because it is too large Load Diff

View File

@ -1,335 +0,0 @@
#ifndef ANIMATIONLAYER_H
#define ANIMATIONLAYER_H
#ifdef _WIN32
#pragma once
#endif
#include "rangecheckedvar.h"
#include "lerp_functions.h"
#include "shareddefs.h"
#include "cs_shareddefs.h"
#ifdef CLIENT_DLL
class C_BaseAnimatingOverlay;
#endif
class C_AnimationLayer
{
public:
ALLOW_DATATABLES_PRIVATE_ACCESS();
C_AnimationLayer();
void Reset();
#ifdef CLIENT_DLL
void SetOwner(C_BaseAnimatingOverlay* pOverlay);
C_BaseAnimatingOverlay* GetOwner() const;
#endif
void SetOrder(int order);
bool IsActive(void);
float GetFadeout(float flCurTime);
void SetSequence(int nSequence);
void SetCycle(float flCycle);
void SetPrevCycle(float flCycle);
void SetPlaybackRate(float flPlaybackRate);
void SetWeight(float flWeight);
void SetWeightDeltaRate(float flDelta);
int GetOrder() const;
int GetSequence() const;
float GetCycle() const;
float GetPrevCycle() const;
float GetPlaybackRate() const;
float GetWeight() const;
float GetWeightDeltaRate() const;
#ifdef CLIENT_DLL
int GetInvalidatePhysicsBits() const;
void SetInvalidatePhysicsBits(int iBit) { m_nInvalidatePhysicsBits = iBit; }
#endif
public:
float m_flLayerAnimtime;
float m_flLayerFadeOuttime;
CStudioHdr* m_pDispatchedStudioHdr;
int m_nDispatchedSrc;
int m_nDispatchedDst;
private:
int m_nOrder;
CRangeCheckedVar<int, -1, 65535, 0> m_nSequence;
CRangeCheckedVar<float, -2, 2, 0> m_flPrevCycle;
CRangeCheckedVar<float, -5, 5, 0> m_flWeight;
CRangeCheckedVar<float, -5, 5, 0> m_flWeightDeltaRate;
CRangeCheckedVar<float, -50, 50, 1> m_flPlaybackRate;
CRangeCheckedVar<float, -2, 2, 0> m_flCycle;
#ifdef CLIENT_DLL
C_BaseAnimatingOverlay* m_pOwner;
int m_nInvalidatePhysicsBits;
#endif
friend class C_BaseAnimatingOverlay;
friend C_AnimationLayer LoopingLerp(float flPercent, C_AnimationLayer& from, C_AnimationLayer& to);
friend C_AnimationLayer Lerp(float flPercent, const C_AnimationLayer& from, const C_AnimationLayer& to);
friend C_AnimationLayer LoopingLerp_Hermite(const C_AnimationLayer& current, float flPercent, C_AnimationLayer& prev, C_AnimationLayer& from, C_AnimationLayer& to);
friend C_AnimationLayer Lerp_Hermite(const C_AnimationLayer& current, float flPercent, const C_AnimationLayer& prev, const C_AnimationLayer& from, const C_AnimationLayer& to);
friend void Lerp_Clamp(C_AnimationLayer& val);
friend int CheckForSequenceBoxChanges(const C_AnimationLayer& newLayer, const C_AnimationLayer& oldLayer);
};
#ifdef CLIENT_DLL
#define CAnimationLayer C_AnimationLayer
#endif
inline C_AnimationLayer::C_AnimationLayer()
{
#ifdef CLIENT_DLL
m_pOwner = NULL;
m_nInvalidatePhysicsBits = 0;
#endif
m_pDispatchedStudioHdr = NULL;
m_nDispatchedSrc = 0;
m_nDispatchedDst = 0;
Reset();
}
#ifdef GAME_DLL
inline void C_AnimationLayer::SetSequence(int nSequence)
{
m_nSequence = nSequence;
}
inline void C_AnimationLayer::SetCycle(float flCycle)
{
m_flCycle = flCycle;
}
inline void C_AnimationLayer::SetWeight(float flWeight)
{
m_flWeight = flWeight;
}
#endif
FORCEINLINE void C_AnimationLayer::SetPrevCycle(float flPrevCycle)
{
m_flPrevCycle = flPrevCycle;
}
FORCEINLINE void C_AnimationLayer::SetPlaybackRate(float flPlaybackRate)
{
m_flPlaybackRate = flPlaybackRate;
}
FORCEINLINE void C_AnimationLayer::SetWeightDeltaRate(float flDelta)
{
m_flWeightDeltaRate = flDelta;
}
FORCEINLINE int C_AnimationLayer::GetSequence() const
{
return m_nSequence;
}
FORCEINLINE float C_AnimationLayer::GetCycle() const
{
return m_flCycle;
}
FORCEINLINE float C_AnimationLayer::GetPrevCycle() const
{
return m_flPrevCycle;
}
FORCEINLINE float C_AnimationLayer::GetPlaybackRate() const
{
return m_flPlaybackRate;
}
FORCEINLINE float C_AnimationLayer::GetWeight() const
{
return m_flWeight;
}
FORCEINLINE float C_AnimationLayer::GetWeightDeltaRate() const
{
return m_flWeightDeltaRate;
}
FORCEINLINE int C_AnimationLayer::GetOrder() const
{
return m_nOrder;
}
inline float C_AnimationLayer::GetFadeout(float flCurTime)
{
float s;
if (m_flLayerFadeOuttime <= 0.0f)
{
s = 0;
}
else
{
s = 1.0 - (flCurTime - m_flLayerAnimtime) / m_flLayerFadeOuttime;
if (s > 0 && s <= 1.0)
{
s = 3 * s * s - 2 * s * s * s;
}
else if (s > 1.0f)
{
s = 1.0f;
}
}
return s;
}
#ifdef CLIENT_DLL
FORCEINLINE int C_AnimationLayer::GetInvalidatePhysicsBits() const
{
return m_nInvalidatePhysicsBits;
}
#endif
inline C_AnimationLayer LoopingLerp(float flPercent, C_AnimationLayer& from, C_AnimationLayer& to)
{
#ifdef CLIENT_DLL
Assert(from.GetOwner() == to.GetOwner());
#endif
C_AnimationLayer output;
output.m_nSequence = to.m_nSequence;
output.m_flCycle = LoopingLerp(flPercent, (float)from.m_flCycle, (float)to.m_flCycle);
output.m_flPrevCycle = to.m_flPrevCycle;
output.m_flWeight = Lerp(flPercent, from.m_flWeight, to.m_flWeight);
output.m_nOrder = to.m_nOrder;
output.m_flLayerAnimtime = to.m_flLayerAnimtime;
output.m_flLayerFadeOuttime = to.m_flLayerFadeOuttime;
#ifdef CLIENT_DLL
output.SetOwner(to.GetOwner());
#endif
return output;
}
inline C_AnimationLayer Lerp(float flPercent, const C_AnimationLayer& from, const C_AnimationLayer& to)
{
#ifdef CLIENT_DLL
Assert(from.GetOwner() == to.GetOwner());
#endif
C_AnimationLayer output;
output.m_nSequence = to.m_nSequence;
output.m_flCycle = Lerp(flPercent, from.m_flCycle, to.m_flCycle);
output.m_flPrevCycle = to.m_flPrevCycle;
output.m_flWeight = Lerp(flPercent, from.m_flWeight, to.m_flWeight);
output.m_nOrder = to.m_nOrder;
output.m_flLayerAnimtime = to.m_flLayerAnimtime;
output.m_flLayerFadeOuttime = to.m_flLayerFadeOuttime;
#ifdef CLIENT_DLL
output.SetOwner(to.GetOwner());
#endif
return output;
}
inline int CheckForSequenceBoxChanges(const C_AnimationLayer& newLayer, const C_AnimationLayer& oldLayer)
{
int nChangeFlags = 0;
bool bOldIsZero = (oldLayer.GetWeight() == 0.0f);
bool bNewIsZero = (newLayer.GetWeight() == 0.0f);
if ((newLayer.GetSequence() != oldLayer.GetSequence()) ||
(bNewIsZero != bOldIsZero))
{
nChangeFlags |= SEQUENCE_CHANGED | BOUNDS_CHANGED;
}
if (newLayer.GetCycle() != oldLayer.GetCycle())
{
nChangeFlags |= ANIMATION_CHANGED;
}
if (newLayer.GetOrder() != oldLayer.GetOrder())
{
nChangeFlags |= BOUNDS_CHANGED;
}
return nChangeFlags;
}
inline C_AnimationLayer LoopingLerp_Hermite(const C_AnimationLayer& current, float flPercent, C_AnimationLayer& prev, C_AnimationLayer& from, C_AnimationLayer& to)
{
#ifdef CLIENT_DLL
Assert(prev.GetOwner() == from.GetOwner());
Assert(from.GetOwner() == to.GetOwner());
#endif
C_AnimationLayer output;
output.m_nSequence = to.m_nSequence;
output.m_flCycle = LoopingLerp_Hermite((float)current.m_flCycle, flPercent, (float)prev.m_flCycle, (float)from.m_flCycle, (float)to.m_flCycle);
output.m_flPrevCycle = to.m_flPrevCycle;
output.m_flWeight = Lerp(flPercent, from.m_flWeight, to.m_flWeight);
output.m_nOrder = to.m_nOrder;
output.m_flLayerAnimtime = to.m_flLayerAnimtime;
output.m_flLayerFadeOuttime = to.m_flLayerFadeOuttime;
#ifdef CLIENT_DLL
output.SetOwner(to.GetOwner());
output.m_nInvalidatePhysicsBits = CheckForSequenceBoxChanges(output, current);
#endif
return output;
}
inline C_AnimationLayer Lerp_Hermite(const C_AnimationLayer& current, float flPercent, const C_AnimationLayer& prev, const C_AnimationLayer& from, const C_AnimationLayer& to)
{
#ifdef CLIENT_DLL
Assert(prev.GetOwner() == from.GetOwner());
Assert(from.GetOwner() == to.GetOwner());
#endif
C_AnimationLayer output;
output.m_nSequence = to.m_nSequence;
output.m_flCycle = Lerp_Hermite((float)current.m_flCycle, flPercent, (float)prev.m_flCycle, (float)from.m_flCycle, (float)to.m_flCycle);
output.m_flPrevCycle = to.m_flPrevCycle;
output.m_flWeight = Lerp(flPercent, from.m_flWeight, to.m_flWeight);
output.m_nOrder = to.m_nOrder;
output.m_flLayerAnimtime = to.m_flLayerAnimtime;
output.m_flLayerFadeOuttime = to.m_flLayerFadeOuttime;
#ifdef CLIENT_DLL
output.SetOwner(to.GetOwner());
output.m_nInvalidatePhysicsBits = CheckForSequenceBoxChanges(output, current);
#endif
return output;
}
inline void Lerp_Clamp(C_AnimationLayer& val)
{
Lerp_Clamp(val.m_nSequence);
Lerp_Clamp(val.m_flCycle);
Lerp_Clamp(val.m_flPrevCycle);
Lerp_Clamp(val.m_flWeight);
Lerp_Clamp(val.m_nOrder);
Lerp_Clamp(val.m_flLayerAnimtime);
Lerp_Clamp(val.m_flLayerFadeOuttime);
}
#endif

View File

@ -1,64 +0,0 @@
#ifndef ANALYSIS_ANNOTATIONS_H
#define ANALYSIS_ANNOTATIONS_H
#if _MSC_VER >= 1600
#pragma warning(error : 4789 )
#ifdef _PREFAST_
#include <sal.h>
#define ANALYZE_SUPPRESS(wnum) __pragma(warning(suppress: wnum))
#define ANALYZE_SUPPRESS2(wnum1, wnum2) __pragma(warning(supress: wnum1 wnum2))
#define ANALYZE_SUPPRESS3(wnum1, wnum2, wnum3) __pragma(warning(suppress: wnum1 wnum2 wnum3))
#define ANALYZE_SUPPRESS4(wnum1, wnum2, wnum3, wnum4) __pragma(warning(suppress: wnum1 wnum2 wnum3 wnum4))
#define PRINTF_FORMAT_STRING _Printf_format_string_
#define SCANF_FORMAT_STRING _Scanf_format_string_impl_
#define IN_Z _In_z_
#define IN_CAP(x) _In_count_(x)
#define IN_BYTECAP(x) _In_bytecount_(x)
#define OUT_Z_CAP(x) _Out_z_cap_(x)
#define OUT_CAP(x) _Out_cap_(x)
#define OUT_CAP_C(x) _Out_cap_c_(x)
#define OUT_BYTECAP(x) _Out_bytecap_(x)
#define OUT_Z_BYTECAP(x) _Out_z_bytecap_(x)
#define INOUT_BYTECAP(x) _Inout_bytecap_(x)
#define INOUT_Z_CAP(x) _Inout_z_cap_(x)
#define INOUT_Z_BYTECAP(x) _Inout_z_bytecap_(x)
#if _MSC_VER >= 1700
#define IN_Z_ARRAY _Pre_z_
#define OUT_Z_ARRAY _Post_z_
#define INOUT_Z_ARRAY _Prepost_z_
#else
#define IN_Z_ARRAY _Deref_pre_z_
#define OUT_Z_ARRAY _Deref_post_z_
#define INOUT_Z_ARRAY _Deref_prepost_z_
#endif
#define MUST_CHECK_RETURN _Check_return_
#endif
#endif
#ifndef ANALYZE_SUPPRESS
#define ANALYZE_SUPPRESS(wnum)
#define ANALYZE_SUPPRESS2(wnum1, wnum2)
#define ANALYZE_SUPPRESS3(wnum1, wnum2, wnum3)
#define ANALYZE_SUPPRESS4(wnum1, wnum2, wnum3, wnum4)
#define PRINTF_FORMAT_STRING
#define SCANF_FORMAT_STRING
#define IN_Z
#define IN_CAP(x)
#define IN_BYTECAP(x)
#define OUT_Z_CAP(x)
#define OUT_CAP(x)
#define OUT_CAP_C(x)
#define OUT_BYTECAP(x)
#define OUT_Z_BYTECAP(x)
#define INOUT_BYTECAP(x)
#define INOUT_Z_CAP(x)
#define INOUT_Z_BYTECAP(x)
#define OUT_Z_ARRAY
#define INOUT_Z_ARRAY
#define MUST_CHECK_RETURN
#endif
#endif

View File

@ -1,118 +0,0 @@
#ifndef BASECLIENTSTATE_H
#define BASECLIENTSTATE_H
#ifdef _WIN32
#pragma once
#endif
class CBaseClientState
{
public:
char _pad0[0x20C];
int m_nDeltaTick;
bool m_bPaused;
char _pad1[0x3];
int m_nViewEntity;
char _pad2[0x8];
char m_szLevelName[260];
char m_szLevelNameShort[40];
};
class CClockDriftMgr
{
public:
float m_ClockOffsets[16];
uint32_t m_iCurClockOffset;
uint32_t m_nServerTick;
uint32_t m_nClientTick;
};
class CEventInfo
{
public:
enum
{
EVENT_INDEX_BITS = 8,
EVENT_DATA_LEN_BITS = 11,
MAX_EVENT_DATA = 192,
};
inline CEventInfo()
{
classID = 0;
fire_delay = 0.0f;
flags = 0;
pSendTable = NULL;
pClientClass = NULL;
m_Packed = 0;
}
short classID;
short pad;
float fire_delay;
const void* pSendTable;
const ClientClass* pClientClass;
int m_Packed;
int flags;
int filter[8];
CEventInfo* next;
};
class CClientState
{
public:
void ForceFullUpdate()
{
m_nDeltaTick = -1;
}
char pad_0000[156];
INetChannel* m_NetChannel;
int m_nChallengeNr;
char pad_00A4[100];
int m_nSignonState;
int signon_pads[2];
float m_flNextCmdTime;
int m_nServerCount;
int m_nCurrentSequence;
int musor_pads[2];
CClockDriftMgr m_ClockDriftMgr;
int m_nDeltaTick;
bool m_bPaused;
char paused_align[3];
int m_nViewEntity;
int m_nPlayerSlot;
int bruh;
char m_szLevelName[260];
char m_szLevelNameShort[80];
char m_szGroupName[80];
char pad_032[92];
int m_nMaxClients;
char pad_0314[18828];
float m_nLastServerTickTime;
bool m_bInSimulation;
char pad_4C9D[3];
int m_nOldTickCount;
float m_flTickReminder;
float m_flFrametime;
int m_nLastOutgoingCommand;
int m_nChokedCommands;
int m_nLastCommandAck;
int m_nPacketEndTickUpdate;
int m_nCommandAck;
int m_nSoundSequence;
char pad_4CCD[76];
QAngle viewangles;
int pads[54];
CEventInfo* m_pEvents;
};
#endif
#pragma once

View File

@ -1,352 +0,0 @@
#ifndef ENTITYLIST_H
#define ENTITYLIST_H
#ifdef _WIN32
#pragma once
#endif
class CBaseEntity;
class IEntityListener;
class CBaseEntityClassList
{
public:
CBaseEntityClassList();
~CBaseEntityClassList();
virtual void LevelShutdownPostEntity() = 0;
CBaseEntityClassList* m_pNextClassList;
};
template< class T >
class CEntityClassList : public CBaseEntityClassList
{
public:
virtual void LevelShutdownPostEntity() { m_pClassList = NULL; }
void Insert(T* pEntity)
{
pEntity->m_pNext = m_pClassList;
m_pClassList = pEntity;
}
void Remove(T* pEntity)
{
T** pPrev = &m_pClassList;
T* pCur = *pPrev;
while (pCur)
{
if (pCur == pEntity)
{
*pPrev = pCur->m_pNext;
return;
}
pPrev = &pCur->m_pNext;
pCur = *pPrev;
}
}
static T* m_pClassList;
};
abstract_class IEntityFindFilter
{
public:
virtual bool ShouldFindEntity(CBaseEntity * pEntity) = 0;
virtual CBaseEntity* GetFilterResult(void) = 0;
};
class CGlobalEntityList : public CBaseEntityList
{
public:
private:
int m_iHighestEnt;
int m_iNumEnts;
int m_iNumEdicts;
bool m_bClearingEntities;
CUtlVector<IEntityListener*> m_entityListeners;
public:
CBaseHandle AddNetworkableEntity(IHandleEntity* pEnt, int index, int iForcedSerialNum = -1);
CBaseHandle AddNonNetworkableEntity(IHandleEntity* pEnt);
void UpdateName(IHandleEntity* pEnt, CBaseHandle hEnt);
void UpdateName(IHandleEntity* pEnt);
IServerNetworkable* GetServerNetworkable(CBaseHandle hEnt) const;
CBaseNetworkable* GetBaseNetworkable(CBaseHandle hEnt) const;
CBaseEntity* GetBaseEntity(CBaseHandle hEnt) const;
edict_t* GetEdict(CBaseHandle hEnt) const;
int NumberOfEntities(void);
int NumberOfEdicts(void);
void AddToDeleteList(IServerNetworkable* ent);
void CleanupDeleteList(void);
int ResetDeleteList(void);
void Clear(void);
bool IsClearingEntities() { return m_bClearingEntities; }
void AddListenerEntity(IEntityListener* pListener);
void RemoveListenerEntity(IEntityListener* pListener);
void ReportEntityFlagsChanged(CBaseEntity* pEntity, unsigned int flagsOld, unsigned int flagsNow);
void AddPostClientMessageEntity(CBaseEntity* pEntity);
void PostClientMessagesSent();
void NotifyCreateEntity(CBaseEntity* pEnt);
void NotifySpawn(CBaseEntity* pEnt);
void NotifyRemoveEntity(CBaseEntity* pEnt);
CBaseEntity* NextEnt(CBaseEntity* pCurrentEnt);
CBaseEntity* FirstEnt() { return NextEnt(NULL); }
template< class T >
T* NextEntByClass(T* start)
{
for (CBaseEntity* x = NextEnt(start); x; x = NextEnt(x))
{
start = dynamic_cast<T*>(x);
if (start)
return start;
}
return NULL;
}
bool IsEntityPtr(void* pTest);
CBaseEntity* FindEntityByClassname(CBaseEntity* pStartEntity, const char* szName);
CBaseEntity* FindEntityByName(CBaseEntity* pStartEntity, const char* szName, CBaseEntity* pSearchingEntity = NULL, CBaseEntity* pActivator = NULL, CBaseEntity* pCaller = NULL, IEntityFindFilter* pFilter = NULL);
CBaseEntity* FindEntityByName(CBaseEntity* pStartEntity, string_t iszName, CBaseEntity* pSearchingEntity = NULL, CBaseEntity* pActivator = NULL, CBaseEntity* pCaller = NULL, IEntityFindFilter* pFilter = NULL)
{
return FindEntityByName(pStartEntity, STRING(iszName), pSearchingEntity, pActivator, pCaller, pFilter);
}
CBaseEntity* FindEntityInSphere(CBaseEntity* pStartEntity, const Vector& vecCenter, float flRadius);
CBaseEntity* FindEntityByTarget(CBaseEntity* pStartEntity, const char* szName);
CBaseEntity* FindEntityByModel(CBaseEntity* pStartEntity, const char* szModelName);
CBaseEntity* FindEntityByOutputTarget(CBaseEntity* pStartEntity, string_t iTarget);
CBaseEntity* FindEntityByNameNearest(const char* szName, const Vector& vecSrc, float flRadius, CBaseEntity* pSearchingEntity = NULL, CBaseEntity* pActivator = NULL, CBaseEntity* pCaller = NULL);
CBaseEntity* FindEntityByNameWithin(CBaseEntity* pStartEntity, const char* szName, const Vector& vecSrc, float flRadius, CBaseEntity* pSearchingEntity = NULL, CBaseEntity* pActivator = NULL, CBaseEntity* pCaller = NULL);
CBaseEntity* FindEntityByClassnameNearest(const char* szName, const Vector& vecSrc, float flRadius);
CBaseEntity* FindEntityByClassnameNearest2D(const char* szName, const Vector& vecSrc, float flRadius);
CBaseEntity* FindEntityByClassnameWithin(CBaseEntity* pStartEntity, const char* szName, const Vector& vecSrc, float flRadius);
CBaseEntity* FindEntityByClassnameWithin(CBaseEntity* pStartEntity, const char* szName, const Vector& vecMins, const Vector& vecMaxs);
CBaseEntity* FindEntityGeneric(CBaseEntity* pStartEntity, const char* szName, CBaseEntity* pSearchingEntity = NULL, CBaseEntity* pActivator = NULL, CBaseEntity* pCaller = NULL);
CBaseEntity* FindEntityGenericWithin(CBaseEntity* pStartEntity, const char* szName, const Vector& vecSrc, float flRadius, CBaseEntity* pSearchingEntity = NULL, CBaseEntity* pActivator = NULL, CBaseEntity* pCaller = NULL);
CBaseEntity* FindEntityGenericNearest(const char* szName, const Vector& vecSrc, float flRadius, CBaseEntity* pSearchingEntity = NULL, CBaseEntity* pActivator = NULL, CBaseEntity* pCaller = NULL);
CBaseEntity* FindEntityNearestFacing(const Vector& origin, const Vector& facing, float threshold);
CBaseEntity* FindEntityClassNearestFacing(const Vector& origin, const Vector& facing, float threshold, char* classname);
CBaseEntity* FindEntityByNetname(CBaseEntity* pStartEntity, const char* szModelName);
CBaseEntity* FindEntityProcedural(const char* szName, CBaseEntity* pSearchingEntity = NULL, CBaseEntity* pActivator = NULL, CBaseEntity* pCaller = NULL);
CBaseEntity* FindEntityByClassnameFast(CBaseEntity* pStartEntity, string_t iszClassname);
CBaseEntity* FindEntityByClassnameNearestFast(string_t iszClassname, const Vector& vecSrc, float flRadius);
CBaseEntity* FindEntityByNameFast(CBaseEntity* pStartEntity, string_t iszName);
CGlobalEntityList();
protected:
virtual void OnAddEntity(IHandleEntity* pEnt, CBaseHandle handle);
virtual void OnRemoveEntity(IHandleEntity* pEnt, CBaseHandle handle);
};
extern CGlobalEntityList gEntList;
inline CBaseHandle CGlobalEntityList::AddNetworkableEntity(IHandleEntity* pEnt, int index, int iForcedSerialNum)
{
CBaseHandle h = CBaseEntityList::AddNetworkableEntity(pEnt, index, iForcedSerialNum);
UpdateName(pEnt, h);
return h;
}
inline CBaseHandle CGlobalEntityList::AddNonNetworkableEntity(IHandleEntity* pEnt)
{
CBaseHandle h = CBaseEntityList::AddNonNetworkableEntity(pEnt);
UpdateName(pEnt, h);
return h;
}
inline edict_t* CGlobalEntityList::GetEdict(CBaseHandle hEnt) const
{
IServerUnknown* pUnk = static_cast<IServerUnknown*>(LookupEntity(hEnt));
if (pUnk)
return pUnk->GetNetworkable()->GetEdict();
else
return NULL;
}
inline CBaseNetworkable* CGlobalEntityList::GetBaseNetworkable(CBaseHandle hEnt) const
{
IServerUnknown* pUnk = static_cast<IServerUnknown*>(LookupEntity(hEnt));
if (pUnk)
return pUnk->GetNetworkable()->GetBaseNetworkable();
else
return NULL;
}
inline IServerNetworkable* CGlobalEntityList::GetServerNetworkable(CBaseHandle hEnt) const
{
IServerUnknown* pUnk = static_cast<IServerUnknown*>(LookupEntity(hEnt));
if (pUnk)
return pUnk->GetNetworkable();
else
return NULL;
}
inline CBaseEntity* CGlobalEntityList::GetBaseEntity(CBaseHandle hEnt) const
{
IServerUnknown* pUnk = static_cast<IServerUnknown*>(LookupEntity(hEnt));
if (pUnk)
return pUnk->GetBaseEntity();
else
return NULL;
}
#if 0
template <class ENT_TYPE>
inline bool FindEntityByName(const char* pszName, ENT_TYPE** ppResult)
{
CBaseEntity* pBaseEntity = gEntList.FindEntityByName(NULL, pszName);
if (pBaseEntity)
*ppResult = dynamic_cast<ENT_TYPE*>(pBaseEntity);
else
*ppResult = NULL;
return (*ppResult != NULL);
}
template <>
inline bool FindEntityByName<CBaseEntity>(const char* pszName, CBaseEntity** ppResult)
{
*ppResult = gEntList.FindEntityByName(NULL, pszName);
return (*ppResult != NULL);
}
template <>
inline bool FindEntityByName<CAI_BaseNPC>(const char* pszName, CAI_BaseNPC** ppResult)
{
CBaseEntity* pBaseEntity = gEntList.FindEntityByName(NULL, pszName);
if (pBaseEntity)
*ppResult = pBaseEntity->MyNPCPointer();
else
*ppResult = NULL;
return (*ppResult != NULL);
}
#endif
struct entitem_t
{
EHANDLE hEnt;
struct entitem_t* pNext;
static void* operator new(size_t stAllocateBlock);
static void* operator new(size_t stAllocateBlock, int nBlockUse, const char* pFileName, int nLine);
static void operator delete(void* pMem);
static void operator delete(void* pMem, int nBlockUse, const char* pFileName, int nLine) { operator delete(pMem); }
};
class CEntityList
{
public:
CEntityList();
~CEntityList();
int m_iNumItems;
entitem_t* m_pItemList;
void AddEntity(CBaseEntity*);
void DeleteEntity(CBaseEntity*);
};
enum notify_system_event_t
{
NOTIFY_EVENT_TELEPORT = 0,
NOTIFY_EVENT_DESTROY,
};
struct notify_teleport_params_t
{
Vector prevOrigin;
QAngle prevAngles;
bool physicsRotate;
};
struct notify_destroy_params_t
{
};
struct notify_system_event_params_t
{
union
{
const notify_teleport_params_t* pTeleport;
const notify_destroy_params_t* pDestroy;
};
notify_system_event_params_t(const notify_teleport_params_t* pInTeleport) { pTeleport = pInTeleport; }
notify_system_event_params_t(const notify_destroy_params_t* pInDestroy) { pDestroy = pInDestroy; }
};
abstract_class INotify
{
public:
virtual void AddEntity(CBaseEntity * pNotify, CBaseEntity * pWatched) = 0;
virtual void RemoveEntity(CBaseEntity* pNotify, CBaseEntity* pWatched) = 0;
virtual void ReportNamedEvent(CBaseEntity* pEntity, const char* pEventName) = 0;
virtual void ReportSystemEvent(CBaseEntity* pEntity, notify_system_event_t eventType, const notify_system_event_params_t& params) = 0;
inline void ReportDestroyEvent(CBaseEntity* pEntity)
{
notify_destroy_params_t destroy;
ReportSystemEvent(pEntity, NOTIFY_EVENT_DESTROY, notify_system_event_params_t(&destroy));
}
inline void ReportTeleportEvent(CBaseEntity* pEntity, const Vector& prevOrigin, const QAngle& prevAngles, bool physicsRotate)
{
notify_teleport_params_t teleport;
teleport.prevOrigin = prevOrigin;
teleport.prevAngles = prevAngles;
teleport.physicsRotate = physicsRotate;
ReportSystemEvent(pEntity, NOTIFY_EVENT_TELEPORT, notify_system_event_params_t(&teleport));
}
virtual void ClearEntity(CBaseEntity* pNotify) = 0;
};
class IEntityListener
{
public:
virtual void OnEntityCreated(CBaseEntity* pEntity) {};
virtual void OnEntitySpawned(CBaseEntity* pEntity) {};
virtual void OnEntityDeleted(CBaseEntity* pEntity) {};
};
extern INotify* g_pNotify;
void EntityTouch_Add(CBaseEntity* pEntity);
void EntityTouch_Remove(CBaseEntity* pEntity);
int AimTarget_ListCount();
int AimTarget_ListCopy(CBaseEntity* pList[], int listMax);
CBaseEntity* AimTarget_ListElement(int iIndex);
void AimTarget_ForceRepopulateList();
void SimThink_EntityChanged(CBaseEntity* pEntity);
int SimThink_ListCount();
int SimThink_ListCopy(CBaseEntity* pList[], int listMax);
#endif

View File

@ -1,277 +0,0 @@
#ifndef BASEENTITY_SHARED_H
#define BASEENTITY_SHARED_H
#ifdef _WIN32
#pragma once
#endif
#define FCAP_MUST_SPAWN 0x00000001
#define FCAP_ACROSS_TRANSITION 0x00000002
#define FCAP_FORCE_TRANSITION 0x00000004
#define FCAP_NOTIFY_ON_TRANSITION 0x00000008
#define FCAP_IMPULSE_USE 0x00000010
#define FCAP_CONTINUOUS_USE 0x00000020
#define FCAP_ONOFF_USE 0x00000040
#define FCAP_DIRECTIONAL_USE 0x00000080
#define FCAP_USE_ONGROUND 0x00000100
#define FCAP_USE_IN_RADIUS 0x00000200
#define FCAP_SAVE_NON_NETWORKABLE 0x00000400
#define FCAP_MASTER 0x10000000
#define FCAP_WCEDIT_POSITION 0x40000000
#define FCAP_DONT_SAVE 0x80000000
#define NUM_PARENTATTACHMENT_BITS 6
#define VPHYSICS_MAX_OBJECT_LIST_COUNT 1024
enum InvalidatePhysicsBits_t
{
POSITION_CHANGED = 0x1,
ANGLES_CHANGED = 0x2,
VELOCITY_CHANGED = 0x4,
ANIMATION_CHANGED = 0x8,
};
#if defined( CLIENT_DLL )
#include "c_baseentity.h"
#include "c_baseanimating.h"
#else
#include "baseentity.h"
#ifdef HL2_EPISODIC
#include "info_darknessmode_lightsource.h"
#endif
#endif
#if !defined( NO_ENTITY_PREDICTION )
inline bool CBaseEntity::IsPlayerSimulated(void) const
{
return m_bIsPlayerSimulated;
}
inline CBasePlayer* CBaseEntity::GetSimulatingPlayer(void)
{
return m_hPlayerSimulationOwner;
}
#endif
inline MoveType_t CBaseEntity::GetMoveType() const
{
return (MoveType_t)(unsigned char)m_MoveType;
}
inline MoveCollide_t CBaseEntity::GetMoveCollide() const
{
return (MoveCollide_t)(unsigned char)m_MoveCollide;
}
inline int CBaseEntity::GetCollisionGroup() const
{
return m_CollisionGroup;
}
inline int CBaseEntity::GetFlags(void) const
{
return m_fFlags;
}
inline bool CBaseEntity::IsAlive(void)
{
return m_lifeState == LIFE_ALIVE;
}
inline CBaseEntity* CBaseEntity::GetOwnerEntity() const
{
return m_hOwnerEntity.Get();
}
inline CBaseEntity* CBaseEntity::GetEffectEntity() const
{
return m_hEffectEntity.Get();
}
inline int CBaseEntity::GetPredictionRandomSeed(void)
{
return m_nPredictionRandomSeed;
}
inline CBasePlayer* CBaseEntity::GetPredictionPlayer(void)
{
return m_pPredictionPlayer;
}
inline void CBaseEntity::SetPredictionPlayer(CBasePlayer* player)
{
m_pPredictionPlayer = player;
}
inline bool CBaseEntity::IsSimulatedEveryTick() const
{
return m_bSimulatedEveryTick;
}
inline bool CBaseEntity::IsAnimatedEveryTick() const
{
return m_bAnimatedEveryTick;
}
inline void CBaseEntity::SetSimulatedEveryTick(bool sim)
{
if (m_bSimulatedEveryTick != sim)
{
m_bSimulatedEveryTick = sim;
#ifdef CLIENT_DLL
Interp_UpdateInterpolationAmounts(GetVarMapping());
#endif
}
}
inline void CBaseEntity::SetAnimatedEveryTick(bool anim)
{
if (m_bAnimatedEveryTick != anim)
{
m_bAnimatedEveryTick = anim;
#ifdef CLIENT_DLL
Interp_UpdateInterpolationAmounts(GetVarMapping());
#endif
}
}
inline float CBaseEntity::GetAnimTime() const
{
return m_flAnimTime;
}
inline float CBaseEntity::GetSimulationTime() const
{
return m_flSimulationTime;
}
inline void CBaseEntity::SetAnimTime(float at)
{
m_flAnimTime = at;
}
inline void CBaseEntity::SetSimulationTime(float st)
{
m_flSimulationTime = st;
}
inline int CBaseEntity::GetEffects(void) const
{
return m_fEffects;
}
inline void CBaseEntity::RemoveEffects(int nEffects)
{
#if !defined( CLIENT_DLL )
#ifdef HL2_EPISODIC
if (nEffects & (EF_BRIGHTLIGHT | EF_DIMLIGHT))
{
if (!IsPlayer())
{
RemoveEntityFromDarknessCheck(this);
}
}
#endif
#endif
m_fEffects &= ~nEffects;
if (nEffects & EF_NODRAW)
{
#ifndef CLIENT_DLL
NetworkProp()->MarkPVSInformationDirty();
DispatchUpdateTransmitState();
#else
UpdateVisibility();
#endif
}
}
inline void CBaseEntity::ClearEffects(void)
{
#if !defined( CLIENT_DLL )
#ifdef HL2_EPISODIC
if (m_fEffects & (EF_BRIGHTLIGHT | EF_DIMLIGHT))
{
if (!IsPlayer())
{
RemoveEntityFromDarknessCheck(this);
}
}
#endif
#endif
m_fEffects = 0;
#ifndef CLIENT_DLL
DispatchUpdateTransmitState();
#else
UpdateVisibility();
#endif
}
inline bool CBaseEntity::IsEffectActive(int nEffects) const
{
return (m_fEffects & nEffects) != 0;
}
#define BASEENTITY_MSG_REMOVE_DECALS 1
extern float k_flMaxEntityPosCoord;
extern float k_flMaxEntityEulerAngle;
extern float k_flMaxEntitySpeed;
extern float k_flMaxEntitySpinRate;
inline bool IsEntityCoordinateReasonable(const vec_t c)
{
float r = k_flMaxEntityPosCoord;
return c > -r && c < r;
}
inline bool IsEntityPositionReasonable(const Vector& v)
{
float r = k_flMaxEntityPosCoord;
return
v.x > -r && v.x < r&&
v.y > -r && v.y < r&&
v.z > -r && v.z < r;
}
extern int CheckEntityVelocity(Vector& v);
inline bool IsEntityQAngleReasonable(const QAngle& q)
{
float r = k_flMaxEntityEulerAngle;
return
q.x > -r && q.x < r&&
q.y > -r && q.y < r&&
q.z > -r && q.z < r;
}
inline bool IsEntityAngularVelocityReasonable(const Vector& q)
{
float r = k_flMaxEntitySpinRate;
return
q.x > -r && q.x < r&&
q.y > -r && q.y < r&&
q.z > -r && q.z < r;
}
inline bool IsEntityQAngleVelReasonable(const QAngle& q)
{
float r = k_flMaxEntitySpinRate;
return
q.x > -r && q.x < r&&
q.y > -r && q.y < r&&
q.z > -r && q.z < r;
}
extern bool CheckEmitReasonablePhysicsSpew();
#endif

Some files were not shown because too many files have changed in this diff Show More