From 3aaa414f0780ada6cf375304b0080f69f907e33f Mon Sep 17 00:00:00 2001 From: Eric Robinson <68359262+kphoenix137@users.noreply.github.com> Date: Sat, 12 Apr 2025 12:02:03 -0400 Subject: [PATCH] Draw Hotkeys on Belt (#7911) --- Source/inv.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/inv.cpp b/Source/inv.cpp index 327fa4a06..5b9a461c5 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -1297,7 +1297,15 @@ void DrawInvBelt(const Surface &out) if (myPlayer.SpdList[i].isUsable() && myPlayer.SpdList[i]._itype != ItemType::Gold) { - DrawString(out, StrCat(i + 1), { position - Displacement { 0, 12 }, InventorySlotSizeInPixels }, + auto beltKey = StrCat("BeltItem", i + 1); + std::string_view keyName = ControlMode == ControlTypes::Gamepad + ? GetOptions().Padmapper.InputNameForAction(beltKey, true) + : GetOptions().Keymapper.KeyNameForAction(beltKey); + + if (keyName.length() > 2) + keyName = {}; + + DrawString(out, keyName, { position - Displacement { 0, 12 }, InventorySlotSizeInPixels }, { .flags = UiFlags::ColorWhite | UiFlags::AlignRight }); } }