Battle Pet BreedID

1 - TSM Tooltip below yours

Hey there ;)

Found a solution to place the TSM Tooltip below yours even if your Tooltip is below the Original Tooltip.
This is not very "clean" because we can't figure out how many _TSMExtraTip_'s are existsing exactly!
But it works now and i hope TSM will not add too much _TSMExtraTip_'s in the Future :P

Replace the whole "temporal" fix with this:

breedtip:SetPoint("TOPLEFT", parent, "BOTTOMLEFT", 0, tooltipDistance or 2)
breedtip:SetPoint("TOPRIGHT", parent, "BOTTOMRIGHT", 0, tooltipDistance or 2)

if _G.IsAddOnLoaded("TradeSkillMaster") then
	for i=1,10 do
		local t=_G["TSMExtraTip"..i];
		if not t then break else
			if (t:GetParent() == BattlePetTooltip) then
				t:ClearAllPoints();
				t:SetPoint("TOPLEFT", BPBID_BreedTooltip, "BOTTOMLEFT", 0, -1);
				t:SetPoint("TOPRIGHT", BPBID_BreedTooltip, "BOTTOMRIGHT", 0, 1);
			elseif (t:GetParent() == FloatingBattlePetTooltip) then
				t:ClearAllPoints();
				t:SetPoint("TOPLEFT", BPBID_BreedTooltip2, "BOTTOMLEFT", 0, -1);
				t:SetPoint("TOPRIGHT", BPBID_BreedTooltip2, "BOTTOMRIGHT", 0, 1);
			end
		end
	end
end

This will:

  1. place your Tooltip back below the Original Tooltip
  2. place the TSM Tooltip below yours!

So are both Tooltips below the Original Tooltip again.

User When Change
q3fuba Sep 24, 2016 at 21:20 UTC Changed description:
  breedtip:SetPoint("TOPRIGHT", parent, "BOTTOMRIGHT", 0, tooltipDistance or 2)

  if _G.IsAddOnLoaded("TradeSkillMaster") then
- 	for i=1,10 do -- can also set to 10+ becasue we dont know how many TSMExtraTip's may added in the future...
+ 	for i=1,10 do
  		local t=_G["TSMExtraTip"..i];
  		if not t then break else
- 			if (t:GetParent() == BattlePetTooltip) or (t:GetParent() == FloatingBattlePetTooltip) then
+ 			if (t:GetParent() == BattlePetTooltip) then
  				t:ClearAllPoints();
- 				t:SetPoint("TOPLEFT", breedtip, "BOTTOMLEFT", 0, -1);
+ 				t:SetPoint("TOPLEFT", BPBID_BreedTooltip, "BOTTOMLEFT", 0, -1);
- 				t:SetPoint("TOPRIGHT", breedtip, "BOTTOMRIGHT", 0, 1);
+ 				t:SetPoint("TOPRIGHT", BPBID_BreedTooltip, "BOTTOMRIGHT", 0, 1);
+ 			elseif (t:GetParent() == FloatingBattlePetTooltip) then
+ 				t:ClearAllPoints();
+ 				t:SetPoint("TOPLEFT", BPBID_BreedTooltip2, "BOTTOMLEFT", 0, -1);
+ 				t:SetPoint("TOPRIGHT", BPBID_BreedTooltip2, "BOTTOMRIGHT", 0, 1);
  			end
  		end
  	end
----------------------------------------
  # place your Tooltip back below the Original Tooltip
  # place the TSM Tooltip __below__ yours!

- So are booth Tooltips below the Original Tooltip again.
+ So are both Tooltips below the Original Tooltip again.
q3fuba Sep 24, 2016 at 20:38 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • 1 comment
  • Avatar of q3fuba q3fuba Sep 24, 2016 at 21:20 UTC - 0 likes

    fixead an error that prevent the TSMExtraTip to move when both BattlePetTooltip and FloatingBattlePetTooltip are visible!

  • 1 comment

Facts

Last updated
Sep 24, 2016
Reported
Sep 24, 2016
Status
New - Issue has not had initial review yet.
Type
Patch - Source code patch for review
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees