Thread Tools Display Modes
11/07/15, 12:15 PM   #1
Jhenox
 
Jhenox's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 42
Request: Identify crafted potions.

I'd like to request an add on that will add a marker of some sort or tooltip note to differentiate crafted (and/or my crafted potions_ potions from looted potions. I think Zenimax should have added this long ago but I keep crafting potions for writs then they get mixed in with looted ones. Normally I can tell with a little effort by looking for the effects but the Wrothgar pots seem close to my crafted potions. Thank you.
  Reply With Quote
11/07/15, 01:10 PM   #2
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
I will write something quick as we already found how to detect a crafted pot

hmm I did this which works.. but..
as long as inventory don't use thoses functions to get quality, but SHARED_INVENTORY.bagcache[bagId][slotId].quality (and PLAYER_INVENTORY), we could rewrite the tooltips itself.. If someone else wants do something. it shouldn't be hard.

just rewrite a bit GetItemLinkTraitOnUseAbilityInfo() maybe. But it should be better to try to continue to modify the quality I guess.



Lua Code:
  1. local original_GetItemQuality = GetItemQuality
  2. GetItemQuality = function(bagId, slotId)
  3.     if GetItemType(bagId, slotId) == ITEMTYPE_POTION then
  4.         local itemLink = GetItemLink(bagId, slotId)
  5.         if select(24, ZO_LinkHandler_ParseLink(itemLink)) ~= "0" then
  6.            
  7.             local quality = ITEM_QUALITY_NORMAL
  8.             for i = 1, GetMaxTraits() do
  9.                
  10.                 local hasTraitAbility = GetItemLinkTraitOnUseAbilityInfo(itemLink, i)
  11.                
  12.                 if(hasTraitAbility) then
  13.                     quality = quality + 1
  14.                 end
  15.                
  16.             end
  17.            
  18.             if quality == ITEM_QUALITY_NORMAL then
  19.                 quality = ITEM_QUALITY_MAGIC
  20.             end
  21.            
  22.             return quality
  23.        
  24.         end
  25.     end
  26.     return original_GetItemQuality(bagId, slotId)
  27. end
  28.  
  29. local original_GetItemLinkQuality = GetItemLinkQuality
  30. GetItemLinkQuality = function(itemLink)
  31.     if GetItemLinkItemType(itemLink) == ITEMTYPE_POTION then
  32.         if select(24, ZO_LinkHandler_ParseLink(itemLink)) ~= "0" then
  33.            
  34.             local quality = ITEM_QUALITY_NORMAL
  35.             for i = 1, GetMaxTraits() do
  36.                
  37.                 local hasTraitAbility = GetItemLinkTraitOnUseAbilityInfo(itemLink, i)
  38.                
  39.                 if(hasTraitAbility) then
  40.                     quality = quality + 1
  41.                 end
  42.                
  43.             end
  44.            
  45.             if quality == ITEM_QUALITY_NORMAL then
  46.                 quality = ITEM_QUALITY_MAGIC
  47.             end
  48.            
  49.             return quality
  50.        
  51.         end
  52.     end
  53.     return original_GetItemLinkQuality(itemLink)
  54. end

Last edited by Ayantir : 11/07/15 at 01:34 PM.
  Reply With Quote
11/07/15, 01:32 PM   #3
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
There was a request on eso forums to differentiate crafted potions in inventory. I have something thrown in my "misc tweaks and dirty hacks add-on" ... not sure when I'll force myself to push it out
  Reply With Quote
11/07/15, 02:59 PM   #4
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
http://www.esoui.com/downloads/info1...edPotions.html

I still need to :
  • Force quality on tooltip
  • Force quality in trading house

But it's a good begening
  Reply With Quote
11/10/15, 06:46 AM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,976
And force quality at quickslot too please! This would be great.
  Reply With Quote
11/10/15, 07:14 AM   #6
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
I looked around and couldn't find a way to override quality on tooltip. It doesn't seem to use GetItemInfo or GetItemLinkQuality, and the title child control is inaccessible.
  Reply With Quote
11/10/15, 07:26 AM   #7
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
Yes keyboard tooltips only parse itemlink and there is no way to modify it, we should add an item into the db, that's not possible.

I'll look a bit deeply to tooltip control, last time I didn't succeeded to access to whole part of tooltip (same as you I guess, found the sellprice. it must be somewhere, but still don't know.



I need to recheck but think Keyboard use esoui\ingame\tooltip\tooltip.xml (and ItemTooltipBase). there is some function to play with here.
  Reply With Quote
11/10/15, 01:32 PM   #8
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
I've rechecked, that's nearly impossible to do. Keyboard tooltips come from an hidden place that we cannot access.

To build a keyboard tooltip, game just do a TooltipControl:method(), control can be ItemTooltip, PopupTooltip, etc

Methods are thoses of the object type "TooltipControl" (CT_TOOLTIP)

And controls are defined in the c++ side of the game.

Just try by doing a :

/script PopupTooltip:ClearLines();PopupTooltip:SetLink("|H1:item:56490:370:50:26841:370:50:0:0:0:0:0:0:0:0:0:28:1:1:0:464:0|h|h");PopupTooltip:SetHidden(false)

It will show you my sword

Inside SetLink() is used the equivalent of the Lua function we use to get info, ~ same as Lua but in C++.

The other way to do it is to change itemlink passed as argument by another one. I should need an itemlink builder and hope that ZOS added something in their intemlink engine builder to change quality of potions.
, but changing the itemlink will broke a lot of things, quantity displayed in bags, bank, addons which look at the itemlink, maybe values of the potions, etc. It's a hard work for maybe nothing relevant and too much modification for a so little tweak that ZOS could do easily.

The last possibility will be to rebuild ItemTooltip & PopupTooltip themselves by another thing, like GamepadUI does.
That's a lot of work for just a tweak, even, if I already rewrited complete tooltips (ability ones) in another addon, rewriting ItemTootip and PopupTooltip will need me to rewrite entirely the equivalent of esoui\ingame\tooltip folder which is for 90% of its code devoted to GamepadUI and needed for this modification

Last edited by Ayantir : 11/10/15 at 01:44 PM.
  Reply With Quote
11/10/15, 01:52 PM   #9
Wandamey
Guest
Posts: n/a
idk

in better glyph tooltip for example we have this:

SafeAddString(SI_ITEM_FORMAT_STR_DERIVED_STAT,
zo_strjoin(nil, " |u32:0::|u", prefix, value, suffix, " |t100:25:BetterGlyphTooltip/Assets/Head_Chest_Legs_Shield.dds|t\n", " |u32:0::|u", prefix, math.floor(value * 0.405), suffix, " |t100:25:BetterGlyphTooltip/Assets/Feet_Hands_Shoulders_Waist.dds|t"),

thats working to edit the content

have you tried the same with SI_TOOLTIP_ITEM_NAME and "|c"..yourcolorpack:ToHex()..GetItemLinkName(itemLink).."|r" in a tooltip hook ?

Edit : tests peinture rose with a copy pasta of Better Glyph Tooltip (based on crit% de Garkin) code and a few modifs

Warning: Spoiler


I've delayed to write the tooltip the last, not sure if it is useful. the change should be included in tooltips modified after this one. I was afraid they would use the non Hi-jacked SI_TOOLTIP_ITEM_NAME during the process but nope, they shouldn't.

Last edited by Wandamey : 11/12/15 at 06:37 AM.
  Reply With Quote
11/10/15, 02:27 PM   #10
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
Hey.. Nice catch. I'll look at it.
  Reply With Quote
11/10/15, 04:31 PM   #11
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
For the inventory you could also set an icon to show that it is crafted.


That's easy enough.


For the tooltip, you could add a line to the bottom of the tooltip, although I didn't really like that Idea. As for accessing the tooltip information I couldn't find a way either. But I did manage to come up with this very hacky method to do what I wanted (it could be used to replace or add to "some" of the other information on the tooltip as well).



EDIT: Localized the word "Potion" & Fixed a bug.
Warning: Spoiler

Last edited by circonian : 11/10/15 at 05:38 PM.
  Reply With Quote
11/14/15, 06:59 AM   #12
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
So I succesfully rewrited all tooltips, except (I think) one :

The one displayed when you're in Quickslot Inventory and hover a potion in the Quickslot wheel.
It should be ItemTooltip, but seems, it's not this one.


If I /zgoo the potion, it's ZO_QuickSlotXButton (ex: ZO_QuickSlot9Button)
which have a sub key .activeTooltip = ItemTooltip

If I do a ItemTooltip:SetHidden(true), the tooltip is well hidden/displayed, but any of the functions used is setting the tooltip.

It shouldbe something like ItemTooltip:SetSlotItem(slotIndex), but it doesn't seems to exists.



Last edited by Ayantir : 11/14/15 at 07:01 AM.
  Reply With Quote
11/14/15, 07:43 AM   #13
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Originally Posted by Ayantir View Post
It shouldbe something like ItemTooltip:SetSlotItem(slotIndex), but it doesn't seems to exists.
Went through ZO_QuickslotManager and got here: http://esodata.uesp.net/current/src/...ip.lua.html#44
  Reply With Quote
11/14/15, 02:20 PM   #14
Wandamey
Guest
Posts: n/a
you probably already got this now, but in case

TooltipHook(ItemTooltip, "SetAction", GetSlotItemLink) with same model as previous post


or
Code:
orgfunc = ItemTooltip.SetAction
ItemTooltip.SetAction = function(control,...)
   itemLink = GetSlotItemLink(...)
   doyourstuff(itemLink)
   orgfunc (...)
   undoyourstuff()
end

works for the selected A quicklot too.
  Reply With Quote
11/15/15, 09:37 AM   #15
Jhenox
 
Jhenox's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 42
You guys are awesome! Thank you!
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » Request: Identify crafted potions.


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