PDA

View Full Version : Horizontal rule for chat window



Spyke
May 30th, 2008, 15:34
In my ruleset, I've added a slash command to display a horizontal rule to the chat window, which can be used for punctuating sections of an adventure, or signalling the start of the game.

The GM can type /hr into the chat window to display the footer_wide.png icon.

Add this function to chatmanager.lua:


function processHorizontalRule()

local msg = {};
msg.font = "systemfont";
msg.text = "";
msg.icon = "footer_wide";

if User.isHost() then
deliverMessage(msg);
msg.icon = "";
deliverMessage(msg);
end

end
and add this line to function onInit() in chatmanager.lua:


registerSlashHandler("/hr", processHorizontalRule);
The code relies on a graphic file given the resource name "footer_wide" in graphics.xml to be present (as per the supplied d20 ruleset).

Spyke

Foen
May 30th, 2008, 23:53
That's pretty neat! Simple and very effective *rubs hands in anticipation of stealing this new trick*

Oberoten
May 30th, 2008, 23:54
Excellent idea... Added this to my Arm-Set and made so it is useable by both players and GM.