Quantcast
Download
(5 Kb)
Download
Updated: 04/17/19 04:27 AM
Pictures
File Info
Compatibility:
Wrathstone (4.3)
Updated:04/17/19 04:27 AM
Created:04/15/19 07:53 AM
Monthly downloads:115
Total downloads:124
Favorites:1
MD5:
4.3
ShowTraitOnList  New this week!
Version: 1.2.1
by: jellyalex978 [More]
This addon is show Trait icon on bag list

==============================

How to manually install
Download and Extract the files to your ESO AddOn folder
PC: C:\Users\< username >\Documents\Elder Scrolls Online\live\AddOns\
Mac: ~/Documents/Elder Scrolls Online/live/AddOns/

==============================

This addon uses the following libraries:
  • LibAddonMenu-2.0


thanks for all the help by
@hacker725x
Addon - Item Saver
1.2.1
add check GetItemLinkEquipType

1.2.0
add equipped icon setting

1.1.0
add home bank, store, trading house

1.0.1
fix bug when you own trait : Ornate / Intricate

1.0.0
init
Optional Files (0)


Archived Files (3)
File Name
Version
Size
Uploader
Date
1.2.0
4kB
jellyalex978
04/15/19 11:49 PM
1.1.0
4kB
jellyalex978
04/15/19 12:40 PM
1.0.1
4kB
jellyalex978
04/15/19 08:21 AM


Post A Reply Comment Options
Unread Today, 04:26 AM  
jellyalex978
 
jellyalex978's Avatar
AddOn Author - Click to view AddOns

Forum posts: 6
File comments: 47
Uploads: 4
hi Baertram

oh ! i understand now !
i will try to find the constants !
and fix other addon code
vary grateful

=====================

yes, i know you already give me the answer (i will copy it XD)
i mean , i want learn how to find answer XD

if IsUnderArrest() then return end
if SCENE_MANAGER:GetCurrentScene() == STABLES_SCENE then return end
if GetItemType(bagId, slotId) == ITEMTYPE_NONE then return
Report comment to moderator  
Reply With Quote
Unread Yesterday, 10:07 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2067
File comments: 2209
Uploads: 55
Hey there,

to find the constants check the function in teh API txt file.
API txt files can be found here:
https://wiki.esoui.com/APIVersion

The txt file for current live API 100026:
https://www.esoui.com/forums/attachm...6&d=1551113594

The txt file for next patch "Elsweyr" API 100027:
https://www.esoui.com/forums/attachm...5&d=1555350500

Inside the txt fiule search for the function, event or variable type. In your example it will be something with "equipment type" so searching for it will give you:
Code:
EquipType
* EQUIP_TYPE_CHEST
* EQUIP_TYPE_COSTUME
* EQUIP_TYPE_FEET
* EQUIP_TYPE_HAND
* EQUIP_TYPE_HEAD
* EQUIP_TYPE_INVALID
* EQUIP_TYPE_LEGS
* EQUIP_TYPE_MAIN_HAND
* EQUIP_TYPE_NECK
* EQUIP_TYPE_OFF_HAND
* EQUIP_TYPE_ONE_HAND
* EQUIP_TYPE_POISON
* EQUIP_TYPE_RING
* EQUIP_TYPE_SHOULDERS
* EQUIP_TYPE_TWO_HAND
* EQUIP_TYPE_WAIST
Same for the event EVENT_INVENTORY_SINGLE_SLOT_UPDATE :
Code:
* EVENT_INVENTORY_SINGLE_SLOT_UPDATE (*[Bag|#Bag]* _bagId_, *integer* _slotId_, *bool* _isNewItem_, *[ItemUISoundCategory|#ItemUISoundCategory]* _itemSoundCategory_, *integer* _inventoryUpdateReason_, *integer* _stackCountChange_)
The inventoryUpdateReason is an integer. No special type listed here. So just search for inventoryUpdateReason or inventory update or update reason and you'll find:
Code:
InventoryUpdateReason
* INVENTORY_UPDATE_REASON_DEFAULT
* INVENTORY_UPDATE_REASON_DURABILITY_CHANGE
* INVENTORY_UPDATE_REASON_DYE_CHANGE
* INVENTORY_UPDATE_REASON_ITEM_CHARGE
* INVENTORY_UPDATE_REASON_PLAYER_LOCKED
For my addition to the code of this event callback function, just copy my code.
It will stop to update markers if you get arrested (by a guard if yoou have stolen items) and/or if you are at the horse vendor and buy more bagSpace for your horse e.g.

Use google translator to maybe trannslate my text to your native language.

Originally Posted by jellyalex978
hi Baertram

I'm very grateful to help me to know my lua shortcomings
but my english not good , if i say something stupid , forget me plz


> use constant , don't use ahrdoced value
yes ! i understand. i know it. My question is how to find the constant name ... Orz
you can see the stupid code like this
Lua Code:
  1. if Iequiptp == 5 or Iequiptp == 6 or Iequiptp == 7 or Iequiptp == 14 then

maybe this is batter, but still not constants
Lua Code:
  1. mark_equiptype = {5,6,7,14,2,12,1,3,4,8,9,10,13}
  2. if mark_equiptype[Iequiptp] then ... end

==============================

EVENT_INVENTORY_SINGLE_SLOT_UPDATE (number eventCode, Bag bagId, number slotId, boolean isNewItem, ItemUISoundCategory itemSoundCategory, number inventoryUpdateReason, number stackCountChange)

english is my big trouble ... XD
like this, how do i find stackCountChange return value 0 = INVENTORY_UPDATE_REASON_DEFAULT
ha .. i know it's my problem, i should study english hard
but if you can share me some tips , i will very grateful

==============================

> Some additions to your callback function which will prevent firing your code at a stable scene where you improve your mount's capacity, or if you get arrested and the items are scanned for "stolen items", and if the item is not given anymore (drag&drop -> deconstruction etc.):

hmm ... i am not 100% understand
sorry i always copy someone's addon ... Orz
but i will try and learn soon , and fix my stupid code XD
Report comment to moderator  
Reply With Quote
Unread Yesterday, 08:41 AM  
jellyalex978
 
jellyalex978's Avatar
AddOn Author - Click to view AddOns

Forum posts: 6
File comments: 47
Uploads: 4
hi Baertram

I'm very grateful to help me to know my lua shortcomings
but my english not good , if i say something stupid , forget me plz


> use constant , don't use ahrdoced value
yes ! i understand. i know it. My question is how to find the constant name ... Orz
you can see the stupid code like this
Lua Code:
  1. if Iequiptp == 5 or Iequiptp == 6 or Iequiptp == 7 or Iequiptp == 14 then

maybe this is batter, but still not constants
Lua Code:
  1. mark_equiptype = {5,6,7,14,2,12,1,3,4,8,9,10,13}
  2. if mark_equiptype[Iequiptp] then ... end

==============================

EVENT_INVENTORY_SINGLE_SLOT_UPDATE (number eventCode, Bag bagId, number slotId, boolean isNewItem, ItemUISoundCategory itemSoundCategory, number inventoryUpdateReason, number stackCountChange)

english is my big trouble ... XD
like this, how do i find stackCountChange return value 0 = INVENTORY_UPDATE_REASON_DEFAULT
ha .. i know it's my problem, i should study english hard
but if you can share me some tips , i will very grateful

==============================

> Some additions to your callback function which will prevent firing your code at a stable scene where you improve your mount's capacity, or if you get arrested and the items are scanned for "stolen items", and if the item is not given anymore (drag&drop -> deconstruction etc.):

hmm ... i am not 100% understand
sorry i always copy someone's addon ... Orz
but i will try and learn soon , and fix my stupid code XD
Report comment to moderator  
Reply With Quote
Unread 04/17/19, 06:18 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2067
File comments: 2209
Uploads: 55
Hey there,
inside your callback function for EVENT_INVENTORY_SINGLE_SLOT_UPDATE you are checking if invemtory_update_reason ~= 0.
Please do not use the ahrdoced value 0. There are constants for these values which you are able to find in the wiki, global values:
https://wiki.esoui.com/Constant_Values

The constant for this 0 is: INVENTORY_UPDATE_REASON_DEFAULT
This will make your addon work even if ZOs decodes to change the values of these constants. If you hardcode it to 0 it will fire each time in the future after ZOs changed te value to e.g. -1 or 8 (if this will ever happen, but it already has happened with other constant values like bagIds -> You are using BAG_WORN constant with is the correct way here!).

Some additions to your callback function which will prevent firing your code at a stable scene where you improve your mount's capacity, or if you get arrested and the items are scanned for "stolen items", and if the item is not given anymore (drag&drop -> deconstruction etc.):

Lua Code:
  1. --Abort here if we are arrested by a guard (thief system) as it will scan our inventory for stolen items and destroy them.
  2.     --We don't need to scan it with our functions too at this case
  3.     if IsUnderArrest() then return end
  4.     --Do not execute if horse is changed
  5.     if SCENE_MANAGER:GetCurrentScene() == STABLES_SCENE then return end
  6.     --Check if item in slot is still there
  7.     if GetItemType(bagId, slotId) == ITEMTYPE_NONE then return end

Please add them to your callback function like this:
Lua Code:
  1. function STL.handleEquipmentChange(eventCode, bagId, slotIndex, isNewItem, itemSoundCategory, inventoryUpdateReason)
  2.     if bagId ~= BAG_WORN or isNewItem or inventoryUpdateReason ~= INVENTORY_UPDATE_REASON_DEFAULT then return end
  3.     --Abort here if we are arrested by a guard (thief system) as it will scan our inventory for stolen items and destroy them.
  4.     --We don't need to scan it with our functions too at this case
  5.     if IsUnderArrest() then return end
  6.     --Do not execute if horse is changed
  7.     if SCENE_MANAGER:GetCurrentScene() == STABLES_SCENE then return end
  8.     --Check if item in slot is still there
  9.     if GetItemType(bagId, slotIndex) == ITEMTYPE_NONE then return end
  10.    
  11.     STL:initializeEquipment()
  12. end
Last edited by Baertram : 04/17/19 at 06:20 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: