Thread Tools Display Modes
10-29-10, 11:54 AM   #1
Garual
A Deviate Faerie Dragon
Join Date: Oct 2010
Posts: 11
Tooltip text

Hello everyone
Not sure if this is a General or Lua question, but moderators will move it if I got the wrong forum section.
Anyway, I'm starting my way into Addons, Lua etc. and I'm just making a Broker plug-in for Equilibrium Notepad. Got basicly everything to work, I just cant find an elegant solution for the tooltip. I want to show the first 10 lines of content of current page. Best I currently have is this:
Code:
OnTooltipShow = function(tooltip)
	if EQUI_USE_SHARED then
		text = EQUI_SHARED_TEXT
	else
		text = EQUI_CHAR_TEXT
	end
	if text == "" then tooltip:AddLine("Page empty.") end
	tooltip:AddLine(string.sub(text,1,100))
	tooltip:AddLine(string.sub(text,101,200))
	.....
end,
Its incredebly ugly since EOL gives it problems and it seperates words. Any help or point into right direction apreciated.
  Reply With Quote
10-29-10, 04:00 PM   #2
Garual
A Deviate Faerie Dragon
Join Date: Oct 2010
Posts: 11
Ok, I finished it. Ended up writing a function for it. Also figured out Lua probably wasnt made for working with string and that I hate it.
Sorry if I wasted anyones time.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Tooltip text


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