@@ -18,7 +18,6 @@ void Overlay::PostInitialize()
18
18
19
19
auto & d3d12 = CET::Get ().GetD3D12 ();
20
20
d3d12.DelayedSetTrapInputInImGui (true );
21
- ClipToCenter (RED4ext::CGameEngine::Get ()->unkD0 );
22
21
}
23
22
else
24
23
{
@@ -194,8 +193,6 @@ void Overlay::Update()
194
193
195
194
auto & d3d12 = CET::Get ().GetD3D12 ();
196
195
d3d12.DelayedSetTrapInputInImGui (m_enabled);
197
- auto * pEngine = RED4ext::CGameEngine::Get ();
198
- ClipToCenter (pEngine->unkD0 );
199
196
m_toggled = false ;
200
197
}
201
198
}
@@ -211,9 +208,9 @@ void Overlay::Update()
211
208
ImGui::RenderNotifications ();
212
209
213
210
// ——————————————————————————————— WARNING ———————————————————————————————
214
- // Argument MUST match the amount of ImGui::PushStyleVar() calls
211
+ // Argument MUST match the amount of ImGui::PushStyleVar() calls
215
212
ImGui::PopStyleVar (2 );
216
- // Argument MUST match the amount of ImGui::PushStyleColor() calls
213
+ // Argument MUST match the amount of ImGui::PushStyleColor() calls
217
214
ImGui::PopStyleColor (1 );
218
215
219
216
if (!m_enabled)
@@ -240,48 +237,6 @@ bool Overlay::IsInitialized() const noexcept
240
237
return m_initialized;
241
238
}
242
239
243
- BOOL Overlay::ClipToCenter (RED4ext::CGameEngine::UnkD0* apThis)
244
- {
245
- const auto wnd = static_cast <HWND>(apThis->hWnd );
246
- const HWND foreground = GetForegroundWindow ();
247
-
248
- if (wnd == foreground && apThis->unk174 && !apThis->unk164 && !CET::Get ().GetOverlay ().IsEnabled ())
249
- {
250
- RECT rect;
251
- GetClientRect (wnd, &rect);
252
- ClientToScreen (wnd, reinterpret_cast <POINT*>(&rect.left ));
253
- ClientToScreen (wnd, reinterpret_cast <POINT*>(&rect.right ));
254
- rect.left = (rect.left + rect.right ) / 2 ;
255
- rect.right = rect.left ;
256
- rect.bottom = (rect.bottom + rect.top ) / 2 ;
257
- rect.top = rect.bottom ;
258
- apThis->isClipped = true ;
259
- ShowCursor (FALSE );
260
- return ClipCursor (&rect);
261
- }
262
-
263
- if (apThis->isClipped )
264
- {
265
- apThis->isClipped = false ;
266
- return ClipCursor (nullptr );
267
- }
268
-
269
- return 1 ;
270
- }
271
-
272
- void Overlay::Hook ()
273
- {
274
- const RED4ext::UniversalRelocPtr<uint8_t > func (CyberEngineTweaks::AddressHashes::CWinapi_ClipToCenter);
275
-
276
- if (auto * pLocation = func.GetAddr ())
277
- {
278
- if (MH_CreateHook (pLocation, reinterpret_cast <void *>(&ClipToCenter), reinterpret_cast <void **>(&m_realClipToCenter)) != MH_OK || MH_EnableHook (pLocation) != MH_OK)
279
- Log::Error (" Could not hook mouse clip function!" );
280
- else
281
- Log::Info (" Hook mouse clip function!" );
282
- }
283
- }
284
-
285
240
Overlay::Overlay (VKBindings& aBindings, Options& aOptions, PersistentState& aPersistentState, LuaVM& aVm)
286
241
: m_console(aOptions, aPersistentState, aVm)
287
242
, m_bindings(aBindings, aVm)
@@ -291,8 +246,6 @@ Overlay::Overlay(VKBindings& aBindings, Options& aOptions, PersistentState& aPer
291
246
, m_persistentState(aPersistentState)
292
247
, m_vm(aVm)
293
248
{
294
- Hook ();
295
-
296
249
GameMainThread::Get ().AddBaseInitializationTask (
297
250
[this ]
298
251
{
0 commit comments