reflection part 2

This commit is contained in:
Tyfon
2024-07-11 21:58:20 -07:00
parent 8ad0b8c5f7
commit 3d8c9cc232
10 changed files with 178 additions and 84 deletions

View File

@@ -532,7 +532,7 @@ namespace UIFixes
[PatchPrefix]
public static bool Prefix(SimpleTooltip __instance, InventoryError error)
{
if (error is StashGridClass.GClass3310 || error is StashGridClass.GClass3311)
if (error is GridNoRoomError || error is GridSpaceTakenError)
{
__instance.Close();
return false;
@@ -546,15 +546,15 @@ namespace UIFixes
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(Player.FirearmController.Class1039), nameof(Player.FirearmController.Class1039.OnModChanged));
return AccessTools.Method(typeof(FirearmAddingModState), nameof(FirearmAddingModState.OnModChanged));
}
// The firearm state machine state Class1015 is the "adding mod" state
// Unpatched, it fires off the success callback before returning to ready state (GClass1608)
// This is the state machine's "adding mod" state
// Unpatched, it fires off the success callback before returning to ready state
// Patched to not be that stupid
[PatchPrefix]
public static bool Prefix(
Player.FirearmController.Class1039 __instance,
FirearmAddingModState __instance,
bool ___bool_0,
FirearmsAnimator ___firearmsAnimator_0,
Item ___item_0,
@@ -577,7 +577,7 @@ namespace UIFixes
__instance.State = Player.EOperationState.Finished;
// Begin change (moved from bottom)
___firearmController_0.InitiateOperation<Player.FirearmController.GClass1619>().Start(null);
___firearmController_0.InitiateOperation<FirearmReadyState>().Start(null);
__instance.method_5(gameObject);
// End change