12.07.2015 Views

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 13 ■ Responding to Game Events 259endif max < #sortTbl thenBagBuddy.next:Enable()elseBagBuddy.next:Disable()end-- Update the status textif #sortTbl > 24 thenlocal max = math.min(max, #sortTbl)local msg = string.<strong>for</strong>mat(“Showing items %d - %d <strong>of</strong> %d“, min, imax, #sortTbl)BagBuddy.status:SetText(msg)elseBagBuddy.status:SetText(“Found “ .. #sortTbl .. “ items“)endendfunction BagBuddy Button OnEnter(self, motion)if self.link thenGameTooltip:SetOwner(self, “ANCHOR TOPRIGHT“)GameTooltip:SetHyperlink(self.link)GameTooltip:Show()endendfunction BagBuddy Button OnLeave(self, motion)GameTooltip:Hide()endfunction BagBuddy Filter OnEnter(self, motion)GameTooltip:SetOwner(self, “ANCHOR TOPRIGHT“)GameTooltip:SetText( G[“ITEM QUALITY“ .. self.quality .. “ DESC“])GameTooltip:Show()endfunction BagBuddy Filter OnLeave(self, motion)GameTooltip:Hide()endfunction BagBuddy Filter OnClick(self, button)BagBuddy.qualityFilter = false<strong>for</strong> idx = 0, 5 dolocal button = BagBuddy.filters[idx]if button:GetChecked() thenBagBuddy.qualityFilter = trueendendBagBuddy.page = 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!