コード例 #1
0
 public static void Postfix(HUDTurretArmorReadout __instance)
 {
     if (!__instance.DisplayedTurret.Combat.HostilityMatrix.IsLocalPlayerFriendly(__instance.DisplayedTurret.TeamId))
     {
         ArmorAndStructHelper.ObfuscateArmorAndStructText(__instance.DisplayedTurret, __instance.HoverInfoTextArmor, __instance.HoverInfoTextStructure);
     }
 }
コード例 #2
0
 public static void Postfix(HUDVehicleArmorReadout __instance)
 {
     if (__instance != null && __instance.DisplayedVehicle != null && __instance.HoverInfoTextArmor != null && __instance.HoverInfoTextStructure != null)
     {
         if (!__instance.DisplayedVehicle.Combat.HostilityMatrix.IsLocalPlayerFriendly(__instance.DisplayedVehicle.TeamId))
         {
             ArmorAndStructHelper.ObfuscateArmorAndStructText(__instance.DisplayedVehicle, __instance.HoverInfoTextArmor, __instance.HoverInfoTextStructure);
         }
     }
 }
コード例 #3
0
        // Private method can't be patched by annotations, so use MethodInfo
        //public static MethodInfo TargetMethod() {
        //    return AccessTools.Method(typeof(HUDMechArmorReadout), "RefreshHoverInfo", new Type[] { });
        //}

        public static void Postfix(HUDMechArmorReadout __instance)
        {
            if (__instance != null && __instance.DisplayedMech != null && __instance.HoverInfoTextArmor != null && __instance.HoverInfoTextStructure != null)
            {
                if (!__instance.DisplayedMech.Combat.HostilityMatrix.IsLocalPlayerFriendly(__instance.DisplayedMech.TeamId))
                {
                    Mod.Log.Trace?.Write($"Hiding armor and structure on target: {CombatantUtils.Label(__instance.DisplayedMech)}");
                    ArmorAndStructHelper.ObfuscateArmorAndStructText(__instance.DisplayedMech, __instance.HoverInfoTextArmor, __instance.HoverInfoTextStructure);
                }
            }
        }