commit
f431853cbf
@ -50,9 +50,13 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\user\cheat\teleport\CustomTeleports.h" />
|
||||
<ClInclude Include="src\user\cheat\visuals\Browser.h" />
|
||||
<ClInclude Include="src\user\cheat\visuals\CameraZoom.h" />
|
||||
<ClInclude Include="src\user\cheat\visuals\FPSUnlock.h" />
|
||||
<ClInclude Include="src\user\cheat\visuals\HideUI.h" />
|
||||
<ClInclude Include="src\user\cheat\visuals\NoFog.h" />
|
||||
<ClInclude Include="src\user\cheat\visuals\PaimonFollow.h" />
|
||||
<ClInclude Include="src\user\cheat\visuals\ProfileChanger.h" />
|
||||
<ClInclude Include="src\user\cheat\visuals\ShowChestIndicator.h" />
|
||||
<ClInclude Include="src\user\cheat\world\AutoCook.h" />
|
||||
<ClInclude Include="src\user\cheat\world\AutoFish.h" />
|
||||
@ -160,9 +164,13 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\user\cheat\teleport\CustomTeleports.cpp" />
|
||||
<ClCompile Include="src\user\cheat\GenshinCM.cpp" />
|
||||
<ClCompile Include="src\user\cheat\visuals\Browser.cpp" />
|
||||
<ClCompile Include="src\user\cheat\visuals\CameraZoom.cpp" />
|
||||
<ClCompile Include="src\user\cheat\visuals\FPSUnlock.cpp" />
|
||||
<ClCompile Include="src\user\cheat\visuals\HideUI.cpp" />
|
||||
<ClCompile Include="src\user\cheat\visuals\NoFog.cpp" />
|
||||
<ClCompile Include="src\user\cheat\visuals\PaimonFollow.cpp" />
|
||||
<ClCompile Include="src\user\cheat\visuals\ProfileChanger.cpp" />
|
||||
<ClCompile Include="src\user\cheat\visuals\ShowChestIndicator.cpp" />
|
||||
<ClCompile Include="src\user\cheat\world\AutoCook.cpp" />
|
||||
<ClCompile Include="src\user\cheat\world\AutoFish.cpp" />
|
||||
|
@ -225,6 +225,18 @@
|
||||
<ClInclude Include="src\user\cheat\world\AutoCook.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\user\cheat\visuals\ProfileChanger.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\user\cheat\visuals\PaimonFollow.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\user\cheat\visuals\HideUI.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\user\cheat\visuals\Browser.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Font Include="res\Ruda-Bold.ttf" />
|
||||
@ -408,6 +420,18 @@
|
||||
<ClCompile Include="src\user\cheat\debugger.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\user\cheat\visuals\ProfileChanger.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\user\cheat\visuals\PaimonFollow.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\user\cheat\visuals\HideUI.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\user\cheat\visuals\Browser.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="res\res.rc">
|
||||
|
@ -14,32 +14,32 @@
|
||||
|
||||
uintptr_t il2cpp_get_mono_base_address()
|
||||
{
|
||||
static HMODULE hMono = GetModuleHandle("mono.dll");
|
||||
static HMODULE hMono = GetModuleHandle("mono.dll");
|
||||
|
||||
if (hMono != NULL)
|
||||
return (uintptr_t)hMono;
|
||||
if (hMono != NULL)
|
||||
return (uintptr_t)hMono;
|
||||
|
||||
HMODULE hModules[1024] = {};
|
||||
HMODULE hModules[1024] = {};
|
||||
|
||||
DWORD cbNeeded = 0;
|
||||
BOOL result = EnumProcessModules(GetCurrentProcess(), hModules, sizeof(hModules), &cbNeeded);
|
||||
if (result == FALSE)
|
||||
return NULL;
|
||||
DWORD cbNeeded = 0;
|
||||
BOOL result = EnumProcessModules(GetCurrentProcess(), hModules, sizeof(hModules), &cbNeeded);
|
||||
if (result == FALSE)
|
||||
return NULL;
|
||||
|
||||
for (int i = 0; i < (cbNeeded / sizeof(HMODULE)); i++)
|
||||
{
|
||||
if (hModules[i] == NULL)
|
||||
continue;
|
||||
for (int i = 0; i < (cbNeeded / sizeof(HMODULE)); i++)
|
||||
{
|
||||
if (hModules[i] == NULL)
|
||||
continue;
|
||||
|
||||
if (GetProcAddress(hModules[i], "il2cpp_thread_attach") != NULL)
|
||||
return (uintptr_t)hModules[i];
|
||||
}
|
||||
if (GetProcAddress(hModules[i], "il2cpp_thread_attach") != NULL)
|
||||
return (uintptr_t)hModules[i];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uintptr_t il2cppi_get_base_address() {
|
||||
return (uintptr_t) GetModuleHandleW(L"UserAssembly.dll");
|
||||
return (uintptr_t)GetModuleHandleW(L"UserAssembly.dll");
|
||||
}
|
||||
|
||||
uintptr_t il2cppi_get_unity_address() {
|
||||
@ -49,13 +49,13 @@ uintptr_t il2cppi_get_unity_address() {
|
||||
// Helper function to open a new console window and redirect stdout there
|
||||
void il2cppi_new_console() {
|
||||
AllocConsole();
|
||||
freopen_s((FILE**) stdout, "CONOUT$", "w", stdout);
|
||||
freopen_s((FILE**) stderr, "CONOUT$", "w", stderr);
|
||||
freopen_s((FILE**)stdout, "CONOUT$", "w", stdout);
|
||||
freopen_s((FILE**)stderr, "CONOUT$", "w", stderr);
|
||||
}
|
||||
|
||||
void il2cppi_close_console() {
|
||||
fclose(stdout);
|
||||
fclose(stderr);
|
||||
fclose(stderr);
|
||||
FreeConsole();
|
||||
}
|
||||
|
||||
@ -85,6 +85,11 @@ std::string il2cppi_to_string(app::String* str) {
|
||||
return il2cppi_to_string(reinterpret_cast<Il2CppString*>(str));
|
||||
}
|
||||
|
||||
app::String* string_to_il2cppi(std::string input) {
|
||||
return app::Marshal_PtrToStringAnsi((void*)input.c_str(), nullptr);
|
||||
}
|
||||
|
||||
|
||||
std::string to_hex_string(app::Byte__Array* barray, int length) {
|
||||
if (barray == nullptr)
|
||||
return std::string();
|
||||
|
@ -46,7 +46,7 @@ struct UniLinkListNode
|
||||
};
|
||||
|
||||
template<class ElementT>
|
||||
struct UniLinkList
|
||||
struct UniLinkList
|
||||
{
|
||||
void* klass;
|
||||
MonitorData* monitor;
|
||||
@ -127,15 +127,15 @@ struct __declspec(align(8)) UniDict {
|
||||
MonitorData* monitor;
|
||||
void* buckets;
|
||||
UniArray<UniDictEntry<KeyT, ValT>>* entries;
|
||||
int32_t count;
|
||||
int32_t version;
|
||||
int32_t freeList;
|
||||
int32_t freeCount;
|
||||
void* comparer;
|
||||
int32_t count;
|
||||
int32_t version;
|
||||
int32_t freeList;
|
||||
int32_t freeCount;
|
||||
void* comparer;
|
||||
void* keys;
|
||||
void* values;
|
||||
|
||||
std::vector<std::pair<KeyT, ValT>> pairs()
|
||||
std::vector<std::pair<KeyT, ValT>> pairs()
|
||||
{
|
||||
auto pairs = std::vector<std::pair<KeyT, ValT>>();
|
||||
|
||||
@ -153,8 +153,8 @@ struct __declspec(align(8)) UniDict {
|
||||
break;
|
||||
|
||||
if (entry.hashCode > 0)
|
||||
pairs.push_back({ entry.key, entry.value });
|
||||
|
||||
pairs.push_back({ entry.key, entry.value });
|
||||
|
||||
index++;
|
||||
}
|
||||
|
||||
@ -165,11 +165,11 @@ struct __declspec(align(8)) UniDict {
|
||||
template<class T>
|
||||
T* CastTo(void* pObject, void* pClass)
|
||||
{
|
||||
auto object = reinterpret_cast<app::Object*>(pObject);
|
||||
if (object == nullptr || object->klass == nullptr || object->klass != pClass)
|
||||
return nullptr;
|
||||
auto object = reinterpret_cast<app::Object*>(pObject);
|
||||
if (object == nullptr || object->klass == nullptr || object->klass != pClass)
|
||||
return nullptr;
|
||||
|
||||
return reinterpret_cast<T*>(object);
|
||||
return reinterpret_cast<T*>(object);
|
||||
}
|
||||
|
||||
inline app::Vector3 operator + (const app::Vector3& A, const app::Vector3& B)
|
||||
@ -204,12 +204,12 @@ inline app::Vector3 operator / (const app::Vector3& A, const float k)
|
||||
|
||||
inline app::Vector3 operator - (const app::Vector3& A)
|
||||
{
|
||||
return { -A.x, -A.y, -A.z};
|
||||
return { -A.x, -A.y, -A.z };
|
||||
}
|
||||
|
||||
inline app::Vector2 operator + (const app::Vector2& A, const float k)
|
||||
{
|
||||
return { A.x + k, A.y + k};
|
||||
return { A.x + k, A.y + k };
|
||||
}
|
||||
|
||||
inline app::Vector2 operator - (const app::Vector2& A, const app::Vector2& B)
|
||||
@ -219,46 +219,46 @@ inline app::Vector2 operator - (const app::Vector2& A, const app::Vector2& B)
|
||||
|
||||
inline app::Vector2 operator - (const app::Vector2& A, const float k)
|
||||
{
|
||||
return { A.x - k, A.y - k};
|
||||
return { A.x - k, A.y - k };
|
||||
}
|
||||
|
||||
inline app::Vector2 operator + (const app::Vector2& A, const app::Vector2& B)
|
||||
{
|
||||
return { A.x + B.x, A.y + B.y };
|
||||
return { A.x + B.x, A.y + B.y };
|
||||
}
|
||||
|
||||
inline app::Vector2 operator * (const app::Vector2& A, const float k)
|
||||
{
|
||||
return { A.x * k, A.y * k };
|
||||
return { A.x * k, A.y * k };
|
||||
}
|
||||
|
||||
inline app::Vector2 operator * (const app::Vector2& A, const app::Vector2& B)
|
||||
{
|
||||
return { A.x * B.x, A.y * B.y };
|
||||
return { A.x * B.x, A.y * B.y };
|
||||
}
|
||||
|
||||
inline app::Vector2 operator / (const app::Vector2& A, const float k)
|
||||
{
|
||||
return { A.x / k, A.y / k };
|
||||
return { A.x / k, A.y / k };
|
||||
}
|
||||
|
||||
inline app::Vector2 operator - (const app::Vector2& A)
|
||||
{
|
||||
return { -A.x, -A.y };
|
||||
return { -A.x, -A.y };
|
||||
}
|
||||
|
||||
inline float GetVectorMagnitude(const app::Vector3& A)
|
||||
inline float GetVectorMagnitude(const app::Vector3& A)
|
||||
{
|
||||
return sqrtf(A.x * A.x + A.y * A.y + A.z * A.z);
|
||||
}
|
||||
|
||||
inline app::Vector3 GetVectorDirection(const app::Vector3& from, const app::Vector3& to)
|
||||
inline app::Vector3 GetVectorDirection(const app::Vector3& from, const app::Vector3& to)
|
||||
{
|
||||
auto dirRaw = to - from;
|
||||
return dirRaw / GetVectorMagnitude(dirRaw);
|
||||
}
|
||||
|
||||
inline bool IsVectorZero(const app::Vector3& vector)
|
||||
inline bool IsVectorZero(const app::Vector3& vector)
|
||||
{
|
||||
return vector.x == 0 && vector.y == 0 && vector.z == 0;
|
||||
}
|
||||
@ -282,7 +282,7 @@ std::string il2cppi_to_string(app::String* str);
|
||||
std::string il2cppi_to_string(app::Vector vec);
|
||||
std::string il2cppi_to_string(app::Vector2 vec);
|
||||
std::string il2cppi_to_string(app::Vector3 vec);
|
||||
|
||||
app::String* string_to_il2cppi(std::string input);
|
||||
std::string to_hex_string(app::Byte__Array* barray, int length);
|
||||
#endif
|
||||
|
||||
@ -292,6 +292,6 @@ template<typename T> bool il2cppi_is_initialized(T* metadataItem) {
|
||||
return *metadataItem != 0;
|
||||
#else
|
||||
// Metadata >=27 (Unity 2020.2)
|
||||
return !((uintptr_t) *metadataItem & 1);
|
||||
return !((uintptr_t)*metadataItem & 1);
|
||||
#endif
|
||||
}
|
||||
|
@ -42,6 +42,10 @@
|
||||
#include <cheat/visuals/FPSUnlock.h>
|
||||
#include <cheat/visuals/CameraZoom.h>
|
||||
#include <cheat/visuals/ShowChestIndicator.h>
|
||||
#include <cheat/visuals/ProfileChanger.h>
|
||||
#include <cheat/visuals/PaimonFollow.h>
|
||||
#include <cheat/visuals/HideUI.h>
|
||||
#include <cheat/visuals/Browser.h>
|
||||
|
||||
#include "GenshinCM.h"
|
||||
|
||||
@ -95,8 +99,12 @@ namespace cheat
|
||||
FEAT_INST(NoFog),
|
||||
FEAT_INST(FPSUnlock),
|
||||
FEAT_INST(CameraZoom),
|
||||
FEAT_INST(ChestIndicator)
|
||||
|
||||
FEAT_INST(ChestIndicator),
|
||||
FEAT_INST(ProfileChanger),
|
||||
FEAT_INST(PaimonFollow),
|
||||
FEAT_INST(HideUI),
|
||||
FEAT_INST(Browser)
|
||||
|
||||
});
|
||||
#undef FEAT_INST
|
||||
|
||||
|
99
cheat-library/src/user/cheat/visuals/Browser.cpp
Normal file
99
cheat-library/src/user/cheat/visuals/Browser.cpp
Normal file
@ -0,0 +1,99 @@
|
||||
#include "pch-il2cpp.h"
|
||||
#include "Browser.h"
|
||||
|
||||
#include <helpers.h>
|
||||
#include <cheat/events.h>
|
||||
#include <misc/cpp/imgui_stdlib.h>
|
||||
|
||||
#include <cheat/esp/ESPRender.h>
|
||||
|
||||
namespace cheat::feature
|
||||
{
|
||||
app::GameObject* planeObject = nullptr;
|
||||
app::Component_1* BrowserComponents = nullptr;
|
||||
static std::string f_URL;
|
||||
|
||||
Browser::Browser() : Feature(),
|
||||
NF(f_Enabled, "Browser", "Visuals", false),
|
||||
toBeUpdate(), nextUpdate(0)
|
||||
{
|
||||
events::GameUpdateEvent += MY_METHOD_HANDLER(Browser::OnGameUpdate);
|
||||
}
|
||||
|
||||
const FeatureGUIInfo& Browser::GetGUIInfo() const
|
||||
{
|
||||
static const FeatureGUIInfo info{ "Browser", "Visuals", false };
|
||||
return info;
|
||||
}
|
||||
|
||||
void Browser::DrawMain()
|
||||
{
|
||||
ConfigWidget(f_Enabled, "Create in-game Browser");
|
||||
ImGui::InputText("URL", &f_URL);
|
||||
}
|
||||
|
||||
bool Browser::NeedStatusDraw() const
|
||||
{
|
||||
return f_Enabled;
|
||||
}
|
||||
|
||||
void Browser::DrawStatus()
|
||||
{
|
||||
ImGui::Text("Browser");
|
||||
}
|
||||
|
||||
Browser& Browser::GetInstance()
|
||||
{
|
||||
static Browser instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
void Browser::OnGameUpdate()
|
||||
{
|
||||
auto currentTime = util::GetCurrentTimeMillisec();
|
||||
if (currentTime < nextUpdate)
|
||||
return;
|
||||
|
||||
if (f_Enabled) {
|
||||
if (planeObject == nullptr) {
|
||||
|
||||
auto PrimitiveType = app::PrimitiveType__Enum::Plane;
|
||||
planeObject = app::GameObject_CreatePrimitive(PrimitiveType, nullptr);
|
||||
|
||||
app::Transform* planeObject_Transform = app::GameObject_get_transform(planeObject, nullptr);
|
||||
app::Quaternion planeObject_Transform_Quaternion = { 0.5, 0.5, -0.5, 0.5};
|
||||
auto avatarPos = app::ActorUtils_GetAvatarPos(nullptr);
|
||||
auto relativePos = app::WorldShiftManager_GetRelativePosition(avatarPos, nullptr);
|
||||
app::Vector3 planeObject_Transform_Vector3 = { relativePos.x, relativePos.y + 3, relativePos.z };
|
||||
app::Vector3 planeObject_Transform_Scale = { 1, 1, 1};
|
||||
|
||||
app::Transform_set_localPosition(planeObject_Transform, planeObject_Transform_Vector3, nullptr);
|
||||
app::Transform_set_localScale(planeObject_Transform, planeObject_Transform_Scale, nullptr);
|
||||
app::Transform_set_localRotation(planeObject_Transform, planeObject_Transform_Quaternion, nullptr);
|
||||
}
|
||||
|
||||
if (planeObject != nullptr) {
|
||||
if (BrowserComponents == nullptr) {
|
||||
std::string custom_url = f_URL.length() < 2 || f_URL.c_str() == "" ? "https://www.google.com/" : f_URL.c_str();
|
||||
|
||||
BrowserComponents = app::GameObject_AddComponentInternal(planeObject, string_to_il2cppi("Browser"), nullptr);
|
||||
reinterpret_cast<app::Browser*>(BrowserComponents)->fields._url = string_to_il2cppi(custom_url);
|
||||
reinterpret_cast<app::Browser*>(BrowserComponents)->fields._width = 1920;
|
||||
reinterpret_cast<app::Browser*>(BrowserComponents)->fields._height = 1080;
|
||||
reinterpret_cast<app::Browser*>(BrowserComponents)->fields.forceNextRender = true;
|
||||
reinterpret_cast<app::Browser*>(BrowserComponents)->fields._EnableInput_k__BackingField = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (planeObject != nullptr && BrowserComponents != nullptr)
|
||||
{
|
||||
app::Object_1_DestroyImmediate_1(reinterpret_cast<app::Object_1*>(planeObject), nullptr);
|
||||
app::Object_1_DestroyImmediate_1(reinterpret_cast<app::Object_1*>(BrowserComponents), nullptr);
|
||||
planeObject = nullptr;
|
||||
BrowserComponents = nullptr;
|
||||
}
|
||||
}
|
||||
nextUpdate = currentTime + (int)f_DelayUpdate;
|
||||
}
|
||||
}
|
26
cheat-library/src/user/cheat/visuals/Browser.h
Normal file
26
cheat-library/src/user/cheat/visuals/Browser.h
Normal file
@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
#include <cheat-base/cheat/Feature.h>
|
||||
#include <cheat-base/config/config.h>
|
||||
#include <cheat-base/thread-safe.h>
|
||||
|
||||
namespace cheat::feature
|
||||
{
|
||||
class Browser : public Feature
|
||||
{
|
||||
public:
|
||||
config::Field<config::Toggle<Hotkey>> f_Enabled;
|
||||
|
||||
static Browser& GetInstance();
|
||||
const FeatureGUIInfo& GetGUIInfo() const override;
|
||||
void DrawMain() override;
|
||||
virtual bool NeedStatusDraw() const override;
|
||||
void DrawStatus() override;
|
||||
|
||||
private:
|
||||
SafeQueue<uint32_t> toBeUpdate;
|
||||
SafeValue<int64_t> nextUpdate;
|
||||
int f_DelayUpdate = 20.f;
|
||||
void OnGameUpdate();
|
||||
Browser();
|
||||
};
|
||||
}
|
61
cheat-library/src/user/cheat/visuals/HideUI.cpp
Normal file
61
cheat-library/src/user/cheat/visuals/HideUI.cpp
Normal file
@ -0,0 +1,61 @@
|
||||
#include "pch-il2cpp.h"
|
||||
#include "HideUI.h"
|
||||
|
||||
#include <helpers.h>
|
||||
#include <cheat/events.h>
|
||||
|
||||
namespace cheat::feature
|
||||
{
|
||||
app::GameObject* ui_camera{};
|
||||
|
||||
HideUI::HideUI() : Feature(),
|
||||
NF(f_Enabled, "Hide UI", "Hide UI", false)
|
||||
{
|
||||
events::GameUpdateEvent += MY_METHOD_HANDLER(HideUI::OnGameUpdate);
|
||||
}
|
||||
|
||||
const FeatureGUIInfo& HideUI::GetGUIInfo() const
|
||||
{
|
||||
static const FeatureGUIInfo info{ "HideUI", "Visuals", false };
|
||||
return info;
|
||||
}
|
||||
|
||||
void HideUI::DrawMain()
|
||||
{
|
||||
ConfigWidget(f_Enabled, "Hide in-game UI.");
|
||||
}
|
||||
|
||||
bool HideUI::NeedStatusDraw() const
|
||||
{
|
||||
return f_Enabled;
|
||||
}
|
||||
|
||||
void HideUI::DrawStatus()
|
||||
{
|
||||
ImGui::Text("HideUI");
|
||||
}
|
||||
|
||||
HideUI& HideUI::GetInstance()
|
||||
{
|
||||
static HideUI instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
void HideUI::OnGameUpdate()
|
||||
{
|
||||
if (f_Enabled)
|
||||
{
|
||||
if (ui_camera == nullptr)
|
||||
ui_camera = app::GameObject_Find(string_to_il2cppi("/UICamera"), nullptr);
|
||||
|
||||
|
||||
if (ui_camera)
|
||||
app::GameObject_SetActive(ui_camera, false, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ui_camera)
|
||||
app::GameObject_SetActive(ui_camera, true, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
26
cheat-library/src/user/cheat/visuals/HideUI.h
Normal file
26
cheat-library/src/user/cheat/visuals/HideUI.h
Normal file
@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
#include <cheat-base/cheat/Feature.h>
|
||||
#include <cheat-base/config/config.h>
|
||||
|
||||
namespace cheat::feature
|
||||
{
|
||||
|
||||
class HideUI : public Feature
|
||||
{
|
||||
public:
|
||||
config::Field<bool> f_Enabled;
|
||||
|
||||
static HideUI& GetInstance();
|
||||
|
||||
const FeatureGUIInfo& GetGUIInfo() const override;
|
||||
void DrawMain() override;
|
||||
|
||||
virtual bool NeedStatusDraw() const override;
|
||||
void DrawStatus() override;
|
||||
void OnGameUpdate();
|
||||
|
||||
private:
|
||||
HideUI();
|
||||
};
|
||||
}
|
||||
|
78
cheat-library/src/user/cheat/visuals/PaimonFollow.cpp
Normal file
78
cheat-library/src/user/cheat/visuals/PaimonFollow.cpp
Normal file
@ -0,0 +1,78 @@
|
||||
#include "pch-il2cpp.h"
|
||||
#include "PaimonFollow.h"
|
||||
#include <helpers.h>
|
||||
#include <cheat/events.h>
|
||||
|
||||
|
||||
namespace cheat::feature
|
||||
{
|
||||
namespace GameObject {
|
||||
app::GameObject* Paimon = nullptr;
|
||||
app::GameObject* ProfileLayer = nullptr;
|
||||
}
|
||||
|
||||
PaimonFollow::PaimonFollow() : Feature(),
|
||||
NF(f_Enabled, "Paimon Follow", "Visuals", false),
|
||||
toBeUpdate(), nextUpdate(0)
|
||||
{
|
||||
events::GameUpdateEvent += MY_METHOD_HANDLER(PaimonFollow::OnGameUpdate);
|
||||
}
|
||||
|
||||
const FeatureGUIInfo& PaimonFollow::GetGUIInfo() const
|
||||
{
|
||||
static const FeatureGUIInfo info{ "PaimonFollow", "Visuals", true };
|
||||
return info;
|
||||
}
|
||||
|
||||
void PaimonFollow::DrawMain()
|
||||
{
|
||||
ConfigWidget(f_Enabled, "To display paimon, turn on the function, open the profile (esc) and close it. \n" \
|
||||
"If the paimon disappeared after teleportation, do not disable the function, open and close the profile.");
|
||||
}
|
||||
|
||||
bool PaimonFollow::NeedStatusDraw() const
|
||||
{
|
||||
return f_Enabled;
|
||||
}
|
||||
|
||||
void PaimonFollow::DrawStatus()
|
||||
{
|
||||
ImGui::Text("Paimon Follow");
|
||||
}
|
||||
|
||||
PaimonFollow& PaimonFollow::GetInstance()
|
||||
{
|
||||
static PaimonFollow instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
void PaimonFollow::OnGameUpdate()
|
||||
{
|
||||
if (!f_Enabled)
|
||||
return;
|
||||
|
||||
auto currentTime = util::GetCurrentTimeMillisec();
|
||||
if (currentTime < nextUpdate)
|
||||
return;
|
||||
|
||||
if (GameObject::Paimon == nullptr) {
|
||||
GameObject::Paimon = app::GameObject_Find(string_to_il2cppi("/EntityRoot/OtherGadgetRoot/NPC_Guide_Paimon(Clone)"), nullptr);
|
||||
}
|
||||
|
||||
if (GameObject::ProfileLayer == nullptr) {
|
||||
GameObject::ProfileLayer = app::GameObject_Find(string_to_il2cppi("/Canvas/Pages/PlayerProfilePage"), nullptr);
|
||||
}
|
||||
|
||||
if (GameObject::Paimon != nullptr && GameObject::ProfileLayer != nullptr) {
|
||||
auto ProfileOpen = app::GameObject_get_active(GameObject::ProfileLayer, nullptr);
|
||||
|
||||
if (ProfileOpen) {
|
||||
app::GameObject_set_active(GameObject::Paimon, false, nullptr);
|
||||
}
|
||||
else {
|
||||
app::GameObject_set_active(GameObject::Paimon, true, nullptr);
|
||||
}
|
||||
}
|
||||
nextUpdate = currentTime + (int)f_DelayUpdate;
|
||||
}
|
||||
}
|
26
cheat-library/src/user/cheat/visuals/PaimonFollow.h
Normal file
26
cheat-library/src/user/cheat/visuals/PaimonFollow.h
Normal file
@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
#include <cheat-base/cheat/Feature.h>
|
||||
#include <cheat-base/config/config.h>
|
||||
#include <cheat-base/thread-safe.h>
|
||||
|
||||
namespace cheat::feature
|
||||
{
|
||||
class PaimonFollow : public Feature
|
||||
{
|
||||
public:
|
||||
config::Field<config::Toggle<Hotkey>> f_Enabled;
|
||||
static PaimonFollow& GetInstance();
|
||||
const FeatureGUIInfo& GetGUIInfo() const override;
|
||||
void DrawMain() override;
|
||||
|
||||
virtual bool NeedStatusDraw() const override;
|
||||
void DrawStatus() override;
|
||||
private:
|
||||
SafeQueue<uint32_t> toBeUpdate;
|
||||
SafeValue<int64_t> nextUpdate;
|
||||
int f_DelayUpdate = 100.f;
|
||||
|
||||
void OnGameUpdate();
|
||||
PaimonFollow();
|
||||
};
|
||||
}
|
244
cheat-library/src/user/cheat/visuals/ProfileChanger.cpp
Normal file
244
cheat-library/src/user/cheat/visuals/ProfileChanger.cpp
Normal file
@ -0,0 +1,244 @@
|
||||
#include "pch-il2cpp.h"
|
||||
#include "ProfileChanger.h"
|
||||
|
||||
#include <helpers.h>
|
||||
#include <cheat/events.h>
|
||||
#include <misc/cpp/imgui_stdlib.h>
|
||||
#include <fstream>
|
||||
|
||||
|
||||
namespace cheat::feature
|
||||
{
|
||||
namespace GameObject {
|
||||
app::GameObject* WaterMark = nullptr;
|
||||
}
|
||||
|
||||
namespace Components {
|
||||
app::Component_1* WaterMark = nullptr;
|
||||
|
||||
app::Texture2D* CardTexture = nullptr;
|
||||
app::Texture2D* AvatarTexture = nullptr;
|
||||
app::Sprite* CardSprite = nullptr;
|
||||
app::Sprite* AvatarSprite = nullptr;
|
||||
app::Rect RectCard;
|
||||
app::Rect RectAvatar;
|
||||
}
|
||||
|
||||
// Profile Page
|
||||
app::Button_1* ProfilePage(app::MonoInLevelPlayerProfilePage* __this, MethodInfo* method);
|
||||
|
||||
// Edit Player Info Page
|
||||
static void ProfileEditPage(app::MonoFriendInformationDialog* __this, app::Sprite* value, MethodInfo* method);
|
||||
|
||||
ProfileChanger::ProfileChanger() : Feature(),
|
||||
NF(f_Enabled, "Custom Profile", "Visuals", false),
|
||||
NF(f_UID, "UID", "Visuals", false),
|
||||
NF(f_NickName, "NickName", "Visuals", false),
|
||||
NF(f_Level, "Level", "Visuals", false),
|
||||
NF(f_Exp, "Exp", "Visuals", false),
|
||||
NF(f_CurExp, "CurExp", "Visuals", 1),
|
||||
NF(f_MaxExp, "MaxExp", "Visuals", 1),
|
||||
NF(f_ExpBar, "ExpBar", "Visuals", false),
|
||||
NF(f_ExpBarValue, "ExpBarValue", "Visuals", 20.0f),
|
||||
NF(f_WorldLevel, "WorldLevel", "Visuals", false),
|
||||
NF(f_Avatar, "AvatarImage", "Visuals", false),
|
||||
NF(f_Card, "CardImage", "Visuals", false),
|
||||
toBeUpdate(), nextUpdate(0)
|
||||
{
|
||||
HookManager::install(app::ProfilePage, ProfilePage);
|
||||
HookManager::install(app::ProfileEditPage, ProfileEditPage);
|
||||
events::GameUpdateEvent += MY_METHOD_HANDLER(ProfileChanger::OnGameUpdate);
|
||||
}
|
||||
|
||||
const FeatureGUIInfo& ProfileChanger::GetGUIInfo() const
|
||||
{
|
||||
static const FeatureGUIInfo info{ "CustomProfile", "Visuals", true };
|
||||
return info;
|
||||
}
|
||||
|
||||
void ProfileChanger::DrawMain()
|
||||
{
|
||||
ConfigWidget(f_Enabled, "Custom Profile.");
|
||||
ConfigWidget(f_UID, "Changes the uid visually.");
|
||||
ConfigWidget(f_NickName, "Changes the nickname visually.");
|
||||
ConfigWidget(f_Level, "Changes the level visually.");
|
||||
ConfigWidget(f_Exp, "Changes the exp visually.");
|
||||
if (f_Exp) {
|
||||
ConfigWidget("CurExp", f_CurExp, 1, 2, 100000, "Changes the ExpBar visually.");
|
||||
ConfigWidget("MaxExp", f_MaxExp, 1, 2, 100000, "Changes the ExpBar visually.");
|
||||
ConfigWidget(f_ExpBar, "Changes the ExpBar visually.");
|
||||
if (f_ExpBar)
|
||||
ConfigWidget("ExpBarValue", f_ExpBarValue, 1, 2, 100, "Changes the ExpBar visually.");
|
||||
}
|
||||
ConfigWidget(f_WorldLevel, "Changes the world-level visually.");
|
||||
ConfigWidget(f_Avatar, "Changes the Avatar Image visually.\n" \
|
||||
"Note the size of the picture must be: 256x256.\n" \
|
||||
"Example path: C:\\Avatars.png");
|
||||
|
||||
ConfigWidget(f_Card, "Changes the Card visually.\n" \
|
||||
"Note the size of the picture must be: 840x400.\n" \
|
||||
"Example path: C:\\Avatars.png");
|
||||
}
|
||||
|
||||
bool ProfileChanger::NeedStatusDraw() const
|
||||
{
|
||||
return f_Enabled;
|
||||
}
|
||||
|
||||
void ProfileChanger::DrawStatus()
|
||||
{
|
||||
ImGui::Text("Custom Profile");
|
||||
}
|
||||
|
||||
ProfileChanger& ProfileChanger::GetInstance()
|
||||
{
|
||||
static ProfileChanger instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
void ProfileChanger::OnGameUpdate()
|
||||
{
|
||||
if (!f_Enabled || !f_UID)
|
||||
return;
|
||||
|
||||
auto currentTime = util::GetCurrentTimeMillisec();
|
||||
if (currentTime < nextUpdate)
|
||||
return;
|
||||
|
||||
if (f_UID) {
|
||||
if (GameObject::WaterMark == nullptr)
|
||||
GameObject::WaterMark = app::GameObject_Find(string_to_il2cppi("/BetaWatermarkCanvas(Clone)/Panel/TxtUID"), nullptr);
|
||||
|
||||
if (GameObject::WaterMark != nullptr && Components::WaterMark == nullptr)
|
||||
Components::WaterMark = app::GameObject_GetComponentByName(GameObject::WaterMark, string_to_il2cppi("Text"), nullptr);
|
||||
|
||||
if (Components::WaterMark != nullptr)
|
||||
app::Text_set_text(reinterpret_cast<app::Text*>(Components::WaterMark), string_to_il2cppi(f_UID), nullptr);
|
||||
}
|
||||
|
||||
nextUpdate = currentTime + (int)f_DelayUpdate;
|
||||
}
|
||||
|
||||
bool ProfileChanger::CheckFile(const std::string& Filename) {
|
||||
struct stat buffer;
|
||||
return (stat(Filename.c_str(), &buffer) == 0);
|
||||
}
|
||||
|
||||
app::Button_1* ProfilePage(app::MonoInLevelPlayerProfilePage* __this, MethodInfo* method)
|
||||
{
|
||||
auto& profile = ProfileChanger::GetInstance();
|
||||
|
||||
if (profile.f_Enabled) {
|
||||
|
||||
if (profile.f_UID)
|
||||
app::Text_set_text(__this->fields._playerID, string_to_il2cppi(profile.f_UID), nullptr);
|
||||
|
||||
if (profile.f_Level)
|
||||
app::Text_set_text(__this->fields._playerLv, string_to_il2cppi(profile.f_Level), nullptr);
|
||||
|
||||
if (profile.f_Exp) {
|
||||
std::string CurExpStr = std::to_string(profile.f_CurExp);
|
||||
std::string MaxExpStr = std::to_string(profile.f_MaxExp);
|
||||
app::Text_set_text(__this->fields._playerExp, string_to_il2cppi(CurExpStr + "/" + MaxExpStr), nullptr);
|
||||
|
||||
if (profile.f_ExpBar)
|
||||
{
|
||||
app::Slider_1_set_minValue(__this->fields._playerExpSlider, 1, nullptr);
|
||||
app::Slider_1_set_maxValue(__this->fields._playerExpSlider, 100, nullptr);
|
||||
app::Slider_1_set_value(__this->fields._playerExpSlider, profile.f_ExpBarValue, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
if (profile.f_WorldLevel)
|
||||
app::Text_set_text(__this->fields._playerWorldLv, string_to_il2cppi(profile.f_WorldLevel), nullptr);
|
||||
|
||||
if (profile.f_NickName){
|
||||
auto playerModule = GET_SINGLETON(MoleMole_PlayerModule);
|
||||
if (playerModule != nullptr && playerModule->fields._accountData_k__BackingField != nullptr) {
|
||||
auto& accountData = playerModule->fields._accountData_k__BackingField->fields;
|
||||
accountData.nickName = string_to_il2cppi(profile.f_NickName);
|
||||
}
|
||||
}
|
||||
|
||||
// Card Name png size 840x400
|
||||
if (profile.f_Card){
|
||||
if (profile.CheckFile(profile.f_Card)) {
|
||||
Components::CardTexture = app::NativeGallery_LoadImageAtPath(string_to_il2cppi(profile.f_Card), 100, false, false, false, nullptr);
|
||||
// If you don't do this check, then the UI will break after teleportation, I'm just too lazy to set up Rect manually
|
||||
if (Components::RectCard.m_Width == 0)
|
||||
Components::RectCard = app::Sprite_get_rect(__this->fields._nameCardPic->fields.m_Sprite, nullptr);
|
||||
app::Vector2 Vec2 = { 100, 100 };
|
||||
Components::CardSprite = app::Sprite_Create(Components::CardTexture, Components::RectCard, Vec2, 1, nullptr);
|
||||
__this->fields._nameCardPic->fields.m_OverrideSprite = Components::CardSprite;
|
||||
}
|
||||
else {
|
||||
std::cout << "Card Image: \n" << "not found" << std::endl;
|
||||
}
|
||||
}
|
||||
// Avatar png size 256x256
|
||||
if (profile.f_Avatar) {
|
||||
if (profile.CheckFile(profile.f_Avatar)) {
|
||||
Components::AvatarTexture = app::NativeGallery_LoadImageAtPath(string_to_il2cppi(profile.f_Avatar), 100, false, false, false, nullptr);
|
||||
// If you don't do this check, then the UI will break after teleportation, I'm just too lazy to set up Rect manually
|
||||
if (Components::RectAvatar.m_Width == 0)
|
||||
Components::RectAvatar = app::Sprite_get_rect(__this->fields.playerIconImage->fields.m_Sprite, nullptr);
|
||||
app::Vector2 Vec2Avatar = { 128, 128 };
|
||||
Components::AvatarSprite = app::Sprite_Create(Components::AvatarTexture, Components::RectAvatar, Vec2Avatar, 1, nullptr);
|
||||
__this->fields.playerIconImage->fields.m_OverrideSprite = Components::AvatarSprite;
|
||||
}
|
||||
else {
|
||||
std::cout << "Avatar Image: \n" << "not found" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
return CALL_ORIGIN(ProfilePage, __this, method);
|
||||
}
|
||||
|
||||
static void ProfileEditPage(app::MonoFriendInformationDialog* __this, app::Sprite* value, MethodInfo* method) {
|
||||
auto& profile = ProfileChanger::GetInstance();
|
||||
if (profile.f_Enabled) {
|
||||
if (profile.f_UID)
|
||||
__this->fields._playerUID->fields.m_Text = string_to_il2cppi(profile.f_UID);
|
||||
|
||||
if (profile.f_Level)
|
||||
__this->fields._playerLevel->fields.m_Text = string_to_il2cppi(profile.f_Level);
|
||||
|
||||
if (profile.f_WorldLevel)
|
||||
__this->fields._worldLevel->fields.m_Text = string_to_il2cppi(profile.f_WorldLevel);
|
||||
|
||||
// Card Name png size 840x400
|
||||
|
||||
if (profile.f_Card) {
|
||||
if (profile.CheckFile(profile.f_Card)) {
|
||||
Components::CardTexture = app::NativeGallery_LoadImageAtPath(string_to_il2cppi(profile.f_Card), 100, false, false, false, nullptr);
|
||||
// If you don't do this check, then the UI will break after teleportation, I'm just too lazy to set up Rect manually
|
||||
if (Components::RectCard.m_Width == 0)
|
||||
Components::RectCard = app::Sprite_get_rect(__this->fields._cardImg->fields.m_Sprite, nullptr);
|
||||
app::Vector2 Vec2 = { 100, 100 };
|
||||
Components::CardSprite = app::Sprite_Create(Components::CardTexture, Components::RectCard, Vec2, 1, nullptr);
|
||||
__this->fields._cardImg->fields.m_OverrideSprite = Components::CardSprite;
|
||||
}
|
||||
else {
|
||||
std::cout << "Card Image: \n" << "not found" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Avatar png size 256x256
|
||||
if (profile.f_Avatar) {
|
||||
if (profile.CheckFile(profile.f_Avatar)) {
|
||||
Components::AvatarTexture = app::NativeGallery_LoadImageAtPath(string_to_il2cppi(profile.f_Avatar), 100, false, false, false, nullptr);
|
||||
if (Components::RectAvatar.m_Width == 0)
|
||||
Components::RectAvatar = app::Sprite_get_rect(__this->fields._icon->fields.m_Sprite, nullptr);
|
||||
app::Vector2 Vec2Avatar = { 128, 128 };
|
||||
Components::AvatarSprite = app::Sprite_Create(Components::AvatarTexture, Components::RectAvatar, Vec2Avatar, 1, nullptr);
|
||||
__this->fields._icon->fields.m_OverrideSprite = Components::AvatarSprite;
|
||||
}
|
||||
else {
|
||||
std::cout << "Card Image: \n" << "not found" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return CALL_ORIGIN(ProfileEditPage, __this, value, method);
|
||||
}
|
||||
}
|
44
cheat-library/src/user/cheat/visuals/ProfileChanger.h
Normal file
44
cheat-library/src/user/cheat/visuals/ProfileChanger.h
Normal file
@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
#include <cheat-base/cheat/Feature.h>
|
||||
#include <cheat-base/config/config.h>
|
||||
#include <cheat-base/thread-safe.h>
|
||||
|
||||
namespace cheat::feature
|
||||
{
|
||||
class ProfileChanger : public Feature
|
||||
{
|
||||
public:
|
||||
config::Field<config::Toggle<Hotkey>> f_Enabled;
|
||||
config::Field<config::Toggle<std::string>> f_UID;
|
||||
config::Field<config::Toggle<std::string>> f_NickName;
|
||||
config::Field<config::Toggle<std::string>> f_Level;
|
||||
config::Field<config::Toggle<Hotkey>> f_Exp;
|
||||
config::Field<int> f_CurExp;
|
||||
config::Field<int> f_MaxExp;
|
||||
config::Field<config::Toggle<Hotkey>> f_ExpBar;
|
||||
config::Field<float> f_ExpBarValue;
|
||||
config::Field<config::Toggle<std::string>> f_WorldLevel;
|
||||
|
||||
config::Field<config::Toggle<std::string>> f_Avatar; // Avatar png size 256x256
|
||||
config::Field<config::Toggle<std::string>> f_Card; // Card Name png size 840x400
|
||||
|
||||
static ProfileChanger& GetInstance();
|
||||
|
||||
const FeatureGUIInfo& GetGUIInfo() const override;
|
||||
void DrawMain() override;
|
||||
|
||||
virtual bool NeedStatusDraw() const override;
|
||||
void DrawStatus() override;
|
||||
|
||||
bool CheckFile(const std::string& name);
|
||||
|
||||
private:
|
||||
SafeQueue<uint32_t> toBeUpdate;
|
||||
SafeValue<int64_t> nextUpdate;
|
||||
int f_DelayUpdate = 100.f;
|
||||
|
||||
void OnGameUpdate();
|
||||
ProfileChanger();
|
||||
|
||||
};
|
||||
}
|
@ -6,22 +6,27 @@
|
||||
|
||||
namespace cheat::feature
|
||||
{
|
||||
namespace GameObject {
|
||||
app::GameObject* Profirency = nullptr;
|
||||
}
|
||||
|
||||
namespace Components {
|
||||
app::Component_1* Profirency = nullptr;
|
||||
}
|
||||
|
||||
static void PlayerModule_RequestPlayerCook(app::MoleMole_PlayerModule* __this, uint32_t recipeId, uint32_t avatarId, uint32_t qteQuality, uint32_t count, MethodInfo* method);
|
||||
static void PlayerModule_OnPlayerCookRsp(app::MoleMole_PlayerModule* __this, app::PlayerCookRsp* rsp, MethodInfo* method);
|
||||
|
||||
static void CookingQtePageContext_UpdateProficiency(app::CookingQtePageContext* __this, MethodInfo* method);
|
||||
static void CookingQtePageContext_SetProficiencyInfo(app::CookingQtePageContext* __this, MethodInfo* method);
|
||||
static uint32_t CookRecipeExcelConfig_get_maxProficiency(app::CookRecipeExcelConfig* __this, MethodInfo* method);
|
||||
|
||||
AutoCook::AutoCook() : Feature(),
|
||||
NF(f_Enabled, "Auto Cooking", "AutoCook", false),
|
||||
NF(f_Count, "Count Item", "AutoCook", 1),
|
||||
NF(f_Quality, "Quality", "AutoCook", 1)
|
||||
NF(f_Enabled, "Standart Cooking", "AutoCook", false),
|
||||
NF(f_FastProficiency, "Fast Proficiency", "AutoCook", false),
|
||||
NF(f_CountField, "Count Item", "AutoCook", 1),
|
||||
NF(f_QualityField, "Quality", "AutoCook", 1)
|
||||
{
|
||||
HookManager::install(app::MoleMole_PlayerModule_RequestPlayerCook, PlayerModule_RequestPlayerCook);
|
||||
HookManager::install(app::MoleMole_PlayerModule_OnPlayerCookRsp, PlayerModule_OnPlayerCookRsp);
|
||||
HookManager::install(app::MoleMole_PlayerModule_OnPlayerCookRsp, PlayerModule_OnPlayerCookRsp);
|
||||
HookManager::install(app::MoleMole_CookingQtePageContext_UpdateProficiency, CookingQtePageContext_UpdateProficiency);
|
||||
HookManager::install(app::CookRecipeExcelConfig_get_maxProficiency, CookRecipeExcelConfig_get_maxProficiency);
|
||||
}
|
||||
|
||||
const FeatureGUIInfo& AutoCook::GetGUIInfo() const
|
||||
@ -32,11 +37,13 @@ namespace cheat::feature
|
||||
|
||||
void AutoCook::DrawMain()
|
||||
{
|
||||
ConfigWidget(f_Enabled, "Automatic cooking.");
|
||||
ConfigWidget("Count Item", f_Count, 1, 1, 100,
|
||||
ConfigWidget(f_Enabled, "Fast Cooking if the recipe has fast cooking open. \n" \
|
||||
"If fast cooking is closed, you in addition need to turn on Fast Proficiency.");
|
||||
ConfigWidget(f_FastProficiency, "Quickly prepare an unstudied recipe to the maximum possible.");
|
||||
ConfigWidget("Count Item", f_CountField, 1, 1, 100,
|
||||
"How much to cook at a time.\n" \
|
||||
"(If the recipe is not fully explored, set it to 1.)");
|
||||
ConfigWidget("Quality Cooking", f_Quality, 1, 1, 3, "Quality of the cook.");
|
||||
"(For standard mode only.)");
|
||||
ConfigWidget("Quality Cooking", f_QualityField, 1, 1, 3, "Quality of the cook.");
|
||||
}
|
||||
|
||||
bool AutoCook::NeedStatusDraw() const
|
||||
@ -46,7 +53,7 @@ namespace cheat::feature
|
||||
|
||||
void AutoCook::DrawStatus()
|
||||
{
|
||||
ImGui::Text("Auto Cook");
|
||||
ImGui::Text("Auto Cooking [%s]", f_FastProficiency ? "Proficiency" : "Standart");
|
||||
}
|
||||
|
||||
AutoCook& AutoCook::GetInstance()
|
||||
@ -57,51 +64,88 @@ namespace cheat::feature
|
||||
|
||||
// Auto Cooking | RyujinZX#6666
|
||||
|
||||
std::vector<std::string> split(std::string& s, char delimeter)
|
||||
{
|
||||
std::stringstream ss(s);
|
||||
std::string item;
|
||||
std::vector<std::string> tokens;
|
||||
while (std::getline(ss, item, delimeter))
|
||||
{
|
||||
tokens.push_back(item);
|
||||
}
|
||||
return tokens;
|
||||
}
|
||||
|
||||
static void PlayerModule_RequestPlayerCook(app::MoleMole_PlayerModule* __this, uint32_t recipeId, uint32_t avatarId, uint32_t qteQuality, uint32_t count, MethodInfo* method)
|
||||
{
|
||||
AutoCook& autoCook = AutoCook::GetInstance();
|
||||
if (autoCook.f_Enabled)
|
||||
if (autoCook.f_Enabled || autoCook.f_FastProficiency)
|
||||
{
|
||||
qteQuality = autoCook.f_Quality;
|
||||
count = autoCook.f_Count;
|
||||
}
|
||||
autoCook.CookFoodMaxNum = app::MoleMole_Config_CookRecipeExcelConfig_CheckCookFoodMaxNum(recipeId, nullptr);
|
||||
qteQuality = autoCook.f_QualityField;
|
||||
|
||||
return CALL_ORIGIN(PlayerModule_RequestPlayerCook, __this, recipeId, avatarId, qteQuality, count, method);
|
||||
if (!autoCook.f_FastProficiency && autoCook.f_Enabled){
|
||||
count = autoCook.f_CountField;
|
||||
if (autoCook.f_CountField > autoCook.CookFoodMaxNum)
|
||||
count = autoCook.CookFoodMaxNum;
|
||||
|
||||
return CALL_ORIGIN(PlayerModule_RequestPlayerCook, __this, recipeId, avatarId, qteQuality, count, method);
|
||||
}
|
||||
|
||||
if (autoCook.f_Enabled && autoCook.f_FastProficiency) {
|
||||
count = 1;
|
||||
|
||||
GameObject::Profirency = app::GameObject_Find(string_to_il2cppi("/Canvas/Pages/CookingPage/GrpCooking/GrpTab/GrpItemTips/CookingItemTip/Viewport/ItemTips_Cooking(Clone)/Content/GrpProficiency/Level/"), nullptr);
|
||||
auto RectTransform = app::GameObject_GetComponentByName(GameObject::Profirency, string_to_il2cppi("RectTransform"), nullptr);
|
||||
auto TransformChild = app::Transform_GetChild(reinterpret_cast<app::Transform*>(RectTransform), 0, nullptr);
|
||||
auto TextComponent = app::Component_1_GetComponent_1(reinterpret_cast<app::Component_1*>(TransformChild), string_to_il2cppi("Text"), nullptr);
|
||||
|
||||
if (TextComponent != nullptr) {
|
||||
auto Text_str = app::Text_get_text(reinterpret_cast<app::Text*>(TextComponent), nullptr);
|
||||
auto ProficiencyStr = il2cppi_to_string(Text_str).erase(0, il2cppi_to_string(Text_str).find_first_of(" ."));
|
||||
std::vector<std::string> FinalProficiency = split(ProficiencyStr, '/');
|
||||
autoCook.CookCount = atoi(FinalProficiency[1].c_str()) - atoi(FinalProficiency[0].c_str());
|
||||
}
|
||||
|
||||
if (autoCook.CookCount == 0)
|
||||
autoCook.CookCount = 1;
|
||||
|
||||
if (autoCook.CookCount > autoCook.CookFoodMaxNum)
|
||||
autoCook.CookCount = autoCook.CookFoodMaxNum;
|
||||
|
||||
for (int i = 1; i <= autoCook.CookCount; i++) {
|
||||
CALL_ORIGIN(PlayerModule_RequestPlayerCook, __this, recipeId, avatarId, qteQuality, count, method);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
return CALL_ORIGIN(PlayerModule_RequestPlayerCook, __this, recipeId, avatarId, qteQuality, count, method);
|
||||
}
|
||||
}
|
||||
|
||||
static void PlayerModule_OnPlayerCookRsp(app::MoleMole_PlayerModule* __this, app::PlayerCookRsp* rsp, MethodInfo* method) {
|
||||
static void PlayerModule_OnPlayerCookRsp(app::MoleMole_PlayerModule* __this, app::PlayerCookRsp* rsp, MethodInfo* method) {
|
||||
AutoCook& autoCook = AutoCook::GetInstance();
|
||||
if (autoCook.f_Enabled)
|
||||
if (autoCook.f_Enabled || autoCook.f_FastProficiency)
|
||||
{
|
||||
rsp->fields.qteQuality_ = autoCook.f_Quality;
|
||||
rsp->fields.cookCount_ = autoCook.f_Count;
|
||||
|
||||
// Unlock Quick Cooking, It will reset after a restart, so it is better to study the recipe in full at once.
|
||||
if (rsp->fields.recipeData_ != nullptr)
|
||||
rsp->fields.recipeData_->fields.proficiency_ = autoCook.CookCount;
|
||||
rsp->fields.qteQuality_ = autoCook.f_QualityField;
|
||||
rsp->fields.cookCount_ = autoCook.f_CountField;
|
||||
if (autoCook.f_FastProficiency)
|
||||
rsp->fields.cookCount_ = 1;
|
||||
// if (rsp->fields.recipeData_ != nullptr)
|
||||
// rsp->fields.recipeData_->fields.proficiency_ = autoCook.CookCount;
|
||||
}
|
||||
|
||||
return CALL_ORIGIN(PlayerModule_OnPlayerCookRsp, __this, rsp, method);
|
||||
}
|
||||
|
||||
|
||||
static void CookingQtePageContext_UpdateProficiency(app::CookingQtePageContext* __this, MethodInfo* method) {
|
||||
AutoCook& autoCook = AutoCook::GetInstance();
|
||||
if (autoCook.f_Enabled)
|
||||
if (autoCook.f_Enabled || autoCook.f_FastProficiency)
|
||||
{
|
||||
__this->fields._pageMono->fields._qteTime = 0;
|
||||
__this->fields._pageMono->fields._autoQteTime = 0;
|
||||
app::CookingQtePageContext_CloseItemGotPanel(__this, nullptr); // Auto Close Panel
|
||||
}
|
||||
|
||||
return CALL_ORIGIN(CookingQtePageContext_UpdateProficiency, __this, method);
|
||||
}
|
||||
|
||||
static uint32_t CookRecipeExcelConfig_get_maxProficiency(app::CookRecipeExcelConfig* __this, MethodInfo* method) {
|
||||
AutoCook& autoCook = AutoCook::GetInstance();
|
||||
if (autoCook.f_Enabled)
|
||||
{
|
||||
uint32_t maxCount = app::MoleMole_SimpleSafeUInt32_get_Value(__this->fields.maxProficiencyRawNum, nullptr);
|
||||
autoCook.CookCount = maxCount;
|
||||
}
|
||||
return CALL_ORIGIN(CookRecipeExcelConfig_get_maxProficiency, __this, method);
|
||||
}
|
||||
}
|
@ -9,10 +9,13 @@ namespace cheat::feature
|
||||
{
|
||||
public:
|
||||
config::Field<config::Toggle<Hotkey>> f_Enabled;
|
||||
config::Field<int> f_Count;
|
||||
config::Field<int> f_Quality;
|
||||
config::Field<config::Toggle<Hotkey>> f_FastProficiency;
|
||||
|
||||
uint32_t CookCount;
|
||||
config::Field<int> f_CountField;
|
||||
config::Field<int> f_QualityField;
|
||||
|
||||
int CookFoodMaxNum; // Maximum quantity at a time
|
||||
int CookCount;
|
||||
|
||||
static AutoCook& GetInstance();
|
||||
|
||||
|
@ -4,20 +4,23 @@
|
||||
#include <helpers.h>
|
||||
#include <cheat/game/EntityManager.h>
|
||||
|
||||
namespace cheat::feature
|
||||
namespace cheat::feature
|
||||
{
|
||||
static void InLevelCutScenePageContext_UpdateView_Hook(app::InLevelCutScenePageContext* __this, MethodInfo* method);
|
||||
static void InLevelCutScenePageContext_ClearView_Hook(app::InLevelCutScenePageContext* __this, MethodInfo* method);
|
||||
static void CriwareMediaPlayer_Update(app::CriwareMediaPlayer* __this, MethodInfo* method);
|
||||
|
||||
DialogSkip::DialogSkip() : Feature(),
|
||||
NF(f_Enabled, "Auto talk", "AutoTalk", false),
|
||||
NF(f_AutoSelectDialog, "Auto select dialog", "AutoTalk", true),
|
||||
NF(f_ExcludeImportant, "Exclude Katheryne/Tubby", "AutoTalk", true),
|
||||
NF(f_FastDialog, "Fast dialog", "AutoTalk", false),
|
||||
NF(f_TimeSpeedup, "Time Speed", "AutoTalk", 5.0f)
|
||||
NF(f_Enabled, "Auto talk", "AutoTalk", false),
|
||||
NF(f_AutoSelectDialog, "Auto select dialog", "AutoTalk", true),
|
||||
NF(f_ExcludeImportant, "Exclude Katheryne/Tubby", "AutoTalk", true),
|
||||
NF(f_FastDialog, "Fast dialog", "AutoTalk", false),
|
||||
NF(f_CutsceneUSM, "Skip Cutscenes", "AutoTalk", false),
|
||||
NF(f_TimeSpeedup, "Time Speed", "AutoTalk", 5.0f)
|
||||
{
|
||||
HookManager::install(app::MoleMole_InLevelCutScenePageContext_UpdateView, InLevelCutScenePageContext_UpdateView_Hook);
|
||||
HookManager::install(app::MoleMole_InLevelCutScenePageContext_ClearView, InLevelCutScenePageContext_ClearView_Hook);
|
||||
HookManager::install(app::CriwareMediaPlayer_Update, CriwareMediaPlayer_Update);
|
||||
}
|
||||
|
||||
const FeatureGUIInfo& DialogSkip::GetGUIInfo() const
|
||||
@ -41,21 +44,25 @@ namespace cheat::feature
|
||||
{
|
||||
ConfigWidget(f_TimeSpeedup, 0.1f, 2.0f, 50.0f, "Time Speedup Multipler \nHigher Values will lead to sync issues with servers \nand is not recommended for Laggy Internet connections.");
|
||||
}
|
||||
ConfigWidget("Skip Cutscenes", f_CutsceneUSM, "Automatically skips game movies.");
|
||||
}
|
||||
|
||||
bool DialogSkip::NeedStatusDraw() const
|
||||
{
|
||||
return f_Enabled;
|
||||
{
|
||||
return f_Enabled || f_CutsceneUSM;
|
||||
}
|
||||
|
||||
void DialogSkip::DrawStatus()
|
||||
void DialogSkip::DrawStatus()
|
||||
{
|
||||
ImGui::Text("Dialog [%s%s%s%s%s]",
|
||||
f_AutoSelectDialog ? "Auto" : "Manual",
|
||||
f_AutoSelectDialog && (f_ExcludeImportant || f_FastDialog) ? "|" : "",
|
||||
f_ExcludeImportant ? "Exc" : "",
|
||||
f_ExcludeImportant && f_FastDialog ? "|" : "",
|
||||
f_FastDialog ? "Fast" : "Normal");
|
||||
if (f_Enabled)
|
||||
ImGui::Text("Dialog [%s%s%s%s%s]",
|
||||
f_AutoSelectDialog ? "Auto" : "Manual",
|
||||
f_AutoSelectDialog && (f_ExcludeImportant || f_FastDialog) ? "|" : "",
|
||||
f_ExcludeImportant ? "Exc" : "",
|
||||
f_ExcludeImportant && f_FastDialog ? "|" : "",
|
||||
f_FastDialog ? "Fast" : "Normal");
|
||||
|
||||
ImGui::Text(f_CutsceneUSM ? "Skip Cutscenes" : "");
|
||||
}
|
||||
|
||||
DialogSkip& DialogSkip::GetInstance()
|
||||
@ -64,10 +71,10 @@ namespace cheat::feature
|
||||
return instance;
|
||||
}
|
||||
|
||||
// Raised when dialog view updating
|
||||
// Raised when dialog view updating
|
||||
// We call free click, if auto talk enabled, that means we just emulate user click
|
||||
// When appear dialog choose we create notify with dialog select first item.
|
||||
void DialogSkip::OnCutScenePageUpdate(app::InLevelCutScenePageContext* context)
|
||||
void DialogSkip::OnCutScenePageUpdate(app::InLevelCutScenePageContext* context)
|
||||
{
|
||||
if (!f_Enabled)
|
||||
return;
|
||||
@ -86,7 +93,7 @@ namespace cheat::feature
|
||||
// add their own name substrings of entities to avoid
|
||||
// speeding up dialog on.
|
||||
std::vector<std::string> impEntitiesNames = {
|
||||
"Djinn",
|
||||
"Djinn",
|
||||
"Katheryne"
|
||||
};
|
||||
auto dialogPartnerID = context->fields._inteeID;
|
||||
@ -103,25 +110,25 @@ namespace cheat::feature
|
||||
}
|
||||
}
|
||||
|
||||
if (talkDialog->fields._inSelect && f_AutoSelectDialog && !isImportant)
|
||||
{
|
||||
int32_t value = 0;
|
||||
auto object = il2cpp_value_box((Il2CppClass*)*app::Int32__TypeInfo, &value);
|
||||
auto notify = app::Notify_CreateNotify_1(app::MoleMole_NotifyTypes__Enum::DialogSelectItemNotify, (app::Object*)object, nullptr);
|
||||
app::MoleMole_TalkDialogContext_OnDialogSelectItem(talkDialog, ¬ify, nullptr);
|
||||
}
|
||||
else if (!talkDialog->fields._inSelect)
|
||||
app::MoleMole_InLevelCutScenePageContext_OnFreeClick(context, nullptr);
|
||||
if (talkDialog->fields._inSelect && f_AutoSelectDialog && !isImportant)
|
||||
{
|
||||
int32_t value = 0;
|
||||
auto object = il2cpp_value_box((Il2CppClass*)*app::Int32__TypeInfo, &value);
|
||||
auto notify = app::Notify_CreateNotify_1(app::MoleMole_NotifyTypes__Enum::DialogSelectItemNotify, (app::Object*)object, nullptr);
|
||||
app::MoleMole_TalkDialogContext_OnDialogSelectItem(talkDialog, ¬ify, nullptr);
|
||||
}
|
||||
else if (!talkDialog->fields._inSelect)
|
||||
app::MoleMole_InLevelCutScenePageContext_OnFreeClick(context, nullptr);
|
||||
}
|
||||
|
||||
static void InLevelCutScenePageContext_UpdateView_Hook(app::InLevelCutScenePageContext* __this, MethodInfo* method)
|
||||
{
|
||||
CALL_ORIGIN(InLevelCutScenePageContext_UpdateView_Hook, __this, method);
|
||||
static void InLevelCutScenePageContext_UpdateView_Hook(app::InLevelCutScenePageContext* __this, MethodInfo* method)
|
||||
{
|
||||
CALL_ORIGIN(InLevelCutScenePageContext_UpdateView_Hook, __this, method);
|
||||
|
||||
DialogSkip& dialogSkip = DialogSkip::GetInstance();
|
||||
dialogSkip.OnCutScenePageUpdate(__this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Raised when exiting a dialog. We try to hackishly return to normal value.
|
||||
// Should be a better way to store the pre-dialog speed using Time_get_timeScale.
|
||||
static void InLevelCutScenePageContext_ClearView_Hook(app::InLevelCutScenePageContext* __this, MethodInfo* method)
|
||||
@ -131,5 +138,14 @@ namespace cheat::feature
|
||||
app::Time_set_timeScale(1.0f, nullptr);
|
||||
CALL_ORIGIN(InLevelCutScenePageContext_ClearView_Hook, __this, method);
|
||||
}
|
||||
|
||||
static void CriwareMediaPlayer_Update(app::CriwareMediaPlayer* __this, MethodInfo* method)
|
||||
{
|
||||
DialogSkip& dialogSkip = DialogSkip::GetInstance();
|
||||
if (dialogSkip.f_CutsceneUSM)
|
||||
app::CriwareMediaPlayer_Skip(__this, nullptr);
|
||||
|
||||
return CALL_ORIGIN(CriwareMediaPlayer_Update, __this, method);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,16 +2,17 @@
|
||||
#include <cheat-base/cheat/Feature.h>
|
||||
#include <cheat-base/config/config.h>
|
||||
|
||||
namespace cheat::feature
|
||||
namespace cheat::feature
|
||||
{
|
||||
|
||||
class DialogSkip : public Feature
|
||||
{
|
||||
{
|
||||
public:
|
||||
config::Field<config::Toggle<Hotkey>> f_Enabled;
|
||||
config::Field<config::Toggle<Hotkey>> f_AutoSelectDialog;
|
||||
config::Field<config::Toggle<Hotkey>> f_ExcludeImportant;
|
||||
config::Field<config::Toggle<Hotkey>> f_FastDialog;
|
||||
config::Field<config::Toggle<Hotkey>> f_CutsceneUSM;
|
||||
config::Field<float> f_TimeSpeedup;
|
||||
|
||||
static DialogSkip& GetInstance();
|
||||
@ -23,7 +24,7 @@ namespace cheat::feature
|
||||
void DrawStatus() override;
|
||||
|
||||
void OnCutScenePageUpdate(app::InLevelCutScenePageContext* context);
|
||||
|
||||
|
||||
private:
|
||||
DialogSkip();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user