PDA

View Full Version : Hover and Custom Paragraph Types



Papi
April 11th, 2020, 15:22
Greetings Good aligned geniuses! I am trying to find a way to create a custom paragraph type in order to achieve the following:
I want to create a text type that when your mouse hovers over it, it displays additional information. This should work just like when you hover over a link in a map image, but instead of displaying the link title it shows user defined information. Kind of like a hypertext link on hover. The whole point to this is that I am running a pretty complex campaign setting with loads of different NPCs and locations and it would really help for me to have an easy reference in a STORY.

Is there any way to achieve this? My guess is that it should be pretty complex.
Can it be done via an extension? Can it? Can it?
What is the minimum INT score needed to do this? (mine is 8...)

I am giving to you a visual example of what I would like to accomplish in order for you to understand better:
33457

superteddy57
April 11th, 2020, 17:22
Good question. There is onHover (Frame) and setToolTipText options, both worth looking into to see if we can wrangle it to work. Not sure if we have implemented into a link or to get that ability. I like this idea and will investigate it for you.

Reference to the refdoc.
https://www.fantasygrounds.com/refdoc/windowcontrol.xcp#onHover
https://www.fantasygrounds.com/refdoc/windowcontrol.xcp#setTooltipText

The examples I've seen and known to use is placing links on line by itself, but not inline with the text itself.

Papi
April 12th, 2020, 10:49
This is excellent! Is there anything I could do to help out? Files to tinker with, crashes to cause?
(Pardon my delayed response, but I was running a Pathfinder game yesterday)

Maybe by utilising the class used in the following image?
33520
And instead of displaying the link title it showed the whole text of the entry. That seems like a good first step. Is this possible?
Would https://www.fantasygrounds.com/refdoc/textwidget.xcp#getText help?

Trenloe
April 12th, 2020, 11:50
You're not going to be able to do this within a formatted text control (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGU/pages/4096610/formattedtextcontrol) - which is the control Story entries (and others) use. Because there are very limited API functions available for that control - due to the underlying complexity of the code used to visually present the underlying marked up data.

You can do it within a string control (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGU/pages/4096719/stringcontrol) - as these inherit the textbasecontrol (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGU/pages/4096428/textbasecontrol)API which includes the getCursorPosition Interface that can be used to identify where the mouse cursor is and do various operations. This type of code is used in the 5E ruleset to highlight the different actions in an ability description, attack/damage entry, etc.. But, of course, this is just a plain text field - none of the nice formatting is available.

Papi
April 12th, 2020, 12:18
Are these classes available in FG Classic? (Still haven't got my hands on a unity version because I am an ultimate owner via Steam and I am waiting to buy it there so the 40% discount kicks in.)
Plain text would work just fine if there is at least a new line option...
Are these the ones you are referring to:

https://www.fantasygrounds.com/refdoc/stringcontrol.xcp
https://www.fantasygrounds.com/refdoc/windowcontrol.xcp

superteddy57
April 12th, 2020, 12:50
Well the issue I was running into was the inability to just select a word and basically turn it into a control that can then get a tooltip. I am going to at this time say it is something that I can't get accomplished with the tools we currently have. As I mentioned there is going to be a need for some backend help here that we won't have done till we finalize some projects with Unity. The idea is a great one and please use the link in my signature to make a note of it. So we can investigate it in the future.

Papi
April 12th, 2020, 13:30
No worries fellow cthulhian-octopus-enthusiast! Thank you for your time and effort and let me note that it is this community spirit that keeps me invested in fantasy grounds. Do you have any suggestion on how I should phrase it so that it becomes easily clear to other users?

Trenloe
April 12th, 2020, 13:41
Are these the ones you are referring to:

https://www.fantasygrounds.com/refdoc/stringcontrol.xcp
That one, and these:
https://www.fantasygrounds.com/refdoc/formattedtextcontrol.xcp
https://www.fantasygrounds.com/refdoc/textbasecontrol.xcp