Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/xrGame/ui/UITalkDialogWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@ void CUITalkDialogWnd::InitTalkDialogWnd()
}
}

void CUITalkDialogWnd::Show()
void CUITalkDialogWnd::Show(const bool notify_scripts /*= true*/)
{
InventoryUtilities::SendInfoToActor("ui_talk_show");
InventoryUtilities::SendInfoToLuaScripts("ui_talk_show");
if (notify_scripts)
InventoryUtilities::SendInfoToLuaScripts("ui_talk_show");
inherited::Show(true);
inherited::Enable(true);

Expand All @@ -159,12 +160,13 @@ void CUITalkDialogWnd::Show()
UI().Focus().LockToWindow(UIQuestionsList);
}

void CUITalkDialogWnd::Hide()
void CUITalkDialogWnd::Hide(const bool notify_scripts /*= true*/)
{
if (UI().Focus().GetLocker() == UIQuestionsList)
UI().Focus().Unlock();
InventoryUtilities::SendInfoToActor("ui_talk_hide");
InventoryUtilities::SendInfoToLuaScripts("ui_talk_hide");
if (notify_scripts)
InventoryUtilities::SendInfoToLuaScripts("ui_talk_hide");
inherited::Show(false);
inherited::Enable(false);
g_btnHint->Discard();
Expand Down
4 changes: 2 additions & 2 deletions src/xrGame/ui/UITalkDialogWnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class CUITalkDialogWnd final : public CUIWindow, public CUIWndCallback

virtual void SendMessage(CUIWindow* pWnd, s16 msg, void* pData = NULL);

virtual void Show();
virtual void Hide();
virtual void Show(bool notify_scripts = true);
virtual void Hide(bool notify_scripts = true);
CUITalkWnd* m_pParent;
u32 GetHeaderColor() { return m_iNameTextColor; }
CGameFont* GetHeaderFont() { return m_pNameTextFont; }
Expand Down
4 changes: 3 additions & 1 deletion src/xrGame/ui/UITalkWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,9 @@ void CUITalkWnd::SwitchToUpgrade()
CUIGameSP* pGameSP = smart_cast<CUIGameSP*>(CurrentGameUI());
if (pGameSP)
{
UITalkDialogWnd->Hide();
// Don't notify scripts that we are hiding the dialog because the CoC inventory_upgrade script will mess up otherwise.
// See: https://github.com/OpenXRay/xray-16/issues/1852
UITalkDialogWnd->Hide(false);
StopSnd();

pGameSP->StartUpgrade(m_pOurInvOwner, m_pOthersInvOwner);
Expand Down
Loading