Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,24 @@ jobs:
- name: Build and install debug
run: |
cmake --preset x64-Debug .
$f = Get-ChildItem _build/x64-Debug -Recurse -Filter steamnetworkingsockets_internal.h | Select-Object -First 1
if (-not $f) { throw "GNS header nicht gefunden" }
$txt = Get-Content $f.FullName -Raw
$new = $txt -replace 'msg\.GetTypeName\(\)\.c_str\(\)', 'std::string( msg.GetTypeName() ).c_str()'
if ($new -eq $txt) { throw "Patch wurde nicht angewendet" }
Set-Content -Path $f.FullName -Value $new -NoNewline
cmake --build _build/x64-Debug -j12
cmake --install _build/x64-Debug

- name: Build and install release
run: |
cmake --preset x64-Release .
$f = Get-ChildItem _build/x64-Release -Recurse -Filter steamnetworkingsockets_internal.h | Select-Object -First 1
if (-not $f) { throw "GNS header nicht gefunden" }
$txt = Get-Content $f.FullName -Raw
$new = $txt -replace 'msg\.GetTypeName\(\)\.c_str\(\)', 'std::string( msg.GetTypeName() ).c_str()'
if ($new -eq $txt) { throw "Patch wurde nicht angewendet" }
Set-Content -Path $f.FullName -Value $new -NoNewline
cmake --build _build/x64-Release -j12
cmake --install _build/x64-Release

Expand Down Expand Up @@ -173,4 +185,4 @@ jobs:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ matrix.artifact }}/${{ matrix.artifact }}.zip
asset_name: ${{ matrix.artifact }}.zip
asset_content_type: application/zip
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ find_package(imguizmo CONFIG REQUIRED)
find_package(unofficial-imgui-node-editor CONFIG REQUIRED)
find_package(implot CONFIG REQUIRED)
find_package(directxtex CONFIG REQUIRED)
#CPMAddPackage("gh:ValveSoftware/GameNetworkingSockets@1.4.1")
CPMAddPackage("gh:ValveSoftware/GameNetworkingSockets@1.4.1")
CPMAddPackage("gh:OrfeasZ/ZHMTools@4.0.0")
#add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../ZHMTools" "${VCPKG_BUILD_ROOT}/zhmtools")

Expand Down
32 changes: 5 additions & 27 deletions Mods/Hitmen/Src/Hitmen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "Glacier/EntityFactory.h"
#include <ranges>

#include "backends/imgui_impl_dx12.h"
#include <imgui_impl_dx12.h>
#include "Glacier/SGameUpdateEvent.h"
#include "Glacier/ZCollision.h"
#include "Glacier/ZPhysics.h"
Expand Down Expand Up @@ -64,7 +64,6 @@ void Hitmen::Init()
{
Hooks::ZEntitySceneContext_ClearScene->AddDetour(this, &Hitmen::OnClearScene);
Hooks::ZEntitySceneContext_LoadScene->AddDetour(this, &Hitmen::OnLoadScene);
Hooks::ZPlayerRegistry_GetLocalPlayer->AddDetour(this, &Hitmen::GetLocalPlayer);
}

static void ServerCallback(SteamNetConnectionStatusChangedCallback_t* p_Info)
Expand Down Expand Up @@ -578,24 +577,10 @@ void Hitmen::OnDraw3D(IRenderer* p_Renderer)
}
}*/
}

DEFINE_PLUGIN_DETOUR(Hitmen, void, OnLoadScene, ZEntitySceneContext* th, ZSceneData& p_SceneData)
{
// p_SceneData.m_sceneName = "assembly:/_pro/scenes/users/notex/test.entity";
//p_SceneData.m_sceneName = "assembly:/_pro/scenes/missions/golden/mission_gecko/scene_gecko_basic.entity";
//p_SceneData.m_sceneName = "assembly:/_PRO/Scenes/Missions/TheFacility/_Scene_Mission_Polarbear_Module_002_B.entity";
//p_SceneData.m_sceneBricks.clear();

//p_SceneData.m_sceneName = "assembly:/_PRO/Scenes/Missions/Ancestral/scene_bulldog.entity";
//p_SceneData.m_sceneBricks.clear();
//p_SceneData.m_sceneBricks.push_back("assembly:/_PRO/scenes/missions/golden/mission_gecko/mission_gecko.brick");

/*
* Loading scene: assembly:/_pro/scenes/missions/golden/mission_gecko/scene_gecko_basic.entity
+ With brick: assembly:/_PRO/scenes/missions/golden/mission_gecko/mission_gecko.brick
*/
return HookResult<void>(HookAction::Continue());
}
DEFINE_PLUGIN_DETOUR(Hitmen, bool, OnLoadScene, ZEntitySceneContext* th, SSceneInitParameters& p_SceneData)
{
return HookResult<bool>(HookAction::Continue());
}

DEFINE_PLUGIN_DETOUR(Hitmen, void, OnClearScene, ZEntitySceneContext* th, bool p_FullyUnloadScene)
{
Expand All @@ -605,11 +590,4 @@ DEFINE_PLUGIN_DETOUR(Hitmen, void, OnClearScene, ZEntitySceneContext* th, bool p
return HookResult<void>(HookAction::Continue());
}

DEFINE_PLUGIN_DETOUR(Hitmen, TEntityRef<ZHitman5>*, GetLocalPlayer, ZPlayerRegistry* th, TEntityRef<ZHitman5>* out)
{
auto s_Result = p_Hook->CallOriginal(th, out);

return HookResult(HookAction::Return(), out);
}

DEFINE_ZHM_PLUGIN(Hitmen);
4 changes: 2 additions & 2 deletions Mods/Hitmen/Src/Hitmen.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ class Hitmen : public IPluginInterface
void OnNpcPositions(BinaryStreamReader& p_Reader);

private:
DECLARE_PLUGIN_DETOUR(Hitmen, void, OnLoadScene, ZEntitySceneContext*, ZSceneData&);
DECLARE_PLUGIN_DETOUR(Hitmen, bool, OnLoadScene, ZEntitySceneContext*, SSceneInitParameters&);
DECLARE_PLUGIN_DETOUR(Hitmen, void, OnClearScene, ZEntitySceneContext* th, bool p_FullyUnloadScene);
DECLARE_PLUGIN_DETOUR(Hitmen, TEntityRef<ZHitman5>*, GetLocalPlayer, ZPlayerRegistry* th, TEntityRef<ZHitman5>* out);
// DECLARE_PLUGIN_DETOUR(Hitmen, TEntityRef<ZHitman5>*, GetLocalPlayer, ZPlayerRegistry* th, TEntityRef<ZHitman5>* out);

private:
bool m_Initialized = false;
Expand Down
1 change: 0 additions & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"lz4",
"directx-headers",
"protobuf",
"gamenetworkingsockets",
"zlib",
"libuv",
{
Expand Down
Loading