Mercurial > wow > devian
comparison Devian.lua @ 1:a13243a4118b
empty output detection
cleaning old code
author | Nenue |
---|---|
date | Thu, 17 Dec 2015 03:07:00 -0500 |
parents | 585221424a93 |
children | 77adceb8ebe4 |
comparison
equal
deleted
inserted
replaced
0:585221424a93 | 1:a13243a4118b |
---|---|
1 -- User: Krakyn | 1 -- User: Krakyn |
2 -- Created: 11/30/2015 7:46 AM | 2 -- Created: 11/30/2015 7:46 AM |
3 if not LibStub then | 3 if not LibStub then |
4 print('Something has happened...') | 4 print('Something has happened...') |
5 end | 5 end |
6 | |
7 Devian = LibStub("AceAddon-3.0"):NewAddon("Devian", "AceConsole-3.0", "AceEvent-3.0") | 6 Devian = LibStub("AceAddon-3.0"):NewAddon("Devian", "AceConsole-3.0", "AceEvent-3.0") |
8 local D = _G.Devian | 7 local D = _G.Devian |
9 | |
10 local db | 8 local db |
11 local msg = function(...) | |
12 D:Print(...) | |
13 end | |
14 local STATE_LOW, STATE_HIGH = 1, 2 | 9 local STATE_LOW, STATE_HIGH = 1, 2 |
15 local PLAYER_REALM = UnitName("player") .. '-' .. GetRealmName() | 10 local PLAYER_REALM = UnitName("player") .. '-' .. GetRealmName() |
16 local DEVIAN_FRAME = DevianDebugInfo | 11 local DEVIAN_FRAME = DevianDebugInfo |
17 | 12 |
18 local ScanAddOnList = function(args) | 13 local ScanAddOnList = function(args) |
139 D.debug_init = true | 134 D.debug_init = true |
140 end | 135 end |
141 | 136 |
142 local prefix_cache = {} | 137 local prefix_cache = {} |
143 local function Message(prefix, ...) | 138 local function Message(prefix, ...) |
144 | 139 if prefix == nil then |
140 oldprint('Tried to print nothing.') | |
141 return | |
142 end | |
145 -- colorize | 143 -- colorize |
146 if not prefix_cache[prefix] then | 144 if not prefix_cache[prefix] then |
147 local c = {0, 0, 0 } | 145 local c = {0, 0, 0 } |
148 local max = string.len(prefix) | 146 local max = string.len(prefix) |
149 for i = 1, max, 3 do | 147 for i = 1, max, 3 do |