From b877bcffc55d2a64018c9ee8a812edd45b936077 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Tue, 6 May 2025 17:12:38 -0500 Subject: [PATCH] use extra space when there is no scrollbar in shop window --- src/game/boe.actions.cpp | 4 ++++ src/game/boe.dlgutil.cpp | 1 + src/game/boe.newgraph.cpp | 1 + 3 files changed, 6 insertions(+) diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index a72a37e1..ff5d7eb8 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -157,6 +157,10 @@ void init_shopping_rects(bool scrollbar) { shopping_rects[0][SHOPRECT_ITEM_HELP].bottom -= 21; shopping_rects[0][SHOPRECT_ITEM_HELP].right -= 19; shopping_rects[0][SHOPRECT_ITEM_HELP].left = shopping_rects[0][SHOPRECT_ITEM_HELP].right - 14; + // Utilize the extra space on the right side if no scrollbar is shown + int offset_right = scrollbar ? -4 : 12; + shopping_rects[0][SHOPRECT_ITEM_COST].offset(offset_right, 0); + shopping_rects[0][SHOPRECT_ITEM_HELP].offset(offset_right, 0); // Define rectangles for the next 7 rows by copying and offsetting for(short i = 1; i < 8; i++) { diff --git a/src/game/boe.dlgutil.cpp b/src/game/boe.dlgutil.cpp index e964931f..14006818 100644 --- a/src/game/boe.dlgutil.cpp +++ b/src/game/boe.dlgutil.cpp @@ -476,6 +476,7 @@ void handle_sale(int i) { // This looks to be redundant, but I'm just preserving the previous behavior of the code. set_up_shop_array(); + init_shopping_rects(shop_sbar->getMaximum() > 0); draw_shop_graphics(false,false,{}); // When buying from a healer, we want to select the next PC who needs healing diff --git a/src/game/boe.newgraph.cpp b/src/game/boe.newgraph.cpp index 80ed5422..c6691143 100644 --- a/src/game/boe.newgraph.cpp +++ b/src/game/boe.newgraph.cpp @@ -857,6 +857,7 @@ void draw_shop_graphics(bool item_pressed, bool item_help_pressed, rectangle cli rectangle cost_rect = shopping_rects[i][SHOPRECT_ITEM_COST]; cost_rect.left = cost_rect.right - string_length(cur_name, style) - 10; win_draw_string(talk_gworld(),cost_rect,cur_name,eTextMode::WRAP,style); + // Draw the coin cost_rect.left = cost_rect.right - 7; cost_rect.top += 3; cost_rect.height() = 7;