Mercurial > wow > buffalo2
comparison ObjectiveTracker/ObjectiveFrame.lua @ 24:66b927b46776
Refine the XML data logic, and sort out some EnableMouse inconsistencies.
| author | Nenue |
|---|---|
| date | Mon, 11 Apr 2016 09:07:40 -0400 |
| parents | e837384ac363 |
| children | 4b3da1b221de |
comparison
equal
deleted
inserted
replaced
| 23:e837384ac363 | 24:66b927b46776 |
|---|---|
| 54 local tprint = B.print('Tracker') | 54 local tprint = B.print('Tracker') |
| 55 local lprint = B.print('Line') | 55 local lprint = B.print('Line') |
| 56 | 56 |
| 57 local currentPosition, anchorFrame, anchorPoint | 57 local currentPosition, anchorFrame, anchorPoint |
| 58 | 58 |
| 59 T.colors ={ | 59 |
| 60 default = { | |
| 61 titlebg = {'HORIZONTAL', 1, 0, .7, .25, 1, 0, .7, .125}, | |
| 62 textbg = {'HORIZONTAL', 0, 0, 0, 0.4, 0, 0, 0, 0 }, | |
| 63 selectionbg = {'HORIZONTAL', 1, 1, 1, 0, 1, 1, 1, 0.225}, | |
| 64 }, | |
| 65 daily = { | |
| 66 titlebg = {'HORIZONTAL', 0, .7, 1, .25, 0, 1, .7, .125}, | |
| 67 textbg = {'HORIZONTAL', 0, .7, 1, .1, 0, 1, .7, .075 }, | |
| 68 }, | |
| 69 weekly = { | |
| 70 titlebg = {'HORIZONTAL', 0, .35, .7, .25, 0, .35, .7, .125}, | |
| 71 textbg = {'HORIZONTAL', 0, .35, .7, .1, 0, .35, .7, .075 }, | |
| 72 }, | |
| 73 account = { | |
| 74 titlebg = {'HORIZONTAL', .1, .1, .1, .25, .1, .1, .1, .125}, | |
| 75 textbg = {'HORIZONTAL', .1, .1, .1, 0.4, .1, .1, .1, .085 }, | |
| 76 }, | |
| 77 -- alliance | |
| 78 faction_1 = { | |
| 79 titlebg = {'HORIZONTAL', .2, .4, 1, 0.4, .2, .4, 1, .085 }, | |
| 80 textbg = {'HORIZONTAL', .2, .4, 1, 0.4, .2, .4, 1, .085 }, | |
| 81 }, | |
| 82 -- horde | |
| 83 faction_2 = { | |
| 84 titlebg = {'HORIZONTAL', .6, 0, 0.4, 0.4, .6, 0, 0.4, .085 }, | |
| 85 textbg = {'HORIZONTAL', .6, 0, 0.4, 0.4, .6, 0, 0.4, .085 }, | |
| 86 } | |
| 87 } | |
| 88 | 60 |
| 89 T.AddBlock = function(handler, block) | 61 T.AddBlock = function(handler, block) |
| 90 local print = bprint | 62 local print = bprint |
| 91 end | 63 end |
| 92 | 64 |
| 176 | 148 |
| 177 block.title:SetSpacing(c.TitleSpacing) | 149 block.title:SetSpacing(c.TitleSpacing) |
| 178 block.title:SetPoint('TOP', block, 'TOP', 0, -titleSpacing) | 150 block.title:SetPoint('TOP', block, 'TOP', 0, -titleSpacing) |
| 179 | 151 |
| 180 block.titlebg:SetTexture(1,1,1,1) | 152 block.titlebg:SetTexture(1,1,1,1) |
| 181 block.titlebg:SetGradientAlpha(unpack(colors.default.titlebg)) | 153 block.titlebg:SetGradientAlpha(unpack(T.colors.default.titlebg)) |
| 182 block.titlebg:SetPoint('TOP', block, 'TOP', 0, 0) | 154 block.titlebg:SetPoint('TOP', block, 'TOP', 0, 0) |
| 183 block.titlebg:SetPoint('BOTTOM', block.title, 'BOTTOM', 0, -titleSpacing) | 155 block.titlebg:SetPoint('BOTTOM', block.title, 'BOTTOM', 0, -titleSpacing) |
| 184 | 156 |
| 185 block.status:SetSpacing(c.TextSpacing) | 157 block.status:SetSpacing(c.TextSpacing) |
| 186 block.status:SetPoint('TOP', block.titlebg, 'BOTTOM', 0, -textSpacing) | 158 block.status:SetPoint('TOP', block.titlebg, 'BOTTOM', 0, -textSpacing) |
| 187 block.status:SetPoint('LEFT', block.titlebg, 'LEFT', textIndent, 0) | 159 block.status:SetPoint('LEFT', block.titlebg, 'LEFT', textIndent, 0) |
| 188 | 160 |
| 189 block.statusbg:SetPoint('TOP', block.titlebg, 'BOTTOM', 0, 0) | 161 block.statusbg:SetPoint('TOP', block.titlebg, 'BOTTOM', 0, 0) |
| 190 block.statusbg:SetPoint('BOTTOM', block, 'BOTTOM', 0, 0) | 162 block.statusbg:SetPoint('BOTTOM', block, 'BOTTOM', 0, 0) |
| 191 block.statusbg:SetTexture(1,1,1,1) | 163 block.statusbg:SetTexture(1,1,1,1) |
| 192 block.statusbg:SetGradientAlpha(unpack(colors.default.textbg)) | 164 block.statusbg:SetGradientAlpha(unpack(T.colors.default.textbg)) |
| 193 | 165 |
| 194 block.SelectionOverlay:SetGradientAlpha(unpack(colors.default.selectionbg)) | 166 block.SelectionOverlay:SetGradientAlpha(unpack(T.colors.default.selectionbg)) |
| 195 block.SelectionOverlay:SetPoint('TOPLEFT', selectionIndent, 0) | 167 block.SelectionOverlay:SetPoint('TOPLEFT', selectionIndent, 0) |
| 196 block.SelectionOverlay:SetPoint('BOTTOMRIGHT') | 168 block.SelectionOverlay:SetPoint('BOTTOMRIGHT') |
| 197 | 169 |
| 198 block.icon:SetSize(rewardSize, rewardSize) | 170 block.icon:SetSize(rewardSize, rewardSize) |
| 199 block.icon:SetPoint('TOPRIGHT', block, 'TOPRIGHT', -2, -2) | 171 block.icon:SetPoint('TOPRIGHT', block, 'TOPRIGHT', -2, -2) |
| 749 Wrapper:Show() | 721 Wrapper:Show() |
| 750 Scroller:Show() | 722 Scroller:Show() |
| 751 Scroll:Show() | 723 Scroll:Show() |
| 752 end | 724 end |
| 753 Quest.GetClosest() | 725 Quest.GetClosest() |
| 754 | 726 --T.UpdateActionButtons(reason) |
| 755 end | 727 end |
| 756 | 728 |
| 757 --- Queue any active item buttons for update for that frame | 729 --- Queue any active item buttons for update for that frame |
| 730 local iprint = B.print('ItemButton') | |
| 758 T.UpdateActionButtons = function(updateReason) | 731 T.UpdateActionButtons = function(updateReason) |
| 732 local print = iprint | |
| 759 Scroller.snap_upper = 0 | 733 Scroller.snap_upper = 0 |
| 760 Scroller.snap_lower = 0 | 734 Scroller.snap_lower = 0 |
| 761 local print = B.print('ItemButton') | 735 local print = B.print('ItemButton') |
| 762 if updateReason then | 736 if updateReason then |
| 763 print = B.print('IB_'..updateReason) | 737 print = B.print('IB_'..updateReason) |
| 764 end | 738 end |
| 765 | 739 |
| 766 local previousItem | 740 local previousItem |
| 767 for questID, itemButton in pairs(usedButtons) do | 741 for questID, itemButton in pairs(Quest.itemButtons) do |
| 768 local info= T.Quest.Info[questID] | 742 local info= T.Quest.Info[questID] |
| 769 | 743 |
| 770 print('|cFF00FFFF'.. questID .. '|r', itemButton:GetName()) | 744 print('|cFF00FFFF'.. questID .. '|r', itemButton:GetName()) |
| 771 local block = T.Quest.QuestBlock[questID] | 745 local block = T.Quest.QuestBlock[questID] |
| 772 if block then | 746 if block then |
| 797 end | 771 end |
| 798 end | 772 end |
| 799 end | 773 end |
| 800 | 774 |
| 801 T.UpdateBlockAction = function (block, itemButton) | 775 T.UpdateBlockAction = function (block, itemButton) |
| 776 local print = iprint | |
| 802 print('**|cFF0088FF'..itemButton:GetName(), '|r:Update()') | 777 print('**|cFF0088FF'..itemButton:GetName(), '|r:Update()') |
| 803 if itemButton.questID ~= block.info.questID then | 778 if itemButton.questID ~= block.info.questID then |
| 804 print('** |cFFFF0088mismatched block assignment', itemButton.questID,'<~>', block.info.questID) | 779 print('** |cFFFF0088mismatched block assignment', itemButton.questID,'<~>', block.info.questID) |
| 805 -- something happened between this and last frame, go back and set new probes | 780 -- something happened between this and last frame, go back and set new probes |
| 806 return T.UpdateActionButtons() | 781 return T.UpdateActionButtons() |
