Thread: 3.1 Update
View Single Post
07/12/17, 01:27 AM   #8
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by ZOS_ChipHilseberg View Post
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.
  Reply With Quote