Skip to content

Commit

Permalink
CChangeLevelWnd: repaired level changer window
Browse files Browse the repository at this point in the history
Both for CoP and CS
  • Loading branch information
Xottab-DUTY committed Apr 27, 2019
1 parent 1343d5f commit 00e0d08
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
26 changes: 21 additions & 5 deletions src/xrGame/UIGameSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,9 @@ bool CChangeLevelWnd::OnKeyboardAction(int dik, EUIMessages keyboard_action)
return inherited::OnKeyboardAction(dik, keyboard_action);
}

// Не инициализировалась форма, поскольку виртуальная функция отличалась набором аргуметов
//morrey
bool g_block_pause = false;

// Morrey: Не инициализировалась форма, поскольку виртуальная функция отличалась набором аргуметов
void CChangeLevelWnd::Show(bool status)
{
inherited::Show(status);
Expand All @@ -327,10 +326,27 @@ void CChangeLevelWnd::Show(bool status)
}
}

//old
void CChangeLevelWnd::Hide()
void CChangeLevelWnd::ShowDialog(bool bDoHideIndicators)
{
m_messageBox->InitMessageBox(m_b_allow_change_level
? "message_box_change_level"
: "message_box_change_level_disabled");

SetWndPos(m_messageBox->GetWndPos());
m_messageBox->SetWndPos(Fvector2().set(0.0f, 0.0f));
SetWndSize(m_messageBox->GetWndSize());

m_messageBox->SetText(m_message_str.c_str());

g_block_pause = true;
Device.Pause(TRUE, TRUE, TRUE, "CChangeLevelWnd_show");
bShowPauseString = FALSE;
inherited::ShowDialog(bDoHideIndicators);
}

void CChangeLevelWnd::HideDialog()
{
g_block_pause = false;
Device.Pause(FALSE, TRUE, TRUE, "CChangeLevelWnd_hide");
inherited::HideDialog();
}
//morrey
5 changes: 3 additions & 2 deletions src/xrGame/UIGameSP.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ class CChangeLevelWnd : public CUIDialogWnd
virtual ~CChangeLevelWnd(){};
virtual void SendMessage(CUIWindow* pWnd, s16 msg, void* pData);
virtual bool WorkInPause() const { return true; }
virtual void Show(bool status);
virtual void Hide();
void Show(bool status) override;
void ShowDialog(bool bDoHideIndicators) override;
void HideDialog() override;
virtual bool OnKeyboardAction(int dik, EUIMessages keyboard_action);
};
4 changes: 2 additions & 2 deletions src/xrGame/ui/UIDialogWnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class CUIDialogWnd : public CUIWindow
virtual bool NeedCenterCursor() const { return true; }
virtual bool WorkInPause() const { return m_bWorkInPause; }
virtual bool Dispatch(int cmd, int param) { return true; }
void ShowDialog(bool bDoHideIndicators);
void HideDialog();
virtual void ShowDialog(bool bDoHideIndicators);
virtual void HideDialog();

virtual bool IR_process();
};

1 comment on commit 00e0d08

@Xottab-DUTY
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to #382 and #392

Please sign in to comment.