Thread Tools Display Modes
02-08-11, 06:37 PM   #1
lilgulps
A Theradrim Guardian
 
lilgulps's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 62
Addon dissapeared with no lua errors after patch. Code inside if anyone can help

Like in title after this new patch, the addon just vanished from displaying no lua errors. Any ideas whats up?

Code:
--[[

	VERSION 1
	by Tukz
	
	CREDITS:
	Lyn for a lovely addon
	evl and his awesome evl_clock
	
--]]
local addon = CreateFrame("Button", nil, UIParent)

-- the x-files aka. configuration
local frame_anchor = "BOTTOM" -- LEFT, TOPLEFT, TOP, TOPRIGHT, RIGHT, CENTER, BOTTOMRIGHT, BOTTOM, BOTTOMLEFT
local text_anchor = "CENTER"
local font = "Fonts\\ARIALN.ttf"
local size = 12
local show_memorytooltip = true -- Show's the Memory Usage In A Tooltip at the bottom/middle screen.

-- Below settings are all true / false
local time24 = true -- true: 24h format clock / false: 12h format clock
local classcolors = true -- Use class colors total memory usage tooltip

-- Show / Hide Settings (all true / false)
local show_fps = true -- Show's the FPS (Frames Per Second)
local show_time = false -- Show's the Time (With AM/PM if it is in 12h format)
local show_lag = true -- Show's the lag (Latency in MS)
local show_mem = true -- Show's the memory usage of the addons (In MB)
local show_dur = true 
local show_gold = true 

-- reinforcements!
local color, ticktack, lag, fps, ep, text, blizz, memory, entry, i, toutput, ccfunc, mem

if classcolors == true then
	color = RAID_CLASS_COLORS[select(2, UnitClass("player"))]
else
	color = { r=0, g=0.8, b=1 } -- own textcolor
end

-- format memory stuff
local memformat = function(number)
	if number > 1000 then
		return string.format("%.2f mb", (number / 1000))
	else
		return string.format("%.1f kb", floor(number))
	end
end

-- ordering
local addoncompare = function(a, b)
	return a.memory > b.memory
end

-- the allmighty
function addon:new()
	text1 = self:CreateFontString(nil, "OVERLAY")
	text1:SetFont(font, size, nil)
	
	text2 = self:CreateFontString(nil, "OVERLAY")
	text2:SetFont(font, size, nil)
	
	text3 = self:CreateFontString(nil, "OVERLAY")
	text3:SetFont(font, size, nil)
	
	text4 = self:CreateFontString(nil, "OVERLAY")
	text4:SetFont(font, size, nil)
	
	text5 = self:CreateFontString(nil, "OVERLAY")
	text5:SetFont(font, size, nil)
	
	text6 = self:CreateFontString(nil, "OVERLAY")
	text6:SetFont(font, size, nil)
	
	

	
	self:SetPoint(frame_anchor, UIParent)
	self:SetWidth(500)
	self:SetHeight(12)
	self:SetFrameStrata("BACKGROUND")
	self:SetFrameLevel(1)
	
	self:SetScript("OnUpdate", self.update)
	self:SetScript("OnEnter", self.enter)
	self:SetScript("OnLeave", function() GameTooltip:Hide() end)
end

-- update
local last = 0
function addon:update(elapsed)
	last = last + elapsed

	if last > 1 then
		
		-- date thingy
		if show_time == true then
			if time24 == true then
				tick = date("%H")
				tack = date("%M")
				tock = ""
			else
				tick = date("%I")
				tack = date("%M")
				tock = string.lower(date("%p"))
			end
			ticktack = "|c00ffffff"..tick.."|r:|c00ffffff"..tack.."|r"..tock
		else
			ticktack = ""
		end
			
		-- fps crap
		if show_fps == true then
			fps = GetFramerate()
			fps = "|c00ffffff"..floor(fps).."|r FPS"
		else
			fps = ""
		end
		
		-- latency
		if show_lag == true then
			lag = select(3, GetNetStats())
			lag = "|c00ffffff"..lag.."|r MS"
		else
			lag = ""
		end

		
		if show_mem == true then
			local memory = 0
			UpdateAddOnMemoryUsage()
			for i = 1, GetNumAddOns() do
				if IsAddOnLoaded(i) then
					memory = memory + GetAddOnMemoryUsage(i)
				end
			end			
			mem = "|c00ffffff"..format("%.2f", memory / 1024).."|r MB"
		else
			mem = ""
		end
		
		if show_dur == true then
			local durability = 100
			for i = 1, 11 do
				if GetInventoryItemDurability(i) ~= nil then
					local dur, max = GetInventoryItemDurability(i)
					local perc = dur / max * 100
					if perc < durability then durability = floor(perc) end
				end
			end
			dur = "|c00ffffff"..floor(durability).."|r% DUR"
		else
			dur = ""
		end
		
		-- gold crap
		if show_gold == true then
			gold = GetMoney()/10000
			gold = "|c00ffffff"..floor(gold).."|r G"
		else
			gold = ""
		end

		-- reset timer
		last = 0
		
		-- X and Y position of luatexts!
		text1:SetText(fps)
		text1:SetPoint("center", -785, 8)
		text2:SetText(lag)
		text2:SetPoint("center", -620, 8)
		text3:SetText(mem)
		text3:SetPoint("center", -460, 8)
		text4:SetText(dur)
		text4:SetPoint("center", 460, 8)
		text5:SetText(gold)
		text5:SetPoint("center", 630, 8)
		text6:SetText(ticktack)
		text6:SetPoint("center", 795, 8)

	end
end

addon:new()
  Reply With Quote
02-08-11, 06:54 PM   #2
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Load out of date AddOns?
  Reply With Quote
02-08-11, 06:56 PM   #3
lilgulps
A Theradrim Guardian
 
lilgulps's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 62
*walk of shame*
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Addon dissapeared with no lua errors after patch. Code inside if anyone can help


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