From 527e876fffc28771344041abef93dc9950c1162b Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sun, 22 Jan 2023 14:31:01 +0000 Subject: [PATCH] Disable item labels when in store Also disable ground item outlines on hover when in store. --- Source/engine/render/scrollrt.cpp | 2 +- Source/qol/itemlabels.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Source/engine/render/scrollrt.cpp b/Source/engine/render/scrollrt.cpp index db3c77277..ee8fee8c7 100644 --- a/Source/engine/render/scrollrt.cpp +++ b/Source/engine/render/scrollrt.cpp @@ -650,7 +650,7 @@ void DrawItem(const Surface &out, Point tilePosition, Point targetBufferPosition const ClxSprite sprite = item.AnimInfo.currentSprite(); int px = targetBufferPosition.x - CalculateWidth2(sprite.width()); const Point position { px, targetBufferPosition.y }; - if (bItem - 1 == pcursitem || AutoMapShowItems) { + if (stextflag == STORE_NONE && (bItem - 1 == pcursitem || AutoMapShowItems)) { ClxDrawOutlineSkipColorZero(out, GetOutlineColor(item, false), position, sprite); } ClxDrawLight(out, position, sprite); diff --git a/Source/qol/itemlabels.cpp b/Source/qol/itemlabels.cpp index 4d7a03a9f..a05704cdc 100644 --- a/Source/qol/itemlabels.cpp +++ b/Source/qol/itemlabels.cpp @@ -15,6 +15,7 @@ #include "inv.h" #include "options.h" #include "qol/stash.h" +#include "stores.h" #include "utils/format_int.hpp" #include "utils/language.h" #include "utils/stdcompat/string_view.hpp" @@ -90,7 +91,7 @@ void ResetItemlabelHighlighted() bool IsHighlightingLabelsEnabled() { - return altPressed != *sgOptions.Gameplay.showItemLabels; + return stextflag == STORE_NONE && altPressed != *sgOptions.Gameplay.showItemLabels; } void AddItemToLabelQueue(int id, Point position) @@ -186,13 +187,18 @@ void DrawItemNameLabels(const Surface &out) Item &item = Items[label.id]; if (MousePosition.x >= label.pos.x && MousePosition.x < label.pos.x + label.width && MousePosition.y >= label.pos.y + MarginY && MousePosition.y < label.pos.y + MarginY + Height) { - if (!gmenu_is_active() && PauseMode == 0 && !MyPlayerIsDead && IsMouseOverGameArea() && LastMouseButtonAction == MouseActionType::None) { + if (!gmenu_is_active() + && PauseMode == 0 + && !MyPlayerIsDead + && stextflag == STORE_NONE + && IsMouseOverGameArea() + && LastMouseButtonAction == MouseActionType::None) { isLabelHighlighted = true; cursPosition = item.position; pcursitem = label.id; } } - if (pcursitem == label.id) + if (pcursitem == label.id && stextflag == STORE_NONE) FillRect(clippedOut, label.pos.x, label.pos.y + MarginY, label.width, Height, PAL8_BLUE + 6); else DrawHalfTransparentRectTo(clippedOut, label.pos.x, label.pos.y + MarginY, label.width, Height);