Skip to content

Commit

Permalink
add option to have circle minimap and not rotate
Browse files Browse the repository at this point in the history
  • Loading branch information
eltreum0 committed Apr 30, 2024
1 parent 3f0b513 commit 5ba54c3
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 8 deletions.
7 changes: 4 additions & 3 deletions ElvUI_EltreumUI/Core/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,9 @@ function ElvUI_EltreumUI:Configtable()
_G["WorldMapFrame"]:SetScale(value)
end
end,function() return not E.db.ElvUI_EltreumUI.otherstuff.worldmapscale end)
ElvUI_EltreumUI.Options.args.map.args.general.args.description3 = ACH:Description(L["Flight Frame"], 6, nil, 'Interface\\AddOns\\ElvUI_EltreumUI\\Media\\Textures\\EltreumHeader', nil, 3240, 1, "full")
ElvUI_EltreumUI.Options.args.map.args.general.args.RotateMinimap = ACH:Toggle(_G.ROTATE_MINIMAP, nil, 7, nil, false,nil,function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.rotate end,function(_, value) E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.rotate = value E:StaticPopup_Show('CONFIG_RL') end)
ElvUI_EltreumUI.Options.args.map.args.general.args.description3 = ACH:Description(_G.MINIMAP_LABEL or L["Minimap"], 6, nil, 'Interface\\AddOns\\ElvUI_EltreumUI\\Media\\Textures\\EltreumHeader', nil, 3240, 1, "full")
ElvUI_EltreumUI.Options.args.map.args.general.args.circleMinimap = ACH:Toggle(E.NewSign..L["Circle Minimap"], nil, 7, nil, false,nil,function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.circle end,function(_, value) E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.circle = value E:StaticPopup_Show('CONFIG_RL') end)
ElvUI_EltreumUI.Options.args.map.args.general.args.RotateMinimap = ACH:Toggle(_G.ROTATE_MINIMAP, nil, 8, nil, false,nil,function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.rotate end,function(_, value) E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.rotate = value E:StaticPopup_Show('CONFIG_RL') end, function() return not E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.circle end)
ElvUI_EltreumUI.Options.args.map.args.eta = ACH:Group(L["Time to Arrive"], nil, 2, "tab", nil, nil, nil, not E.Retail)
ElvUI_EltreumUI.Options.args.map.args.eta.args.description1 = ACH:Description(L["Add a time to arrive below the waypoint"], 1, nil, 'Interface\\AddOns\\ElvUI_EltreumUI\\Media\\Textures\\EltreumHeader', nil, 3240, 1, "full")
ElvUI_EltreumUI.Options.args.map.args.eta.args.description2 = ACH:Description(L["The time will be calculated based on player speed and distance"], 2, nil, nil, nil, nil, nil, "full")
Expand Down Expand Up @@ -1059,7 +1060,7 @@ function ElvUI_EltreumUI:Configtable()
ElvUI_EltreumUI.Options.args.map.args.cardinal.args.enable = ACH:Toggle(L["Enable Cardinal Directions"], L["Add North, East, South, West to Minimap"], 2, nil, false,'full',function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable end,function(_, value) E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable = value ElvUI_EltreumUI:MinimapCardinalDirections() end)
ElvUI_EltreumUI.Options.args.map.args.cardinal.args.cardinaloffset = ACH:Range(L["Cardinal Text Offset"], nil, 3, { min = -100, max = 100, step = 1 }, 'full', function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.offset end, function(_, value) E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.offset = value ElvUI_EltreumUI:MinimapCardinalDirections() end, function() return not E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable end)
ElvUI_EltreumUI.Options.args.map.args.cardinal.args.description2 = ACH:Description(" ", 4, nil, nil, nil, nil, nil, "full")
ElvUI_EltreumUI.Options.args.map.args.cardinal.args.fontsize = ACH:Range(L["Font Size"], nil, 5, { min = 4, max = 64, step = 1 }, 'full', function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.fontsize end, function(_, value) E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.fontsize = value ElvUI_EltreumUI:MinimapCardinalDirections() end, function() return GetCVar("rotateMinimap") == "1" or not E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable end, function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.rotate end)
ElvUI_EltreumUI.Options.args.map.args.cardinal.args.fontsize = ACH:Range(L["Font Size"], nil, 5, { min = 4, max = 64, step = 1 }, 'full', function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.fontsize end, function(_, value) E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.fontsize = value ElvUI_EltreumUI:MinimapCardinalDirections() end, function() return GetCVar("rotateMinimap") == "1" or not E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable end)
ElvUI_EltreumUI.Options.args.map.args.cardinal.args.description3 = ACH:Description(" ", 6, nil, nil, nil, nil, nil, "full")
ElvUI_EltreumUI.Options.args.map.args.cardinal.args.classcolor = ACH:Toggle(L["Use Class Colors"], nil, 7, nil, false,nil,function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.classcolor end,function(_, value) E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.classcolor = value ElvUI_EltreumUI:MinimapCardinalDirections() end, function() return not E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable end)
ElvUI_EltreumUI.Options.args.map.args.cardinal.args.customcolor = ACH:Color(L["Custom Color"], nil, 8, false, nil, function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.r, E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.g, E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.b, 1 end, function(_, r, g, b) E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.r, E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.g, E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.b = r, g, b ElvUI_EltreumUI:MinimapCardinalDirections() end, function() return not E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable or E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.classcolor end)
Expand Down
58 changes: 53 additions & 5 deletions ElvUI_EltreumUI/Modules/Misc/Maps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,18 @@ local ONUPDATE_INTERVAL2 = 0.01 --smooth for 60fps
local Cardinals = CreateFrame("FRAME", "Eltruism Cardinal Directions")
Cardinals:SetParent(Minimap)
function ElvUI_EltreumUI:MinimapCardinalDirections()
if E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.rotate then
if E.Retail then
Enum.EditModeMinimapSetting.RotateMinimap = 1
if E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.circle then
if E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.rotate then
if E.Retail then
Enum.EditModeMinimapSetting.RotateMinimap = 1
end
SetCVar("rotateMinimap",1)
else
if E.Retail then
Enum.EditModeMinimapSetting.RotateMinimap = 0
end
SetCVar("rotateMinimap",0)
end
SetCVar("rotateMinimap",1)

if Minimap.backdrop then
Minimap.backdrop:Hide()
Expand All @@ -471,7 +478,7 @@ function ElvUI_EltreumUI:MinimapCardinalDirections()
return 'ROUND'
end

if E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable then
if E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable and E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.rotate then
if not Minimap.EltruismRotate then
Minimap.EltruismRotate = Minimap:CreateTexture()
Minimap.EltruismRotate:SetTexture("Interface\\AddOns\\ElvUI_EltreumUI\\Media\\Textures\\cardinals.tga")
Expand Down Expand Up @@ -528,6 +535,47 @@ function ElvUI_EltreumUI:MinimapCardinalDirections()
end
Cardinals:SetScript("OnUpdate",nil)
onupdatesetup = false

if E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable then
if not Cardinals.N then
Cardinals.N = Cardinals:CreateFontString("EltruismNorth", "ARTWORK", "GameFontNormal")
end
Cardinals.N:SetText("N")
if not Cardinals.E then
Cardinals.E = Cardinals:CreateFontString("EltruismEast", "ARTWORK", "GameFontNormal")
end
Cardinals.E:SetText("E")
if not Cardinals.S then
Cardinals.S = Cardinals:CreateFontString("EltruismSouth", "ARTWORK", "GameFontNormal")
end
Cardinals.S:SetText("S")
if not Cardinals.W then
Cardinals.W = Cardinals:CreateFontString("EltruismWest", "ARTWORK", "GameFontNormal")
end
Cardinals.W:SetText("W")

Cardinals.N:SetPoint("BOTTOM", Minimap, "TOP", 0, -E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.offset)
Cardinals.E:SetPoint("LEFT", Minimap, "RIGHT", -E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.offset, 0)
Cardinals.S:SetPoint("TOP", Minimap, "BOTTOM", 0, E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.offset)
Cardinals.W:SetPoint("RIGHT", Minimap, "LEFT", E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.offset, 0)

Cardinals.N:SetFont(E.LSM:Fetch("font", E.db.general.font), E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.fontsize, ElvUI_EltreumUI:FontFlag(E.db.general.fontStyle))
Cardinals.E:SetFont(E.LSM:Fetch("font", E.db.general.font), E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.fontsize, ElvUI_EltreumUI:FontFlag(E.db.general.fontStyle))
Cardinals.S:SetFont(E.LSM:Fetch("font", E.db.general.font), E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.fontsize, ElvUI_EltreumUI:FontFlag(E.db.general.fontStyle))
Cardinals.W:SetFont(E.LSM:Fetch("font", E.db.general.font), E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.fontsize, ElvUI_EltreumUI:FontFlag(E.db.general.fontStyle))

if E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.classcolor then
Cardinals.N:SetTextColor(valuecolors.r,valuecolors.g,valuecolors.b)
Cardinals.E:SetTextColor(valuecolors.r,valuecolors.g,valuecolors.b)
Cardinals.S:SetTextColor(valuecolors.r,valuecolors.g,valuecolors.b)
Cardinals.W:SetTextColor(valuecolors.r,valuecolors.g,valuecolors.b)
else
Cardinals.N:SetTextColor(E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.r,E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.g,E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.b)
Cardinals.E:SetTextColor(E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.r,E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.g,E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.b)
Cardinals.S:SetTextColor(E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.r,E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.g,E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.b)
Cardinals.W:SetTextColor(E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.r,E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.g,E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.b)
end
end
end
else
if E.Retail then
Expand Down
1 change: 1 addition & 0 deletions ElvUI_EltreumUI/Settings/Profile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1714,6 +1714,7 @@ P.ElvUI_EltreumUI = {
offset = 23,
fontsize = 12,
rotate = false,
circle = false,
},
archeology = {
archeologyfontsize = 12,
Expand Down

0 comments on commit 5ba54c3

Please sign in to comment.