Originally Posted by Phanx
http://pastebin.com/aJJqCHw9
Some of those copied action button functions were... really inefficient, creating new tables on every action button update, performing the same function call or global lookup 5 times in a row instead of storing the result in a variable, etc.
|
Changed code (thanks for the revamp again) and seem to be getting a error on the:
Code:
----------------------------------------------------------------------------------------
78. local extraActionButtons = setmetatable({}, { __index = function(t, self)
79. local name = AddRegionKeys(self)
80. local v = not not strmatch(name, "ExtraActionButton")
81. t[f] = v
82. return v
83. end })
----------------------------------------------------------------------------------------
103. hooksecurefunc("ActionButton_UpdateUsable", function(self)
104. if extraActionButtons[self] then return end
105. ColorButton(self.__normalTexture)
106. end)
----------------------------------------------------------------------------------------
The above code is the 2 sections from BasicUI as the code below states.
Here is the error:
Code:
1200x BasicUI-5.4.7\Modules\Actionbars.lua:81: table index is nil
BasicUI-5.4.7\Modules\Actionbars.lua:81: in function <BasicUI\Modules\Actionbars.lua:78>
BasicUI-5.4.7\Modules\Actionbars.lua:104: in function <BasicUI\Modules\Actionbars.lua:103>
<in C code>
<in C code>
FrameXML\ActionButton.lua:271: in function <FrameXML\ActionButton.lua:253>
<in C code>
FrameXML\ActionButton.lua:523: in function "ActionButton_OnEvent"
FrameXML\ActionButton.lua:124: in function <FrameXML\ActionButton.lua:117>
<in C code>
Buffet\Buffet-5.2.0.42.lua:127: in function "Edit"
Buffet\Buffet-5.2.0.42.lua:109: in function "Scan"
Buffet\Buffet-5.2.0.42.lua:61: in function <Buffet\Buffet.lua:54>
(tail call): ?
Locals:
self = MultiBarLeftButton6 {
0 = <userdata>
action = 42
buttonType = "MULTIACTIONBAR4BUTTON"
flashing = 0
__hotkey = MultiBarLeftButton6HotKey {
}
__checkedTexture = <unnamed> {
}
flashtime = 0
icon = MultiBarLeftButton6Icon {
}
__name = MultiBarLeftButton6Name {
}
feedback_action = 42
__pushedTexture = <unnamed> {
}
__highlightTexture = <unnamed> {
}
__flash = MultiBarLeftButton6Flash {
}
__normalTexture = MultiBarLeftButton6NormalTexture {
}
__border = MultiBarLeftButton6Border {
}
FlyoutBorderShadow = MultiBarLeftButton6FlyoutBorderShadow {
}
FlyoutBorder = MultiBarLeftButton6FlyoutBorder {
}
__count = MultiBarLeftButton6Count {
}
eventsRegistered = true
FlyoutArrow = MultiBarLeftButton6FlyoutArrow {
}
cooldown = MultiBarLeftButton6Cooldown {
}
rangeTimer = -1
}
(*temporary) = <table> {
}
(*temporary) = nil
extraActionButtons = <table> {
}
ColorButton = <function> defined @Interface\AddOns\BasicUI\Modules\Actionbars.lua:69
Coke
EDIT: This error also:
Code:
2x BasicUI-5.4.7\Modules\Actionbars.lua:118: attempt to index local "button" (a nil value)
BasicUI-5.4.7\Modules\Actionbars.lua:118: in function <BasicUI\Modules\Actionbars.lua:114>
<in C code>
FrameXML\PetActionBarFrame.lua:52: in function <FrameXML\PetActionBarFrame.lua:40>
Locals:
(*temporary) = <function> defined =[C]:-1
= <function> defined @Interface\FrameXML\PetActionBarFrame.lua:106
= <function> defined @Interface\AddOns\BasicUI\Modules\Actionbars.lua:114
and the code is:
Code:
113.local petButtons = { "PetActionButton", "PossessButton", "ShapeshiftButton" }
114. hooksecurefunc("PetActionBar_Update", function()
115. for i = 1, #petButtons do
116. for j = 1, 12 do
117. local button = _G[petButtons[i]..j]
118. button:SetNormalTexture("Interface\\BUTTONS\\UI-Quickslot2")
119.
120. AddRegionKeys(button)
121.
122. local icon = button.icon
123. icon:SetTexCoord(.05, .95, .05, .95)
124. icon:ClearAllPoints()
125. icon:SetPoint("TOPLEFT", -1, 1)
126. icon:SetPoint("BOTTOMRIGHT", 1, -1)
127.
128. local normalTexture = button.__normalTexture2 or button.__normalTexture
129. normalTexture:ClearAllPoints()
130. normalTexture:SetPoint("TOPLEFT", -15, 15)
131. normalTexture:SetPoint("BOTTOMRIGHT",15, -15)
132.
133. ColorButton(normalTexture)
134. end
135. end
136. end)