private static Tooltip CreateKnownInfoToolTip(Vector2 mousePosition, WindowBase parent, ref Vector2 tooltipPosition) { try { if (Sim.ActiveActor == null) return null; NotificationManager manager = NotificationManager.Instance; if (manager != null) { if ((manager.mNotifications[manager.mCurrentCategory].Count > manager.mCurrentNotification) && (manager.mCurrentNotification >= 0x0)) { StyledNotification notice = manager.mNotifications[manager.mCurrentCategory][manager.mCurrentNotification] as StyledNotification; if (notice != null) { if (notice.mNotificationWindow != null) { Sim sim = null; if (notice.mNotificationWindow.GetChildByID(0x5, true) == parent) { if (notice.mIDOne != ObjectGuid.InvalidObjectGuid) { sim = GameObject.GetObject<Sim>(notice.mIDOne); } } else { if (notice.mIDTwo != ObjectGuid.InvalidObjectGuid) { sim = GameObject.GetObject<Sim>(notice.mIDTwo); } } if (sim != null) { IMiniSimDescription tag = sim.SimDescription; if (tag != null) { IHudModel hudModel = Sims3.Gameplay.UI.Responder.Instance.HudModel; Tooltip result = new KnownInfoTooltip(tag.FullName, hudModel.GetLTRRelationshipString(Sim.ActiveActor.SimDescription, tag), tag.HomeWorld, HudModelEx.GetKnownInfo(hudModel as HudModel, tag)); tooltipPosition = (tooltipPosition - (mousePosition - parent.Position)) + new Vector2(-result.TooltipWindow.Area.Width, parent.Area.Height); return result; } } } } } } } catch (Exception e) { Common.Exception("CreateKnownInfoToolTip", e); } return null; }
private static Tooltip CreateSimTooltip(Vector2 mousePosition, WindowBase parent, ref Vector2 tooltipPosition) { try { if (Sims3.Gameplay.UI.Responder.Instance == null) return null; IHudModel hudModel = Sims3.Gameplay.UI.Responder.Instance.HudModel; if (hudModel == null) return null; SimInfo tag = parent.Tag as SimInfo; if (PortraitPanel.Settings.mShowKnownInfo) { SimDescription sim = PortraitPanel.Settings.GetSim(tag); if ((sim != null) && (Sim.ActiveActor != null)) { Tooltip result = new KnownInfoTooltip(sim.FullName, hudModel.GetLTRRelationshipString(Sim.ActiveActor.SimDescription, sim), sim.HomeWorld, HudModelEx.GetKnownInfo(hudModel as HudModel, sim)); tooltipPosition.x = parent.WindowToScreen(new Vector2(0,0)).x + parent.Area.Width; Window firstPortrait = Skewer.Instance.GetChildByID(0xf6fda571, true) as Window; tooltipPosition.y = firstPortrait.WindowToScreen(new Vector2(0, 0)).y - result.TooltipWindow.Area.Height; return result; } else { return null; } } float offsetX = -5f; float offsetY = -10f; if (GameUtils.IsInstalled(ProductVersion.EP9)) { int nerdLevel = -1; int rebelLevel = -1; int socialiteLevel = -1; hudModel.GetCurrentSimInfluence(tag, ref nerdLevel, ref rebelLevel, ref socialiteLevel); return InfluentialCelebrityTooltip.CreateTooltipWithOffset(parent, ref tooltipPosition, tag, nerdLevel, rebelLevel, socialiteLevel, offsetX, offsetY); } return CelebrityTooltip.CreateTooltipWithOffset(parent, ref tooltipPosition, tag, offsetX, offsetY); } catch (Exception e) { Common.Exception("CreateKnownInfoToolTip", e); } return null; }
private static Tooltip CreateKnownInfoToolTip(Vector2 mousePosition, WindowBase parent, ref Vector2 tooltipPosition) { try { if (Sim.ActiveActor == null) { return(null); } NotificationManager manager = NotificationManager.Instance; if (manager != null) { if ((manager.mNotifications[manager.mCurrentCategory].Count > manager.mCurrentNotification) && (manager.mCurrentNotification >= 0x0)) { StyledNotification notice = manager.mNotifications[manager.mCurrentCategory][manager.mCurrentNotification] as StyledNotification; if (notice != null) { if (notice.mNotificationWindow != null) { Sim sim = null; if (notice.mNotificationWindow.GetChildByID(0x5, true) == parent) { if (notice.mIDOne != ObjectGuid.InvalidObjectGuid) { sim = GameObject.GetObject <Sim>(notice.mIDOne); } } else { if (notice.mIDTwo != ObjectGuid.InvalidObjectGuid) { sim = GameObject.GetObject <Sim>(notice.mIDTwo); } } if (sim != null) { IMiniSimDescription tag = sim.SimDescription; if (tag != null) { IHudModel hudModel = Sims3.Gameplay.UI.Responder.Instance.HudModel; Tooltip result = new KnownInfoTooltip(tag.FullName, hudModel.GetLTRRelationshipString(Sim.ActiveActor.SimDescription, tag), tag.HomeWorld, HudModelEx.GetKnownInfo(hudModel as HudModel, tag)); tooltipPosition = (tooltipPosition - (mousePosition - parent.Position)) + new Vector2(-result.TooltipWindow.Area.Width, parent.Area.Height); return(result); } } } } } } } catch (Exception e) { Common.Exception("CreateKnownInfoToolTip", e); } return(null); }