Thread Tools Display Modes
Prev Previous Post   Next Post Next
09-30-20, 08:58 PM   #1
ashpoker
A Defias Bandit
Join Date: Sep 2020
Posts: 2
Post Lua Help for New Coder

I am having issues having a list displayed in a frame with general character information, ie armor pen, dodge, parry, etc. I can have one thing show but I am unable to get the second item to show up. below is the current code. Any help would be great thanks.

Code:
-------------------------------------------------------
-- Main Addon Stuff --
-------------------------------------------------------

local AshStats = CreateFrame("frame", "AshStatsFrame")
	AshStats: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}
})

AshStats:SetWidth(170)
AshStats:SetHeight(400)
AshStats:SetPoint("CENTER",UIParent)
AshStats:EnableMouse(true)
AshStats:SetMovable(true)
AshStats:RegisterForDrag("LeftButton")
AshStats:SetScript("OnDragStart", function(self) self:StartMoving() end)
AshStats:SetScript("OnDragStart", function(self) self:StartMoving() end)
AshStats:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end)
AshStats:SetFrameStrata("FULLSCREEN_DIALOG")



AshStats:RegisterEvent("PLAYER_ENTERING_WORLD");
local function eventHandler(self, event, ...)
--print("Hello World! Hello " .. event);
end
AshStats:SetScript("OnEvent", eventHandler);
--------------------------------------------------------------
--Framerate
--------------------------------------------------------

local fpsframe = CreateFrame("Frame", nil, AshStats)
	fpsframe:SetFrameStrata("BACKGROUND")
	fpsframe:SetWidth(50)
	fpsframe:SetHeight(30)
	fpsframe:SetPoint("TOPLEFT", AshStats, "TOPLEFT", 20, -30)
	fpsframe:Show()

	fpsframe:RegisterEvent("ZONE_CHANGED")
	fpsframe:RegisterEvent("ZONE_CHANGED_INDOORS")
	fpsframe:RegisterEvent("ZONE_CHANGED_NEW_AREA")

local fpsframeFS = fpsframe:CreateFontString("FontString","OVERLAY","GameTooltipText")

	fpsframeFS:SetPoint("TOPLEFT",fpsframe,"TOPLEFT",0,0)
	fpsframeFS:SetFont("Fonts\\FRIZQT__.TTF", 10, "THINOUTLINE")

local elapsed = 0

	fpsframe:SetScript("OnUpdate", function(self, e)
		elapsed = elapsed + e
			if elapsed >= 1 then
				fpsframeRefresh()
				elapsed = 0
			end
	end)

	fpsframe:SetScript("OnEvent", function()
		fpsframeFS:SetTextColor(1, 1, 1);
		fpsframeRefresh()
	end)

function fpsframeRefresh()
	local framerate = GetFramerate()
		fpsframeFS:SetFormattedText("Frame Rate - " .. "%.0f", framerate)
end
-----------------------------------------------------
local armframe = CreateFrame("Frame", nil, AshStats)
	armframe:SetFrameStrata("BACKGROUND")
	armframe:SetWidth(50)
	armframe:SetHeight(30)
	armframe:SetPoint("TOPLEFT", AshStats, "TOPLEFT", 20, -40)
	armframe:Show()

	armframe:RegisterEvent("ZONE_CHANGED")
	armframe:RegisterEvent("ZONE_CHANGED_INDOORS")
	armframe:RegisterEvent("ZONE_CHANGED_NEW_AREA")

local armframeFS = armframe:CreateFontString("FontString","OVERLAY","GameTooltipText")

	armframeFS:SetPoint("TOPLEFT",armframe,"TOPLEFT",0,0)
	armframeFS:SetFont("Fonts\\FRIZQT__.TTF", 10, "THINOUTLINE")

function armframeRefresh()
	local armorPen = GetArmorPenetration()
		--armframeFS:SetFormattedText("Armor Pen - " .. , armorPen)
	print armorPen
end
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Lua Help for New Coder

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off