Add pickup filter for Auto Pickup
This commit is contained in:
parent
ab62846286
commit
a8ef837f77
@ -17,6 +17,10 @@ namespace cheat::feature
|
||||
NF(f_AutoPickup, "Auto-pickup drops", "AutoLoot", false),
|
||||
NF(f_AutoTreasure, "Auto-open treasures", "AutoLoot", false),
|
||||
NF(f_UseCustomRange, "Use custom pickup range", "AutoLoot", false),
|
||||
NF(f_PickupFilter, "Pickup filter", "AutoLoot", false),
|
||||
NF(f_PickupFilter_Animals, "Animals filter", "AutoLoot", true),
|
||||
NF(f_PickupFilter_DropItems, "Drop items filter", "AutoLoot", true),
|
||||
NF(f_PickupFilter_Resources, "Resources filter", "AutoLoot", true),
|
||||
NF(f_Chest, "Chests", "AutoLoot", false),
|
||||
NF(f_Leyline, "Leylines", "AutoLoot", false),
|
||||
NF(f_Investigate, "Search points", "AutoLoot", false),
|
||||
@ -98,21 +102,29 @@ namespace cheat::feature
|
||||
ImGui::EndGroupPanel();
|
||||
ImGui::EndTable();
|
||||
}
|
||||
|
||||
ImGui::BeginGroupPanel("Pickup Filter");
|
||||
{
|
||||
ConfigWidget("Enabled", f_PickupFilter, "Enable pickup filter.\n");
|
||||
ConfigWidget("Animals", f_PickupFilter_Animals, "Fish, Lizard, Frog, Flying animals."); 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).");
|
||||
}
|
||||
ImGui::EndGroupPanel();
|
||||
}
|
||||
|
||||
bool AutoLoot::NeedStatusDraw() const
|
||||
{
|
||||
return f_AutoPickup || f_AutoTreasure || f_UseCustomRange;
|
||||
{
|
||||
return f_AutoPickup || f_AutoTreasure || f_UseCustomRange || f_PickupFilter;
|
||||
}
|
||||
|
||||
void AutoLoot::DrawStatus()
|
||||
{
|
||||
ImGui::Text("Auto Loot\n[%s%s%s%s%s%s]",
|
||||
ImGui::Text("Auto Loot\n[%s%s%s%s%s]",
|
||||
f_AutoPickup ? "AP" : "",
|
||||
f_AutoPickup && (f_AutoTreasure || f_UseCustomRange) ? "|" : "",
|
||||
f_AutoTreasure ? "AT" : "",
|
||||
f_AutoTreasure && f_UseCustomRange ? "|" : "",
|
||||
f_UseCustomRange ? fmt::format("CR{:.1f}m", f_CustomRange.value()).c_str() : "",
|
||||
f_AutoTreasure ? fmt::format("{}AT", f_AutoPickup ? "|" : "").c_str() : "",
|
||||
f_UseCustomRange ? fmt::format("{}CR{:.1f}m", f_AutoPickup || f_AutoTreasure ? "|" : "", f_CustomRange.value()).c_str() : "",
|
||||
f_PickupFilter ? fmt::format("{}PF", f_AutoPickup || f_AutoTreasure || f_UseCustomRange ? "|" : "").c_str() : "",
|
||||
f_AutoPickup || f_AutoTreasure ? fmt::format("|{}ms", f_DelayTime.value()).c_str() : ""
|
||||
);
|
||||
}
|
||||
@ -132,6 +144,18 @@ namespace cheat::feature
|
||||
if (itemModule == nullptr)
|
||||
return false;
|
||||
|
||||
if (f_PickupFilter)
|
||||
{
|
||||
if (!f_PickupFilter_Animals && entity->fields.entityType == app::EntityType__Enum_1::EnvAnimal)
|
||||
return false;
|
||||
|
||||
if (!f_PickupFilter_DropItems && entity->fields.entityType == app::EntityType__Enum_1::DropItem)
|
||||
return false;
|
||||
|
||||
if (!f_PickupFilter_Resources && entity->fields.entityType == app::EntityType__Enum_1::GatherObject)
|
||||
return false;
|
||||
}
|
||||
|
||||
auto entityId = entity->fields._runtimeID_k__BackingField;
|
||||
if (f_DelayTime == 0)
|
||||
{
|
||||
|
@ -12,6 +12,7 @@ namespace cheat::feature
|
||||
config::Field<config::Toggle<Hotkey>> f_AutoPickup;
|
||||
config::Field<config::Toggle<Hotkey>> f_AutoTreasure;
|
||||
config::Field<config::Toggle<Hotkey>> f_UseCustomRange;
|
||||
config::Field<config::Toggle<Hotkey>> f_PickupFilter;
|
||||
|
||||
config::Field<int> f_DelayTime;
|
||||
config::Field<float> f_CustomRange;
|
||||
@ -22,6 +23,10 @@ namespace cheat::feature
|
||||
config::Field<bool> f_QuestInteract;
|
||||
config::Field<bool> f_Others;
|
||||
|
||||
config::Field<bool> f_PickupFilter_Animals;
|
||||
config::Field<bool> f_PickupFilter_DropItems;
|
||||
config::Field<bool> f_PickupFilter_Resources;
|
||||
|
||||
static AutoLoot& GetInstance();
|
||||
|
||||
const FeatureGUIInfo& GetGUIInfo() const override;
|
||||
|
Loading…
Reference in New Issue
Block a user