Skip to content

hkb_editor.hkb.hk2014_enums

Enum and flag constants as they appear in hk2014 packfile xml.

hk2018 tagfiles store enums and flags as plain integers, but hk2014 packfiles write them as symbolic constants. The converter needs to be able to map between the two, which requires the names of the constants.

The values are taken from hkb_enums and hkb_flags, this module only adds the naming scheme that hk2014 uses for the members. Usually this is a prefix in front of the member name (e.g. START_STATE_MODE_DEFAULT for hkbStateMachine::StartStateMode.DEFAULT), but the custom (FromSoftware) enums are written in CamelCase (IdleCategory). Enums that aren't listed here are not converted, the converter will fall back to keeping their values as strings.

ConstantTable

Bidirectional mapping between hk2014 constants and their integer values.

format

format(value: int) -> str | None

Convert an integer to its symbolic representation. None if it fails.

parse

parse(text: str) -> int | None

Convert the symbolic representation to an integer. None if it fails.

Ko-fi donations