diff --git a/Borders.lua b/Borders.lua index 140c41f..dbcab5b 100644 --- a/Borders.lua +++ b/Borders.lua @@ -721,7 +721,7 @@ local borderOptions = { set = function(info, v) local tex = getTextureAndDB(info) tex.settings.width = v ~= 180 and v or nil - tex:SetWidth(v * (tex.settings.scale or 1)) + tex:SetWidth(v * (tex.settings.scale or 1) * sm.core.sizeScale) end }, height = { @@ -740,7 +740,7 @@ local borderOptions = { set = function(info, v) local tex = getTextureAndDB(info) tex.settings.height = v ~= 180 and v or nil - tex:SetHeight(v * (tex.settings.scale or 1)) + tex:SetHeight(v * (tex.settings.scale or 1) * sm.core.sizeScale) end }, layer = { @@ -968,8 +968,8 @@ do tex:SetBlendMode(t.blendMode or "ADD") tex:SetVertexColor(t.r or 1, t.g or 1, t.b or 1, t.a or 1) tex:SetPoint("CENTER", Minimap, "CENTER", t.hNudge or 0, t.vNudge or 0) - tex:SetWidth((t.width or defaultSize) * (t.scale or 1)) - tex:SetHeight((t.height or defaultSize) * (t.scale or 1)) + tex:SetWidth((t.width or defaultSize) * (t.scale or 1) * sm.core.sizeScale) + tex:SetHeight((t.height or defaultSize) * (t.scale or 1) * sm.core.sizeScale) tex:SetDrawLayer(t.drawLayer or "ARTWORK") tex.rotSpeed = t.rotSpeed or 0 @@ -1088,13 +1088,15 @@ function mod:UpdateBorder() MinimapBorder:Show() else MinimapBackdrop:Show() - MinimapCompassTexture:SetSize(157, 168) -- We shrink the minimap so we gotta shrink the border also + MinimapCompassTexture:SetSize(157 * sm.core.sizeScale, 168 * sm.core.sizeScale) -- We shrink the minimap so we gotta shrink the border also end end end function mod:UpdateBackdrop() if mod.db.backdrop.show then + customBackdrop:SetWidth(Minimap:GetWidth()) + customBackdrop:SetHeight(Minimap:GetHeight()) customBackdrop:Show() customBackdrop:SetScale(mod.db.backdrop.scale or 1) customBackdrop:SetAlpha(mod.db.backdrop.alpha or 1) diff --git a/SexyMap.lua b/SexyMap.lua index 47a0c6c..f02a88d 100644 --- a/SexyMap.lua +++ b/SexyMap.lua @@ -140,9 +140,36 @@ mod.options = { end, disabled = not MinimapNorthTag, }, - zoom = { + size = { order = 7, type = "range", + name = L["Size (diameter)"], + min = 20, + max = 300, + step = 1, + bigStep = 10, + width = 2, + get = function(info) + return mod.db.size + end, + set = function(info, v) + mod.db.size = v + mod.sizeScale = v / 140 + Minimap:SetSize(v, v) + + -- workaround to update the aktual size of the Minimap + -- without the need to move the character + -- TODO: find better solution + Minimap:SetScale(mod.db.scale+1); + Minimap:SetScale(mod.db.scale); + + sm.buttons:UpdateDraggables() + sm.borders:ApplySettings() + end, + }, + zoom = { + order = 8, + type = "range", name = L["Auto Zoom-Out Delay"], desc = L["If you zoom into the map, this feature will automatically zoom out after the selected period of time (seconds). Using a value of 0 will disable Auto Zoom-Out."], width = 2, @@ -158,18 +185,18 @@ mod.options = { end, }, spacer1 = { - order = 8, + order = 9, type = "description", width = "full", name = "\n\n", }, presetHeader = { - order = 9, + order = 10, type = "header", name = L["Preset"], }, spacer2 = { - order = 10, + order = 11, type = "description", width = "full", name = L["Quickly change the look of your minimap by using a minimap preset."].."\n", @@ -378,6 +405,9 @@ function mod:ADDON_LOADED(addon) end mod.db = dbToDispatch.core + mod.db.size = mod.db.size or 140 + mod.sizeScale = mod.db.size / 140 + mod.loadModules = {} for k,v in pairs(sm) do if v.OnInitialize then @@ -566,8 +596,8 @@ function mod:SetupMap() end Minimap:RegisterForDrag("LeftButton") Minimap:SetClampedToScreen(mod.db.clamp) + Minimap:SetSize(mod.db.size, mod.db.size) Minimap:SetScale(mod.db.scale or (MinimapNorthTag and 1 or 1.1)) - Minimap:SetSize(140, 140) Minimap:SetMovable(not mod.db.lock) if mod.db.rotate then @@ -621,7 +651,7 @@ function public:Restore() mod.frame.SetPoint(Minimap, mod.db.point, UIParent, mod.db.relpoint, mod.db.x, mod.db.y) Minimap:SetClampedToScreen(mod.db.clamp) Minimap:SetScale(mod.db.scale or (MinimapNorthTag and 1 or 1.1)) - Minimap:SetSize(140, 140) + Minimap:SetSize(mod.db.size, mod.db.size) Minimap:SetMovable(not mod.db.lock) end diff --git a/localization/deDE.lua b/localization/deDE.lua index 6c35596..02e3c6d 100644 --- a/localization/deDE.lua +++ b/localization/deDE.lua @@ -138,6 +138,7 @@ L["Show North Tag"] = "Zeige Norden-Anzeiger" L["Show on minimap"] = "Zeige an der Minikarte" L["Show %s:"] = "Zeige %s:" L["Show who pinged"] = "Zeige wer gepingt hat" +L["Size (diameter)"] = "Größe (Durchmesser)" L["Snowflake"] = "Schneeflocke" L["Spice up your minimap with some sexy options."] = "Peppe deine Minikarte auf, mit ein paar sexy Optionen." L["Square"] = "Rechteck" diff --git a/localization/enUS.lua b/localization/enUS.lua index 15172b0..53fb891 100644 --- a/localization/enUS.lua +++ b/localization/enUS.lua @@ -169,6 +169,7 @@ L["Right clicking the map will open the SexyMap options"] = "Right clicking the L["Auto Zoom-Out Delay"] = "Auto Zoom-Out Delay" L["If you zoom into the map, this feature will automatically zoom out after the selected period of time (seconds). Using a value of 0 will disable Auto Zoom-Out."] = "If you zoom into the map, this feature will automatically zoom out after the selected period of time (seconds). Using a value of 0 will disable Auto Zoom-Out." L["Show North Tag"] = "Show North Tag" +L["Size (diameter)"] = "Size (diameter)" L["Profiles"] = "Profiles" L["Copy a Profile"] = "Copy a Profile" L["Copying this profile will reload your UI, are you sure?"] = "Copying this profile will reload your UI, are you sure?"