diff --git a/saco/chatwindow.cpp b/saco/chatwindow.cpp index d2a50ca..a341a53 100644 --- a/saco/chatwindow.cpp +++ b/saco/chatwindow.cpp @@ -2,6 +2,8 @@ #include "main.h" extern CConfig *pConfig; +extern CCmdWindow *pCmdWindow; +extern CGame *pGame; //---------------------------------------------------- @@ -199,3 +201,48 @@ void CChatWindow::ReplaceControlChars(char *szString) while(*++szString); } } + +//---------------------------------------------------- + +void CChatWindow::PageUp() +{ + if(field_8 && m_pScrollBar && !pGame->sub_100A0920() && !pCmdWindow->IsImeActive()) { + int iPos = m_pScrollBar->GetTrackPos()-field_0; + if(iPos < 1) iPos = 1; + m_pScrollBar->SetTrackPos(iPos); + } +} + +//---------------------------------------------------- + +void CChatWindow::PageDown() +{ + if(field_8 && m_pScrollBar && !pGame->sub_100A0920() && !pCmdWindow->IsImeActive()) { + int iPos = m_pScrollBar->GetTrackPos(); + if(iPos == 1) + iPos = field_0; + else + iPos += field_0; + if(iPos > MAX_MESSAGES) iPos = MAX_MESSAGES; + m_pScrollBar->SetTrackPos(iPos); + } +} + +//---------------------------------------------------- + +void CChatWindow::FUNC_10067390() +{ + if(m_pScrollBar) + m_pScrollBar->SetTrackPos(MAX_MESSAGES-10); +} + +//---------------------------------------------------- + +void CChatWindow::OnMouseWheel(int nDelta) +{ + if(field_8 && m_pScrollBar) { + int nScrollLines; + SystemParametersInfo(SPI_GETWHEELSCROLLLINES,0,&nScrollLines,0); + m_pScrollBar->Scroll(-(nDelta*nScrollLines)); + } +} diff --git a/saco/chatwindow.h b/saco/chatwindow.h index 9a9e12b..08e13b9 100644 --- a/saco/chatwindow.h +++ b/saco/chatwindow.h @@ -51,6 +51,14 @@ public: void FUNC_10067200(); + void FUNC_10067390(); // .text:10067390 + + void OnMouseWheel(int nDelta); // .text:100673C0 + + void PageUp(); // .text:100672D0 + + void PageDown(); // .text:10067330 + void ReplaceControlChars(char *szString); // .text:10067420 void FUNC_10067E00(); // .text:10067E00 diff --git a/saco/cmdwindow.h b/saco/cmdwindow.h index 9fb44b7..04ca822 100644 --- a/saco/cmdwindow.h +++ b/saco/cmdwindow.h @@ -35,6 +35,8 @@ public: void GetDialogSize(RECT *pRect); + bool IsImeActive(); // .text:10069810 + void Enable(); void Disable();