#pragma once #include "anm2.h" #include constexpr const char* ONLINE_EMOTES_ANM2 = "gfx/OnlineEmotes.anm2"; // The emotes a player can show, by the animation each plays in OnlineEmotes.anm2. // The die rolls show their result on a frame of the result animation, each face its own emote. // Nicalis plays one of its frames the same way. enum Emote : int { EMOTE_UP, EMOTE_DOWN, EMOTE_LEFT, EMOTE_RIGHT, EMOTE_HAPPY, EMOTE_SAD, EMOTE_THUMBS_UP, EMOTE_THUMBS_DOWN, EMOTE_HEART, EMOTE_BOMB, EMOTE_COIN, EMOTE_KEY, EMOTE_TINTED_ROCK, EMOTE_ANGEL, EMOTE_DEVIL, EMOTE_POOP, EMOTE_RAISE_HAND, EMOTE_QUESTION_MARK, EMOTE_D6, EMOTE_D20, EMOTE_RESET, EMOTE_TYPING, EMOTE_D6_ROLL, EMOTE_D20_ROLL = EMOTE_D6_ROLL + 6, EMOTE_NICALIS = EMOTE_D20_ROLL + 20, EMOTE_COUNT = EMOTE_NICALIS + 11, EMOTE_NONE = 60 }; // Where the emote wheel is in opening and closing. enum EmoteWheelState : int { EMOTE_WHEEL_CLOSED, EMOTE_WHEEL_OPENING, EMOTE_WHEEL_OPEN, EMOTE_WHEEL_CLOSING }; // Construction, copies and destruction (0042fa30, 0042fac0) are the defaults. // An emote shown over a player or on the wheel (OnlineEmotes): the emote in its bubble, or dots while its player types. // It plays for a duration in frames, or until replaced when that is 0. class OnlineEmotes { public: ANM2 bubbleSprite; ANM2 emoteSprite; Emote emote = EMOTE_NONE; int duration = 0; int timer = 0; bool isActive = false; bool isBubbleShown = true; void Load(); void Play(Emote shown, int frames); void Update(); void Render(Vector position); }; // Construction and destruction (008d1d20) are the defaults. // The online emote wheel (EmoteWheel): two sets of emotes laid out around a ring that opens and closes from the // screen center, the emote the stick points at, and the emote drawing each one. // The ring radii are those of the ring and selection images the open wheel draws. class EmoteWheel { public: std::vector> emoteSets; OnlineEmotes emote; EmoteWheelState state = EMOTE_WHEEL_CLOSED; float angleStep = 0; float innerRadius = 70; float maxRadius = 110; float openProgress = 0; float ringRadius = 0; float selectionRadius = 0; int emoteSetIndex = 0; int selection = -1; bool isInitialized = false; void Init(); void SetEmoteSet(int index); void Update(); void Render(); private: void angle_step_update(); };