private static void Postfix(TeleportWorld __instance, string __result) { string portalName = __instance.GetText(); if (Configuration.Current.Game.IsEnabled && Configuration.Current.Game.bigPortalNames) { __result = Localization.instance.Localize(string.Concat(new string[] { "$piece_portal $piece_portal_tag:", " ", "[", portalName, "]" })); MessageHud.instance.ShowMessage(MessageHud.MessageType.Center, __result, 0, null); return; } return; }
static bool Prefix(TeleportWorld __instance, ref ZNetView ___m_nview, ref string __result) { string destPortalTag = "None"; string tag = __instance.GetText(); if (tag == "") { tag = "Empty tag"; } if (___m_nview == null || !___m_nview.IsValid()) { Debug.LogError("HoverTextPatch: ___m_nview is not valid"); } else { ZDOID targetZDOID = ___m_nview.GetZDO().GetZDOID("target"); if (!targetZDOID.IsNone()) { var destPortalZDO = ZDOMan.instance.GetZDO(targetZDOID); if (destPortalZDO == null || !destPortalZDO.IsValid()) { Debug.Log("HoverText: destPortalZDO is null or invalid"); destPortalTag = "None"; // Reset the target since it's bad... Debug.Log("HoverText: Clearing out the target"); ___m_nview.GetZDO().Set("target", ZDOID.None); ZDOMan.instance.ForceSendZDO(___m_nview.GetZDO().m_uid); } else { destPortalTag = destPortalZDO.GetString("tag", "Empty tag"); } } } __result = Localization.instance.Localize($"Portal Tag: {tag}\nDestination Portal Tag: {destPortalTag}\n[<color=yellow><b>$KEY_Use</b></color>] Configure Portal"); return(false); }