Echo Hollow

Gender-Bending Interactive Stories! :D

User Tools

Site Tools


smutbook:classes:util:messagequeue

MessageQueue

A global message queue system to allow the story author to more easily hook into the Inventory and Apparel UIs and display various flavor texts and do other processing while a player is fooling around with Inventory and Apparel.

FIXME May change as we rejigger the UIs. Maybe ought to move from here to the Inventory UI classes.

MessageQueue.push( message )

If the queue is enabled, push a message into the top of the queue.

Returns: void

MessageQueue.unshift( message )

If the queue is enabled, push a message onto the bottom of the queue.

Returns: void

MessageQueue.shift()

If the queue is enabled, shift a message off the bottom of the queue.

Returns: the message being shifted off, or null if the queue is disabled.

MessageQueue.dump( separator="\n" )

Dump the whole queue as a string, using the given separator. Clear the queue.

Returns: the whole queue as a single string

MessageQueue.on( queue=[] )

If the queue is already enabled, to nothing. Otherwise enable the queue, filling it with the given array of strings.

Returns: void

MessageQueue.off()

Disable and clear the queue.

Returns: the contents of the queue before it was cleared.


smutbook/classes/util/messagequeue.txt · Last modified: by lee