Skip to content

Commit

Permalink
1.0.16-Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldpaw committed Jan 17, 2024
1 parent f08cf19 commit 4ba71a9
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 100 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. Be aware th
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.0.16-Release] 2024-01-17
- Updated for WoW Client Patch 10.2.5.

## [1.0.15-Release] 2023-12-01
### Changed
- Slightly optimized the parsing efficiency.
Expand Down
190 changes: 91 additions & 99 deletions TooltipCleaner/Core/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -382,73 +382,69 @@ ns.OnTooltipSetItem = function(self, tooltip, tooltipData)
local tipName = tooltip:GetName()
local foundLevel, foundSkill, foundDurability = false, false, false

-- Assign data to 'type' and 'guid' fields.
TooltipUtil.SurfaceArgs(tooltipData)
if (tooltipData) then

-- Assign data to 'leftText' fields.
for _,line in ipairs(tooltipData.lines) do
TooltipUtil.SurfaceArgs(line)
end
for i = #tooltipData.lines,1,-1 do
local line = tooltipData.lines[i]
local msg = line.leftText

for i = #tooltipData.lines,1,-1 do
local line = tooltipData.lines[i]
local msg = line.leftText
if (not msg) then break end

if (not msg) then break end
if (db.hideMetRequirements and not foundLevel) then

if (db.hideMetRequirements and not foundLevel) then

local level = string_match(msg, P[G.ITEM_MIN_LEVEL])
if (level) then
local playerLevel = UnitLevel("player")
if (playerLevel >= tonumber(level)) then
local tipText = _G[tipName.."TextLeft"..i]
tipText:SetText("")
tipText:Hide()
local level = string_match(msg, P[G.ITEM_MIN_LEVEL])
if (level) then
local playerLevel = UnitLevel("player")
if (playerLevel >= tonumber(level)) then
local tipText = _G[tipName.."TextLeft"..i]
tipText:SetText("")
tipText:Hide()
end
foundLevel = true
end
foundLevel = true
end

--local skill = string_match(msg, P[G.ITEM_MIN_SKILL])
--if (skill) then
-- _G[tipName.."TextLeft"..i]:SetText(nil)
-- _G[tipName.."TextRight"..i]:SetText(nil)
-- print("found skill level:", skill)
-- foundSkill = true
--end
--local skill = string_match(msg, P[G.ITEM_MIN_SKILL])
--if (skill) then
-- _G[tipName.."TextLeft"..i]:SetText(nil)
-- _G[tipName.."TextRight"..i]:SetText(nil)
-- print("found skill level:", skill)
-- foundSkill = true
--end

end
end

if (db.hideFullDurability and not foundDurability) then
local min,max = string_match(msg, P[G.DURABILITY_TEMPLATE])
if (min and max) then
if (min == max) then
local tipText = _G[tipName.."TextLeft"..i]
tipText:SetText("")
tipText:Hide()
if (db.hideFullDurability and not foundDurability) then
local min,max = string_match(msg, P[G.DURABILITY_TEMPLATE])
if (min and max) then
if (min == max) then
local tipText = _G[tipName.."TextLeft"..i]
tipText:SetText("")
tipText:Hide()
end
foundDurability = true
end
foundDurability = true
end
end

if (db.hideUnusedStats or db.hideMissingSetBonuses) then
local r, g, b = line.leftColor.r, line.leftColor.g, line.leftColor.b
if (r == g and g == b and r > 0.49 and r < 0.51) then
local tipText = _G[tipName.."TextLeft"..i]
if (db.hideUnusedStats and string_match(msg, "^%+?%-?%d+%s+%w+")) then
tipText:SetText("")
tipText:Hide()
end
if (db.hideMissingSetBonuses and string_match(msg, "^%(%d+%)%s+.+")) then
tipText:SetText("")
tipText:Hide()
if (db.hideUnusedStats or db.hideMissingSetBonuses) then
local r, g, b = line.leftColor.r, line.leftColor.g, line.leftColor.b
if (r == g and g == b and r > 0.49 and r < 0.51) then
local tipText = _G[tipName.."TextLeft"..i]
if (db.hideUnusedStats and string_match(msg, "^%+?%-?%d+%s+%w+")) then
tipText:SetText("")
tipText:Hide()
end
if (db.hideMissingSetBonuses and string_match(msg, "^%(%d+%)%s+.+")) then
tipText:SetText("")
tipText:Hide()
end
end
end
end

if (db.hideMetRequirements == foundLevel and db.hideFullDurability == foundDurability and not db.hideUnusedStats and not db.hideMissingSetBonuses) then
break
if (db.hideMetRequirements == foundLevel and db.hideFullDurability == foundDurability and not db.hideUnusedStats and not db.hideMissingSetBonuses) then
break
end
end

end

end
Expand Down Expand Up @@ -536,14 +532,6 @@ ns.OnTooltipSetUnit = function(self, tooltip, tooltipData)
local db = self:GetSettings().profile
local tipName = tooltip:GetName()

-- Assign data to 'type' and 'guid' fields.
TooltipUtil.SurfaceArgs(tooltipData)

-- Assign data to 'leftText' fields.
for _,line in ipairs(tooltipData.lines) do
TooltipUtil.SurfaceArgs(line)
end

if (db.hideGuild and UnitIsPlayer(unit) and GetGuildInfo(unit)) then
local line = _G[tipName.."TextLeft2"]
line:SetText("")
Expand All @@ -552,56 +540,60 @@ ns.OnTooltipSetUnit = function(self, tooltip, tooltipData)

local foundPvP, foundFaction, foundSpec = false, false, false

for i = #tooltipData.lines,2,-1 do
local line = tooltipData.lines[i]
local msg = line.leftText
if (tooltipData) then

if (not msg) then break end
for i = #tooltipData.lines,2,-1 do
local line = tooltipData.lines[i]
local msg = line.leftText

local processed
if (not msg) then break end

if (db.hidePvP and not foundPvP and not processed) then
if (msg == PVP) then
local tipText = _G[tipName.."TextLeft"..i]
tipText:SetText("")
tipText:Hide()
foundPvP = true
processed = true
local processed

if (db.hidePvP and not foundPvP and not processed) then
if (msg == PVP) then
local tipText = _G[tipName.."TextLeft"..i]
tipText:SetText("")
tipText:Hide()
foundPvP = true
processed = true
end
end
end

if (db.hideFaction and not foundFaction and not processed) then
if (msg == FACTION_ALLIANCE or msg == FACTION_HORDE or msg == FACTION_NEUTRAL) then
local tipText = _G[tipName.."TextLeft"..i]
tipText:SetText("")
tipText:Hide()
foundFaction = true
processed = true
if (db.hideFaction and not foundFaction and not processed) then
if (msg == FACTION_ALLIANCE or msg == FACTION_HORDE or msg == FACTION_NEUTRAL) then
local tipText = _G[tipName.."TextLeft"..i]
tipText:SetText("")
tipText:Hide()
foundFaction = true
processed = true
end
end
end

if (db.hideSpec and not foundSpec and not processed) then
if (string_match(msg, P[G.LEVEL_GAINED]))
or (string_match(msg, P[G.UNIT_TYPE_LETHAL_LEVEL_TEMPLATE]))
or (string_match(msg, P[G.UNIT_TYPE_LEVEL_FACTION_TEMPLATE]))
or (string_match(msg, P[G.UNIT_TYPE_LEVEL_TEMPLATE]))
or (string_match(msg, P[G.UNIT_TYPE_PLUS_LEVEL_TEMPLATE])) then
local tipText = _G[tipName.."TextLeft"..i]
tipText:SetText("")
tipText:Hide()
foundSpec = true
processed = true
if (db.hideSpec and not foundSpec and not processed) then
if (string_match(msg, P[G.LEVEL_GAINED]))
or (string_match(msg, P[G.UNIT_TYPE_LETHAL_LEVEL_TEMPLATE]))
or (string_match(msg, P[G.UNIT_TYPE_LEVEL_FACTION_TEMPLATE]))
or (string_match(msg, P[G.UNIT_TYPE_LEVEL_TEMPLATE]))
or (string_match(msg, P[G.UNIT_TYPE_PLUS_LEVEL_TEMPLATE])) then
local tipText = _G[tipName.."TextLeft"..i]
tipText:SetText("")
tipText:Hide()
foundSpec = true
processed = true

-- In retail spec and classification is on the line after level
local tipText = _G[tipName.."TextLeft"..(i + 1)]
tipText:SetText("")
tipText:Hide()
-- In retail spec and classification is on the line after level
local tipText = _G[tipName.."TextLeft"..(i + 1)]
tipText:SetText("")
tipText:Hide()
end
end
end

if (db.hidePvP == foundPvP and db.hideFaction == foundFaction and db.hideSpec == foundSpec) then
break
if (db.hidePvP == foundPvP and db.hideFaction == foundFaction and db.hideSpec == foundSpec) then
break
end
end

end

if (db.hideHealthBar) then
Expand Down
2 changes: 1 addition & 1 deletion TooltipCleaner/TooltipCleaner.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 100200
## Interface: 100205
## IconTexture: Interface\ICONS\Pet_Type_Mechanical

## Title: Cleaner: |cffffffffTooltip|r
Expand Down

0 comments on commit 4ba71a9

Please sign in to comment.