ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Improve Item Crafting Event ? (https://www.esoui.com/forums/showthread.php?t=7522)

Argusus 12/20/17 11:28 PM

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.

Dolgubon 12/21/17 12:28 AM

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.

Baertram 12/21/17 10:36 AM

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

Dolgubon 12/21/17 11:28 AM

I'd be wary of that method, because it is possible for improvements to happen when not on that tab

Baertram 12/21/17 01:30 PM

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.

Dolgubon 12/21/17 02:16 PM

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!

Argusus 12/21/17 02:25 PM

Thank you both. I'll give this a try and see how it goes. I'll keep you posted


All times are GMT -6. The time now is 09:59 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI