Skip to content

Commit

Permalink
Unified usage of Armor.spriteInv across all UIs
Browse files Browse the repository at this point in the history
  • Loading branch information
MeridianOXC committed Apr 16, 2023
1 parent 82b7b11 commit 88d7da2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Battlescape/InventoryState.cpp
Expand Up @@ -340,11 +340,23 @@ void InventoryState::init()
{
look = s->getArmor()->getSpriteInventory() + ".SPK";
}
if (!_game->getMod()->getSurface(look, false))
{
look = s->getArmor()->getSpriteInventory();
}
_game->getMod()->getSurface(look)->blit(_soldier);
}
else
{
Surface *armorSurface = _game->getMod()->getSurface(unit->getArmor()->getSpriteInventory(), false);
if (!armorSurface)
{
armorSurface = _game->getMod()->getSurface(unit->getArmor()->getSpriteInventory() + ".SPK", false);
}
if (!armorSurface)
{
armorSurface = _game->getMod()->getSurface(unit->getArmor()->getSpriteInventory() + "M0.SPK", false);
}
if (armorSurface)
{
armorSurface->blit(_soldier);
Expand Down
4 changes: 4 additions & 0 deletions src/Ufopaedia/ArticleStateArmor.cpp
Expand Up @@ -70,6 +70,10 @@ namespace OpenXcom
{
look = armor->getSpriteInventory() + ".SPK";
}
if (!_game->getMod()->getSurface(look, false))
{
look = armor->getSpriteInventory();
}
_game->getMod()->getSurface(look)->blit(_image);


Expand Down

0 comments on commit 88d7da2

Please sign in to comment.