Custom Tooltips

Talk nerdy to us here.
Post Reply
Slamyy
Reactions:
Posts: 9
Joined: February 23rd, 2020, 5:11 pm

Custom Tooltips

Post by Slamyy » February 23rd, 2020, 5:50 pm

Hi, I'm trying to create custom sim tooltips to make them show extra info. Opened a topic on MTS here: http://modthesims.info/showthread.php?t=637968
I have been informed that Chain_Reaction has had endeavours in this regard so I'm wondering if I can get a little help :)

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7617
Joined: December 30th, 2011, 6:00 pm
Answers: 82
Contact:

Custom Tooltips

Post by Chain_Reaction » February 26th, 2020, 8:11 am

Hi,

Tagger currently allows you to add extra text to Sim tooltips. "Modify Custom Titles" is the feature on each Sim. This was a sorta an aside feature as the primary display was meant for the Sims map tag. On their tooltip it is sometimes finicky and prone to vanishing. I never got around to looking into why this is but it's likely due to the the SimInfo being regenerated. There may be an event to hook into to resolve that. I just replace the Sims name in the SimInfo with the appended text. The code is here (SetCustomTitles). You won't be able to replace the tooltip without a core mod. I ended up writing my own system to add custom tooltips to doors. It's a hacky method that hooks into the hover mouseevents, running on the simulator so it doesn't work with the game paused. There may be a more elegant solution but after a lot of trial and error it worked so I went with it. That is here. Hope those help.

Slamyy
Reactions:
Posts: 9
Joined: February 23rd, 2020, 5:11 pm

Custom Tooltips

Post by Slamyy » February 28th, 2020, 12:04 am

Thanks for all the info!
First I tried to change the name in SimInfo for all sims and failed :) Maybe I should try that on a smaller scope first. But I have a question about that. Does changing that name affect other places than tooltips?
Then I decided to examine your TooltipHelper in VS (added NRaasTagger.dll as reference too). It shows one error here:

Code: Select all

public static void HideCurrentTooltip()
        {
            if (sLastObjectId == sTipObject && sLastObjectId != 0)
            {
                RestartAlarm();
            }

            if (sCurrentTip != null)
            {
                sCurrentTip.TooltipWindow.Visible = false;
                // because...EA
                sCurrentTip.TooltipWindow.ShadeColor = new Color(sCurrentTip.TooltipWindow.ShadeColor.ARGB & 0xffffff);
                Simulator.AddObject(new TooltipManager.DisposeTooltipTask(sCurrentTip));
                KillAlarm();
                sCurrentTip = null;
                sTipObject = 0L;
            }
        }
Says that DisposeTooltipTask is inaccessable. It's an internal constructor.

Slamyy
Reactions:
Posts: 9
Joined: February 23rd, 2020, 5:11 pm

Custom Tooltips

Post by Slamyy » February 29th, 2020, 2:51 pm

Oh, I guess u used unprotected dll's.

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7617
Joined: December 30th, 2011, 6:00 pm
Answers: 82
Contact:

Custom Tooltips

Post by Chain_Reaction » February 29th, 2020, 7:33 pm

Slamyy wrote:
February 28th, 2020, 12:04 am
Does changing that name affect other places than tooltips?
I don't believe so.
Slamyy wrote:
February 29th, 2020, 2:51 pm
Oh, I guess u used unprotected dll's.
Yes, you need to when modding.

Post Reply