mirror of
https://github.com/OpenTrespasser/JurassicParkTrespasser.git
synced 2024-12-19 15:11:57 +00:00
Compare commits
No commits in common. "2c52f38fe82753de5d05fa5ffaa8557d32197995" and "040c99d81bec2cd2c5fc01eea4b1f1afeff976fa" have entirely different histories.
2c52f38fe8
...
040c99d81b
@ -101,7 +101,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if 1
|
#if VER_LOG_MESSAGES
|
||||||
|
|
||||||
//******************************************************************************************
|
//******************************************************************************************
|
||||||
void CMessage::WriteToLog() const
|
void CMessage::WriteToLog() const
|
||||||
|
@ -228,7 +228,7 @@ protected:
|
|||||||
//**************************************
|
//**************************************
|
||||||
|
|
||||||
|
|
||||||
#if 1
|
#if VER_LOG_MESSAGES
|
||||||
|
|
||||||
//******************************************************************************************
|
//******************************************************************************************
|
||||||
//
|
//
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
#include "Lib/EntityDBase/PhysicsInfo.hpp"
|
#include "Lib/EntityDBase/PhysicsInfo.hpp"
|
||||||
|
|
||||||
#define VER_PARTITION_MAGNETS 1
|
#define VER_PARTITION_MAGNETS VER_TEST
|
||||||
|
|
||||||
enum EMagnetFlag // Used for flags in CMagnet
|
enum EMagnetFlag // Used for flags in CMagnet
|
||||||
// Prefix: emf
|
// Prefix: emf
|
||||||
|
@ -843,7 +843,7 @@ void CUIListbox::DoFrame(POINT ptMouse)
|
|||||||
iThumbHeight = (m_rc.bottom - m_rc.top) - (2 + (2 * m_iScrollWidth));
|
iThumbHeight = (m_rc.bottom - m_rc.top) - (2 + (2 * m_iScrollWidth));
|
||||||
y = (ptMouse.y - m_rc.top) - (m_iScrollWidth + 1);
|
y = (ptMouse.y - m_rc.top) - (m_iScrollWidth + 1);
|
||||||
|
|
||||||
iNewTop = (int)((double)((y - m_iMouseFromTop) * (int) m_vInfo.size()) / (double) iThumbHeight);
|
iNewTop = (int)((double)((y - m_iMouseFromTop) * m_vInfo.size()) / (double) iThumbHeight);
|
||||||
if (iNewTop < 0)
|
if (iNewTop < 0)
|
||||||
{
|
{
|
||||||
iNewTop = 0;
|
iNewTop = 0;
|
||||||
@ -1069,42 +1069,28 @@ BOOL CUIListbox::LButtonUp(int x, int y, UINT keyFlags)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUIListbox::ScrollUp()
|
|
||||||
{
|
|
||||||
if ((m_iTop - 1) >= 0)
|
|
||||||
{
|
|
||||||
m_iTop--;
|
|
||||||
m_bUpdate = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CUIListbox::ScrollDown()
|
|
||||||
{
|
|
||||||
if ((m_iTop + 1) <= (m_vInfo.size() - m_iItemsMaxVis))
|
|
||||||
{
|
|
||||||
m_iTop++;
|
|
||||||
m_bUpdate = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL CUIListbox::MouseWheel(int x, int y, int zDelta, UINT keyFlags)
|
|
||||||
{
|
|
||||||
if (zDelta > 0)
|
|
||||||
ScrollUp();
|
|
||||||
else if (zDelta < 0)
|
|
||||||
ScrollDown();
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CUIListbox::UIButtonUp(CUIButton * pbutton)
|
void CUIListbox::UIButtonUp(CUIButton * pbutton)
|
||||||
{
|
{
|
||||||
|
int iNewTop;
|
||||||
|
|
||||||
if ((pbutton->GetID() == IDSCROLLUP) && (pbutton->GetActive()))
|
if ((pbutton->GetID() == IDSCROLLUP) && (pbutton->GetActive()))
|
||||||
{
|
{
|
||||||
ScrollUp();
|
iNewTop = m_iTop - 1;
|
||||||
|
if (iNewTop >= 0)
|
||||||
|
{
|
||||||
|
m_iTop = iNewTop;
|
||||||
|
m_bUpdate = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ((pbutton->GetID() == IDSCROLLDN) && (pbutton->GetActive()))
|
else if ((pbutton->GetID() == IDSCROLLDN) && (pbutton->GetActive()))
|
||||||
{
|
{
|
||||||
ScrollDown();
|
iNewTop = m_iTop + 1;
|
||||||
|
if (iNewTop <= m_vInfo.size()- m_iItemsMaxVis)
|
||||||
|
{
|
||||||
|
m_iTop = iNewTop;
|
||||||
|
m_bUpdate = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_bUpdate)
|
if (m_bUpdate)
|
||||||
@ -2646,19 +2632,6 @@ BOOL CUISlider::LButtonUp(int x, int y, UINT keyFlags)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL CUISlider::MouseWheel(int x, int y, int zDelta, UINT keyFlags)
|
|
||||||
{
|
|
||||||
//zDeltas are multiples of 120, see WM_MOUSEWHEEL documentation
|
|
||||||
int scrollstep = static_cast<int>(std::round(static_cast<double>(m_iUnits) / 20));
|
|
||||||
int scrolldistance = scrollstep * (zDelta / 120);
|
|
||||||
m_iCurrUnit = std::clamp(m_iCurrUnit + scrolldistance, 0, m_iUnits);
|
|
||||||
|
|
||||||
m_pParent->UISliderChange(this, m_iCurrUnit);
|
|
||||||
m_pParent->CtrlInvalidateRect(&m_rc);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL CUISlider::TokenLoad(HANDLE hFile)
|
BOOL CUISlider::TokenLoad(HANDLE hFile)
|
||||||
{
|
{
|
||||||
BOOL bRet;
|
BOOL bRet;
|
||||||
|
@ -102,7 +102,6 @@ public:
|
|||||||
virtual void ReleaseCapture() {;}
|
virtual void ReleaseCapture() {;}
|
||||||
|
|
||||||
virtual void MouseMove(int x, int y, UINT keyFlags);
|
virtual void MouseMove(int x, int y, UINT keyFlags);
|
||||||
virtual BOOL MouseWheel(int x, int y, int zDelta, UINT keyFlags) { return FALSE; }
|
|
||||||
virtual BOOL LButtonDown(int x, int y, BOOL bDoubleClick, UINT keyFlags);
|
virtual BOOL LButtonDown(int x, int y, BOOL bDoubleClick, UINT keyFlags);
|
||||||
virtual BOOL LButtonUp(int x, int y, UINT keyFlags);
|
virtual BOOL LButtonUp(int x, int y, UINT keyFlags);
|
||||||
|
|
||||||
@ -212,7 +211,6 @@ public:
|
|||||||
|
|
||||||
virtual BOOL LButtonDown(int x, int y, BOOL bDoubleClick, UINT keyFlags) override;
|
virtual BOOL LButtonDown(int x, int y, BOOL bDoubleClick, UINT keyFlags) override;
|
||||||
virtual BOOL LButtonUp(int x, int y, UINT keyFlags) override;
|
virtual BOOL LButtonUp(int x, int y, UINT keyFlags) override;
|
||||||
virtual BOOL MouseWheel(int x, int y, int zDelta, UINT keyFlags) override;
|
|
||||||
|
|
||||||
virtual BOOL TokenLoad(HANDLE hFile) override;
|
virtual BOOL TokenLoad(HANDLE hFile) override;
|
||||||
|
|
||||||
@ -307,9 +305,6 @@ private:
|
|||||||
|
|
||||||
void Update();
|
void Update();
|
||||||
BOOL InitSurface();
|
BOOL InitSurface();
|
||||||
|
|
||||||
void ScrollUp();
|
|
||||||
void ScrollDown();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -442,7 +437,6 @@ public:
|
|||||||
virtual void MouseMove(int x, int y, UINT keyFlags) override;
|
virtual void MouseMove(int x, int y, UINT keyFlags) override;
|
||||||
virtual BOOL LButtonDown(int x, int y, BOOL bDoubleClick, UINT keyFlags) override;
|
virtual BOOL LButtonDown(int x, int y, BOOL bDoubleClick, UINT keyFlags) override;
|
||||||
virtual BOOL LButtonUp(int x, int y, UINT keyFlags) override;
|
virtual BOOL LButtonUp(int x, int y, UINT keyFlags) override;
|
||||||
virtual BOOL MouseWheel(int x, int y, int zDelta, UINT keyFlags) override;
|
|
||||||
|
|
||||||
virtual BOOL TokenLoad(HANDLE hFile) override;
|
virtual BOOL TokenLoad(HANDLE hFile) override;
|
||||||
|
|
||||||
|
@ -70,7 +70,6 @@ public:
|
|||||||
void OnKey(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags);
|
void OnKey(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags);
|
||||||
void OnChar(HWND hwnd, TCHAR ch, int cRepeat);
|
void OnChar(HWND hwnd, TCHAR ch, int cRepeat);
|
||||||
void OnMouseMove(HWND hwnd, int x, int y, UINT keyFlags);
|
void OnMouseMove(HWND hwnd, int x, int y, UINT keyFlags);
|
||||||
void OnMouseWheel(HWND hwnd, int x, int y, int zDelta, UINT fwKeys);
|
|
||||||
void OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags);
|
void OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags);
|
||||||
void OnLButtonUp(HWND hwnd, int x, int y, UINT keyFlags);
|
void OnLButtonUp(HWND hwnd, int x, int y, UINT keyFlags);
|
||||||
void OnRButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags);
|
void OnRButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags);
|
||||||
|
@ -237,11 +237,6 @@ void CMainWnd::OnMouseMove(HWND hwnd, int x, int y, UINT keyFlags)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMainWnd::OnMouseWheel(HWND hwnd, int x, int y, int zDelta, UINT fwKeys)
|
|
||||||
{
|
|
||||||
if (CUIWnd* puiwnd = m_pUIMgr->GetActiveUIWnd(); puiwnd && !puiwnd->m_bExitWnd)
|
|
||||||
puiwnd->OnMouseWheel(x, y, zDelta, fwKeys);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CMainWnd::OnRButtonDown(HWND hwnd,
|
void CMainWnd::OnRButtonDown(HWND hwnd,
|
||||||
BOOL fDoubleClick,
|
BOOL fDoubleClick,
|
||||||
@ -728,7 +723,6 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
HANDLE_MSG(hwnd, WM_KEYUP, g_pMainWnd->OnKey);
|
HANDLE_MSG(hwnd, WM_KEYUP, g_pMainWnd->OnKey);
|
||||||
HANDLE_MSG(hwnd, WM_CHAR, g_pMainWnd->OnChar);
|
HANDLE_MSG(hwnd, WM_CHAR, g_pMainWnd->OnChar);
|
||||||
HANDLE_MSG(hwnd, WM_MOUSEMOVE, g_pMainWnd->OnMouseMove);
|
HANDLE_MSG(hwnd, WM_MOUSEMOVE, g_pMainWnd->OnMouseMove);
|
||||||
HANDLE_MSG(hwnd, WM_MOUSEWHEEL, g_pMainWnd->OnMouseWheel);
|
|
||||||
HANDLE_MSG(hwnd, WM_LBUTTONDOWN, g_pMainWnd->OnLButtonDown);
|
HANDLE_MSG(hwnd, WM_LBUTTONDOWN, g_pMainWnd->OnLButtonDown);
|
||||||
HANDLE_MSG(hwnd, WM_LBUTTONDBLCLK, g_pMainWnd->OnLButtonDown);
|
HANDLE_MSG(hwnd, WM_LBUTTONDBLCLK, g_pMainWnd->OnLButtonDown);
|
||||||
HANDLE_MSG(hwnd, WM_LBUTTONUP, g_pMainWnd->OnLButtonUp);
|
HANDLE_MSG(hwnd, WM_LBUTTONUP, g_pMainWnd->OnLButtonUp);
|
||||||
@ -736,7 +730,6 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
HANDLE_MSG(hwnd, WM_ERASEBKGND, g_pMainWnd->OnEraseBkgnd);
|
HANDLE_MSG(hwnd, WM_ERASEBKGND, g_pMainWnd->OnEraseBkgnd);
|
||||||
HANDLE_MSG(hwnd, WM_RBUTTONDOWN, g_pMainWnd->OnRButtonDown);
|
HANDLE_MSG(hwnd, WM_RBUTTONDOWN, g_pMainWnd->OnRButtonDown);
|
||||||
HANDLE_MSG(hwnd, WM_RBUTTONDBLCLK, g_pMainWnd->OnRButtonDown);
|
HANDLE_MSG(hwnd, WM_RBUTTONDBLCLK, g_pMainWnd->OnRButtonDown);
|
||||||
HANDLE_MSG(hwnd, WM_MBUTTONDOWN, g_pMainWnd->OnMButtonDown);
|
|
||||||
HANDLE_MSG(hwnd, WM_TIMER, g_pMainWnd->OnTimer);
|
HANDLE_MSG(hwnd, WM_TIMER, g_pMainWnd->OnTimer);
|
||||||
HANDLE_MSG(hwnd, WM_SYSCOMMAND, g_pMainWnd->OnSysCommand);
|
HANDLE_MSG(hwnd, WM_SYSCOMMAND, g_pMainWnd->OnSysCommand);
|
||||||
}
|
}
|
||||||
|
@ -1000,25 +1000,6 @@ void CUIWnd::OnMouseMove(int x, int y, UINT keyFlags)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUIWnd::OnMouseWheel(int x, int y, int zDelta, UINT fwKeys)
|
|
||||||
{
|
|
||||||
if (m_vUICtrls.empty())
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (auto i = m_vUICtrls.rbegin(); i != m_vUICtrls.rend() && *i; i++)
|
|
||||||
{
|
|
||||||
if (*i &&
|
|
||||||
(*i)->HitTest(m_pUIMgr->m_ptMouse.x, m_pUIMgr->m_ptMouse.y) &&
|
|
||||||
(*i)->MouseWheel(m_pUIMgr->m_ptMouse.x,
|
|
||||||
m_pUIMgr->m_ptMouse.y,
|
|
||||||
zDelta,
|
|
||||||
fwKeys))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CUIWnd::OnLButtonDown(BOOL fDoubleClick, int x, int y, UINT keyFlags)
|
void CUIWnd::OnLButtonDown(BOOL fDoubleClick, int x, int y, UINT keyFlags)
|
||||||
{
|
{
|
||||||
if (m_vUICtrls.size() == 0)
|
if (m_vUICtrls.size() == 0)
|
||||||
|
@ -143,7 +143,6 @@ public:
|
|||||||
virtual void OnKey(UINT vk, BOOL fDown, int cRepeat, UINT flags);
|
virtual void OnKey(UINT vk, BOOL fDown, int cRepeat, UINT flags);
|
||||||
virtual void OnChar(TCHAR ch, int cRepeat);
|
virtual void OnChar(TCHAR ch, int cRepeat);
|
||||||
virtual void OnMouseMove(int x, int y, UINT keyFlags);
|
virtual void OnMouseMove(int x, int y, UINT keyFlags);
|
||||||
virtual void OnMouseWheel(int x, int y, int zDelta, UINT fwKeys);
|
|
||||||
virtual void OnLButtonDown(BOOL fDoubleClick, int x, int y, UINT keyFlags);
|
virtual void OnLButtonDown(BOOL fDoubleClick, int x, int y, UINT keyFlags);
|
||||||
virtual void OnLButtonUp(int x, int y, UINT keyFlags);
|
virtual void OnLButtonUp(int x, int y, UINT keyFlags);
|
||||||
virtual void OnRButtonDown(BOOL fDoubleClick, int x, int y, UINT keyFlags);
|
virtual void OnRButtonDown(BOOL fDoubleClick, int x, int y, UINT keyFlags);
|
||||||
|
Loading…
Reference in New Issue
Block a user