ranch_options["types"] = {} |
end |
|
-- Create display items option, if it doesn't exist. |
if ranch_options["displayitems"] == nil then |
ranch_options["displayitems"] = true |
end |
|
-- Create display items option, if it doesn't exist. |
if ranch_options["mergeitems"] == nil then |
ranch_options["mergeitems"] = false |
end |
|
-- Create an empty table to hold any temporary items. |
ranch_temp = {} |
|
-- Create the Options Panel. |
-- Create the About Panel. |
RanchAbout = LibStub("tekKonfig-AboutPanel").new(nil, "Ranch") |
|
-- Create the Items Options |
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.") |
|
-- Add Display Items option. |
local displayitems = LibStub("tekKonfig-Checkbox").new(RanchItemOptions, nil, "Display BoE items?", "TOPLEFT", subtitle, "BOTTOMLEFT", -2, -8) |
local checksound = displayitems:GetScript("OnClick") |
displayitems:SetScript("OnClick", function(self) checksound(self); ranch_options["displayitems"] = not ranch_options["displayitems"]; end) |
displayitems:SetChecked(ranch_options["displayitems"]) |
|
-- Add Merge Items option. |
local mergeitems = LibStub("tekKonfig-Checkbox").new(RanchItemOptions, nil, "Merge BoE items?", "TOPLEFT", displayitems, "BOTTOMLEFT", -2, -8) |
local checksound = mergeitems:GetScript("OnClick") |
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 Items Options to the Interface Menu. |
InterfaceOptions_AddCategory(RanchItemOptions) |
|
-- Register the BAG_UPDATE event. |
RanchFrame:RegisterEvent("BAG_UPDATE"); |
|