WoWInterface SVN Critline

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 16 to Rev 17
    Reverse comparison

Rev 16 → Rev 17

changeLog.txt
1,3 → 1,12
4.0.1
- Records printed to the chat frame can now be shortened, and can once again include the previous record.
- Added Aerial Command Unit back to mob filter. Not eligible for aura tracking.
- Splash frame records can now be shortened when no previous record is included in the message.
- Do not try to load AceDBOptions since we're not using it.
- You can now specify the sound effect played on new records. (LibSharedMedia)
- Pet auto attack records are now displayed on the pet attack action tooltip.
- Added Hellscream's Warsong, Strength of Wrynn, Singed and Chemical Cloud to aura filters.
 
4.0.0
Core:
* Rewrote database to store spells by ID rather than name. This is more flexible and opens up a few possibilities.
core.lua
9,6 → 9,7
-- print(addon.module.method())
 
local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
local LSM = LibStub("LibSharedMedia-3.0")
local templates = Critline.templates
local playerClass = select(2, UnitClass("player"))
local debugging
239,6 → 240,9
local spellArrays = {dmg = {}, heal = {}, pet = {}}
 
 
LSM:Register("sound", "Level up", [[Sound\Interface\LevelUp.ogg]])
 
 
-- tooltip for level scanning
local tooltip = CreateFrame("GameTooltip", "CritlineTooltip", nil, "GameTooltipTemplate")
 
322,12 → 326,14
{
text = L["Play sound"],
tooltipText = L["Plays a sound on a new record."],
setting = "sound",
setting = "playSound",
func = function(self) options.sound:SetDisabled(not self:GetChecked()) end,
},
{
text = L["Screenshot"],
tooltipText = L["Saves a screenshot on a new record."],
setting = "screenshot",
gap = 48,
},
{
text = L["Shorten records"],
363,9 → 369,30
btn.module = Critline
local btns = checkButtons[btn.db]
btns[#btns + 1] = btn
options[v.setting] = btn
checkButtons[i] = btn
end
 
local function onClick(self)
self.owner:SetSelectedValue(self.value)
Critline.db.profile.sound = self.value
PlaySoundFile(LSM:Fetch("sound", self.value))
end
 
local sound = templates:CreateDropDownMenu("CritlineSoundEffect", config)
sound:SetFrameWidth(160)
sound:SetPoint("TOPLEFT", options.playSound, "BOTTOMLEFT", -15, -8)
sound.initialize = function(self)
for _, v in ipairs(LSM:List("sound")) do
local info = UIDropDownMenu_CreateInfo()
info.text = v
info.func = onClick
info.owner = self
UIDropDownMenu_AddButton(info)
end
end
options.sound = sound
 
-- summary sort dropdown
local menu = {
{
383,7 → 410,7
}
 
local sorting = templates:CreateDropDownMenu("CritlineTooltipSorting", config, menu)
sorting:SetFrameWidth(120)
sorting:SetFrameWidth(160)
sorting:SetPoint("TOPLEFT", checkButtons[#checkButtons], "BOTTOMLEFT", -15, -24)
sorting.label:SetText(L["Tooltip sorting:"])
sorting.onClick = function(self)
419,7 → 446,8
PvP = true,
ignoreVulnerability = true,
chatOutput = false,
sound = false,
playSound = true,
sound = "Level up",
screenshot = false,
shortFormat = false,
spellTooltips = false,
801,6 → 829,7
btn:LoadSetting()
end
 
options.sound:SetSelectedValue(self.db.profile.sound)
options.tooltipSort:SetSelectedValue(self.db.profile.tooltipSort)
end
 
850,8 → 879,8
self:Message(format(L["New %s%s record - %s"], critical and L["critical "] or "", self:GetFullSpellName(spellID, periodic, true), amount))
end
 
if self.db.profile.sound then
PlaySound("LEVELUP", 1, 1, 0, 1, 3)
if self.db.profile.playSound then
PlaySoundFile(LSM:Fetch("sound", self.db.profile.sound))
end
 
if self.db.profile.screenshot then
1182,7 → 1211,7
 
local function addLine(header, nonTick, tick)
if header then
GameTooltip:AddLine(L[header])
GameTooltip:AddLine(header)
end
Critline:AddTooltipLine(nonTick)
if tick and nonTick then
1219,25 → 1248,36
end
 
if dmg then
addLine((heal or pet) and "Damage", dmg1, dmg2)
addLine((heal or pet) and L["Damage"], dmg1, dmg2)
end
 
if heal then
if dmg then
GameTooltip:AddLine(" ")
end
addLine((dmg or pet) and "Healing", heal1, heal2)
addLine((dmg or pet) and L["Healing"], heal1, heal2)
end
 
if pet then
if dmg or heal then
GameTooltip:AddLine(" ")
end
addLine((dmg or heal) and "Pet", pet1, pet2)
addLine((dmg or heal) and L["Pet"], pet1, pet2)
end
end)
 
 
GameTooltip:HookScript("OnTooltipCleared", function(self)
self.Critline = nil
end)
 
hooksecurefunc(GameTooltip, "SetPetAction", function(self, action)
if not Critline.db.profile.spellTooltips then
return
end
 
if GetPetActionInfo(action) == "PET_ACTION_ATTACK" then
addLine(" ", funcset.pet(AUTOATK_ID, 1))
self:Show()
end
end)
\ No newline at end of file
filters.lua
66,6 → 66,8
[70867] = true, -- Essence of the Blood Queen (Blood Queen Lana'thel)
[70879] = true, -- Essence of the Blood Queen (Blood Queen Lana'thel, bitten by a player)
[72219] = true, -- Gastric Bloat (Festergut)
[73822] = true, -- Hellscream's Warsong (Icecrown Citadel)
[73828] = true, -- Strength of Wrynn (Icecrown Citadel)
[76133] = true, -- Tidal Surge (Neptulon)
[76155] = true, -- Tidal Surge (Neptulon)
[76159] = true, -- Pyrogenics (Sun-Touched Spriteling)
87,13 → 89,14
-- these are auras that increases the target's damage or healing received
local targetAuras = {
[64436] = true, -- Magnetic Core (Aerial Command Unit) ?
[65280] = true, -- Singed (Hodir)
[66758] = true, -- Staggered Daze (Icehowl) ?
[75664] = true, -- Shadow Gale (Erudax) ?
[75846] = true, -- Superheated Quicksilver Armor (Karsh Steelbender) ?
[76015] = true, -- Superheated Quicksilver Armor (Karsh Steelbender) ?
[76232] = true, -- Storm's Fury (Ragnaros - Mount Hyjal) ?
[77717] = true, -- Vertigo (Atramedes)
[80157] = true, -- Chemical Bomb (Toxitron) ?
[80164] = true, -- Chemical Cloud (Toxitron)
[87683] = true, -- Dragon's Vengeance (Halfus Wyrmbreaker)
[87904] = true, -- Feedback (Al'Akir)
[90933] = true, -- Ragezone (Defias Blood Wizard) ?