isle-portable/extensions/include/extensions/common/animdata.h
foxtacles 569c8b467b
Separate extensions (#18)
* WIP

* WIP

* Make camera the single source of truth for broadcast state

Remove redundant local copies of walkAnimId, idleAnimId, and
displayActorIndex from NetworkManager. BroadcastLocalState now reads
these from the camera's Controller, eliminating dual-copy sync issues.

Additional cleanup:
- Early-return on null cam in SendEmote/HandleCustomize for clarity
- Only consume camera-dependent pending requests when cam is available
- Move local name bubble creation from BroadcastLocalState to Tickle
- Remove dead NetworkManager::SetDisplayActorIndex method

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix clang format

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:12:07 +01:00

53 lines
1.5 KiB
C++

#pragma once
#include "extensions/common/constants.h"
#include <cstdint>
class LegoPathActor;
namespace Extensions
{
namespace Common
{
// Animation and vehicle tables (defined in animdata.cpp)
extern const char* const g_walkAnimNames[];
extern const int g_walkAnimCount;
extern const char* const g_idleAnimNames[];
extern const int g_idleAnimCount;
// Per-phase emote data: animation name and optional sound effect.
struct EmotePhase {
const char* anim; // Animation name (nullptr = unused phase)
const char* sound; // Sound key for LegoCacheSoundManager (nullptr = silent)
};
// Emote table entry: two phases (phase 1 = primary, phase 2 = recovery for multi-part emotes).
struct EmoteEntry {
EmotePhase phases[2];
};
extern const EmoteEntry g_emoteEntries[];
extern const int g_emoteAnimCount;
// Returns true if the emote is a multi-part stateful emote (has a phase-2 animation).
inline bool IsMultiPartEmote(uint8_t p_emoteId)
{
return p_emoteId < g_emoteAnimCount && g_emoteEntries[p_emoteId].phases[1].anim != nullptr;
}
extern const char* const g_vehicleROINames[VEHICLE_COUNT];
extern const char* const g_rideAnimNames[VEHICLE_COUNT];
extern const char* const g_rideVehicleROINames[VEHICLE_COUNT];
// Returns true if the vehicle type has no ride animation (model swap instead)
bool IsLargeVehicle(int8_t p_vehicleType);
// Detect the vehicle type of a given actor, or VEHICLE_NONE if not a vehicle
int8_t DetectVehicleType(LegoPathActor* p_actor);
} // namespace Common
} // namespace Extensions