-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Enum attributes can be access either via the key or the value of the corresponding enum, right now we are only using the value. This results in some annoying behaviour:
---@type tiletype
local ttype = dfhack.maps.getTileType(engraving.pos)
local tileattrs = df.tiletype.attrs[ttype] -- Cast as `unknown` even though this is a valid index.The biggest issue is going to be figuring out how to do this without doubling the size of enums (again):
---@field FrozenRampTrackNEW { caption: "ice ramp track NEW", shape: "RAMP", material: "FROZEN_LIQUID", variant: "NONE", special: "TRACK", direction: "NEW" }```Would change into:
---@field FrozenRampTrackNEW { caption: "ice ramp track NEW", shape: "RAMP", material: "FROZEN_LIQUID", variant: "NONE", special: "TRACK", direction: "NEW" }
---@field [677] { caption: "ice ramp track NEW", shape: "RAMP", material: "FROZEN_LIQUID", variant: "NONE", special: "TRACK", direction: "NEW" }For enums with hundreds of attributes, it is less than ideal.
Metadata
Metadata
Assignees
Labels
No labels