Go to Page... |
|
Thread Tools | Display Modes |
|
07-22-14, 04:42 PM | #1 |
Looking for help with modifying code tooltip addon
Hello,
I recently found this addon that changes the (gear) item tooltips to the pre 5.1 look (specificly the order of the info) it works great but it has a few issues. - I cant seam to find anyway to set it up beside toggle it on or off with /betteritemtooltip or /bitip (found these 2 / commands when looking trough the code) the addon page itself does not have any info beside that the addon reverts it back to pre 5.1 look - enchants show in a light blue now i did find a list of text colors in the code and when i change: enchantColor = { 0.0, 0.82, 1.0 } to enchantColor = { 0.0, 1.0, 0.0 } wich should be green since it used on the lfr heroic flex color codes nothing happens. - pvp seasons text shows in red on wich i tried the same as with the enchants change the color code but also no luck. - It messes with (some) non-gear tooltips from the TSM addon quick example a crafted item typically shows this at bottom of a tooltip (i left some part out since tsm has alot of modules) tradskillmaster info: group: professions->inscription->crafts->glyph auctions operation(s): glyph TSM crafting: Crafting cost: (price in gold-silver-copper) Now for some items is still shows the colored part but the rest it removes for example it still show. tradskillmaster info: group: auctions operation(s): TSM crafting: Crafting cost: - somehow it removes the . in dmg numbers for example a 1.350.456 chaosbolt shows as 1350456 it also does the same on item tooltips (3.545 agi showing as 3545 agi) so guess they related and caused by this addon. Now my question is. 1) How can i change the color of the enchant and season both to green in the code (or is there some ingame way to set this up i could not find) 2) Is there a way to stop this addon from messing with TSM tooltips 3) Is there a way to stop it from removing the . in dmg/stats numbers. I added the lua file as attachement, hope someone can help out what to change in the code for changing the colors and maby point me in the right direction of what causes the TSM conflicts and the removeal of the . in dmg/stat numbers. Thanks alot in advance, Bas. |
|
07-25-14, 08:07 AM | #2 | |
I think this is the part that removes the split in large number.
|
||
07-25-14, 09:52 AM | #3 |
That must be a very old AddOn. Almost nobody registers and uses VARIABLES_LOADED. Instead, if you need it check when entering the world OR every UI reload, PLAYER_ENTERING_WORLD is used. If you only need it to check one time, use PLAYER_LOGIN, do processing, and unregister PLAYER_LOGIN in the same function.
You could even use ADDON_LOADED, and handle it that way. The trouble with VL, iirc, is that its load order is inconsistent. Also, next time please use the [ code ] [ /code ] tags, or the # symbol in the tools above. You may have to change your WowI forum settings to get the full toolset to display. For your short piece of code, the quote is okay, I guess, but the formatting is ruined and makes it harder to read. Last edited by myrroddin : 07-25-14 at 10:12 AM. Reason: ADDON LOADED |
|
07-25-14, 01:32 PM | #4 |
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"); 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)); 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 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"); And can i get large number seperation back again. Thanks alot in advance, bas. |
|
07-26-14, 02:27 AM | #5 | ||
/run SetCVar("breakUpLargeNumbers", 1) I'm not even sure why the addon is overriding this, as I'm pretty sure there aren't even any numbers in item tooltips that are long enough to qualify for break-up. Sounds like feature creep.
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
|||
07-26-14, 03:13 AM | #6 | |
|
||
07-27-14, 04:09 AM | #7 | |
Anyway ill give removing that piece of code a go and see if that does the trick. Bases on the other code i linked is it possible to change settings in game beside toggle it on or off? |
||
08-03-14, 04:16 AM | #8 | |
Putting in
Code:
frame:SetScript("OnEvent", function(self, event, ...) if ... == addonName then BetterItemTooltip:OnInitialize() end end) frame:RegisterEvent("ADDON_LOADED")
Thanks alot for those that helped to get it working good. |
||
WoWInterface » Developer Discussions » Lua/XML Help » Looking for help with modifying code tooltip addon |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Hybrid Mode |
Switch to Threaded Mode |
|
|