Files
Akebi-GC3_0/cheat-library/src/user/cheat/visuals/ShowChestIndicator.cpp

56 lines
1.5 KiB
C++
Raw Normal View History

#include "pch-il2cpp.h"
#include "ShowChestIndicator.h"
#include <helpers.h>
#include <cheat/events.h>
namespace cheat::feature
{
static bool IndicatorPlugin_DoCheck(app::LCIndicatorPlugin* __this, MethodInfo* method);
ChestIndicator::ChestIndicator() : Feature(),
NF(f_Enabled, "Show Chest Indicator", "ShowChest", false)
{
HookManager::install(app::LCIndicatorPlugin_DoCheck, IndicatorPlugin_DoCheck);
}
const FeatureGUIInfo& ChestIndicator::GetGUIInfo() const
{
static const FeatureGUIInfo info{ "ShowChest", "Visuals", false };
return info;
}
void ChestIndicator::DrawMain()
{
ConfigWidget(f_Enabled, "Show chests, game mechanics.");
}
bool ChestIndicator::NeedStatusDraw() const
{
return f_Enabled;
}
void ChestIndicator::DrawStatus()
{
ImGui::Text("Chest Indicator");
}
ChestIndicator& ChestIndicator::GetInstance()
{
static ChestIndicator instance;
return instance;
}
static bool IndicatorPlugin_DoCheck(app::LCIndicatorPlugin* __this, MethodInfo* method) {
ChestIndicator& chestIndicator = ChestIndicator::GetInstance();
if (chestIndicator.f_Enabled)
{
if (__this->fields._dataItem != nullptr)
{
// Base Chest not found, try improve
app::LCIndicatorPlugin_ShowIcon(__this, nullptr);
}
}
return CALL_ORIGIN(IndicatorPlugin_DoCheck, __this, method);
}
}