add: Mouse wheel top window.

This commit is contained in:
WildEgo 2024-06-01 17:44:41 +01:00
parent 7c4bd90e29
commit 13496016cf
8 changed files with 125 additions and 2 deletions

View File

@ -100,6 +100,26 @@ namespace UI
m_bShow = false;
}
#if defined(__BL_MOUSE_WHEEL_TOP_WINDOW__)
bool CWindow::OnMouseWheelButtonUp()
{
bool bValue = false;
if (PyCallClassMemberFunc(m_poHandler, "OnMouseWheelButtonUp", BuildEmptyTuple(), &bValue))
return bValue;
return false;
}
bool CWindow::OnMouseWheelButtonDown()
{
bool bValue = false;
if (PyCallClassMemberFunc(m_poHandler, "OnMouseWheelButtonDown", BuildEmptyTuple(), &bValue))
return bValue;
return false;
}
#endif
// NOTE : IsShow<6F><77> "<22>ڽ<EFBFBD><DABD><EFBFBD> <20><><EFBFBD>̴°<CCB4>?" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, __IsShowing<6E><67> "<22>ڽ<EFBFBD><DABD><EFBFBD> <20>׷<EFBFBD><D7B7><EFBFBD><EFBFBD><EFBFBD> <20>ִ°<D6B4>?" <20><> üũ<C3BC>Ѵ<EFBFBD>
// <20>ڽ<EFBFBD><DABD><EFBFBD> Show <20><><EFBFBD><EFBFBD> Tree <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Parent <20><> <20>ϳ<EFBFBD><CFB3><EFBFBD> Hide <20><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>.. - [levites]
bool CWindow::IsRendering()

View File

@ -163,6 +163,10 @@ namespace UI
#if defined(__BL_CLIP_MASK__)
virtual void SetClippingMaskRect(const RECT& rMask);
virtual void SetClippingMaskWindow(CWindow* pMaskWindow);
#endif
#if defined(__BL_MOUSE_WHEEL_TOP_WINDOW__)
virtual bool OnMouseWheelButtonUp();
virtual bool OnMouseWheelButtonDown();
#endif
/////////////////////////////////////

View File

@ -28,6 +28,9 @@ namespace UI
m_pMiddleCaptureWindow(NULL),
m_pRightCaptureWindow(NULL),
m_pLockWindow(NULL),
#if defined(__BL_MOUSE_WHEEL_TOP_WINDOW__)
m_pTopWindow(NULL),
#endif
m_bAttachingFlag(FALSE),
m_dwAttachingType(0),
m_dwAttachingIndex(0),
@ -70,6 +73,9 @@ namespace UI
delete m_pRootWindow;
m_pRootWindow = NULL;
#if defined(__BL_MOUSE_WHEEL_TOP_WINDOW__)
m_pTopWindow = NULL;
#endif
}
void CWindowManager::Destroy()
@ -403,6 +409,11 @@ namespace UI
if (pWindow == m_pLockWindow)
m_pLockWindow = NULL;
#if defined(__BL_MOUSE_WHEEL_TOP_WINDOW__)
if (pWindow == m_pTopWindow)
m_pTopWindow = NULL;
#endif
m_LockWindowList.remove(pWindow);
m_ActiveWindowList.remove(pWindow);
m_PickAlwaysWindowList.remove(pWindow);
@ -529,6 +540,34 @@ namespace UI
m_iIgnoreEndTime = timeGetTime() + 500;
}
#if defined(__BL_MOUSE_WHEEL_TOP_WINDOW__)
bool CWindowManager::OnMouseWheelButtonUp()
{
if (m_pTopWindow)
return m_pTopWindow->OnMouseWheelButtonUp();
return false;
}
bool CWindowManager::OnMouseWheelButtonDown()
{
if (m_pTopWindow)
return m_pTopWindow->OnMouseWheelButtonDown();
return false;
}
void CWindowManager::SetWheelTopWindow(CWindow* pWindow)
{
m_pTopWindow = pWindow;
}
void CWindowManager::ClearWheelTopWindow()
{
m_pTopWindow = NULL;
}
#endif
void CWindowManager::LockWindow(CWindow * pWin)
{
if (m_pActiveWindow)
@ -638,6 +677,9 @@ namespace UI
{
SetTop(pTopWindow);
}
#if defined(__BL_MOUSE_WHEEL_TOP_WINDOW__)
m_pTopWindow = pTopWindow;
#endif
}
CWindow * CWindowManager::GetActivateWindow()

View File

@ -40,6 +40,12 @@ namespace UI
void SetParent(CWindow * pWindow, CWindow * pParentWindow);
void SetPickAlways(CWindow * pWindow);
#if defined(__BL_MOUSE_WHEEL_TOP_WINDOW__)
bool OnMouseWheelButtonUp();
bool OnMouseWheelButtonDown();
void SetWheelTopWindow(CWindow* pWindow);
void ClearWheelTopWindow();
#endif
enum
{
@ -169,6 +175,9 @@ namespace UI
CWindow * m_pActiveWindow;
TWindowContainer m_ActiveWindowList;
CWindow * m_pLockWindow;
#if defined(__BL_MOUSE_WHEEL_TOP_WINDOW__)
CWindow* m_pTopWindow;
#endif
TWindowContainer m_LockWindowList;
CWindow * m_pPointWindow;
CWindow * m_pLeftCaptureWindow;

View File

@ -51,6 +51,24 @@ PyObject* wndMgrSetClippingMaskWindow(PyObject* poSelf, PyObject* poArgs)
}
#endif
#if defined(__BL_MOUSE_WHEEL_TOP_WINDOW__)
PyObject* wndMgrSetWheelTopWindow(PyObject* poSelf, PyObject* poArgs)
{
UI::CWindow* pWindow;
if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
return Py_BuildException();
UI::CWindowManager::Instance().SetWheelTopWindow(pWindow);
return Py_BuildNone();
}
PyObject* wndMgrClearWheelTopWindow(PyObject* poSelf, PyObject* poArgs)
{
UI::CWindowManager::Instance().ClearWheelTopWindow();
return Py_BuildNone();
}
#endif
PyObject * wndMgrGetAspect(PyObject * poSelf, PyObject * poArgs)
{
return Py_BuildValue("f", UI::CWindowManager::Instance().GetAspect());
@ -2341,6 +2359,11 @@ void initwndMgr()
{ "SetClippingMaskWindow", wndMgrSetClippingMaskWindow, METH_VARARGS },
#endif
#if defined(__BL_MOUSE_WHEEL_TOP_WINDOW__)
{ "SetWheelTopWindow", wndMgrSetWheelTopWindow, METH_VARARGS },
{ "ClearWheelTopWindow", wndMgrClearWheelTopWindow, METH_VARARGS },
#endif
// WindowManager
{ "SetMouseHandler", wndMgrSetMouseHandler, METH_VARARGS },
{ "SetScreenSize", wndMgrSetScreenSize, METH_VARARGS },

View File

@ -7,6 +7,7 @@
#define ENABLE_DRAGON_SOUL_SYSTEM
#define ENABLE_NEW_EQUIPMENT_SYSTEM
#define __BL_CLIP_MASK__
#define __BL_MOUSE_WHEEL_TOP_WINDOW__
bool LocaleService_IsYMIR();
bool LocaleService_IsJAPAN();

View File

@ -60,13 +60,29 @@ void CPythonApplication::OnMouseMiddleButtonUp(int x, int y)
void CPythonApplication::OnMouseWheel(int nLen)
{
#if defined(__BL_MOUSE_WHEEL_TOP_WINDOW__)
bool bUIWheel = false;
if (nLen > 0)
bUIWheel = UI::CWindowManager::Instance().OnMouseWheelButtonUp();
else
bUIWheel = UI::CWindowManager::Instance().OnMouseWheelButtonDown();
if (!bUIWheel)
{
CCameraManager& rkCmrMgr = CCameraManager::Instance();
CCamera* pkCmrCur = rkCmrMgr.GetCurrentCamera();
if (pkCmrCur)
pkCmrCur->Wheel(nLen);
}
#else
CCameraManager& rkCmrMgr=CCameraManager::Instance();
CCamera* pkCmrCur=rkCmrMgr.GetCurrentCamera();
if (pkCmrCur)
pkCmrCur->Wheel(nLen);
#endif
}
void CPythonApplication::OnMouseMove(int x, int y)
{
CCameraManager& rkCmrMgr=CCameraManager::Instance();
@ -81,7 +97,7 @@ void CPythonApplication::OnMouseMove(int x, int y)
y = Point.y;
ClientToScreen(m_hWnd, &Point);
// 2004.07.26.myevan.안철수HackShield와 충돌
// 2004.07.26.myevan.<EFBFBD><EFBFBD>ö<EFBFBD><EFBFBD>HackShield<EFBFBD><EFBFBD> <20>
SetCursorPos(Point.x, Point.y);
}
@ -111,7 +127,9 @@ void CPythonApplication::OnMouseLeftButtonUp(int x, int y)
void CPythonApplication::OnMouseLeftButtonDoubleClick(int x, int y)
{
UI::CWindowManager& rkWndMgr=UI::CWindowManager::Instance();
#if !defined(__BL_MOUSE_WHEEL_TOP_WINDOW__)
rkWndMgr.RunMouseLeftButtonDown(x, y);
#endif
rkWndMgr.RunMouseLeftButtonDoubleClick(x, y);
}

View File

@ -1513,6 +1513,12 @@ void initapp()
PyModule_AddIntConstant(poModule, "__BL_CLIP_MASK__", false);
#endif
#if defined(__BL_MOUSE_WHEEL_TOP_WINDOW__)
PyModule_AddIntConstant(poModule, "__BL_MOUSE_WHEEL_TOP_WINDOW__", true);
#else
PyModule_AddIntConstant(poModule, "__BL_MOUSE_WHEEL_TOP_WINDOW__", false);
#endif
#ifdef ENABLE_NEW_EQUIPMENT_SYSTEM
PyModule_AddIntConstant(poModule, "ENABLE_NEW_EQUIPMENT_SYSTEM", 1);
#else