PDA

View Full Version : Formatting text sent to the ChatManager



MadBeardMan
April 12th, 2017, 00:06
Greetings,

Can anyone advise me on how to format 'formatted text' that get's sent to the ChatManager.

For example;

Rather than seeing '<b>Exploit List:</b>'

I see 'Exploit:' in bold and then the text that follows is listed.

This is for the WOiN ruleset that I've been working on for far to long, now's the time to start to tidy the bits up.

Cheers
Colin/MadBeardMan.

Moon Wizard
April 12th, 2017, 00:52
There is no formatting in the chat window. You can specify a sender, icon, font, etc. for each chat message. You may want to do it outside of ChatManager, and use Comm API directly; depending on what you are doing.
https://www.fantasygrounds.com/refdoc/Comm.xcp

Cheers,
JPG

MadBeardMan
April 12th, 2017, 00:55
Cheers as usual chap, so what's the best way to convert the following:

<p><b><i>Fast. </i></b>Felans are fast and nimble, adding 2 to their SPEED.</p>
<p><b><i>Jumper. </i></b>Felans are adept at jumping, adding 5' to both horizontal and vertical jump distances.</p>
<p><b><i>Land on your feet. </i></b>When falling, a Felan reduces the effective distance by 10'.</p>
<p><b><i>Claws. </i></b>Accurately slashing with their sharp claws, Felans do 2d6 unarmed damage.</p>

To human readable text, even plain text, ie no bold/italic?

I could export a simpler string version and iterate through a string split with comma's I suppose, as you don't need the exploit descriptions.

Cheers

Moon Wizard
April 12th, 2017, 03:27
I would only dump that much text to the chat window if you really need to. It generally just floods the chat window, and no one reads it anyways. They really only need a confirmation that something was added or used.

Generally, for spells/abilities, I just output the name when the user clicks the cast/use button, then the user can double-click on the name to output the full power text, if needed. If you're adding to a PC sheet, again I would only output the name.

When outputting power text when the user double clicks, I have usually just done: "<power_name>: <one line power desc>" for each power as a separate message. If you really wanted to output everything to the chat window, I would probably do that with each power.

Regards,
JPG

MadBeardMan
April 12th, 2017, 22:59
Hi Chap,

It's for when linking a Race to a character, showing in the Chat Window, but it's ok redone it.

Cheers