# HG changeset patch # User Nenue # Date 1477298227 14400 # Node ID 06c9a30d48da598e015fc8920213686e97bcb10c # Parent 3396a117108189e3c460dee360a80ab78520f84c WorldQuests: - Filter interface controls reverted: Left-click to single out a category value, right-click to exclude. Hold shift to set multiple inclusion rules. diff -r 3396a1171081 -r 06c9a30d48da WorldPlan.lua --- a/WorldPlan.lua Sun Oct 23 17:22:21 2016 -0400 +++ b/WorldPlan.lua Mon Oct 24 04:37:07 2016 -0400 @@ -201,7 +201,6 @@ local QuestsByID = {} local QuestPositions = {} local FilterInclusions = {rewardType = {}, worldQuestType = {}, factionID = {}} -local FilterExclusions = {rewardType = {}, worldQuestType = {}, factionID = {}} local NotificationTypes = {} local ZoneInfo = {} local SummaryHeaders = {} @@ -712,6 +711,7 @@ elseif worldQuestType == LE_QUEST_TAG_TYPE_DUNGEON then tagAtlas = "worldquest-icon-dungeon" end + pin.tagID = tagID pin.tagName = tagName pin.worldQuestType = worldQuestType @@ -954,17 +954,16 @@ self.whiteListed = nil self.used = true - local whiteListed, blackListed for filterKey, includes in pairs(FilterInclusions) do local controlValue = self[filterKey] - if FilterInclusions[filterKey][controlValue] then - self.filtered = nil - self.whiteListed = true - break - end - if FilterExclusions[filterKey][controlValue] then - self.filtered = true + if controlValue then + if includes[controlValue] == nil then + includes[controlValue] = true + elseif includes[controlValue] == false then + self.filtered = true + break + end end end @@ -1212,9 +1211,14 @@ local r, g, b, a = 1,1,1,1 if self.filterKey then + if FilterInclusions[self.filterKey][self.filterValue] == nil then + FilterInclusions[self.filterKey][self.filterValue] = true + end + + if FilterInclusions[self.filterKey][self.filterValue] == true then r, g, b = 0, 1, 0 - elseif FilterExclusions[self.filterKey][self.filterValue] then + elseif FilterInclusions[self.filterKey][self.filterValue] == false then r, g, b = 1, 0, 0 end end @@ -1248,9 +1252,7 @@ local operation = opPrefix - local setExclude = (button == 'RightButton') - local filterTable = setExclude and FilterExclusions or FilterInclusions - local opposingTable = setExclude and FilterInclusions or FilterExclusions + local setInclude = (button == 'LeftButton') if not filterKey then @@ -1258,38 +1260,17 @@ for k,v in pairs(FilterInclusions) do wipe(v) end - for k,v in pairs(FilterExclusions) do - wipe(v) - end else - - if filterTable[filterKey][filterValue] then - filterTable[filterKey][filterValue] = nil - else - filterTable[filterKey][filterValue] = true - opposingTable[filterKey][filterValue] = nil - end - - local overrideFilters = IsControlKeyDown() - local overrideOpposing = IsShiftKeyDown() - - for k, info in ipairs(POI_FILTER_OPTIONS) do + FilterInclusions[filterKey][filterValue] = setInclude + if (not IsShiftKeyDown()) then + for k, info in ipairs(WorldPlan.FilterOptions) do if (info.filterKey == filterKey) and (info.filterValue ~= filterValue) then - if overrideFilters then - filterTable[info.filterKey][info.filterValue] = nil - opposingTable[info.filterKey][info.filterValue] = true - elseif overrideOpposing then - filterTable[info.filterKey][info.filterValue] = nil - opposingTable[info.filterKey][info.filterValue] = nil - end + FilterInclusions[info.filterKey][info.filterValue] = (not setInclude) end end - - + end end - print('|cFF00FF88Filter Update:', filterKey, filterValue, operation) - WorldPlan:RefreshAll() end