forked from Ryan-rsm-McKenzie/CommonLibSSE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New virtual keyboard code from 1.6.1130
- Loading branch information
Showing
8 changed files
with
210 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#pragma once | ||
|
||
#include "RE/B/BSTEvent.h" | ||
|
||
namespace RE | ||
{ | ||
class BSSystemEvent; | ||
struct BSGamepadEvent; | ||
|
||
class BSSystemUtility : | ||
public BSTEventSink<BSGamepadEvent>, // 000 | ||
public BSTEventSource<BSSystemEvent> // 008 | ||
{ | ||
public: | ||
virtual ~BSSystemUtility(); // 00 | ||
|
||
// override (BSTEventSink<BSGamepadEvent>) | ||
BSEventNotifyControl ProcessEvent(const BSGamepadEvent* a_event, BSTEventSource<BSGamepadEvent>* a_eventSource); // 01 | ||
|
||
// add | ||
virtual void GetAuthenticationInfo(char*& userAuthID, std::uint64_t& size); // 02 | ||
virtual void Func03(void); // 03 | ||
virtual void DoInitialize(); // 04 | ||
virtual void Func05(void); // 05 | ||
virtual void DoUpdate(); // 06 | ||
virtual void Func07(void); // 07 | ||
virtual void DoGetUserName(char* buffer, std::uint64_t size); // 08 | ||
virtual void Func09(void); // 09 | ||
virtual void Func0A(void); // 0A | ||
virtual void Func0B(void); // 0B | ||
virtual void Func0C(void); // 0C | ||
virtual void DoGetComputerName(char* buffer, std::uint64_t size); // 0D | ||
virtual void Func0E(void); // 0E | ||
virtual void Func0F(void); // 0F | ||
virtual void DoAuthenticateUser(); // 10 | ||
virtual void Func11(void); // 11 | ||
virtual bool Func12(); // 12 - added in 1.6.1130 | ||
|
||
// members | ||
std::uint64_t unk060[24]; // 060 | ||
std::uint8_t unk120; // 120 - added in 1.6.1130 | ||
std::uint8_t unk121; // 121 - added in 1.6.1130 | ||
std::uint16_t pad122; // 122 | ||
std::uint32_t pad124; // 124 | ||
}; | ||
static_assert(sizeof(BSSystemUtility) == 0x128); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#pragma once | ||
|
||
#include "RE/B/BSSystemUtility.h" | ||
#include "RE/B/BSVirtualKeyboardDevice.h" | ||
#include "RE/C/CCallback.h" | ||
|
||
class ISteamClient; | ||
class ISteamUtils; | ||
struct EncryptedAppTicketResponse_t; | ||
struct FloatingGamepadTextInputDismissed_t; | ||
struct GameOverlayActivated_t; | ||
struct GamepadTextInputDismissed_t; | ||
|
||
using HSteamPipe = std::int32_t; | ||
|
||
namespace RE | ||
{ | ||
class BSWin32SystemUtility : public BSSystemUtility | ||
{ | ||
public: | ||
template <class P> | ||
using SteamCallback = CCallback<BSWin32SystemUtility, P, false>; | ||
template <class P> | ||
using SteamCallResult = CCallResult<BSWin32SystemUtility, P>; | ||
|
||
using VirtualKeyboardDoneCallback = void(void*, const char*); | ||
using VirtualKeyboardCancelCallback = void(); | ||
|
||
virtual ~BSWin32SystemUtility(); // 00 | ||
|
||
// override (BSSystemUtility) | ||
void GetAuthenticationInfo(char*& userAuthID, std::uint64_t& size) override; // 02 | ||
void DoInitialize() override; // 04 | ||
void DoUpdate() override; // 06 | ||
void DoGetUserName(char* buffer, std::uint64_t size) override; // 08 | ||
void DoGetComputerName(char* buffer, std::uint64_t size) override; // 0D | ||
void DoAuthenticateUser() override; // 10 | ||
bool Func12() override; // 12 | ||
|
||
[[nodiscard]] static BSWin32SystemUtility* GetSingleton() | ||
{ | ||
using func_t = decltype(&BSWin32SystemUtility::GetSingleton); | ||
REL::Relocation<func_t> func{ Offset::BSWin32SystemUtility::GetSingleton }; | ||
return func(); | ||
} | ||
|
||
// members | ||
SteamCallback<GameOverlayActivated_t> steamcallback_GameOverlayActivated; // 128 | ||
SteamCallback<FloatingGamepadTextInputDismissed_t> steamcallback_FloatingGamepadTextInputDismissed; // 150 - added in 1.6.1130 | ||
SteamCallback<GamepadTextInputDismissed_t> steamcallback_GamepadTextInputDismissed; // 178 - added in 1.6.1130 | ||
SteamCallResult<EncryptedAppTicketResponse_t> steamcallresult_EncryptedAppTicketResponse; // 1A0 | ||
VirtualKeyboardDoneCallback* virtualKeyboardDone; // 1D0 - added in 1.6.1130 | ||
VirtualKeyboardCancelCallback* virtualKeyboardCancel; // 1D8 - added in 1.6.1130 | ||
void* virtualKeyboardUserParam; // 1E0 - added in 1.6.1130 | ||
bool steamAPIInitialized; // 1E8 - added in 1.6.1130 | ||
std::uint8_t pad1E9; // 1E9 | ||
std::uint16_t pad1EA; // 1EA | ||
std::uint32_t pad1EC; // 1EC | ||
ISteamClient* steamClient; // 1F0 - added in 1.6.1130 | ||
HSteamPipe steamPipe; // 1F8 - added in 1.6.1130 | ||
std::uint32_t pad1FC; // 1FC | ||
ISteamUtils* steamUtils; // 200 - added in 1.6.1130 | ||
bool isRunningOnSteamDeck; // 208 - added in 1.6.1130 | ||
}; | ||
static_assert(sizeof(BSWin32SystemUtility) == 0x210); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#pragma once | ||
|
||
using SteamAPICall_t = std::uint64_t; | ||
|
||
namespace RE | ||
{ | ||
class CCallbackBase | ||
{ | ||
public: | ||
enum | ||
{ | ||
k_ECallbackFlagsRegistered = 0x01, | ||
k_ECallbackFlagsGameServer = 0x02 | ||
}; | ||
|
||
virtual void Run(void* vParam); // 01 | ||
virtual void Run(void* vParam, bool ioFailure, SteamAPICall_t steamAPICall); // 00 | ||
virtual int GetCallbackSizeBytes(); // 02 | ||
|
||
// members | ||
std::uint8_t callbackFlags; // 08 | ||
std::uint8_t pad09; // 09 | ||
std::uint16_t pad0A; // 0A | ||
std::int32_t iCallback; // 0C | ||
}; | ||
static_assert(sizeof(CCallbackBase) == 0x10); | ||
|
||
template <class T, class P> | ||
class CCallResult : public CCallbackBase | ||
{ | ||
public: | ||
using func_t = void (T::*)(P*); | ||
|
||
// override (CCallbackBase) | ||
void Run(void* vParam) override; // 01 | ||
void Run(void* vParam, bool ioFailure, SteamAPICall_t steamAPICall) override; // 00 | ||
int GetCallbackSizeBytes() override; // 02 | ||
|
||
SteamAPICall_t apiCall; // 10 | ||
T* obj; // 18 | ||
func_t func; // 20 | ||
}; | ||
// size == 0x30 | ||
|
||
template <class T, class P, bool bGameserver = false> | ||
class CCallback : public CCallbackBase | ||
{ | ||
public: | ||
using func_t = void (T::*)(P*); | ||
|
||
// override (CCallbackBase) | ||
void Run(void* vParam) override; // 01 | ||
void Run(void* vParam, bool ioFailure, SteamAPICall_t steamAPICall) override; // 00 | ||
int GetCallbackSizeBytes() override; // 02 | ||
|
||
// add | ||
virtual ~CCallback(); // 03 | ||
|
||
// members | ||
T* pObj; // 10 | ||
func_t func; // 18 | ||
}; | ||
// size == 0x28 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters