goldberg_emulator/overlay_experimental/steam_overlay.h

82 lines
2.1 KiB
C
Raw Normal View History

#ifndef __INCLUDED_STEAM_OVERLAY_H__
#define __INCLUDED_STEAM_OVERLAY_H__
2019-07-25 23:33:07 +02:00
#include "../dll/base.h"
2019-07-25 23:33:07 +02:00
#include "Hook_Manager.h"
#include <vector>
2019-07-25 23:33:07 +02:00
enum friend_action
{
friend_action_none = 0,
friend_action_invite = 1<<0,
friend_action_join = 1<<1
};
2019-07-25 23:33:07 +02:00
class Steam_Overlay
{
Settings* settings;
SteamCallResults* callback_results;
SteamCallBacks* callbacks;
RunEveryRunCB* run_every_runcb;
Networking* network;
const std::vector<Friend>* friends;
2019-07-25 23:33:07 +02:00
HWND game_hwnd;
WNDPROC game_hwnd_proc;
bool is_ready;
bool show_overlay;
Base_Hook window_hooks;
ENotificationPosition notif_position;
int h_inset, v_inset;
// Callback infos
uint64 friend_to_action;
int friend_action;
bool overlay_state_changed;
2019-07-25 23:33:07 +02:00
Steam_Overlay(Steam_Overlay const&) = delete;
Steam_Overlay(Steam_Overlay&&) = delete;
Steam_Overlay& operator=(Steam_Overlay const&) = delete;
Steam_Overlay& operator=(Steam_Overlay&&) = delete;
bool IgnoreMsg(const MSG* lpMsg);
LRESULT HookWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
2019-07-25 23:33:07 +02:00
static LRESULT CALLBACK sHookWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT WINAPI MyDispatchMessageA(const MSG* lpMsg);
static LRESULT WINAPI MyDispatchMessageW(const MSG* lpMsg);
2019-07-25 23:33:07 +02:00
static void steam_overlay_run_every_runcb(void* object);
void RunCallbacks();
2019-07-25 23:33:07 +02:00
public:
Steam_Overlay(Settings* settings, SteamCallResults* callback_results, SteamCallBacks* callbacks, RunEveryRunCB* run_every_runcb, Networking *network);
2019-07-25 23:33:07 +02:00
~Steam_Overlay();
2019-07-25 23:33:07 +02:00
HWND GetGameHwnd() const;
2019-07-25 23:33:07 +02:00
bool Ready() const;
2019-07-25 23:33:07 +02:00
bool NeedPresent() const;
2019-07-25 23:33:07 +02:00
void SetNotificationPosition(ENotificationPosition eNotificationPosition);
2019-07-25 23:33:07 +02:00
void SetNotificationInset(int nHorizontalInset, int nVerticalInset);
void SetupOverlay();
2019-07-25 23:33:07 +02:00
void HookReady(void* hWnd);
2019-07-25 23:33:07 +02:00
void OverlayProc(int width, int height);
2019-07-25 23:33:07 +02:00
void SetupFriends(const std::vector<Friend>* friends);
2019-07-25 23:33:07 +02:00
void OpenOverlayInvite(CSteamID lobbyId);
void OpenOverlay(const char* pchDialog);
2019-07-25 23:33:07 +02:00
void ShowOverlay(bool state);
};
2019-07-25 23:33:07 +02:00
#endif//__INCLUDED_STEAM_OVERLAY_H__