ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   How to differentiate between Regular and Crown Soul Gems (https://www.esoui.com/forums/showthread.php?t=7744)

calia1120 04/25/18 05:07 PM

How to differentiate between Regular and Crown Soul Gems
 
How would we differentiate soul gems vs crown soul gems for inventory count purposes?
There's a SPECIALIZED_ITEMTYPE_SOUL_GEM, as well as SOUL_GEM_TYPE_FILLED
Only place I'm seeing a differentiation is for default soul gem choice

Crown Gem - http://esoitem.uesp.net/viewlog.php?...mmary&id=17501
Regular - http://esoitem.uesp.net/viewlog.php?...ummary&id=1295

One of the requests I got for Wykkyd Toolbar was to show a count for both types.

sirinsidiator 04/26/18 03:18 AM

I'd just count them by item id since they have removed all except for those two types when they simplified the soul gem system.
Seeing that there already is a function GetSoulGemInfo which is used to determine how many soul gems the player has available, it might also be worthwhile to ask for an additional argument SoulGemType which can be SOUL_GEM_INFO_ALL, SOUL_GEM_INFO_REGULAR or SOUL_GEM_INFO_CROWN.

ZOS_ChipHilseberg 04/26/18 07:54 AM

I think IsItemFromCrownStore(bag, slot) should work.

calia1120 04/26/18 09:39 AM

That could work. This is what Wykkyd had originally come up with for the count:
Code:

local useIcon = _addon:GetOrDefault( true, _addon.Settings["soulgem_icon"] )
    local retVal, c = "", {215/255,213/255,205/255,1}
    local name, icon, icon2, stackCount = "", "", "", 0
    local myLevel = GetUnitEffectiveLevel("player")
    local emptyCount, fullCount = 0, 0
    name, icon, stackCount = GetSoulGemInfo(SOUL_GEM_TYPE_EMPTY, myLevel, true); emptyCount = stackCount;
    name, icon2, stackCount = GetSoulGemInfo(SOUL_GEM_TYPE_FILLED, myLevel, true); fullCount = stackCount;

It's not using slot references, but I'm not against reworking things.


All times are GMT -6. The time now is 06:35 AM.

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