--[[ SquareMinimap ]]

SquareMinimap = {
  version = 1.0
}

function SquareMinimap.OnLoad()
  this:RegisterEvent("PLAYER_ENTERING_WORLD")
end

function SquareMinimap.OnEvent()
SquareMinimap.SquareTheMap()
end

function SquareMinimap.SquareTheMap()
  -- moves the minimap
  --MinimapCluster:SetPoint("TOPRIGHT","UIParent","TOPRIGHT",15,2)
  -- nudges the zone text to center
  MinimapZoneText:SetPoint("TOP","MinimapZoneTextButton","TOP",9,1)
  -- hides the "X" to close the minimap
  MinimapToggleButton:Hide()
  -- hides the zoom buttons
  MinimapZoomIn:Hide()
  MinimapZoomOut:Hide()	
  -- hides the day/night indicator
  GameTimeFrame:Hide()
  -- makes clicking the zone text the "X" (toggle minimap)
  MinimapZoneTextButton:SetScript("OnClick",ToggleMinimap)
  -- sets the square border texture
  MinimapBorder:SetTexture("Interface\\AddOns\\SquareMinimap\\SquareMinimapBorder")
  -- sets the square title texture
  MinimapBorderTop:SetTexture("Interface\\AddOns\\SquareMinimap\\SquareMinimapBorder")
  -- sets the square mask
  Minimap:SetMaskTexture("Interface\\AddOns\\SquareMinimap\\SquareMinimapMask")
  -- moves the tracking icon
  MiniMapTrackingFrame:SetPoint("TOPLEFT","Minimap","TOPLEFT",0,-2)
  MiniMapTrackingFrame:SetScale(.75)
end

function MiniMap_OnMouseWheel(value)
		if ( value > 0 ) then Minimap_ZoomIn()
		elseif ( value < 0 ) then Minimap_ZoomOut()
		end
end

function Minimap_ZoomIn()
	if Minimap:GetZoom() == 5 then
		Minimap:SetZoom(5);
	else
		Minimap:SetZoom(Minimap:GetZoom() + 1);
	end
end

function Minimap_ZoomOut()
	if Minimap:GetZoom() == 0 then
		Minimap:SetZoom(0);
	else
		Minimap:SetZoom(Minimap:GetZoom() - 1);
	end
end