Mercurial > wow > devian
comparison Devian.lua @ 45:5341e4d84622
Removed dock manager from the TOC for now
Parts of the config dialog in, needs finishing
| author | Nenue |
|---|---|
| date | Wed, 30 Dec 2015 07:05:38 -0500 |
| parents | e95cccfcfeb7 |
| children | dcc57a7cabc9 |
comparison
equal
deleted
inserted
replaced
| 44:8a3f42ccf920 | 45:5341e4d84622 |
|---|---|
| 4 -- @file-revision@ @file-hash@ | 4 -- @file-revision@ @file-hash@ |
| 5 if not LibStub then | 5 if not LibStub then |
| 6 print('Something has happened...') | 6 print('Something has happened...') |
| 7 end | 7 end |
| 8 Devian = LibStub("AceAddon-3.0"):NewAddon("Devian", "AceConsole-3.0", "AceEvent-3.0") | 8 Devian = LibStub("AceAddon-3.0"):NewAddon("Devian", "AceConsole-3.0", "AceEvent-3.0") |
| 9 Devian:SetDefaultModuleState(false) | |
| 9 local MAJOR, MINOR = 'Devian-1.3', 'r@project-revision@' | 10 local MAJOR, MINOR = 'Devian-1.3', 'r@project-revision@' |
| 10 local D = _G.Devian | 11 local D = _G.Devian |
| 11 local MSG_NEED_DEV_MODE = 'Must be in development mode to use this function.' | 12 local MSG_NEED_DEV_MODE = 'Must be in development mode to use this function.' |
| 12 local WORKSPACE_ON, WORKSPACE_OFF = 1, 2 | 13 local WORKSPACE_ON, WORKSPACE_OFF = 1, 2 |
| 13 local PLAYER_REALM = UnitName("player") .. '-' .. GetRealmName() | 14 local PLAYER_REALM = UnitName("player") .. '-' .. GetRealmName() |
| 15 local db | 16 local db |
| 16 local defaults = { | 17 local defaults = { |
| 17 ['global'] = {{}, {}}, | 18 ['global'] = {{}, {}}, |
| 18 ['tags'] = {}, | 19 ['tags'] = {}, |
| 19 ['channels'] = {[1] = {signature = 'Main', index = 1, x = 100, y = 800, height = 500, width = 600, enabled = true}}, | 20 ['channels'] = {[1] = {signature = 'Main', index = 1, x = 100, y = 800, height = 500, width = 600, enabled = true}}, |
| 21 ['profiles'] = { | |
| 22 {'Main', false}, | |
| 23 {'Devian', true}, | |
| 24 {'Turok', true}, | |
| 25 {'Bam', true} | |
| 26 }, | |
| 20 primary_channel = 1, -- the channel to which default output is sent | 27 primary_channel = 1, -- the channel to which default output is sent |
| 21 current_channel = 1, -- the front channel | 28 current_channel = 1, -- the front channel |
| 22 max_channel = 1, -- the highest created channel id | 29 max_channel = 1, -- the highest created channel id |
| 23 enable = true, -- allow enabled consoles to appear | 30 enable = true, -- allow enabled consoles to appear |
| 24 load_message = "Defaults loaded.", -- messages to be displayed after reload | 31 load_message = "Defaults loaded.", -- messages to be displayed after reload |
| 25 font = [[Interface\Addons\Devian\font\SourceCodePro-Regular.ttf]], -- font info | 32 font = [[Interface\Addons\Devian\font\SourceCodePro-Regular.ttf]], -- font info |
| 26 fontsize = 13, | 33 fontsize = 13, |
| 27 fontoutline = 'NONE', | 34 fontoutline = 'NONE', |
| 28 headergrad = {'VERTICAL', 0, 0, 0, 0.5, 0.1, 0.1, 0.1, 0.3}, -- header info | 35 |
| 36 headergrad = {'VERTICAL', 0, 0, 0, 1, | |
| 37 1, 0.1, 0.1, 1}, -- header info | |
| 29 headerdrop = {1,1,1,1}, | 38 headerdrop = {1,1,1,1}, |
| 39 headerblend = 'BLEND', | |
| 30 headeralpha = 1, | 40 headeralpha = 1, |
| 31 headerfontcolor = {1,0.2,0.2,1}, | 41 headerfontcolor = {1,1,1,1}, |
| 32 backdrop = {1,1,1,1}, -- background frame info | 42 |
| 33 backgrad = {'VERTICAL', 0.1, 0.1, 0.1, 0.3, 0, 0, 0, 0.5}, | 43 backdrop = {1,1,1,1}, -- background frame info |
| 44 backgrad = {'VERTICAL', 0.1, 0.1, 0.1, 1, 0, 0, 0, 1}, | |
| 34 backblend = 'MOD', | 45 backblend = 'MOD', |
| 35 backalpha = 0.7, | 46 backalpha = 1, |
| 36 backborder = {0,0,1,0.75}, | 47 backborder = {.5,.5,.5,1}, |
| 37 frontdrop = {1,1,1,1}, -- foreground frame info | 48 backheader = {.25,.25,.25,1}, |
| 38 frontgrad = {'VERTICAL', 0.1, 0.1, 0.1, 0.8, 0, 0, 0, 0.6}, | 49 |
| 50 frontdrop = {1,1,1,1}, -- foreground frame info | |
| 51 frontgrad = {'VERTICAL', 0.1, 0.1, 0.1, 1, 0, 0, 0, 1}, | |
| 39 frontblend = 'MOD', | 52 frontblend = 'MOD', |
| 40 frontalpha = 1, | 53 frontalpha = 1, |
| 41 frontborder = {1,0,0,1}, | 54 frontborder = {.07,.47,1,1}, |
| 55 frontheader = {1,1,1,1}, | |
| 42 tagcolor = {}, -- tag color repository | 56 tagcolor = {}, -- tag color repository |
| 43 workspace = 2, -- current profile | 57 workspace = 2, -- current profile |
| 44 last_workspace = 2 -- default workspace to alternate with when just "/dvn" is issued | 58 last_workspace = 2 -- default workspace to alternate with when just "/dvn" is issued |
| 45 } | 59 } |
| 46 | 60 |
| 253 -- The first argument describes the channel to output on, and the remaining arguments are concatenated in a manner similar to default print() | 267 -- The first argument describes the channel to output on, and the remaining arguments are concatenated in a manner similar to default print() |
| 254 -- This becomes the print handler when development mode is active. The original print() function is assigned to oldprint(). | 268 -- This becomes the print handler when development mode is active. The original print() function is assigned to oldprint(). |
| 255 -- @param Tag, signature, or numeric index of the channel to output on. Defaults to primary channel. | 269 -- @param Tag, signature, or numeric index of the channel to output on. Defaults to primary channel. |
| 256 -- @param ... Output contents. | 270 -- @param ... Output contents. |
| 257 local function Message(prefix, ...) | 271 local function Message(prefix, ...) |
| 258 if not db.enabled then | 272 if db.workspace == 1 then |
| 259 return D.oldprint(prefix, ...) | 273 return D.oldprint(prefix, ...) |
| 260 end | 274 end |
| 261 | 275 |
| 262 if prefix == nil then | 276 if prefix == nil then |
| 263 prefix = 1 | 277 prefix = 1 |
| 334 | 348 |
| 335 D:Print("|cFFFFFF00/resetdvn|r", "- Resets all but profile data SavedVariables.") | 349 D:Print("|cFFFFFF00/resetdvn|r", "- Resets all but profile data SavedVariables.") |
| 336 D:Print("|cFFFFFF00/cleandvn|r", "- Fully resets SavedVariables, profiles and all.") | 350 D:Print("|cFFFFFF00/cleandvn|r", "- Fully resets SavedVariables, profiles and all.") |
| 337 end | 351 end |
| 338 | 352 |
| 353 | |
| 354 | |
| 339 function D:OnEnable() | 355 function D:OnEnable() |
| 340 print(MAJOR, MINOR) | 356 print(MAJOR, MINOR) |
| 341 | 357 |
| 342 if db.unlisted and #db.unlisted > 0 then | 358 if db.unlisted and #db.unlisted > 0 then |
| 343 D:Print('New AddOns have been found since the last profile update: '.. table.concat(db.unlisted, ', ')) | 359 D:Print('New AddOns have been found since the last profile update: '.. table.concat(db.unlisted, ', ')) |
| 347 if db.workspace == 1 then | 363 if db.workspace == 1 then |
| 348 D:Print('Gameplay mode active (list #'..db.workspace..'). Print handling turned |cFFFFFF00OFF|r.') | 364 D:Print('Gameplay mode active (list #'..db.workspace..'). Print handling turned |cFFFFFF00OFF|r.') |
| 349 else | 365 else |
| 350 D:Print('Development mode active (list #'..db.workspace..'). Print handling |cFF00FF00ON|r.') | 366 D:Print('Development mode active (list #'..db.workspace..'). Print handling |cFF00FF00ON|r.') |
| 351 end | 367 end |
| 368 | |
| 369 self:RegisterChatCommand("dvg", function(input) | |
| 370 if not self.config then | |
| 371 self.config = DevCon | |
| 372 self:EnableModule("Config") | |
| 373 end | |
| 374 self.modules.Config:ChatCommand(input) | |
| 375 end) | |
| 352 | 376 |
| 353 end | 377 end |
| 354 | 378 |
| 355 function D:OnInitialize() | 379 function D:OnInitialize() |
| 356 -- commands | 380 -- commands |
