Mercurial > wow > devian
comparison Devian.lua @ 17:48a1d9c14af5
Commented out debug prints
author | Nenue |
---|---|
date | Sun, 20 Dec 2015 02:26:36 -0500 |
parents | 5254d1ba6013 |
children | 01c32c98e72a |
comparison
equal
deleted
inserted
replaced
16:dee6cef56415 | 17:48a1d9c14af5 |
---|---|
48 | 48 |
49 -- no args, toggle ui | 49 -- no args, toggle ui |
50 if mode == nil then | 50 if mode == nil then |
51 list_state = db.enabled and STATE_LOW or STATE_HIGH | 51 list_state = db.enabled and STATE_LOW or STATE_HIGH |
52 db.enabled = (db.enabled == false) and true or false | 52 db.enabled = (db.enabled == false) and true or false |
53 print(list_state, db.enabled) | 53 --print(list_state, db.enabled) |
54 | 54 |
55 if list_state == STATE_LOW then | 55 if list_state == STATE_LOW then |
56 end | 56 end |
57 elseif mode == 'stack' then | 57 elseif mode == 'stack' then |
58 return D:StackFrames() | 58 return D:StackFrames() |
77 end | 77 end |
78 return | 78 return |
79 elseif mode ~= nil then | 79 elseif mode ~= nil then |
80 mode = tonumber(mode) | 80 mode = tonumber(mode) |
81 if mode > 2 then | 81 if mode > 2 then |
82 print('Something has happened.') | 82 --print('Something has happened.') |
83 return | 83 return |
84 end | 84 end |
85 list_state = mode == STATE_LOW and STATE_LOW or STATE_HIGH | 85 list_state = mode == STATE_LOW and STATE_LOW or STATE_HIGH |
86 end | 86 end |
87 local char_list, global_list = db[PLAYER_REALM][list_state], db.global[list_state] | 87 local char_list, global_list = db[PLAYER_REALM][list_state], db.global[list_state] |
103 if char_list[name] == 2 and global_list[name] == 1 then | 103 if char_list[name] == 2 and global_list[name] == 1 then |
104 value = UnitName("player") | 104 value = UnitName("player") |
105 elseif global_list[name] == 2 then | 105 elseif global_list[name] == 2 then |
106 value = true | 106 value = true |
107 end | 107 end |
108 print('EnableAddOn(', i, ',', value,')') | 108 --print('EnableAddOn(', i, ',', value,')') |
109 EnableAddOn(i, value) | 109 EnableAddOn(i, value) |
110 else | 110 else |
111 local value = true | 111 local value = true |
112 if char_list[name] == 2 and global_list[name] == 1 then | 112 if char_list[name] == 2 and global_list[name] == 1 then |
113 value = UnitName("player") | 113 value = UnitName("player") |
114 end | 114 end |
115 print('DisableAddOn(', i, ',', value,')') | 115 --print('DisableAddOn(', i, ',', value,')') |
116 DisableAddOn(i,value) | 116 DisableAddOn(i,value) |
117 end | 117 end |
118 end | 118 end |
119 | 119 |
120 end | 120 end |
187 end | 187 end |
188 | 188 |
189 db.minimized = self.minimized and true or nil | 189 db.minimized = self.minimized and true or nil |
190 db.enabled = self:IsVisible() and true or nil | 190 db.enabled = self:IsVisible() and true or nil |
191 db.active = self.active and true or nil | 191 db.active = self.active and true or nil |
192 print('save:', db.signature, 'min=', db.minimized, ' enabled=', db.enabled, ' active = ', db.active, 'x=', db.x, 'y=', db.y, 'h=', db.height, 'w=', db.width) | 192 --print('save:', db.signature, 'min=', db.minimized, ' enabled=', db.enabled, ' active = ', db.active, 'x=', db.x, 'y=', db.y, 'h=', db.height, 'w=', db.width) |
193 self:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', db.x, db.y) | 193 self:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', db.x, db.y) |
194 self:SetWidth(db.width) | 194 self:SetWidth(db.width) |
195 end | 195 end |
196 | 196 |
197 -- Console frame toggler | 197 -- Console frame toggler |
266 | 266 |
267 if not vars then | 267 if not vars then |
268 vars = db.channels[i] | 268 vars = db.channels[i] |
269 end | 269 end |
270 | 270 |
271 print('make:', vars.signature, '(', vars.x, vars.y, ')', vars.width, 'x', vars.height) | 271 --print('make:', vars.signature, '(', vars.x, vars.y, ')', vars.width, 'x', vars.height) |
272 local f = CreateFrame('Frame', 'DevianChannelFrame' .. tostring(i), UIParent, DEVIAN_FRAME) | 272 local f = CreateFrame('Frame', 'DevianChannelFrame' .. tostring(i), UIParent, DEVIAN_FRAME) |
273 f:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', vars.x, vars.y) | 273 f:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', vars.x, vars.y) |
274 f:SetSize(vars.width, vars.height) | 274 f:SetSize(vars.width, vars.height) |
275 f:Lower() | 275 f:Lower() |
276 f.out:SetFont(db.font, db.fontsize, db.fontoutline) | 276 f.out:SetFont(db.font, db.fontsize, db.fontoutline) |
365 table.wipe(buffer) | 365 table.wipe(buffer) |
366 end | 366 end |
367 | 367 |
368 -- Spaces each frame evenly across the screen | 368 -- Spaces each frame evenly across the screen |
369 function D:DistributeFrames() -- | 369 function D:DistributeFrames() -- |
370 print('frame grid:', max, num_side) | 370 --print('frame grid:', max, num_side) |
371 local max = self.num_channels | 371 local max = self.num_channels |
372 local num_side = math.ceil(math.sqrt(max)) | 372 local num_side = math.ceil(math.sqrt(max)) |
373 local w = GetScreenWidth() / num_side | 373 local w = GetScreenWidth() / num_side |
374 local h = GetScreenHeight() / num_side | 374 local h = GetScreenHeight() / num_side |
375 for i, frame in pairs(D.console) do | 375 for i, frame in pairs(D.console) do |
376 local dx = (i-1) % num_side | 376 local dx = (i-1) % num_side |
377 local dy = math.floor((i-1) / num_side) | 377 local dy = math.floor((i-1) / num_side) |
378 | 378 |
379 print('move:', frame.signature, 'dx=', dx, 'dy=', dy) | 379 --print('move:', frame.signature, 'dx=', dx, 'dy=', dy) |
380 print('move:', frame.signature, ' x=', dx * w, 'y=', -(dy * h), 'h=', h, 'w=', w) | 380 --print('move:', frame.signature, ' x=', dx * w, 'y=', -(dy * h), 'h=', h, 'w=', w) |
381 frame.width = w | 381 frame.width = w |
382 frame.height = h | 382 frame.height = h |
383 frame.x = dx * w | 383 frame.x = dx * w |
384 frame.y = -(dy * h) | 384 frame.y = -(dy * h) |
385 frame:Save() | 385 frame:Save() |
407 -- Creates or updates a console frame | 407 -- Creates or updates a console frame |
408 -- @paramsig cinfo [, i] | 408 -- @paramsig cinfo [, i] |
409 -- @param cinfo an array from db.channels[x] or the desired string signature | 409 -- @param cinfo an array from db.channels[x] or the desired string signature |
410 -- @param id when set, the console at that index will be assigned all parameters in cinfo | 410 -- @param id when set, the console at that index will be assigned all parameters in cinfo |
411 function D:SetChannel(cinfo, i) | 411 function D:SetChannel(cinfo, i) |
412 print('join:', i , cinfo) | 412 --print('join:', i , cinfo) |
413 local t_info = {} | 413 local t_info = {} |
414 if type(cinfo) ~= 'table' then | 414 if type(cinfo) ~= 'table' then |
415 t_info.signature = tostring(cinfo) | 415 t_info.signature = tostring(cinfo) |
416 cinfo = {} | 416 cinfo = {} |
417 end | 417 end |
418 local srcdb = db.channels[self.primary_channel] | 418 local srcdb = db.channels[self.primary_channel] |
419 if i ~= nil then | 419 if i ~= nil then |
420 i = tonumber(i) | 420 i = tonumber(i) |
421 if db.channels[i] then | 421 if db.channels[i] then |
422 print('pull vars from '..db.channels[i].signature) | 422 --print('pull vars from '..db.channels[i].signature) |
423 cinfo = db.channels[i] | 423 cinfo = db.channels[i] |
424 srcdb = cinfo | 424 srcdb = cinfo |
425 end | 425 end |
426 end | 426 end |
427 | 427 |
428 for k,v in pairs(srcdb) do | 428 for k,v in pairs(srcdb) do |
429 if not t_info[k] then | 429 if not t_info[k] then |
430 if cinfo[k] then | 430 if cinfo[k] then |
431 print('- pulling', k..':',v) | 431 --print('- pulling', k..':',v) |
432 t_info[k] = cinfo[k] | 432 t_info[k] = cinfo[k] |
433 end | 433 end |
434 end | 434 end |
435 end | 435 end |
436 | 436 |