Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Commit

Permalink
Merge commit 'eaf45925d7735d95e1f01af1ee8644b254fd0138' into master
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/scripts/.lastclassicwowbuild
#	.luacheckrc
#	.pkgmeta-bc
#	.pkgmeta-classic
#	WeakAuras/Prototypes.lua
#	WeakAuras/WeakAuras.lua
#	WeakAuras/WeakAuras.toc
#	WeakAurasModelPaths/ModelPathsClassic.lua
#	WeakAurasTemplates/TriggerTemplatesData.lua
  • Loading branch information
Maczuga committed May 18, 2021
2 parents 1067358 + eaf4592 commit 3530e11
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 153 deletions.
2 changes: 2 additions & 0 deletions .pkgmeta
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ ignore:
- update_translations.sh
- generate_changelog.sh
- WeakAurasModelPaths/ModelPathsClassic.lua
- WeakAurasTemplates/TriggerTemplatesDataClassic.lua
- WeakAurasTemplates/TriggerTemplatesDataTBC.lua

move-folders:
WeakAuras/WeakAuras: WeakAuras
Expand Down
4 changes: 2 additions & 2 deletions WeakAuras/GenericTrigger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ local WeakAuras = WeakAuras;
local L = WeakAuras.L;
local GenericTrigger = {};
local LCSA
if WeakAuras.IsClassic() or WeakAuras.IsBC() then
if WeakAuras.IsClassic() then
LCSA = LibStub("LibClassicSpellActionCount-1.0")
end

Expand Down Expand Up @@ -2086,7 +2086,7 @@ do
end

local count
if WeakAuras.IsClassic() or WeakAuras.IsBC() then
if WeakAuras.IsClassic() then
count = LCSA:GetSpellReagentCount(id)
else
count = GetSpellCount(id)
Expand Down
1 change: 1 addition & 0 deletions WeakAuras/Prototypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ local GetShapeshiftFormInfo, GetShapeshiftForm = GetShapeshiftFormInfo, GetShape
local GetRuneCooldown, UnitCastingInfo, UnitChannelInfo = GetRuneCooldown, UnitCastingInfo, UnitChannelInfo
local UnitDetailedThreatSituation, UnitThreatSituation = UnitDetailedThreatSituation, UnitThreatSituation
-- local CastingInfo, ChannelInfo = CastingInfo, ChannelInfo
local MAX_NUM_TALENTS = MAX_NUM_TALENTS or 20

local WeakAuras = WeakAuras
local L = WeakAuras.L
Expand Down
8 changes: 5 additions & 3 deletions WeakAuras/Types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local wipe, tinsert = wipe, tinsert
local GetNumShapeshiftForms, GetShapeshiftFormInfo = GetNumShapeshiftForms, GetShapeshiftFormInfo
local GetNumSpecializationsForClassID, GetSpecializationInfoForClassID = GetNumSpecializationsForClassID, GetSpecializationInfoForClassID
local WrapTextInColorCode = WrapTextInColorCode
local MAX_NUM_TALENTS = MAX_NUM_TALENTS or 20

local function WA_GetClassColor(classFilename)
local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[classFilename]
Expand Down Expand Up @@ -1082,6 +1083,7 @@ Private.subevent_suffix_types = {
_DAMAGE = L["Damage"],
_MISSED = L["Missed"],
_HEAL = L["Heal"],
_HEAL_ABSORBED = L["Heal Absorbed"],
_ENERGIZE = L["Energize"],
_DRAIN = L["Drain"],
_INTERRUPT = L["Interrupt"],
Expand Down Expand Up @@ -1272,9 +1274,9 @@ if WeakAuras.IsRetail() then
tier = 1
end
else
for tab = 1, 5 do
for num_talent = 1, 20 do
local talentId = (tab - 1)*20+num_talent
for tab = 1, GetNumTalentTabs() do
for num_talent = 1, GetNumTalents(tab) do
local talentId = (tab - 1) * MAX_NUM_TALENTS + num_talent
Private.talent_types[talentId] = L["Tab "]..tab.." - "..num_talent
end
end
Expand Down
6 changes: 4 additions & 2 deletions WeakAuras/WeakAuras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ local SendChatMessage, GetChannelName, UnitInBattleground, UnitInRaid, UnitInPar
local CreateFrame, IsShiftKeyDown, GetScreenWidth, GetScreenHeight, GetCursorPosition, UpdateAddOnCPUUsage, GetFrameCPUUsage, debugprofilestop
= CreateFrame, IsShiftKeyDown, GetScreenWidth, GetScreenHeight, GetCursorPosition, UpdateAddOnCPUUsage, GetFrameCPUUsage, debugprofilestop
local debugstack, IsSpellKnown = debugstack, IsSpellKnown
local MAX_NUM_TALENTS = MAX_NUM_TALENTS or 20

local ADDON_NAME = "WeakAuras"
local WeakAuras = WeakAuras
Expand Down Expand Up @@ -756,7 +757,8 @@ local function CreateTalentCache()
end

function WeakAuras.CountWagoUpdates()
if not (WeakAurasCompanion and WeakAurasCompanion.slugs) then
local CompanionData = WeakAurasCompanion and WeakAurasCompanion.WeakAuras or WeakAurasCompanion
if not (CompanionData and CompanionData.slugs) then
return 0
end
local WeakAurasSaved = WeakAurasSaved
Expand All @@ -769,7 +771,7 @@ function WeakAuras.CountWagoUpdates()
version = 1
end
if slug and version then
local wago = WeakAurasCompanion.slugs[slug]
local wago = CompanionData.slugs and CompanionData.slugs[slug]
if wago and wago.wagoVersion
and tonumber(wago.wagoVersion) > (
aura.skipWagoUpdate and tonumber(aura.skipWagoUpdate) or tonumber(version)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local tinsert, tconcat, tremove, wipe = table.insert, table.concat, table.remove
local select, pairs, next, type, unpack = select, pairs, next, type, unpack
local tostring, error = tostring, error

local Type, Version = "WeakAurasDisplayButton", 56
local Type, Version = "WeakAurasDisplayButton", 57
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end

Expand Down Expand Up @@ -1514,11 +1514,11 @@ local methods = {
end
end,
["HasUpdate"] = function(self)
-- return hasUpdate, skipVersion, updateData, key
if not WeakAurasCompanion or self.data.ignoreWagoUpdate then return end
local slug = self.data.uid and WeakAurasCompanion.uids[self.data.uid] or WeakAurasCompanion.ids[self.data.id]
local CompanionData = WeakAurasCompanion and WeakAurasCompanion.WeakAuras or WeakAurasCompanion
if not (CompanionData and CompanionData.uids and CompanionData.ids) or self.data.ignoreWagoUpdate then return end
local slug = self.data.uid and CompanionData.uids[self.data.uid] or CompanionData.ids[self.data.id]
if slug then
local updateData = WeakAurasCompanion.slugs[slug]
local updateData = CompanionData.slugs and CompanionData.slugs[slug]
if updateData then
if not (self.data.skipWagoUpdate and self.data.skipWagoUpdate == updateData.wagoVersion) then
if not self.data.version or tonumber(updateData.wagoVersion) > tonumber(self.data.version) then
Expand Down
2 changes: 1 addition & 1 deletion WeakAurasOptions/CommonOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ local function replaceNameDescFuncs(intable, data, subOption)
end
end
end
return combinedName;
return combinedName or "";
end

local function descAll(info)
Expand Down
93 changes: 34 additions & 59 deletions WeakAurasOptions/OptionsFrames/ModelPicker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,23 @@ local function GetAll(baseObject, path, property, default)
if not property then
return default
end
if baseObject.controlledChildren then
local result
local first = true
for index, childId in pairs(baseObject.controlledChildren) do
local childData = WeakAuras.GetData(childId)
local childObject = valueFromPath(childData, path)
if childObject and childObject[property] then
if first then
result = childObject[property]
first = false
else
if result ~= childObject[property] then
return default
end

local result = default
local first = true
for child in OptionsPrivate.Private.TraverseLeafsOrAura(baseObject) do
local childObject = valueFromPath(child, path)
if childObject and childObject[property] then
if first then
result = childObject[property]
first = false
else
if result ~= childObject[property] then
return default
end
end
end
return result
else
local object = valueFromPath(baseObject, path)
if object and object[property] then
return object[property]
end
return default
end
return result
end

local function ConstructModelPicker(frame)
Expand Down Expand Up @@ -304,22 +296,13 @@ local function ConstructModelPicker(frame)
self.model:SetTransform(self.selectedValues.model_st_tx / 1000, self.selectedValues.model_st_ty / 1000, self.selectedValues.model_st_tz / 1000,
rad(self.selectedValues.model_st_rx), rad(self.selectedValues.model_st_ry), rad(self.selectedValues.model_st_rz),
self.selectedValues.model_st_us / 1000);
if(self.baseObject.controlledChildren) then
for index, childId in pairs(self.baseObject.controlledChildren) do
local childData = WeakAuras.GetData(childId)
local object = valueFromPath(childData, self.path)
if(object) then
SetStOnObject(object, model_path, model_fileId, model_tx, model_ty, model_tz, model_rx, model_ry, model_rz, model_us)
WeakAuras.Add(childData);
WeakAuras.UpdateThumbnail(childData);
end
end
else
local object = valueFromPath(self.baseObject, self.path)
if object then

for child in OptionsPrivate.Private.TraverseLeafsOrAura(self.baseObject) do
local object = valueFromPath(child, self.path)
if(object) then
SetStOnObject(object, model_path, model_fileId, model_tx, model_ty, model_tz, model_rx, model_ry, model_rz, model_us)
WeakAuras.Add(self.baseObject)
WeakAuras.UpdateThumbnail(self.baseObject)
WeakAuras.Add(child);
WeakAuras.UpdateThumbnail(child);
end
end
end
Expand Down Expand Up @@ -361,22 +344,12 @@ local function ConstructModelPicker(frame)
self.model:SetPosition(self.selectedValues.model_z, self.selectedValues.model_x, self.selectedValues.model_y);
self.model:SetFacing(rad(self.selectedValues.rotation));

if(self.baseObject.controlledChildren) then
for index, childId in pairs(self.baseObject.controlledChildren) do
local childData = WeakAuras.GetData(childId)
local object = valueFromPath(childData, self.path)
if(object) then
SetOnObject(object, model_path, model_fileId, model_z, model_x, model_y, rotation)
WeakAuras.Add(childData)
WeakAuras.UpdateThumbnail(childData)
end
end
else
local object = valueFromPath(self.baseObject, self.path)
if object then
for child in OptionsPrivate.Private.TraverseLeafsOrAura(self.baseObject) do
local object = valueFromPath(child, self.path)
if(object) then
SetOnObject(object, model_path, model_fileId, model_z, model_x, model_y, rotation)
WeakAuras.Add(self.baseObject)
WeakAuras.UpdateThumbnail(self.baseObject)
WeakAuras.Add(child)
WeakAuras.UpdateThumbnail(child)
end
end
end
Expand Down Expand Up @@ -474,6 +447,7 @@ local function ConstructModelPicker(frame)

if(baseObject.controlledChildren) then
self.givenModel = {};
self.givenModelId = {};
self.givenApi = {};
self.givenZ = {};
self.givenX = {};
Expand All @@ -486,11 +460,12 @@ local function ConstructModelPicker(frame)
self.givenRY = {};
self.givenRZ = {};
self.givenUS = {};
for index, childId in pairs(baseObject.controlledChildren) do
local childData = WeakAuras.GetData(childId)
local object = valueFromPath(childData, path)
for child in OptionsPrivate.Private.TraverseLeafs(baseObject) do
local childId = child.id
local object = valueFromPath(child, path)
if(object) then
self.givenModel[childId] = object.model_path;
self.givenModelId[childId] = object.model_fileId;
self.givenApi[childId] = object.api;
if (object.api) then
self.givenTX[childId] = object.model_st_tx;
Expand Down Expand Up @@ -543,9 +518,9 @@ local function ConstructModelPicker(frame)
function group.CancelClose()
local valueFromPath = OptionsPrivate.Private.ValueFromPath
if(group.baseObject.controlledChildren) then
for index, childId in pairs(group.baseObject.controlledChildren) do
local childData = WeakAuras.GetData(childId);
local object = valueFromPath(childData, group.path)
for child in OptionsPrivate.Private.TraverseLeafs(group.baseObject) do
local childId = child.id
local object = valueFromPath(child, group.path)
if(object) then
object.model_path = group.givenModel[childId];
object.model_fileId = group.givenModelId[childId];
Expand All @@ -564,8 +539,8 @@ local function ConstructModelPicker(frame)
object.model_y = group.givenY[childId];
object.rotation = group.givenRotation[childId];
end
WeakAuras.Add(childData);
WeakAuras.UpdateThumbnail(childData);
WeakAuras.Add(child);
WeakAuras.UpdateThumbnail(child);
end
end
else
Expand Down
Loading

0 comments on commit 3530e11

Please sign in to comment.