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
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