local Options = CreateFrame("Frame", ADDON.."Options", InterfaceOptionsFramePanelContainer)
Options.name = GetAddOnMetadata(ADDON, "Title") or ADDON
InterfaceOptions_AddCategory(Options)
Addon.OptionsPanel = Options
Options:SetScript("OnShow", function()
local Title = Options:CreateFontString("$parentTitle", "ARTWORK", "GameFontNormalLarge")
Title:SetPoint("TOPLEFT", 16, -16)
Title:SetText(Options.name)
local Notes = Options:CreateFontString("$parentSubText", "ARTWORK", "GameFontHighlightSmall")
Notes:SetPoint("TOPLEFT", Title, "BOTTOMLEFT", 0, -8)
Notes:SetPoint("RIGHT", -32, 0)
Notes:SetHeight(8)
Notes:SetJustifyH("LEFT")
Notes:SetJustifyV("TOP")
Notes:SetText("Version: "..GetAddOnMetadata(ADDON, "Version"))
local OptionPanel = CreateFrame("Frame", nil, Options)
OptionPanel:SetPoint("TOPLEFT", Notes, "BOTTOMLEFT", 0, -24)
OptionPanel:SetPoint("BOTTOMRIGHT", Options, -16, 16)
OptionPanel:SetBackdrop({
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true, tileSize = 16, edgeSize = 16,
insets= { left = 3, right = 3, top = 5, bottom = 3 }
})
OptionPanel:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
OptionPanel:SetBackdropBorderColor(0.4, 0.4, 0.4)
local myCheckButton = CreateFrame("CheckButton", "myCheckButton_GlobalName", OptionPanel, "ChatConfigCheckButtonTemplate")
myCheckButton:SetPoint("TOPLEFT", 16, -16)
myCheckButton_GlobalNameText:SetText("MillButton Extended")
myCheckButton.tooltip = "This is where you place MouseOver Text."
myCheckButton:SetScript("OnClick",
function()
PlaySound("igMainMenuOptionCheckBoxOn" or "igMainmenuOptionCheckBoxOff")
local isChecked = myCheckButton:GetChecked()
if isChecked == true then
MillButtonSettings.extended = true
print(MillButtonSettings.extended)
else
MillButtonSettings.extended = false
print(MillButtonSettings.extended)
end
end)
myCheckButton:SetChecked(MillButtonSettings.extended)
for i = 1, #MillButtonExpansions do
-- Make a child panel
local Options_Child = CreateFrame("Frame", ADDON.."Child", Options)
Options_Child.name = MillButtonExpansions[i]
Options_Child.id = i
-- Specify childness of this panel (this puts it under the little red [+], instead of giving it a normal AddOn category)
Options_Child.parent = Options.name
-- Add the child to the Interface Options
InterfaceOptions_AddCategory(Options_Child)
local Title = Options_Child:CreateFontString("$parentTitle", "ARTWORK", "GameFontNormalLarge")
Title:SetPoint("TOPLEFT", 16, -16)
Title:SetText(Options_Child.name)
local SubOptionPanel = CreateFrame("Frame", nil, Options_Child)
SubOptionPanel:SetPoint("TOPLEFT", Title, "BOTTOMLEFT", 0, -24)
SubOptionPanel:SetPoint("BOTTOMRIGHT", Options_Child, -16, 16)
SubOptionPanel:SetBackdrop({
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true, tileSize = 16, edgeSize = 16,
insets= { left = 3, right = 3, top = 5, bottom = 3 }
})
SubOptionPanel:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
SubOptionPanel:SetBackdropBorderColor(0.4, 0.4, 0.4)
Options_Child:SetScript("OnShow",
function()
PlaySound("igMainMenuOptionCheckBoxOn" or "igMainmenuOptionCheckBoxOff")
--code für die kräuter
end)
end
Options:SetScript("OnShow", nil)
end)