#pragma once #include "anm2.h" #include "font.h" #include #include #include #include // What a rich text icon shows, each but the collectible an animation of gfx/ui/text_icons.anm2. enum RichTextIconType : int { ICON_PLAYER, ICON_PICKUP, ICON_COLLECTIBLE, ICON_ROOM }; // The icons rich text draws inline from gfx/ui/text_icons.anm2: the sprite, the height icons are fit to, the icon last // set and the collectible images loaded for it so far. // Its drawing (render, get_size, set_icon) waits on the ANM2 and graphics rework and is not reconstructed yet. struct RichTextIcon : ANM2 { std::map images; float maxHeight = 0; int iconId = 0; RichTextIconType iconType = ICON_PLAYER; static std::string_view get_animation_name(RichTextIconType type); }; // Text drawn in a font with icons inline (hearts, pickups, collectibles, rooms), its lines spaced by lineSpacing. // Its layout and drawing (rich_text_layout, rich_text_render) are not reconstructed yet. // Destruction (009efa10) is the default: the font unloads and the icons go with their pointer. struct RichText { Font font; std::string fontPath; std::unique_ptr icons; float lineSpacing = 1; void load_font(std::string_view path); };