Skip to content

Commit

Permalink
Merge pull request #5 from flow0284/shadowlands
Browse files Browse the repository at this point in the history
Shadowlands update
  • Loading branch information
flow0284 authored Oct 17, 2020
2 parents dc83ef8 + 9c5e178 commit 899c67a
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 16 deletions.
26 changes: 14 additions & 12 deletions Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ MillButton_Dev = {

--[[ Optionstable ]]
MillButton_DefaultOptions = {
extended = false, --für die Optionale Chatausgabe der übersrpungenen Kräuter (entfällt evtl.)
macroID = nil, --falls man sich entscheiden sollte das generierte macro nicht mehr nutzen zu wollen muss es über die gespeicherte macroID gelöscht werden
extended = false, --für die Optionale Chatausgabe der übersrpungenen Kräuter (entfällt evtl.)
macroID = nil, --falls man sich entscheiden sollte das generierte macro nicht mehr nutzen zu wollen muss es über die gespeicherte macroID gelöscht werden
};

--[[ Expansiontable ]]
Expand All @@ -20,6 +20,7 @@ MillButtonExpansions = {
"WoD",
"Legion",
"BfA",
"Shadowlands",
};

--[[ Expansion Logos ]]
Expand All @@ -32,6 +33,7 @@ MillButtonExpansionLogos = {
[[Interface\Addons\MillButton\gfx\WoD]],
[[Interface\Addons\MillButton\gfx\Legion]],
[[Interface\Addons\MillButton\gfx\BfA]],
[[Interface\Addons\MillButton\gfx\Shadowlands]],
};

--[[ Macronames ]]
Expand Down Expand Up @@ -81,7 +83,7 @@ Options = CreateFrame("Frame", ADDON.."Options", InterfaceOptionsFramePanelConta
Notes:SetJustifyV("TOP")
Notes:SetText("Version: "..GetAddOnMetadata(ADDON, "Version"))

local OptionPanel = CreateFrame("Frame", nil, Options)
local OptionPanel = CreateFrame("Frame", nil, Options, BackdropTemplateMixin and "BackdropTemplate")
OptionPanel:SetPoint("TOPLEFT", Notes, "BOTTOMLEFT", 0, -24)
OptionPanel:SetPoint("BOTTOMRIGHT", Options, -16, 16)
OptionPanel:SetBackdrop({
Expand Down Expand Up @@ -194,7 +196,7 @@ Options = CreateFrame("Frame", ADDON.."Options", InterfaceOptionsFramePanelConta
texframe.texture:SetAllPoints(texframe)
texframe.texture:SetTexture(MillButtonExpansionLogos[i],1)

local SubOptionPanel = CreateFrame("Frame", nil, Options_Child)
local SubOptionPanel = CreateFrame("Frame", nil, Options_Child, BackdropTemplateMixin and "BackdropTemplate")
SubOptionPanel:SetPoint("TOPLEFT", texframe, "BOTTOMLEFT", 0, 0)
SubOptionPanel:SetPoint("BOTTOMRIGHT", Options_Child, -16, 16)
SubOptionPanel:SetBackdrop({
Expand All @@ -214,23 +216,23 @@ Options = CreateFrame("Frame", ADDON.."Options", InterfaceOptionsFramePanelConta
--wenn noch keine checkboxen vorhanden dann erstmal erstellen
if not self.herbCheckboxes or self.herbCheckboxes then
self.herbCheckboxes = {}
--ankerpunkt für die erste checkbox
--ankerpunkt für die erste checkbox
local tAnchorPointY = -120
local tAnchorPointX = 30
local tAnchorPointCount = 0
--alle kräuter der jeweiligen untertabelle durchgehen und jeweils eine checkbox erstellen
--alle kräuter der jeweiligen untertabelle durchgehen und jeweils eine checkbox erstellen
for itemID, optionValue in pairs(MillButton_Herblist[expansion]) do

--name des krauts für das label der checkbox holen
--name des krauts für das label der checkbox holen
local itemName = L[tostring(itemID)]
local itemcount = GetItemCount(itemID, true)
--checkbox erstellen (siehe helper function unten) und für späteren zugriff referenz auf checkbox-objekt mit itemid vom kraut als index in herbCheckboxes speichern
--checkbox erstellen (siehe helper function unten) und für späteren zugriff referenz auf checkbox-objekt mit itemid vom kraut als index in herbCheckboxes speichern
self.herbCheckboxes[itemID] = Addon:CreateOptionsCheckButton(self, itemName, itemID, itemcount)
self.herbCheckboxes[itemID].itemID = itemID
table.sort(self.herbCheckboxes[itemID])
--passend anordnen
self.herbCheckboxes[itemID]:SetPoint("TOPLEFT", self, "TOPLEFT", tAnchorPointX, tAnchorPointY)
--ankerpunkt für die nächste checkbox
--ankerpunkt für die nächste checkbox
tAnchorPointY = tAnchorPointY - self.herbCheckboxes[itemID]:GetHeight()
tAnchorPointCount = tAnchorPointCount + 1
if tAnchorPointCount > 16 then
Expand All @@ -240,7 +242,7 @@ Options = CreateFrame("Frame", ADDON.."Options", InterfaceOptionsFramePanelConta
end
end
end
--alle inhalte self.herbCheckboxes durchgehen und den aktuellen wert (checked/nicht checked bzw. true/false) für die checkbox entsprechend der db festlegen
--alle inhalte self.herbCheckboxes durchgehen und den aktuellen wert (checked/nicht checked bzw. true/false) für die checkbox entsprechend der db festlegen
for itemID, checkboxObj in pairs(self.herbCheckboxes) do

--wert der checkbox entsprechend der tabelle festlegen
Expand All @@ -257,7 +259,7 @@ Options = CreateFrame("Frame", ADDON.."Options", InterfaceOptionsFramePanelConta
checkboxObj:SetChecked(MillButton_Herblist[expansion][itemID])
end

--bei wertänderung auf true in der db speichern
--bei wertänderung auf true in der db speichern
checkboxObj:SetScript("OnClick", function(self)
PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON or SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF)
if MillButton_Dev.debug == true then
Expand Down Expand Up @@ -324,4 +326,4 @@ function Addon:CreateOptionsCheckButton(pParentFrame, pLabelText, pLabelID, pIte

return tCheckBoxFrame
end
--[ Checkbox HELPERS Ende ]
--[ Checkbox HELPERS Ende ]
Binary file added gfx/SL.blp
Binary file not shown.
Binary file added gfx/Shadowlands.blp
Binary file not shown.
10 changes: 7 additions & 3 deletions herb_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ MillButton_Herblist = {
[152511] = false, --Sea Stalk
[168487] = false, --Zin'anthid
},
--[[["Shadowlands"] = {
[tdb] = false, -- tdb
},]]
["Shadowlands"] = {
[168586] = false, --Rising Glory
[168583] = false, --Widowbloom
[168589] = false, --Marrowroot
[171315] = false, --Nightshade
[169701] = false, --Death Blossom
},
};
3 changes: 2 additions & 1 deletion locales/deDE.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local L = LibStub("AceLocale-3.0"):NewLocale("MillButton", "deDE")
local L = LibStub("AceLocale-3.0"):NewLocale("MillButton", "deDE")

if not L then return end

--@localization(locale="deDE", format="lua_additive_table")@
5 changes: 5 additions & 0 deletions locales/enUS.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
local L = LibStub("AceLocale-3.0"):NewLocale("MillButton", "enUS", true)
L["168586"] = "Rising Glory"
L["168583"] = "Widowbloom"
L["168589"] = "Marrowroot"
L["171315"] = "Nightshade"
L["169701"] = "Death Blossom"
L["168487"] = "Zin'anthid"
L["152511"] = "Sea Stalk"
L["152509"] = "Siren's Pollen"
Expand Down
1 change: 1 addition & 0 deletions locales/esES.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local L = LibStub("AceLocale-3.0"):NewLocale("MillButton", "esES")

if not L then return end

--@localization(locale="esES", format="lua_additive_table")@
1 change: 1 addition & 0 deletions locales/frFR.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local L = LibStub("AceLocale-3.0"):NewLocale("MillButton", "frFR")

if not L then return end

--@localization(locale="frFR", format="lua_additive_table")@
1 change: 1 addition & 0 deletions locales/itIT.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local L = LibStub("AceLocale-3.0"):NewLocale("MillButton", "itIT")

if not L then return end

--@localization(locale="itIT", format="lua_additive_table")@
1 change: 1 addition & 0 deletions locales/ptBR.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local L = LibStub("AceLocale-3.0"):NewLocale("MillButton", "ptBR")

if not L then return end

--@localization(locale="ptBR", format="lua_additive_table")@
1 change: 1 addition & 0 deletions locales/ruRU.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local L = LibStub("AceLocale-3.0"):NewLocale("MillButton", "ruRU")

if not L then return end

--@localization(locale="ruRU", format="lua_additive_table")@

0 comments on commit 899c67a

Please sign in to comment.