Skip to content

Commit

Permalink
v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcraig committed Jul 16, 2019
1 parent 8e10008 commit e5582b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v2.0.0] - 2019-07-14
### Changed
- Use v2.0 of SniperTips library

## [v1.0.0]
### Changed
- Remove Ace3 dependency and move to optional.
Expand Down
14 changes: 4 additions & 10 deletions main.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local SniperTips_HunterPetFood = LibStub("AceAddon-3.0"):NewAddon('SniperTips_HunterPetFood');
local LibTooltip = LibStub("SniperTips-1.0");
local LibTooltip = LibStub("SniperTips-2.0");
local tipColour = { 0.6, 0.2, 0.2 }
SniperTips_HunterPetFood.kbDEBUG = true

Expand Down Expand Up @@ -69,19 +69,13 @@ function SniperTips_HunterPetFood:ItemIsFood(itemClassID, itemSubClassID, itemId
return false
end

function SniperTips_HunterPetFood:HandleItem(self, itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType,
itemSubType, itemStackCount, itemEquipLoc, itemIcon, itemSellPrice, itemClassID, itemSubClassID, bindType, expacID,
itemSetID, isCraftingReagent)

-- Get the item ID
local id = string.match(itemLink, "item:(%d*)")

function SniperTips_HunterPetFood:HandleItem(self, item)
-- Only load for the consumables item category
if (SniperTips_HunterPetFood:ItemIsFood(itemClassID, itemSubClassID, id) == false) then
if (SniperTips_HunterPetFood:ItemIsFood(item.classID, item.subClassID, item.id) == false) then
return -- void
end

local rating, ratingColour = SniperTips_HunterPetFood:GetFoodRating(id)
local rating, ratingColour = SniperTips_HunterPetFood:GetFoodRating(item.id)

if (rating ~= nil and ratingColour ~= nil) then
self:AddDoubleLine(
Expand Down

0 comments on commit e5582b6

Please sign in to comment.