Add offer with space/enter; hide scary slot swap error tooltip

This commit is contained in:
Tyfon
2024-07-09 12:12:28 -07:00
parent 3038c71ed7
commit f74a234f7c
2 changed files with 45 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ namespace UIFixes
new RememberSwapGridHoverPatch().Enable();
new InspectWindowUpdateStatsOnSwapPatch().Enable();
new FixAddModFirearmOperationPatch().Enable();
new HideScaryTooltipPatch().Enable();
}
private static bool ValidPrerequisites(ItemContextClass itemContext, ItemContextAbstractClass targetItemContext, IInventoryEventResult operation)
@@ -521,6 +522,26 @@ namespace UIFixes
}
}
public class HideScaryTooltipPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(SimpleTooltip), nameof(SimpleTooltip.ShowInventoryError));
}
[PatchPrefix]
public static bool Prefix(SimpleTooltip __instance, InventoryError error)
{
if (error is StashGridClass.GClass3310 || error is StashGridClass.GClass3311)
{
__instance.Close();
return false;
}
return true;
}
}
public class FixAddModFirearmOperationPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()