View Single Post
12-09-22, 12:18 PM   #3
AeroMaxxD
An Aku'mai Servant
Join Date: Dec 2022
Posts: 33
Thanks, for the response I didn't know about the /fstack command, my LUA 5.1 reference book is in the post somewhere, but postage strikes here so it's not arrived yet!

Maybe this picture would help?
https://www.curseforge.com/wow/addon...ne/screenshots

The code below appears to be the issue. The LUA code is below that. I believe it's trying to write zone information when you hover over an area on the world map. Adding the name of the instances and their levels in that zone.

Code:
<!-- Map Text -->
<Frame name="TRZ_WorldMap_Frame" parent="WorldMapFrameAreaFrame">
<Scripts>
<OnUpdate>
TRZ_WorldMapButton_OnUpdate(arg1);
</OnUpdate>
</Scripts>
<Layers>
<Layer level="OVERLAY">
<FontString name="TRZ_WorldMap_Text" inherits="GameFontNormalLargeOutline" outline="THICK" virtual="true">
<Anchors>
<Anchor point="TOP" relativeTo="WorldMapFrameAreaLabel" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-5"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
The function below is referenced in the XML file

Code:
function TRZ_WorldMapButton_OnUpdate(arg1)
	local player_level = UnitLevel("player");
	local zoneColor;
	local wZone;
	local wZone2;
	local zoneText="";
	if (WorldMapFrame.areaName ~= nil) then
		wZone=LT:GetMapNameByIDAlt(WorldMapFrame:GetMapID());
		-- Instance display
		if (WorldMapFrameAreaPetLevels:GetText()) then
			TRZ_WorldMap_Text:SetPoint("TOP", WorldMapFrameAreaPetLevels, "BOTTOM");
		elseif (WorldMapFrameAreaDescription:GetText()) then
			TRZ_WorldMap_Text:SetPoint("TOP", WorldMapFrameAreaDescription, "BOTTOM");
		else
			TRZ_WorldMap_Text:SetPoint("TOP", WorldMapFrameAreaLabel, "BOTTOM");
		end
		if ( LT:DoesZoneHaveInstances(wZone) == true ) then
			local instance;
			zoneText = TRZ_NORMAL .. TRZ_TOOLTIP_CINSTANCES .. "\n" .. TRZ_FONT_OFF;
			for instance in LT:IterateZoneInstances(wZone) do
				zoneText = zoneText .. TRZ_GetInstanceText(instance, true) .. "\n";
			end
		end
		if (zoneText ~= nil) then
			TRZ_WorldMap_Text:SetText(zoneText);
		else
			TRZ_WorldMap_Text:SetText("");
		end
	else
		TRZ_WorldMap_Text:SetText("");
	end

	if (WorldMapFrame.poiHighlight) then
	    wZone2=WorldMapFrameAreaLabel:GetText();
		if (not LT:IsZone(wZone2)) then
			wZone2=WorldMapFrame.areaName;
		end
		wZone2=LT:GetUniqueZoneNameForLookup(wZone2, WorldMapFrame:GetMapID());	-- Fixes issue retrieving instances from newer zones that share a name with older zones.
		if (wZone ~= wZone2) then
			if (LT:IsZone(wZone2)) then
				if (LT:GetType(wZone2) == "Zone") then
					if ( LT:DoesZoneHaveInstances(wZone2) == true ) then
						if (zoneText ~= nil) then
							zoneText = zoneText .. TRZ_NORMAL .. TRZ_TOOLTIP_RINSTANCES .. "\n" .. TRZ_FONT_OFF;
						else
							zoneText = TRZ_NORMAL .. TRZ_TOOLTIP_RINSTANCES .. "\n" .. TRZ_FONT_OFF;
						end
						local instance;
						for instance in LT:IterateZoneInstances(wZone2) do
							zoneText = zoneText .. TRZ_GetInstanceText(instance, true) .. "\n";
						end
					end
					if (zoneText ~= nil) then
						TRZ_WorldMap_Text:SetText(zoneText);
					else
						TRZ_WorldMap_Text:SetText("");
					end
				end
			end
		end
	end
end

Last edited by AeroMaxxD : 12-09-22 at 12:21 PM.
  Reply With Quote