comparison Core.lua @ 76:958aba5f3297

Moved the group functions to the item data class. Added a new subgroup under the general config group called ?extra? which will provide features such as database character removal and perhaps guild selecting. Added a new custom .Print function to the addon object which takes two parameters: (string)text, (Color)color. The latter can be retrieved from the addon.Colors var (e.g. addon.Colors.Red). The ItemId parameter of the ItemData class constructor is now optional.
author Zerotorescue
date Sat, 25 Dec 2010 22:07:07 +0100
parents 8d11fc88ecab
children f885805da5d6
comparison
equal deleted inserted replaced
75:2127ab01ed4a 76:958aba5f3297
428 428
429 429
430 430
431 431
432 432
433 -- General
434
435 addon.Colors = {
436 Red = { 1, 0, 0 },
437 Green = { 0, 1, 0 },
438 }; -- easy to extend if more colors are needed
439 function addon:Print(text, color)
440 local red, green, blue;
441
442 if color then
443 red, green, blue = color[1], color[2], color[3];
444 end
445
446 DEFAULT_CHAT_FRAME:AddMessage(text or "", red, green, blue, nil, 5);
447 end
448
433 -- Debug 449 -- Debug
434 450
435 function addon:Debug(t) 451 function addon:Debug(t)
436 if not self.debugChannel and self.debugChannel ~= false then 452 if not self.debugChannel and self.debugChannel ~= false then
437 -- We want to check just once, so if you add a debug channel later just do a /reload (registering an event for this is wasted resources) 453 -- We want to check just once, so if you add a debug channel later just do a /reload (registering an event for this is wasted resources)