From 327c2bec70aeb39be743abe07f478ad803c2bb59 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Mon, 7 Sep 2026 22:34:02 -0500 Subject: [PATCH] Show map name in the debug player position overlay Useful now that multiple maps can be loaded, to tell which map the printed coordinates belong to. --- src/dusk/ui/debug/uiplayerpos.c | 4 +++- src/dusk/ui/debug/uiplayerpos.h | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dusk/ui/debug/uiplayerpos.c b/src/dusk/ui/debug/uiplayerpos.c index ad430075..ce7972c2 100644 --- a/src/dusk/ui/debug/uiplayerpos.c +++ b/src/dusk/ui/debug/uiplayerpos.c @@ -13,6 +13,7 @@ #include "rpg/entity/entity.h" #include "rpg/entity/entitytype.h" #include "rpg/overworld/worldpos.h" +#include "rpg/overworld/map.h" uiplayerpos_t UIPLAYERPOS; @@ -46,7 +47,8 @@ errorret_t uiPlayerPosDraw() { stringFormat( UIPLAYERPOS.text, UI_PLAYERPOS_TEXT_MAX - 1, - "%d,%d,%d[%d,%d,%d]#%d", + "%s %d,%d,%d[%d,%d,%d]#%d", + MAP.name, (int_t)player->position.x, (int_t)player->position.y, (int_t)player->position.z, diff --git a/src/dusk/ui/debug/uiplayerpos.h b/src/dusk/ui/debug/uiplayerpos.h index ed84ea6b..1fb03ff7 100644 --- a/src/dusk/ui/debug/uiplayerpos.h +++ b/src/dusk/ui/debug/uiplayerpos.h @@ -28,9 +28,9 @@ extern uiplayerpos_t UIPLAYERPOS; errorret_t uiPlayerPosInit(); /** - * Draws the player world position, chunk position, and chunk index on - * screen. Searches for the first ENTITY_TYPE_PLAYER and renders: - * WORLDX,WORLDY,WORLDZ[chunkx,chunky,chunkz]#chunkIndex + * Draws the current map name, player world position, chunk position, and + * chunk index on screen. Searches for the first ENTITY_TYPE_PLAYER and + * renders: MAPNAME WORLDX,WORLDY,WORLDZ[chunkx,chunky,chunkz]#chunkIndex * * @return Any error that occurs. */