Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ public class LootValueMod : BaseUnityPlugin
public const string pluginName = "LootValue";
public const string pluginVersion = "2.0.3";

public enum ModifierKey
{
None = 0,
Shift = KeyCode.LeftShift,
Control = KeyCode.LeftControl,
Alt = KeyCode.LeftAlt
}

private void Awake()
{
Config.SaveOnConfigSet = true;
Expand Down Expand Up @@ -98,6 +106,8 @@ private void Config_SettingChanged(object sender, SettingChangedEventArgs e)

internal static ConfigEntry<string> TraderBlacklist;

internal static ConfigEntry<ModifierKey> showPriceKey;

private void SetupConfig()
{
OneButtonQuickSell = Config.Bind("Quick Sell", "One button quick sell", false);
Expand Down Expand Up @@ -126,6 +136,8 @@ The third is marked as the ultimate color. Anything over 10000 rubles would be w

blacklistedTraders.AddRange(TraderBlacklist.Value.ToLower().Split(','));

showPriceKey = Config.Bind("Tooltip", "Modifier key to show price", ModifierKey.None, "Only show price in tooltip while holding this key");

if (UseCustomColours.Value)
SlotColoring.ReadColors(CustomColours.Value);
}
Expand Down Expand Up @@ -505,15 +517,15 @@ protected override MethodBase GetTargetMethod()
[PatchPrefix]
private static void Prefix(ref string text, ref float delay, SimpleTooltip __instance)
{
delay = 0;

bool isFleaEligible = false;
double lowestFleaOffer = 0;

bool modifierKeyHeld = Input.GetKey((KeyCode)LootValueMod.showPriceKey.Value) || LootValueMod.showPriceKey.Value == 0;
bool inRaidAndCanShowInRaid = HasRaidStarted() && LootValueMod.showFleaPricesInRaid.Value;

if (hoveredItem != null && LootValueMod.showPrices.Value && (!HasRaidStarted() || inRaidAndCanShowInRaid))
if (hoveredItem != null && LootValueMod.showPrices.Value && (!HasRaidStarted() || inRaidAndCanShowInRaid) && modifierKeyHeld)
{
delay = 0; // Show tooltip immediately if showing price, otherwise use default delay
tooltip = __instance;

TraderOffer bestTraderOffer = GetBestTraderOffer(hoveredItem);
Expand Down