5#include "absl/strings/str_format.h"
10#include "imgui/imgui.h"
24 case EntityType::kEntrance:
26 case EntityType::kExit:
28 case EntityType::kItem:
30 case EntityType::kSprite:
42 return ImVec4{theme.status_active.x, theme.status_active.y,
43 theme.status_active.z, 0.5f};
55 if (each.map_id_ < 0x40 + (current_world * 0x40) &&
56 each.map_id_ >= (current_world * 0x40) && !each.deleted) {
58 MarkerColor(EntityType::kEntrance, each.is_hole_));
75 if (each.map_id_ < 0x40 + (current_world * 0x40) &&
76 each.map_id_ >= (current_world * 0x40) && !each.deleted_) {
78 MarkerColor(EntityType::kExit));
93 if (item.room_map_id_ < 0x40 + (current_world * 0x40) &&
94 item.room_map_id_ >= (current_world * 0x40) && !item.deleted) {
96 MarkerColor(EntityType::kItem));
100 std::string item_name =
"";
104 item_name = absl::StrFormat(
"0x%02X", item.id_);
112 int current_world,
int game_state) {
114 if (!sprite.deleted() && sprite.map_id() < 0x40 + (current_world * 0x40) &&
115 sprite.map_id() >= (current_world * 0x40)) {
116 int sprite_x = sprite.x_;
117 int sprite_y = sprite.y_;
120 MarkerColor(EntityType::kSprite));
134 gui::DrawText(rt, absl::StrFormat(
"%s", sprite.name()), sprite_x,
151 if (each.map_id_ < 0x40 + (current_world * 0x40) &&
152 each.map_id_ >= (current_world * 0x40) && !each.deleted) {
154 MarkerColor(EntityType::kEntrance, each.is_hole_));
167 int current_world,
int current_mode) {
175 if (each.map_id_ < 0x40 + (current_world * 0x40) &&
176 each.map_id_ >= (current_world * 0x40) && !each.deleted_) {
178 MarkerColor(EntityType::kExit));
197 if (item.room_map_id_ < 0x40 + (current_world * 0x40) &&
198 item.room_map_id_ >= (current_world * 0x40) && !item.deleted) {
200 MarkerColor(EntityType::kItem));
207 std::string item_name =
"";
211 item_name = absl::StrFormat(
"0x%02X", item.id_);
225 if (!sprite.deleted() && sprite.map_id() < 0x40 + (current_world * 0x40) &&
226 sprite.map_id() >= (current_world * 0x40)) {
229 int sprite_x = sprite.x_;
230 int sprite_y = sprite.y_;
233 int original_x = sprite.x_;
234 int original_y = sprite.y_;
237 MarkerColor(EntityType::kSprite));
254 sprite.x_ = original_x;
255 sprite.y_ = original_y;
273 int map_x = (current_map % 8) * 32;
274 int map_y = (current_map / 8) * 32;
277 for (
int ty = 0; ty < 32; ++ty) {
278 for (
int tx = 0; tx < 32; ++tx) {
279 int world_tx = map_x + tx;
280 int world_ty = map_y + ty;
284 if (world_ty >= 256 || world_tx >= 256) {
288 uint16_t tile_id = map_tiles[world_ty][world_tx];
291 if (diggable_tiles.IsDiggable(tile_id)) {
293 int pixel_x = world_tx * 16;
294 int pixel_y = world_ty * 16;
zelda3::GameEntity * hovered_entity_
void DrawDiggableTileHighlights(int current_world, int current_map)
Draw highlights for all diggable tiles on the current map.
zelda3::Overworld * overworld_
void DrawItems(const gui::CanvasRuntime &rt, int current_world)
void DrawExits(const gui::CanvasRuntime &rt, int current_world)
void DrawSprites(const gui::CanvasRuntime &rt, int current_world, int game_state)
void DrawEntrances(const gui::CanvasRuntime &rt, int current_world)
std::vector< gfx::Bitmap > * sprite_previews_
bool show_diggable_tiles_
void DrawBitmap(Bitmap &bitmap, int border_offset, float scale)
auto global_scale() const
void DrawRect(int x, int y, int w, int h, ImVec4 color)
void DrawText(const std::string &text, int x, int y)
auto mutable_sprites(int state)
const DiggableTiles & diggable_tiles() const
const std::vector< OverworldEntrance > & entrances() const
OverworldBlockset & GetMapTiles(int world_type)
const AgentUITheme & GetTheme()
ImVec4 MarkerColor(EntityType type, bool is_hole=false)
ImVec4 GetDiggableTileColor()
ImVec4 EntityMarkerColor(const AgentUITheme &theme, EntityType type, bool is_hole)
EntityType
Type of entity that can be selected in the dungeon editor.
bool IsMouseHoveringOverEntity(const zelda3::GameEntity &entity, ImVec2 canvas_p0, ImVec2 scrolling, float scale)
Check if mouse is hovering over an entity.
void DrawRect(const CanvasRuntime &rt, int x, int y, int w, int h, ImVec4 color)
void DrawText(const CanvasRuntime &rt, const std::string &text, int x, int y)
std::string HexByte(uint8_t byte, HexStringParams params)
const std::vector< std::string > kSecretItemNames
bool kDrawOverworldSprites
struct yaze::core::FeatureFlags::Flags::Overworld overworld
Centralized theme colors for Agent UI components.