diff --git a/Source/DiabloUI/diabloui.cpp b/Source/DiabloUI/diabloui.cpp index 069118e70..e1ea1d863 100644 --- a/Source/DiabloUI/diabloui.cpp +++ b/Source/DiabloUI/diabloui.cpp @@ -44,6 +44,7 @@ namespace devilution { OptionalOwnedClxSpriteList ArtLogo; +std::array DifficultyIndicator; std::array ArtFocus; @@ -562,6 +563,8 @@ void LoadUiGFX() } else { ArtLogo = LoadPcxSpriteList("ui_art\\smlogo.pcx", /*numFrames=*/15, /*transparentColor=*/250); } + DifficultyIndicator[0] = LoadPcx("ui_art\\radio1.pcx"); + DifficultyIndicator[1] = LoadPcx("ui_art\\radio3.pcx"); ArtFocus[FOCUS_SMALL] = LoadPcxSpriteList("ui_art\\focus16.pcx", /*numFrames=*/8, /*transparentColor=*/250); ArtFocus[FOCUS_MED] = LoadPcxSpriteList("ui_art\\focus.pcx", /*numFrames=*/8, /*transparentColor=*/250); ArtFocus[FOCUS_BIG] = LoadPcxSpriteList("ui_art\\focus42.pcx", /*numFrames=*/8, /*transparentColor=*/250); @@ -589,6 +592,8 @@ void UnloadUiGFX() for (auto &art : ArtFocus) art = std::nullopt; ArtLogo = std::nullopt; + for (auto &diffInd : DifficultyIndicator) + diffInd = std::nullopt; } void UiInitialize() diff --git a/Source/DiabloUI/diabloui.h b/Source/DiabloUI/diabloui.h index b467a8e91..7032e095f 100644 --- a/Source/DiabloUI/diabloui.h +++ b/Source/DiabloUI/diabloui.h @@ -61,6 +61,7 @@ struct _uiheroinfo { }; extern OptionalOwnedClxSpriteList ArtLogo; +extern std::array DifficultyIndicator; extern std::array ArtFocus; extern OptionalOwnedClxSpriteList ArtBackgroundWidescreen; extern OptionalOwnedClxSpriteList ArtBackground; diff --git a/Source/DiabloUI/selhero.cpp b/Source/DiabloUI/selhero.cpp index e9209cd22..82b8f3d33 100644 --- a/Source/DiabloUI/selhero.cpp +++ b/Source/DiabloUI/selhero.cpp @@ -44,6 +44,7 @@ bool selhero_deleteEnabled; std::vector> vecSelHeroDialog; std::vector> vecSelHeroDlgItems; std::vector> vecSelDlgItems; +std::vector> vecDifficultyIndicators; UiImageClx *SELHERO_DIALOG_HERO_IMG; @@ -70,6 +71,7 @@ void SelheroFree() ArtBackground = std::nullopt; vecSelHeroDialog.clear(); + vecDifficultyIndicators.clear(); vecSelDlgItems.clear(); vecSelHeroDlgItems.clear(); @@ -85,6 +87,14 @@ void SelheroSetStats() CopyUtf8(textStats[3], StrCat(selhero_heroInfo.dexterity), sizeof(textStats[3])); CopyUtf8(textStats[4], StrCat(selhero_heroInfo.vitality), sizeof(textStats[4])); CopyUtf8(textStats[5], StrCat(selhero_heroInfo.saveNumber), sizeof(textStats[5])); + + const Point uiPosition = GetUIRectangle().position; + vecDifficultyIndicators.clear(); + SDL_Rect rect = MakeSdlRect(uiPosition.x + 28, uiPosition.y + 198, 12, 12); + for (int i = 0; i <= DIFF_LAST; i++) { + vecDifficultyIndicators.push_back(std::make_unique(*DifficultyIndicator[i < selhero_heroInfo.herorank ? 0 : 1], rect, UiFlags::None)); + rect.x += 12; + } } UiArtTextButton *SELLIST_DIALOG_DELETE_BUTTON; @@ -563,6 +573,7 @@ static void UiSelHeroDialog( while (!selhero_endMenu && !selhero_navigateYesNo) { UiClearScreen(); UiRenderItems(vecSelHeroDialog); + UiRenderItems(vecDifficultyIndicators); UiPollAndRender(); } SelheroFree();