From ce14a018a6f66aa1309ebe71a8217082d83cd0da Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 6 Feb 2016 14:32:35 +0300 Subject: Hide cutin if npc window closed. --- src/gui/windows/cutinwindow.cpp | 6 ++++++ src/gui/windows/cutinwindow.h | 2 ++ src/gui/windows/npcdialog.cpp | 11 +++++++++++ 3 files changed, 19 insertions(+) (limited to 'src/gui') diff --git a/src/gui/windows/cutinwindow.cpp b/src/gui/windows/cutinwindow.cpp index f8d21a37c..1a38661b8 100644 --- a/src/gui/windows/cutinwindow.cpp +++ b/src/gui/windows/cutinwindow.cpp @@ -139,6 +139,12 @@ void CutInWindow::show(const std::string &name, } } +void CutInWindow::hide() +{ + delete2(mImage); + setVisible(Visible_false); +} + void CutInWindow::logic() { if (mImage) diff --git a/src/gui/windows/cutinwindow.h b/src/gui/windows/cutinwindow.h index 7850c4e49..f6e48624c 100644 --- a/src/gui/windows/cutinwindow.h +++ b/src/gui/windows/cutinwindow.h @@ -47,6 +47,8 @@ class CutInWindow final : public Window void show(const std::string &name, const CutInT cutin); + void hide(); + void logic() override final; private: diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index 585e8ab2f..dc991097b 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -39,6 +39,9 @@ #include "gui/popups/popupmenu.h" +#ifdef EATHENA_SUPPORT +#include "gui/windows/cutinwindow.h" +#endif #include "gui/windows/inventorywindow.h" #include "gui/widgets/browserbox.h" @@ -325,6 +328,10 @@ void NpcDialog::action(const ActionEvent &event) else if (mActionState == NPC_ACTION_CLOSE || mActionState == NPC_ACTION_WAIT) { +#ifdef EATHENA_SUPPORT + if (cutInWindow) + cutInWindow->hide(); +#endif closeDialog(); } else if (mActionState == NPC_ACTION_INPUT) @@ -601,6 +608,10 @@ void NpcDialog::action(const ActionEvent &event) npcHandler->listInput(mNpcId, 255); break; } +#ifdef EATHENA_SUPPORT + if (cutInWindow) + cutInWindow->hide(); +#endif closeDialog(); } } -- cgit v1.2.3-70-g09d2