ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   STAT_CRITICAL_DAMAGE - Does this exist yet? (https://www.esoui.com/forums/showthread.php?t=9920)

lt_columbo 09/17/21 06:49 PM

STAT_CRITICAL_DAMAGE - Does this exist yet?
 
Looking to pull the critical damage value (the value displayed on the advanced character stat page in base game) into an addon but cannot seem to find the variable to do this. Does anyone know if this exists yet?

Baertram 09/19/21 07:44 AM

No idea sorry but you can do the same as at the advanced stat fragment and collect the data yourself via
function
GetAdvancedStatInfo(categoryId, statIndex)

Description how to get the categoryId, statIndex:

The advanced stats are defined via the class "ZO_AdvancedStats_Keyboard" and assigned to the object "ZO_ADVANCED_STATS_WINDOW" here:
https://github.com/esoui/esoui/blob/...oard.lua#L1080

The object contains a list where all the adv. stats are added to.
The list can have 4 different types of stats using 4 different setup functions to build the rows:
https://github.com/esoui/esoui/blob/...board.lua#L920
Code:

DATA_ENTRY_TYPE_STAT
DATA_ENTRY_TYPE_DIVIDER
DATA_ENTRY_TYPE_HEADER
DATA_ENTRY_TYPE_MULTI_STAT

where most probably divider and header do not count as they are headlines or a divider line.
So stats and multi stats count here, showing the stats values.

Here the function SetupAdvancedStats() will loop over all given advanced stats data, get cateories and build the list entries of the 4 different types shown above:
https://github.com/esoui/esoui/blob/...board.lua#L932


Lua Code:
  1. --Get num of catgeories
  2. local numCategories = GetNumAdvancedStatCategories()
  3. --For each category:
  4.     for categoryIndex = 1, numCategories do
  5. --get num of stats in category
  6. local categoryId = GetAdvancedStatsCategoryId(categoryIndex)
  7.         local displayName, numStats = GetAdvancedStatCategoryInfo(categoryId)
  8. --get stats info for each stat in the category
  9. for statIndex = 1, numStats do
  10.             local statType, statDisplayName, description, flatValueDescription, percentValueDescription = GetAdvancedStatInfo(categoryId, statIndex)


And here the list is setup then based on the data collected above:
https://github.com/esoui/esoui/blob/...board.lua#L966

ZO_ScrollList_CreateDataEntry creates the list entry with the list type like divider, header and the actual stats values e.g. DATA_ENTRY_TYPE_STAT or DATA_ENTRY_TYPE_MULTI_STAT

You would need to check at the data collection, by e..g using the same code in your own example function, which category and stat type etc. are used there for the critical value output and then you should be able to calculate/use it on your own by directly reading the data via
Code:

local statType, statDisplayName, description, flatValueDescription, percentValueDescription = GetAdvancedStatInfo(categoryId, statIndex)
Hope this helps


All times are GMT -6. The time now is 02:19 AM.

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