public void OnReveal(HyperText source, HyperText.LinkInfo linkInfo) { if (!Popup.IsRevealed) { // get center of hitboxes involved Vector2 hitboxCenter = Vector3.zero; source.GetLinkHitboxes(linkInfo.Index, m_Hitboxes); for (int i = 0; i < m_Hitboxes.Count; ++i) { hitboxCenter += m_Hitboxes[i].center; } hitboxCenter /= m_Hitboxes.Count; // set position of popup Popup.transform.localPosition = hitboxCenter - Vector2.up * ((Popup.RectTransform.rect.height + m_Source.FontSizeToUse) * 0.5f + m_Padding); } // set text of popup m_Source.GetLinkKeywordCollections(m_LinkKeywords); Popup.SetText( ( m_LinkKeywords.Where( collection => collection.ClassName == linkInfo.ClassName ).First().Collection as KeywordsGlossary ).GetEntry(linkInfo.Name).Definition ); // reveal the popup Popup.Reveal(); }
private void OnClickText(HyperText arg0, HyperText.LinkInfo arg1) { if (this.onClickKeyward != null) { onClickKeyward.Invoke(DocUtil.UnWarpText(arg1.Name)); } }
public void OnClickChatLink(HyperText text, HyperText.LinkInfo link) { if (string.IsNullOrEmpty(link.Name)) { return; } //<a name="c:1001:Name" class="player">Name</a> //<a name="i:1001:Name" class="item">Name</a> if (link.Name.StartsWith("c:")) { string[] strs = link.Name.Split(":".ToCharArray()); UIPopCharMenu menu = UIManager.Instance.Show <UIPopCharMenu>(); menu.targetId = int.Parse(strs[1]); menu.targetName = strs[2]; } }
public void OnDismiss(HyperText source, HyperText.LinkInfo linkInfo) { Popup.Dismiss(); }