Added Oculies filter to auto pickup/pickup range

This commit is contained in:
Joaquin 2022-09-09 01:14:32 -06:00
parent b045b3057a
commit 0facae8f62
2 changed files with 9 additions and 3 deletions

View File

@ -23,6 +23,7 @@ namespace cheat::feature
NF(f_PickupFilter_Animals, "Animals filter", "AutoLoot", true), NF(f_PickupFilter_Animals, "Animals filter", "AutoLoot", true),
NF(f_PickupFilter_DropItems, "Drop items filter", "AutoLoot", true), NF(f_PickupFilter_DropItems, "Drop items filter", "AutoLoot", true),
NF(f_PickupFilter_Resources, "Resources filter", "AutoLoot", true), NF(f_PickupFilter_Resources, "Resources filter", "AutoLoot", true),
NF(f_PickupFilter_Oculus, "Oculus filter", "AutoLoot", true),
NF(f_Chest, "Chests", "AutoLoot", false), NF(f_Chest, "Chests", "AutoLoot", false),
NF(f_Leyline, "Leylines", "AutoLoot", false), NF(f_Leyline, "Leylines", "AutoLoot", false),
NF(f_Investigate, "Search points", "AutoLoot", false), NF(f_Investigate, "Search points", "AutoLoot", false),
@ -123,7 +124,8 @@ namespace cheat::feature
ConfigWidget("Enabled", f_PickupFilter, "Enable pickup filter.\n"); ConfigWidget("Enabled", f_PickupFilter, "Enable pickup filter.\n");
ConfigWidget("Animals", f_PickupFilter_Animals, "Fish, Lizard, Frog, Flying animals."); ImGui::SameLine(); ConfigWidget("Animals", f_PickupFilter_Animals, "Fish, Lizard, Frog, Flying animals."); ImGui::SameLine();
ConfigWidget("Drop Items", f_PickupFilter_DropItems, "Material, Mineral, Artifact."); ImGui::SameLine(); ConfigWidget("Drop Items", f_PickupFilter_DropItems, "Material, Mineral, Artifact."); ImGui::SameLine();
ConfigWidget("Resources", f_PickupFilter_Resources, "Everything beside Animals and Drop Items (Plants, Books, etc)."); ConfigWidget("Resources", f_PickupFilter_Resources, "Everything beside Animals and Drop Items (Plants, Books, etc)."); ImGui::SameLine();
ConfigWidget("Oculus", f_PickupFilter_Oculus, "Filter Oculus");
} }
ImGui::EndGroupPanel(); ImGui::EndGroupPanel();
} }
@ -248,20 +250,23 @@ namespace cheat::feature
void AutoLoot::OnCheckIsInPosition(bool& result, app::BaseEntity* entity) void AutoLoot::OnCheckIsInPosition(bool& result, app::BaseEntity* entity)
{ {
// TODO: Maybe add a list of filter for all GatherObject instead of just using entityType in general.
auto& manager = game::EntityManager::instance();
if (f_AutoPickup || f_UseCustomRange) { if (f_AutoPickup || f_UseCustomRange) {
float pickupRange = f_UseCustomRange ? f_CustomRange : g_default_range; float pickupRange = f_UseCustomRange ? f_CustomRange : g_default_range;
if (f_PickupFilter) if (f_PickupFilter)
{ {
if (!f_PickupFilter_Animals && entity->fields.entityType == app::EntityType__Enum_1::EnvAnimal || if (!f_PickupFilter_Animals && entity->fields.entityType == app::EntityType__Enum_1::EnvAnimal ||
!f_PickupFilter_DropItems && entity->fields.entityType == app::EntityType__Enum_1::DropItem || !f_PickupFilter_DropItems && entity->fields.entityType == app::EntityType__Enum_1::DropItem ||
!f_PickupFilter_Resources && entity->fields.entityType == app::EntityType__Enum_1::GatherObject) !f_PickupFilter_Resources && entity->fields.entityType == app::EntityType__Enum_1::GatherObject ||
!f_PickupFilter_Oculus && game::filters::combined::Oculies.IsValid(manager.entity(entity->fields._runtimeID_k__BackingField)))
{ {
result = false; result = false;
return; return;
} }
} }
auto& manager = game::EntityManager::instance();
result = manager.avatar()->distance(entity) < pickupRange; result = manager.avatar()->distance(entity) < pickupRange;
} }
} }

View File

@ -28,6 +28,7 @@ namespace cheat::feature
config::Field<bool> f_PickupFilter_Animals; config::Field<bool> f_PickupFilter_Animals;
config::Field<bool> f_PickupFilter_DropItems; config::Field<bool> f_PickupFilter_DropItems;
config::Field<bool> f_PickupFilter_Resources; config::Field<bool> f_PickupFilter_Resources;
config::Field<bool> f_PickupFilter_Oculus;
static AutoLoot& GetInstance(); static AutoLoot& GetInstance();