From 670632a6126f411fa25385967c5f0590e52fcd21 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Sat, 16 Oct 2021 03:38:15 +0300 Subject: [PATCH] xrGame/ui/UIActorMenu.cpp: added monster info to the inventory window (#382, #392) --- src/xrGame/ui/UIActorMenu.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/xrGame/ui/UIActorMenu.cpp b/src/xrGame/ui/UIActorMenu.cpp index f2f3bd76a10..e06bb35b3bc 100644 --- a/src/xrGame/ui/UIActorMenu.cpp +++ b/src/xrGame/ui/UIActorMenu.cpp @@ -70,10 +70,21 @@ void CUIActorMenu::InitPartnerInfo() { if (m_pPartnerInvOwner) { - if (m_pPartnerInvOwner->use_simplified_visual()) + CBaseMonster* monster = smart_cast(m_pPartnerInvOwner); + if (monster || m_pPartnerInvOwner->use_simplified_visual()) + { GetModeSpecificPartnerInfo(m_currMenuMode)->ClearInfo(); + if (monster) + { + shared_str monster_tex_name = pSettings->r_string(monster->cNameSect(), "icon"); + GetModeSpecificPartnerInfo(m_currMenuMode)->UIIcon().InitTexture(monster_tex_name.c_str()); + GetModeSpecificPartnerInfo(m_currMenuMode)->UIIcon().SetStretchTexture(true); + } + } else + { GetModeSpecificPartnerInfo(m_currMenuMode)->InitCharacter(m_pPartnerInvOwner->object_id()); + } SetInvBox(nullptr); }