Mercurial > wow > buffalo2
comparison Modules/ArtifactPower.lua @ 123:b3c0258b419d v7.3.0-1
ArtifactPower:
- XP progress bar fixes
Currency:
- More argus stuff
- Block dimensions are calculated more consistently
TalkingHead
- Aesthetic changes
- Default right-click behaviour restored (hides the text box)
author | Nenue |
---|---|
date | Tue, 05 Sep 2017 02:56:33 -0400 |
parents | ea2c616a3b4f |
children | 3f4794dca91b |
comparison
equal
deleted
inserted
replaced
122:ea2c616a3b4f | 123:b3c0258b419d |
---|---|
30 autoHide = true, | 30 autoHide = true, |
31 } | 31 } |
32 local Module = VeneerArtifactPowerMixin | 32 local Module = VeneerArtifactPowerMixin |
33 local BAGS_TO_SCAN = {BACKPACK_CONTAINER} | 33 local BAGS_TO_SCAN = {BACKPACK_CONTAINER} |
34 local TOOLTIP_NAME = 'VeneerAPScanner' | 34 local TOOLTIP_NAME = 'VeneerAPScanner' |
35 local XP_INSET = 1 | |
36 local XP_WIDTH = 4 | |
35 local FISHING_MAX_TRAITS = 24 | 37 local FISHING_MAX_TRAITS = 24 |
36 local WEAPON_MAX_TRAITS = 92 | 38 local WEAPON_MAX_TRAITS = 92 |
37 local FRAME_PADDING = 4 | 39 local FRAME_PADDING = 4 |
38 local EQUIPPED_SIZE = 64 | 40 local EQUIPPED_SIZE = 64 |
39 local BUTTON_SIZE = 48 | 41 local BUTTON_SIZE = 48 |
967 -- total total of invested and inventory XP | 969 -- total total of invested and inventory XP |
968 -- totalCost total of costs between current and actual level | 970 -- totalCost total of costs between current and actual level |
969 local actualXP = artifact.currentXP | 971 local actualXP = artifact.currentXP |
970 local actualLevel = artifact.level | 972 local actualLevel = artifact.level |
971 local actualCost = C_ArtifactUI.GetCostForPointAtRank(actualLevel, artifact.tier) | 973 local actualCost = C_ArtifactUI.GetCostForPointAtRank(actualLevel, artifact.tier) |
972 local totalXP = actualXP | |
973 local totalCost = actualCost | |
974 local totalLevel = actualLevel | |
975 | 974 |
976 print('tier:', artifact.tier) | 975 print('tier:', artifact.tier) |
977 print('current:', self.level, self.currentXP, '/', self.currentCost) | 976 print('current:', self.level, self.currentXP, '/', self.currentCost) |
978 while actualXP >= actualCost do | 977 while actualXP >= actualCost do |
979 actualXP = actualXP - actualCost | 978 actualXP = actualXP - actualCost |
983 print('* ', actualLevel, actualXP, actualCost, totalCost) | 982 print('* ', actualLevel, actualXP, actualCost, totalCost) |
984 end | 983 end |
985 print('actual:', actualLevel, actualXP, '/', actualCost) | 984 print('actual:', actualLevel, actualXP, '/', actualCost) |
986 | 985 |
987 | 986 |
988 local remaining = totalXP + unusedXP | 987 local totalXP = actualXP + unusedXP |
988 local totalCost = actualCost | |
989 local totalLevel = actualLevel | |
990 | |
991 local remaining = totalXP | |
989 local nextCost = artifact.currentCost | 992 local nextCost = artifact.currentCost |
993 print(totalXP, totalCost) | |
990 if remaining > nextCost then | 994 if remaining > nextCost then |
991 totalCost = nextCost | |
992 while remaining >= nextCost do | 995 while remaining >= nextCost do |
993 totalLevel = totalLevel + 1 | 996 totalLevel = totalLevel + 1 |
994 remaining = remaining - nextCost | 997 remaining = remaining - nextCost |
995 nextCost = C_ArtifactUI.GetCostForPointAtRank(totalLevel, artifact.tier) | 998 nextCost = C_ArtifactUI.GetCostForPointAtRank(totalLevel, artifact.tier) |
996 print('|cFFFFFF00+ ', totalLevel, remaining, '/', totalCost) | 999 print('|cFFFFFF00+ ', totalLevel, remaining, '/', totalCost) |
1034 -- current: amount shown in blizz ui | 1037 -- current: amount shown in blizz ui |
1035 -- actual: amount contributing the next level, will be same until current point cap is reached | 1038 -- actual: amount contributing the next level, will be same until current point cap is reached |
1036 -- potential: total of ap on hand | 1039 -- potential: total of ap on hand |
1037 print(self.currentXP, self.actualXP, self.potentialXP) | 1040 print(self.currentXP, self.actualXP, self.potentialXP) |
1038 | 1041 |
1039 local maxHeight = self:GetHeight() - 8 | 1042 local maxHeight = self:GetHeight() - (XP_INSET*2) |
1040 local currentHeight = self.CurrentProgress:GetHeight() or 1 | 1043 local currentHeight = self.CurrentProgress:GetHeight() or 1 |
1041 local offHeight = self.AdjustedProgress:GetHeight() or 1 | 1044 local offHeight = self.AdjustedProgress:GetHeight() or 1 |
1042 | 1045 |
1043 | 1046 |
1047 self.CurrentProgress:SetPoint('BOTTOM', self, 'BOTTOM', 0, XP_INSET) | |
1044 local currentProgress = (self.currentXP < self.currentCost) and (self.currentXP / self.currentCost) or 1 | 1048 local currentProgress = (self.currentXP < self.currentCost) and (self.currentXP / self.currentCost) or 1 |
1045 local projectedProgress = (self.totalXP < self.totalCost) and (self.totalXP / self.totalCost) or 1 | 1049 local projectedProgress = (self.totalXP < self.totalCost) and (self.totalXP / self.totalCost) or 1 |
1046 if self.actualLevel ~= self.level then | 1050 if self.actualLevel ~= self.level then |
1047 r3, g3, b3 = 0, 1, 1 | 1051 r3, g3, b3 = 0, 1, 1 |
1048 end | 1052 end |
1049 | 1053 |
1050 print('|cFFFF4400', currentProgress) | 1054 print('|cFFFF4400', currentProgress, projectedProgress, self.currentLevel, self.totalLevel) |
1051 if self.level <= WEAPON_MAX_TRAITS then | 1055 if self.level <= WEAPON_MAX_TRAITS then |
1052 self.CurrentProgress.animateFrom = currentHeight or 1 | 1056 self.CurrentProgress.animateFrom = currentHeight or 1 |
1053 self.CurrentProgress.animateTo = currentProgress * maxHeight | 1057 self.CurrentProgress.animateTo = currentProgress * maxHeight |
1054 self.CurrentProgress:Show() | 1058 self.CurrentProgress:Show() |
1055 self.ProgressLine:Show() | |
1056 else | 1059 else |
1057 self.CurrentProgress:Hide() | 1060 self.CurrentProgress:Hide() |
1058 self.ProgressLine:Hide() | 1061 end |
1059 end | 1062 |
1060 | 1063 local nextLevel = (self.totalLevel ~= self.currentLevel) |
1061 if self.totalXP ~= self.currentXP then | 1064 |
1062 print('|cFF00FFFF', projectedProgress) | 1065 if self.totalXP ~= self.currentXP or nextLevel then |
1063 if (projectedProgress > currentProgress) then | 1066 print('project', 'xp test=', (self.totalXP ~= self.currentXP), 'lvl test=', (self.totalLevel ~= self.currentLevel)) |
1064 self.AdjustedProgress:SetPoint('BOTTOM', self.CurrentProgress, 'TOP') | 1067 |
1065 projectedProgress = projectedProgress - currentProgress | 1068 local projectedPos = projectedProgress |
1066 print('show projected above', currentProgress, projectedProgress) | 1069 |
1070 if projectedProgress > currentProgress and (not nextLevel) then | |
1071 projectedPos = (projectedProgress - currentProgress) | |
1072 self.AdjustedProgress:SetPoint('BOTTOM', self.CurrentProgress, 'TOP', 0, 0) | |
1073 print(' set above', projectedPos, self.CurrentProgress:GetPoint(3)) | |
1067 else | 1074 else |
1068 self.CurrentProgress:Hide() | 1075 self.AdjustedProgress:SetPoint('BOTTOM', self, 'BOTTOM', 0 , XP_INSET) |
1069 self.ProgressLine:Hide() | 1076 print(' set under', projectedPos) |
1070 self.AdjustedProgress:SetPoint('BOTTOM', self, 'BOTTOM', 0 , 4) | 1077 end |
1071 print('show projected at bottom', currentProgress, projectedProgress) | |
1072 end | |
1073 | |
1074 self.AdjustedProgress.animateFrom = self.AdjustedProgress:GetHeight() or 1 | 1078 self.AdjustedProgress.animateFrom = self.AdjustedProgress:GetHeight() or 1 |
1075 self.AdjustedProgress.animateTo = projectedProgress * self:GetHeight() | 1079 self.AdjustedProgress.animateTo = projectedPos * maxHeight |
1076 self.AdjustedLine:Show() | |
1077 self.AdjustedProgress:Show() | 1080 self.AdjustedProgress:Show() |
1078 else | 1081 else |
1079 self.CurrentProgress:SetPoint('BOTTOM', self, 'BOTTOM', 0, 4) | 1082 print('nothing to project') |
1080 self.AdjustedProgress:Hide() | 1083 self.AdjustedProgress:Hide() |
1081 self.AdjustedLine:Hide() | 1084 end |
1082 end | 1085 |
1086 | |
1083 --print(self.CurrentProgress:GetPoint(3)) | 1087 --print(self.CurrentProgress:GetPoint(3)) |
1084 --print(self.CurrentProgress:GetSize()) | 1088 --print(self.CurrentProgress:GetSize()) |
1085 | 1089 |
1090 self.XPBackground:SetPoint('BOTTOMLEFT', self, 'BOTTOMLEFT', XP_INSET, XP_INSET) | |
1091 self.XPBackground:SetPoint('TOPRIGHT', self, 'TOPLEFT', XP_INSET + XP_WIDTH, -XP_INSET) | |
1086 self.CurrentProgress:SetColorTexture(r3,g3,b3,1) | 1092 self.CurrentProgress:SetColorTexture(r3,g3,b3,1) |
1087 | 1093 |
1088 end | 1094 end |
1089 | 1095 |
1090 function Artifact:OnLoad() | 1096 function Artifact:OnLoad() |