Thread Tools Display Modes
12/20/17, 11:28 PM   #1
Argusus
AddOn Author - Click to view addons
Join Date: Sep 2014
Posts: 120
Improve Item Crafting Event ?

Hello,

I am wondering if there is any event for "Improving an Item" like the EVENT_CRAFT_COMPLETED that I can hook to and perform some logic? For Example, when an item is improved from Green to Blue in a crafting station.. is there a way to know that an improvement just happened?

Thanks in advance, I appreciate any thoughts.
  Reply With Quote
12/21/17, 12:28 AM   #2
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 408
There's no actual improve Item crafting event. However, there is EVENT_CRAFT_COMPLETED. While it does fire for anything you do at a crafting station, you can further filter it down with GetLastCraftingResultItemInfo(number resultIndex). The 9th return value is the itemQuality. If the quality is not white, and it is an armour or a weapon, and the stack (3rd return) > 0 then it is an improvement.
  Reply With Quote
12/21/17, 10:36 AM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
It's even easier (assuming you use the improvement station to improve an item, not sure if it would be possible without or just opening the crafting station but NOT selecting the improvement tab) to check if the imporvement tab is shown.

Use the event_craft_complete to register your callback function and then check if the improvement's inventory control is not hidden:

Lua Code:
  1. if not ZO_SmithingTopLevelImprovementPanelInventory:IsHidden() then
  2. --Improvement
  3. end
  Reply With Quote
12/21/17, 11:28 AM   #4
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 408
I'd be wary of that method, because it is possible for improvements to happen when not on that tab
  Reply With Quote
12/21/17, 01:30 PM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Yes, but uf you use the base game it shouldn't happen at another tab?
If you use an addon to improve stuff, it could be.
  Reply With Quote
12/21/17, 02:16 PM   #6
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 408
In the base game yes, but as it is possible for it to happen otherwise with addons, it might be better to use the other method just in case.

I suppose that would be an argument for making addons go through the base game crafting UI methods, but too bad, I'm not changing it!
  Reply With Quote
12/21/17, 02:25 PM   #7
Argusus
AddOn Author - Click to view addons
Join Date: Sep 2014
Posts: 120
Thank you both. I'll give this a try and see how it goes. I'll keep you posted
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Improve Item Crafting Event ?

Thread Tools
Display Modes

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