forked from faggotman69/Prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlaySound.h
More file actions
36 lines (30 loc) · 939 Bytes
/
PlaySound.h
File metadata and controls
36 lines (30 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once
#include "HookIncludes.h"
typedef void(__thiscall* play_sound_t)(void*, const char*);
void IsReadyaccept()
{
using IsReadyFn = void(__cdecl*)();
static auto fnIsReady = (void(__cdecl*)(void))U::pattern_scan(GetModuleHandleW(L"client.dll"), "55 8B EC 83 E4 F8 83 EC 08 56 8B 35 ? ? ? ? 57 83 BE");
reinterpret_cast<IsReadyFn>(fnIsReady)();
}
void __stdcall hkPlaySound(const char* szFileName)
{
static auto ofunc = hooks::surface.get_original<play_sound_t>(82);
//Call original PlaySound
ofunc(g_Surface, szFileName);
if (g_Engine->IsInGame()) return;
if (g_Options.Misc.AutoAccept)
{
if (!strstr(szFileName, "!UI/competitive_accept_beep.wav"))
{
IsReadyaccept();
FLASHWINFO flash;
flash.cbSize = sizeof(FLASHWINFO);
flash.hwnd = window;
flash.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
flash.uCount = 0;
flash.dwTimeout = 0;
FlashWindowEx(&flash);
}
}
}