WoWInterface SVN Ranch

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 15 to Rev 16
    Reverse comparison

Rev 15 → Rev 16

ranch.lua
13,7 → 13,17
RanchFrame:SetScript("OnEvent", function(self, event, ...) getglobal("Ranch_"..event)(event, ...) end);
RanchFrame:RegisterEvent("VARIABLES_LOADED")
 
if GetLocale() == "deDE" then
ranch_QGT = "Dieser Gegenstand startet eine Quest."
elseif GetLocale() == "esES" or GetLocale() == "esMX" then
ranch_QGT = "Este objeto inicia una misión"
elseif GetLocale() == "frFR" then
ranch_QGT = "Cet objet permet de lancer une quête"
else
ranch_QGT = "This Item Begins a Quest"
end
 
 
-- Event handler for the VARIABLES_LOADED event.
function Ranch_VARIABLES_LOADED(event, ...)
 
48,14 → 58,22
ranch_options["displayitems"] = true
end
 
-- Create display items option, if it doesn't exist.
-- Create merge items option, if it doesn't exist.
if ranch_options["mergeitems"] == nil then
ranch_options["mergeitems"] = false
end
 
-- Create the quest giving items option, if it doesn't exist.
if ranch_options["questitems"] == nil then
ranch_options["questitems"] = true
end
 
-- Create an empty table to hold any temporary items.
ranch_temp = {}
 
-- Set the RanchTradeTypes variable
RanchTradeTypes = 0
 
-- Create the About Panel.
RanchAbout = LibStub("tekKonfig-AboutPanel").new(nil, "Ranch")
 
63,7 → 81,7
local RanchItemOptions = CreateFrame("Frame", "RanchItemOpts", InterfaceOptionsFramePanelContainer)
RanchItemOptions.name = "Item Options"
RanchItemOptions.parent = "Ranch"
local title, subtitle = LibStub("tekKonfig-Heading").new(RanchItemOptions, "Ranch Item Options", "This panel controls how Ranch deals with BoE items.")
local title, subtitle = LibStub("tekKonfig-Heading").new(RanchItemOptions, "Ranch Item Options", "This panel controls how Ranch deals with certain item types.")
 
-- Add Display Items option.
local displayitems = LibStub("tekKonfig-Checkbox").new(RanchItemOptions, nil, "Display BoE items?", "TOPLEFT", subtitle, "BOTTOMLEFT", -2, -8)
77,10 → 95,39
mergeitems:SetScript("OnClick", function(self) checksound(self); ranch_options["mergeitems"] = not ranch_options["mergeitems"]; end)
mergeitems:SetChecked(ranch_options["mergeitems"])
 
RanchItemOptions:SetScript("OnShow", function(self) displayitems:SetChecked(ranch_options["displayitems"]); mergeitems:SetChecked(ranch_options["mergeitems"]) end)
-- Add Quest Giving Items option
local questitems = LibStub("tekKonfig-Checkbox").new(RanchItemOptions, nil, "Show items that give quests?", "TOPLEFT", mergeitems, "BOTTOMLEFT", -2, -8)
local checksound = questitems:GetScript("OnClick")
questitems:SetScript("OnClick", function(self) checksound(self); ranch_options["questitems"] = not ranch_options["questitems"]; end)
questitems:SetChecked(ranch_options["questitems"])
 
RanchItemOptions:SetScript("OnShow", function(self) displayitems:SetChecked(ranch_options["displayitems"]); mergeitems:SetChecked(ranch_options["mergeitems"]); questitems:SetChecked(ranch_options["questitems"]) end)
-- Add Items Options to the Interface Menu.
InterfaceOptions_AddCategory(RanchItemOptions)
 
-- Create the Trade Goods options
local RanchTradeOptions = CreateFrame("Frame", "RanchTradeOpts", InterfaceOptionsFramePanelContainer)
RanchTradeOptions.name = "Trade Goods"
RanchTradeOptions.parent = "Ranch"
local title, subtitle = LibStub("tekKonfig-Heading").new(RanchTradeOptions, "Ranch Trade Goods Options", "This panel controls how Ranch deals with Trade Goods.")
RanchTradeOptions:SetScript("OnShow", function(RanchTradeOptions)
if RanchTradeTypes < Ranch_tcount(ranch_options["types"]) then
RanchTradeTypes = Ranch_tcount(ranch_options["types"])
local goods, shown, rows
rows = 0
for goods, shown in pairs(ranch_options["types"]) do
if shown then
local GoodsCheck = LibStub("tekKonfig-Checkbox").new(RanchTradeOptions, nil, "Show "..goods.."?", "TOPLEFT", subtitle, "BOTTOMLEFT", -2, -8 - (rows*26))
rows = rows + 1
local checksound = GoodsCheck:GetScript("OnClick")
GoodsCheck:SetScript("OnClick", function(self) checksound(self); ranch_options["types"][goods] = not ranch_options["types"][goods]; end)
GoodsCheck:SetChecked(ranch_options["types"][goods])
end
end
end
end)
InterfaceOptions_AddCategory(RanchTradeOptions)
 
-- Register the BAG_UPDATE event.
RanchFrame:RegisterEvent("BAG_UPDATE");
 
152,6 → 199,7
local i, j
local ranch_items = {}
local ranch_boe = {}
local ranch_qg = {} -- Quest Giving Items
local ranch_cash = 0
local ranch_uncost = false
local ranch_junk = false
191,7 → 239,11
end
end
end
 
RanchGameTip:ClearLines();
RanchGameTip:SetBagItem(i,j);
if ((RanchGameTipTextLeft2:GetText() == ranch_QGT) or (RanchGameTipTextLeft3:GetText() == ranch_QGT) or RanchGameTipTextLeft4:GetText() == ranch_QGT) then
tinsert(ranch_qg, itemId)
end
if ranch_temp[itemId] ~= nil then
ranch_temp[itemId] = GetItemCount(itemLink)
end
202,7 → 254,7
local itemGroup, Collection, itemId, itemCount
self:AddLine("Ranch")
 
if ranch_options["displayitems"] then
if ranch_options["displayitems"] and Ranch_tcount(ranch_boe) ~= 0 then
self:AddLine(" ")
self:AddLine("Items")
for itemDesc, itemCost in pairs(ranch_boe) do
218,6 → 270,15
end
end
 
if ranch_options["questitems"] and Ranch_tcount(ranch_qg) ~= 0 then
self:AddLine(" ")
self:AddLine("Quest Givers")
for _, itemDesc in ipairs(ranch_qg) do
local _, itemLink = GetItemInfo(itemDesc)
self:AddLine(itemLink)
end
end
 
for itemGroup, Collection in pairs(ranch_items) do
if ranch_options["types"][itemGroup] == nil then
ranch_options["types"][itemGroup] = true
ranch.toc
1,11 → 1,12
## Interface: 30000
## Title : Ranch
## Title : Ranch
## Notes: Keeps track of items you've farmed.
## Author: Sekrin@Argent Dawn-EU
## Version: 1.0.wowi:revision
## SavedVariablesPerCharacter: ranch_perm, ranch_options
 
## X-Website: http://www.wowinterface.com/downloads/info11942-Ranch.html
## X-Email: sekrin.ad@googlemail.com
## X-Category: Inventory
 
libs\tekKonfig\tekKonfig.xml