Thread Tools Display Modes
08-02-12, 12:22 AM   #1
Qupe
A Warpwood Thunder Caller
 
Qupe's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 92
Rectangle Minimap

I'm trying to recreate Dawn's rectangle minimap.

Before straight up copy/pasting his code, I hack'n'slashed it by setting the size. This worked but ended up stretching the map's textures.

ex:


Went ahead and copy/pasted code in and got this:



code:
Lua Code:
  1. -----------
  2. -- style --
  3. -----------
  4. local _, class = UnitClass('player')
  5. local color = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]           
  6.  
  7. Minimap:SetSize(172*scale, 172*scale)
  8. Minimap:SetMaskTexture(mediaFolder.."rectangle")
  9. Minimap:SetHitRectInsets(0, 0, 24*scale, 24*scale)
  10. Minimap:SetFrameLevel(4)
  11. Minimap:ClearAllPoints()
  12. Minimap:SetPoint(position, UIParent, position_x, position_y)
  13. Minimap:SetScale(scale)
  14.  
  15. --LFDSearchStatus:SetClampedToScreen(true)
  16.  
  17. BorderFrame = CreateFrame("Frame", nil, Minimap)
  18. BorderFrame:SetPoint("TOPLEFT", Minimap, "TOPLEFT", -1, -(21*scale))
  19. BorderFrame:SetPoint("BOTTOMRIGHT", Minimap, "BOTTOMRIGHT", 1, (21*scale)) 
  20. BorderFrame:SetBackdrop(backdrop)
  21. if not classColoredBorder then
  22.     BorderFrame:SetBackdropBorderColor(unpack(brdcolor))
  23. else
  24.     BorderFrame:SetBackdropBorderColor(color.r, color.g, color.b)
  25. end
  26. BorderFrame:SetBackdropColor(unpack(backdropcolor))
  27. BorderFrame:SetFrameLevel(6)

I understand the general gist of how the mask is covering the bits of the map, making it a "rectangle" without stretching the actual map texture.

What I don't understand is why a) it's green and b) the top/bottom bits of the map aren't being masked.

This is the addon I'm trying to recreate:
http://www.wowinterface.com/download...0-dRecMap.html

I don't think I missed any code or stuff that is actually masking the map (I didn't include the config code at the top of the addon that sets stuff like bg textures, scale, etc...).

I attached the entirety of the code; the lua file is basically Dawn's map with stuff commented out that errors. I don't intend to use anything from that code besides what styles the map, so just disregard any of the out of date stuff.

Basically, is it still possible to do this? If it is, has something changed which makes the styling in this addon non-functional?

Thanks!
Attached Files
File Type: lua Minimap.lua (5.8 KB, 515 views)
__________________
Quse UI
WoW :: EQ2
  Reply With Quote
08-02-12, 01:42 AM   #2
Miiru
A Flamescale Wyrmkin
 
Miiru's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 138
As far as i know, aside from the code, green always means the texture didnt load correctly. Be aware that the actual texture's size needs to be power of 2, like 32x64 or 128x256 for example.
__________________
◘◘ Author of MiirGui Texture Pack - [Core] [Blue] [Grey] ◘◘
  Reply With Quote
08-02-12, 02:21 AM   #3
eiszeit
A Chromatic Dragonspawn
 
eiszeit's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 154
Rectangle minimap would be exactly what I need in my UI.
I'll try to get it running at home, too. Maybe I can help.
__________________
Lyn • I'm a mess of unfinished thoughts
  Reply With Quote
08-02-12, 02:28 AM   #4
Qupe
A Warpwood Thunder Caller
 
Qupe's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 92
Originally Posted by Miiru View Post
As far as i know, aside from the code, green always means the texture didnt load correctly. Be aware that the actual texture's size needs to be power of 2, like 32x64 or 128x256 for example.
If green means the texture didn't load then something may have changed since this addon worked? I haven't modified the texture at all. By default it's 256x256 and it's Dawn's original texture for an addon that worked at some point, so I'm assuming the issue isn't with the texture (+? I really don't have any idea, just going on what I see).

Originally Posted by eiszeit View Post
Rectangle minimap would be exactly what I need in my UI.
I'll try to get it running at home, too. Maybe I can help.
You stylish mofo, you! (also, yes please!).

I can't upload a .tga file? If I could I'd drop the texture file in here for people to look at. If there's something else I can upload it as/a trusted location, please let me know. If not, it's available in the addon link in the OP.
__________________
Quse UI
WoW :: EQ2
  Reply With Quote
08-02-12, 02:42 AM   #5
eiszeit
A Chromatic Dragonspawn
 
eiszeit's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 154
Originally Posted by Qupe View Post
You stylish mofo, you! (also, yes please!).
<3

You could put it on Dropbox or so? That's where I put all my stuff about four years now.
__________________
Lyn • I'm a mess of unfinished thoughts
  Reply With Quote
08-02-12, 03:23 AM   #6
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
Lua Code:
  1. Minimap:SetMaskTexture(mediaFolder.."rectangle")
mediaFolder is set correctly ?
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
08-02-12, 03:27 AM   #7
Qupe
A Warpwood Thunder Caller
 
Qupe's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 92
Originally Posted by Rilgamon View Post
Lua Code:
  1. Minimap:SetMaskTexture(mediaFolder.."rectangle")
mediaFolder is set correctly ?
Yessir. That's basically why you're seeing that rectangle shape/green overlay (I'm assuming) in the second minimap example.

@eiszeit
Haven't thought about that. Probably a good idea - especially when I'm too dumb/inexperienced to figure things like this out on my own.
__________________
Quse UI
WoW :: EQ2
  Reply With Quote
08-02-12, 08:51 AM   #8
eiszeit
A Chromatic Dragonspawn
 
eiszeit's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 154
The code you gave me seems to work, I tested it with and without rectangle to see if it's stretched.



(I, personally, have another problem, which may prevent me from using this kind of minimap, sadly. :<)
__________________
Lyn • I'm a mess of unfinished thoughts
  Reply With Quote
08-02-12, 02:53 PM   #9
Kendian
A Molten Giant
 
Kendian's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 614
I played with this code for months, but client hates a true rectangle, so if I could seat it against X, I couldn't seat it against Y. I personally like a bit of offset, but I couldn't get it under 30 pixels, which for my OCD is just too much

TLDR: Would LOVE to see this work~
__________________
  Reply With Quote
08-02-12, 06:53 PM   #10
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
There's a slight rectangle skin in PocketPlot (among other shapes).

Qupe: where is mediaFolder located and where is that variable defined in your code?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-02-12, 10:33 PM   #11
Qupe
A Warpwood Thunder Caller
 
Qupe's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 92
Originally Posted by Seerah View Post
There's a slight rectangle skin in PocketPlot (among other shapes).

Qupe: where is mediaFolder located and where is that variable defined in your code?
It's the base location for Dawn's addons, a folder called dMedia in the addons folder and its location is defined near the top of the code as such:
Lua Code:
  1. local mediaFolder = "Interface\\AddOns\\dMedia\\"   -- don't touch this ...

I got the same green looking thing when I changed the media folder location to the minimap's own folder and put the mask file straight into said folder.
__________________
Quse UI
WoW :: EQ2
  Reply With Quote
08-03-12, 12:08 AM   #12
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Possibly stupid question, but are you restarting WoW after moving the texture file? WoW won't read any files that weren't present when it launched.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
08-03-12, 12:14 AM   #13
Qupe
A Warpwood Thunder Caller
 
Qupe's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 92
Originally Posted by Phanx View Post
Possibly stupid question, but are you restarting WoW after moving the texture file? WoW won't read any files that weren't present when it launched.
Really not stupid question, like, really. Thanks so much for the help!

I feel really dumb, disregard the thread =/



- Thoroughly Embarrassed, signing off.
__________________
Quse UI
WoW :: EQ2
  Reply With Quote
03-03-16, 03:01 PM   #14
EvilMaddness
An Aku'mai Servant
 
EvilMaddness's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2015
Posts: 33
Getting close to getting flat screen minimap

Lua Code:
  1. -- minimap default position - you can move it ingame by holding down ALT!
  2. position = "TOPRIGHT"      
  3. position_x = -200              
  4. position_y = -200              
  5.  
  6. -- achievement/quest tracker position
  7. moveWatchFrame = false          -- enable/disable positioning, set to false if you are using a different addon to move it
  8. qparent = UIParent        
  9. qanchor = "TOPRIGHT"     
  10. qposition_x = -60          
  11. qposition_y = -260        
  12. qheight = 400            
  13.  
  14. local useInfoPanel = true       -- enable disable fps/latency and clock
  15. local showclock = false         -- ONLY show clock - makes sense to set useInfoPanel to false if you only want to show the clock ^^
  16. local AddonNumb = 30            -- maximum number of addons shown in tooltip (will always show set number of top memory usage addons)
  17.  
  18. local mediaFolder = "Interface\\AddOns\\dMedia\\"   -- don't touch this ...
  19. local texture = "Interface\\Buttons\\WHITE8x8"
  20. --local backdrop = {bgFile = texture, edgeFile = texture, edgeSize = 1, insets = { left = -1, right = -1, top = -1, bottom = -1}}
  21. local backdrop = {edgeFile = texture, edgeSize = 1}
  22.    
  23. local mailicon = mediaFolder.."mail"
  24. local font = mediaFolder.."big_noodle_titling.ttf"
  25. local fontSize = 12
  26. local fontFlag = "THINOUTLINE"          -- "THINOUTLINE", "OUTLINE MONOCHROME", "OUTLINE" or nil (no outline)
  27.  
  28. local backdropcolor = {26/255, 25/255, 31/255}      -- backdrop color  
  29. local brdcolor = {0/255, 0/255, 0/255}              -- backdrop border color
  30. local infocolor = {29/255, 63/255, 72/255}          -- info panel color
  31. local IpanelBGalpha = 0.3                           -- info panel background alpha
  32.  
  33. local classColoredBorder = false                    -- color border by class
  34. local scale = 1
  35.  
  36. local enableCombatFade = true                       -- enable/disable fade out in combat
  37. local inCombatAlpha = 0.3                           -- in combat alpha
  38. local outCombatAlpha = 1.0                          -- ooc alpha
  39.  
  40. -----------
  41. -- style --
  42. -----------
  43. local _, class = UnitClass('player')
  44. local color = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]           
  45.  
  46. Minimap:SetSize(253*scale, 253*scale)
  47. Minimap:SetMaskTexture(mediaFolder.."rectangle")
  48. Minimap:SetHitRectInsets(30, 25, 75*scale, 75*scale)
  49. Minimap:ClearAllPoints()
  50. Minimap:SetPoint(position, UIParent, position_x, position_y)
  51. Minimap:SetScale(scale)
  52. Minimap:SetFrameLevel(8)
  53.  
  54. BorderFrame = CreateFrame("Frame", nil, UIParent)
  55. BorderFrame:SetPoint("TOPLEFT", Minimap, "TOPLEFT", 23, -(75*scale))
  56. BorderFrame:SetPoint("BOTTOMRIGHT", Minimap, "BOTTOMRIGHT", -23, (75*scale))
  57.    
  58. BorderFrame:SetBackdrop(backdrop)
  59. if not classColoredBorder then
  60.     BorderFrame:SetBackdropBorderColor(unpack(brdcolor))
  61. else
  62.     BorderFrame:SetBackdropBorderColor(color.r, color.g, color.b)
  63. end
  64. BorderFrame:SetBackdropColor(unpack(backdropcolor))
  65. BorderFrame:SetFrameLevel(6)       
  66.  
  67. ------------------------
  68. -- fps latency memory --
  69. ------------------------
  70. if useInfoPanel then   
  71.  
  72. local FLMframe = CreateFrame("Button", "FLMframe", UIParent)
  73. FLMframe:SetPoint("TOP", Minimap, "BOTTOM", 0, 20*scale)
  74. FLMframe:SetSize((Minimap:GetWidth()+2)*scale, fontSize+6)
  75. FLMframe:SetFrameLevel(4)
  76. FLMframe:SetBackdrop(backdrop)
  77. if not classColoredBorder then
  78.     FLMframe:SetBackdropBorderColor(unpack(brdcolor))
  79. else
  80.     FLMframe:SetBackdropBorderColor(color.r, color.g, color.b)
  81. end
  82. FLMframe:SetBackdropColor(unpack(backdropcolor))
  83.  
  84. local FLMframeT = FLMframe:CreateTexture(nil, "ARTWORK")
  85. FLMframeT:SetPoint("TOPLEFT", FLMframe, "TOPLEFT", 1, -1)
  86. FLMframeT:SetPoint("BOTTOMRIGHT", FLMframe, "BOTTOMRIGHT", -1, 1)  
  87. --FLMframeT:SetTexture(mediaFolder.."dO")
  88. FLMframeT:SetTexture(texture)
  89. FLMframeT:SetVertexColor(unpack(infocolor))
  90. FLMframeT:SetAlpha(IpanelBGalpha)
  91.  
  92. local text = FLMframe:CreateFontString(nil, "OVERLAY")
  93. text:SetPoint("CENTER", FLMframe, 4, 0)
  94. text:SetFont(font, fontSize, fontFlag)
  95. --text:SetShadowOffset(1, -1)
  96. text:SetTextColor(color.r, color.g, color.b)
  97.    
  98.     --========[ important functions ]========--
  99. local function Addoncompare(a, b)
  100.     return a.memory > b.memory
  101. end
  102.  
  103. local function MemFormat(v)
  104.     if (v > 1024) then
  105.         return string.format("%.2f MiB", v / 1024)
  106.     else
  107.         return string.format("%.2f KiB", v)
  108.     end
  109. end
  110.  
  111. local function ColorGradient(perc, ...)
  112.     if (perc > 1) then
  113.         local r, g, b = select(select('#', ...) - 2, ...)
  114.         return r, g, b
  115.     elseif (perc < 0) then
  116.         local r, g, b = ...
  117.         return r, g, b
  118.     end
  119.    
  120.     local num = select('#', ...) / 3
  121.  
  122.     local segment, relperc = math.modf(perc*(num-1))
  123.     local r1, g1, b1, r2, g2, b2 = select((segment*3)+1, ...)
  124.  
  125.     return r1 + (r2-r1)*relperc, g1 + (g2-g1)*relperc, b1 + (b2-b1)*relperc
  126. end
  127.  
  128. local function TimeFormat(time)
  129.     local t = format("%.1ds",floor(mod(time,60)))
  130.     if (time > 60) then
  131.         time = floor(time / 60)
  132.         t = format("%.1dm ",mod(time,60))..t
  133.         if (time > 60) then
  134.             time = floor(time / 60)
  135.             t = format("%.1dh ",mod(time,24))..t
  136.             if (time > 24) then
  137.                 time = floor(time / 24)
  138.                 t = format("%dd ",time)..t
  139.             end
  140.         end
  141.     end
  142.     return t
  143. end
  144.  
  145. local function ColorizeLatency(v)
  146.     if (v < 100) then
  147.         return {r = 0, g = 1, b = 0}
  148.     elseif (v < 300) then
  149.         return {r = 1, g = 1, b = 0}
  150.     else
  151.         return {r = 1, g = 0, b = 0}
  152.     end
  153. end
  154.  
  155. local function ColorizeFramerate(v)
  156.     if (v < 10) then
  157.         return {r = 1, g = 0, b = 0}
  158.     elseif (v < 30) then
  159.         return {r = 1, g = 1, b = 0}
  160.     else
  161.         return {r = 0, g = 1, b = 0}
  162.     end
  163. end
  164.    
  165.     --========[ update ]========--
  166. local lastUpdate = 0
  167. local updateDelay = 1
  168. FLMframe:SetScript("OnUpdate", function(self, elapsed)
  169.     lastUpdate = lastUpdate + elapsed
  170.     if (lastUpdate > updateDelay) then
  171.         lastUpdate = 0
  172.         local time = date("|c00ffffff%H|r:|c00ffffff%M|r")
  173.         fps = GetFramerate()
  174.         fps = "|c00ffffff"..floor(fps+0.5).."|r fps   "
  175.         lag = select(4, GetNetStats())
  176.         lag = "|c00ffffff"..lag.."|r ms   "
  177.         text:SetText(lag..fps..time)
  178.     end
  179. end)
  180.  
  181. FLMframe:SetScript("OnEnter", function()
  182.     GameTooltip:SetOwner(FLMframe)
  183.     collectgarbage()
  184.     local memory, i, addons, total, entry, total
  185.     local latencycolor = ColorizeLatency(select(3, GetNetStats()))
  186.     local fpscolor = ColorizeFramerate(GetFramerate())
  187.        
  188.     GameTooltip:AddLine(date("%A, %d %B, %Y"), 1, 1, 1)
  189.     GameTooltip:AddDoubleLine("Framerate:", format("%.1f fps", GetFramerate()), color.r, color.g, color.b, fpscolor.r, fpscolor.g, fpscolor.b)
  190.     GameTooltip:AddDoubleLine("Latency:", format("%d ms", select(3, GetNetStats())), color.r, color.g, color.b, latencycolor.r, latencycolor.g, latencycolor.b)
  191.     GameTooltip:AddDoubleLine("System Uptime:", TimeFormat(GetTime()), color.r, color.g, color.b, 1, 1, 1)
  192.     GameTooltip:AddDoubleLine(". . . . . . . . . . .", ". . . . . . . . . . .", 1, 1, 1, 1, 1, 1)
  193.    
  194.     addons = {}
  195.     total = 0
  196.     UpdateAddOnMemoryUsage()
  197.     for i = 1, GetNumAddOns(), 1 do
  198.         if GetAddOnMemoryUsage(i) > 0 then
  199.             memory = GetAddOnMemoryUsage(i)
  200.             entry = {name = GetAddOnInfo(i), memory = memory}
  201.             table.insert(addons, entry)
  202.             total = total + memory
  203.         end
  204.     end
  205.    
  206.     table.sort(addons, Addoncompare)
  207.  
  208.     i = 0
  209.     for _,entry in pairs(addons) do
  210.         local cr, cg, cb = ColorGradient((entry.memory / 800), 0, 1, 0, 1, 1, 0, 1, 0, 0)
  211.         GameTooltip:AddDoubleLine(entry.name, MemFormat(entry.memory), 1, 1, 1, cr, cg, cb)
  212.    
  213.         i = i + 1
  214.         if i >= AddonNumb then
  215.             break
  216.         end    
  217.     end
  218.    
  219.     local cr, cg, cb = ColorGradient((entry.memory / 800), 0, 1, 0, 1, 1, 0, 1, 0, 0)
  220.     GameTooltip:AddDoubleLine(". . . . . . . . . . .", ". . . . . . . . . . .", 1, 1, 1, 1, 1, 1)
  221.     GameTooltip:AddDoubleLine("Total", MemFormat(total), color.r, color.g, color.b, cr, cg, cb)
  222.     GameTooltip:AddDoubleLine("..with Blizzard", MemFormat(collectgarbage("count")), color.r, color.g, color.b, cr, cg, cb)
  223.     GameTooltip:Show()
  224. end)
  225.  
  226. FLMframe:SetScript("OnLeave", function()
  227.     GameTooltip:Hide()
  228. end)
  229.  
  230.     --========[ mem cleanup ]========--
  231. FLMframe:SetScript("OnClick", function()
  232.     if (not IsAltKeyDown()) then
  233.         UpdateAddOnMemoryUsage()
  234.         local memBefore = gcinfo()
  235.         collectgarbage()
  236.         UpdateAddOnMemoryUsage()
  237.         local memAfter = gcinfo()
  238.         DEFAULT_CHAT_FRAME:AddMessage("Memory cleaned: |cff00FF00"..MemFormat(memBefore - memAfter))
  239.     end
  240. end)
  241.    
  242. end
  243.    
  244. ---------------------
  245. -- hide some stuff --
  246. ---------------------
  247. MinimapBackdrop:Hide()
  248. MinimapBorder:Hide()
  249. MinimapBorderTop:Hide()
  250. MinimapZoomIn:Show()
  251. MinimapZoomOut:Show()
  252. MiniMapVoiceChatFrame:Hide()
  253. GameTimeFrame:Hide()
  254. MinimapZoneTextButton:Show()
  255. MiniMapTracking:Show()
  256. MiniMapMailBorder:Hide()
  257. MinimapNorthTag:SetAlpha(50)
  258. MiniMapInstanceDifficulty:SetAlpha(50)
  259. GuildInstanceDifficulty:SetAlpha(50)
  260.  
  261. if showclock then
  262.     LoadAddOn('Blizzard_TimeManager')
  263.     local clockFrame, clockTime = TimeManagerClockButton:GetRegions()
  264.     clockFrame:Hide()
  265.     clockTime:Show()
  266.     clockTime:SetFont(font, fontSize, fontFlag)
  267.     TimeManagerClockButton:SetPoint("BOTTOM", Minimap, 0, -6)
  268. else
  269.     LoadAddOn('Blizzard_TimeManager')
  270.     TimeManagerClockButton.Show = TimeManagerClockButton.Hide
  271.     local region = TimeManagerClockButton:GetRegions()
  272.     region:Hide()  
  273.     TimeManagerClockButton:ClearAllPoints()
  274.     TimeManagerClockButton:Hide()  
  275. end
  276.  
  277. ---------------------
  278. -- move some stuff --
  279. ---------------------
  280. if moveWatchFrame then
  281.     WatchFrame:ClearAllPoints()
  282.     WatchFrame.ClearAllPoints = function() end
  283.     WatchFrame:SetPoint(qanchor, qparent, qanchor, qposition_x, qposition_y)
  284.     WatchFrame.SetPoint = function() end
  285.     WatchFrame:SetClampedToScreen(true)
  286.     WatchFrame:SetHeight(qheight)
  287. end
  288.  
  289. MiniMapMailFrame:ClearAllPoints()
  290. MiniMapMailFrame:SetPoint("TOPRIGHT", Minimap, 4, -20)
  291. MiniMapMailIcon:SetTexture(mailicon)
  292.  
  293. MiniMapWorldMapButton:Hide()
  294. MiniMapInstanceDifficulty:ClearAllPoints()
  295. MiniMapInstanceDifficulty:SetParent(Minimap)
  296. MiniMapInstanceDifficulty:SetPoint("TOPLEFT", Minimap, "TOPLEFT", 0, -22)
  297. DropDownList1:SetClampedToScreen(true)
  298.  
  299. MiniMapMailFrame:SetFrameLevel(10)
  300. MiniMapInstanceDifficulty:SetFrameLevel(10)
  301.  
  302. QueueStatusMinimapButton:SetSize(20, 20)
  303. QueueStatusMinimapButton:ClearAllPoints()
  304. QueueStatusMinimapButton:SetParent(Minimap)
  305. QueueStatusMinimapButton:SetPoint("BOTTOMLEFT", Minimap, "BOTTOMLEFT", 0, 22)
  306. QueueStatusMinimapButton:SetFrameLevel(10)
  307. QueueStatusMinimapButtonBorder:Hide()
  308.  
  309. ---------------------
  310. -- mousewheel zoom --
  311. ---------------------
  312. Minimap:EnableMouseWheel(true)
  313. Minimap:SetScript("OnMouseWheel", function(self, direction)
  314.     if(direction > 0) then
  315.         Minimap_ZoomIn()
  316.     else
  317.         Minimap_ZoomOut()
  318.     end
  319. end)
  320.  
  321. ------------------------
  322. -- move and clickable --
  323. ------------------------
  324. Minimap:SetMovable(true)
  325. Minimap:SetUserPlaced(true)
  326. Minimap:SetScript("OnMouseDown", function()
  327.     if (IsAltKeyDown()) then
  328.         Minimap:ClearAllPoints()
  329.         Minimap:StartMoving()
  330.     end
  331. end)
  332.  
  333. Minimap:SetScript('OnMouseUp', function(self, button)
  334. Minimap:StopMovingOrSizing()
  335.     if (button == 'RightButton') then
  336.         ToggleDropDownMenu(1, nil, MiniMapTrackingDropDown, self, - (Minimap:GetWidth() * 0.7), -3)
  337.     elseif (button == 'MiddleButton') then
  338.         ToggleCalendar()
  339.     else
  340.         Minimap_OnClick(self)
  341.     end
  342. end)
  343.  
  344. -- calendar slashcmd
  345. SlashCmdList["CALENDAR"] = function()
  346.     ToggleCalendar()
  347. end
  348. SLASH_CALENDAR1 = "/cl"
  349. SLASH_CALENDAR2 = "/calendar"
  350.  
  351. function GetMinimapShape() return 'SQUARE' end
  352.  
  353. -------------------
  354. -- combat fading --
  355. -------------------
  356. if enableCombatFade then
  357. function Minimap_OnEvent(self, event)
  358.         if event == "PLAYER_REGEN_DISABLED" then
  359.             MinimapCluster:SetAlpha(inCombatAlpha)
  360.             if useInfoPanel then   
  361.                 FLMframe:SetAlpha(inCombatAlpha)
  362.             end
  363.         elseif event == "PLAYER_REGEN_ENABLED" then
  364.             MinimapCluster:SetAlpha(outCombatAlpha)
  365.             if useInfoPanel then   
  366.                 FLMframe:SetAlpha(outCombatAlpha)
  367.             end    
  368.         end
  369. end
  370.    
  371. Minimap:HookScript("OnEvent", Minimap_OnEvent)
  372.  
  373. Minimap:RegisterEvent("PLAYER_REGEN_DISABLED")
  374. Minimap:RegisterEvent("PLAYER_REGEN_ENABLED")
  375. end
  376.  
  377. -------------------------------
  378. -- style Battlefield Minimap --
  379. -------------------------------
  380. local function hide(f)
  381.     f:SetTexture()
  382.     f.SetTexture = function() end
  383. end
  384.  
  385. hooksecurefunc("LoadAddOn", function(addon)
  386.     if addon ~= "Blizzard_BattlefieldMinimap" then return end
  387.  
  388.     BattlefieldMinimapBackground:Hide()
  389.     BattlefieldMinimapCorner:Hide()
  390.     BattlefieldMinimapCloseButton:Hide()
  391.     BattlefieldMinimapTab:Hide()
  392.    
  393.     BBorderFrame = CreateFrame("Frame", nil, BattlefieldMinimap)
  394.     BBorderFrame:SetPoint("TOPLEFT", BattlefieldMinimap, "TOPLEFT", -1, 1)
  395.     BBorderFrame:SetPoint("BOTTOMRIGHT", BattlefieldMinimap, "BOTTOMRIGHT", -5, 3) 
  396.     BBorderFrame:SetBackdrop(backdrop)
  397.     if not classColoredBorder then
  398.         BBorderFrame:SetBackdropBorderColor(unpack(brdcolor))
  399.     else
  400.         BBorderFrame:SetBackdropBorderColor(color.r, color.g, color.b)
  401.     end
  402.     BBorderFrame:SetBackdropColor(unpack(backdropcolor))
  403.     BBorderFrame:SetFrameLevel(6)      
  404. end)

I used the dRecMap add-on. There's a folder named dMedia to add your tga file in. I used the size 256-128 for the mask with a Width 200-Height 100 rectangle in the middle but I'm also going to try a 128-256. At first it was showing up green for the size 128-256 so I thought I couldn't use it. You need to exit fully out and back on first for it to register the size.

I'm getting really close making it work after countless hours messing with the settings. The only part getting in my way now is trying to make a hidden minimap circle small enough to where the border touches the edges of the rectangle. Least that's what it seems like.
__________________
The Maddness Within lua
  Reply With Quote
03-03-16, 07:32 PM   #15
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
Was it really needed to bump a 4yr old thread?
__________________
AddOns: Tim @ WoWInterface
Characters: Mage, Priest, Devoker, Pally
Battle Tag: Mysterio#11164
Current PC Setup: PCPartPicker List
  Reply With Quote
03-04-16, 12:51 AM   #16
Miiru
A Flamescale Wyrmkin
 
Miiru's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 138
Originally Posted by Tim View Post
Was it really needed to bump a 4yr old thread?



__________________
◘◘ Author of MiirGui Texture Pack - [Core] [Blue] [Grey] ◘◘
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Rectangle Minimap

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off