EventCatalog.h file
Namespaces
- namespace Jazz2
- Root namespace of Jazz² Resurrection.
- namespace Jazz2::Editor
- namespace Jazz2::Editor::EventCatalogParts
Classes
- struct Jazz2::Editor::CatalogText
- Text of a description of an event, a literal is shown as it is, a text translated by
_x()is kept. - struct Jazz2::Editor::ParamOption
- Option of a parameter of the type ParamType::Enum or ParamType::Flags.
- struct Jazz2::Editor::FieldMirror
- How a value changes when its event is mirrored one way.
- struct Jazz2::Editor::EventParamField
- Parameter of an event, a value stored in the 16 bytes of parameters of the event.
- struct Jazz2::Editor::EventPreviewCase
- How an event looks for a value of one of its parameters, see EventDescriptor::
PreviewCases. - struct Jazz2::Editor::EventDescriptor
- Description of an event, how it's shown and how its parameters are edited.
- struct Jazz2::Editor::EventExtensionError
- A description of an event from outside of the game that couldn't be used, see EventCatalog::
GetExtensionErrors(). - class Jazz2::Editor::EventCatalog
- All events the editor knows, how they are shown and how their parameters are edited.
Enums
-
enum class EventCategory : std::
uint8_t { Basic, Scenery, Modifier, Area, Trigger, Warp, Light, Environment, Enemy, Boss, Collectible, Container, Other, Count } - Category of an event, the picker groups events by it.
-
enum class ParamType : std::
uint8_t { UInt, Int, Bool, Enum, Flags, EventType, TextId, TriggerId, WarpId, String, Raw, Contents } - How a parameter of an event is edited.
-
enum class ParamUnit : std::
uint8_t { None, Pixels, Tiles, Frames, Seconds, Percent, Degrees } - Unit of a parameter, shown next to its value.
-
enum class FieldCondition : std::
uint8_t { Equals, NotEquals, AnyBits } - How the value of another field decides whether a field is shown, see EventParamField::
VisibleIfField. -
enum class MirrorMode : std::
uint8_t { None, Negate, Toggle, Swap, SwapField } - What mirroring an event does to a value, see EventCatalog::
MirrorParams(). -
enum class FieldGizmo : std::
uint8_t { None, Radius, LengthDown, WidthRight, OffsetX, OffsetY } - A handle in the level that changes a value, see EventGizmos.
-
enum class EventLinkRole : std::
uint8_t { None, Source, Target, Peer } - What a link of an event to others with the same value is, see EventPreviews::
CollectLinks(). -
enum class DirectionAxis : std::
uint8_t { None, X, Y } - Axis a value points an arrow along, see EventPreviews::
CollectDirections(). -
enum class EventTraits : std::
uint16_t { None = 0, TileModifier = 0x01, Area = 0x02, Object = 0x04, Unused = 0x08, MultiplayerOnly = 0x10 } - What an event is, helps the editor to show and check it.
-
enum class EventExtensionScope : std::
uint8_t { Global, Level } - Where descriptions of events from outside of the game come from, see EventCatalog::
LoadExtensions().
Functions
-
auto UIntField(CatalogText name,
std::
uint8_t offset, std:: uint8_t bits, std:: int32_t min, std:: int32_t max, std:: int32_t defaultValue = 0, std:: uint8_t shift = 0) -> EventParamField constexpr - Unsigned number of
bitsbits at the byteoffset, starting at the bitshift. -
auto IntField(CatalogText name,
std::
uint8_t offset, std:: uint8_t bits, std:: int32_t min, std:: int32_t max, std:: int32_t defaultValue = 0, std:: uint8_t shift = 0) -> EventParamField constexpr - Signed number of
bitsbits at the byteoffset. -
auto BoolField(CatalogText name,
std::
uint8_t offset, std:: uint8_t bit = 0, bool defaultValue = false) -> EventParamField constexpr - Yes or no, the bit
bitof the byteoffset. -
template<std::auto EnumField(CatalogText name, std::
size_t N> uint8_t offset, std:: uint8_t bits, const ParamOption(&options)[N], std:: int32_t defaultValue = 0, std:: uint8_t shift = 0) -> EventParamField constexpr - One of the options,
bitsbits at the byteoffset. -
template<std::auto FlagsField(CatalogText name, std::
size_t N> uint8_t offset, std:: uint8_t bits, const ParamOption(&options)[N], std:: int32_t defaultValue = 0, std:: uint8_t shift = 0) -> EventParamField constexpr - Any of the options, each a bit of
bitsbits at the byteoffset. -
auto EventTypeField(CatalogText name,
std::
uint8_t offset, std:: int32_t defaultValue = 0) -> EventParamField constexpr - Another event, 16 bits at the byte
offset. -
auto TextIdField(CatalogText name,
std::
uint8_t offset, std:: int32_t defaultValue = 0) -> EventParamField constexpr - Index of a level text, 8 bits at the byte
offset. -
auto TriggerIdField(CatalogText name,
std::
uint8_t offset, std:: int32_t defaultValue = 0) -> EventParamField constexpr - Index of a trigger, 8 bits at the byte
offset. -
auto WarpIdField(CatalogText name,
std::
uint8_t offset, std:: uint8_t bits = 8, std:: int32_t defaultValue = 0) -> EventParamField constexpr - Identifier of a warp,
bitsbits at the byteoffset. -
auto StringField(CatalogText name,
std::
uint8_t offset, std:: uint8_t length) -> EventParamField constexpr - Text of
lengthbytes starting at the byteoffset. -
auto ContentsField(CatalogText name,
std::
uint8_t offset, std:: uint8_t length, std:: int8_t typeField) -> EventParamField constexpr - Parameters of another event inside this one,
lengthbytes from the byteoffset. -
auto DescribeEvent(EventType type,
const char* key,
CatalogText name,
EventCategory category,
CatalogText description,
const char* previewMetadata,
std::
uint32_t previewAnimation, EventTraits traits) -> EventDescriptor constexpr - Description of an event without parameters.
-
template<std::auto DescribeEvent(EventType type, const char* key, CatalogText name, EventCategory category, CatalogText description, const EventParamField(&fields)[N], const char* previewMetadata, std::
size_t N> uint32_t previewAnimation, EventTraits traits) -> EventDescriptor constexpr - Description of an event with parameters.
- auto GetBasicEvents() -> ArrayView<const EventDescriptor>
- auto GetAreaEvents() -> ArrayView<const EventDescriptor>
- auto GetEnvironmentEvents() -> ArrayView<const EventDescriptor>
- auto GetEnemyEvents() -> ArrayView<const EventDescriptor>
- auto GetItemEvents() -> ArrayView<const EventDescriptor>
Enum documentation
enum class EventCategory : std:: uint8_t
Category of an event, the picker groups events by it.
| Enumerators | |
|---|---|
| Basic |
Starts and checkpoints |
| Scenery |
Destructible and collapsing tiles |
| Modifier |
What a tile does — vines, poles, hurting... |
| Area |
What happens in an area |
| Trigger |
Triggers |
| Warp |
Warps |
| Light |
Lights |
| Environment |
Springs, platforms and other objects |
| Enemy |
Enemies |
| Boss |
Bosses |
| Collectible |
Things to collect |
| Container |
Crates, barrels and monitors |
| Other |
Anything else |
| Count |
|
enum class ParamType : std:: uint8_t
How a parameter of an event is edited.
| Enumerators | |
|---|---|
| UInt |
Unsigned number |
| Int |
Signed number |
| Bool |
Yes or no |
| Enum |
One of the options |
| Flags |
Any of the options, each option is a bit |
| EventType |
Another event, 16 bits |
| TextId |
Index of a level text |
| TriggerId |
Index of a trigger, 0 to 31 |
| WarpId |
Identifier of a warp, a warp origin goes to the target with the same one |
| String |
Text of the given number of bytes, padded with zeros |
| Raw |
Bytes shown as they are |
| Contents |
Parameters of another event inside this one, as a crate has them, see EventParamField:: |
enum class FieldCondition : std:: uint8_t
How the value of another field decides whether a field is shown, see EventParamField::
| Enumerators | |
|---|---|
| Equals |
The value is the given one |
| NotEquals |
The value isn't the given one |
| AnyBits |
Any of the given bits is set |
enum class MirrorMode : std:: uint8_t
What mirroring an event does to a value, see EventCatalog::
| Enumerators | |
|---|---|
| None |
The value stays |
| Negate |
The value turns negative, as a speed or an offset; a value whose negation is out of the range stays, so mirroring twice always gives it back |
| Toggle |
A yes becomes a no and the other way, as facing left |
| Swap |
Values, or bits of flags, are swapped in pairs, see FieldMirror:: |
| SwapField |
The value is swapped with another field, as a belt to the left with one to the right |
enum class FieldGizmo : std:: uint8_t
A handle in the level that changes a value, see EventGizmos.
| Enumerators | |
|---|---|
| None |
|
| Radius |
A distance from the event in any direction |
| LengthDown |
A distance below the event, as a chain hangs |
| WidthRight |
A distance to the right of the event, as a bridge goes |
| OffsetX |
A horizontal offset from the center of the tile, paired with the next OffsetY field |
| OffsetY |
The vertical offset paired with an OffsetX field |
enum class EventLinkRole : std:: uint8_t
What a link of an event to others with the same value is, see EventPreviews::
| Enumerators | |
|---|---|
| None |
|
| Source |
It acts on the targets, as a warp origin or a trigger crate |
| Target |
It's acted on, as a warp target or a trigger area |
| Peer |
It's linked to the others without a direction |
enum class DirectionAxis : std:: uint8_t
Axis a value points an arrow along, see EventPreviews::
| Enumerators | |
|---|---|
| None |
|
| X |
Horizontal, positive to the right |
| Y |
Vertical, positive down |
enum class EventTraits : std:: uint16_t
What an event is, helps the editor to show and check it.
| Enumerators | |
|---|---|
| None |
|
| TileModifier |
Changes the tile it's placed on, it's not an object |
| Area |
Acts on the area of its tile, it's not an object |
| Object |
Spawns an object |
| Unused |
Not used by the game, kept only so levels that have it load |
| MultiplayerOnly |
Means something only in multiplayer |
enum class EventExtensionScope : std:: uint8_t
Where descriptions of events from outside of the game come from, see EventCatalog::
| Enumerators | |
|---|---|
| Global |
Event packs in |
| Level |
The script of the level being edited |
Function documentation
EventParamField ContentsField(CatalogText name,
std:: uint8_t offset,
std:: uint8_t length,
std:: int8_t typeField) constexpr
Parameters of another event inside this one, length bytes from the byte offset.
The type of the event inside is in the field of the index typeField, its own parameters are edited shifted by offset bytes, see EventCatalog::