View Single Post
07-25-14, 01:32 PM   #4
basvanderwerff
A Murloc Raider
Join Date: Jul 2014
Posts: 9
As far as i know it was made after 5.1 so not that old.
Thank you for the heads up on how to post code properly (i only recently found this forum)
I solved some of my initial problems with the addon.
1) i got the color of the enchant and season text changed to green turned out there was a saved variables file also and ONLY changing it both in the lua code and saved variables changed it.
2) I solved the problem with TSM addon by moving the TMS tooltip to a seperate window (option of TSM)

Now i just need to solve the problem of the addon removing the large number seperators wich it does everywhere from dmg/healing gold stats ect ect, ill repost the piece of code wich i think it the culprit.
Code:
frame:SetScript("OnEvent", function(self, event, ...)
	if (event == "VARIABLES_LOADED") then
		self:UnregisterEvent("VARIABLES_LOADED");
		self:RegisterEvent("CVAR_UPDATE");
		if (GetCVarBool("breakUpLargeNumbers")) then
			SetCVar("breakUpLargeNumbers", nil);
		end
		BetterItemTooltip:OnInitialize();
	elseif (event == "CVAR_UPDATE") then
		if (GetCVarBool("breakUpLargeNumbers")) then
			SetCVar("breakUpLargeNumbers", nil);
		end
	end
end);
frame:RegisterEvent("VARIABLES_LOADED");
And also looking trough the code it sugests that there are /commands to set these colors and hide/show various things in game but please correct me if im wrong, the second piece of code repeats itself for each different color setting there is available, can post that also if needed.
Code:
	SLASH_BETTERITEMTOOLTIP1 = "/betteritemtooltip";
	SLASH_BETTERITEMTOOLTIP2 = "/bitip";
end

function BetterItemTooltip:Print(...)
	if not (...) then return; end
	print("|cff4fcfffBetterItemTooltip:|r "..(...));
end

local options = {};
SlashCmdList.BETTERITEMTOOLTIP = function(msg)
	if not msg then return; end
	wipe(options);
	for v in gmatch(strlower(msg), "[^ ]+") do
		options[#options + 1] = v;
	end
	if options[1] == "bonuscolor" then
		if tonumber(options[2]) and tonumber(options[3]) and tonumber(options[4]) then
			local r, g, b = tonumber(options[2]), tonumber(options[3]), tonumber(options[4]);
			if r > 1 then r = 1; elseif r < 0 then r = 0; end
			if g > 1 then g = 1; elseif g < 0 then g = 0; end
			if b > 1 then b = 1; elseif b < 0 then b = 0; end
			db.bonusColor[1] = r;
			db.bonusColor[2] = g;
			db.bonusColor[3] = b;
			AvgItemLvl:Print("Bonus Stats Color is now "..format("|cff%02x%02x%02x%s, %s, %s|r", r*255, g*255, b*255, r, g, b));
After this it goes trough all the available color settings it ends with.
Code:
	elseif options[1] == "on" then
		db.enable = true;
		BetterItemTooltip:Print("BetterItemTooltip is now "..(db.enable and "|cff00ff00on|r" or "|cffff0000off|r"));
	elseif options[1] == "off" then
		db.enable = false;
		BetterItemTooltip:Print("BetterItemTooltip is now "..(db.enable and "|cff00ff00on|r" or "|cffff0000off|r"));
		for _, tooltip in pairs(tooltips) do
			if _G[tooltip] then
				tipIsShown = 1;
				ItemTooltip_OnHide(_G[tooltip]);
			end
		end
After this it goes trough a list of non color option for example show/hide made by tag on items ect ect they all listed in the same format but again can post them all if needed they look like this.
Code:
	elseif options[1] == "shortbonus" then
		db.shortBonus = not db.shortBonus;
		BetterItemTooltip:Print("Bonus Stats are now using "..(db.shortBonus and "|cff00ff00short|r" or "|cffff0000long|r").." format");
So i just like to know can i set all these options in game with /commands or do i need to change them in the code?
And can i get large number seperation back again.

Thanks alot in advance, bas.
  Reply With Quote