comparison UI.lua @ 89:b3ed963f482d v.2.1.92

- /dvc command needed a pre-defined enclosure to properly work through SlashCmdList - /dvn <profile name> and /dvn save <profile name> should resolve to and update the correct profile. - set some globals indicating the name and index of the workspace in use - DEVIAN_WORKSPACE (bool) - DEVIAN_PNAME (string) - DEVIAN_PID (number)
author Nenue
date Wed, 10 Aug 2016 06:58:27 -0400
parents 7ff0579e5a6e
children f6fae1a4c66c
comparison
equal deleted inserted replaced
88:7ff0579e5a6e 89:b3ed963f482d
455 result[i] = tostring(id) .. ' = ' .. (self.console[id].enabled and 'ON' or 'OFF') 455 result[i] = tostring(id) .. ' = ' .. (self.console[id].enabled and 'ON' or 'OFF')
456 end 456 end
457 self:Print('toggled: '..concat(result, ', ')) 457 self:Print('toggled: '..concat(result, ', '))
458 end 458 end
459 end 459 end
460
461 local frame_helper = CreateFrame('Frame', 'DevianFrameHelper', UIParent)
462 frame_helper.fill = frame_helper:CreateTexture(nil, 'BACKGROUND')
463 frame_helper.fill:SetColorTexture(1,0,0,1)
464 frame_helper.fill:SetAllPoints(frame_helper)
465 D.FrameHelper_Update = function(input, editbox)
466 local frame, func = D:GetArgs(input,2)
467
468 if type(frame) == 'string' then
469 if not _G[frame] then
470 return
471 end
472 frame = _G[frame]
473 elseif type(frame) == 'table' and frame.IsVisible then
474 local x, y = frame:GetCenter()
475 if not (x or y) then
476 frame_helper:ClearAllPoints()
477 frame_helper:SetPoint('CENTER')
478 end
479 else
480 local frame = EnumerateFrames(); -- Get the first frame
481 while frame do
482 if ( frame:IsVisible() and MouseIsOver(frame) ) then
483 print(frame:GetName() or string.format("[Unnamed Frame: %s]", tostring(frame)));
484 end
485 frame = EnumerateFrames(frame); -- Get the next frame
486 end
487 end
488
489 frame_helper:SetPoint('TOPLEFT', UIParent, 'BOTTOMLEFT', frameHandle:GetLeft(), frameHandle:GetTop())
490 frame_helper:SetPoint('BOTTOMRIGHT', UIParent, 'BOTTOMLEFT', frameHandle:GetRight(), frameHandle:GetBottom())
491
492 end
493
494
495 local frame_guide_init = function(self)
496 self.testU = self.testU or self:CreateTexture('TestU', 'OVERLAY', 'VnTestLine')
497 self.testB = self.testB or self:CreateTexture('TestB', 'OVERLAY', 'VnTestLine')
498 self.testL = self.testL or self:CreateTexture('TestL', 'OVERLAY', 'VnTestLine')
499 self.testR = self.testR or self:CreateTexture('TestR', 'OVERLAY', 'VnTestLine')
500 end
501 local frame_guide = function(self, target)
502 if not target then return end
503 if target:IsDragging() then return end
504 local thickness = 1
505 local midX, midY = target:GetCenter()
506 local width, height = target:GetWidth() * 1.5, target:GetHeight() * 1.5
507 --print('frame', target:GetLeft(), target:GetTop(), target:GetRight(), target:GetBottom())
508 self.testB:ClearAllPoints()
509 self.testB:SetPoint('TOP', UIParent, 'BOTTOMLEFT', midX, target:GetBottom())
510 self.testB:SetSize(width,thickness)
511
512 self.testU:ClearAllPoints()
513 self.testU:SetPoint('BOTTOM', UIParent, 'BOTTOMLEFT', midX, target:GetTop())
514 self.testU:SetSize(width,thickness)
515
516 self.testL:ClearAllPoints()
517 self.testL:SetPoint('RIGHT', UIParent, 'BOTTOMLEFT', target:GetLeft(), midY)
518 self.testL:SetSize(thickness,height)
519
520 self.testR:ClearAllPoints()
521 self.testR:SetPoint('LEFT', UIParent, 'BOTTOMLEFT', target:GetRight(), midY)
522 self.testR:SetSize(thickness,height)
523 end