Originally Posted by Fizzlemizz
You're essentially taking control of another addon so you can't entirely rely on it's slash command(s). For this you will need to provide one of your own (in this case /sinc)
The .toc for your addon (the ## Dependencies: means the Incomming addon will load first.)
Lua Code:
## Interface: 90205 ## Title: Sharpedge Inc ## Author: Sharpedge ## Version: 1.0.0 ## Dependencies: Incoming Sharpedge.lua
The Sharpedge.lua (or whatever you've called it)
Lua Code:
local Incoming = CreateFrame("Frame", "SharpedgeIncommingFrame", UIParent, BackdropTemplateMixin and "BackdropTemplate"); Incoming:SetBackdrop({ bgFile="Interface\\DialogFrame\\UI-DialogBox-Background", edgeFile="Interface\\DialogFrame\\UI-DialogBox-Border", tile=1, tileSize=32, edgeSize=32, insets={left=11, right=12, top=12, bottom=11} }) Incoming:Hide() LocationMessageView:SetParent(Incoming) LocationMessageView:Show() LocationMessageView:ClearAllPoints() LocationMessageView:SetPoint("TOP") LocationMessageView:SetMovable(false) LocationMessageView:EnableMouse(false)Incoming:SetWidth(139) Incoming:SetHeight(190) Incoming:SetPoint("CENTER",UIParent) Incoming:EnableMouse(true) Incoming:SetMovable(true) Incoming:RegisterForDrag("LeftButton") Incoming:SetScript("OnDragStart", function(self) self:StartMoving() end) Incoming:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end) Incoming:SetFrameStrata("FULLSCREEN_DIALOG") local button = CreateFrame("button","IncomingButton", Incoming, "UIPanelButtonTemplate") button:SetHeight(24) button:SetWidth(60) button:SetPoint("BOTTOM", Incoming, "BOTTOM", 0, 10) button:SetText("Close") button:SetScript("OnClick", function(self) self:GetParent():Hide() end) SLASH_SHARPEDGEINC1 = "/sinc" SlashCmdList.SHARPEDGEINC = function(msg) Incoming:SetShown(not Incoming:IsShown()) end
use /sincor whatever you renale "/sinc" to instead of /inc
|
Ok, everything is inside that panel now. Fits just right. But, the only button that works is the Close button. Whenever I click any of the others I get this message:
Code:
Message: [string "Incoming:OnClick"]:1: attempt to index global 'location_message_controller' (a nil value)
Time: Sat Sep 17 01:14:36 2022
Count: 1
Stack: [string "Incoming:OnClick"]:1: attempt to index global 'location_message_controller' (a nil value)
[string "*:OnClick"]:1: in function <[string "*:OnClick"]:1>
Locals: self = Incoming {
0 = <userdata>
}
button = "LeftButton"
down = false
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index global 'location_message_controller' (a nil value)"