From 612e3159bd6bb413ab4473bb848fa2a25af6b1cc Mon Sep 17 00:00:00 2001 From: Kotti Date: Fri, 24 Apr 2026 17:22:34 +0300 Subject: [PATCH 1/3] Add HUDPersist mod --- CMakeLists.txt | 1 + .../include/Glacier/UI/EHUDItem.h | 12 ++- Mods/HUDPersist/CMakeLists.txt | 29 ++++++ Mods/HUDPersist/include/HUDPersist.h | 22 +++++ Mods/HUDPersist/src/HUDPersist.cpp | 56 ++++++++++++ README.md | 88 +++++++++++-------- 6 files changed, 172 insertions(+), 36 deletions(-) create mode 100644 Mods/HUDPersist/CMakeLists.txt create mode 100644 Mods/HUDPersist/include/HUDPersist.h create mode 100644 Mods/HUDPersist/src/HUDPersist.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index d3e4d5a..f70d9c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,7 @@ set(MODS Editor Noclip HUD + HUDPersist Camera ) diff --git a/HitmanAbsolutionSDK/include/Glacier/UI/EHUDItem.h b/HitmanAbsolutionSDK/include/Glacier/UI/EHUDItem.h index edad06f..9ec4e17 100644 --- a/HitmanAbsolutionSDK/include/Glacier/UI/EHUDItem.h +++ b/HitmanAbsolutionSDK/include/Glacier/UI/EHUDItem.h @@ -16,5 +16,15 @@ enum EHUDItem HUD_ITEM_DARE_TIMER = 11, HUD_ITEM_PROFILE_DATA = 12, HUD_ITEM_DEBUGLOG = 13, - HUD_ITEM_NUM = 14 + HUD_ITEM_SCORE_INFO_MESSAGE = 14, + HUD_ITEM_RATING_TRACKER = 15, + HUD_ITEM_UNKNOWN_1 = 16, + HUD_ITEM_TARGET_TRACKER = 17, + HUD_ITEM_UNKNOWN_2 = 18, + HUD_ITEM_UNKNOWN_3 = 19, + HUD_ITEM_HEALTH_BAR = 20, + HUD_ITEM_OBJECTIVE_MESSAGE = 21, + HUD_ITEM_ITEM_HOTBAR = 22, + HUD_ITEM_NUM = 23, + }; diff --git a/Mods/HUDPersist/CMakeLists.txt b/Mods/HUDPersist/CMakeLists.txt new file mode 100644 index 0000000..c01a599 --- /dev/null +++ b/Mods/HUDPersist/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.8) + +file(GLOB_RECURSE HEADER_FILES + CONFIGURE_DEPENDS + include/*.h +) + +file(GLOB_RECURSE SRC_FILES + CONFIGURE_DEPENDS + src/*.cpp + src/*.c +) + +add_library(HUDPersist SHARED + ${HEADER_FILES} + ${SRC_FILES} +) + +target_include_directories(HUDPersist PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/include +) + +target_link_libraries(HUDPersist PRIVATE + HitmanAbsolutionSDK +) + +install(TARGETS HUDPersist + RUNTIME DESTINATION bin/mods +) diff --git a/Mods/HUDPersist/include/HUDPersist.h b/Mods/HUDPersist/include/HUDPersist.h new file mode 100644 index 0000000..1ad9a3c --- /dev/null +++ b/Mods/HUDPersist/include/HUDPersist.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +#include + +class HUDPersist : public ModInterface +{ +public: + HUDPersist(); + ~HUDPersist(); + + void OnEngineInitialized() override; + void OnDrawMenu() override; + +private: + void OnFrameUpdate(const SGameUpdateEvent& updateEvent); + + bool isHUDPersistEnabled; +}; + +DECLARE_MOD(HUDPersist) diff --git a/Mods/HUDPersist/src/HUDPersist.cpp b/Mods/HUDPersist/src/HUDPersist.cpp new file mode 100644 index 0000000..1df4923 --- /dev/null +++ b/Mods/HUDPersist/src/HUDPersist.cpp @@ -0,0 +1,56 @@ +#include + +#include "imgui.h" + +#include "Glacier/ZGameLoopManager.h" +#include "Glacier/ZLevelManager.h" +#include "Glacier/UI/ZHUDManager.h" +#include "Glacier/UI/EHUDFadeReason.h" +#include "Glacier/Player/ZHitman5.h" + +#include "Hooks.h" +#include "HUDPersist.h" + +// Bitmask covering all HUD_ITEM_NUM elements +static constexpr unsigned int ALL_HUD_ELEMENTS = (1u << HUD_ITEM_NUM) - 1; + +HUDPersist::HUDPersist() : + isHUDPersistEnabled(true) +{ +} + +HUDPersist::~HUDPersist() +{ + const ZMemberDelegate delegate(this, &HUDPersist::OnFrameUpdate); + + GameLoopManager->UnregisterForFrameUpdate(delegate); +} + +void HUDPersist::OnEngineInitialized() +{ + const ZMemberDelegate delegate(this, &HUDPersist::OnFrameUpdate); + + GameLoopManager->RegisterForFrameUpdate(delegate, 1); +} + +void HUDPersist::OnDrawMenu() +{ + ImGui::Checkbox(ICON_MD_SELF_IMPROVEMENT " HUD Persist", &isHUDPersistEnabled); +} + +void HUDPersist::OnFrameUpdate(const SGameUpdateEvent& updateEvent) +{ + ZHitman5* hitman = LevelManager->GetHitman().GetRawPointer(); + + if (!isHUDPersistEnabled || !hitman) + { + return; + } + + for (int reason = 0; reason < HUD_FADE_REASON_NUM; ++reason) + { + HUDManager->FadeHUDElements(ALL_HUD_ELEMENTS, static_cast(reason), true, 0.0f); + } +} + +DEFINE_MOD(HUDPersist); diff --git a/README.md b/README.md index eb49f97..f136d10 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # HitmanAbsolutionSDK - SDK for Hitman Absolution + +SDK for Hitman Absolution @@ -8,18 +9,22 @@ ![HMA_POST](https://github.com/user-attachments/assets/0bfcc67d-f588-4b8a-98c8-f5108a2e4bcb) ## Install + Extract the content of the `AbsolutionSDK-Release.zip` archive to `:\Program Files (x86)\Steam\steamapps\common\Hitman Absolution` image ## Usage + Open SDK menu by pressing `~` key ## Contracts Mode + To use SDK with [Hitman-5-Server](https://github.com/LennardF1989/Hitman-5-Server) add `ConsoleCmd WebServiceUrl http://localhost:40147/hm5` below `[application]` in HMA.ini \ Port should match port specified in appsettings.json for HM5.Server ## Mods + ![image](https://github.com/user-attachments/assets/9ad1b04b-90da-4f3b-9a0b-d198c1c16fd0) The SDK includes 9 mods which can be activated or deactivated at any time depending on the purpose. Some of them like Freecamera and HUD have a specific key for activation or deactivation. @@ -27,99 +32,112 @@ To enable or disable one or many mods, click on `MODS` in the SDK bar. Check and ![image](https://github.com/user-attachments/assets/01b7624f-2fcd-4357-89e0-e40d301c5ae4) ### Actors + Displays all actors and has options to equip model of actors, teleport actor to hitman, teleport hitman to actor, add weapon to inventory of actor and teleport all actors to hitman.

![image](https://github.com/user-attachments/assets/a47b3fd8-7815-4547-bdd5-908c62170ab8) ### Camera + Change FOV and toggle LUT and Vignette effects.

![image](https://github.com/user-attachments/assets/c486b511-0474-4ac9-8a03-943829a4c2ed) Before disabling LUT and FOV change ![image](https://github.com/user-attachments/assets/1ff8f9ac-bc1b-418d-9f6f-85d948a0182a) +

-After disabling LUT +After disabling LUT ![image](https://github.com/user-attachments/assets/70b34a57-b5fd-4ee0-8c96-802af886d24c) +

FOV Change ![image](https://github.com/user-attachments/assets/1cf859ee-8843-4749-a50f-d01088311e78) - ### Editor + Displays tree with entities of scene and it can be used to modify properties and trigger input/output pins.

![image](https://github.com/user-attachments/assets/efd5a54f-3060-47eb-be82-5fb6a8e6e76b) ### HUD + Toggle HUD and all HUD items.

![image](https://github.com/user-attachments/assets/40d6ec87-cab2-449b-acea-e4df94af016f) +### HUDPersist + +Prevent HUD elements from fading out when using Instinct.

+ ### Items + Displays all items and has option to teleport all items to hitman.

![image](https://github.com/user-attachments/assets/68f62784-3151-4494-b464-2aa0fa646c2d) ### Player + It has tab for cheats(god mode, invisibility, infinite ammo, refill focus), tab for equping disguise/model of specified actors, tabs for spawning specified weapon/item/prop to world/inventory and tab for spawning actor. ![image](https://github.com/user-attachments/assets/9ad3d39a-97d6-4036-85ca-bf4759850534) ### StartingOutfitAndWeaponModifier + Sets starting outfit and weapon.

![image](https://github.com/user-attachments/assets/77ae42a8-d34f-4d79-aa8a-a2632c2788a5) ### NoClip + Make player fly. ### FreeCamera + Adds support for free camera. ## Configuration ### General Settings + `Read HMA.ini` is used to re-activate the contract feature in the game.

`Patch Resources` is used for installing modified files.

`Pause On Focus Loss` will pause the game at ALT-TAB. Uncheck this is you want to switch windows without pause. Usefull option for screenshooting.

The last option will minimize the game to the task bar.

![image](https://github.com/user-attachments/assets/b9c25952-6a79-484a-815f-1d2d9e92f267) - ### Mods Configuration + Mods like `FreeCamera`, `HUD`, `NoClip` and `Player` have a configurable `.ini` file in which you can change the key bindings at wish. Files are located in `.\steamapps\common\Hitman Absolution\mod` Accepted bindigs can be found in [THIS FILE](https://github.com/user-attachments/files/18822180/keys.txt). ## Controls -|Key | Description| -| -------- | ----------- | -|**Free Camera**|| -|K | Enable/Disable Free Camera| -|B+R | Increase/Decrease Camera Speed| -|LS | Forward/Backward/Left/Right| -|RS | Pan/Tilt| -|A+LS | Roll Camera| -|Y+LS | Change FOV| -|LB | Lock Camera and Enable 47 Input| -|RT (HOLD) | Faster Camera Movements| -|LT+RS | Camera Lift Up/Down| -|A+LS (Press)| Reset Roll| -|F9 | Kill NPC| -|CTRL+F9| Teleport 47 To Camera| -|F10 | Pause/Unpause Game and Activate/Deactivate Free Camera| -|F11 | Pause/Unpause Game| -| | | -|**HUD**| | -|F8 |Enable/Disable HUD| -| | | -|**No Clip**| | -|N |Enable/Disable No Clip| -| | | -|**Player** | | -|I |Get Outfit| -|O |Get Model| -|P | Change Outfit| -|J |Teleport Hitman| - - +| Key | Description | +| --------------- | ------------------------------------------------------ | +| **Free Camera** | | +| K | Enable/Disable Free Camera | +| B+R | Increase/Decrease Camera Speed | +| LS | Forward/Backward/Left/Right | +| RS | Pan/Tilt | +| A+LS | Roll Camera | +| Y+LS | Change FOV | +| LB | Lock Camera and Enable 47 Input | +| RT (HOLD) | Faster Camera Movements | +| LT+RS | Camera Lift Up/Down | +| A+LS (Press) | Reset Roll | +| F9 | Kill NPC | +| CTRL+F9 | Teleport 47 To Camera | +| F10 | Pause/Unpause Game and Activate/Deactivate Free Camera | +| F11 | Pause/Unpause Game | +| | | +| **HUD** | | +| F8 | Enable/Disable HUD | +| | | +| **No Clip** | | +| N | Enable/Disable No Clip | +| | | +| **Player** | | +| I | Get Outfit | +| O | Get Model | +| P | Change Outfit | +| J | Teleport Hitman |