Mercurial > wow > worldplan
comparison WorldPlan.lua @ 13:06c9a30d48da
WorldQuests:
- Filter interface controls reverted: Left-click to single out a category value, right-click to exclude. Hold shift to set multiple inclusion rules.
| author | Nenue |
|---|---|
| date | Mon, 24 Oct 2016 04:37:07 -0400 |
| parents | a2b623043970 |
| children | 54adb0d4938b |
comparison
equal
deleted
inserted
replaced
| 12:3396a1171081 | 13:06c9a30d48da |
|---|---|
| 199 local QuestsByReward = {} | 199 local QuestsByReward = {} |
| 200 local QuestsByTag = {} | 200 local QuestsByTag = {} |
| 201 local QuestsByID = {} | 201 local QuestsByID = {} |
| 202 local QuestPositions = {} | 202 local QuestPositions = {} |
| 203 local FilterInclusions = {rewardType = {}, worldQuestType = {}, factionID = {}} | 203 local FilterInclusions = {rewardType = {}, worldQuestType = {}, factionID = {}} |
| 204 local FilterExclusions = {rewardType = {}, worldQuestType = {}, factionID = {}} | |
| 205 local NotificationTypes = {} | 204 local NotificationTypes = {} |
| 206 local ZoneInfo = {} | 205 local ZoneInfo = {} |
| 207 local SummaryHeaders = {} | 206 local SummaryHeaders = {} |
| 208 | 207 |
| 209 local FreePins = {} | 208 local FreePins = {} |
| 710 tagAtlas = WORLD_QUEST_ICONS_BY_PROFESSION[id] | 709 tagAtlas = WORLD_QUEST_ICONS_BY_PROFESSION[id] |
| 711 end | 710 end |
| 712 elseif worldQuestType == LE_QUEST_TAG_TYPE_DUNGEON then | 711 elseif worldQuestType == LE_QUEST_TAG_TYPE_DUNGEON then |
| 713 tagAtlas = "worldquest-icon-dungeon" | 712 tagAtlas = "worldquest-icon-dungeon" |
| 714 end | 713 end |
| 714 | |
| 715 pin.tagID = tagID | 715 pin.tagID = tagID |
| 716 pin.tagName = tagName | 716 pin.tagName = tagName |
| 717 pin.worldQuestType = worldQuestType | 717 pin.worldQuestType = worldQuestType |
| 718 pin.isElite = isElite | 718 pin.isElite = isElite |
| 719 pin.tradeskillLineIndex = tradeskillLineIndex | 719 pin.tradeskillLineIndex = tradeskillLineIndex |
| 952 local rType = self.rewardType | 952 local rType = self.rewardType |
| 953 self.filtered = nil | 953 self.filtered = nil |
| 954 self.whiteListed = nil | 954 self.whiteListed = nil |
| 955 self.used = true | 955 self.used = true |
| 956 | 956 |
| 957 | |
| 958 local whiteListed, blackListed | 957 local whiteListed, blackListed |
| 959 for filterKey, includes in pairs(FilterInclusions) do | 958 for filterKey, includes in pairs(FilterInclusions) do |
| 960 local controlValue = self[filterKey] | 959 local controlValue = self[filterKey] |
| 961 if FilterInclusions[filterKey][controlValue] then | 960 if controlValue then |
| 962 self.filtered = nil | 961 if includes[controlValue] == nil then |
| 963 self.whiteListed = true | 962 includes[controlValue] = true |
| 964 break | 963 elseif includes[controlValue] == false then |
| 965 end | 964 self.filtered = true |
| 966 if FilterExclusions[filterKey][controlValue] then | 965 break |
| 967 self.filtered = true | 966 end |
| 968 end | 967 end |
| 969 end | 968 end |
| 970 | 969 |
| 971 if not TQ_IsActive(self.questID) then | 970 if not TQ_IsActive(self.questID) then |
| 972 self.used = nil | 971 self.used = nil |
| 1210 end | 1209 end |
| 1211 print('anchor to', self.relativeFrame:GetName()) | 1210 print('anchor to', self.relativeFrame:GetName()) |
| 1212 | 1211 |
| 1213 local r, g, b, a = 1,1,1,1 | 1212 local r, g, b, a = 1,1,1,1 |
| 1214 if self.filterKey then | 1213 if self.filterKey then |
| 1214 if FilterInclusions[self.filterKey][self.filterValue] == nil then | |
| 1215 FilterInclusions[self.filterKey][self.filterValue] = true | |
| 1216 end | |
| 1217 | |
| 1218 | |
| 1215 if FilterInclusions[self.filterKey][self.filterValue] == true then | 1219 if FilterInclusions[self.filterKey][self.filterValue] == true then |
| 1216 r, g, b = 0, 1, 0 | 1220 r, g, b = 0, 1, 0 |
| 1217 elseif FilterExclusions[self.filterKey][self.filterValue] then | 1221 elseif FilterInclusions[self.filterKey][self.filterValue] == false then |
| 1218 r, g, b = 1, 0, 0 | 1222 r, g, b = 1, 0, 0 |
| 1219 end | 1223 end |
| 1220 end | 1224 end |
| 1221 self.iconBorder:SetVertexColor(r, g, b, a) | 1225 self.iconBorder:SetVertexColor(r, g, b, a) |
| 1222 self:UpdateSize() | 1226 self:UpdateSize() |
| 1246 local filterKey = self.filterKey | 1250 local filterKey = self.filterKey |
| 1247 local filterValue = self.filterValue | 1251 local filterValue = self.filterValue |
| 1248 | 1252 |
| 1249 | 1253 |
| 1250 local operation = opPrefix | 1254 local operation = opPrefix |
| 1251 local setExclude = (button == 'RightButton') | 1255 local setInclude = (button == 'LeftButton') |
| 1252 local filterTable = setExclude and FilterExclusions or FilterInclusions | |
| 1253 local opposingTable = setExclude and FilterInclusions or FilterExclusions | |
| 1254 | 1256 |
| 1255 | 1257 |
| 1256 if not filterKey then | 1258 if not filterKey then |
| 1257 -- resetting | 1259 -- resetting |
| 1258 for k,v in pairs(FilterInclusions) do | 1260 for k,v in pairs(FilterInclusions) do |
| 1259 wipe(v) | 1261 wipe(v) |
| 1260 end | 1262 end |
| 1261 for k,v in pairs(FilterExclusions) do | |
| 1262 wipe(v) | |
| 1263 end | |
| 1264 else | 1263 else |
| 1265 | 1264 FilterInclusions[filterKey][filterValue] = setInclude |
| 1266 if filterTable[filterKey][filterValue] then | 1265 if (not IsShiftKeyDown()) then |
| 1267 filterTable[filterKey][filterValue] = nil | 1266 for k, info in ipairs(WorldPlan.FilterOptions) do |
| 1268 else | |
| 1269 filterTable[filterKey][filterValue] = true | |
| 1270 opposingTable[filterKey][filterValue] = nil | |
| 1271 end | |
| 1272 | |
| 1273 local overrideFilters = IsControlKeyDown() | |
| 1274 local overrideOpposing = IsShiftKeyDown() | |
| 1275 | |
| 1276 for k, info in ipairs(POI_FILTER_OPTIONS) do | |
| 1277 if (info.filterKey == filterKey) and (info.filterValue ~= filterValue) then | 1267 if (info.filterKey == filterKey) and (info.filterValue ~= filterValue) then |
| 1278 if overrideFilters then | 1268 FilterInclusions[info.filterKey][info.filterValue] = (not setInclude) |
| 1279 filterTable[info.filterKey][info.filterValue] = nil | |
| 1280 opposingTable[info.filterKey][info.filterValue] = true | |
| 1281 elseif overrideOpposing then | |
| 1282 filterTable[info.filterKey][info.filterValue] = nil | |
| 1283 opposingTable[info.filterKey][info.filterValue] = nil | |
| 1284 end | |
| 1285 end | 1269 end |
| 1286 end | 1270 end |
| 1287 | 1271 end |
| 1288 | 1272 end |
| 1289 end | |
| 1290 | |
| 1291 print('|cFF00FF88Filter Update:', filterKey, filterValue, operation) | 1273 print('|cFF00FF88Filter Update:', filterKey, filterValue, operation) |
| 1292 | |
| 1293 WorldPlan:RefreshAll() | 1274 WorldPlan:RefreshAll() |
| 1294 end | 1275 end |
| 1295 | 1276 |
| 1296 --%debug% | 1277 --%debug% |
| 1297 local SetTimedCallbackForAllPins = function(seconds, callback) | 1278 local SetTimedCallbackForAllPins = function(seconds, callback) |
