diff --git a/src/EterPythonLib/PythonWindow.cpp b/src/EterPythonLib/PythonWindow.cpp index 6096df41..32c6f800 100644 --- a/src/EterPythonLib/PythonWindow.cpp +++ b/src/EterPythonLib/PythonWindow.cpp @@ -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�� "�ڽ��� ���̴°�?" ������, __IsShowing�� "�ڽ��� �׷����� �ִ°�?" �� üũ�Ѵ� // �ڽ��� Show ���� Tree ������ Parent �� �ϳ��� Hide �� �� �����Ƿ�.. - [levites] bool CWindow::IsRendering() diff --git a/src/EterPythonLib/PythonWindow.h b/src/EterPythonLib/PythonWindow.h index 90dfe6d3..4f871ace 100644 --- a/src/EterPythonLib/PythonWindow.h +++ b/src/EterPythonLib/PythonWindow.h @@ -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 ///////////////////////////////////// diff --git a/src/EterPythonLib/PythonWindowManager.cpp b/src/EterPythonLib/PythonWindowManager.cpp index aee2bf73..c0439cdd 100644 --- a/src/EterPythonLib/PythonWindowManager.cpp +++ b/src/EterPythonLib/PythonWindowManager.cpp @@ -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() diff --git a/src/EterPythonLib/PythonWindowManager.h b/src/EterPythonLib/PythonWindowManager.h index d7681a21..2ed338f7 100644 --- a/src/EterPythonLib/PythonWindowManager.h +++ b/src/EterPythonLib/PythonWindowManager.h @@ -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; diff --git a/src/EterPythonLib/PythonWindowManagerModule.cpp b/src/EterPythonLib/PythonWindowManagerModule.cpp index 80198849..b5606e00 100644 --- a/src/EterPythonLib/PythonWindowManagerModule.cpp +++ b/src/EterPythonLib/PythonWindowManagerModule.cpp @@ -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 }, diff --git a/src/UserInterface/Locale.h b/src/UserInterface/Locale.h index 35c60cc2..24b30560 100644 --- a/src/UserInterface/Locale.h +++ b/src/UserInterface/Locale.h @@ -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(); diff --git a/src/UserInterface/PythonApplicationEvent.cpp b/src/UserInterface/PythonApplicationEvent.cpp index 7919e3b4..33eb06ac 100644 --- a/src/UserInterface/PythonApplicationEvent.cpp +++ b/src/UserInterface/PythonApplicationEvent.cpp @@ -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.��ö��HackShield�� �浹 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); } diff --git a/src/UserInterface/PythonApplicationModule.cpp b/src/UserInterface/PythonApplicationModule.cpp index 98b1a7e7..aa65c395 100644 --- a/src/UserInterface/PythonApplicationModule.cpp +++ b/src/UserInterface/PythonApplicationModule.cpp @@ -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