mirror of
https://github.com/360NENZ/Taiga74164-Akebi-GC.git
synced 2025-09-19 20:26:20 +08:00
56 lines
1.5 KiB
C++
56 lines
1.5 KiB
C++
#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);
|
|
}
|
|
} |