Add coordinates for non-Halfhill locations #2


  • Started
  • Fixed
  • Enhancment
Closed
Assigned to sygon_paul
  • bsmorgan created this issue Dec 16, 2012

    What is the enhancement in mind? How should it look and feel?

    Add location coordinates for NPCs when they are not in Halfhill. See the modified section of code below.

    Please provide any additional information below.

    	local FT_Tooltip = qtip:Acquire("FeedTillersTT", 4, "CENTER", "CENTER", "CENTER", "CENTER")
    	FeedTillers.tooltip = FT_Tooltip
    	completed_quests = GetQuestsCompleted(Tillers_Quests)
    	FT_Tooltip:AddHeader(GetFactionInfoByID(1272), " ", ITEMS, COMPLETE)
    	FT_Tooltip:AddLine(GetFactionInfoByID(1273), " ", GetItemInfo(74643), completed_quests[30439] == true and YES or NO) -- Jogu the Drunk
    	FT_Tooltip:AddLine(GetFactionInfoByID(1275), "31.0, 58.0", GetItemInfo(74651), completed_quests[30386] == true and YES or NO) -- Ella
    	FT_Tooltip:AddLine(GetFactionInfoByID(1276), "31.0, 53.1", GetItemInfo(74649), completed_quests[30396] == true and YES or NO) -- Old Hillpaw
    	FT_Tooltip:AddLine(GetFactionInfoByID(1277), "34.4, 46.7", GetItemInfo(74647), completed_quests[30402] == true and YES or NO) -- Chee Chee
    	FT_Tooltip:AddLine(GetFactionInfoByID(1278), "29.6, 30.6", GetItemInfo(74645), completed_quests[30408] == true and YES or NO) -- Sho
    	FT_Tooltip:AddLine(GetFactionInfoByID(1279), "44.6, 34.0", GetItemInfo(74642), completed_quests[30414] == true and YES or NO) -- Haohan Mudclaw
    	FT_Tooltip:AddLine(GetFactionInfoByID(1280), "45.0, 33.8", GetItemInfo(74652), completed_quests[30433] == true and YES or NO) -- Tina Mudclaw
    	FT_Tooltip:AddLine(GetFactionInfoByID(1281), " ", GetItemInfo(74644), completed_quests[30390] == true and YES or NO) -- Gina Mudclaw
    	FT_Tooltip:AddLine(GetFactionInfoByID(1282), "41.6, 30.0", GetItemInfo(74655), completed_quests[30427] == true and YES or NO) -- Fish Fellreed
    	FT_Tooltip:AddLine(GetFactionInfoByID(1283), "48.2, 33.8", GetItemInfo(74654), completed_quests[30421] == true and YES or NO) -- Farmer Fung
    
  • bsmorgan added the tags New Enhancment Dec 16, 2012
  • bsmorgan posted a comment Dec 21, 2012

    Here's a patch against 1.0.3:

    --- D:/WoWNew/FeedTillers/FeedTillers.lua	Thu Dec 20 02:50:16 2012
    +++ D:/World of Warcraft/Interface/AddOns/FeedTillers/FeedTillers.lua	Sat Dec 22 01:03:06 2012
    @@ -11,13 +11,14 @@
     ]]--
     
     -- GLOBALS: sort, GetAddOnMetadata, GetFactionInfoByID, GetItemInfo, IsQuestFlaggedCompleted, GetLocale
    --- GLOBALS: COMPLETE, ITEMS, YES
    +-- GLOBALS: COMPLETE, ITEMS, YES, LOCATION_COLON
     -- GLOBALS: LibStub
     -- GLOBALS: FeedTillers_hideComplete, FeedTillers_currentSort
     
     local ADDON, L = ...
     local ADDON_TITLE = GetAddOnMetadata(ADDON, "Title")
     local TILLERS
    +local LOCATION
     local LOCALE = GetLocale()
     local event_frame = CreateFrame("frame")
     
    @@ -72,16 +73,16 @@
     local qtip = LibStub("LibQTip-1.0")
     
     local npcs = {
    -	{ factionID = 1273, itemID = 74643, questID = 30439 }, -- Jogu the Drunk
    -	{ factionID = 1275, itemID = 74651, questID = 30386 }, -- Ella
    -	{ factionID = 1276, itemID = 74649, questID = 30396 }, -- Old Hillpaw
    -	{ factionID = 1277, itemID = 74647, questID = 30402 }, -- Chee Chee
    -	{ factionID = 1278, itemID = 74645, questID = 30408 }, -- Sho
    -	{ factionID = 1279, itemID = 74642, questID = 30414 }, -- Haohan Mudclaw
    -	{ factionID = 1280, itemID = 74652, questID = 30433 }, -- Tina Mudclaw
    -	{ factionID = 1281, itemID = 74644, questID = 30390 }, -- Gina Mudclaw
    -	{ factionID = 1282, itemID = 74655, questID = 30427 }, -- Fish Fellreed
    -	{ factionID = 1283, itemID = 74654, questID = 30421 }, -- Farmer Fung
    +	{ factionID = 1273, loc = "          ", itemID = 74643, questID = 30439 }, -- Jogu the Drunk
    +	{ factionID = 1275, loc = "31.0, 58.0", itemID = 74651, questID = 30386 }, -- Ella
    +	{ factionID = 1276, loc = "31.0, 53.1", itemID = 74649, questID = 30396 }, -- Old Hillpaw
    +	{ factionID = 1277, loc = "34.4, 46.7", itemID = 74647, questID = 30402 }, -- Chee Chee
    +	{ factionID = 1278, loc = "29.6, 30.6", itemID = 74645, questID = 30408 }, -- Sho
    +	{ factionID = 1279, loc = "44.6, 34.0", itemID = 74642, questID = 30414 }, -- Haohan Mudclaw
    +	{ factionID = 1280, loc = "45.0, 33.8", itemID = 74652, questID = 30433 }, -- Tina Mudclaw
    +	{ factionID = 1281, loc = "          ", itemID = 74644, questID = 30390 }, -- Gina Mudclaw
    +	{ factionID = 1282, loc = "41.6, 30.0", itemID = 74655, questID = 30427 }, -- Fish Fellreed
    +	{ factionID = 1283, loc = "48.2, 33.8", itemID = 74654, questID = 30421 }, -- Farmer Fung
     }
     
     local tooltip = "NAME"
    @@ -117,24 +118,28 @@
     				sort(npcs, sortByName)
     			end
     			
    -			tooltip = qtip:Acquire("FeedTillersTT", 3, "LEFT", "LEFT", "RIGHT")
    -			tooltip:AddHeader(TILLERS, ITEMS, COMPLETE)
    +			tooltip = qtip:Acquire("FeedTillersTT", 4, "LEFT", "LEFT", "LEFT", "RIGHT")
    +			LOCATION = string.sub(LOCATION_COLON,1,string.len(LOCATION_COLON)-1)
    +			tooltip:AddHeader(TILLERS, LOCATION, ITEMS, COMPLETE)
     			local line
     			local hideComplete = FeedTillers_hideComplete
     			for i = 1, #npcs do
     				local npc = npcs[i]
    +				if not npc.loc then
    +					npc.loc = "          ";
    +				end
     				if not npc.item then
     					npc.item = GetItemInfo(npc.itemID)
     				end
     				if not IsQuestFlaggedCompleted(npc.questID) then
     					-- note "line" is no longer local to this scope!
     					local count = GetItemCount(npc.itemID)
    -					line = tooltip:AddLine(npc.name, npc.item, format("%d/%d", count, 5))
    +					line = tooltip:AddLine(npc.name, npc.loc, npc.item, format("%d/%d", count, 5))
     					if count < 5 then
     						tooltip:SetLineColor(line, 1, 0.1, 0.1, 0.3)
     					end
     				elseif not hideComplete then
    -					line = tooltip:AddLine(npc.name, npc.item, YES)
    +					line = tooltip:AddLine(npc.name, npc.loc, npc.item, YES)
     					tooltip:SetLineColor(line, 0.1, 1, 0.1, 0.3)
     				end
     			end
    

    Edited Dec 22, 2012
  • bsmorgan posted a comment Dec 28, 2012

    Here's a newer patch to 1.0.3 which adds hiding of Best Friends. Localization of the CONTROL_DOWN string is needed.

    --- D:/WoWNew/FeedTillers/FeedTillers.lua	Thu Dec 20 02:50:16 2012
    +++ D:/World of Warcraft/Interface/AddOns/FeedTillers/FeedTillers.lua	Fri Dec 28 16:14:31 2012
    @@ -8,16 +8,22 @@
     	File Author:		myrroddin
     	File Date:			2012-12-20T02:43:06Z
     	File Revision:		12
    +	
    +	Patch Author:		Brad Morgan
    +	Patch Date:			2012-12-28
    +	Patch Revision:		b
    +	
     ]]--
     
    --- GLOBALS: sort, GetAddOnMetadata, GetFactionInfoByID, GetItemInfo, IsQuestFlaggedCompleted, GetLocale
    --- GLOBALS: COMPLETE, ITEMS, YES
    +-- GLOBALS: sort, GetAddOnMetadata, GetFactionInfoByID, GetItemInfo, IsQuestFlaggedCompleted, GetLocale, GetFriendshipReputation
    +-- GLOBALS: COMPLETE, ITEMS, YES, LOCATION_COLON
     -- GLOBALS: LibStub
    --- GLOBALS: FeedTillers_hideComplete, FeedTillers_currentSort
    +-- GLOBALS: FeedTillers_hideComplete, FeedTillers_currentSort, FeedTillers_hideBF
     
     local ADDON, L = ...
     local ADDON_TITLE = GetAddOnMetadata(ADDON, "Title")
     local TILLERS
    +local LOCATION
     local LOCALE = GetLocale()
     local event_frame = CreateFrame("frame")
     
    @@ -25,36 +31,43 @@
     if LOCALE == "esES" then
     L["CLICK_SORT"] = "Clic para alternar entre ordenar por nombre de PNJ o nombre de comida."
     L["SHIFT_DOWN"] = "Mayús-clic para ocultar a los Labradores que ya ha alimentado hoy."
    +-- L["CONTROL_DOWN"] = ""
     L["ToC/Description"] = "Mostrar cuál comida le gusta cada miembro de los Labradores, y si ha completado su misión diaria \"Un plato para...\""
     
     elseif LOCALE == "esMX" then
     L["CLICK_SORT"] = "Clic para alternar entre ordenar por nombre de PNJ o nombre de comida."
     L["SHIFT_DOWN"] = "Mayús-clic para ocultar a los Labradores que ya ha alimentado hoy."
    +-- L["CONTROL_DOWN"] = ""
     L["ToC/Description"] = "Mostrar cuál comida le gusta cada miembro de los Labradores, y si ha completado su misión diaria \"Un plato para...\""
     
     elseif LOCALE == "itIT" then
     -- L["CLICK_SORT"] = ""
     -- L["SHIFT_DOWN"] = ""
    +-- L["CONTROL_DOWN"] = ""
     -- L["ToC/Description"] = ""
     
     elseif LOCALE == "ptBR" then
     -- L["CLICK_SORT"] = ""
     -- L["SHIFT_DOWN"] = ""
    +-- L["CONTROL_DOWN"] = ""
     -- L["ToC/Description"] = ""
     
     elseif LOCALE == "frFR" then
     -- L["CLICK_SORT"] = ""
     -- L["SHIFT_DOWN"] = ""
    +-- L["CONTROL_DOWN"] = ""
     -- L["ToC/Description"] = ""
     
     elseif LOCALE == "deDE" then
     -- L["CLICK_SORT"] = ""
     -- L["SHIFT_DOWN"] = ""
    +-- L["CONTROL_DOWN"] = ""
     -- L["ToC/Description"] = ""
     
     elseif LOCALE == "ruRU" then
     -- L["CLICK_SORT"] = ""
     -- L["SHIFT_DOWN"] = ""
    +-- L["CONTROL_DOWN"] = ""
     -- L["ToC/Description"] = ""
     
     elseif LOCALE == "zhCN" then
    @@ -62,26 +75,28 @@
     elseif LOCALE == "zhTW" then
     -- L["CLICK_SORT"] = ""
     -- L["SHIFT_DOWN"] = ""
    +-- L["CONTROL_DOWN"] = ""
     -- L["ToC/Description"] = ""
     
     else
     L["CLICK_SORT"] = "Click the plugin to sort by Tiller name or item name"
     L["SHIFT_DOWN"] = "Hold the <Shift> key and click to hide already fed Tillers"
    +L["CONTROL_DOWN"] = "Hold the <Control> key and click to hide Best Friend Tillers"
     end
     
     local qtip = LibStub("LibQTip-1.0")
     
     local npcs = {
    -	{ factionID = 1273, itemID = 74643, questID = 30439 }, -- Jogu the Drunk
    -	{ factionID = 1275, itemID = 74651, questID = 30386 }, -- Ella
    -	{ factionID = 1276, itemID = 74649, questID = 30396 }, -- Old Hillpaw
    -	{ factionID = 1277, itemID = 74647, questID = 30402 }, -- Chee Chee
    -	{ factionID = 1278, itemID = 74645, questID = 30408 }, -- Sho
    -	{ factionID = 1279, itemID = 74642, questID = 30414 }, -- Haohan Mudclaw
    -	{ factionID = 1280, itemID = 74652, questID = 30433 }, -- Tina Mudclaw
    -	{ factionID = 1281, itemID = 74644, questID = 30390 }, -- Gina Mudclaw
    -	{ factionID = 1282, itemID = 74655, questID = 30427 }, -- Fish Fellreed
    -	{ factionID = 1283, itemID = 74654, questID = 30421 }, -- Farmer Fung
    +	{ factionID = 1273, loc = "          ", itemID = 74643, questID = 30439 , repID = 1273 }, -- Jogu the Drunk
    +	{ factionID = 1275, loc = "31.0, 58.0", itemID = 74651, questID = 30386 , repID = 1275 }, -- Ella
    +	{ factionID = 1276, loc = "31.0, 53.1", itemID = 74649, questID = 30396 , repID = 1276 }, -- Old Hillpaw
    +	{ factionID = 1277, loc = "34.4, 46.7", itemID = 74647, questID = 30402 , repID = 1277 }, -- Chee Chee
    +	{ factionID = 1278, loc = "29.6, 30.6", itemID = 74645, questID = 30408 , repID = 1278 }, -- Sho
    +	{ factionID = 1279, loc = "44.6, 34.0", itemID = 74642, questID = 30414 , repID = 1279 }, -- Haohan Mudclaw
    +	{ factionID = 1280, loc = "45.0, 33.8", itemID = 74652, questID = 30433 , repID = 1280 }, -- Tina Mudclaw
    +	{ factionID = 1281, loc = "          ", itemID = 74644, questID = 30390 , repID = 1281 }, -- Gina Mudclaw
    +	{ factionID = 1282, loc = "41.6, 30.0", itemID = 74655, questID = 30427 , repID = 1282 }, -- Fish Fellreed
    +	{ factionID = 1283, loc = "48.2, 33.8", itemID = 74654, questID = 30421 , repID = 1283 }, -- Farmer Fung
     }
     
     local tooltip = "NAME"
    @@ -100,6 +115,8 @@
     		OnClick = function(self)
     			if IsShiftKeyDown() then
     				FeedTillers_hideComplete = not FeedTillers_hideComplete
    +			elseif IsControlKeyDown() then
    +				FeedTillers_hideBF = not FeedTillers_hideBF
     			else
     				FeedTillers_currentSort = FeedTillers_currentSort == "NAME" and "ITEM" or "NAME"
     				sort(npcs, FeedTillers_currentSort == "NAME" and sortByName or sortByItem)
    @@ -117,30 +134,45 @@
     				sort(npcs, sortByName)
     			end
     			
    -			tooltip = qtip:Acquire("FeedTillersTT", 3, "LEFT", "LEFT", "RIGHT")
    -			tooltip:AddHeader(TILLERS, ITEMS, COMPLETE)
    +			tooltip = qtip:Acquire("FeedTillersTT", 4, "LEFT", "LEFT", "LEFT", "RIGHT")
    +			LOCATION = string.sub(LOCATION_COLON,1,string.len(LOCATION_COLON)-1)
    +			tooltip:AddHeader(TILLERS, LOCATION, ITEMS, COMPLETE)
     			local line
     			local hideComplete = FeedTillers_hideComplete
    +			local hideBF = FeedTillers_hideBF
     			for i = 1, #npcs do
     				local npc = npcs[i]
    +				if not npc.loc then
    +					npc.loc = "          ";
    +				end
     				if not npc.item then
     					npc.item = GetItemInfo(npc.itemID)
     				end
    +				if not npc.rep then
    +					_, npc.rep = GetFriendshipReputation(npc.repID)
    +				end
    +
    +				-- note "line" is no longer local to this scope!
     				if not IsQuestFlaggedCompleted(npc.questID) then
    -					-- note "line" is no longer local to this scope!
    -					local count = GetItemCount(npc.itemID)
    -					line = tooltip:AddLine(npc.name, npc.item, format("%d/%d", count, 5))
    -					if count < 5 then
    -						tooltip:SetLineColor(line, 1, 0.1, 0.1, 0.3)
    +					if not hideBF or npc.rep < 42000 then
    +						local count = GetItemCount(npc.itemID)
    +						line = tooltip:AddLine(npc.name, npc.loc, npc.item, format("%d/%d", count, 5))
    +						if count < 5 then
    +							tooltip:SetLineColor(line, 1, 0.1, 0.1, 0.3)
    +						end
     					end
    -				elseif not hideComplete then
    -					line = tooltip:AddLine(npc.name, npc.item, YES)
    +				elseif not hideComplete and not hideBF then
    +					line = tooltip:AddLine(npc.name, npc.loc, npc.item, YES)
    +					tooltip:SetLineColor(line, 0.1, 1, 0.1, 0.3)
    +				elseif not hideComplete and npc.rep < 42000 then
    +					line = tooltip:AddLine(npc.name, npc.loc, npc.item, YES)
     					tooltip:SetLineColor(line, 0.1, 1, 0.1, 0.3)
     				end
     			end
     
     			if not line then
     				hideComplete = nil
    +				hideBF = nil
     				self:GetScript("OnLeave")(self)
     				return self:GetScript("OnEnter")(self)
     			end
    @@ -153,6 +185,9 @@
     			line = tooltip:AddLine(" ")
     			tooltip:SetCell(line, 1, NORMAL_FONT_COLOR_CODE .. L.SHIFT_DOWN, "LEFT", 3)
     
    +			line = tooltip:AddLine(" ")
    +			tooltip:SetCell(line, 1, NORMAL_FONT_COLOR_CODE .. L.CONTROL_DOWN, "LEFT", 3)
    +
     			tooltip:SmartAnchorTo(self)
     			tooltip:Show()
     		end,
    @@ -173,6 +208,9 @@
     		end
     		if not FeedTillers_currentSort then
     			FeedTillers_currentSort = "NAME"
    +		end
    +		if not FeedTillers_hideBF then
    +			FeedTillers_hideBF = false
     		end
     	end	
     	CreateBroker()
    

    Edited Dec 28, 2012
  • Sygon_Paul removed a tag New Jan 22, 2013
  • Sygon_Paul added a tag Accepted Jan 22, 2013
  • Sygon_Paul posted a comment Jan 22, 2013

    @bsmorgan: Go

    Wow, I wasn't expecting suggestions or other tickets, but this is a good idea. Sorry for the delay, as I said, it was a bit of a surprise.

  • Sygon_Paul removed a tag Accepted Mar 18, 2013
  • Sygon_Paul added a tag Started Mar 18, 2013
  • Sygon_Paul closed issue Dec 30, 2020
  • Sygon_Paul added a tag Fixed Dec 30, 2020

To post a comment, please login or register a new account.