Thread Tools Display Modes
08-01-08, 11:34 AM   #1
ztealmax
A Defias Bandit
Join Date: Jun 2008
Posts: 3
Cool Infopanel

Hi im trying to sort this out on zone.lua script below
im trying to get it to show up like this line for example: Teldrasil (24,54) on infopanel

Code:
-- Gather Info
local function OnUpdate(self,elapsed)
	nextUpdate = (nextUpdate - elapsed);
	if (nextUpdate <= 0) then
		if (IsInInstance()) then
			InfoPanel_SetText(f,GetZoneText());
		else
			local x, y = GetPlayerMapPosition("player");
			InfoPanel_SetText(f,"%.1f |cffffff00|||r %.1f",x * 100,y * 100);
		end
		nextUpdate = UPDATE_INTERVAL;
	end
end
so at line that shows coords:
Code:
InfoPanel_SetText(f,"%.1f |cffffff00|||r %.1f",x * 100,y * 100);
i want to implement zone
Code:
InfoPanel_SetText(f,GetZoneText());
as for now it only shows the coords,

how should i do this?
was thinking something like
Code:
InfoPanel_SetText(f,GetZoneText(),"%.1f |cffffff00|||r %.1f",x * 100,y * 100);
but that is ofc not working so question is, how shall i do this the correct way?

//Cheers
Zt
  Reply With Quote
08-02-08, 06:38 AM   #2
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 199
I've never used Infopanel, but it looks to me as if it would do a string.format on your arguments.

So I would suggest changing the function to this:
Code:
InfoPanel_SetText(f,"%s %.1f |cffffff00|||r %.1f", GetZoneText(), x * 100,y * 100);
Now "%s" will be replaced by GetZoneText(), so that it should result in: "Teldrassil 24.1 | 54.2".
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Infopanel


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