Mercurial > wow > buffalo2
comparison Init.lua @ 44:756e8aeb040b
- Default.lua
- simplified the response to SuperTrackedQuestID changes
- tag icons work again
| author | Nenue |
|---|---|
| date | Mon, 25 Apr 2016 19:37:13 -0400 |
| parents | 1f8f9cc3d956 |
| children |
comparison
equal
deleted
inserted
replaced
| 43:9480bd904f4c | 44:756e8aeb040b |
|---|---|
| 408 for i, anchorButton in ipairs(display.anchor.anchorButton) do | 408 for i, anchorButton in ipairs(display.anchor.anchorButton) do |
| 409 anchorButton:Hide() | 409 anchorButton:Hide() |
| 410 end | 410 end |
| 411 | 411 |
| 412 end | 412 end |
| 413 print(B.Conf.ConfigMode) | 413 --print(B.Conf.ConfigMode) |
| 414 display.anchor:EnableMouse(B.Conf.ConfigMode) | 414 display.anchor:EnableMouse(B.Conf.ConfigMode) |
| 415 end | 415 end |
| 416 for id, region in pairs(layers) do | 416 for id, region in pairs(layers) do |
| 417 print(id, region:GetName(), func) | 417 --print(id, region:GetName(), func) |
| 418 region[func](region) | 418 region[func](region) |
| 419 end | 419 end |
| 420 | 420 |
| 421 print('['..func..'] updated', #layers, 'regions,', numAnchors, 'frames') | 421 --print('['..func..'] updated', #layers, 'regions,', numAnchors, 'frames') |
| 422 end | 422 end |
| 423 | 423 |
| 424 local XMLFrame_Enable = function(self, value) | 424 local XMLFrame_Enable = function(self, value) |
| 425 local name = self:GetName() | 425 local name = self:GetName() |
| 426 | 426 local print = B.print('XML') |
| 427 | 427 |
| 428 if not B.Conf[name] then | 428 if not B.Conf[name] then |
| 429 B.Conf[name] = { | 429 B.Conf[name] = { |
| 430 enabled = true | 430 enabled = true |
| 431 } | 431 } |
| 469 self:OnDisable() | 469 self:OnDisable() |
| 470 end | 470 end |
| 471 end | 471 end |
| 472 end | 472 end |
| 473 --- Generic handlers for keeping track of XML-defined frames | 473 --- Generic handlers for keeping track of XML-defined frames |
| 474 | 474 local print = B.print('XML') |
| 475 local XMLFrame_OnDragStart = function(self) | 475 local XMLFrame_OnDragStart = function(self) |
| 476 local print = B.print('XML') | |
| 476 self.xA = self:GetLeft() | 477 self.xA = self:GetLeft() |
| 477 self.yA = self:GetBottom() | 478 self.yA = self:GetBottom() |
| 478 self.anchorTo, self.relativeTo, self.relativePoint, self.x, self.y = self:GetPoint(1) | 479 self.anchorTo, self.relativeTo, self.relativePoint, self.x, self.y = self:GetPoint(1) |
| 479 print('acquire anchor', self:GetPoint(1)) | 480 print('acquire anchor', self:GetPoint(1)) |
| 480 print(self:GetName(), 'start moving ('..self.x..', '..self.y..')') | 481 print(self:GetName(), 'start moving ('..self.x..', '..self.y..')') |
| 481 self:StartMoving() | 482 self:StartMoving() |
| 482 end | 483 end |
| 483 | 484 |
| 484 local XMLFrame_OnDragStop = function(self) | 485 local XMLFrame_OnDragStop = function(self) |
| 486 local print = B.print('XML') | |
| 485 local name = self:GetName() | 487 local name = self:GetName() |
| 486 print(name, 'stop moving ('..self:GetLeft()..', '..self:GetBottom()..')') | 488 print(name, 'stop moving ('..self:GetLeft()..', '..self:GetBottom()..')') |
| 487 local xB = self:GetLeft() - self.xA | 489 local xB = self:GetLeft() - self.xA |
| 488 local yB = self:GetBottom() - self.yA | 490 local yB = self:GetBottom() - self.yA |
| 489 print('storing anchor point', self.anchorTo, self.relativePoint, self.x + xB, self.y + yB) | 491 print('storing anchor point', self.anchorTo, self.relativePoint, self.x + xB, self.y + yB) |
| 492 B.Conf[name].position = {self.anchorTo, self.relativePoint, self.x + xB, self.y + yB} | 494 B.Conf[name].position = {self.anchorTo, self.relativePoint, self.x + xB, self.y + yB} |
| 493 B.UpdateXMLFrame(self) | 495 B.UpdateXMLFrame(self) |
| 494 end | 496 end |
| 495 | 497 |
| 496 B.RegisterModuleFrame = function(self, moduleName) | 498 B.RegisterModuleFrame = function(self, moduleName) |
| 499 local print = B.print('XML') | |
| 497 tinsert(checkForConfig, self) | 500 tinsert(checkForConfig, self) |
| 498 self.Enable = XMLFrame_Enable | 501 self.Enable = XMLFrame_Enable |
| 499 self.moduleName = moduleName | 502 self.moduleName = moduleName |
| 500 print('|cFF00FF00XML stuff related to '.. tostring(moduleName) .. ':', name) | 503 print('|cFF00FF00XML stuff related to '.. tostring(moduleName) .. ':', self:GetName()) |
| 501 end | 504 end |
| 502 | 505 |
| 503 B.UpdateXMLFrame = function(self) | 506 B.UpdateXMLFrame = function(self) |
| 507 local print = B.print('XML') | |
| 504 | 508 |
| 505 local name = self:GetName() | 509 local name = self:GetName() |
| 506 | 510 |
| 507 | 511 |
| 508 if self.drag then | 512 if self.drag then |
| 509 self:RegisterForDrag('LeftButton') | 513 self:RegisterForDrag('LeftButton') |
| 510 self:SetScript('OnDragStart', XMLFrame_OnDragStart) | 514 self:SetScript('OnDragStart', XMLFrame_OnDragStart) |
| 511 if self.OnDragStop then | 515 if self.OnDragStop then |
| 512 self:SetScript('OnDragStop', function(self, ...) | 516 self:SetScript('OnDragStop', function(self, ...) |
| 517 print('|cFFFF0088end of dragging') | |
| 513 self:OnDragStop(self, ...) | 518 self:OnDragStop(self, ...) |
| 514 XMLFrame_OnDragStop(self, ...) | 519 XMLFrame_OnDragStop(self, ...) |
| 515 end) | 520 end) |
| 516 else | 521 else |
| 517 self:SetScript('OnDragStop', XMLFrame_OnDragStop) | 522 self:SetScript('OnDragStop', XMLFrame_OnDragStop) |
