Tooltips for roll expansion

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
User avatar
Mr. Pokeylope
Giant
Posts: 118
Joined: Mon Aug 11, 2008 9:24 pm

Tooltips for roll expansion

Post by Mr. Pokeylope »

My group and I have been wanting a way to keep macro output concise while still being able to see detailed roll breakdowns. To that end, I added tooltip support to the message frame and added a new syntax for rolls. (I submitted a patch to Trevor a few days ago but haven't heard back; I assume he's still getting his donkey kicked by real life.)

In addition to using [ ] and { } for rolls, I added [[ ]]. When you use the new syntax, the expansion only shows the output, just like when using { } (except it's colored blue). However, when you mouseover that value, it'll display a tooltip showing the complete expansion of the roll like what [ ] would output. You can also display arbitrary tooltips: <span title="foo">bar</span> will display the text "bar" and, when you hover over it, a tooltip showing "foo".

So, hopefully people will find this useful. If you've got any feedback, think the syntax sucks, whatever, please let me know.

User avatar
kat2cute
Dragon
Posts: 297
Joined: Wed Jan 30, 2008 3:46 pm

Post by kat2cute »

Can't wait to try it. Hope it makes b41. That means I'll have to change all my macros, but I can deal with that. The arbitrary tooltips part is a bit confusing though. Would you type [[<span title="foo">bar</span>]] to get bar (with float over foo), cause normally you wouldn't enclose that sort of thing. There might be an issue with getting useless things in the float-over command area, like it telling you the color when you could care less. I don't think I'd ever use the <span title=> method, but maybe other people would? There is really no reason to use it for hidden calculations now that HTML commenting is more popular <!--roll=[1d20]-->. Would HTML comments be floatable also?
Quote from an underwater D&D fight:
Alright fighter, it's your turn. What do you do?
Fighter: What do you think I do? I FAIL MY F**KING SWIM CHECK

User avatar
Mr. Pokeylope
Giant
Posts: 118
Joined: Mon Aug 11, 2008 9:24 pm

Post by Mr. Pokeylope »

The <span title="whatever"> is seperate from the [[ ]] syntax (and behind the scenes, the latter is implemented using the former). So just typing

Code: Select all

<span title="This is a tooltip!">Some text here</span>
will give you the text with tooltip, while typing

Code: Select all

[[d20 + StrBonus]]
will give you, say, the text "14", and when you hover over it you'll get a tooltip displaying "d20 + StrBonus = 11 + 3".

You wouldn't be able to use this to display the contents of HTML comments, since they're removed from the output completely. Although you could use it as an alternative to comments, like:

Code: Select all

<span title="[roll = d20]">*</span>
i.e. display some small amount of text that had a tooltip showing the hidden calculations.

User avatar
UntoldGlory
Great Wyrm
Posts: 1649
Joined: Sun Mar 16, 2008 8:12 pm

Post by UntoldGlory »

OMG I LOVE YOU!!!!
Pleeeeaaaaaaaaaaaaaassssssseeeeeee put it in 41 trevor?!?! Totally worth a macro rewrite, even to the weird new syntax! (not the double brackets, but b39 weird syntax, the double brackets makes perfect sense).

User avatar
Mrugnak
Dragon
Posts: 745
Joined: Mon Jul 21, 2008 7:38 pm

Post by Mrugnak »

I would also like to declare this "Sex on toast". Possibly even "with marmalade".

Want.

User avatar
trevor
Codeum Arcanum (RPTools Founder)
Posts: 11311
Joined: Mon Jan 09, 2006 4:16 pm
Location: Austin, Tx
Contact:

Post by trevor »

Spiffy ! I was trying to figure out a decent way to get that content in there, I wouldn't have guessed it would be that easy :)

Patch received (in fact I've received two to do this). I'll get it in for b41
Dreaming of a 1.3 release

User avatar
UntoldGlory
Great Wyrm
Posts: 1649
Joined: Sun Mar 16, 2008 8:12 pm

Post by UntoldGlory »

H E DOUBLE HOCKEYSTICKS YEAH!!!

User avatar
Brigand
Read-only User
Posts: 1623
Joined: Thu Feb 14, 2008 8:57 am
Location: Nosy GM's can go frak themselves!

Post by Brigand »

Why not just make the { } braces do the tooltip expanded roll? I don't see a need to add a third syntax for this.

User avatar
Naryt
Dragon
Posts: 517
Joined: Fri Oct 26, 2007 8:55 am
Location: Near a tree, in a cave, under a rock.

Post by Naryt »

Aria wrote:Why not just make the { } braces do the tooltip expanded roll? I don't see a need to add a third syntax for this.
Agreed.
A wandering lost soul

User avatar
Mr. Pokeylope
Giant
Posts: 118
Joined: Mon Aug 11, 2008 9:24 pm

Post by Mr. Pokeylope »

I did initially just modify { }, but there are circumstances in which you don't want the full expansion (sometimes it's just not necessary, sometimes you don't want the expression to be visible—for example, DMs may want to display results without exposing all of an NPC's modifiers). Also, by creating new syntax for this, we maintain backwards compatibility; any existing macros will continue to work as they do now without modification.

User avatar
AidyBaby
Dragon
Posts: 383
Joined: Tue Feb 07, 2006 12:55 pm
Contact:

Post by AidyBaby »

Aria wrote:Why not just make the { } braces do the tooltip expanded roll? I don't see a need to add a third syntax for this.
Makes perfect sense. I'd vote for this!
D&D qualities are related inversely to those of Poker... and I love both.
http://www.yorkpoker.co.uk

User avatar
Hawke
Great Wyrm
Posts: 2261
Joined: Sat Apr 21, 2007 12:12 am
Location: Albuquerque, NM

Post by Hawke »

Mr. Pokeylope wrote:I did initially just modify { }, but there are circumstances in which you don't want the full expansion (sometimes it's just not necessary, sometimes you don't want the expression to be visible—for example, DMs may want to display results without exposing all of an NPC's modifiers). Also, by creating new syntax for this, we maintain backwards compatibility; any existing macros will continue to work as they do now without modification.
I would say that more often than not you'd want the expansion. . . why not make { } for the tooltop and {{}} for the roll w/o the tooltip?

User avatar
Naryt
Dragon
Posts: 517
Joined: Fri Oct 26, 2007 8:55 am
Location: Near a tree, in a cave, under a rock.

Post by Naryt »

Mr. Pokeylope wrote:I did initially just modify { }, but there are circumstances in which you don't want the full expansion (sometimes it's just not necessary, sometimes you don't want the expression to be visible—for example, DMs may want to display results without exposing all of an NPC's modifiers). Also, by creating new syntax for this, we maintain backwards compatibility; any existing macros will continue to work as they do now without modification.
In cases where I don't want full expansion available, I'd just use the current <!-- [finalroll=blah] -->{finalroll} method.
A wandering lost soul

User avatar
Brigand
Read-only User
Posts: 1623
Joined: Thu Feb 14, 2008 8:57 am
Location: Nosy GM's can go frak themselves!

Post by Brigand »

How about { } = Tooltip, for use by players and GM's and [[ ]] is for GM's who don't want to expose the npc's stats?
Also, by creating new syntax for this, we maintain backwards compatibility; any existing macros will continue to work as they do now without modification.
Actually, making { } show the tooltip would be better for backwards compatibility, because this would mean all the macro's currently being used by players, would not have to be changed. Players are the ones who really need the tooltip, so that the GM can be sure the player isn't cheating.

User avatar
UntoldGlory
Great Wyrm
Posts: 1649
Joined: Sun Mar 16, 2008 8:12 pm

Post by UntoldGlory »

I'm happy either way. But it does make sense to me to have {} be the default with tooltip, and either {{}} or [[]] be the no-tooltip variety.

Again, pleased as peach pie and pumpernickle to have it at all!

Post Reply

Return to “MapTool”