Only the last error has anything to do with the changes to
this, and only changing
this to
self won't fix it, you also need to update the function declarations to include that
self is passed:
lua Code:
_G.SlashCmdList["GTIPNOTES_SHORTHAND"] = function(input)
if not UnitExists('target') then
print(TARGET_ERROR)
return
end
input = input:trim()
if type(input) ~= 'string' or input == "" then
if not StaticPopupDialogs["GTipNotes"] then
StaticPopupDialogs["GTipNotes"] = {
text = nil,
button1 = SET,
button2 = CANCEL,
whileDead = 1,
hideOnEscape = 1,
timeout = 0,
OnShow = function(self)
-- We have to do this onshow to reset the previous text
local name = UnitExists("target") and UnitName("target") or ""
_G[self:GetName() .. "EditBox"]:SetText(_G.GTipNotesDB[name] or "")
end,
OnHide = function(self)
_G[self:GetName() .. "EditBox"]:SetText("")
end,
EditBoxOnEnterPressed = function(self)
addNoteFromPopup(_G[self:GetParent():GetName() .. "EditBox"]:GetText())
self:GetParent():Hide()
end,
EditBoxOnEscapePressed = function(self)
self:GetParent():Hide()
end,
OnAccept = function(self)
addNoteFromPopup(_G[self:GetParent():GetName() .. "EditBox"]:GetText())
end,
hasEditBox = 1,
}
end
StaticPopupDialogs["GTipNotes"].text = POPUP_TEXT:format(UnitName('target'))
StaticPopup_Show("GTipNotes")
else
local name = UnitName('target')
_G.GTipNotesDB[name] = input
print(NOTE_SET:format(name, input))
end
end
The issue with FriendsFrame code is that Blizzard changed it and no longer uses/sets FriendsFrameFriendsScrollFrame.usedButtons:
lua Code:
hooksecurefunc('FriendsList_Update', function()
local buttons, button = FriendsFrameFriendsScrollFrame.buttons
local colors, CLASS = CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS, addon.CLASS
for index = 1, #buttons do
button = buttons[index]
if button:IsShown() then
if button.buttonType == FRIENDS_BUTTON_TYPE_WOW then
local _, _, class, _, connected = GetFriendInfo(button.id)
if connected then
local color = colors[CLASS[class]]
button.name:SetTextColor(color.r, color.g, color.b)
end
end
else
break
end
end
end)
Part of the problem with the first error is that the ammo slot was removed which is what slots[0] is, so remove the start variable and always begin with an id of 1:
lua Code:
local function CreateBorders(frame, prefix)
local border = { }
for id = 1, #slots do
local frame = _G[prefix .. slots[id]]
local region = GetNormalTexture(frame:GetRegions())
local texture = frame:CreateTexture(nil, 'OVERLAY')
texture:SetTexture([[Interface\Buttons\UI-ActionButton-Border]])
texture:SetBlendMode('ADD')
texture:SetAlpha(0.8)
texture:SetPoint('TOPLEFT', region, -1, 3)
texture:SetPoint('BOTTOMRIGHT', region, 1, 0)
border[id] = texture
end
borders[frame] = border
end
There may still be errors after making those changes, I don't have access to check, but at least you will be one step closer to fixing it.