View Single Post
09-16-22, 10:17 PM   #16
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
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:
  1. ## Interface:  90205
  2. ## Title: Sharpedge Inc
  3. ## Author: Sharpedge
  4. ## Version: 1.0.0
  5. ## Dependencies: Incoming
  6.  
  7. Sharpedge.lua

The Sharpedge.lua (or whatever you've called it)
Lua Code:
  1. local Incoming = CreateFrame("Frame", "SharpedgeIncommingFrame", UIParent, BackdropTemplateMixin and "BackdropTemplate");
  2. Incoming:SetBackdrop({
  3.       bgFile="Interface\\DialogFrame\\UI-DialogBox-Background",
  4.       edgeFile="Interface\\DialogFrame\\UI-DialogBox-Border",
  5.       tile=1, tileSize=32, edgeSize=32,
  6.       insets={left=11, right=12, top=12, bottom=11}
  7. })
  8. Incoming:Hide()
  9. LocationMessageView:SetParent(Incoming)
  10. LocationMessageView:Show()
  11. LocationMessageView:ClearAllPoints()
  12. LocationMessageView:SetPoint("TOP")
  13. LocationMessageView:SetMovable(false)
  14. LocationMessageView:EnableMouse(false)Incoming:SetWidth(139)
  15. Incoming:SetHeight(190)
  16. Incoming:SetPoint("CENTER",UIParent)
  17. Incoming:EnableMouse(true)
  18. Incoming:SetMovable(true)
  19. Incoming:RegisterForDrag("LeftButton")
  20. Incoming:SetScript("OnDragStart", function(self) self:StartMoving() end)
  21. Incoming:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end)
  22. Incoming:SetFrameStrata("FULLSCREEN_DIALOG")
  23.  
  24. local button = CreateFrame("button","IncomingButton", Incoming, "UIPanelButtonTemplate")
  25. button:SetHeight(24)
  26. button:SetWidth(60)
  27. button:SetPoint("BOTTOM", Incoming, "BOTTOM", 0, 10)
  28. button:SetText("Close")
  29. button:SetScript("OnClick", function(self)  self:GetParent():Hide() end)
  30.  
  31.  
  32. SLASH_SHARPEDGEINC1 = "/sinc"
  33. SlashCmdList.SHARPEDGEINC = function(msg)
  34.     Incoming:SetShown(not Incoming:IsShown())
  35. end

use /sincor whatever you renale "/sinc" to instead of /inc
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote