-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor steam gift custom behavior, add patches
- Loading branch information
Showing
4 changed files
with
62 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using HarmonyLib; | ||
|
||
namespace DingusThings.Patches | ||
{ | ||
internal class SteamGiftPatch | ||
{ | ||
[HarmonyPatch(typeof(GrabbableObject), nameof(GrabbableObject.GrabItem))] | ||
[HarmonyPostfix] | ||
public static void GrabbableObject_GrabItem(GrabbableObject __instance) | ||
{ | ||
if (__instance.itemProperties.itemName == "Steam Gift Card") | ||
{ | ||
// change tooltip on grab | ||
HUDManager.Instance.ChangeControlTip(2, __instance.scrapValue <= 0 ? "ALREADY REDEEMED" : "Redeem : [ LMB ]"); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using HarmonyLib; | ||
|
||
namespace DingusThings.Patches | ||
{ | ||
internal class TerminalPatch | ||
{ | ||
// tell Harmony which class method is being targeted | ||
[HarmonyPatch(typeof(Terminal), nameof(Terminal.Start))] | ||
// run after original method | ||
[HarmonyPostfix] | ||
public static void Terminal_Start(Terminal __instance) | ||
{ | ||
DingusThings.SetTerminalInstance(__instance); | ||
} | ||
} | ||
} |