Thread: XML to Lua?
View Single Post
04-01-24, 01:15 AM   #2
Codger
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Mar 2021
Posts: 30
Lua code for xml (found)

I went to ChatGPT https://chat.openai.com/ and asked them to convert the xml code to lua and the code below is the result.

Lua Code:
  1. local frame = CreateFrame("Frame", "SimpleFrame", UIParent, "BasicFrameTemplateWithInset")
  2. frame:SetSize(150, 150)
  3. frame:SetPoint("CENTER")
  4.  
  5. local closeButton = CreateFrame("Button", nil, frame, "UIPanelCloseButton")
  6. closeButton:SetPoint("TOPRIGHT", -4, -4)
  7.  
  8. local insetFrame = CreateFrame("Frame", nil, frame, "InsetFrameTemplate")
  9. insetFrame:SetPoint("TOPLEFT", 10, -26)
  10. insetFrame:SetPoint("BOTTOMRIGHT", -6, 26)
  11.  
  12. local okButton = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate")
  13. okButton:SetText("Okay")
  14. okButton:SetSize(90, 22)
  15. okButton:SetPoint("BOTTOMRIGHT", -6, 4)
  16. okButton:SetScript("OnClick", function()
  17.     frame:Hide()
  18. end)
  19.  
  20. frame:SetScript("OnLoad", function()
  21.     frame.TitleText:SetText("Simple Frame")
  22. end)

Last edited by Codger : 04-01-24 at 07:53 AM.
  Reply With Quote