Lua-Problem

Atiesh

Newbie
Registriert
Feb. 2008
Beiträge
4
Hi,

ich wollte in einer Lua-Datei die Schriftgröße verändern. Mein Problem ist, dass ich sie nur für alle Elemente verändern kann (rote Markierung). Kann mir jemand sagen, was ich wo reinschreiben muss, damit sich nur dieses eine Element (grüne Markierung)verändert? Oder geht das gar nicht?


Code:
[...]
-- the x-files aka. configuration
local frame_anchor = "BOTTOMRIGHT" -- LEFT, TOPLEFT, TOP, TOPRIGHT, RIGHT, BOTTOMRIGHT, BOTTOM, BOTTOMLEFT
local pos_x = -5
local pos_y = 5
local text_anchor = "BOTTOMRIGHT"
local font = "Fonts\\ARIALN.ttf"
[COLOR="Red"]local size = 12[/COLOR]
local shadow = true -- true = fo sho! / false = nowaii!!

-- YAY!
local text

-- 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()
	self:SetPoint(frame_anchor, UIParent, frame_anchor, pos_x, pos_y)
	self:SetWidth(120)
	self:SetHeight(14)
	
	text = self:CreateFontString(nil, "OVERLAY")
	text:SetFont(font, size, nil)
	if shadow == true then
		text:SetShadowOffset(1,-1)
	end
	text:SetPoint(text_anchor, self)
	
	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
		-- mail stuff
		local mail
		local hasmail
		hasmail = (HasNewMail() or 0);
		if hasmail > 0 then
			mail = "|c00FA58F4new!|r  "
		else
			mail = ""
		end
		
		-- date thingy
		local ticktack = date("%H.%M")
		ticktack = "|c00ffffff"..ticktack.."|r"
		
		[COLOR="Green"]-- fps crap
		local fps = GetFramerate()
		fps = "|c00ffffff"..floor(fps).."|r|c7FFF00FFfps|r  |  "[/COLOR]
		
		-- right down downright + punch
		local _, _, lag = GetNetStats()
		lag = "|c00ffffff"..lag.."|r|c0000CCFFms|r  |  "
		
		-- garbage!
		--[[ OLD MEMORY STUFF
		local mem = collectgarbage("count")
		mem = "|c00ffffff"..floor(mem / 1024).."|r|c0000CCFFmb|r  |  "
		--]]
	
		-- xp stuff
		local ep
		local xp_cur = UnitXP("player")
		local xp_max = UnitXPMax("player")
		if UnitLevel("player") < 1 then
			ep = "|c00ffffff"..floor(xp_max - xp_cur).."|r|c0000CCFFxp|r  | "
		else
			ep = ""
		end
[...]
 
Zurück
Oben