Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/hzqst/MetaHookSv
Browse files Browse the repository at this point in the history
  • Loading branch information
hzqst committed Jan 10, 2024
2 parents 6551d86 + ecc7ad0 commit d766310
Show file tree
Hide file tree
Showing 106 changed files with 43,859 additions and 2,262 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
[submodule "thirdparty/ScopeExit"]
path = thirdparty/ScopeExit
url = https://github.com/SergiusTheBest/ScopeExit
[submodule "thirdparty/FreeImage_fork"]
path = thirdparty/FreeImage_fork
url = https://github.com/hzqst/FreeImage_fork
[submodule "thirdparty/FreeImage_clone"]
path = thirdparty/FreeImage_clone
url = https://github.com/hzqst/FreeImage_clone
Binary file removed Build/FreeImage.dll
Binary file not shown.
8 changes: 4 additions & 4 deletions Build/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Compiled Binaries and Resources

### svencoop.exe (required)
### MetaHook.exe / MetaHook_blob.exe (required)

Main executable loader to bootstrap metahook plugins and start game.

### FreeImage.dll (optional)

Imageloader required by MetaRenderer plugin.
* Use MetaHook_blob.exe instead of MetaHook.exe to load legacy blob engine, such as engine with buildnum 3248 or 3266.

### SDL.dll (optional)

The SDL2.dll fixes a bug that the IME input handler from original SDL library provided by valve was causing buffer overflow and game crash when using non-english IME. you don't need to copy it if you don't have a non-english IME.

* Valve fixed this issue for SDL2 in HL25th patch, you don't have to replace SDL2 if you are running HL25th engine.

### svencoop/captionmod/* (optional)

All resource files in this directory are required by CaptionMod plugin.
Expand Down
8 changes: 4 additions & 4 deletions Build/READMECN.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# 可安装资源

### svencoop.exe (必须)
### MetaHook.exe / MetaHook_blob.exe (必须)

metahook主启动器

### FreeImage.dll (可选)

Renderer.dll的依赖项,如果要使用Renderer.dll则必须安装
* 使用 MetaHook_blob.exe 而不是 MetaHook.exe 来加载旧版的加密引擎(如3248或3266版本的引擎)。

### SDL.dll (可选)

`SDL2.dll`文件是用来修复原版SDL使用中文输入法进行游戏时可能发生的内存越界写入导致游戏崩溃的问题。如果你全程都关闭中文输入法的话也可以选择不替换`SDL2.dll`

* Valve在HL25周年补丁中更新了修复了缓冲区越界问题的SDL2,所以如果你是HL25周年正版就不需要替换SDL2.dll

### svencoop/captionmod/* (可选)

CaptionMod.dll的依赖项,如果要使用CaptionMod.dll则必须安装
Expand Down
3 changes: 2 additions & 1 deletion Build/svencoop/metahook/configs/plugins_goldsrc.lst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ CaptionMod.dll
Renderer.dll
BulletPhysics.dll
StudioEvents.dll
PrecacheManager.dll
PrecacheManager.dll
ThreadGuard.dll
2 changes: 1 addition & 1 deletion Build/svencoop/metahook/configs/plugins_svencoop.lst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ PrecacheManager.dll
CommunicationDemo.dll
SCModelDownloader.dll
SteamScreenshots.dll
;DontFlushSoundCache.dll
ThreadGuard.dll
19 changes: 19 additions & 0 deletions MetaHook.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DontFlushSoundCache", "Plug
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PrecacheManager", "Plugins\PrecacheManager\PrecacheManager.vcxproj", "{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ThreadGuard", "Plugins\ThreadGuard\ThreadGuard.vcxproj", "{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Expand Down Expand Up @@ -207,6 +209,22 @@ Global
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CC}.Release|Win32.ActiveCfg = Release|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CC}.Release|Win32.Build.0 = Release|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CC}.Release|x64.ActiveCfg = Release|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Debug|Win32.ActiveCfg = Debug|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Debug|Win32.Build.0 = Debug|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Debug|x64.ActiveCfg = Debug|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Debug|x64.Build.0 = Debug|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Release_AVX2|Win32.ActiveCfg = Release|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Release_AVX2|Win32.Build.0 = Release|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Release_AVX2|x64.ActiveCfg = Release|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Release_AVX2|x64.Build.0 = Release|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Release_blob|Win32.ActiveCfg = Release|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Release_blob|Win32.Build.0 = Release|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Release_blob|x64.ActiveCfg = Release|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Release_blob|x64.Build.0 = Release|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Release|Win32.ActiveCfg = Release|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Release|Win32.Build.0 = Release|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Release|x64.ActiveCfg = Release|Win32
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD}.Release|x64.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -223,6 +241,7 @@ Global
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5C9} = {4BBE5591-2774-44E5-837E-B54D33AFC431}
{527CB8FE-4710-4F1E-B929-CF43C6C80D1E} = {4BBE5591-2774-44E5-837E-B54D33AFC431}
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CC} = {4BBE5591-2774-44E5-837E-B54D33AFC431}
{FBF9CAF6-8DED-4EB0-8E7B-18294607C5CD} = {4BBE5591-2774-44E5-837E-B54D33AFC431}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D7EC138D-907F-4149-8DE2-92E63D7597ED}
Expand Down
41 changes: 24 additions & 17 deletions Plugins/CaptionMod/BaseUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ IBaseUI *baseuifuncs;
IGameUIFuncs *gameuifuncs;

extern vgui::ISurface *g_pSurface;
extern vgui::ISurface_HL25* g_pSurface_HL25;
extern vgui::ISchemeManager *g_pScheme;
extern vgui::ISchemeManager_HL25 *g_pScheme_HL25;
extern IKeyValuesSystem *g_pKeyValuesSystem;
Expand All @@ -63,47 +64,53 @@ extern IEngineSurface_HL25 *staticSurface_HL25;

static bool s_LoadingClientFactory = false;

extern CreateInterfaceFn* g_pClientFactory;

void CBaseUI::Initialize(CreateInterfaceFn *factories, int count)
{
#if 0
//Patch ClientFactory
/*if(!g_IsClientVGUI2 && *gPrivateFuncs.pfnClientFactory == NULL)

if(!g_IsClientVGUI2 && *g_pClientFactory == NULL)
{
*gPrivateFuncs.pfnClientFactory = NewClientFactory;
*g_pClientFactory = (CreateInterfaceFn)NewClientFactory;
s_LoadingClientFactory = true;
}*/
}
#endif

m_pfnCBaseUI_Initialize(this, 0, factories, count);

#if 0
s_LoadingClientFactory = false;

#endif
HINTERFACEMODULE hVGUI2 = (HINTERFACEMODULE)GetModuleHandle("vgui2.dll");
if (hVGUI2)
{
CreateInterfaceFn fnVGUI2CreateInterface = Sys_GetFactory(hVGUI2);

if (g_iEngineType != ENGINE_GOLDSRC_HL25)
g_pScheme = (vgui::ISchemeManager *)fnVGUI2CreateInterface(VGUI_SCHEME_INTERFACE_VERSION, NULL);
if (g_iEngineType == ENGINE_GOLDSRC_HL25)
g_pScheme_HL25 = (vgui::ISchemeManager_HL25*)fnVGUI2CreateInterface(VGUI_SCHEME_INTERFACE_VERSION, NULL);
else
g_pScheme_HL25 = (vgui::ISchemeManager_HL25 *)fnVGUI2CreateInterface(VGUI_SCHEME_INTERFACE_VERSION, NULL);
g_pScheme = (vgui::ISchemeManager*)fnVGUI2CreateInterface(VGUI_SCHEME_INTERFACE_VERSION, NULL);

g_pKeyValuesSystem = (IKeyValuesSystem *)fnVGUI2CreateInterface(KEYVALUESSYSTEM_INTERFACE_VERSION, NULL);
}

g_pSurface = (vgui::ISurface *)factories[0](VGUI_SURFACE_INTERFACE_VERSION, NULL);
if (g_iEngineType == ENGINE_GOLDSRC_HL25)
g_pSurface_HL25 = (vgui::ISurface_HL25*)factories[0](VGUI_SURFACE_INTERFACE_VERSION, NULL);
else
g_pSurface = (vgui::ISurface *)factories[0](VGUI_SURFACE_INTERFACE_VERSION, NULL);

if (g_iEngineType != ENGINE_GOLDSRC_HL25)
staticSurface = (IEngineSurface *)factories[0](ENGINE_SURFACE_VERSION, NULL);
if (g_iEngineType == ENGINE_GOLDSRC_HL25)
staticSurface_HL25 = (IEngineSurface_HL25*)factories[0](ENGINE_SURFACE_VERSION, NULL);
else
staticSurface_HL25 = (IEngineSurface_HL25 *)factories[0](ENGINE_SURFACE_VERSION, NULL);
staticSurface = (IEngineSurface*)factories[0](ENGINE_SURFACE_VERSION, NULL);

KeyValuesSystem_InstallHook();

if (g_iEngineType != ENGINE_GOLDSRC_HL25)
{
Surface_InstallHooks();
Scheme_InstallHooks();
GameUI_InstallHooks();
}
Surface_InstallHooks();
Scheme_InstallHooks();
GameUI_InstallHooks();
}

void CBaseUI::Start(struct cl_enginefuncs_s *engineFuncs, int interfaceVersion)
Expand Down
23 changes: 11 additions & 12 deletions Plugins/CaptionMod/CaptionMod.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)tools\global.props" Condition="exists('$(SolutionDir)tools\global.props')" />
<Import Project="$(SolutionDir)tools\global.props" Condition="exists('$(SolutionDir)tools\global.props')" />
<Import Project="$(SolutionDir)tools\global_template.props" Condition="!exists('$(SolutionDir)tools\global.props') and exists('$(SolutionDir)tools\global_template.props')" />
<Import Project="$(SolutionDir)tools\global_common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_AVX2|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)tools\global.props" Condition="exists('$(SolutionDir)tools\global.props')" />
<Import Project="$(SolutionDir)tools\global.props" Condition="exists('$(SolutionDir)tools\global.props')" />
<Import Project="$(SolutionDir)tools\global_template.props" Condition="!exists('$(SolutionDir)tools\global.props') and exists('$(SolutionDir)tools\global_template.props')" />
<Import Project="$(SolutionDir)tools\global_common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)tools\global.props" Condition="exists('$(SolutionDir)tools\global.props')" />
<Import Project="$(SolutionDir)tools\global.props" Condition="exists('$(SolutionDir)tools\global.props')" />
<Import Project="$(SolutionDir)tools\global_template.props" Condition="!exists('$(SolutionDir)tools\global.props') and exists('$(SolutionDir)tools\global_template.props')" />
<Import Project="$(SolutionDir)tools\global_common.props" />
</ImportGroup>
Expand All @@ -77,15 +77,12 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\;$(SolutionDir)include;$(SolutionDir)include\Interface;$(SolutionDir)include\HLSDK\cl_dll;$(SolutionDir)include\HLSDK\common;$(SolutionDir)include\HLSDK\engine;$(SolutionDir)include\HLSDK\pm_shared;$(SolutionDir)include\HLSDK\public;$(SolutionDir)include\SteamSDK;$(SolutionDir)include\VGUI;$(SolutionDir)include\vgui_controls;$(SolutionDir)include\SourceSDK;$(SolutionDir)include\SourceSDK\tier0;$(SolutionDir)include\SourceSDK\tier1;$(SolutionDir)include\SourceSDK\vstdlib;$(CapstoneIncludeDirectory);$(GLEWIncludeDirectory);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;STEAM_API_NODLL;GLEW_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;STEAM_API_NODLL;GLEW_STATIC;VGUI_USE_SURFACE2;VGUI_USE_SCHEME2;NO_MALLOC_OVERRIDE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader />
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableSpecificWarnings>4291;4311;4312;4819;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<Optimization>Disabled</Optimization>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(SolutionDir)include\SourceSDK\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
Expand All @@ -106,7 +103,7 @@ $(GLEWCheckRequirements)</Command>
<ClCompile>
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>.\;$(SolutionDir)include;$(SolutionDir)include\Interface;$(SolutionDir)include\HLSDK\cl_dll;$(SolutionDir)include\HLSDK\common;$(SolutionDir)include\HLSDK\engine;$(SolutionDir)include\HLSDK\pm_shared;$(SolutionDir)include\HLSDK\public;$(SolutionDir)include\SteamSDK;$(SolutionDir)include\VGUI;$(SolutionDir)include\vgui_controls;$(SolutionDir)include\SourceSDK;$(SolutionDir)include\SourceSDK\tier0;$(SolutionDir)include\SourceSDK\tier1;$(SolutionDir)include\SourceSDK\vstdlib;$(CapstoneIncludeDirectory);$(GLEWIncludeDirectory);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;STEAM_API_NODLL;GLEW_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;STEAM_API_NODLL;GLEW_STATIC;VGUI_USE_SURFACE2;VGUI_USE_SCHEME2;NO_MALLOC_OVERRIDE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader />
Expand Down Expand Up @@ -176,9 +173,10 @@ $(GLEWCheckRequirements)</Command>
<ClCompile Include="KeyValuesSystemHook.cpp" />
<ClCompile Include="message.cpp" />
<ClCompile Include="plugins.cpp" />
<ClCompile Include="Scheme.cpp" />
<ClCompile Include="Scheme2.cpp" />
<ClCompile Include="SchemeHook.cpp" />
<ClCompile Include="SubtitlePanel.cpp" />
<ClCompile Include="Surface2.cpp" />
<ClCompile Include="SurfaceHook.cpp" />
<ClCompile Include="Viewport.cpp" />
<ClCompile Include="Win32Font.cpp" />
Expand All @@ -191,7 +189,6 @@ $(GLEWCheckRequirements)</Command>
<ClCompile Include="$(SolutionDir)include\SourceSDK\mathlib\3dnow.cpp" />
<ClCompile Include="$(SolutionDir)include\SourceSDK\mathlib\mathlib_base.cpp" />
<ClCompile Include="$(SolutionDir)include\SourceSDK\mathlib\sse.cpp" />
<ClCompile Include="$(SolutionDir)include\SourceSDK\Surface.cpp" />
<ClCompile Include="$(SolutionDir)include\SourceSDK\tier0\assert_dialog.cpp" />
<ClCompile Include="$(SolutionDir)include\SourceSDK\tier0\cpu.cpp" />
<ClCompile Include="$(SolutionDir)include\SourceSDK\tier0\dbg.cpp" />
Expand Down Expand Up @@ -302,7 +299,9 @@ $(GLEWCheckRequirements)</Command>
<ClInclude Include="FontTextureCache.h" />
<ClInclude Include="message.h" />
<ClInclude Include="plugins.h" />
<ClInclude Include="Scheme2.h" />
<ClInclude Include="SubtitlePanel.h" />
<ClInclude Include="Surface2.h" />
<ClInclude Include="vgui_internal.h" />
<ClInclude Include="Viewport.h" />
<ClInclude Include="Win32Font.h" />
Expand Down
26 changes: 16 additions & 10 deletions Plugins/CaptionMod/CaptionMod.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<ClCompile Include="FontTextureCache.cpp">
<Filter>VGUI2</Filter>
</ClCompile>
<ClCompile Include="Scheme.cpp">
<ClCompile Include="Scheme2.cpp">
<Filter>VGUI2</Filter>
</ClCompile>
<ClCompile Include="SurfaceHook.cpp">
Expand All @@ -164,9 +164,6 @@
<ClCompile Include="Win32Font.cpp">
<Filter>VGUI2</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)include\SourceSDK\Surface.cpp">
<Filter>VGUI2</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)include\SourceSDK\VPanel.cpp">
<Filter>VGUI2</Filter>
</ClCompile>
Expand Down Expand Up @@ -329,9 +326,6 @@
<ClCompile Include="$(SolutionDir)\include\vgui_controls\PanelListPanel.cpp">
<Filter>vgui_controls</Filter>
</ClCompile>
<ClCompile Include="privatefuncs.cpp">
<Filter>vgui_controls</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\include\vgui_controls\ProgressBar.cpp">
<Filter>vgui_controls</Filter>
</ClCompile>
Expand Down Expand Up @@ -362,9 +356,6 @@
<ClCompile Include="$(SolutionDir)\include\vgui_controls\savedocumentquery.cpp">
<Filter>vgui_controls</Filter>
</ClCompile>
<ClCompile Include="SchemeHook.cpp">
<Filter>vgui_controls</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\include\vgui_controls\ScrollableEditablePanel.cpp">
<Filter>vgui_controls</Filter>
</ClCompile>
Expand Down Expand Up @@ -440,6 +431,15 @@
<ClCompile Include="$(SolutionDir)include\HLSDK\common\parsemsg.cpp">
<Filter>HLSDK</Filter>
</ClCompile>
<ClCompile Include="privatefuncs.cpp">
<Filter>Source</Filter>
</ClCompile>
<ClCompile Include="SchemeHook.cpp">
<Filter>VGUI2</Filter>
</ClCompile>
<ClCompile Include="Surface2.cpp">
<Filter>VGUI2</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="enginedef.h">
Expand Down Expand Up @@ -997,5 +997,11 @@
<ClInclude Include="$(SolutionDir)include\VGUI\BaseUI.h">
<Filter>VGUI2</Filter>
</ClInclude>
<ClInclude Include="Scheme2.h">
<Filter>VGUI2</Filter>
</ClInclude>
<ClInclude Include="Surface2.h">
<Filter>VGUI2</Filter>
</ClInclude>
</ItemGroup>
</Project>
10 changes: 9 additions & 1 deletion Plugins/CaptionMod/ClientVGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ void CClientVGUI::Shutdown(void)

}

void ClientVGUI_InstallHook(void)
void* NewClientFactory(void);

void ClientVGUI_InstallHook(cl_exportfuncs_t* pExportFunc)
{
CreateInterfaceFn ClientVGUICreateInterface = NULL;

Expand Down Expand Up @@ -150,6 +152,11 @@ void ClientVGUI_InstallHook(void)
g_IsClientVGUI2 = true;
}
}

if (!g_IsClientVGUI2)
{
pExportFunc->ClientFactory = NewClientFactory;
}
}

//implement the ClientVGUI interface for those mod with no ClientVGUI implemented
Expand Down Expand Up @@ -185,6 +192,7 @@ void NewClientVGUI::Initialize(CreateInterfaceFn *factories, int count)
}

extern vgui::ISurface *g_pSurface;
extern vgui::ISurface_HL25* g_pSurface_HL25;

void NewClientVGUI::Start(void)
{
Expand Down
16 changes: 16 additions & 0 deletions Plugins/CaptionMod/FontAmalgam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,20 @@ bool CFontAmalgam::GetOutlined(void)
return false;

return m_Fonts[0].font->GetOutlined();
}

int CFontAmalgam::GetBlur(void)
{
if (!m_Fonts.Count())
return false;

return m_Fonts[0].font->GetBlur();
}

bool CFontAmalgam::GetAdditive(void)
{
if (!m_Fonts.Count())
return false;

return m_Fonts[0].font->GetAdditive();
}
Loading

0 comments on commit d766310

Please sign in to comment.