This website allows you to paste some of your code and create a downloadable .zip addon as per sites like WoWI.
Change the Title from "My First Addon" to a unique name as that will be the name of the addon/folder.
Limits, it's a single .lua file and sadly they have remove the advanced .toc options button(s).
I hope that's close enough to what you are asking about (it gives you the basic folder name with corresponding .toc name and source file that makes up the core of an addon).
Something basic to paste to display/update on change the token price at the top/center of your screen initially.
Lua Code:
-- Function to display the price
local function UpdateTokenPrice(self)
local Price = C_WowTokenPublic.GetCurrentMarketPrice()
if not Price then
self.Text:SetText("N/A")
return
end
self.Text:SetText("|TInterface/ICONS/Wow_Token01:0:0:2:0|t "..GetMoneyString(Price, true))
self:SetSize(self.Text:GetSize())
end
-- Create a Frame and make it dragable
local CurrencyFrame = CreateFrame("Button", "BarleduqCurrencyFrame", UIParent)
CurrencyFrame:SetSize(14, 14)
CurrencyFrame:SetPoint("TOP", 0, -4)
CurrencyFrame:SetFrameStrata("DIALOG")
CurrencyFrame:EnableMouse(true)
CurrencyFrame:RegisterForDrag("LeftButton")
CurrencyFrame:SetMovable(true) -- Create frame before PLAYER_LOGIN to save position
CurrencyFrame:SetScript("OnDragStart", function(self) self:StartMoving() end)
CurrencyFrame:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end)
-- Create a Fontstring to display the current price
CurrencyFrame.Text = CurrencyFrame:CreateFontString("$parentText", "OVERLAY")
CurrencyFrame.Text:SetFont("Fonts/FRIZQT__.TTF", 21)
CurrencyFrame.Text:SetPoint("CENTER")
CurrencyFrame.Text:SetJustifyH("CENTER")
-- register the token change event
CurrencyFrame:RegisterEvent("TOKEN_MARKET_PRICE_UPDATED")
-- Script to update the price when it changes
CurrencyFrame:SetScript("OnEvent", function(self, event, ...)
UpdateTokenPrice(self)
end)
--Display the price on startup (the event might not fire for minutes/hours/days...)
UpdateTokenPrice(CurrencyFrame)