Persistent content in frames (or dialogs)?

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Persistent content in frames (or dialogs)?

Post by Irrlicht »

Another discussion made me wonder if there is a way to keep the content in a frame and add more with further macros, thus basically creating a secondary chat window (except it would accept only macro output and not user's strings, unless one makes a macro for inputting text strings in a chatlike way too).

Mainly, I could use it as a personal chat only, though if the thing can be done, it could be shared among all users as well.
It'd be handy for keeping track od certain things without writing them somewhere else, such as rolls you send to chat but may need to look up later, when players have sent other messages/macros in the chat window, making it a pain to find what you need.

Basically, it'd be: I use macro A, which opens "Frame X" with a certain content. Then I use macro B, which outputs to the same frame (and normally would just overwrite the previous content of the frame), but it keeps the previous content and adds more output.
Can it be done?
If there was something like a getFrameContent() function, I suppose it could be done by getting that content and outputting it back with the new one attached immediately after (though I guess over time it'd get very heavy), but there seems to be nothing like that in the wiki.
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Persistent content in frames (or dialogs)?

Post by Jagged »

This would typically be done using a library token and by storing the data in the token. Probably in a JSON format.

So you would add data just by adding to the token property and just keep calling the function that displays the form.

User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Re: Persistent content in frames (or dialogs)?

Post by Irrlicht »

Ah, that's right.

But it'd quickly get very heavy (adding all the html and css, other than mere output without any formatting), am I correct?
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: Persistent content in frames (or dialogs)?

Post by aliasmask »

If you save it all as a string, then you can output it very easily and quickly. I did this for my spell library caching the frame output although it was derived from a page template with values being filled in. Basically, if the page wasn't visited before it would build the page and the delay would be noticeable, but when you went back to it then it was instantaneous.

One main problem with a chat output format using a frame would be page alignment. Meaning if you use top down for chat then you can't really force the view at the bottom of the text with a form. It will always display the top. So, if you reverse the chat order so new entries are on top then the rest is pushed down then it's totally doable.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Persistent content in frames (or dialogs)?

Post by Jagged »

Irrlicht wrote: But it'd quickly get very heavy (adding all the html and css, other than mere output without any formatting), am I correct?
It shouldn't need to. You encapsulate most of the stuff into little sub-macros and it works easily enough and can remain readable.

Post Reply

Return to “Macros”