ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Tutorials & Other Helpful Info (https://www.esoui.com/forums/forumdisplay.php?f=172)
-   -   3.1 Update (https://www.esoui.com/forums/showthread.php?t=7212)

Ayantir 07/10/17 08:14 AM

3.1 Update
 
Hello there,

As we know, the next update of game will be launched this week on PTS (consider the opening today or tomorrow).

So the old new update thread. Please leave any comment, or issues you may encounter while doing your updates.

Now, back to business, so some placeholders :


Weolo 07/11/17 11:51 AM

This compatibility function is broken

GetSmithingStyleItemInfo() in addoncompatibilityaliases.lua

Lua Code:
  1. function GetSmithingStyleItemInfo(itemStyleId)
  2.     local styleItemLink = GetItemStyleMaterialLink(validItemStyleId)
  3.     local alwaysHideIfLocked = GetItemStyleInfo(validItemStyleId)
  4.     local name = GetItemLinkName(styleItemLink)
  5.     local icon, sellPrice, meetsUsageRequirement = GetItemLinkInfo(styleItemLink)
  6.     local quality = GetItemLinkQuality(styleItemLink)
  7.     return name, icon, sellPrice, meetsUsageRequirement, itemStyleId, quality, alwaysHideIfLocked
  8. end

Vvariable validItemStyleId does not exist on the 2nd and 3rd lines so styleItemLink and alwaysHideIfLocked are always blank

Weolo 07/11/17 11:59 AM

Just a little note for others, item style constants such as ITEMSTYLE_GLASS etc are on the way out. They will work for now as they are in the addoncompatibilityaliases.lua file but I am checking to see how to code without them with the PTS patch.
Will let you know what I figure out

Ayantir 07/11/17 01:16 PM

use styleItemIndex? but I do agree all addons are coded with the ITEMSTYLE constant.

Rhyono 07/11/17 02:12 PM

StyleItemIndex is great for dynamic lists, but the constants always made it easier for holding my own information on it. I'm surprised they are doing away with them so soon after cleaning them up in the last update.

ZOS_ChipHilseberg 07/11/17 04:40 PM

Quote:

Originally Posted by Weolo (Post 31804)
This compatibility function is broken

GetSmithingStyleItemInfo() in addoncompatibilityaliases.lua

Lua Code:
  1. function GetSmithingStyleItemInfo(itemStyleId)
  2.     local styleItemLink = GetItemStyleMaterialLink(validItemStyleId)
  3.     local alwaysHideIfLocked = GetItemStyleInfo(validItemStyleId)
  4.     local name = GetItemLinkName(styleItemLink)
  5.     local icon, sellPrice, meetsUsageRequirement = GetItemLinkInfo(styleItemLink)
  6.     local quality = GetItemLinkQuality(styleItemLink)
  7.     return name, icon, sellPrice, meetsUsageRequirement, itemStyleId, quality, alwaysHideIfLocked
  8. end

Vvariable validItemStyleId does not exist on the 2nd and 3rd lines so styleItemLink and alwaysHideIfLocked are always blank

This has been fixed.

ZOS_ChipHilseberg 07/11/17 04:50 PM

Quote:

Originally Posted by Rhyono (Post 31808)
StyleItemIndex is great for dynamic lists, but the constants always made it easier for holding my own information on it. I'm surprised they are doing away with them so soon after cleaning them up in the last update.

We often have to choose between using enumerations and using ids when making a system. Enums are great for writing code against because it makes checks against specific values easy. However, adding to an enumeration requires a programmer to make a code change, and then the new client needs to propagate through several branches before finally reaching the designer who can make use of it. If we use ids, changes do not require any programmer support, but it becomes hard to program against unless you want code like itemStyleId == 5. We've been thinking over some ways to have the best of both worlds, and our favorite option right now is adding a string identifier that can be used to fetch an id. These strings would not be localized and would probably look a lot like the enum values. The designers could fill them out and we would keep them as stable as possible so code could fetch ids using them, or use them for equality checks, etc. But we're open to other ideas.

votan 07/12/17 01:27 AM

Quote:

Originally Posted by ZOS_ChipHilseberg (Post 31814)
These strings would not be localized and would probably look a lot like the enum values. The designers could fill them out and we would keep them as stable as possible so code could fetch ids using them, or use them for equality checks, etc. But we're open to other ideas.

Maybe let you inspire from the Enum of C# (not necessarily copy 1:1): Create a ZO_Enum sub-class with some meta methods like :GetNames, :Parse :GetName :GetDisplayName.
Instead of creating millions of global constants, an Enum class like ITEM_STYLE, ITEM_TRAIT, ABILITY.
In Lua there is close to no difference reading a continous index based list and an ID based hash-table:
Lua Code:
  1. for value,name in pairs(ITEM_STYLE) do
  2.   what ever
  3. end

The Enum classes may get auto-generated from work-sheets of your designers.

You may allow us to override and/or extend these Enum instances for things like :GetNameWithQualityColor.

Shinni 07/12/17 03:32 AM

@Ayantir, you might want to put the .txt in your post:
https://forums.elderscrollsonline.co...change-log-pts


@Chip
Quote:

3D Controls
3D controls with no parent that are positioned using world coordinates now update their position automatically when you cross a boundary. We also added two APIs to help convert between Gui Render 3D positions and World positions:

GuiRender3DPositionToWorldPosition(renderX, renderY, renderZ) – worldX, worldY, worldZ.
WorldPositionToGuiRender3DPosition(worldX, worldY, worldZ) – renderX, renderY, renderZ.
Thanks a lot! This is great.

Weolo 07/12/17 10:06 AM

Cool changes but it does mean I have some learning and re-writting to do, all good :cool:

I will be trying to make use of these

Code:

GetItemStyleName(styleId) – styleName
GetItemStyleMaterialLink(styleId, LinkStyle) – link
GetNumValidItemStyles() – numStyles
GetValidItemStyleId(index) – styleId

Will try these out, hopefully I can take out some of my code in place of them

Code:

GetSkillLineIndicesFromSkillId(skillId) – SkillType, skillIndex.
GetSkillLineIndicesFromSkillLineId(skillLineId) – SkillType, skillIndex.

Also the GetNonCombatBonus() function looks very handy

Code:

NON_COMBAT_BONUS_BLACKSMITHING_BOOSTER_BONUS
NON_COMBAT_BONUS_BLACKSMITHING_CRAFT_PERCENT_DISCOUNT
NON_COMBAT_BONUS_BLACKSMITHING_EXTRACT_LEVEL
NON_COMBAT_BONUS_BLACKSMITHING_HIRELING_LEVEL
NON_COMBAT_BONUS_BLACKSMITHING_LEVEL
NON_COMBAT_BONUS_BLACKSMITHING_RESEARCH_LEVEL
NON_COMBAT_BONUS_BLACKSMITHING_SHOW_NODES

Maybe I can finally detect when the research skill is changed

Rhyono 07/12/17 07:31 PM

Was GetSmithingStyleItemLink supposed to be removed? If so, could someone point me in the direction of its replacement?

Weolo 07/13/17 11:05 AM

Quote:

Originally Posted by Rhyono (Post 31842)
Was GetSmithingStyleItemLink supposed to be removed? If so, could someone point me in the direction of its replacement?

Did that used to give you a link to the style material?
If so this is the kind of thing
Lua Code:
  1. for itemStyleIndex = 1, GetNumValidItemStyles() do
  2.     local validItemStyleId = GetValidItemStyleId(itemStyleIndex)
  3.     if validItemStyleId > 0 then
  4.         local styleItemLink = GetItemStyleMaterialLink(validItemStyleId, LINK_STYLE_DEFAULT)
  5.     end
  6. end

Rhyono 07/13/17 08:22 PM

Thanks, that is what I needed. Still trying to fix the rest of the code now, though...

Also: Clockwork is a lie. It's in the books area, the items exist in the data, but the style and achievement do not.

Whoever transcribed the style names to GetItemStyleName() used the constants verbatim. E.g. Celestial is now called Craglorn which is...not good.

Is Mimic being in the valid style list as "Universal" intentional? If so, I'm going to have to write a work around to make that non-style not appear in CraftStore.

Weolo 07/14/17 11:24 AM

Yes I saw one of the style names from GetItemStyleName(validItemStyleId) was Craglorn which did not fit.

Ayantir 07/14/17 11:53 AM

Quote:

Event found on Wiki but not in ZOS ref -> EVENT_BANKED_TELVAR_STONES_UPDATE (integer eventCode,number newBankedTelvarStones,number oldBankedTelvarStones)
Event found on Wiki but not in ZOS ref -> EVENT_COLLECTIBLE_ON_COOLDOWN (number eventCode)
Event found on Wiki but not in ZOS ref -> EVENT_COLLECTIBLE_USE_BLOCKED (integer eventCode,number reason)
Event found on Wiki but not in ZOS ref -> EVENT_DIFFICULTY_LEVEL_CHANGED (integer eventCode,integer difficultyLevel)
Event found on Wiki but not in ZOS ref -> EVENT_SHOW_GUI (integer eventCode,string guiName,string desiredStateName)
Event found on Wiki but not in ZOS ref -> EVENT_ESO_PLUS_SUBSCRIPTION_NOTIFICATION_CLEARED (number eventCode)
Event found on Wiki but not in ZOS ref -> EVENT_ESO_PLUS_SUBSCRIPTION_STATUS_CHANGED (integer eventCode, boolean hasSubscription)
Event found on Wiki but not in ZOS ref -> EVENT_QUICK_REPORT_ALREADY_REPORTED (number eventCode)
Event found on Wiki but not in ZOS ref -> EVENT_QUICK_REPORT_TICKET_SENT (number eventCode)
New ZOS event -> EVENT_SMITHING_TRAIT_RESEARCH_CANCELED (integer eventCode, number craftingSkillType, number researchLineIndex, number traitIndex)
New ZOS event -> EVENT_BANKED_CURRENCY_UPDATE (integer eventCode, number currency, number newValue, number oldValue)
New ZOS event -> EVENT_SHOW_PREGAME_GUI_IN_STATE (integer eventCode, string desiredStateName)
New ZOS event -> EVENT_ESO_PLUS_FREE_TRIAL_STATUS_CHANGED (integer eventCode, boolean hasFreeTrial)
New ZOS event -> EVENT_CARRIED_CURRENCY_UPDATE (integer eventCode, number currency, number newValue, number oldValue, number reason)
New ZOS event -> EVENT_BATTLEGROUND_SHUTDOWN_TIMER (integer eventCode, boolean enabled)
New ZOS event -> EVENT_ESO_PLUS_FREE_TRIAL_NOTIFICATION_CLEARED (number eventCode)
New ZOS event -> EVENT_CRAFT_FAILED (integer eventCode, number tradeskillResult)
New ZOS event -> EVENT_BATTLEGROUND_KILL (integer eventCode, string killedPlayerCharacterName, string killedPlayerDisplayName, number killedPlayerBattlegroundAlliance, string killingPlayerCharacterName, string killingPlayerDisplayName, number killingPlayerBattlegroundAlliance, number battlegroundKillType)
In case of.

Weolo 07/14/17 12:14 PM

Oh no my brain only just kicked in, I am going to have to add code to my crafting addon to cover when someone cancels researching EVENT_SMITHING_TRAIT_RESEARCH_CANCELED durrr me

Ayantir 07/14/17 12:15 PM

About Methods of Controls :


ColorSelectControl
New: * GetThumbNormalizedPosition()
** _Returns:_ *number* _normalizedX_, *number* _normalizedY_
New: * SetThumbNormalizedPosition(*number* _normalizedX_, *number* _normalizedY_)



Control
Changed: * Set3DRenderSpaceOrigin(*number* _xM_, *number* _yM_, *number* _zM_)



LabelControl
New: * Clean()



TooltipControl
Changed: * SetSmithingStyleItem(*integer* _itemStyleId_)
New: * SetVerticalPadding(*number* _paddingY_)

Weolo 07/14/17 12:17 PM

Is there any point checking for EVENT_ESO_PLUS_SUBSCRIPTION_STATUS_CHANGED?
Would it be enough to just check IsESOPlusSubscriber() on player activation?

sirinsidiator 07/14/17 12:39 PM

I guess it could make sense if you got eso plus activated ingame like during the free eso+ event last weekend or if it ran out while you are ingame.

Btw @Chip, would it be possible to deactivate ESO+ on PTS and permanently add the activation thingy for 1 day of ESO+ to the crownstore there? Or instead of making it last only 1 day, add a second item to turn it off again.

Weolo 07/14/17 12:43 PM

Quote:

Originally Posted by sirinsidiator (Post 31879)
I guess it could make sense if you got eso plus activated ingame like during the free eso+ event last weekend or if it ran out while you are ingame.

Btw @Chip, would it be possible to deactivate ESO+ on PTS and permanently add the activation thingy for 1 day of ESO+ to the crownstore there? Or instead of making it last only 1 day, add a second item to turn it off again.

Maybe 2 free items on the store to turn on ESO+ and another to turn it off


All times are GMT -6. The time now is 05:17 AM.

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