mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-10 19:53:04 +08:00
[saco] Implement/match the four CChatWindow scrollbar pokes; CDXUTScrollBar::GetTrackPos comes along as the out-of-line COMDAT at 0x100670D0
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -35,6 +35,8 @@ public:
|
||||
|
||||
void GetDialogSize(RECT *pRect);
|
||||
|
||||
bool IsImeActive(); // .text:10069810
|
||||
|
||||
void Enable();
|
||||
void Disable();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user