#pragma once #include "anm2.h" #include "kage_graphics.h" #include // How the map shows: the small one in the corner, the large one while the map button is held, or the large one left // open by a tap. enum MinimapState : int { MINIMAP_SMALL, MINIMAP_HELD, MINIMAP_PINNED }; // The two maps, by their index in Minimap::configs. enum MinimapSize : int { MINIMAP_SIZE_SMALL, MINIMAP_SIZE_LARGE, MINIMAP_SIZE_COUNT }; // Copies and destruction are the defaults. // One of the two maps (MinimapConfig): its frame sheet, the surface the rooms are drawn on, the room cell size and the // gap between cells, how many cells fit across and down, the margin around them, the room icons' size and how many // a cell shows, the point of the surface the map centers on, the drawn rooms' bounds and its alpha. struct MinimapConfig { ANM2 mapSprite; KAGE::Graphics::ImagePtr surface; Vector boundsMax{}; Vector boundsMin{}; Vector cellSize{}; Vector center{}; Vector iconSize{}; float alpha = 0; float gap = 0; float margin = 0; int columns = 0; int iconLimit = 0; int rows = 0; void refresh(); }; // Destruction (0098b1d0) is the default. // The floor map (Minimap): the small and large maps, how long the map button is held, the item and curse icons beside // the map, the question mark the curse of the lost shows instead, the shake when it is hit, and the time and score // written under it. largeMapOffset and largeMapScale move and shrink the large map's surface. class Minimap { public: std::array configs; KAGE::Graphics::ImagePtr questionMarkImage; ANM2 hudPickupSprite; ANM2 iconsSprite; ANM2 itemIconsSprite; Vector largeMapOffset{}; Vector shakeOffset{}; MinimapState state = MINIMAP_SMALL; float largeMapScale = 1; int holdTime = 0; int shakeDuration = 0; bool isPinned = false; void Init(); void Refresh(); void Update(); void Render(); Vector GetDisplayedSize(); private: bool state_update(bool isHeld); void render_small(float alpha, bool isLost); void render_large(float alpha, bool isLost); void render_icons(Vector position, float alpha); void render_score_time(float alpha); };