Add files via upload

This commit is contained in:
Relationship
2026-07-02 13:47:16 +01:00
committed by GitHub
commit aad6d666ea
46 changed files with 3091 additions and 0 deletions
+557
View File
@@ -0,0 +1,557 @@
local useUiScale = tonumber(GetCVar("useUiScale"))
local uiScale = GetCVar("uiScale")
if useUiScale ~= 1 then uiScale = 1 end
frameWidth = UIParent:GetWidth() / uiScale
xMiddle = frameWidth / 2
frameHeight = UIParent:GetHeight() / uiScale
yMiddle = frameHeight / 2
frameScale = 0.75999999046326
local _G = getfenv(0)
local timeElapsed = 0
local updateTime = 1/60
CTextures = {}
CRotateTextures = {}
-- Default minimap dimensions (before any scaling)
local defaultMinimapWidth = 140
local defaultMinimapHeight = 140
-- Track hidden minimap buttons so we can restore them
local hiddenMinimapButtons = {}
-- Minimap cluster Show hook state (for minimap hide/show toggle)
local minimapClusterHooked = false
local minimapClusterOrigShow = nil
local minimapOrigShow = nil
-- Minimap button Show hook state
local minimapBtnHooked = false
-- Saved original Show functions for minimap buttons
local hiddenBtnOrigShows = {}
-- Saved original anchor points for minimap buttons (so positions are preserved across hide/show)
-- Format: hiddenBtnOrigPoints[frame] = { {point, relativeTo, relativePoint, xOfs, yOfs}, ... }
local hiddenBtnOrigPoints = {}
-- Addon version for SavedVariables migration
local ADDON_VERSION = 7
local function print(msg)
if msg and msg ~= "" then
DEFAULT_CHAT_FRAME:AddMessage(msg, 1, 1, 0)
end
end
function deepCopyHash(t)
if t == nil then return nil end
local nt = {}
for k, v in pairs(t) do
if type(v) == "table" then
nt[k] = deepCopyHash(v)
else
nt[k] = v
end
end
return nt
end
function destroyTable(t)
setmetatable(t, nil)
for k,v in pairs(t) do
t[k] = nil
end
end
-- ============================================
-- SavedVariables Migration
-- ============================================
-- Detects and fixes stale/invalid data from older addon versions.
-- Called during PLAYER_ENTERING_WORLD before any settings are applied.
local function MigrateSavedVariables()
if not SexyMap2DB then
SexyMap2DB = {}
end
-- Version-based migration: if the saved version is older than current,
-- apply fixes. This runs ONCE per version bump.
local savedVersion = SexyMap2DB.version or 0
-- Always check for invalid data regardless of version,
-- since the user might have stale data from before version tracking existed.
-- Fix empty borders array (from v1.4 when some presets had empty borders)
if SexyMap2DB.borders == nil or (type(SexyMap2DB.borders) == "table" and table.getn(SexyMap2DB.borders) == 0 and next(SexyMap2DB.borders) == nil) then
SexyMap2DB.borders = deepCopyHash(borderPresets["Diablo by Zork"].borders)
print("[SexyMap] Migrated: empty borders reset to default preset.")
end
-- Fix backdrop with invalid/missing data
if SexyMap2DB.backdrop == nil then
SexyMap2DB.backdrop = deepCopyHash(borderPresets["Diablo by Zork"].backdrop)
print("[SexyMap] Migrated: missing backdrop reset to default preset.")
else
-- Fix empty borderColor/textureColor that cause green rendering
if SexyMap2DB.backdrop.borderColor == nil or (type(SexyMap2DB.backdrop.borderColor) == "table" and next(SexyMap2DB.backdrop.borderColor) == nil) then
SexyMap2DB.backdrop.borderColor = { r = 1, g = 1, b = 1, a = 1 }
end
if SexyMap2DB.backdrop.textureColor == nil or (type(SexyMap2DB.backdrop.textureColor) == "table" and next(SexyMap2DB.backdrop.textureColor) == nil) then
SexyMap2DB.backdrop.textureColor = { r = 0, g = 0, b = 0, a = 1 }
end
-- Fix settings with .blp in edgeFile/bgFile (WoW 1.12 auto-appends .blp)
if SexyMap2DB.backdrop.settings then
local s = SexyMap2DB.backdrop.settings
if s.edgeFile and string.find(s.edgeFile, "%.blp$") then
s.edgeFile = string.gsub(s.edgeFile, "%.blp$", "")
print("[SexyMap] Migrated: removed .blp from backdrop edgeFile.")
end
if s.bgFile and string.find(s.bgFile, "%.blp$") then
s.bgFile = string.gsub(s.bgFile, "%.blp$", "")
print("[SexyMap] Migrated: removed .blp from backdrop bgFile.")
end
end
end
-- Fix missing/empty shape
if SexyMap2DB.shape == nil or SexyMap2DB.shape == "" then
SexyMap2DB.shape = "Round"
end
-- Ensure all expected fields exist
if SexyMap2DB.showZoneText == nil then
SexyMap2DB.showZoneText = true
end
if SexyMap2DB.showMinimapButtons == nil then
SexyMap2DB.showMinimapButtons = true
end
if SexyMap2DB.mapScale == nil then
SexyMap2DB.mapScale = 1.0
end
if SexyMap2DB.showMinimap == nil then
SexyMap2DB.showMinimap = true
end
if not SexyMap2DB.userPresets then
SexyMap2DB.userPresets = {}
end
-- Mark the current version so migration doesn't re-run needlessly
-- (but the checks above still protect against manually-edited bad data)
SexyMap2DB.version = ADDON_VERSION
end
function CMap_OnLoad()
print("[SexyMap] v1.7 loaded for OctoWoW. Type '/sm' or '/sexymap' to open the menu.")
this:SetScript("OnEvent", CMap_OnEvent)
this:SetScript("OnUpdate", CMap_OnUpdate)
this:RegisterEvent("PLAYER_ENTERING_WORLD")
end
function CMap_OnEvent()
if event == "PLAYER_ENTERING_WORLD" then
this:UnregisterEvent("PLAYER_ENTERING_WORLD")
-- Run migration FIRST, before any settings are applied
MigrateSavedVariables()
-- Capture the default minimap dimensions before we modify anything
defaultMinimapWidth = Minimap:GetWidth()
defaultMinimapHeight = Minimap:GetHeight()
CreateFrame("Frame", "CMinimapBackdrop", Minimap)
CMinimapBackdrop:SetFrameStrata("BACKGROUND")
CMinimapBackdrop:SetFrameLevel(CMinimapBackdrop:GetFrameLevel() - 1)
CMinimapBackdrop:SetPoint("CENTER", Minimap, "CENTER")
CMinimapBackdrop:SetWidth(Minimap:GetWidth())
CMinimapBackdrop:SetHeight(Minimap:GetHeight())
-- Set an explicit default backdrop so the frame never renders as green
-- (a frame with no backdrop set can render as solid green in WoW 1.12)
CMinimapBackdrop:SetBackdrop({
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = false,
edgeSize = 16,
insets = { left = 4, right = 4, top = 4, bottom = 4 }
})
CMinimapBackdrop:SetBackdropColor(0, 0, 0, 1)
CMinimapBackdrop:SetBackdropBorderColor(1, 1, 1, 1)
CHideAnnoyingStuff()
CUpdateZoneText()
CUpdateMinimapButtonsVisibility()
CUpdateMinimapVisibility()
CApplyMapScale()
CLoadArtwork()
SlashCmdList["CMAP"] = CMap_SlashCmdHandler
SLASH_CMAP1 = "/cm"
SLASH_CMAP2 = "/sm"
SLASH_CMAP3 = "/sexymap"
end
end
function CMap_OnUpdate()
timeElapsed = timeElapsed + arg1
if timeElapsed >= updateTime then
for k,v in pairs(CRotateTextures) do
CRotateTexture(_G[k], v * timeElapsed)
end
timeElapsed = 0
end
end
function CMap_SlashCmdHandler(msg)
if not CMinimapOptionFrame.menuState then
CInitiateMenu()
else
CHideMenu()
end
end
function CHideAnnoyingStuff()
-- Hide the default minimap border art (we draw our own borders)
MinimapBorder:Hide()
MinimapBorderTop:Hide()
-- Hide the X button (minimap toggle) — we now control this from the GUI
MinimapToggleButton:Hide()
-- Hide zoom buttons ( SexyMap handles its own zoom or user doesn't need them )
MinimapZoomIn:Hide()
MinimapZoomOut:Hide()
-- Style the zone text font
MinimapZoneText:SetFont("Fonts\\FRIZQT__.TTF", 11, "OUTLINE")
end
-- ============================================
-- Minimap visibility (replaces the X button)
-- ============================================
-- In vanilla WoW 1.12, MinimapToggleButton calls ToggleMinimap() which
-- hides/shows just the Minimap frame. We replace this with a full
-- MinimapCluster hide/show controlled from the GUI, and hook Show/Hide
-- to prevent anything from re-showing the minimap when it should be hidden.
local function MinimapClusterHookedShow(self)
if not SexyMap2DB.showMinimap then
return -- Block the Show, minimap stays hidden
end
if minimapClusterOrigShow then
minimapClusterOrigShow(self)
end
end
local function MinimapHookedShow(self)
if not SexyMap2DB.showMinimap then
return -- Block the Show, minimap stays hidden
end
if minimapOrigShow then
minimapOrigShow(self)
end
end
function CUpdateMinimapVisibility()
if SexyMap2DB.showMinimap then
-- Show the minimap cluster - unhook first
if minimapClusterHooked then
if MinimapCluster then
MinimapCluster.Show = minimapClusterOrigShow
end
if Minimap then
Minimap.Show = minimapOrigShow
end
minimapClusterHooked = false
minimapClusterOrigShow = nil
minimapOrigShow = nil
end
-- Show everything
if MinimapCluster then MinimapCluster:Show() end
if Minimap then Minimap:Show() end
-- Re-apply our hidden stuff (borders, zoom buttons, X button stay hidden)
CHideAnnoyingStuff()
-- Re-apply button visibility settings
CUpdateMinimapButtonsVisibility()
else
-- Hide the entire minimap cluster and hook Show to prevent re-appearance
if MinimapCluster then
if not minimapClusterHooked then
minimapClusterOrigShow = MinimapCluster.Show
MinimapCluster.Show = MinimapClusterHookedShow
minimapOrigShow = Minimap.Show
Minimap.Show = MinimapHookedShow
minimapClusterHooked = true
end
MinimapCluster:Hide()
end
end
end
-- ============================================
-- Minimap buttons visibility
-- ============================================
local function MinimapBtnHookedShow(self)
if not SexyMap2DB.showMinimapButtons then
return -- Block Show while buttons should be hidden
end
-- When buttons are allowed, call the original Show
local orig = hiddenBtnOrigShows[self]
if orig then
orig(self)
end
end
-- Save a frame's current anchor points so we can restore them later
local function SaveButtonPoints(frame)
local points = {}
local numPoints = frame:GetNumPoints()
if numPoints and numPoints > 0 then
for i = 1, numPoints do
local point, relativeTo, relativePoint, xOfs, yOfs = frame:GetPoint(i)
if point then
table.insert(points, {
point = point,
relativeTo = relativeTo,
relativePoint = relativePoint,
xOfs = xOfs,
yOfs = yOfs,
})
end
end
end
-- Only store if we actually got points; don't overwrite existing saved points with empty
if table.getn(points) > 0 then
hiddenBtnOrigPoints[frame] = points
end
end
-- Restore a frame's saved anchor points
local function RestoreButtonPoints(frame)
local points = hiddenBtnOrigPoints[frame]
if points and table.getn(points) > 0 then
frame:ClearAllPoints()
for _, pt in ipairs(points) do
frame:SetPoint(pt.point, pt.relativeTo, pt.relativePoint, pt.xOfs, pt.yOfs)
end
end
-- Clean up saved points for this frame
hiddenBtnOrigPoints[frame] = nil
end
function CUpdateMinimapButtonsVisibility()
if SexyMap2DB.showMinimapButtons then
-- Show only the buttons we previously hid (preserves original visibility)
for _, btn in ipairs(hiddenMinimapButtons) do
if btn then
-- Restore original Show
local orig = hiddenBtnOrigShows[btn]
if orig then
btn.Show = orig
hiddenBtnOrigShows[btn] = nil
end
-- Restore saved anchor points (preserves button positions across hide/show)
RestoreButtonPoints(btn)
btn:Show()
end
end
hiddenMinimapButtons = {}
else
-- Find and hide only VISIBLE minimap buttons, hook their Show
hiddenMinimapButtons = {}
local children = { Minimap:GetChildren() }
for idx, frame in ipairs(children) do
local objType = frame:GetObjectType()
if objType == "Button" or objType == "CheckButton" then
local name = frame:GetName() or ""
-- Skip our own frames and WoW native controls we already hide
if name ~= "MinimapZoomIn" and name ~= "MinimapZoomOut"
and name ~= "MinimapToggleButton" and name ~= "GameTimeFrame"
and name ~= "CMinimapBackdrop" then
-- Only hide buttons that are currently visible
-- (buttons already hidden by other addons should stay hidden)
if frame:IsVisible() then
-- Save anchor points before hiding so we can restore them later
SaveButtonPoints(frame)
-- Hook Show to prevent re-appearance
if not hiddenBtnOrigShows[frame] then
hiddenBtnOrigShows[frame] = frame.Show
frame.Show = MinimapBtnHookedShow
end
frame:Hide()
table.insert(hiddenMinimapButtons, frame)
end
end
end
end
-- Also hide known WoW minimap frames by name (only if visible)
local knownFrames = {
"MiniMapTracking",
"MiniMapTrackingButton",
"MiniMapTrackingFrame",
"MiniMapMailFrame",
"MiniMapMailBorder",
"MiniMapBattlefieldFrame",
"MiniMapMeetingStoneFrame",
"MiniMapWorldMapButton",
"MinimapVoiceChatFrame",
"MiniMapLFGFrame",
}
for _, frameName in ipairs(knownFrames) do
local frame = _G[frameName]
if frame and frame:IsVisible() then
-- Save anchor points before hiding so we can restore them later
SaveButtonPoints(frame)
if not hiddenBtnOrigShows[frame] then
hiddenBtnOrigShows[frame] = frame.Show
frame.Show = MinimapBtnHookedShow
end
frame:Hide()
table.insert(hiddenMinimapButtons, frame)
end
end
end
end
function CApplyMapScale()
local scale = SexyMap2DB.mapScale or 1.0
if scale < 0.3 then scale = 0.3 end
if scale > 1.0 then scale = 1.0 end
SexyMap2DB.mapScale = scale
-- Apply scale to the MinimapCluster which contains everything
MinimapCluster:SetScale(scale)
-- Re-anchor to TOPRIGHT - the anchor point is TOPRIGHT so when scaled down,
-- the right side and top stay put, while the left and bottom move inward
MinimapCluster:ClearAllPoints()
MinimapCluster:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", -14, 10)
-- Update backdrop to match current minimap size
CMinimapBackdrop:SetWidth(Minimap:GetWidth())
CMinimapBackdrop:SetHeight(Minimap:GetHeight())
-- Update border textures to match new minimap size
CUpdateBackdrop()
end
function CUpdateZoneText()
MinimapCluster:ClearAllPoints()
-- Map position: always anchored TOPRIGHT so scale keeps right/top fixed
MinimapCluster:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", -14, 10)
MinimapZoneText:ClearAllPoints()
if SexyMap2DB.showZoneText then
MinimapZoneText:Show()
-- Zone name positioned below the minimap
MinimapZoneText:SetPoint("TOP", Minimap, "BOTTOM", 0, -20)
else
-- Only hide the zone text; map and border do NOT move
MinimapZoneText:Hide()
end
end
-- ============================================
-- Set Defaults - resets all settings to factory
-- ============================================
function CSetDefaults()
-- Reset all SavedVariables to defaults
SexyMap2DB.borders = deepCopyHash(borderPresets["Diablo by Zork"].borders)
SexyMap2DB.backdrop = deepCopyHash(borderPresets["Diablo by Zork"].backdrop)
SexyMap2DB.shape = "Round"
SexyMap2DB.userPresets = {}
SexyMap2DB.showZoneText = true
SexyMap2DB.showMinimapButtons = true
SexyMap2DB.mapScale = 1.0
SexyMap2DB.showMinimap = true
SexyMap2DB.version = ADDON_VERSION
-- Reapply everything
CHideAnnoyingStuff()
CUpdateZoneText()
CUpdateMinimapButtonsVisibility()
CUpdateMinimapVisibility()
CApplyMapScale()
CClearArtwork()
CLoadArtwork()
-- Refresh the GUI if it's open
if CMinimapOptionFrame and CMinimapOptionFrame.menuState then
CUpdatePresetList()
CUpdateShapeList()
CTexture_Update()
CZoneTextToggle_Update()
CMinimapButtonsToggle_Update()
CMinimapToggle_Update()
CMapScaleSlider_Update()
CVariable_Update()
end
print("[SexyMap] All settings reset to defaults.")
end
function CClearArtwork()
for k,v in pairs(CTextures) do
_G[k]:SetTexCoord(0,1,0,1)
_G[k]:Hide()
end
destroyTable(CTextures)
CTextures = {}
destroyTable(CRotateTextures)
CRotateTextures = {}
end
function CLoadArtwork()
if SexyMap2DB.shape then
CApplyShape(SexyMap2DB.shape)
end
for k,v in ipairs(SexyMap2DB.borders) do
CCreateBorder(v)
end
CUpdateBackdrop()
end
function CUpdateBackdrop()
if not SexyMap2DB.backdrop or not SexyMap2DB.backdrop.show then
CMinimapBackdrop:Hide()
else
local backdrop = CMinimapBackdrop
backdrop:Show()
backdrop:SetWidth(Minimap:GetWidth() * (SexyMap2DB.backdrop.scale or 1))
backdrop:SetHeight(Minimap:GetHeight() * (SexyMap2DB.backdrop.scale or 1))
-- Validate the backdrop settings before applying.
-- If edgeFile or bgFile references are invalid, WoW 1.12 renders the frame
-- as solid green (missing texture fallback). We check that the paths exist
-- in the settings table before calling SetBackdrop.
local settings = SexyMap2DB.backdrop.settings
if settings then
-- Ensure edgeFile doesn't have .blp extension (WoW 1.12 auto-appends it)
if settings.edgeFile and string.find(settings.edgeFile, "%.blp$") then
settings.edgeFile = string.gsub(settings.edgeFile, "%.blp$", "")
end
if settings.bgFile and string.find(settings.bgFile, "%.blp$") then
settings.bgFile = string.gsub(settings.bgFile, "%.blp$", "")
end
backdrop:SetBackdrop(settings)
end
-- Set backdrop color with safe defaults for empty/missing color tables
local c = SexyMap2DB.backdrop.textureColor
if c and (c.r or c.g or c.b or c.a) then
backdrop:SetBackdropColor(c.r or 0, c.g or 0, c.b or 0, c.a or 1)
else
-- Default: black background, full opacity
backdrop:SetBackdropColor(0, 0, 0, 1)
end
-- Set border color with safe defaults for empty/missing color tables
c = SexyMap2DB.backdrop.borderColor
if c and (c.r or c.g or c.b or c.a) then
backdrop:SetBackdropBorderColor(c.r or 1, c.g or 1, c.b or 1, c.a or 1)
else
-- Default: white border, full opacity
backdrop:SetBackdropBorderColor(1, 1, 1, 1)
end
end
end
+14
View File
@@ -0,0 +1,14 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\..\FrameXML\UI.xsd">
<Script file="CMap.lua" />
<Script file="borders.lua" />
<Script file="shapes.lua" />
<Script file="presets.lua" />
<Frame name="CMap_Main" hidden="false">
<Scripts>
<OnLoad>
CMap_OnLoad()
</OnLoad>
</Scripts>
</Frame>
</Ui>
+395
View File
@@ -0,0 +1,395 @@
local _G = getfenv(0)
local textureOffset = 0
local minimapX
local minimapY
local getn = table.getn
presetNames = { "Diablo by Zork", "Faded Square by Renaitre", "Blue Rune Circles", "Blue Rune Diamond", "Burning Sun", "Stargate", "Simple Square", "Ruins", "Emerald Portal", "Shamanism", "Space by Ruka", "Clouds by koccs", "Rogue", "Electric", "LL Corner Rounded", }
shapeNames = { "Round", "Square", "Diamond", "Hexagon", "Octagon", "Heart", "Snowflake", "LL Corner Rounded", "LR Corner Rounded", "UL Corner Rounded", "UR Corner Rounded", "Large Circle", "Route66", "Deathsky", "VFX Border",}
variableOptionSliders = {
{ text = "Rotation Speed", func = "CRotSpeedChanged", value = "rotSpeed", minValue = -64, maxValue = 64, valueStep = 1 },
{ text = "Scale", func = "CScaleChanged", value = "scale", minValue = 0.0, maxValue = 4, valueStep = 0.01 },
}
-- Pagination state
local presetPage = 0
local shapePage = 0
local PRESETS_PER_PAGE = 8
local SHAPES_PER_PAGE = 8
local function print(msg)
if msg and msg ~= "" then
DEFAULT_CHAT_FRAME:AddMessage(msg, 1, 1, 1)
end
end
function NotImportant_OnLoad()
end
function CApplyPreset(preset)
local preset = SexyMap2DB.userPresets[preset] or borderPresets[preset]
SexyMap2DB.borders = deepCopyHash(preset.borders)
SexyMap2DB.backdrop = deepCopyHash(preset.backdrop)
SexyMap2DB.shape = preset.shape
CTextureOptionFrame.selectedTexture = nil
CClearArtwork()
CLoadArtwork()
CTexture_Update()
CVariable_Update()
CUpdateShapeList()
end
function CInitiateMenu()
CSexyMapMainFrame:Show()
-- Show sub-frames
CTextureOptionFrame:Show()
CMinimapOptionFrame:Show()
-- Initialize all lists
CUpdatePresetList()
CUpdateShapeList()
CTexture_Update()
CZoneTextToggle_Update()
CMinimapButtonsToggle_Update()
CMinimapToggle_Update()
CMapScaleSlider_Update()
CMinimapOptionFrame.menuState = true
end
function CHideMenu()
CTextureOptionFrame.selectedTexture = nil
CVariableOptionFrame:Hide()
CSexyMapMainFrame:Hide()
CMinimapOptionFrame.menuState = false
end
-------------------------------------------------
-- Preset list (button-based, replaces dropdown)
-------------------------------------------------
function CUpdatePresetList()
local startIdx = presetPage * PRESETS_PER_PAGE + 1
for i = 1, PRESETS_PER_PAGE do
local btn = _G["CPresetBtn"..i]
local idx = startIdx + i - 1
if idx <= getn(presetNames) then
btn:SetText(presetNames[idx])
btn.presetName = presetNames[idx]
btn:Show()
else
btn:Hide()
end
end
-- Prev/Next buttons
if presetPage > 0 then
CPresetPrevBtn:Show()
else
CPresetPrevBtn:Hide()
end
if (presetPage + 1) * PRESETS_PER_PAGE < getn(presetNames) then
CPresetNextBtn:Show()
else
CPresetNextBtn:Hide()
end
end
function CPresetBtn_OnClick()
local name = this.presetName
if name then
CApplyPreset(name)
end
end
function CPresetPrev_OnClick()
if presetPage > 0 then
presetPage = presetPage - 1
CUpdatePresetList()
end
end
function CPresetNext_OnClick()
if (presetPage + 1) * PRESETS_PER_PAGE < getn(presetNames) then
presetPage = presetPage + 1
CUpdatePresetList()
end
end
-------------------------------------------------
-- Shape list (button-based, replaces dropdown)
-------------------------------------------------
function CUpdateShapeList()
local startIdx = shapePage * SHAPES_PER_PAGE + 1
for i = 1, SHAPES_PER_PAGE do
local btn = _G["CShapeBtn"..i]
local idx = startIdx + i - 1
if idx <= getn(shapeNames) then
btn:SetText(shapeNames[idx])
btn.shapeName = shapeNames[idx]
if SexyMap2DB.shape == shapeNames[idx] then
btn:LockHighlight()
else
btn:UnlockHighlight()
end
btn:Show()
else
btn:Hide()
end
end
-- Prev/Next buttons
if shapePage > 0 then
CShapePrevBtn:Show()
else
CShapePrevBtn:Hide()
end
if (shapePage + 1) * SHAPES_PER_PAGE < getn(shapeNames) then
CShapeNextBtn:Show()
else
CShapeNextBtn:Hide()
end
end
function CShapeBtn_OnClick()
local name = this.shapeName
if name then
SexyMap2DB.shape = name
CApplyShape(SexyMap2DB.shape)
CUpdateShapeList()
end
end
function CShapePrev_OnClick()
if shapePage > 0 then
shapePage = shapePage - 1
CUpdateShapeList()
end
end
function CShapeNext_OnClick()
if (shapePage + 1) * SHAPES_PER_PAGE < getn(shapeNames) then
shapePage = shapePage + 1
CUpdateShapeList()
end
end
-------------------------------------------------
-- Texture list (border texture buttons)
-------------------------------------------------
function CTexture_Update()
local button
for i=1,12 do
button = _G["CTextureButton"..i]
textureIndex = textureOffset + i
button.textureIndex = textureIndex
if not SexyMap2DB.borders[textureIndex] then
button:Hide()
else
button:Show()
_G["CTextureButton"..i.."Texture"]:SetText(SexyMap2DB.borders[textureIndex].name or SexyMap2DB.borders[textureIndex].texture)
end
if CTextureOptionFrame.selectedTexture == textureIndex then
button:LockHighlight()
else
button:UnlockHighlight()
end
end
end
function CMinimap_Update()
-- Shape highlight handled in CUpdateShapeList
end
function CVariable_Update()
if not CTextureOptionFrame.selectedTexture then
CVariableOptionFrame:Hide()
return
else
CVariableOptionFrame:Show()
end
local texture = CTextureOptionFrame.selectedTexture
local button
local slider
local string
local thumb
local high
local low
for i,v in ipairs(variableOptionSliders) do
slider = _G["CVariableSlider"..i]
string = _G["CVariableSlider"..i.."Text"]
thumb = _G["CVariableSlider"..i.."Thumb"]
high = _G["CVariableSlider"..i.."High"]
low = _G["CVariableSlider"..i.."Low"]
if slider.disabled then
CDisableSlider(slider)
else
CEnableSlider(slider)
end
slider:SetMinMaxValues(v.minValue, v.maxValue)
slider:SetValueStep(v.valueStep)
-- Clamp stored value to slider range before setting
local storedVal = SexyMap2DB.borders[texture][v.value] or 0
if storedVal < v.minValue then storedVal = v.minValue end
if storedVal > v.maxValue then storedVal = v.maxValue end
slider:SetValue(storedVal)
slider:SetScript("OnValueChanged", _G[v.func])
string:SetText(v.text)
high:SetText(v.maxValue)
low:SetText(v.minValue)
end
end
function CTextureButton_OnClick(button)
local id = this.textureIndex
CTextureOptionFrame.selectedTexture = id
CTexture_Update()
CVariable_Update()
end
function CRotSpeedChanged()
local i = CTextureOptionFrame.selectedTexture
SexyMap2DB.borders[i].rotSpeed = this:GetValue()
CCreateBorder(SexyMap2DB.borders[i])
end
function CScaleChanged()
local i = CTextureOptionFrame.selectedTexture
local val = this:GetValue()
-- Clamp to 0.0 minimum to prevent wrapping
if val < 0 then val = 0 end
SexyMap2DB.borders[i].scale = val
CCreateBorder(SexyMap2DB.borders[i])
end
function CDisableSlider(slider)
local name = slider:GetName();
_G[name.."Thumb"]:Hide();
_G[name.."Text"]:SetVertexColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
_G[name.."Low"]:SetVertexColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
_G[name.."High"]:SetVertexColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
end
function CEnableSlider(slider)
local name = slider:GetName();
_G[name.."Thumb"]:Show();
_G[name.."Text"]:SetVertexColor(NORMAL_FONT_COLOR.r , NORMAL_FONT_COLOR.g , NORMAL_FONT_COLOR.b);
_G[name.."Low"]:SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
_G[name.."High"]:SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
end
function GameMenu_AddButton(button)
if GameMenu_InsertAfter == nil then
GameMenu_InsertAfter = GameMenuButtonMacros
end
if GameMenu_InsertBefore == nil then
GameMenu_InsertBefore = GameMenuButtonLogout
end
button:ClearAllPoints()
button:SetPoint( "TOP", GameMenu_InsertAfter:GetName(), "BOTTOM", 0, -1 )
GameMenu_InsertBefore:SetPoint( "TOP", button:GetName(), "BOTTOM", 0, -1 )
GameMenu_InsertAfter = button
GameMenuFrame:SetHeight( GameMenuFrame:GetHeight() + button:GetHeight() + 2 )
end
-------------------------------------------------
-- Zone Text Toggle
-------------------------------------------------
function CZoneTextToggle_OnClick()
if this:GetChecked() then
SexyMap2DB.showZoneText = true
else
SexyMap2DB.showZoneText = false
end
CUpdateZoneText()
end
function CZoneTextToggle_Update()
if SexyMap2DB.showZoneText then
CZoneTextCheckbox:SetChecked(true)
else
CZoneTextCheckbox:SetChecked(false)
end
end
-------------------------------------------------
-- Minimap Buttons Toggle
-------------------------------------------------
function CMinimapButtonsToggle_OnClick()
if this:GetChecked() then
SexyMap2DB.showMinimapButtons = true
else
SexyMap2DB.showMinimapButtons = false
end
CUpdateMinimapButtonsVisibility()
end
function CMinimapButtonsToggle_Update()
if SexyMap2DB.showMinimapButtons then
CMinimapButtonsCheckbox:SetChecked(true)
else
CMinimapButtonsCheckbox:SetChecked(false)
end
end
-------------------------------------------------
-- Minimap Visibility Toggle (replaces the X button)
-------------------------------------------------
function CMinimapToggle_OnClick()
if this:GetChecked() then
SexyMap2DB.showMinimap = true
else
SexyMap2DB.showMinimap = false
end
CUpdateMinimapVisibility()
end
function CMinimapToggle_Update()
if SexyMap2DB.showMinimap then
CMinimapCheckbox:SetChecked(true)
else
CMinimapCheckbox:SetChecked(false)
end
end
-------------------------------------------------
-- Map Scale Slider
-------------------------------------------------
function CMapScaleSlider_OnValueChanged()
local val = this:GetValue()
if val < 0.3 then val = 0.3 end
if val > 1.0 then val = 1.0 end
SexyMap2DB.mapScale = val
CApplyMapScale()
-- Update the value text
CMapScaleSliderValueText:SetText(string.format("%.2f", val))
end
function CMapScaleSlider_Update()
CMapScaleSlider:SetMinMaxValues(0.3, 1.0)
CMapScaleSlider:SetValueStep(0.05)
local val = SexyMap2DB.mapScale or 1.0
if val < 0.3 then val = 0.3 end
if val > 1.0 then val = 1.0 end
CMapScaleSlider:SetValue(val)
CMapScaleSliderLowText:SetText("0.30")
CMapScaleSliderHighText:SetText("1.00")
CMapScaleSliderValueText:SetText(string.format("%.2f", val))
end
-------------------------------------------------
-- Set Defaults Button
-------------------------------------------------
function CSetDefaultsBtn_OnClick()
CSetDefaults()
end
+711
View File
@@ -0,0 +1,711 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\..\FrameXML\UI.xsd">
<Script file="COptions.lua" />
<!-- ============================================================ -->
<!-- Button Templates -->
<!-- ============================================================ -->
<Button name="CTextureButtonTemplate" virtual="true">
<Size>
<AbsDimension x="250" y="30" />
</Size>
<Layers>
<Layer level="BORDER">
<FontString name="$parentTexture" inherits="GameFontNormal">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="10" y="-3"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
this:RegisterForClicks("LeftButtonUp", "RightButtonUp");
</OnLoad>
<OnClick>
CTextureButton_OnClick(arg1);
PlaySound("igMainMenuOptionCheckBoxOn");
</OnClick>
</Scripts>
<HighlightTexture file="Interface\QuestFrame\UI-QuestTitleHighlight" alphaMode="ADD">
<Size>
<AbsDimension x="250" y="30"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="5" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</HighlightTexture>
</Button>
<!-- Simple list button template for presets/shapes -->
<Button name="CListButtonTemplate" inherits="UIPanelButtonTemplate" virtual="true">
<Size>
<AbsDimension x="200" y="24" />
</Size>
<NormalFont style="GameFontNormalSmall"/>
<HighlightFont style="GameFontHighlightSmall"/>
</Button>
<!-- Small nav button for prev/next page -->
<Button name="CNavButtonTemplate" inherits="UIPanelButtonTemplate" virtual="true">
<Size>
<AbsDimension x="40" y="22"/>
</Size>
<NormalFont style="GameFontNormalSmall"/>
</Button>
<Button name="CMenuButtonTemplate" inherits="UIPanelButtonTemplate" virtual="true">
<Size>
<AbsDimension x="75" y="21"/>
</Size>
</Button>
<!-- ============================================================ -->
<!-- Slider Templates -->
<!-- ============================================================ -->
<Slider name="CHorizontalSliderTemplate" orientation="HORIZONTAL" virtual="true" enableMouse="true">
<Size>
<AbsDimension x="200" y="17"/>
</Size>
<HitRectInsets>
<AbsInset left="0" right="0" top="-10" bottom="-10"/>
</HitRectInsets>
<Backdrop bgFile="Interface\Buttons\UI-SliderBar-Background" edgeFile="Interface\Buttons\UI-SliderBar-Border" tile="true">
<EdgeSize>
<AbsValue val="8"/>
</EdgeSize>
<TileSize>
<AbsValue val="8"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="3" right="3" top="6" bottom="6"/>
</BackgroundInsets>
</Backdrop>
<Layers>
<Layer level="ARTWORK">
<FontString name="$parentText" inherits="GameFontNormalSmall">
<Anchors>
<Anchor point="BOTTOM" relativePoint="TOP"/>
</Anchors>
</FontString>
<FontString name="$parentLow" inherits="GameFontHighlightSmall" text="LOW">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="2" y="3"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentHigh" inherits="GameFontHighlightSmall" text="HIGH">
<Anchors>
<Anchor point="TOPRIGHT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-2" y="3"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<ThumbTexture name="$parentThumb" file="Interface\Buttons\UI-SliderBar-Button-Horizontal">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
</ThumbTexture>
</Slider>
<!-- ============================================================ -->
<!-- Game Menu Entry -->
<!-- ============================================================ -->
<Button name="GameMenuButtonCMap" parent="GameMenuFrame" inherits="GameMenuButtonTemplate" text="SexyMap">
<Scripts>
<OnLoad>
GameMenu_AddButton(this)
</OnLoad>
<OnClick>
PlaySound("igMainMenuOption")
HideUIPanel(GameMenuFrame)
CInitiateMenu()
</OnClick>
</Scripts>
</Button>
<!-- ============================================================ -->
<!-- Main Options Panel -->
<!-- ============================================================ -->
<Frame name="CSexyMapMainFrame" frameStrata="DIALOG" hidden="true" enableMouse="true" parent="UIParent" movable="true">
<Size>
<AbsDimension x="750" y="600" />
</Size>
<Anchors>
<Anchor point="CENTER" relativeTo="UIParent" relativePoint="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<BackgroundInsets>
<AbsInset left="4" right="4" top="4" bottom="4" />
</BackgroundInsets>
<TileSize>
<AbsValue val="32" />
</TileSize>
<EdgeSize>
<AbsValue val="32" />
</EdgeSize>
</Backdrop>
<Scripts>
<OnLoad>
this:RegisterForDrag("LeftButton")
</OnLoad>
<OnDragStart>
this:StartMoving()
</OnDragStart>
<OnDragStop>
this:StopMovingOrSizing()
</OnDragStop>
</Scripts>
<Layers>
<Layer level="ARTWORK">
<!-- Title -->
<FontString name="CSexyMapTitle" inherits="GameFontNormalLarge" text="SexyMap - OctoWoW">
<Anchors>
<Anchor point="TOP" relativePoint="TOP">
<Offset>
<AbsDimension x="0" y="-18"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<!-- Presets section label -->
<FontString name="CPresetLabel" inherits="GameFontNormal" text="Presets:">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="25" y="-48"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<!-- Shapes section label -->
<FontString name="CShapeLabel" inherits="GameFontNormal" text="Shapes:">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="230" y="-48"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<!-- Borders section label -->
<FontString name="CBordersLabel" inherits="GameFontNormal" text="Border Layers:">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="445" y="-48"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="CPresetBtn1" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CSexyMapMainFrame" relativePoint="TOPLEFT">
<Offset><AbsDimension x="15" y="-65"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CPresetBtn_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CPresetBtn2" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CPresetBtn1" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-3"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CPresetBtn_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CPresetBtn3" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CPresetBtn2" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-3"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CPresetBtn_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CPresetBtn4" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CPresetBtn3" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-3"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CPresetBtn_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CPresetBtn5" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CPresetBtn4" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-3"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CPresetBtn_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CPresetBtn6" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CPresetBtn5" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-3"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CPresetBtn_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CPresetBtn7" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CPresetBtn6" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-3"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CPresetBtn_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CPresetBtn8" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CPresetBtn7" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-3"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CPresetBtn_OnClick()</OnClick>
</Scripts>
</Button>
<!-- Preset page nav -->
<Button name="CPresetPrevBtn" inherits="CNavButtonTemplate" text="Prev">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CPresetBtn8" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-5"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CPresetPrev_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CPresetNextBtn" inherits="CNavButtonTemplate" text="Next">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CPresetPrevBtn" relativePoint="TOPRIGHT">
<Offset><AbsDimension x="5" y="0"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CPresetNext_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CShapeBtn1" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CSexyMapMainFrame" relativePoint="TOPLEFT">
<Offset><AbsDimension x="225" y="-65"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CShapeBtn_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CShapeBtn2" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CShapeBtn1" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-3"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CShapeBtn_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CShapeBtn3" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CShapeBtn2" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-3"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CShapeBtn_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CShapeBtn4" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CShapeBtn3" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-3"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CShapeBtn_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CShapeBtn5" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CShapeBtn4" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-3"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CShapeBtn_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CShapeBtn6" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CShapeBtn5" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-3"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CShapeBtn_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CShapeBtn7" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CShapeBtn6" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-3"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CShapeBtn_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CShapeBtn8" inherits="CListButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CShapeBtn7" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-3"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CShapeBtn_OnClick()</OnClick>
</Scripts>
</Button>
<!-- Shape page nav -->
<Button name="CShapePrevBtn" inherits="CNavButtonTemplate" text="Prev">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CShapeBtn8" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-5"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CShapePrev_OnClick()</OnClick>
</Scripts>
</Button>
<Button name="CShapeNextBtn" inherits="CNavButtonTemplate" text="Next">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CShapePrevBtn" relativePoint="TOPRIGHT">
<Offset><AbsDimension x="5" y="0"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>CShapeNext_OnClick()</OnClick>
</Scripts>
</Button>
<!-- ====================================================== -->
<!-- Border Texture List (right column, top) -->
<!-- ====================================================== -->
<Frame name="CTextureOptionFrame" hidden="true">
<Frames>
<Button name="CTextureButton1" inherits="CTextureButtonTemplate" id="1">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CSexyMapMainFrame" relativePoint="TOPLEFT">
<Offset><AbsDimension x="440" y="-65"/></Offset>
</Anchor>
</Anchors>
</Button>
<Button name="CTextureButton2" inherits="CTextureButtonTemplate" id="2">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CTextureButton1" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
</Button>
<Button name="CTextureButton3" inherits="CTextureButtonTemplate" id="3">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CTextureButton2" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
</Button>
<Button name="CTextureButton4" inherits="CTextureButtonTemplate" id="4">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CTextureButton3" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
</Button>
<Button name="CTextureButton5" inherits="CTextureButtonTemplate" id="5">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CTextureButton4" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
</Button>
<Button name="CTextureButton6" inherits="CTextureButtonTemplate" id="6">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CTextureButton5" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
</Button>
<Button name="CTextureButton7" inherits="CTextureButtonTemplate" id="7">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CTextureButton6" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
</Button>
<Button name="CTextureButton8" inherits="CTextureButtonTemplate" id="8">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CTextureButton7" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
</Button>
<Button name="CTextureButton9" inherits="CTextureButtonTemplate" id="9">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CTextureButton8" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
</Button>
<Button name="CTextureButton10" inherits="CTextureButtonTemplate" id="10">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CTextureButton9" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
</Button>
<Button name="CTextureButton11" inherits="CTextureButtonTemplate" id="11">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CTextureButton10" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
</Button>
<Button name="CTextureButton12" inherits="CTextureButtonTemplate" id="12">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CTextureButton11" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
</Button>
</Frames>
</Frame>
<!-- ====================================================== -->
<!-- Separator line -->
<!-- ====================================================== -->
<Frame name="CSeparatorLine">
<Size>
<AbsDimension x="710" y="1"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CSexyMapMainFrame" relativePoint="TOPLEFT">
<Offset><AbsDimension x="20" y="-310"/></Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture name="CSeparatorTexture">
<Anchors>
<Anchor point="TOPLEFT"/>
<Anchor point="BOTTOMRIGHT"/>
</Anchors>
<Color r="0.5" g="0.5" b="0.5" a="0.8"/>
</Texture>
</Layer>
</Layers>
</Frame>
<!-- ====================================================== -->
<!-- Bottom row: Checkboxes + Scale Slider -->
<!-- ====================================================== -->
<Frame name="CMinimapOptionFrame" hidden="true">
<Frames>
<!-- Row 1 of checkboxes: Zone, Minimap Buttons, Show Minimap -->
<!-- Zone text checkbox -->
<CheckButton name="CZoneTextCheckbox" inherits="UICheckButtonTemplate" id="1">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CSexyMapMainFrame" relativePoint="TOPLEFT">
<Offset><AbsDimension x="30" y="-325"/></Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<FontString name="CZoneTextCheckboxText" inherits="GameFontNormalSmall" text="Show Zone Name">
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT">
<Offset><AbsDimension x="5" y="0"/></Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnClick>CZoneTextToggle_OnClick()</OnClick>
</Scripts>
</CheckButton>
<!-- Show Minimap Buttons checkbox -->
<CheckButton name="CMinimapButtonsCheckbox" inherits="UICheckButtonTemplate" id="3">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CSexyMapMainFrame" relativePoint="TOPLEFT">
<Offset><AbsDimension x="310" y="-325"/></Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<FontString name="CMinimapButtonsCheckboxText" inherits="GameFontNormalSmall" text="Show Minimap Buttons">
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT">
<Offset><AbsDimension x="5" y="0"/></Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnClick>CMinimapButtonsToggle_OnClick()</OnClick>
</Scripts>
</CheckButton>
<!-- Show Minimap checkbox (replaces the X toggle button) -->
<CheckButton name="CMinimapCheckbox" inherits="UICheckButtonTemplate" id="4">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CSexyMapMainFrame" relativePoint="TOPLEFT">
<Offset><AbsDimension x="490" y="-325"/></Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<FontString name="CMinimapCheckboxText" inherits="GameFontNormalSmall" text="Show Minimap">
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT">
<Offset><AbsDimension x="5" y="0"/></Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnClick>CMinimapToggle_OnClick()</OnClick>
</Scripts>
</CheckButton>
<!-- Row 2: Map Scale slider -->
<Slider name="CMapScaleSlider" inherits="CHorizontalSliderTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CSexyMapMainFrame" relativePoint="TOPLEFT">
<Offset><AbsDimension x="60" y="-370"/></Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<FontString name="CMapScaleSliderLabel" inherits="GameFontNormal" text="Map Scale:">
<Anchors>
<Anchor point="RIGHT" relativeTo="CMapScaleSlider" relativePoint="LEFT">
<Offset><AbsDimension x="-10" y="0"/></Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="CMapScaleSliderValueText" inherits="GameFontHighlightSmall" text="1.00">
<Anchors>
<Anchor point="LEFT" relativeTo="CMapScaleSlider" relativePoint="RIGHT">
<Offset><AbsDimension x="10" y="0"/></Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnValueChanged>CMapScaleSlider_OnValueChanged()</OnValueChanged>
</Scripts>
</Slider>
</Frames>
</Frame>
<!-- Variable sliders frame (shown when a border texture is selected) -->
<Frame name="CVariableOptionFrame" hidden="true">
<Frames>
<!-- Slider label area -->
<Slider name="CVariableSlider1" inherits="CHorizontalSliderTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CSexyMapMainFrame" relativePoint="TOPLEFT">
<Offset><AbsDimension x="60" y="-420"/></Offset>
</Anchor>
</Anchors>
</Slider>
<Slider name="CVariableSlider2" inherits="CHorizontalSliderTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CVariableSlider1" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-50"/></Offset>
</Anchor>
</Anchors>
</Slider>
</Frames>
</Frame>
<!-- ====================================================== -->
<!-- Bottom buttons: Set Defaults + Close -->
<!-- ====================================================== -->
<Button name="CSetDefaultsBtn" inherits="UIPanelButtonTemplate" text="Set Defaults">
<Size>
<AbsDimension x="120" y="24"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="CSexyMapMainFrame" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="20" y="18"/></Offset>
</Anchor>
</Anchors>
<NormalFont style="GameFontNormalSmall"/>
<HighlightFont style="GameFontHighlightSmall"/>
<Scripts>
<OnClick>
PlaySound("igMainMenuOption")
CSetDefaultsBtn_OnClick()
</OnClick>
</Scripts>
</Button>
<Button name="CMenuCloseButton" inherits="CMenuButtonTemplate" text="Close">
<Anchors>
<Anchor point="BOTTOMRIGHT" relativeTo="CSexyMapMainFrame" relativePoint="BOTTOMRIGHT">
<Offset><AbsDimension x="-20" y="18"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
PlaySound("igMainMenuContinue")
CHideMenu()
</OnClick>
</Scripts>
</Button>
</Frames>
</Frame>
</Ui>
+11
View File
@@ -0,0 +1,11 @@
## Interface: 11200
## Title: SexyMap - OctoWoW
## Notes: OctoWoW-compatible backport of SexyMap with custom borders and shapes
## Author: Packaged By Relationship
## Version: 1.7
## SavedVariables: SexyMap2DB
## X-Website: https://github.com/Relationship-OctoWoW/SexyMap
## X-GitHub: https://github.com/Relationship-OctoWoW/SexyMap
CMap.xml
COptions.xml
+115
View File
@@ -0,0 +1,115 @@
local _G = getfenv(0)
local defaultSize = 180
local math = math
local sin = math.sin
local cos = math.cos
borderTextures = {
["AURARUNE256.BLP"] = "SPELLS\\AURARUNE256.BLP",
["AuraRune256b.blp"] = "SPELLS\\AuraRune256b.blp",
["AuraRune_A.blp"] = "SPELLS\\AuraRune_A.blp",
["AuraRune_B.blp"] = "SPELLS\\AuraRune_B.blp",
["Elite"] = "Interface\\TargetingFrame\\UI-TargetingFrame-Elite",
["GENERICGLOW5.BLP"] = "PARTICLES\\GENERICGLOW5.BLP",
["GENERICGLOW64.BLP"] = "SPELLS\\GENERICGLOW64.BLP",
["gradientCircle.blp"] = "Interface\\GLUES\\MODELS\\UI_Tauren\\gradientCircle.blp",
["Nature_Rune_128.blp"] = "SPELLS\\Nature_Rune_128.blp",
["Rare"] = "Interface\\TargetingFrame\\UI-TargetingFrame-Rare",
["ShamanStoneAir.blp"] = "World\\GENERIC\\PASSIVEDOODADS\\ShamanStone\\ShamanStoneAir.blp",
["SHAMANSTONEEARTH.blp"] = "World\\GENERIC\\PASSIVEDOODADS\\ShamanStone\\SHAMANSTONEEARTH.blp",
["ShamanStoneFlame.blp"] = "World\\GENERIC\\PASSIVEDOODADS\\ShamanStone\\ShamanStoneFlame.blp",
["ShamanStoneWater.blp"] = "World\\GENERIC\\PASSIVEDOODADS\\ShamanStone\\ShamanStoneWater.blp",
["Shockwave4.blp"] = "SPELLS\\Shockwave4.blp",
["Shockwave_blue.blp"] = "World\\ENVIRONMENT\\DOODAD\\GENERALDOODADS\\ELEMENTALRIFTS\\Shockwave_blue.blp",
["SHOCKWAVE_INVERTGREY.BLP"] = "SPELLS\\SHOCKWAVE_INVERTGREY.BLP",
["TREANTLEAVES.BLP"] = "SPELLS\\TREANTLEAVES.BLP",
["T_VFX_HERO_CIRCLE.BLP"] = "SPELLS\\T_VFX_HERO_CIRCLE.BLP",
-- Diablo preset textures (addon-local BLP files)
["MAP_OVERLAY"] = "Interface\\AddOns\\SexyMap\\media\\map_overlay",
["MAP_GLOSS"] = "Interface\\AddOns\\SexyMap\\media\\map_gloss",
["MAP_INNERSHADOW"] = "Interface\\AddOns\\SexyMap\\media\\map_innershadow",
["ZAHNRAD"] = "Interface\\AddOns\\SexyMap\\media\\zahnrad",
-- Renaitre textures (addon-local BLP files)
["RENAITRE_FADE_BORDER"] = "Interface\\AddOns\\SexyMap\\media\\RenaitreFadeBorder",
["RENAITRE_FADE_NORMAL"] = "Interface\\AddOns\\SexyMap\\media\\RenaitreFadeNormal",
["RENAITRE_FADE_GLOSS"] = "Interface\\AddOns\\SexyMap\\media\\RenaitreFadeGloss",
-- Classic media textures (addon-local BLP files)
["AUCHINDOUN_VORTEXCLOUD01"] = "Interface\\AddOns\\SexyMap\\media\\classic\\auchindoun_vortexcloud01",
["AURA_01"] = "Interface\\AddOns\\SexyMap\\media\\classic\\aura_01",
["BLADESEDGEPLANET04"] = "Interface\\AddOns\\SexyMap\\media\\classic\\bladesedgeplanet04",
["DEATHSKY_VORTEXCLOUD01"] = "Interface\\AddOns\\SexyMap\\media\\classic\\deathsky_vortexcloud01",
["DEATHWINGFIGHTSKY_CLOUDSMASK03"] = "Interface\\AddOns\\SexyMap\\media\\classic\\deathwingfightsky_cloudsmask03",
["DEATHWINGFIGHTSKY_PARTICLECLOUD"] = "Interface\\AddOns\\SexyMap\\media\\classic\\deathwingfightsky_particlecloud",
["DEEPHOLMSKY_NEBULA01"] = "Interface\\AddOns\\SexyMap\\media\\classic\\deepholmsky_nebula01",
["GALAXY_02"] = "Interface\\AddOns\\SexyMap\\media\\classic\\galaxy_02",
["HELLFIREPLANET03"] = "Interface\\AddOns\\SexyMap\\media\\classic\\hellfireplanet03",
["HELLFIREPLANET_BLUE01"] = "Interface\\AddOns\\SexyMap\\media\\classic\\hellfireplanet_blue01",
["HELLFIREPLANET_RED01"] = "Interface\\AddOns\\SexyMap\\media\\classic\\hellfireplanet_red01",
["ICECROWN_CLOUDSA02_MASK01"] = "Interface\\AddOns\\SexyMap\\media\\classic\\icecrown_cloudsa02_mask01",
["ICECROWN_CLOUDSA02_MASK02"] = "Interface\\AddOns\\SexyMap\\media\\classic\\icecrown_cloudsa02_mask02",
["LIGHTNING_NEW"] = "Interface\\AddOns\\SexyMap\\media\\classic\\lightning_new",
["ROGUERUNE2"] = "Interface\\AddOns\\SexyMap\\media\\classic\\roguerune2",
["SWATHSMALLSTONES"] = "Interface\\AddOns\\SexyMap\\media\\classic\\swathsmallstones",
["TREANTLEAVES"] = "Interface\\AddOns\\SexyMap\\media\\classic\\treantleaves",
["T_VFX_HERO_CIRCLE"] = "Interface\\AddOns\\SexyMap\\media\\classic\\t_vfx_hero_circle",
["UL_SPINNINGROOMRINGS_RING07"] = "Interface\\AddOns\\SexyMap\\media\\classic\\ul_spinningroomrings_ring07",
["WINTERGRASP_CLOUDMASK01"] = "Interface\\AddOns\\SexyMap\\media\\classic\\wintergrasp_cloudmask01",
}
function CCreateBorder(t)
texture = _G[t.name] or Minimap:CreateTexture(t.name)
-- Clamp scale to 0.0 minimum; 0.0 means invisible
local effectiveScale = t.scale or 1
if effectiveScale < 0 then effectiveScale = 0 end
if effectiveScale == 0 then
texture:Hide()
-- Still register in CTextures so we can update later
texture.settings = t
texture.angle = 0
CTextures[t.name] = t.name
return
end
texture:Show()
texture:SetBlendMode(t.blendMode or "ADD")
local texPath = borderTextures[t.texture] or t.texture
-- For addon-local paths (extensionless), append .blp for SetTexture compatibility in classic WoW
if texPath and not string.find(string.lower(texPath), ".blp") and not string.find(string.lower(texPath), ".tga") and string.find(texPath, "AddOns") then
texPath = texPath .. ".blp"
end
texture:SetTexture(texPath)
texture:SetWidth((t.width or defaultSize) * effectiveScale)
texture:SetHeight((t.height or defaultSize) * effectiveScale)
texture:SetVertexColor(t.r or 1, t.g or 1, t.b or 1)
texture:SetAlpha(t.a or 1)
texture:SetPoint(t.anchorPoint or "CENTER",
t.relativeTo or Minimap,
t.relativePoint or "CENTER",
t.xOffset or 0, t.yOffset or 0)
texture:SetDrawLayer(t.drawLayer or "ARTWORK")
texture.settings = t
texture.angle = 0
CTextures[t.name] = t.name
if t.rotSpeed and t.rotSpeed ~= 0 and not t.disableRotation then
CRotateTextures[t.name] = t.rotSpeed
end
if t.disableRotation then
texture:SetTexCoord(0, 1, 0, 1)
end
if t.rotation then
CRotateTexture(texture, t.rotation)
end
end
function CRotateTexture(self, change)
self.angle = (self.angle or 0) - change
if self.angle < 0 then self.angle = self.angle + 360 end
if self.angle > 360 then self.angle = self.angle - 360 end
--self.angle = self.angle % 360
s = sin(rad(self.angle))
c = cos(rad(self.angle))
self:SetTexCoord(
0.5 - s, 0.5 + c, --Top Left Corner
0.5 + c, 0.5 + s, --Bottom Left Corner
0.5 - c, 0.5 - s, --Top Right Corner
0.5 + s, 0.5 - c --Bottom Right Corner
)
end
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+1213
View File
File diff suppressed because it is too large Load Diff
+75
View File
@@ -0,0 +1,75 @@
-- shapes.lua - Minimap shape masks for SexyMap OctoWoW Edition
-- Provides CApplyShape() which clips the minimap to a given shape
--
-- IMPORTANT: We use Minimap:SetMaskTexture() instead of creating overlay textures.
-- Creating an overlay texture on top of the minimap blocks the map content and causes
-- the minimap to appear as pure white. SetMaskTexture clips the minimap to the shape
-- without covering it.
--
-- In WoW 1.12, SetMaskTexture(nil) does NOT remove the mask — it falls back to
-- the default round mask. This means there is no way to show a truly square
-- minimap via mask alone. For square shapes, we use the circle mask and rely
-- on the border/backdrop visuals to give a square appearance.
local _G = getfenv(0)
-- The default round minimap mask.
-- IMPORTANT: "Interface\Minimap\UI-Minimap-Background" is NOT a mask — it's a
-- decorative border texture. Using it with SetMaskTexture causes green rendering.
-- The correct default mask is the circle.blp we ship with the addon.
local DEFAULT_MASK = "Interface\\AddOns\\SexyMap\\shapes\\circle.blp"
-- Shape texture paths (addon-local BLP files in shapes/ directory)
-- All paths include .blp because SetMaskTexture does NOT auto-append .blp
-- (unlike SetBackdrop which does auto-append it).
local shapeTextures = {
["Round"] = "Interface\\AddOns\\SexyMap\\shapes\\circle.blp",
["Square"] = "Square", -- special: no mask change, keep default round
["Diamond"] = "Interface\\AddOns\\SexyMap\\shapes\\diamond.blp",
["Hexagon"] = "Interface\\AddOns\\SexyMap\\shapes\\hexagon.blp",
["Octagon"] = "Interface\\AddOns\\SexyMap\\shapes\\octagon.blp",
["Heart"] = "Interface\\AddOns\\SexyMap\\shapes\\heart.blp",
["Snowflake"] = "Interface\\AddOns\\SexyMap\\shapes\\circle.blp",
["LL Corner Rounded"] = "Interface\\AddOns\\SexyMap\\shapes\\bottomleft.blp",
["LR Corner Rounded"] = "Interface\\AddOns\\SexyMap\\shapes\\bottomright.blp",
["UL Corner Rounded"] = "Interface\\AddOns\\SexyMap\\shapes\\circle.blp", -- fallback, no topleft BLP
["UR Corner Rounded"] = "Interface\\AddOns\\SexyMap\\shapes\\circle.blp", -- fallback, no topright BLP
["Large Circle"] = "Interface\\AddOns\\SexyMap\\shapes\\largecircle.blp",
["Route66"] = "Interface\\AddOns\\SexyMap\\shapes\\circle.blp",
["Deathsky"] = "Interface\\AddOns\\SexyMap\\shapes\\deathsky_mask.blp",
["VFX Border"] = "Interface\\AddOns\\SexyMap\\shapes\\circle.blp",
["Left"] = "Interface\\AddOns\\SexyMap\\shapes\\left.blp",
["Bottom"] = "Interface\\AddOns\\SexyMap\\shapes\\bottom.blp",
}
function CApplyShape(shapeName)
if not shapeName then return end
local texPath = shapeTextures[shapeName]
if not texPath then
-- Unknown shape: apply default round mask
Minimap:SetMaskTexture(DEFAULT_MASK)
return
end
-- Square shape: keep the default round mask.
-- WoW 1.12 does not support removing the mask entirely (SetMaskTexture(nil)
-- just resets to the default round mask). The square appearance for presets
-- like "Ruins" and "Simple Square" comes from their border textures and
-- backdrop frame, not from the minimap mask shape.
if texPath == "Square" then
Minimap:SetMaskTexture(DEFAULT_MASK)
return
end
-- Use SetMaskTexture to clip the minimap to the shape.
-- pcall protects against invalid texture paths
local ok, err = pcall(function()
Minimap:SetMaskTexture(texPath)
end)
if not ok then
-- Fallback to default round mask if the texture failed to load
Minimap:SetMaskTexture(DEFAULT_MASK)
end
end
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.