public static void Postfix(MechDetails __instance) { MechDef mech = (MechDef)mechdef.GetValue(__instance); if (mech != null) { Main.modLog.LogMessage($"finding mechdef affinity descriptor for {mech.Description.UIName}"); string affinityDescriptors = PilotAffinityManager.Instance.getMechChassisAffinityDescription(mech); //Main.modLog.LogMessage(affinityDescriptors); LocalizableText bioText = (LocalizableText)descriptor.GetValue(__instance); bioText.AppendTextAndRefresh(affinityDescriptors, (object[])Array.Empty <object>()); descriptor.SetValue(__instance, bioText); } else { Main.modLog.LogMessage("mechdef is null!"); } }
static bool MechTooltipInstance(CardInner __instance, EffectApp efApp, string dictKey) { if (dictKey == "Lua") { //Need to go ahead and add MechDetails for all Lua effApps on this card since otherwise they'll be treated as duplicate "Lua" effects for (int index = __instance.itemObj.efApps.Count - 1; index >= 0; --index) { var thisApp = __instance.itemObj.efApps[index]; if (thisApp.effect == (Effect)Enum.Parse(typeof(Effect), "Lua")) { var effectKey = thisApp.value; if (LuaPowerCustomTooltips.customTooltips.Contains(effectKey)) { MechDetails mechDetails = UnityEngine.Object.Instantiate <MechDetails>(__instance.deCtrl.mechTooltip, __instance.mechTooltipGrid); mechDetails.cardInner = __instance; mechDetails.FillTra(thisApp, __instance.deCtrl.ctrl.effectSpritesDict[effectKey], effectKey); } } } return(false); } return(true); }