0
-local path = "Interface\\AddOns\\Blipstick\\"
0
-local textures = {"Default", "SmallExclaim", "LittleExclaim", "Nandini", "Nandini-black", "AlternateBlips"}
0
-Minimap:SetBlipTexture("Interface\\AddOns\\Blipstick\\SmallExclaim")
0
+local GAP, EDGEGAP, ROWHEIGHT = 8, 16, 43
0
+local DEFAULTPATH = "Interface\\Minimap\\ObjectIcons"
0
+local path = "Interface\\AddOns\\Blipstick\\"
0
+local textures = {"Default", "SmallExclaim", "LittleExclaim", "Nandini", "Nandini-black", "AlternateBlips"}
0
+------------------------------
0
+------------------------------
0
+local frame = CreateFrame("Frame", nil, UIParent)
0
+frame:RegisterEvent("ADDON_LOADED")
0
+frame:SetScript("OnEvent", function (self, event, addon)
0
+ if addon ~= "Blipstick" then return end
0
+ BlipStickDB = BlipStickDB or {texture = "SmallExclaim"}
0
+ Minimap:SetBlipTexture(self.db.texture == "Default" and DEFAULTPATH or path..self.db.texture)
0
-local GAP, EDGEGAP, ROWHEIGHT = 8, 16, 43
0
+ self:UnregisterEvent("ADDON_LOADED")
0
+ f:SetScript("OnEvent", nil)
0
+----------------------------
0
+----------------------------
0
-local frame = CreateFrame("Frame", nil, UIParent)
0
frame.name = "Blipstick"
0
frame:SetScript("OnShow", function(frame)
0
@@ -27,11 +39,12 @@ frame:SetScript("OnShow", function(frame)
0
local anchor, rows = subtitle, {}
0
local function OnClick(self)
0
+ frame.db.texture = self.texture
0
Minimap:SetBlipTexture(self.texture)
0
for _,row in pairs(rows) do row:SetChecked(row == self) end
0
for _,name in ipairs(textures) do
0
- local texture = name == "Default" and
"Interface\\Minimap\\ObjectIcons" or path..name
0
+ local texture = name == "Default" and
DEFAULTPATH or path..name
0
local row = CreateFrame("CheckButton", nil, frame)
0
row:SetHeight(ROWHEIGHT)
0
@@ -39,6 +52,7 @@ frame:SetScript("OnShow", function(frame)
0
row:SetPoint("LEFT", frame, "LEFT", EDGEGAP, 0)
0
row:SetPoint("RIGHT", frame, "RIGHT", -EDGEGAP, 0)
0
+ row:SetChecked(name == frame.db.texture)
0
row:SetScript("OnClick", OnClick)
Comments
No one has commented yet.