Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CustomiseDialog/Designer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,11 @@ function addonTable.CustomiseDialog.GetMainDesigner(parent)
end
if w.details.kind == "castIcon" and w.details.square then
w.background:Show()
local flip = w.details.flip or {}
addonTable.Display.UpdateTextureFlip(w.marker, flip.horizontal, 0.1, 0.9, 0.1, 0.9)
else
local flip = w.details.flip or {}
addonTable.Display.UpdateTextureFlip(w.marker, flip.horizontal)
end
elseif w.kind == "highlights" then
w:Show(true)
Expand Down
10 changes: 10 additions & 0 deletions CustomiseDialog/WidgetsConfiguration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,16 @@ addonTable.CustomiseDialog.WidgetsConfig = {
return details.color
end,
},
{
label = addonTable.Locales.FLIP,
kind = "checkbox",
setter = function(details, value)
details.flip = { horizontal = value }
end,
getter = function(details)
return details.flip and details.flip.horizontal
end,
},
},
},
},
Expand Down
3 changes: 3 additions & 0 deletions Display/CannotInterruptMarker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,7 @@ function addonTable.Display.CannotInterruptMarkerMixin:ApplyCasting()
else
self.marker:Hide()
end

local flip = self.details.flip or {}
addonTable.Display.UpdateTextureFlip(self.marker, flip.horizontal)
end
7 changes: 7 additions & 0 deletions Display/CastIconMarker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,11 @@ function addonTable.Display.CastIconMarkerMixin:ApplyCasting()
self.background:Hide()
end
end

local flip = self.details.flip or {}
if self.details.square then
addonTable.Display.UpdateTextureFlip(self.marker, flip.horizontal, 0.1, 0.9, 0.1, 0.9)
else
addonTable.Display.UpdateTextureFlip(self.marker, flip.horizontal)
end
end
4 changes: 4 additions & 0 deletions Display/EliteMarker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ function addonTable.Display.EliteMarkerMixin:SetUnit(unit)
else
self.marker:Hide()
end

local flip = self.details.flip or {}
addonTable.Display.UpdateTextureFlip(self.marker, flip.horizontal, flip.vertical)

else
self:Strip()
end
Expand Down
3 changes: 3 additions & 0 deletions Display/PvPMarker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,7 @@ function addonTable.Display.PvPMarkerMixin:Update()
else
self.marker:Hide()
end

local flip = self.details.flip or {}
addonTable.Display.UpdateTextureFlip(self.marker, flip.horizontal)
end
3 changes: 3 additions & 0 deletions Display/QuestMarker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ end

function addonTable.Display.QuestMarkerMixin:UpdateMarker()
self.marker:SetShown(C_QuestLog.UnitIsRelatedToActiveQuest and C_QuestLog.UnitIsRelatedToActiveQuest(self.unit))

local flip = self.details.flip or {}
addonTable.Display.UpdateTextureFlip(self.marker, flip.horizontal)
end

function addonTable.Display.QuestMarkerMixin:OnEvent(eventName, ...)
Expand Down
3 changes: 3 additions & 0 deletions Display/RaidMarker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ function addonTable.Display.RaidMarkerMixin:UpdateMarker()
else
self.marker:Hide()
end

local flip = self.details.flip or {}
addonTable.Display.UpdateTextureFlip(self.marker, flip.horizontal)
end
3 changes: 3 additions & 0 deletions Display/RareMarker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ function addonTable.Display.RareMarkerMixin:SetUnit(unit)
else
self.marker:Hide()
end

local flip = self.details.flip or {}
addonTable.Display.UpdateTextureFlip(self.marker, flip.horizontal)
else
self:Strip()
end
Expand Down
25 changes: 25 additions & 0 deletions Display/Utilities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,28 @@ function addonTable.Display.Utilities.IsInRelevantInstance()
local _, instanceType = GetInstanceInfo()
return instanceType == "raid" or instanceType == "party" or instanceType == "arenas"
end

function addonTable.Display.UpdateTextureFlip(texture, flipHorizontal, minU, maxU, minV, maxV)
local ULx, ULy, LLx, LLy, URx, URy, LRx, LRy

if minU then
ULx, ULy = minU, minV
LLx, LLy = minU, maxV
URx, URy = maxU, minV
LRx, LRy = maxU, maxV
else
ULx, ULy, LLx, LLy, URx, URy, LRx, LRy = texture:GetTexCoord()
end

local left = math.min(ULx, LLx, URx, LRx)
local right = math.max(ULx, LLx, URx, LRx)
if flipHorizontal then
ULx, LLx = right, right
URx, LRx = left, left
else
ULx, LLx = left, left
URx, LRx = right, right
end

texture:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy)
end
2 changes: 2 additions & 0 deletions Locales.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ L["DIFFICULTY"] = "Difficulty"
L["AUTOMATIC"] = "Automatic"
L["SHOW_NAMEPLATES_ONLY_IF_NEEDED"] = "Show nameplates only if needed"
L["NEVER"] = "Never"

L["FLIP"] = "Flip"
L["NAME_ONLY_PLAYERS"] = "Name only (players)"
L["ALWAYS_ALL"] = "Always (all)"
L["ON_TARGET_SCALE"] = "On target scale"
Expand Down