I came across a bug that has annoyed me for a few days and I can't quite pin-point the problem.
When trying to access the Forge of Bonds in Ardenweald, I get the following error below.
When I disable my addon "GarrisonJukeBox", the error goes away.
Any hint to help me look in the right direction would be greatly appreciated.
Oh, and my addon works without issues.
Question : I was wondering if there was a buttongroup type of frame and if all buttons must have such a parent?
Thank you.
From Bugsack :
1x SharedXML\ButtonGroup.lua:55: attempt to call a table value
[string "@SharedXML\ButtonGroup.lua"]:55: in function `RemoveAllButtons'
[string "@SharedXML\ButtonGroup.lua"]:65: in function `Reset'
[string "@Blizzard_Soulbinds\Blizzard_SoulbindsSelectGroup.lua"]:52: in function `Init'
[string "@Blizzard_Soulbinds\Blizzard_SoulbindsViewer.lua"]:217: in function `Init'
[string "@Blizzard_Soulbinds\Blizzard_SoulbindsViewer.lua"]:200: in function `OpenSoulbind'
[string "@Blizzard_Soulbinds\Blizzard_SoulbindsViewer.lua"]:194: in function `Open'
[string "@Blizzard_Soulbinds\Blizzard_Soulbinds.lua"]:3: in function `?'
[string "@FrameXML\UIParent.lua"]:2235: in function <FrameXML\UIParent.lua:1269>
Locals:
self = <table> {
GetButtons = <function> defined @SharedXML\ButtonGroup.lua:60
GetSelectedButtons = <function> defined @SharedXML\ButtonGroup.lua:119
RemoveAllButtons = <function> defined @SharedXML\ButtonGroup.lua:54
AddInternal = <function> defined @SharedXML\ButtonGroup.lua:169
GenerateCallbackEvents = <function> defined @SharedXML\CallbackRegistry.lua:92
TriggerEvent = <function> defined @SharedXML\CallbackRegistry.lua:36
Select = <function> defined @SharedXML\ButtonGroup.lua:93
RegisterCallback = <function> defined @SharedXML\CallbackRegistry.lua:19
SetUndefinedEventsAllowed = <function> defined @SharedXML\CallbackRegistry.lua:15
UnregisterCallback = <function> defined @SharedXML\CallbackRegistry.lua:60
UnregisterAllCallbacksByEvent = <function> defined @SharedXML\CallbackRegistry.lua:76
Unselect = <function> defined @SharedXML\ButtonGroup.lua:89
UnregisterEvents = <function> defined @SharedXML\CallbackRegistry.lua:81
SelectAtIndex = <function> defined @SharedXML\ButtonGroup.lua:105
buttons = <table> {
}
CanChangeSelection = <function> defined @SharedXML\ButtonGroup.lua:152
funcRegistry = <table> {
}
closureRegistry = <table> {
}
GetAtIndex = <function> defined @SharedXML\ButtonGroup.lua:131
RemoveInternal = <function> defined @SharedXML\ButtonGroup.lua:174
RemoveButtons = <function> defined @SharedXML\ButtonGroup.lua:34
Init = <function> defined @SharedXML\ButtonGroup.lua:10
Event = <table> {
}
RemoveButton = <function> defined @SharedXML\ButtonGroup.lua:30
AddButtons = <function> defined @SharedXML\ButtonGroup.lua:19
GetButtonsByPredicate = <function> defined @SharedXML\ButtonGroup.lua:79
FindButtonByPredicate = <function> defined @SharedXML\ButtonGroup.lua:70
UnselectAtIndex = <function> defined @SharedXML\ButtonGroup.lua:112
SetButtons = <function> defined @SharedXML\ButtonGroup.lua:49
AddButton = <function> defined @SharedXML\ButtonGroup.lua:15
OnLoad = <function> defined @SharedXML\CallbackRegistry.lua:3
OnSelectionChange = <function> defined @SharedXML\ButtonGroup.lua:156
GetButtonIndex = <function> defined @SharedXML\ButtonGroup.lua:127
Reset = <function> defined @SharedXML\ButtonGroup.lua:64
}
(for generator) = <table> {
}
(for state) = nil
(for control) = nil
(*temporary) = <table> {
}
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to call a table value"
From ButtonGroup.lua
function ButtonGroupBaseMixin:RemoveAllButtons()
for index, button in ripairs(self.buttons) do <--- line 55
self:RemoveInternal(button);
end
end
I would like to know if frame creation below is ok with mixin (from my addon)?
GJB.mplayer.fbg = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate")
Found this :
ButtonGroupBaseMixin = CreateFromMixins(CallbackRegistryMixin);
ButtonGroupBaseMixin:GenerateCallbackEvents(
{
"Selected",
"Unselected",
}
);
function ButtonGroupBaseMixin:Init()
CallbackRegistryMixin.OnLoad(self);
self.buttons = {};
end
function ButtonGroupBaseMixin:AddButton(button)
self:AddInternal(button);
end
function ButtonGroupBaseMixin:AddButtons(buttons)
for buttonIndex, button in ipairs(buttons) do
self:AddInternal(button);
end
end
function ButtonGroupBaseMixin:AddInternal(button, func, owner)
table.insert(self.buttons, button);
button:RegisterSelectionChangedCallback(func, owner);
end
function ButtonGroupBaseMixin:RemoveButton(button)
self:RemoveInternal(button);
end
function ButtonGroupBaseMixin:RemoveButtons(buttons)
if buttons == self.buttons then
self:RemoveAllButtons();
else
for buttonIndex, button in ipairs(buttons) do
self:RemoveInternal(button);
end
end
end
function ButtonGroupBaseMixin:RemoveInternal(button)
tDeleteItem(self.buttons, button);
button:UnregisterSelectionChangedCallback(self);
end
function ButtonGroupBaseMixin:SetButtons(buttons)
self:RemoveAllButtons();
self:AddButtons(buttons);
end
function ButtonGroupBaseMixin:RemoveAllButtons()
for index, button in ripairs(self.buttons) do
self:RemoveInternal(button);
end
end
function ButtonGroupBaseMixin:GetButtons()
return self.buttons;
end
function ButtonGroupBaseMixin:Reset()
self:RemoveAllButtons();
self:UnregisterEvents();
self.callbacks = {};
end
function ButtonGroupBaseMixin:FindButtonByPredicate(pred)
for buttonIndex, button in ipairs(self.buttons) do
if pred(button) then
return button;
end
end
return nil;
end
function ButtonGroupBaseMixin:GetButtonsByPredicate(pred)
local buttons = {};
for buttonIndex, button in ipairs(self.buttons) do
if pred(button) then
table.insert(buttons, button);
end
end
return buttons;
end
function ButtonGroupBaseMixin:Unselect(button)
self:UnselectAtIndex(self:GetButtonIndex(button));
end
function ButtonGroupBaseMixin:Select(button, isInitializing)
self:SelectAtIndex(self:GetButtonIndex(button), isInitializing);
end
function ButtonGroupBaseMixin:UnselectAtIndex(index)
local button = self:GetAtIndex(index);
if button then
local isInitializing = false;
button:SetSelected(false, isInitializing);
end
end
function ButtonGroupBaseMixin:SelectAtIndex(index, isInitializing)
local button = self:GetAtIndex(index);
if button then
button:SetSelected(true, isInitializing);
end
end
function ButtonGroupBaseMixin:UnselectAtIndex(index)
local button = self:GetAtIndex(index);
if button then
button:SetSelected(false);
end
end
function ButtonGroupBaseMixin:GetSelectedButtons()
return self:GetButtonsByPredicate(
function(button)
return button:IsSelected();
end
);
end
function ButtonGroupBaseMixin:GetButtonIndex(button)
return tIndexOf(self.buttons, button);
end
function ButtonGroupBaseMixin:GetAtIndex(index)
return self.buttons[index];
end
ButtonGroupMixin = CreateFromMixins(ButtonGroupBaseMixin);
function ButtonGroupMixin:OnSelectionChange(button, newSelected)
local event = newSelected and ButtonGroupBaseMixin.Event.Selected or ButtonGroupBaseMixin.Event.Unselected;
self:TriggerEvent(event, button, self:GetButtonIndex(button));
end
function ButtonGroupMixin:AddInternal(button)
ButtonGroupBaseMixin.AddInternal(self, button, self.OnSelectionChange, self);
end
function CreateButtonGroup()
return CreateAndInitFromMixin(ButtonGroupMixin);
end
RadioButtonGroupMixin = CreateFromMixins(ButtonGroupBaseMixin);
function RadioButtonGroupMixin:CanChangeSelection(button, newSelected)
return not (not newSelected and #self:GetSelectedButtons() == 1);
end
function RadioButtonGroupMixin:OnSelectionChange(button, newSelected)
if newSelected then
for selectedButtonIndex, selectedButton in ipairs(self:GetSelectedButtons()) do
if selectedButton ~= button then
selectedButton:SetSelected(false);
self:TriggerEvent(ButtonGroupBaseMixin.Event.Unselected, selectedButton, self:GetButtonIndex(selectedButton));
end
end
self:TriggerEvent(ButtonGroupBaseMixin.Event.Selected, button, self:GetButtonIndex(button));
end
end
function RadioButtonGroupMixin:AddInternal(button)
button:SetSelectionChangeInterrupt(GenerateClosure(self.CanChangeSelection, self));
ButtonGroupBaseMixin.AddInternal(self, button, self.OnSelectionChange, self);
end
function RadioButtonGroupMixin:RemoveInternal(button)
button:SetSelectionChangeInterrupt(nil);
ButtonGroupBaseMixin.RemoveInternal(self, button);
end
function CreateRadioButtonGroup()
return CreateAndInitFromMixin(RadioButtonGroupMixin);
end
Hello,
I came across a bug that has annoyed me for a few days and I can't quite pin-point the problem.
When trying to access the Forge of Bonds in Ardenweald, I get the following error below.
When I disable my addon "GarrisonJukeBox", the error goes away.
Any hint to help me look in the right direction would be greatly appreciated.
Oh, and my addon works without issues.
Question : I was wondering if there was a buttongroup type of frame and if all buttons must have such a parent?
Thank you.
From Bugsack :
From ButtonGroup.lua
I would like to know if frame creation below is ok with mixin (from my addon)?
Found this :