View Single Post
09-16-22, 08:57 PM   #8
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
The XML is being loaded after the .lua. You don't say if your .lua file is being made part of the addon or a separate addon so I will assume separate and this should work in either case unless the original addon is Load-On-Demand.

Lua Code:
  1. local Incoming = CreateFrame("Frame", "SharpedgeFrame", 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. Incoming:SetWidth(139)
  10. Incoming:SetHeight(190)
  11. Incoming:SetPoint("CENTER",UIParent)
  12. Incoming:EnableMouse(true)
  13. Incoming:SetMovable(true)
  14. Incoming:RegisterForDrag("LeftButton")
  15. Incoming:SetScript("OnDragStart", function(self) self:StartMoving() end)
  16. Incoming:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end)
  17. Incoming:SetFrameStrata("FULLSCREEN_DIALOG")
  18.  
  19. local button = CreateFrame("button","IncomingButton", Incoming, "UIPanelButtonTemplate")
  20. button:SetHeight(24)
  21. button:SetWidth(60)
  22. button:SetPoint("BOTTOM", Incoming, "BOTTOM", 0, 10)
  23. button:SetText("Close")
  24. button:SetScript("OnClick", function(self)  self:GetParent():Hide() end)
  25.  
  26. Incoming:RegisterEvent("PLAYER_LOGIN")
  27. Incoming:SetScript("OnEvent", function(self, event, ...)
  28.     LocationMessageView:Show()
  29.     LocationMessageView:SetParent(self)
  30.     LocationMessageView:ClearAllPoints()
  31.     LocationMessageView:SetPoint("TOP")
  32.     LocationMessageView:SetMovable(false)
  33.     LocationMessageView:EnableMouse(false)
  34. end)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote