FeedTillers very simply tells you the Tiller (Sho, Old Hillpaw, etc), their favourite dish for the daily quests A Dish For ..., and if you have fed them today. It plugs into any Broker display, and is so basic, there are no options!

Come look at the pretty picture!! :banana:

If you know other languages, please help with your Curse user name and password via the localization app.

There is more information on the project page, and can be downloaded on WoWInterface and Curse.

Phanx

12-09-12 11:02 PM

Quote:

Originally Posted by myrroddin
(Post 270439)

If you know other languages, please help with your Curse user name and password via the localization app.

I'm pretty sure I'm not supposed to give you my Curse user name and password. ;)

That said, I did give you a Spanish translation for the description. I didn't translate the addon name, as names are generally not translated.

myrroddin

12-10-12 03:21 AM

Silliness aside, I don't want your user name and password, only that people use theirs to log in and translate LOL.

And I saw the Spanish translations, Phanx, and thank you. You could, in this case, translate the addon name because I only use it for display purposes, and "Feed Tillers" looks better than "FeedTillers".

myrroddin

12-10-12 10:12 PM

I have Release 1.0.2 up, which fixes the log in error; public version works, not just developer build. I fail at string-fu!

Also, the Tillers changed their display order to match the order of faction ID. Cosmetic, but if Blizzard ever changes the list of Tillers, this makes it easier to keep track in the code.

Phanx

12-14-12 12:35 AM

I made the mistake of looking at your code. :p

It's actually not that bad, but I rewrote it anyway. AceAddon seemed like overkill, so I removed it. I also removed all of the localization in the Lua file in favor of just pulling the translated name from the TOC via GetAddOnMetadata, and replaced all of the unnecessary upvalues with "GLOBALS: ..." comments which will keep FindGlobals from complaining, though personally I only use FindGlobals to check for set globals, not read ones.

I also moved to a table for storing NPC/item/quest IDs. Localized names are looked up on-demand and cached in the table. This allows easily sorting the display by any criteria, while retaining whatever order you find most convenient in the source code.

By default, all quests are shown, and tooltip lines are sorted by NPC name. Click the plugin to toggle between sorting by NPC name or item name. Shift-click to toggle between showing or hiding completed quests. You could easily save the sort and filter between sessions by changing the "currentSort" and "hideComplete" local variables to more distinctly-named global variables and listing them as SavedVariables in the TOC. I did not add any tooltip hints, since that would require localization, but it would be easy to add if you wanted.

I also aligned each column so my eyes can stop bleeding while looking at it, and highlighted each line green or red depending on quest completion status.

tooltip = qtip:Acquire("FeedTillersTT", 3, "LEFT", "LEFT", "RIGHT")
tooltip:AddHeader(TILLERS, ITEMS, COMPLETE)
for i = 1, #npcs do
local npc = npcs[i]
if not npc.item then
npc.item = GetItemInfo(npc.itemID)
end
if not IsQuestFlaggedCompleted(npc.questID) then
local line = tooltip:AddLine(npc.name, npc.item, NO)
tooltip:SetLineColor(line, 1, 0.1, 0.1, 0.3)
elseif not hideComplete then
local line = tooltip:AddLine(npc.name, npc.item, YES)
tooltip:SetLineColor(line, 0.1, 1, 0.1, 0.3)
end
end
tooltip:SmartAnchorTo(self)
tooltip:Show()
end,
OnLeave = function(self)
if qtip:IsAcquired("FeedTillersTT") then
qtip:Release(tooltip)
end
tooltip = nil
end
})

myrroddin

12-14-12 05:42 AM

Good thing the dailies just reset. Bad thing is I need sleep. But I'll give it a whirl. If my tired eyes are reading correctly, I can reduce the pkgmeta and toc to just LibStub, LibDataBroker-1.1, and FeedTillers.lua.

And sorry for making you curious enough to look at my code :eek::o

Phanx

12-14-12 06:36 AM

Well, you also need LibQTip, though I suppose you could actually do away with that, since you could just do two columns with "<npc> / <item>" for incomplete quests and "<npc> / Complete" for complete ones:

Code:

OnTooltipShow = function(tooltip)
if not TILLERS then
TILLERS = GetFactionInfoByID(1272)
for i = 1, #npcs do
local npc = npcs[i]
npc.name = GetFactionInfoByID(npc.factionID)
end
sort(npcs, sortByName)
end

tooltip:AddDoubleLine(TILLERS, ITEMS)
for i = 1, #npcs do
local npc = npcs[i]
if not npc.item then
npc.item = GetItemInfo(npc.itemID)
end
if not IsQuestFlaggedCompleted(npc.questID) then
tooltip:AddDoubleLine(npc.name, npc.item, 1, 0.8, 0.8, 1, 0.8, 0.8)
elseif not hideComplete then
tooltip:AddDoubleLine(npc.name, COMPLETE, 0.6, 0.8, 0.6, 0.6, 0.8, 0.6)
end
end
tooltip:Show()
end

myrroddin

12-14-12 03:37 PM

Quote:

Originally Posted by Phanx
(Post 270674)

Well, you also need LibQTip

I just forgot to mention it. But either case, it will have to wait until later tonight until I can poke at it. Work beckons. I will try both and see which I prefer.

myrroddin

12-15-12 08:16 AM

I just uploaded an alpha to the WoWAce project site, using Phanx's first version, because it looks the most similar to what I had visually. Therefore, no end user shock, or very little.

It might be good of me to cave in and add saved variables to maintain the sort through logging sessions, and put in a mouse over script to indicate that things can be sorted. That can come later.

myrroddin

12-17-12 01:29 AM

1 Attachment(s)

Saved variables are in, which save the column sort by name or item, and holding <shift> + click to hide completed Tillers. Also added is localization for the tooltip help. But it looks terrible, and I have tried a few variants of formatting. Any suggestions on how to adjust the placement of the hints, starting line 97, is welcome.

On a side note, there are now four strings that need localizing, up from two. Still a tiny addon.

in pink: item counts instead of just "No" for not-yet-completed quests, with quests that are ready to turn in no longer highlighted in red,

in green: auto-switching back to showing completed quests once all quests have been completed (you might want to use a second variable for this so as not to mess with the saved variable, or just take it out).