Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [HarmonyPatch(typeof(VerbTracker), "CreateVerbTargetCommand")]
- private static class CreateVerbTargetCommandPatch {
- [HarmonyPostfix]
- static void Postfix(Thing ownerThing, Command_VerbTarget __result) {
- var comp = ownerThing?.TryGetComp<CompLootAffixableThing>();
- if (comp == null) return;
- Texture2D icon = comp.UIIcon;
- Log.Message("CreateVerbTargetCommand: end");
- }
- }
- // In CompLootAffixableThing
- private Texture2D GetUIIcon () {
- Log.Message("GetUIIcon 1");
- Texture2D defIcon = parent.def.uiIcon;
- if (affixes.Count == 0) return defIcon;
- if (!UnityData.IsInMainThread) return defIcon; // too early to be fetching this stuff
- Log.Message("GetUIIcon 2");
- Material overlayMat = OverlayMaterial();
- Log.Message("GetUIIcon 3");
- if (overlayMat == null) return defIcon; // some sort of error
- // DEBUG
- Log.Message("GetUIIcon 4");
- uiIcon = (Texture2D)overlayMat.mainTexture;
- Log.Message("GetUIIcon 5");
- return uiIcon;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement