GM Notes Style Tag

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
Kasuko
Kobold
Posts: 1
Joined: Sat Dec 10, 2016 11:50 am

GM Notes Style Tag

Post by Kasuko »

Is it possible to specify CSS style in the GM Notes for a stamp on the object or hidden layer when viewed from the token layer?

E.g. I am trying to add nice box text to the notes from Lost Mines of Phandelver

I am setting the GM Notes to

Code: Select all

<style>
.box-text {
  background-color: #EEEEEE;
}
</style>

<p>Whether the characters follow Gundren's map or receive directions to Wave Echo Cave from another source, their initial approach leads them to a narrow tunnel whose entrance is hidden within the Sword Mountain foothills.</p>

<p class="box-text">The entrance tunnel leads into a large-cavern supported by a natural pillar of rock and containing three stalagmites. In the western part of the cave, behind the column ofrock, are three bedrolls and a heap of ordinary supplies-sacks of flour, bags of salt, casks of salted meat, lanterns, flasks of lamp oil, pickaxes, shovels, and other gear. Amid the supplies, you see the body of a dwarf miner, dead for at least a week. The northeastern section of the cavern has collapsed, forming a ten-foot-wide, twenty-foot-deep pit. A sturdy hemp rope is tied off around a nearby stalagmite and dangles down the side of the pit, at the bottom of which is a rough-hewn tunnel heading northwest and east.
</p>

<p>This was the campsite of the Rockseekers. The dead dwarf is Tharden, Gundren's brother, who was killed by the Black Spider. Gundren's other brother, Nundro, was here as well and is currently the Black Spider's prisoner in area 20. The dwarves' supplies are potentially useful, but not particularly valuable. </p>

<p><strong>Open Pit:</strong> Climbing up or down the wall of the pit without a rope requires a successful DC 15 Strength (Athletics) check. A character who fails the check by 5 or more falls and takes Id6 bludgeoning damage per 10 feet fallen, landing prone at the bottom. The tunnel at the bottom of the pit leads northwest toward area 2 and east toward area 3.</p>

<h3 class="">TREASURE</h3>
<p>Tharden wears a pair of boots of striding and springing. In his haste to explore the rest of Wave Echo Cave, Nezznar overlooked them.
</p>
However, I don't see the style, just the text from between the style show up in the note itself.

Am I doing this wrong, or are style tags not allowed? I know I can manually specify the style on the element itself but that's pretty annoying since I am not writing this by hand and I can get the style tags for free but if I want to do more than just the background color keeping track of all the CSS styles on the element will be very annoying, so I am hoping I am just doing something wrong.

Thanks
Kasuko

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: GM Notes Style Tag

Post by aliasmask »

Textboxes have no html or css, but if you were copy the text from the gmnotes to a dialog or frame, then the css should work.

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: GM Notes Style Tag

Post by JamzTheMan »

That's not true actually. I use HTML in my Notes/GM notes in my setup. I haven't used CSS though and that could be a limitation. But if you were to just specify <html> or <font> tags, they will work.

In fact, even the name can have HTML. I use <h2> tags and font=green for the name so, like <h2><font color=green>B4. Torture Chamber (CR5)</font></h2> works (as it also does in the notes.

I add number stamps to the hidden layer with all the room text and It makes for much easier readability on my screen. :)
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: GM Notes Style Tag

Post by aliasmask »

JamzTheMan wrote:That's not true actually. I use HTML in my Notes/GM notes in my setup. I haven't used CSS though and that could be a limitation. But if you were to just specify <html> or <font> tags, they will work.

In fact, even the name can have HTML. I use <h2> tags and font=green for the name so, like <h2><font color=green>B4. Torture Chamber (CR5)</font></h2> works (as it also does in the notes.

I add number stamps to the hidden layer with all the room text and It makes for much easier readability on my screen. :)
I think we may be talking about 2 different things. If I put <html><b>Hello</b></html> in the GM Notes or a token, it shows only the text of the html code. If I print the GM Notes to the chat, dialog or frame, then the html will show the bold Hello from the notes.

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: GM Notes Style Tag

Post by JamzTheMan »

Ok, if you "edit" the token, yes, you see the HTML/source code.

But, if you put said token on the Hidden layer, then hover over/click the stamp/object while on the token layer (what the user is trying to do) you get the text popup is in HTML.
HTML Source
Capture.JPG
Capture.JPG (61.51 KiB) Viewed 1951 times
Results
Capture2.JPG
Capture2.JPG (54.65 KiB) Viewed 1951 times

Note: You can place the style inline and it works. I think that's about the best you can get away with for now...

Code: Select all

<p style=" background-color: #EEEEEE;">The entrance tunnel leads into a large-cavern supported by a natural pillar of rock and containing three stalagmites. In the western part of the cave, behind the column ofrock, are three bedrolls and a heap of ordinary supplies-sacks of flour, bags of salt, casks of salted meat, lanterns, flasks of lamp oil, pickaxes, shovels, and other gear. Amid the supplies, you see the body of a dwarf miner, dead for at least a week. The northeastern section of the cavern has collapsed, forming a ten-foot-wide, twenty-foot-deep pit. A sturdy hemp rope is tied off around a nearby stalagmite and dangles down the side of the pit, at the bottom of which is a rough-hewn tunnel heading northwest and east.
</p>
FYI: I copy/paste all my text from PDF into the GM text and then run a macro to format/replace text to the HTML...

Code: Select all

<!-- Format PDF Text
Jamz: Currently based on the Emerald Spire module
-->
[h: heroLabToken = findToken("herolab")]
[h: levelLetter = getNotes(heroLabToken)]

[h: currentLocations="( " + levelLetter + "[0-9]+)( |\\.|,)"]

[h: pcNotesOrig = getNotes()]
[h: gmNotesOrig = getGMNotes()]
[h: output="Notes Updated:"]
[h: newLine="<br>    "]
 
[h: id = strfind(pcNotesOrig, "(^[A-Z][0-9]+\\. .*?(?=\\n))((\\n|.)*)")]
[h, IF(0<getFindCount(id)),CODE: {
  [h: newName=trim(getGroup(id, 1, 1))]
  [h: pcNotesOrig=trim(getGroup(id, 1, 2))]
  [h: setName(newName)]
  [h: output=output+"<br>Name: "+newName+", "]
}]

[h: pcNotes = replace(pcNotesOrig, "(?<=[^\\.])\\n", " ")]
[h: pcNotes = replace(pcNotes, "\\n", newLine)]
[h: pcNotes = replace(pcNotes, "(DC [0-9]+)", "<FONT COLOR=RED><b>\$1</b></FONT>")]
[h: pcNotes = '<HR><FONT COLOR=GREEN SIZE=5><I>    "' + pcNotes + '"</I></FONT><HR>']

[h: gmNotes = replace(gmNotesOrig, "(?<=[^\\.])\\n", " ")]
[h: gmNotes = replace(gmNotes, "\\n", newLine)]
[h: gmNotes = replace(gmNotes, "(Traps:|Trap:|Creatures:|Creature:|Development:)", "<b>\$1</b>")]
[h: gmNotes = replace(gmNotes, "(DC [0-9]+)", "<FONT COLOR=RED><b>\$1</b></FONT>")]
[h: gmNotes = replace(gmNotes, currentLocations, "<FONT COLOR=PURPLE><b>\$1</b></FONT> ")]
[h: gmNotes = replace(gmNotes, "(Treasure:)", "<FONT COLOR=BLUE><b>\$1</b></FONT>")]
[h: gmNotes = replace(gmNotes, "(Quest:)", "<FONT COLOR=MAROON><b>\$1</b></FONT>")]
[h: gmNotes = replace(gmNotes, "(Story Award:)", "<FONT COLOR=GREEN><b>\$1</b></FONT>")]
[h: gmNotes = "<FONT SIZE=4>    " + gmNotes + "</FONT>"]

[h: setNotes(pcNotes)]
[h: setGMNotes(gmNotes)]

[h: setLayer("HIDDEN")]

{output}
<br><br>
[r: strformat(pcNotes)]
[r: strformat(gmNotes)]
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: GM Notes Style Tag

Post by aliasmask »

Ah, yeah, you're right. I wasn't thinking about the popup.

User avatar
PinkRose
Dragon
Posts: 732
Joined: Sat Nov 15, 2008 2:28 pm
Location: The City of Roses, Oregon

Re: GM Notes Style Tag

Post by PinkRose »

I would love for this to work, Jamz.
But I get the error
Error executing "getNotes": the token name or id "" is unknown.

How do I proceed?
I am a special snowflake!

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: GM Notes Style Tag

Post by aliasmask »

You'll have to use the correct id for the token you want to get the notes from.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: GM Notes Style Tag

Post by Phergus »

PinkRose - You probably didn't set the macro to Apply To Selected.

Post Reply

Return to “MapTool”