mirror of
https://github.com/SunsetMkt/Akebi-GC.git
synced 2025-09-19 20:16:01 +08:00
Auto Follow Paimon
Auto Follow Paimon
This commit is contained in:
@ -53,6 +53,7 @@
|
|||||||
<ClInclude Include="src\user\cheat\visuals\CameraZoom.h" />
|
<ClInclude Include="src\user\cheat\visuals\CameraZoom.h" />
|
||||||
<ClInclude Include="src\user\cheat\visuals\FPSUnlock.h" />
|
<ClInclude Include="src\user\cheat\visuals\FPSUnlock.h" />
|
||||||
<ClInclude Include="src\user\cheat\visuals\NoFog.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\ProfileChanger.h" />
|
||||||
<ClInclude Include="src\user\cheat\visuals\ShowChestIndicator.h" />
|
<ClInclude Include="src\user\cheat\visuals\ShowChestIndicator.h" />
|
||||||
<ClInclude Include="src\user\cheat\world\AutoCook.h" />
|
<ClInclude Include="src\user\cheat\world\AutoCook.h" />
|
||||||
@ -164,6 +165,7 @@
|
|||||||
<ClCompile Include="src\user\cheat\visuals\CameraZoom.cpp" />
|
<ClCompile Include="src\user\cheat\visuals\CameraZoom.cpp" />
|
||||||
<ClCompile Include="src\user\cheat\visuals\FPSUnlock.cpp" />
|
<ClCompile Include="src\user\cheat\visuals\FPSUnlock.cpp" />
|
||||||
<ClCompile Include="src\user\cheat\visuals\NoFog.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\ProfileChanger.cpp" />
|
||||||
<ClCompile Include="src\user\cheat\visuals\ShowChestIndicator.cpp" />
|
<ClCompile Include="src\user\cheat\visuals\ShowChestIndicator.cpp" />
|
||||||
<ClCompile Include="src\user\cheat\world\AutoCook.cpp" />
|
<ClCompile Include="src\user\cheat\world\AutoCook.cpp" />
|
||||||
|
@ -228,6 +228,9 @@
|
|||||||
<ClInclude Include="src\user\cheat\visuals\ProfileChanger.h">
|
<ClInclude Include="src\user\cheat\visuals\ProfileChanger.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\user\cheat\visuals\PaimonFollow.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Font Include="res\Ruda-Bold.ttf" />
|
<Font Include="res\Ruda-Bold.ttf" />
|
||||||
@ -414,6 +417,9 @@
|
|||||||
<ClCompile Include="src\user\cheat\visuals\ProfileChanger.cpp">
|
<ClCompile Include="src\user\cheat\visuals\ProfileChanger.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\user\cheat\visuals\PaimonFollow.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="res\res.rc">
|
<ResourceCompile Include="res\res.rc">
|
||||||
|
@ -157,6 +157,8 @@ DO_APP_FUNC(0x016A77B0, void, ProfileEditPage, (MonoFriendInformationDialog* __t
|
|||||||
// Game Object Utility
|
// Game Object Utility
|
||||||
DO_APP_FUNC(0x0662F130, GameObject*, GameObject_Find, (String* name, MethodInfo* method));
|
DO_APP_FUNC(0x0662F130, GameObject*, GameObject_Find, (String* name, MethodInfo* method));
|
||||||
DO_APP_FUNC(0x0662F190, Component_1*, GameObject_GetComponentByName, (GameObject* __this, String* type, MethodInfo* method));
|
DO_APP_FUNC(0x0662F190, Component_1*, GameObject_GetComponentByName, (GameObject* __this, String* type, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x0662F660, bool, GameObject_get_active, (GameObject* __this, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x0662F720, void, GameObject_set_active, (GameObject* __this, bool value, MethodInfo* method));
|
||||||
|
|
||||||
// Utility
|
// Utility
|
||||||
DO_APP_FUNC(0x06568060, void, Text_set_text, (Text* __this, String* value, MethodInfo* method));
|
DO_APP_FUNC(0x06568060, void, Text_set_text, (Text* __this, String* value, MethodInfo* method));
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include <cheat/visuals/CameraZoom.h>
|
#include <cheat/visuals/CameraZoom.h>
|
||||||
#include <cheat/visuals/ShowChestIndicator.h>
|
#include <cheat/visuals/ShowChestIndicator.h>
|
||||||
#include <cheat/visuals/ProfileChanger.h>
|
#include <cheat/visuals/ProfileChanger.h>
|
||||||
|
#include <cheat/visuals/PaimonFollow.h>
|
||||||
|
|
||||||
#include "GenshinCM.h"
|
#include "GenshinCM.h"
|
||||||
|
|
||||||
@ -97,7 +98,8 @@ namespace cheat
|
|||||||
FEAT_INST(FPSUnlock),
|
FEAT_INST(FPSUnlock),
|
||||||
FEAT_INST(CameraZoom),
|
FEAT_INST(CameraZoom),
|
||||||
FEAT_INST(ChestIndicator),
|
FEAT_INST(ChestIndicator),
|
||||||
FEAT_INST(ProfileChanger)
|
FEAT_INST(ProfileChanger),
|
||||||
|
FEAT_INST(PaimonFollow)
|
||||||
|
|
||||||
});
|
});
|
||||||
#undef FEAT_INST
|
#undef FEAT_INST
|
||||||
|
77
cheat-library/src/user/cheat/visuals/PaimonFollow.cpp
Normal file
77
cheat-library/src/user/cheat/visuals/PaimonFollow.cpp
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
#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, "Paimon Follow.");
|
||||||
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
};
|
||||||
|
}
|
Reference in New Issue
Block a user