Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed May 7, 2023
2 parents 5ef1fbe + 1e46db7 commit 4f8e134
Show file tree
Hide file tree
Showing 20 changed files with 298 additions and 115 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# CHANGELOG

## Version 100100.02

### Minimap

- Added minimap coordinates. Disabled by default.
- Adjusted minimap border textures to make zone colouring more pronounced.

### Unit Frames

- Readded fading options for pet, target of focus, and target of target frames.

## Version 100100.01

- Added 10.1.0 support.
Expand Down
Binary file added ls_UI/assets/backdrop.TGA
Binary file not shown.
Binary file modified ls_UI/assets/minimap-round-100.TGA
Binary file not shown.
Binary file modified ls_UI/assets/minimap-square-100.TGA
Binary file not shown.
1 change: 1 addition & 0 deletions ls_UI/core/_core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- can sort -->
<Script file="animation.lua"/>
<Script file="border.lua"/>
<Script file="backdrop.lua"/>
<Script file="button.lua"/>
<Script file="changelog.lua"/>
<Script file="cooldown.lua"/>
Expand Down
29 changes: 29 additions & 0 deletions ls_UI/core/backdrop.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
local _, ns = ...
local E, C, PrC, M, L, P = ns.E, ns.C, ns.PrC, ns.M, ns.L, ns.P

-- Lua
local _G = getfenv(0)

-- Mine
function E:CreateBackdrop(parent)
local backdrop = CreateFrame("Frame", nil, parent, "BackdropTemplate")
backdrop:SetBackdrop({
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
edgeFile = "Interface\\AddOns\\ls_Glass\\assets\\border",
tile = true,
tileEdge = true,
tileSize = 8,
edgeSize = 8,
-- insets = {left = 4, right = 4, top = 4, bottom = 4},
})

-- the way Blizz position it creates really weird gaps, so fix it
backdrop.Center:ClearAllPoints()
backdrop.Center:SetPoint("TOPLEFT", backdrop.TopLeftCorner, "BOTTOMRIGHT", 0, 0)
backdrop.Center:SetPoint("BOTTOMRIGHT", backdrop.BottomRightCorner, "TOPLEFT", 0, 0)

backdrop:SetBackdropColor(0, 0, 0, 0.6)
backdrop:SetBackdropBorderColor(0, 0, 0, 0.6)

return backdrop
end
10 changes: 6 additions & 4 deletions ls_UI/core/changelog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ local _G = getfenv(0)

-- Mine
E.CHANGELOG = [[
- Added 10.1.0 support.
- Removed login message for good. It served its purpose.
### Minimap
- Fixed an issue where the difficulty flag's position wasn't adjusted when flipping the minimap.
- Added minimap coordinates. Disabled by default.
- Adjusted minimap border textures to make zone colouring more pronounced.
### Unit Frames
- Readded fading options for pet, target of focus, and target of target frames.
]]
39 changes: 39 additions & 0 deletions ls_UI/core/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ D.global = {
blue = rgb(38, 125, 206), -- #267DCE (5PB 5/12)
yellow = rgb(246, 196, 66), -- #F6C442 (2.5Y 8/10)
gray = rgb(136, 137, 135), -- #888987 (N5)
light_gray = rgb(202, 202, 202), -- #CACACA (N8)
dark_gray = rgb(59, 58, 58), -- #3B3A3A (N2)
black = rgb(0, 0, 0), -- #000000
white = rgb(255, 255, 255), -- #FFFFFF
Expand Down Expand Up @@ -770,6 +771,17 @@ D.profile = {
width = 114,
height = 28,
point = {"BOTTOMRIGHT", "LSPlayerFrame", "BOTTOMLEFT", -12, 0},
fade = {
enabled = false,
combat = false,
target = false,
health = false,
out_delay = 0.75,
out_duration = 0.15,
in_duration = 0.15,
min_alpha = 0.2,
max_alpha = 1,
},
insets = {
t_size = 0.25,
b_size = 0.25,
Expand Down Expand Up @@ -1190,6 +1202,17 @@ D.profile = {
width = 114,
height = 28,
point = {"BOTTOMLEFT", "LSTargetFrame", "BOTTOMRIGHT", 12, 0},
fade = {
enabled = false,
combat = false,
target = false,
health = false,
out_delay = 0.75,
out_duration = 0.15,
in_duration = 0.15,
min_alpha = 0.2,
max_alpha = 1,
},
insets = {
t_size = 0.25,
b_size = 0.25,
Expand Down Expand Up @@ -1523,6 +1546,17 @@ D.profile = {
width = 114,
height = 28,
point = {"BOTTOMLEFT", "LSFocusFrame", "BOTTOMRIGHT", 12, 0},
fade = {
enabled = false,
combat = false,
target = false,
health = false,
out_delay = 0.75,
out_duration = 0.15,
in_duration = 0.15,
min_alpha = 0.2,
max_alpha = 1,
},
insets = {
t_size = 0.25,
b_size = 0.25,
Expand Down Expand Up @@ -1864,6 +1898,11 @@ D.profile = {
color = {
border = false,
},
coords = {
enabled = false,
background = true,
point = {"TOP", "Minimap", "BOTTOM", 0, -8},
},
flag = {
enabled = true,
tooltip = false,
Expand Down
13 changes: 0 additions & 13 deletions ls_UI/core/modernize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -776,19 +776,6 @@ function P:Modernize(data, name, key)
data.version = 10000501
end

--> 100005.03
if data.version < 10000503 then
if data.units then
for _, unit in next, {"pet", "focustarget", "targettarget"} do
if data.units[unit] then
data.units[unit].fade = nil
end
end
end

data.version = 10000503
end

--> 100100.01
if data.version < 10010001 then
if data.blizzard then
Expand Down
34 changes: 34 additions & 0 deletions ls_UI/core/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -947,3 +947,37 @@ do

E.FontStrings = module
end

----------
-- MAPS --
----------

-- credit: elcius@WoWInterface
do
local mapRects = {}
local tempVec2D = CreateVector2D(0, 0)

function E:GetPlayerMapPosition()
tempVec2D.x, tempVec2D.y = UnitPosition("player")
if not tempVec2D.x then return end

local mapID = C_Map.GetBestMapForUnit("player")
if not mapID then return end

local mapRect = mapRects[mapID]
if not mapRect then
local _, pos1 = C_Map.GetWorldPosFromMapPos(mapID, CreateVector2D(0, 0))
local _, pos2 = C_Map.GetWorldPosFromMapPos(mapID, CreateVector2D(1, 1))
if not (pos1 and pos2) then return end

mapRect = {pos1, pos2}
mapRect[2]:Subtract(mapRect[1])

mapRects[mapID] = mapRect
end

tempVec2D:Subtract(mapRect[1])

return tempVec2D.y / mapRect[2].y * 100, tempVec2D.x / mapRect[2].x * 100
end
end
2 changes: 2 additions & 0 deletions ls_UI/locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ L["ACCEPT"] = _G.ACCEPT
L["ADD"] = _G.ADD
L["ALT"] = _G.ALT_KEY_TEXT
L["ARCANE_CHARGES"] = _G.POWER_TYPE_ARCANE_CHARGES
L["BACKGROUND"] = _G.BACKGROUND
L["BACKPACK"] = _G.BACKPACK_TOOLTIP
L["CALL_TO_ARMS_TOOLTIP"] = _G.LFG_CALL_TO_ARMS
L["CANCEL"] = _G.CANCEL
Expand Down Expand Up @@ -177,6 +178,7 @@ L["COOLDOWN"] = "Cooldown"
L["COOLDOWN_SWIPE"] = "Swipe"
L["COOLDOWN_TEXT"] = "Cooldown Text"
L["COOLDOWNS"] = "Cooldowns"
L["COORDS"] = "Coordinates"
L["COPY_FROM"] = "Copy from"
L["COPY_FROM_DESC"] = "Select a unit to copy settings from."
L["COST_PREDICTION"] = "Cost Prediction"
Expand Down
1 change: 1 addition & 0 deletions ls_UI/locales/ruRU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ L["COOLDOWN"] = "Восстановление"
L["COOLDOWN_SWIPE"] = "Анимация восстановления"
L["COOLDOWN_TEXT"] = "Текст восстановления"
L["COOLDOWNS"] = "Время восстановления"
L["COORDS"] = "Координаты"
L["COPY_FROM"] = "Скопировать из"
L["COPY_FROM_DESC"] = "Выберете откуда скопировать настройки."
L["COST_PREDICTION"] = "Прогноз затрат"
Expand Down
2 changes: 1 addition & 1 deletion ls_UI/ls_UI.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 100100
## Author: lightspark
## Version: 100100.01
## Version: 100100.02
## Title: LS: |cff1a9fc0UI|r
## Notes: Yet another UI, but this one is a bit special...
## SavedVariables: LS_UI_GLOBAL_CONFIG, LS_UI_PRIVATE_CONFIG
Expand Down
14 changes: 7 additions & 7 deletions ls_UI/modules/blizzard/characterframe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,12 @@ function MODULE:SetUpCharacterFrame()
PaperDollFrame.TitleManagerPane:SetPoint("BOTTOMRIGHT", CharacterFrame.InsetRight, "BOTTOMRIGHT", -21, 4)

PaperDollFrame.TitleManagerPane.ScrollBox:SetSize(0, 0)
PaperDollFrame.TitleManagerPane.ScrollBox:SetPoint("TOPLEFT", CharacterFrame.InsetRight, "TOPLEFT", 3, -2)
PaperDollFrame.TitleManagerPane.ScrollBox:SetPoint("BOTTOMRIGHT", CharacterFrame.InsetRight, "BOTTOMRIGHT", -26, 5)
PaperDollFrame.TitleManagerPane.ScrollBox:SetPoint("TOPLEFT", CharacterFrame.InsetRight, "TOPLEFT", 3, -4)
PaperDollFrame.TitleManagerPane.ScrollBox:SetPoint("BOTTOMRIGHT", CharacterFrame.InsetRight, "BOTTOMRIGHT", -26, 4)

PaperDollFrame.TitleManagerPane.ScrollBar:ClearAllPoints()
PaperDollFrame.TitleManagerPane.ScrollBar:SetPoint("TOPRIGHT", CharacterFrame.InsetRight, "TOPRIGHT", 1, -2)
PaperDollFrame.TitleManagerPane.ScrollBar:SetPoint("BOTTOMRIGHT", CharacterFrame.InsetRight, "BOTTOMRIGHT", 1, 0)
PaperDollFrame.TitleManagerPane.ScrollBar:SetPoint("TOPRIGHT", CharacterFrame.InsetRight, "TOPRIGHT", -10, -8)
PaperDollFrame.TitleManagerPane.ScrollBar:SetPoint("BOTTOMRIGHT", CharacterFrame.InsetRight, "BOTTOMRIGHT", -10, 6)

hooksecurefunc("PaperDollTitlesPane_InitButton", function(button)
button.BgTop:Hide()
Expand All @@ -271,11 +271,11 @@ function MODULE:SetUpCharacterFrame()

PaperDollFrame.EquipmentManagerPane.ScrollBox:SetSize(0, 0)
PaperDollFrame.EquipmentManagerPane.ScrollBox:SetPoint("TOPLEFT", CharacterFrame.InsetRight, "TOPLEFT", 3, -28)
PaperDollFrame.EquipmentManagerPane.ScrollBox:SetPoint("BOTTOMRIGHT", CharacterFrame.InsetRight, "BOTTOMRIGHT", -26, 5)
PaperDollFrame.EquipmentManagerPane.ScrollBox:SetPoint("BOTTOMRIGHT", CharacterFrame.InsetRight, "BOTTOMRIGHT", -26, 4)

PaperDollFrame.EquipmentManagerPane.ScrollBar:ClearAllPoints()
PaperDollFrame.EquipmentManagerPane.ScrollBar:SetPoint("TOPRIGHT", CharacterFrame.InsetRight, "TOPRIGHT", 1, -2)
PaperDollFrame.EquipmentManagerPane.ScrollBar:SetPoint("BOTTOMRIGHT", CharacterFrame.InsetRight, "BOTTOMRIGHT", 1, 0)
PaperDollFrame.EquipmentManagerPane.ScrollBar:SetPoint("TOPRIGHT", CharacterFrame.InsetRight, "TOPRIGHT", -10, -8)
PaperDollFrame.EquipmentManagerPane.ScrollBar:SetPoint("BOTTOMRIGHT", CharacterFrame.InsetRight, "BOTTOMRIGHT", -10, 6)

hooksecurefunc("PaperDollEquipmentManagerPane_InitButton", function(button)
button.BgTop:Hide()
Expand Down
73 changes: 71 additions & 2 deletions ls_UI/modules/minimap/minimap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ local unpack = _G.unpack
-- Mine
local isInit = false

local cluster_proto = {}
local minimap_proto = {}

do
Expand All @@ -29,7 +30,7 @@ do
if self._config.color.border then
self.Border:SetVertexColor((C.db.global.colors.zone[zoneTypeToColor[GetZonePVPInfo() or "contested"]]):GetRGB())
else
self.Border:SetVertexColor(1, 1, 1)
self.Border:SetVertexColor(C.db.global.colors.light_gray:GetRGB())
end
end

Expand Down Expand Up @@ -115,7 +116,7 @@ do
GetMinimapShape = theBodyIsSquare
end

MinimapCluster:SetSize(info[3] + 24, info[3] + 24)
MinimapCluster:SetSize(info[3] + 24, info[3] + 24, true)
E.Movers:Get(MinimapCluster):UpdateSize()

self:SetSize(info[3] - 22, info[3] - 22)
Expand Down Expand Up @@ -164,6 +165,34 @@ do
self.DifficultyFlag:Hide()
end
end


function minimap_proto:UpdateCoords()
if self._config.coords.enabled then
self.Coords:ClearAllPoints()
self.Coords:SetPoint(unpack(self._config.coords.point))
self.Coords:Show()

if self._config.coords.background then
self.Coords:SetBackdropColor(0, 0, 0, 0.6)
self.Coords:SetBackdropBorderColor(0, 0, 0, 0.6)
else
self.Coords:SetBackdropColor(0, 0, 0, 0)
self.Coords:SetBackdropBorderColor(0, 0, 0, 0)
end
else
self.Coords:Hide()
end
end

function cluster_proto:ResetSize(_, _, shouldIgnore)
if not shouldIgnore then
local scale = self._config.scale
local info = borderInfo[scale] or borderInfo[100]

self:SetSize(info[3] + 24, info[3] + 24, true)
end
end
end

local flag_proto = {
Expand Down Expand Up @@ -280,6 +309,29 @@ do
end
end

local coords_proto = {}

do
local COORDS_FORMAT = "%.1f / %.1f"
local NO_COORDS = "n / a"

function coords_proto:OnUpdate(elapsed)
self.elapsed = (self.elapsed or 0) - elapsed
if self.elapsed < 0 then
local x, y = E:GetPlayerMapPosition()
if x then
self.Text:SetFormattedText(COORDS_FORMAT, x, y)

self.elapsed = 0.1
else
self.Text:SetText(NO_COORDS)

self.elapsed = 5
end
end
end
end

function MODULE:IsInit()
return isInit
end
Expand All @@ -290,8 +342,11 @@ function MODULE:Init()
LoadAddOn("Blizzard_TimeManager")
end

Mixin(MinimapCluster, cluster_proto)

MinimapCluster:ClearAllPoints()
MinimapCluster:SetPoint(unpack(C.db.profile.minimap.point))
hooksecurefunc(MinimapCluster, "SetSize", MinimapCluster.ResetSize)
E.Movers:Create(MinimapCluster)

Mixin(Minimap, minimap_proto)
Expand Down Expand Up @@ -383,6 +438,19 @@ function MODULE:Init()
flagIcon:SetTexture("Interface\\AddOns\\ls_UI\\assets\\minimap-flags")
difficultyFlag.Icon = flagIcon

local coords = Mixin(E:CreateBackdrop(textureParent), coords_proto)
coords:SetFrameLevel(Minimap:GetFrameLevel() + 2)
coords:SetScript("OnUpdate", coords.OnUpdate)
Minimap.Coords = coords

local coordsText = coords:CreateFontString(nil, "ARTWORK", "GameFontNormal")
coordsText:SetPoint("CENTER", 0, 0)
coordsText:SetText("99.9 / 99.9")
coordsText:SetJustifyH("CENTER")
coords.Text = coordsText

coords:SetSize(coordsText:GetUnboundedStringWidth() + 10, coordsText:GetStringHeight() + 8)

hooksecurefunc(MinimapCluster, "SetHeaderUnderneath", function()
Minimap:UpdateConfig()
Minimap:UpdateLayout()
Expand Down Expand Up @@ -477,6 +545,7 @@ function MODULE:Update()
Minimap:UpdateLayout()
Minimap:UpdateBorderColor()
Minimap:UpdateDifficultyFlag()
Minimap:UpdateCoords()
MinimapCluster:UpdateFading()
end
end
Expand Down
Loading

0 comments on commit 4f8e134

Please sign in to comment.