From 9e7d223f1995d651de19da29a8243b9ca7421f44 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 5 Jun 2023 21:10:39 +0200 Subject: [PATCH] Menu tweaks --- Source/DiabloUI/diabloui.cpp | 8 +++----- Source/DiabloUI/diabloui.h | 2 +- Source/DiabloUI/hero/selhero.cpp | 14 ++++++++++---- Source/options.cpp | 30 +++++++++++++++--------------- 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/Source/DiabloUI/diabloui.cpp b/Source/DiabloUI/diabloui.cpp index a688f6b71..3ddacbc1d 100644 --- a/Source/DiabloUI/diabloui.cpp +++ b/Source/DiabloUI/diabloui.cpp @@ -46,7 +46,7 @@ namespace devilution { OptionalOwnedClxSpriteList ArtLogo; -std::array DifficultyIndicator; +OptionalOwnedClxSpriteList DifficultyIndicator; std::array ArtFocus; @@ -588,8 +588,7 @@ void LoadUiGFX() } else { ArtLogo = LoadPcxSpriteList("ui_art\\smlogo", /*numFrames=*/15, /*transparentColor=*/250); } - DifficultyIndicator[0] = LoadPcx("ui_art\\radio1", /*transparentColor=*/0); - DifficultyIndicator[1] = LoadPcx("ui_art\\radio3", /*transparentColor=*/0); + DifficultyIndicator = LoadPcx("ui_art\\r1_gry", /*transparentColor=*/0); ArtFocus[FOCUS_SMALL] = LoadPcxSpriteList("ui_art\\focus16", /*numFrames=*/8, /*transparentColor=*/250); ArtFocus[FOCUS_MED] = LoadPcxSpriteList("ui_art\\focus", /*numFrames=*/8, /*transparentColor=*/250); ArtFocus[FOCUS_BIG] = LoadPcxSpriteList("ui_art\\focus42", /*numFrames=*/8, /*transparentColor=*/250); @@ -617,8 +616,7 @@ void UnloadUiGFX() for (auto &art : ArtFocus) art = std::nullopt; ArtLogo = std::nullopt; - for (auto &diffInd : DifficultyIndicator) - diffInd = std::nullopt; + DifficultyIndicator = std::nullopt; } void UiInitialize() diff --git a/Source/DiabloUI/diabloui.h b/Source/DiabloUI/diabloui.h index 5c5e99412..8ba6f0b10 100644 --- a/Source/DiabloUI/diabloui.h +++ b/Source/DiabloUI/diabloui.h @@ -65,7 +65,7 @@ struct _uiheroinfo { }; extern OptionalOwnedClxSpriteList ArtLogo; -extern std::array DifficultyIndicator; +extern OptionalOwnedClxSpriteList DifficultyIndicator; extern std::array ArtFocus; extern OptionalOwnedClxSpriteList ArtBackgroundWidescreen; extern OptionalOwnedClxSpriteList ArtBackground; diff --git a/Source/DiabloUI/hero/selhero.cpp b/Source/DiabloUI/hero/selhero.cpp index e2783f389..8c8782616 100644 --- a/Source/DiabloUI/hero/selhero.cpp +++ b/Source/DiabloUI/hero/selhero.cpp @@ -92,11 +92,17 @@ void RenderDifficultyIndicators() { if (!selhero_isSavegame) return; - const uint16_t width = (*DifficultyIndicator[0])[0].width(); - const uint16_t height = (*DifficultyIndicator[0])[0].height(); - SDL_Rect rect = MakeSdlRect(SELHERO_DIALOG_HERO_IMG->m_rect.x, SELHERO_DIALOG_HERO_IMG->m_rect.y - height - 2, width, height); + const uint16_t width = (*DifficultyIndicator)[0].width(); + const uint16_t height = (*DifficultyIndicator)[0].height(); + SDL_Rect rect = MakeSdlRect( + SELHERO_DIALOG_HERO_IMG->m_rect.x + 1, + SELHERO_DIALOG_HERO_IMG->m_rect.y + SELHERO_DIALOG_HERO_IMG->m_rect.h - height - 1, + width, + height); for (int i = 0; i <= DIFF_LAST; i++) { - UiRenderItem(UiImageClx((*DifficultyIndicator[i < selhero_heroInfo.herorank ? 0 : 1])[0], rect, UiFlags::None)); + if (i >= selhero_heroInfo.herorank) + break; + UiRenderItem(UiImageClx((*DifficultyIndicator)[0], rect, UiFlags::None)); rect.x += width; } } diff --git a/Source/options.cpp b/Source/options.cpp index 72116fbe4..ca3c4fc2a 100644 --- a/Source/options.cpp +++ b/Source/options.cpp @@ -1021,6 +1021,9 @@ std::vector GraphicsOptions::GetEntries() #if !defined(USE_SDL1) || defined(__3DS__) &fitToScreen, #endif + &showItemGraphicsInStores, + &showHealthValues, + &showManaValues, #ifndef USE_SDL1 &upscale, &scaleQuality, @@ -1031,9 +1034,6 @@ std::vector GraphicsOptions::GetEntries() &zoom, &limitFPS, &showFPS, - &showItemGraphicsInStores, - &showHealthValues, - &showManaValues, &colorCycling, &alternateNestArt, #if SDL_VERSION_ATLEAST(2, 0, 0) @@ -1095,39 +1095,39 @@ std::vector GameplayOptions::GetEntries() { return { &tickRate, - &grabInput, - &runInTown, - &adriaRefillsMana, + &friendlyFire, + &multiplayerFullQuests, &randomizeQuests, &theoQuest, &cowQuest, - &friendlyFire, - &multiplayerFullQuests, + &runInTown, + &quickCast, &testBard, &testBarbarian, &experienceBar, &enemyHealthBar, &showMonsterType, &showItemLabels, - &disableCripplingShrines, - &quickCast, + &enableFloatingNumbers, &autoRefillBelt, - &autoPickupInTown, - &autoGoldPickup, - &autoElixirPickup, - &autoOilPickup, &autoEquipWeapons, &autoEquipArmor, &autoEquipHelms, &autoEquipShields, &autoEquipJewelry, + &autoGoldPickup, + &autoElixirPickup, + &autoOilPickup, &numHealPotionPickup, &numFullHealPotionPickup, &numManaPotionPickup, &numFullManaPotionPickup, &numRejuPotionPickup, &numFullRejuPotionPickup, - &enableFloatingNumbers, + &autoPickupInTown, + &disableCripplingShrines, + &adriaRefillsMana, + &grabInput, }; }