Skip to content

Commit

Permalink
Make thieves guild adapt background to chosen interface (#7419)
Browse files Browse the repository at this point in the history
  • Loading branch information
zenseii authored Jul 17, 2023
1 parent c4f7277 commit a56d5bf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/fheroes2/dialog/dialog_thievesguild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void DrawFlags( const std::vector<ValueColors> & v, const fheroes2::Point & pos,
}
}

void DrawHeroIcons( const std::vector<ValueColors> & v, const fheroes2::Point & pos, int step )
void DrawHeroIcons( const std::vector<ValueColors> & v, const fheroes2::Point & pos, int step, const int frameIcnID )
{
if ( !v.empty() ) {
fheroes2::Display & display = fheroes2::Display::instance();
Expand All @@ -240,7 +240,7 @@ void DrawHeroIcons( const std::vector<ValueColors> & v, const fheroes2::Point &
const Heroes * hero = world.GetHeroes( v[ii].first );
if ( hero ) {
int32_t px = pos.x + ii * step;
const fheroes2::Sprite & window = fheroes2::AGG::GetICN( ICN::LOCATORS, 22 );
const fheroes2::Sprite & window = fheroes2::AGG::GetICN( frameIcnID, 22 );
fheroes2::Blit( window, display, px - window.width() / 2, pos.y - 4 );

const fheroes2::Sprite & icon = hero->GetPortrait( PORT_SMALL );
Expand Down Expand Up @@ -310,7 +310,10 @@ void Dialog::ThievesGuild( bool oracle )
Dialog::FrameBorder frameborder( { fheroes2::Display::DEFAULT_WIDTH, fheroes2::Display::DEFAULT_HEIGHT } );
const fheroes2::Point cur_pt( frameborder.GetArea().x, frameborder.GetArea().y );

fheroes2::Blit( fheroes2::AGG::GetICN( ICN::STONEBAK, 0 ), display, cur_pt.x, cur_pt.y );
const bool isEvilInterfaceTown = !oracle && Settings::Get().isEvilInterfaceEnabled();

const int backgroundIcnID = isEvilInterfaceTown ? ICN::STONEBAK_EVIL : ICN::STONEBAK;
fheroes2::Blit( fheroes2::AGG::GetICN( backgroundIcnID, 0 ), display, cur_pt.x, cur_pt.y );

fheroes2::Point dst_pt( cur_pt.x, cur_pt.y );

Expand Down Expand Up @@ -487,7 +490,8 @@ void Dialog::ThievesGuild( bool oracle )
dst_pt.x = cur_pt.x + startx + 1;
dst_pt.y -= 2;
GetBestHeroArmyInfo( v, colors );
DrawHeroIcons( v, dst_pt, stepx );
const int frameIcnID = isEvilInterfaceTown ? ICN::LOCATORE : ICN::LOCATORS;
DrawHeroIcons( v, dst_pt, stepx, frameIcnID );

text.Set( _( "Best Hero Stats:" ) );
dst_pt.x = cur_pt.x + textx - text.w();
Expand Down

0 comments on commit a56d5bf

Please sign in to comment.