View Single Post
02/07/16, 04:39 PM   #2
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Wandamey View Post
I'm having a problem with some tootlip edition

At the gear crafting stations (clothier, carpenter, blacksmith)

In creation mode, i can't seem to get a valid info from GetSmithingPatternResultLink(...) with the args I get from ZO_SmithingTopLevelCreationPanelResultTooltip.SetPendingSmithingItem anymore (the hook was working till TG) and get this error :
Yes it is an error about the linkStyle.

If your trying to create a link for the item that's currently being created theres a function to get all of those arguments:
Lua Code:
  1. local patternIndex, materialIndex, materialQuantity, styleIndex, traitIndex, isUsingUniversalStyle = SMITHING.creationPanel:GetAllCraftingParameters()
  2. -- Don't try to use this: isUsingUniversalStyle  as the last parameter,
  3. -- its the wrong type which is what you were trying to use
  4. local link = GetSmithingPatternResultLink(patternIndex, materialIndex, materialQuantity, styleIndex, traitIndex)
  5. d(link)

As for the Boolean argument you mentioned: isUsingUniversalStyle, its not extra its just that the last argument is different. It is because GetSmithingPatternResultLink takes a linkStyle as its last parameter and SetupResultTooltip/SetPendingSmithingItemTooltip takes a Boolean as its last parameter which is isUsingUniversalStyle that is returned from GetAllCraftingParameters() or SMITHING.creationPanel.GetIsUsingUniversalStyleItem()
Lua Code:
  1. function ZO_SharedSmithingCreation:GetAllCraftingParameters()
  2.     return self:GetSelectedPatternIndex(), self:GetSelectedMaterialIndex(),
  3.            self:GetSelectedMaterialQuantity(), self:GetSelectedStyleIndex(), self:GetSelectedTraitIndex(), self:GetIsUsingUniversalStyleItem()
  4. end

Lua Code:
  1. local creationPanel = SMITHING.creationPanel
  2. creationPanel:SetupResultTooltip(creationPanel:GetAllCraftingParameters())

SetupResultTooltip(...) is what calls your: SetPendingSmithingItemTooltip(...), passing it all of its parameters.
Lua Code:
  1. function ZO_SmithingCreation:SetupResultTooltip(...)
  2.     self.resultTooltip:SetPendingSmithingItem(...)
  3. end

Last edited by circonian : 02/07/16 at 04:54 PM.
  Reply With Quote