LunaHook-mirror/LunaHook/embed_util.h

34 lines
1.0 KiB
C
Raw Normal View History

2024-02-07 20:59:24 +08:00
#ifndef __LUNA_EMBED_ENGINE_H
#define __LUNA_EMBED_ENGINE_H
2024-11-03 20:31:46 +08:00
extern CommonSharedMem *commonsharedmem;
2024-07-21 21:04:12 +08:00
extern DynamicShiftJISCodec *dynamiccodec;
2024-02-07 20:59:24 +08:00
2024-07-21 21:04:12 +08:00
namespace WinKey
{
2024-02-07 20:59:24 +08:00
inline bool isKeyPressed(int vk) { return ::GetKeyState(vk) & 0xf0; }
inline bool isKeyToggled(int vk) { return ::GetKeyState(vk) & 0x0f; }
inline bool isKeyReturnPressed() { return isKeyPressed(VK_RETURN); }
inline bool isKeyControlPressed() { return isKeyPressed(VK_CONTROL); }
inline bool isKeyShiftPressed() { return isKeyPressed(VK_SHIFT); }
inline bool isKeyAltPressed() { return isKeyPressed(VK_MENU); }
}
2024-07-21 21:04:12 +08:00
namespace Engine
{
enum TextRole
{
UnknownRole = 0,
ScenarioRole,
NameRole,
OtherRole,
ChoiceRole = OtherRole,
HistoryRole = OtherRole,
RoleCount
};
}
inline std::atomic<void (*)()> patch_fun = nullptr;
2024-10-22 00:44:15 +08:00
bool ReplaceFunction(PVOID oldf, PVOID newf, PVOID *pOrigin = nullptr);
2024-07-21 21:04:12 +08:00
bool check_embed_able(const ThreadParam &tp);
bool checktranslatedok(void *data, size_t len);
2024-02-07 20:59:24 +08:00
#endif