Browse Source

Make item graphics in stores optional

pull/5697/head
staphen 3 years ago committed by Anders Jenbo
parent
commit
d707f07e8f
  1. 2
      Source/options.cpp
  2. 2
      Source/options.h
  3. 4
      Source/stores.cpp

2
Source/options.cpp

@ -939,6 +939,7 @@ GraphicsOptions::GraphicsOptions()
#endif
, limitFPS("FPS Limiter", OptionEntryFlags::None, N_("FPS Limiter"), N_("FPS is limited to avoid high CPU load. Limit considers refresh rate."), true)
, showFPS("Show FPS", OptionEntryFlags::None, N_("Show FPS"), N_("Displays the FPS in the upper left corner of the screen."), false)
, showItemGraphicsInStores("Show Item Graphics in Stores", OptionEntryFlags::None, N_("Show Item Graphics in Stores"), N_("Show item graphics to the left of item desriptions in store menus."), false)
, showHealthValues("Show health values", OptionEntryFlags::None, N_("Show health values"), N_("Displays current / max health value on health globe."), false)
, showManaValues("Show mana values", OptionEntryFlags::None, N_("Show mana values"), N_("Displays current / max mana value on mana globe."), false)
{
@ -976,6 +977,7 @@ std::vector<OptionEntryBase *> GraphicsOptions::GetEntries()
&zoom,
&limitFPS,
&showFPS,
&showItemGraphicsInStores,
&showHealthValues,
&showManaValues,
&colorCycling,

2
Source/options.h

@ -505,6 +505,8 @@ struct GraphicsOptions : OptionCategoryBase {
#endif
/** @brief Enable FPS Limiter. */
OptionEntryBoolean limitFPS;
/** @brief Show item graphics to the left of item desriptions in store menus. */
OptionEntryBoolean showItemGraphicsInStores;
/** @brief Show FPS, even without the -f command line flag. */
OptionEntryBoolean showFPS;
/** @brief Display current/max health values on health globe. */

4
Source/stores.cpp

@ -2288,7 +2288,7 @@ void PrintSString(const Surface &out, int margin, int line, string_view text, Ui
const int halfCursWidth = cursWidth / 2;
const int halfCursHeight = cursHeight / 2;
if (cursId >= 0) {
if (*sgOptions.Graphics.showItemGraphicsInStores && cursId >= 0) {
const ClxSprite itemSprite = GetInvItemSprite(static_cast<int>(CURSOR_FIRSTITEM) + cursId);
const OwnedSurface itemSurface(itemSprite.width(), itemSprite.height());
SDL_FillRect(itemSurface.surface, nullptr, 1);
@ -2302,7 +2302,7 @@ void PrintSString(const Surface &out, int margin, int line, string_view text, Ui
ClxDraw(out, rect.position + spriteOffset, halfSprite[0]);
}
if (cursIndent) {
if (*sgOptions.Graphics.showItemGraphicsInStores && cursIndent) {
const Rectangle textRect { { rect.position.x + halfCursWidth + 8, rect.position.y }, { rect.size.width - halfCursWidth + 8, rect.size.height } };
DrawString(out, text, textRect, flags);
} else {

Loading…
Cancel
Save