from retail

This commit is contained in:
Bunny67
2020-12-27 05:57:15 +03:00
parent 7cbc40c959
commit e0672fe539
31 changed files with 291 additions and 131 deletions
+4 -2
View File
@@ -399,9 +399,11 @@ local exec_env = setmetatable({},
elseif k == "aura_env" then
return current_aura_env
elseif blockedFunctions[k] then
return blocked
blocked(k)
return function() end
elseif blockedTables[k] then
return blocked()
blocked(k)
return {}
elseif overridden[k] then
return overridden[k]
else
+3 -1
View File
@@ -216,7 +216,7 @@ local function CreateTestForCondition(uid, input, allConditionsTemplate, usedSta
end
elseif (cType == "customcheck") then
if value then
local customCheck = WeakAuras.LoadFunction("return " .. value, "custom check")
local customCheck = WeakAuras.LoadFunction("return " .. value, Private.UIDtoID(uid), "conditions custom check")
if customCheck then
WeakAuras.conditionHelpers[uid] = WeakAuras.conditionHelpers[uid] or {}
WeakAuras.conditionHelpers[uid].customTestFunctions = WeakAuras.conditionHelpers[uid].customTestFunctions or {}
@@ -642,7 +642,9 @@ end
function Private.RunConditions(region, uid, hideRegion)
if (checkConditions[uid]) then
Private.ActivateAuraEnvironmentForRegion(region)
checkConditions[uid](region, hideRegion);
Private.ActivateAuraEnvironment()
end
end
+3 -3
View File
@@ -8,8 +8,8 @@ WeakAuras.halfWidth = WeakAuras.normalWidth / 2
WeakAuras.doubleWidth = WeakAuras.normalWidth * 2
local versionStringFromToc = GetAddOnMetadata("WeakAuras", "Version")
local versionString = "3.0.6"
local buildTime = "20201109223200"
local versionString = "3.1.4"
local buildTime = "20201210233053"
WeakAuras.versionString = versionStringFromToc
WeakAuras.buildTime = buildTime
@@ -29,7 +29,7 @@ WeakAuras.prettyPrint = function(msg)
end
if versionString ~= versionStringFromToc and versionStringFromToc ~= "Dev" then
Private.prettyPrint("You need to restart your game client to complete the WeakAuras update!")
WeakAuras.prettyPrint("You need to restart your game client to complete the WeakAuras update!")
end
-- Force enable WeakAurasCompanion and Archive because some addon managers interfere with it
+1
View File
@@ -360,6 +360,7 @@ function Private.Modernize(data)
text2FontSize = "sub.2.text_fontSize"
}
data.subRegions = data.subRegions or {}
tinsert(data.subRegions, text1)
if (usetext2) then
tinsert(data.subRegions, text2)
+10 -3
View File
@@ -990,9 +990,7 @@ Private.event_prototypes = {
AddUnitEventForEvents(result, unit, "UNIT_LEVEL")
AddUnitEventForEvents(result, unit, "UNIT_FACTION")
AddUnitEventForEvents(result, unit, "UNIT_NAME_UPDATE")
if trigger.use_ignoreDead or trigger.use_ignoreDisconnected then
AddUnitEventForEvents(result, unit, "UNIT_FLAGS")
end
AddUnitEventForEvents(result, unit, "UNIT_FLAGS")
return result;
end,
internal_events = function(trigger)
@@ -1164,6 +1162,14 @@ Private.event_prototypes = {
store = true,
conditionType = "bool"
},
{
name = "inCombat",
display = L["In Combat"],
type = "tristate",
init = "UnitAffectingCombat(unit) == 1 and true or false",
store = true,
conditionType = "bool"
},
{
hidden = true,
test = "WeakAuras.UnitExistsFixed(unit, smart) and specificUnitCheck"
@@ -3511,6 +3517,7 @@ Private.event_prototypes = {
"GCD_UPDATE",
"WA_DELAYED_PLAYER_ENTERING_WORLD"
},
force_events = "GCD_UPDATE",
name = L["Global Cooldown"],
loadFunc = function(trigger)
WeakAuras.WatchGCD();
+1 -1
View File
@@ -55,7 +55,7 @@ local properties = {
type = "color",
},
icon_visible = {
display = {L["Icon"], L["Visible"]},
display = {L["Icon"], L["Visibility"]},
setter = "SetIconVisible",
type = "bool"
},
+1 -2
View File
@@ -761,8 +761,7 @@ end
local function modify(parent, region, data)
Private.FixGroupChildrenOrderForGroup(data)
-- Scale
region:SetScale(data.scale and data.scale > 0 and data.scale or 1)
region:SetScale(data.scale and data.scale > 0 and data.scale <= 10 and data.scale or 1)
WeakAuras.regionPrototype.modify(parent, region, data)
if data.border and (data.grow ~= "CUSTOM" and not data.useAnchorPerUnit) then
+1 -1
View File
@@ -88,7 +88,7 @@ local function modify(parent, region, data)
local border = region.border;
-- Scale
region:SetScale(data.scale and data.scale > 0 and data.scale or 1)
region:SetScale(data.scale and data.scale > 0 and data.scale <= 10 and data.scale or 1)
-- Get overall bounding box
local leftest, rightest, lowest, highest = 0, 0, 0, 0;
+15
View File
@@ -96,6 +96,21 @@ local function modify(parent, region, data)
region:SetWidth(region.width);
region:SetHeight(region.height);
local tooltipType = Private.CanHaveTooltip(data);
if(tooltipType and data.useTooltip) then
if not region.tooltipFrame then
region.tooltipFrame = CreateFrame("frame", nil, region);
region.tooltipFrame:SetAllPoints(region);
region.tooltipFrame:SetScript("OnEnter", function()
Private.ShowMouseoverTooltip(region, region);
end);
region.tooltipFrame:SetScript("OnLeave", Private.HideTooltip);
end
region.tooltipFrame:EnableMouse(true);
elseif region.tooltipFrame then
region.tooltipFrame:EnableMouse(false);
end
text:SetShadowColor(unpack(data.shadowColor))
text:SetShadowOffset(data.shadowXOffset, data.shadowYOffset)
+76 -33
View File
@@ -4,6 +4,8 @@ local AddonName, Private = ...
local SharedMedia = LibStub("LibSharedMedia-3.0");
local L = WeakAuras.L;
Private.barmodels = {}
local default = function(parentType)
return {
bar_model_visible = true,
@@ -35,8 +37,23 @@ local properties = {
}
}
local function PreShow(self)
local data = self.data
--self:SetKeepModelOnHide(true)
self:Show()
-- Adjust model
self:SetModel(data.model_path)
self:SetPosition(data.model_z, data.model_x, data.model_y);
self:SetFacing(0);
self:SetAlpha(self.region.alpha)
end
local function CreateModel()
return CreateFrame("PlayerModel", nil, UIParent)
local model = CreateFrame("PlayerModel", nil, UIParent)
model.PreShow = PreShow;
return model
end
-- Keep the two model apis separate
@@ -44,6 +61,8 @@ local pool = CreateObjectPool(CreateModel)
local function AcquireModel(region, data)
local model = pool:Acquire()
model.data = data
Private.barmodels[model] = true
model:ClearAllPoints()
@@ -72,12 +91,66 @@ local function ReleaseModel(model)
--model:SetKeepModelOnHide(false)
model:Hide()
pool:Release(model)
Private.barmodels[model] = nil
end
local funcs = {
SetVisible = function(self, visible)
self.visible = visible
self:UpdateVisible()
end,
SetAlpha = function(self, alpha)
if self.model then
self.model:SetModelAlpha(alpha)
end
self.alpha = alpha
end,
AlphaChanged = function(self)
self:SetAlpha(self.alpha)
end,
UpdateVisible = function(self)
local effectiveVisible = self.parent_visible and self.visible and not self.toosmall
if effectiveVisible then
if not self.model then
self.model = AcquireModel(self, self.data)
self.model:SetAlpha(self.alpha)
self.model.region = self
end
else
if self.model then
ReleaseModel(self.model)
self.model = nil
end
end
end,
PreShow = function(self)
self.parent_visible = true
self:UpdateVisible()
end,
PreHide = function(self)
self.parent_visible = false
self:UpdateVisible()
end,
OnSizeChanged = function(self)
-- WORKAROUND clipping being broken on the SL beta with some setups with bars of zero width
if self:GetWidth() < 1 or self:GetHeight() < 1 then
self.toosmall = true
else
self.toosmall = false
end
self:UpdateVisible()
end
}
local function create()
local subRegion = CreateFrame("FRAME", nil, UIParent)
--subRegion:SetClipsChildren(true)
for k, v in pairs(funcs) do
subRegion[k] = v
end
subRegion:SetScript("OnSizeChanged", subRegion.OnSizeChanged)
return subRegion
end
@@ -89,34 +162,6 @@ local function onRelease(subRegion)
subRegion:Hide()
end
local funcs = {
SetVisible = function(self, visible)
self.visible = visible
if visible then
if not self.model then
self.model = AcquireModel(self, self.data)
self.model:SetAlpha(self.alpha)
end
self:Show()
else
self:Hide()
if self.model then
ReleaseModel(self.model)
self.model = nil
end
end
end,
SetAlpha = function(self, alpha)
if self.model then
self.model:SetAlpha(alpha)
end
self.alpha = alpha
end,
AlphaChanged = function(self)
self:SetAlpha(self.alpha)
end
}
local function modify(parent, region, parentData, data, first)
if region.model then
ReleaseModel(region.model)
@@ -139,14 +184,12 @@ local function modify(parent, region, parentData, data, first)
region:SetAllPoints(parent)
end
for k, v in pairs(funcs) do
region[k] = v
end
region:SetAlpha(data.bar_model_alpha)
region:SetVisible(data.bar_model_visible)
parent.subRegionEvents:AddSubscriber("AlphaChanged", region)
parent.subRegionEvents:AddSubscriber("PreShow", region)
parent.subRegionEvents:AddSubscriber("PreHide", region)
end
local function supports(regionType)
+12 -9
View File
@@ -20,13 +20,13 @@ end
local properties = {
border_visible = {
display = L["Show Border"],
display = L["Visibility"],
setter = "SetVisible",
type = "bool",
defaultProperty = true
},
border_color = {
display = L["Border Color"],
display = L["Color"],
setter = "SetBorderColor",
type = "color"
},
@@ -50,13 +50,16 @@ local function modify(parent, region, parentData, data, first)
parent:AnchorSubRegion(region, "area", parentData.regionType == "aurabar" and data.border_anchor, nil, data.border_offset, data.border_offset)
region:SetBackdrop({
edgeFile = SharedMedia:Fetch("border", data.border_edge) or "",
edgeSize = data.border_size,
bgFile = nil,
});
region:SetBackdropBorderColor(data.border_color[1], data.border_color[2], data.border_color[3], data.border_color[4])
region:SetBackdropColor(0, 0, 0, 0)
local edgeFile = SharedMedia:Fetch("border", data.border_edge)
if edgeFile and edgeFile ~= "" then
region:SetBackdrop({
edgeFile = edgeFile,
edgeSize = data.border_size,
bgFile = nil,
})
region:SetBackdropBorderColor(data.border_color[1], data.border_color[2], data.border_color[3], data.border_color[4])
region:SetBackdropColor(0, 0, 0, 0)
end
function region:SetBorderColor(r, g, b, a)
self:SetBackdropBorderColor(r, g, b, a or 1)
+1 -1
View File
@@ -35,7 +35,7 @@ end
local properties = {
glow = {
display = L["Show Glow"],
display = L["Visibility"],
setter = "SetVisible",
type = "bool",
defaultProperty = true
+4 -6
View File
@@ -1127,7 +1127,7 @@ local function scamCheck(codes, data)
if (data.conditions) then
for _, condition in ipairs(data.conditions) do
if (condition) then
if (condition and condition.changes) then
for _, property in ipairs(condition.changes) do
if ((property.property == "chat" or property.property == "customcode") and type(property.value) == "table" and property.value.custom) then
checkCustomCondition(codes, L["%s - Condition Custom Chat"]:format(data.id), property.value.custom);
@@ -1817,11 +1817,9 @@ Comm:RegisterComm("WeakAuras", function(prefix, message, distribution, sender)
local matchInfo = MatchInfo(data, children)
ShowDisplayTooltip(data, children, matchInfo, icon, icons, sender, true)
elseif(received.m == "dR") then
--if(WeakAuras.linked[received.d]) then
TransmitDisplay(received.d, sender);
--else
-- TransmitError("not authorized", sender);
--end
if(Private.linked and Private.linked[received.d]) then
TransmitDisplay(received.d, sender);
end
elseif(received.m == "dE") then
tooltipLoading = nil;
if(received.eM == "dne") then
+4 -1
View File
@@ -143,7 +143,7 @@ Private.format_types = {
name = L["Max Char "],
width = WeakAuras.normalWidth,
min = 1,
max = 20,
softMax = 20,
hidden = hidden,
step = 1,
disabled = function()
@@ -2266,6 +2266,9 @@ WeakAuras.data_stub = {
class = {
multi = {},
},
talent = {
multi = {},
},
},
actions = {
init = {},
+3 -10
View File
@@ -1355,16 +1355,10 @@ function Private.Resume()
end
end
Private.ResumeAllDynamicGroups();
UnloadAll();
scanForLoadsImpl();
for _, regionData in pairs(regions) do
if regionData.region.Resume then
regionData.region:Resume(true)
end
end
Private.ResumeAllDynamicGroups();
end
function Private.LoadDisplays(toLoad, ...)
@@ -2337,6 +2331,8 @@ function WeakAuras.PreAdd(data)
regionValidate(data)
end
Private.Modernize(data);
WeakAuras.validate(data, WeakAuras.data_stub);
if data.subRegions then
local result = {}
for index, subRegionData in ipairs(data.subRegions) do
@@ -2362,9 +2358,6 @@ function WeakAuras.PreAdd(data)
end
data.subRegions = result
end
Private.Modernize(data);
WeakAuras.validate(data, WeakAuras.data_stub);
validateUserConfig(data, data.authorOptions, data.config)
removeSpellNames(data)
data.init_started = nil
+1 -1
View File
@@ -1,7 +1,7 @@
## Interface: 30300
## Title: WeakAuras
## Author: The WeakAuras Team
## Version: 3.0.6
## Version: 3.1.4
## 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.
@@ -527,6 +527,8 @@ local methods = {
end
end
editbox:Insert("[WeakAuras: "..fullName.." - "..data.id.."]");
OptionsPrivate.Private.linked = OptionsPrivate.Private.linked or {}
OptionsPrivate.Private.linked[data.id] = true
elseif not data.controlledChildren then
-- select all buttons between 1st select and current
OptionsPrivate.PickDisplayMultipleShift(data.id)
@@ -624,12 +626,21 @@ local methods = {
if (WeakAuras.IsImporting()) then return end;
if data.controlledChildren then
local new_idGroup = OptionsPrivate.DuplicateAura(data)
-- Do this after duplicating the parent!
OptionsPrivate.Private.PauseAllDynamicGroups()
for index, childId in pairs(data.controlledChildren) do
local childData = WeakAuras.GetData(childId)
OptionsPrivate.DuplicateAura(childData, new_idGroup)
OptionsPrivate.DuplicateAura(childData, new_idGroup, true)
end
local button = WeakAuras.GetDisplayButton(new_idGroup)
button.callbacks.UpdateExpandButton()
WeakAuras.UpdateDisplayButton(WeakAuras.GetData(new_idGroup))
WeakAuras.SortDisplayButtons()
OptionsPrivate.PickAndEditDisplay(new_idGroup)
OptionsPrivate.Private.ResumeAllDynamicGroups()
else
local new_id = OptionsPrivate.DuplicateAura(data)
WeakAuras.SortDisplayButtons()
+2
View File
@@ -163,6 +163,8 @@ function OptionsPrivate.GetActionOptions(data)
order = 8.2,
hidden = function() return not data.actions.start.do_loop end,
disabled = function() return not data.actions.start.do_sound end,
min = 0,
softMax = 100,
},
start_sound_repeat_space = {
type = "description",
+13 -6
View File
@@ -1004,7 +1004,7 @@ local function CreateExecuteAll(subOption)
end
end
local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint)
local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, group)
local metaOrder = 99
local function IsParentDynamicGroup()
if data.parent then
@@ -1209,7 +1209,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint)
};
OptionsPrivate.commonOptions.AddCodeOption(positionOptions, data, L["Custom Anchor"], "custom_anchor", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-anchor-function",
72.1, function() return not(data.anchorFrameType == "CUSTOM" and not IsParentDynamicGroup()) end, {"customAnchor"}, false)
72.1, function() return not(data.anchorFrameType == "CUSTOM" and not IsParentDynamicGroup()) end, {"customAnchor"}, false, { setOnParent = group })
return positionOptions;
end
@@ -1318,6 +1318,9 @@ local function BorderOptions(id, data, showBackDropOptions, hiddenFunc, order)
return borderOptions;
end
local function noop()
end
local function GetCustomCode(data, path)
for _, key in ipairs(path) do
if (not data or not data[key]) then
@@ -1394,7 +1397,10 @@ local function AddCodeOption(args, data, name, prefix, url, order, hiddenFunc, p
if not errorString then
if options.validator then
errorString = options.validator(loadedFunction())
local ok, validate = xpcall(loadedFunction, function(err) errorString = err end)
if ok then
errorString = options.validator(validate)
end
end
end
return errorString and "|cFFFF0000"..errorString or "";
@@ -1422,10 +1428,11 @@ local function AddCodeOption(args, data, name, prefix, url, order, hiddenFunc, p
return false;
else
if options.validator then
errorString = options.validator(loadedFunction())
if errorString then
return false
local ok, validate = xpcall(loadedFunction, noop)
if ok then
return options.validator(validate)
end
return false
end
return true;
end
+10 -1
View File
@@ -1797,7 +1797,7 @@ end
local function addControlsForCondition(args, order, data, conditionVariable, conditions, i, conditionTemplates, conditionTemplateWithoutCombinations, allProperties)
if (not conditions[i].check) then
return;
return order;
end
local defaultCollapsed = #conditions > 2
@@ -2537,6 +2537,13 @@ local function mergeConditions(all, aura, id, allConditionTemplates, propertyTyp
end
end
local fixupConditions = function(conditions)
for index, condition in ipairs(conditions) do
condition.check = condition.check or {}
condition.changes = condition.changes or {}
end
end
function OptionsPrivate.GetConditionOptions(data)
local options = {
type = "group",
@@ -2564,11 +2571,13 @@ function OptionsPrivate.GetConditionOptions(data)
for index = last, 1, -1 do
local id = data.controlledChildren[index];
local data = WeakAuras.GetData(id);
fixupConditions(data[conditionVariable])
mergeConditions(conditions, data[conditionVariable], data.id, conditionTemplates.all, allProperties);
end
else
data[conditionVariable] = data[conditionVariable] or {};
conditions = data[conditionVariable];
fixupConditions(data[conditionVariable])
end
local order = startorder;
+1 -1
View File
@@ -217,7 +217,7 @@ function OptionsPrivate.GetInformationOptions(data)
end
end
else
if not propertyData.regionType or propertyData.regionType == data.regionType then
if not isTmpGroup and (not propertyData.regionType or propertyData.regionType == data.regionType) then
if data.information[property] ~= nil then
common[property] = data.information[property]
else
@@ -936,11 +936,13 @@ local function ConstructMoverSizer(parent)
frame.offscreenText:Hide()
-- Check if the center is offscreen
-- How many pixels of the aura need to be visible
local margin = 30
local x, y = mover:GetCenter()
if x and y then
if x < 0 or x > GetScreenWidth() or y < 0 or y > GetScreenHeight() then
if mover:GetRight() < margin or mover:GetLeft() + margin > GetScreenWidth() or mover:GetTop() < 20 or mover:GetBottom() + margin > GetScreenHeight() then
local arrowX, arrowY = frame.arrowTexture:GetCenter()
local arrowAngle = atan2(selfY - arrowY, selfX - arrowX)
local arrowAngle = atan2(y - arrowY, x - arrowX)
frame.offscreenText:Show()
frame.arrowTexture:Show()
frame.arrowTexture:SetRotation( (arrowAngle - 90) / 180 * math.pi)
+61 -28
View File
@@ -53,6 +53,7 @@ local editor_themes = {
}
}
if not WeakAurasSaved.editor_tab_spaces then WeakAurasSaved.editor_tab_spaces = 4 end
local color_scheme = {[0] = "|r"}
local function set_scheme()
if not WeakAurasSaved.editor_theme then
@@ -168,7 +169,7 @@ local function ConstructTextEditor(frame)
-- display we ned the original, so save it here.
local originalGetText = editor.editBox.GetText
set_scheme()
IndentationLib.enable(editor.editBox, color_scheme, 4)
IndentationLib.enable(editor.editBox, color_scheme, WeakAurasSaved.editor_tab_spaces)
local cancel = CreateFrame("Button", nil, group.frame, "UIPanelButtonTemplate")
cancel:SetScript(
@@ -229,33 +230,62 @@ local function ConstructTextEditor(frame)
local dropdown = CreateFrame("Frame", "SettingsMenuFrame", settings_frame, "UIDropDownMenuTemplate")
local function settings_dropdown_initialize(frame, level, menu)
for k, v in pairs(editor_themes) do
local item = {
text = k,
isNotRadio = false,
checked = function()
return WeakAurasSaved.editor_theme == k
end,
func = function()
WeakAurasSaved.editor_theme = k
set_scheme()
editor.editBox:SetText(editor.editBox:GetText())
end
}
UIDropDownMenu_AddButton(item)
if level == 1 then
for k, v in pairs(editor_themes) do
local item = {
text = k,
isNotRadio = false,
checked = function()
return WeakAurasSaved.editor_theme == k
end,
func = function()
WeakAurasSaved.editor_theme = k
set_scheme()
editor.editBox:SetText(editor.editBox:GetText())
end
}
UIDropDownMenu_AddButton(item, level)
end
UIDropDownMenu_AddButton(
{
text = L["Bracket Matching"],
isNotRadio = true,
checked = function()
return WeakAurasSaved.editor_bracket_matching
end,
func = function()
WeakAurasSaved.editor_bracket_matching = not WeakAurasSaved.editor_bracket_matching
end
},
level)
UIDropDownMenu_AddButton(
{
text = L["Indent Size"],
hasArrow = true,
notCheckable = true,
menuList = "spaces"
},
level)
elseif menu == "spaces" then
local spaces = {2,4}
for _, i in pairs(spaces) do
UIDropDownMenu_AddButton(
{
text = i,
isNotRadio = false,
checked = function()
return WeakAurasSaved.editor_tab_spaces == i
end,
func = function()
WeakAurasSaved.editor_tab_spaces = i
IndentationLib.enable(editor.editBox, color_scheme, WeakAurasSaved.editor_tab_spaces)
editor.editBox:SetText(editor.editBox:GetText().."\n")
IndentationLib.indentEditbox(editor.editBox)
end
},
level)
end
end
UIDropDownMenu_AddButton(
{
text = L["Bracket Matching"],
isNotRadio = true,
checked = function()
return WeakAurasSaved.editor_bracket_matching
end,
func = function()
WeakAurasSaved.editor_bracket_matching = not WeakAurasSaved.editor_bracket_matching
end
}
)
end
UIDropDownMenu_Initialize(dropdown, settings_dropdown_initialize, "MENU")
@@ -612,7 +642,10 @@ local function ConstructTextEditor(frame)
func, errorString = loadstring("return " .. str)
end
if not errorString and validator then
errorString = validator(func())
local ok, validate = xpcall(func, function(err) errorString = err end)
if ok then
errorString = validator(validate)
end
end
if errorString then
urlText:Hide()
+13 -4
View File
@@ -570,10 +570,19 @@ local function modifyThumbnail(parent, borderframe, data, fullModify, width, hei
-- Fake icon (code)
if(data.icon) then
function borderframe:SetIcon(path)
local success = icon:SetTexture(data.auto and path or data.displayIcon) and (data.auto and path or data.displayIcon);
if not(success) then
icon:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark");
local iconPath
if data.iconSource == 0 then
iconPath = data.displayIcon or "Interface\\Icons\\INV_Misc_QuestionMark"
else
iconPath = path or data.displayIcon or "Interface\\Icons\\INV_Misc_QuestionMark"
end
local success = icon:SetTexture(data.auto and path or data.displayIcon) and (data.auto and path or data.displayIcon);
icon:SetTexture(iconPath)
end
if data and data.iconSource ~= 0 then
local name, icon = WeakAuras.GetNameAndIcon(data)
borderframe:SetIcon(icon)
end
icon:Show();
@@ -587,7 +596,7 @@ local function createIcon()
-- Default data
local data = {
icon = true,
auto = true,
iconSource = 0,
texture = "Runes",
orientation = "HORIZONTAL",
alpha = 1.0,
@@ -408,6 +408,7 @@ local function createOptions(id, data)
order = 28,
min = 0.05,
softMax = 2,
max = 10,
bigStep = 0.05,
get = function()
return data.scale or 1
@@ -445,7 +446,7 @@ local function createOptions(id, data)
return {
dynamicgroup = options,
position = OptionsPrivate.commonOptions.PositionOptions(id, data, nil, true, disableSelfPoint),
position = OptionsPrivate.commonOptions.PositionOptions(id, data, nil, true, disableSelfPoint, true),
};
end
+2 -1
View File
@@ -559,6 +559,7 @@ local function createOptions(id, data)
order = 45,
min = 0.05,
softMax = 2,
max = 10,
bigStep = 0.05,
get = function()
return data.scale or 1
@@ -586,7 +587,7 @@ local function createOptions(id, data)
return {
group = options,
position = OptionsPrivate.commonOptions.PositionOptions(id, data, nil, true, true),
position = OptionsPrivate.commonOptions.PositionOptions(id, data, nil, true, true, true),
};
end
+6 -1
View File
@@ -243,7 +243,12 @@ local function modifyThumbnail(parent, frame, data)
frame:SetParent(parent)
function frame:SetIcon(path)
local iconPath = data.auto and path or data.displayIcon or "Interface\\Icons\\INV_Misc_QuestionMark"
local iconPath
if data.iconSource == 0 then
iconPath = data.displayIcon or "Interface\\Icons\\INV_Misc_QuestionMark"
else
iconPath = path or data.displayIcon or "Interface\\Icons\\INV_Misc_QuestionMark"
end
self.icon:SetTexture(iconPath)
end
+8
View File
@@ -247,6 +247,14 @@ local function createOptions(id, data)
}
},
useTooltip = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Tooltip on Mouseover"],
hidden = function() return not OptionsPrivate.Private.CanHaveTooltip(data) end,
order = 51
},
endHeader = {
type = "header",
order = 100,
@@ -446,11 +446,11 @@ local function createOptions(parentData, data, index, subIndex)
-- Add Text Format Options
local hidden = function()
return OptionsPrivate.IsCollapsed("format_option", "text", "text_text", true)
return OptionsPrivate.IsCollapsed("format_option", "text", "text_text" .. index, true)
end
local setHidden = function(hidden)
OptionsPrivate.SetCollapsed("format_option", "text", "text_text", hidden)
OptionsPrivate.SetCollapsed("format_option", "text", "text_text" .. index, hidden)
end
local order = 12
+13 -7
View File
@@ -46,7 +46,7 @@ local tempGroup = {
};
OptionsPrivate.tempGroup = tempGroup;
function OptionsPrivate.DuplicateAura(data, newParent)
function OptionsPrivate.DuplicateAura(data, newParent, massEdit)
local base_id = data.id .. " "
local num = 2
@@ -72,7 +72,7 @@ function OptionsPrivate.DuplicateAura(data, newParent)
newData.controlledChildren = {}
end
WeakAuras.Add(newData)
WeakAuras.NewDisplayButton(newData)
WeakAuras.NewDisplayButton(newData, massEdit)
if(newParent or data.parent) then
local parentId = newParent or data.parent
local parentData = WeakAuras.GetData(parentId)
@@ -94,9 +94,11 @@ function OptionsPrivate.DuplicateAura(data, newParent)
childButton:SetGroupOrder(index, #parentData.controlledChildren)
end
local button = WeakAuras.GetDisplayButton(parentData.id)
button.callbacks.UpdateExpandButton()
WeakAuras.UpdateDisplayButton(parentData)
if not massEdit then
local button = WeakAuras.GetDisplayButton(parentData.id)
button.callbacks.UpdateExpandButton()
WeakAuras.UpdateDisplayButton(parentData)
end
OptionsPrivate.ClearOptions(parentData.id)
end
end
@@ -373,6 +375,7 @@ StaticPopupDialogs["WEAKAURAS_CONFIRM_DELETE"] = {
button2 = L["Cancel"],
OnAccept = function(self)
if self.data then
OptionsPrivate.Private.PauseAllDynamicGroups()
OptionsPrivate.massDelete = true
for _, auraData in pairs(self.data.toDelete) do
WeakAuras.Delete(auraData)
@@ -395,6 +398,7 @@ StaticPopupDialogs["WEAKAURAS_CONFIRM_DELETE"] = {
WeakAuras.UpdateDisplayButton(parentData)
end
end
OptionsPrivate.Private.ResumeAllDynamicGroups()
WeakAuras.SortDisplayButtons()
end
end,
@@ -840,13 +844,15 @@ function OptionsPrivate.ConvertDisplay(data, newType)
WeakAuras.SortDisplayButtons()
end
function WeakAuras.NewDisplayButton(data)
function WeakAuras.NewDisplayButton(data, massEdit)
local id = data.id;
OptionsPrivate.Private.ScanForLoads({[id] = true});
EnsureDisplayButton(db.displays[id]);
WeakAuras.UpdateDisplayButton(db.displays[id]);
frame.buttonsScroll:AddChild(displayButtons[id]);
WeakAuras.SortDisplayButtons();
if not massEdit then
WeakAuras.SortDisplayButtons()
end
end
function WeakAuras.UpdateGroupOrders(data)
+2 -2
View File
@@ -1,7 +1,7 @@
## Interface: 30300
## Title: WeakAuras Options
## Author: Mirrored and the WeakAuras Team
## Version: 2.17.5
## Author: The WeakAuras Team
## Version: 3.1.4
## Notes: Options for WeakAuras
## Notes-esES: Opciones para WeakAuras
## Notes-deDE: Optionen für WeakAuras