from retail

This commit is contained in:
NoM0Re
2025-01-23 19:40:40 +01:00
parent e1e0744ecf
commit 4ed4d4159b
15 changed files with 118 additions and 27 deletions
+2 -2
View File
@@ -2279,7 +2279,7 @@ local function createScanFunc(trigger)
local names = {}
for index, spellName in ipairs(trigger.ignoreAuraNames) do
local spellId = WeakAuras.SafeToNumber(spellName)
local name = GetSpellInfo(spellId or 0) or spellName
local name = spellId and GetSpellInfo(spellId or 0) or spellName
tinsert(names, name)
end
@@ -2386,7 +2386,7 @@ function BuffTrigger.Add(data)
names = {}
for index, spellName in ipairs(trigger.auranames) do
local spellId = WeakAuras.SafeToNumber(spellName)
names[index] = GetSpellInfo(spellId or 0) or spellName
names[index] = spellId and GetSpellInfo(spellId or 0) or spellName
end
end
+2 -2
View File
@@ -42,7 +42,7 @@ local function formatValueForAssignment(vType, value, pathToCustomFunction, path
return value and tostring(value) or "false";
elseif(vType == "number") then
return value and tostring(value) or "0";
elseif (vType == "list") then
elseif (vType == "list" or vType == "textureLSM") then
if type(value) == "string" then
return string.format("%s", Private.QuotedString(value))
elseif type(value) == "number" then
@@ -154,7 +154,7 @@ local function formatValueForAssignment(vType, value, pathToCustomFunction, path
end
local function formatValueForCall(type, property)
if type == "bool" or type == "number" or type == "list" or type == "icon" or type == "string" or type == "texture"
if type == "bool" or type == "number" or type == "list" or type == "icon" or type == "string" or type == "texture" or type == "textureLSM"
or type == "progressSource"
then
return "propertyChanges['" .. property .. "']";
+1 -1
View File
@@ -8,7 +8,7 @@ WeakAuras.halfWidth = WeakAuras.normalWidth / 2
WeakAuras.doubleWidth = WeakAuras.normalWidth * 2
local versionStringFromToc = GetAddOnMetadata("WeakAuras", "Version")
local versionString = "5.4.0"
local versionString = "5.13.2"
local buildTime = "20240701180000"
local isAwesomeEnabled = C_NamePlate and C_NamePlate.GetNamePlateForUnit or false
@@ -94,7 +94,7 @@ local methods = {
local status = self.status or self.localstatus
local height, viewheight = self.scrollframe:GetHeight(), self.content:GetHeight()
local offset = status.offset or 0
-- Give us a margin of error of 2 pixels to stop some conditions that i would blame on floating point inaccuracys
-- Give us a margin of error of 2 pixels to stop some conditions that i would blame on floating point inaccuracies
-- No-one is going to miss 2 pixels at the bottom of the frame, anyhow!
if viewheight < height + 2 then
if self.scrollBarShown then
+5 -1
View File
@@ -4918,7 +4918,11 @@ Private.event_prototypes = {
type = "event",
events = function(trigger)
if trigger.use_messageType and trigger.messageType and Private.chat_message_types[trigger.messageType] then
return { ["events"] = {trigger.messageType} }
local events = {trigger.messageType}
if Private.chat_message_leader_event[trigger.messageType] then
table.insert(events, Private.chat_message_leader_event[trigger.messageType])
end
return { events = events }
end
return {
["events"] = {
+59 -7
View File
@@ -11,6 +11,7 @@ local default = {
iconSource = -1,
progressSource = {-1, "" },
texture = "Blizzard",
textureSource = "LSM",
width = 200,
height = 15,
orientation = "HORIZONTAL",
@@ -45,6 +46,25 @@ Private.regionPrototype.AddAlphaToDefault(default);
local screenWidth, screenHeight = math.ceil(GetScreenWidth() / 20) * 20, math.ceil(GetScreenHeight() / 20) * 20;
local properties = {
textureSource = {
display = {L["Bar Texture"], L["Selection Mode"]},
setter = "SetStatusBarTextureMode",
type = "list",
values = {
LSM = L["LibSharedMedia"],
Picker = L["Texture Picker"]
}
},
textureInput = {
display = {L["Bar Texture"], L["Texture Picker"]},
setter = "SetStatusBarTextureInput",
type = "texture",
},
texture = {
display = {L["Bar Texture"], L["LibSharedMedia"]},
setter = "SetStatusBarTextureLSM",
type = "textureLSM",
},
barColor = {
display = L["Bar Color"],
setter = "Color",
@@ -896,6 +916,40 @@ local funcs = {
end
end,
SetStatusBarTextureMode = function(self, mode)
if self.textureSource == mode then
return
end
self.textureSource = mode
self:UpdateStatusBarTexture()
end,
SetStatusBarTextureInput = function(self, texture)
if self.textureInput == texture then
return
end
self.textureInput = texture
self:UpdateStatusBarTexture()
end,
SetStatusBarTextureLSM = function(self, texture)
if self.texture == texture then
return
end
self.texture = texture
self:UpdateStatusBarTexture()
end,
UpdateStatusBarTexture = function(self)
local texturePath
if self.textureSource == "Picker" then
texturePath = self.textureInput or ""
else
texturePath = SharedMedia:Fetch("statusbar", self.texture) or ""
end
self.bar:SetStatusBarTexture(texturePath)
end,
SetIconVisible = function(self, iconVisible)
if (self.iconVisible == iconVisible) then
return
@@ -1125,13 +1179,11 @@ local function modify(parent, region, data)
end
-- Update texture settings
local texturePath
if data.textureSource == "Picker" then
texturePath = data.textureInput or ""
else
texturePath = SharedMedia:Fetch("statusbar", data.texture) or "";
end
bar:SetStatusBarTexture(texturePath);
region.textureSource = data.textureSource
region.texture = data.texture
region.textureInput = data.textureInput
region:UpdateStatusBarTexture();
bar:SetBackgroundColor(data.backgroundColor[1], data.backgroundColor[2], data.backgroundColor[3], data.backgroundColor[4]);
-- Update spark settings
bar.spark:SetTexture(data.sparkTexture);
+18 -4
View File
@@ -27,6 +27,11 @@ Private.regionPrototype.AddAlphaToDefault(default);
local screenWidth, screenHeight = math.ceil(GetScreenWidth() / 20) * 20, math.ceil(GetScreenHeight() / 20) * 20;
local properties = {
texture = {
display = L["Texture"],
setter = "SetTexture",
type = "texture",
},
color = {
display = L["Color"],
setter = "Color",
@@ -82,7 +87,6 @@ end
local function modify(parent, region, data)
Private.regionPrototype.modify(parent, region, data);
region.texture:SetTexture(data.texture);
region.texture:SetDesaturated(data.desaturate)
region:SetWidth(data.width);
region:SetHeight(data.height);
@@ -178,12 +182,22 @@ local function modify(parent, region, data)
end
function region:Update()
if region.state.texture then
region.texture:SetTexture(region.state.texture);
if self.state.texture then
self:SetTexture(self.state.texture)
end
region:UpdateProgress()
self:UpdateProgress()
end
function region:SetTexture(texture)
if self.textureName == texture then
return
end
self.textureName = texture
self.texture:SetTexture(self.textureName);
DoTexCoord()
end
region:SetTexture(data.texture)
function region:Color(r, g, b, a)
region.color_r = r;
region.color_g = g;
+6
View File
@@ -2170,6 +2170,12 @@ Private.chat_message_types = {
CHAT_MSG_LOOT = L["Loot"],
}
Private.chat_message_leader_event = {
CHAT_MSG_BATTLEGROUND = "CHAT_MSG_BATTLEGROUND_LEADER",
CHAT_MSG_PARTY = "CHAT_MSG_PARTY_LEADER",
CHAT_MSG_RAID = "CHAT_MSG_RAID_LEADER"
}
Private.send_chat_message_types = {
WHISPER = L["Whisper"],
CHANNEL = L["Channel"],
+1 -1
View File
@@ -3460,7 +3460,7 @@ end
-- The constants table has weak keys
do
local function CompareProgressValueTables(a, b)
-- For auto/manual progreess, only compare a[] with b[1]
-- For auto/manual progress, only compare a[] with b[1]
if a[1] == -1 or a[1] == 0 then
return a[1] == b[1]
end
+2 -2
View File
@@ -1,7 +1,7 @@
## Interface: 30300
## Title: WeakAuras
## Author: The WeakAuras Team
## Version: 5.4.0
## Version: 5.13.2
## Notes: A powerful, comprehensive utility for displaying graphics and information based on buffs, debuffs, and other triggers.
## Notes-esES: Potente y completa aplicación que te permitirá mostrar por pantalla múltiples diseños, basados en beneficios, perjuicios y otros activadores.
## Notes-deDE: Ein leistungsfähiges, umfassendes Addon zur grafischen Darstellung von Informationen von Auren, Cooldowns, Timern und vielem mehr.
@@ -19,7 +19,7 @@
Templates.lua
Templates.xml
compat.lua
Compatibility.lua
Pools.lua
# External code + initialization
+4
View File
@@ -1472,6 +1472,8 @@ local function up(data, options, index)
local dereferencedParent = parent.references[id].options[parent.references[id].index]
if dereferencedParent.nameSource == optionID then
dereferencedParent.nameSource = optionID - 1
elseif dereferencedParent.nameSource == optionID - 1 then
dereferencedParent.nameSource = optionID
end
end
OptionsPrivate.MoveCollapseDataUp(id, "author", path)
@@ -1501,6 +1503,8 @@ local function down(data, options, index)
local dereferencedParent = parent.references[id].options[parent.references[id].index]
if dereferencedParent.nameSource == optionID then
dereferencedParent.nameSource = optionID + 1
elseif dereferencedParent.nameSource == optionID + 1 then
dereferencedParent.nameSource = optionID
end
end
local childOptions = optionData.options
+14 -3
View File
@@ -50,6 +50,8 @@ local AddonName, OptionsPrivate = ...
local WeakAuras = WeakAuras;
local L = WeakAuras.L;
local SharedMedia = LibStub("LibSharedMedia-3.0");
local function addSpace(args, order)
args["space" .. order] = {
type = "description",
@@ -613,12 +615,21 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA
set = setValueColor
}
order = order + 1;
elseif (propertyType == "list" or property == "progressSource") then
elseif (propertyType == "list" or propertyType == "progressSource" or propertyType == "textureLSM") then
local values = property and allProperties.propertyMap[property] and allProperties.propertyMap[property].values;
local dialogControl
if propertyType == "textureLSM" then
dialogControl = "WA_LSM30_StatusbarAtlas"
local statusbarList = {}
WeakAuras.Mixin(statusbarList, SharedMedia:HashTable("statusbar"))
values = statusbarList
end
args["condition" .. i .. "value" .. j] = {
type = "select",
width = WeakAuras.normalWidth,
values = values,
dialogControl = dialogControl,
name = blueIfNoValue(data, conditions[i].changes[j], "value", L["Differences"], ""),
desc = descIfNoValue(data, conditions[i].changes[j], "value", propertyType, values),
order = order,
@@ -663,7 +674,7 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA
return true
end
args["condition" .. i .. "progressSoruceManualValue" .. j] = {
args["condition" .. i .. "progressSourceManualValue" .. j] = {
type = "range",
control = "WeakAurasSpinBox",
width = WeakAuras.normalWidth,
@@ -681,7 +692,7 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA
}
order = order + 1
args["condition" .. i .. "progressSoruceManualTotal" .. j] = {
args["condition" .. i .. "progressSourceManualTotal" .. j] = {
type = "range",
control = "WeakAurasSpinBox",
width = WeakAuras.normalWidth,
+2 -2
View File
@@ -454,7 +454,7 @@ local function GetGenericTriggerOptions(data, triggernum)
{
subeventPrefix = {
type = "select",
name = L["Message Prefix"],
name = L["Subevent"],
width = WeakAuras.normalWidth,
order = 8,
values = OptionsPrivate.Private.subevent_prefix_types,
@@ -471,7 +471,7 @@ local function GetGenericTriggerOptions(data, triggernum)
subeventSuffix = {
type = "select",
width = WeakAuras.normalWidth,
name = L["Message Suffix"],
name = L["Subevent Suffix"],
order = 9,
values = OptionsPrivate.Private.subevent_suffix_types,
sorting = OptionsPrivate.Private.SortOrderForValues(OptionsPrivate.Private.subevent_suffix_types),
+1 -1
View File
@@ -1,7 +1,7 @@
## Interface: 30300
## Title: WeakAuras Options
## Author: The WeakAuras Team
## Version: 5.4.0
## Version: 5.13.2
## Notes: Options for WeakAuras
## Notes-esES: Opciones para WeakAuras
## Notes-deDE: Optionen für WeakAuras