Quantcast
WoWInterface - View Single Post - Need help to integrate Addon-Options
View Single Post
02-23-15, 05:05 PM   #14
flow0284
An Aku'mai Servant
Join Date: Jan 2015
Posts: 39
In Zeile 78 versuchte ich jetzt die letzten Tage die Kräuter anzeigen zu lassen. Entweder hab ich meine Tabelle nicht richtig aufgebaut, versuche es am falschen Ort oder keine Ahnung. Den Aufbau der Tabelle hatte ich vor einigen Wochen bereits kurz dargestellt.


Lua Code:
  1. local Options = CreateFrame("Frame", ADDON.."Options", InterfaceOptionsFramePanelContainer)
  2. Options.name = GetAddOnMetadata(ADDON, "Title") or ADDON
  3. InterfaceOptions_AddCategory(Options)
  4. Addon.OptionsPanel = Options
  5.  
  6. Options:SetScript("OnShow", function()
  7.     local Title = Options:CreateFontString("$parentTitle", "ARTWORK", "GameFontNormalLarge")
  8.     Title:SetPoint("TOPLEFT", 16, -16)
  9.     Title:SetText(Options.name)
  10.    
  11.     local Notes = Options:CreateFontString("$parentSubText", "ARTWORK", "GameFontHighlightSmall")
  12.     Notes:SetPoint("TOPLEFT", Title, "BOTTOMLEFT", 0, -8)
  13.     Notes:SetPoint("RIGHT", -32, 0)
  14.     Notes:SetHeight(8)
  15.     Notes:SetJustifyH("LEFT")
  16.     Notes:SetJustifyV("TOP")
  17.     Notes:SetText("Version: "..GetAddOnMetadata(ADDON, "Version"))
  18.        
  19.     local OptionPanel = CreateFrame("Frame", nil, Options)
  20.     OptionPanel:SetPoint("TOPLEFT", Notes, "BOTTOMLEFT", 0, -24)
  21.     OptionPanel:SetPoint("BOTTOMRIGHT", Options, -16, 16)
  22.     OptionPanel:SetBackdrop({
  23.         bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
  24.         edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
  25.         tile = true, tileSize = 16, edgeSize = 16,
  26.         insets= { left = 3, right = 3, top = 5, bottom = 3 }
  27.     })
  28.     OptionPanel:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
  29.     OptionPanel:SetBackdropBorderColor(0.4, 0.4, 0.4)
  30.    
  31.     local myCheckButton = CreateFrame("CheckButton", "myCheckButton_GlobalName", OptionPanel, "ChatConfigCheckButtonTemplate")
  32.     myCheckButton:SetPoint("TOPLEFT", 16, -16)
  33.     myCheckButton_GlobalNameText:SetText("MillButton Extended")
  34.     myCheckButton.tooltip = "This is where you place MouseOver Text."
  35.     myCheckButton:SetScript("OnClick",
  36.     function()
  37.         PlaySound("igMainMenuOptionCheckBoxOn" or "igMainmenuOptionCheckBoxOff")
  38.         local isChecked = myCheckButton:GetChecked()
  39.         if isChecked == true then
  40.             MillButtonSettings.extended = true
  41.             print(MillButtonSettings.extended)
  42.         else
  43.             MillButtonSettings.extended = false
  44.             print(MillButtonSettings.extended)
  45.         end        
  46.     end)
  47.     myCheckButton:SetChecked(MillButtonSettings.extended)
  48.    
  49.     for i = 1, #MillButtonExpansions do
  50.         -- Make a child panel
  51.         local Options_Child = CreateFrame("Frame", ADDON.."Child", Options)
  52.         Options_Child.name = MillButtonExpansions[i]
  53.         Options_Child.id = i
  54.         -- Specify childness of this panel (this puts it under the little red [+], instead of giving it a normal AddOn category)
  55.         Options_Child.parent = Options.name
  56.         -- Add the child to the Interface Options
  57.         InterfaceOptions_AddCategory(Options_Child)
  58.        
  59.         local Title = Options_Child:CreateFontString("$parentTitle", "ARTWORK", "GameFontNormalLarge")
  60.         Title:SetPoint("TOPLEFT", 16, -16)
  61.         Title:SetText(Options_Child.name)
  62.        
  63.         local SubOptionPanel = CreateFrame("Frame", nil, Options_Child)
  64.         SubOptionPanel:SetPoint("TOPLEFT", Title, "BOTTOMLEFT", 0, -24)
  65.         SubOptionPanel:SetPoint("BOTTOMRIGHT", Options_Child, -16, 16)
  66.         SubOptionPanel:SetBackdrop({
  67.             bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
  68.             edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
  69.             tile = true, tileSize = 16, edgeSize = 16,
  70.             insets= { left = 3, right = 3, top = 5, bottom = 3 }
  71.         })
  72.         SubOptionPanel:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
  73.         SubOptionPanel:SetBackdropBorderColor(0.4, 0.4, 0.4)
  74.        
  75.         Options_Child:SetScript("OnShow",
  76.             function()
  77.             PlaySound("igMainMenuOptionCheckBoxOn" or "igMainmenuOptionCheckBoxOff")
  78.             --code für die kräuter
  79.         end)
  80.        
  81.     end
  82.    
  83.     Options:SetScript("OnShow", nil)
  84.        
  85. end)
  Reply With Quote