WoWInterface SVN Ranch

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 10 to Rev 11
    Reverse comparison

Rev 10 → Rev 11

trunk/ranch.lua
28,14 → 28,58
RanchGameTip:CreateFontString( "$parentTextRight1", nil, "GameTooltipText" )
);
 
-- Create the ranch_perm table if it doesn't exist
-- Create the ranch_perm table if it doesn't exist.
if ranch_perm == nil then
ranch_perm = {}
end
 
-- Create the ranch_options table if it doesn't exist.
if ranch_options == nil then
ranch_options = {}
end
 
-- Create the list of types, if it doesn't exist.
if ranch_options["types"] == nil then
ranch_options["types"] = {}
end
 
-- Create an empty table to hold any temporary items.
ranch_temp = {}
 
-- Create the Options Panel.
RanchPanel = CreateFrame( "Frame", "RanchOptionsPanel", UIParent );
RanchPanel.name = "Ranch (LDB)"
InterfaceOptions_AddCategory(RanchPanel)
 
-- Add a Title to the Options Panel
local RanchTitle = RanchPanel:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
RanchTitle:SetPoint("TOP", 0, -16)
RanchTitle:SetText("Ranch - A Farming Addon")
 
-- Add a description to the Options Panel
local RanchDesc = RanchPanel:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
RanchDesc:SetHeight(48)
RanchDesc:SetPoint("TOPLEFT", 16, -40)
RanchDesc:SetPoint("RIGHT", -16, 0)
RanchDesc:SetNonSpaceWrap(true)
RanchDesc:SetJustifyH("LEFT")
RanchDesc:SetJustifyV("TOP")
RanchDesc:SetText("Ranch is an addon to assist you when farming for items in World of Warcraft. It will keep track of all the trade goods you have collected, along with all of the BoE items and any special, custom items you wish to select.")
 
local RanchItemsHelp = RanchPanel:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
RanchItemsHelp:SetHeight(192)
RanchItemsHelp:SetPoint("TOPLEFT", RanchDesc, "BOTTOMLEFT", 0, -8)
RanchItemsHelp:SetPoint("RIGHT", -16, 0)
RanchItemsHelp:SetNonSpaceWrap(true)
RanchItemsHelp:SetJustifyH("LEFT")
RanchItemsHelp:SetJustifyV("TOP")
local helptext = "The Items sub-category deals with how Ranch displays BoE items.\n\n"
helptext = helptext.."The Types sub-category controls which types of trade items Ranch displays.\n\n"
helptext = helptext.."The Track sub-category controls the item being tracked in the LDB display.\n\n"
helptext = helptext.."The Temporary sub-category controls the items being displayed in the LDB tooltip for this session only.\n\n"
helptext = helptext.."The Permanent sub-category controls the items being permanently displayed in the LDB tooltip."
RanchItemsHelp:SetText(helptext)
 
-- Register the BAG_UPDATE event.
RanchFrame:RegisterEvent("BAG_UPDATE");
 
47,7 → 91,10
 
function Ranch_Command(slashargs)
local startPos, endPos, firstWord, restOfString = string.find(slashargs, "(%w+)[%s%p]*(.*)");
firstWord = strlower(firstWord)
if firstWord ~= nil then
firstWord = strlower(firstWord)
end
 
if firstWord == "track" then
if restOfString == "" or restOfString == nil then
ranchtrack = nil
77,6 → 124,13
end
elseif firstWord == "removeall" then
ranch_perm = {}
else
DEFAULT_CHAT_FRAME:AddMessage("Ranch accepts the following arguments:")
DEFAULT_CHAT_FRAME:AddMessage("track [itemlink]: Tracks an item in the LDB display")
DEFAULT_CHAT_FRAME:AddMessage("temp [itemlink]: Tracks an item in the LDB tooltip under the 'Temporary' heading. This item will disappear after you logout.")
DEFAULT_CHAT_FRAME:AddMessage("add [itemlink]: Tracks an item in the LDB tooltip under the 'Custom' heading. This item will only be removed using the 'remove' or 'removeall' commands.")
DEFAULT_CHAT_FRAME:AddMessage("remove [itemlink]: Removes an item being tracked in the LDB tooltip under the 'Custom' heading.")
DEFAULT_CHAT_FRAME:AddMessage("removeall: Removes all items being tracked in the LDB tooltip under the 'Custom' heading.")
end
end
 
151,12 → 205,17
end
 
for itemGroup, Collection in pairs(ranch_items) do
self:AddLine(" ")
self:AddLine(itemGroup)
for itemId, itemCount in pairs(Collection) do
_, itemLink = GetItemInfo(itemId)
self:AddDoubleLine(itemLink,itemCount)
if ranch_options["types"][itemGroup] == nil then
ranch_options["types"][itemGroup] = true
end
if ranch_options["types"][itemGroup] then
self:AddLine(" ")
self:AddLine(itemGroup)
for itemId, itemCount in pairs(Collection) do
_, itemLink = GetItemInfo(itemId)
self:AddDoubleLine(itemLink,itemCount)
end
end
end
 
if Ranch_tcount(ranch_perm) > 0 then