port: complete 100% logic layer, eliminate pending dir, and unify client_main on port route
- Completed batch 4-f (Messenger, Guild, GuildMark), 4-g (PythonSystem, systemSetting), 4-h (PythonSoundManagerModule, MilesLib CSoundManager) - Ported UserInterface/Locale.cpp, EterLocale/Japanese.cpp, EterLib/PathStack, EterLib/NetDatagram* UDP suite - Modularized PythonApplication into Camera and Event handlers aligning with 40250 signatures - Completely removed extension/src/platform/pending/ directory - Logic layer reached 100.0% completion (3338/3338 functions, 0 TODO, 0 DIVERGENT) with empty port-map queue - Removed legacy AppFlow route and fallback from project/client_main.gd, switching main loop unconditionally to native port route - Verified 15/15 port.login_flow integration steps and 19/19 port_gate suites passing
This commit is contained in:
@@ -0,0 +1,217 @@
|
||||
#include "UserInterface/StdAfx.h"
|
||||
#include "UserInterface/PythonApplication.h"
|
||||
#include "UserInterface/PythonBackground.h"
|
||||
#include "EterLib/Camera.h"
|
||||
|
||||
extern PyObject* s_poMouseHandler;
|
||||
|
||||
void CPythonApplication::OnCameraUpdate()
|
||||
{
|
||||
if ( CPythonBackground::Instance().IsMapReady() )
|
||||
{
|
||||
CCamera* pkCameraMgr = CCameraManager::Instance().GetCurrentCamera();
|
||||
if (pkCameraMgr)
|
||||
pkCameraMgr->Update();
|
||||
}
|
||||
}
|
||||
|
||||
void CPythonApplication::OnUIUpdate()
|
||||
{
|
||||
UI::CWindowManager& rkUIMgr = UI::CWindowManager::Instance();
|
||||
rkUIMgr.Update();
|
||||
}
|
||||
|
||||
void CPythonApplication::OnUIRender()
|
||||
{
|
||||
UI::CWindowManager& rkUIMgr = UI::CWindowManager::Instance();
|
||||
rkUIMgr.Render();
|
||||
}
|
||||
|
||||
void CPythonApplication::OnSizeChange(int width, int height)
|
||||
{
|
||||
}
|
||||
|
||||
void CPythonApplication::OnMouseMiddleButtonDown(int x, int y)
|
||||
{
|
||||
CCameraManager& rkCmrMgr = CCameraManager::Instance();
|
||||
CCamera* pkCmrCur = rkCmrMgr.GetCurrentCamera();
|
||||
if (pkCmrCur)
|
||||
pkCmrCur->BeginDrag(x, y);
|
||||
|
||||
if ( !CPythonBackground::Instance().IsMapReady() )
|
||||
return;
|
||||
|
||||
SetCursorNum(CAMERA_ROTATE);
|
||||
if ( CURSOR_MODE_HARDWARE == GetCursorMode())
|
||||
SetCursorVisible(FALSE, true);
|
||||
}
|
||||
|
||||
void CPythonApplication::OnMouseMiddleButtonUp(int x, int y)
|
||||
{
|
||||
CCameraManager& rkCmrMgr = CCameraManager::Instance();
|
||||
CCamera* pkCmrCur = rkCmrMgr.GetCurrentCamera();
|
||||
if (pkCmrCur)
|
||||
pkCmrCur->EndDrag();
|
||||
|
||||
if ( !CPythonBackground::Instance().IsMapReady() )
|
||||
return;
|
||||
|
||||
SetCursorNum(NORMAL);
|
||||
if ( CURSOR_MODE_HARDWARE == GetCursorMode())
|
||||
SetCursorVisible(TRUE);
|
||||
}
|
||||
|
||||
void CPythonApplication::OnMouseWheel(int nLen)
|
||||
{
|
||||
CCameraManager& rkCmrMgr = CCameraManager::Instance();
|
||||
CCamera* pkCmrCur = rkCmrMgr.GetCurrentCamera();
|
||||
if (pkCmrCur)
|
||||
pkCmrCur->Wheel(nLen);
|
||||
}
|
||||
|
||||
void CPythonApplication::OnMouseMove(int x, int y)
|
||||
{
|
||||
CCameraManager& rkCmrMgr = CCameraManager::Instance();
|
||||
CCamera* pkCmrCur = rkCmrMgr.GetCurrentCamera();
|
||||
|
||||
POINT Point;
|
||||
if (pkCmrCur)
|
||||
{
|
||||
if ( CPythonBackground::Instance().IsMapReady() && pkCmrCur->Drag(x, y, &Point) )
|
||||
{
|
||||
x = Point.x;
|
||||
y = Point.y;
|
||||
}
|
||||
}
|
||||
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunMouseMove(x, y);
|
||||
}
|
||||
|
||||
void CPythonApplication::OnMouseLeftButtonDown(int x, int y)
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunMouseLeftButtonDown(x, y);
|
||||
}
|
||||
|
||||
void CPythonApplication::OnMouseLeftButtonUp(int x, int y)
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunMouseLeftButtonUp(x, y);
|
||||
}
|
||||
|
||||
void CPythonApplication::OnMouseLeftButtonDoubleClick(int x, int y)
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunMouseLeftButtonDown(x, y);
|
||||
rkWndMgr.RunMouseLeftButtonDoubleClick(x, y);
|
||||
}
|
||||
|
||||
void CPythonApplication::OnMouseRightButtonDown(int x, int y)
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunMouseRightButtonDown(x, y);
|
||||
}
|
||||
|
||||
void CPythonApplication::OnMouseRightButtonUp(int x, int y)
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunMouseRightButtonUp(x, y);
|
||||
}
|
||||
|
||||
void CPythonApplication::OnKeyDown(int iIndex)
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
|
||||
if (DIK_ESCAPE == iIndex)
|
||||
{
|
||||
rkWndMgr.RunPressEscapeKey();
|
||||
}
|
||||
|
||||
rkWndMgr.RunKeyDown(iIndex);
|
||||
}
|
||||
|
||||
void CPythonApplication::OnKeyUp(int iIndex)
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunKeyUp(iIndex);
|
||||
}
|
||||
|
||||
void CPythonApplication::RunIMEUpdate()
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunIMEUpdate();
|
||||
}
|
||||
|
||||
void CPythonApplication::RunIMETabEvent()
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunIMETabEvent();
|
||||
}
|
||||
|
||||
void CPythonApplication::RunIMEReturnEvent()
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunIMEReturnEvent();
|
||||
}
|
||||
|
||||
void CPythonApplication::OnIMEKeyDown(int iIndex)
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunIMEKeyDown(iIndex);
|
||||
}
|
||||
|
||||
void CPythonApplication::RunIMEChangeCodePage()
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunChangeCodePage();
|
||||
}
|
||||
|
||||
void CPythonApplication::RunIMEOpenCandidateListEvent()
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunOpenCandidate();
|
||||
}
|
||||
|
||||
void CPythonApplication::RunIMECloseCandidateListEvent()
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunCloseCandidate();
|
||||
}
|
||||
|
||||
void CPythonApplication::RunIMEOpenReadingWndEvent()
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunOpenReading();
|
||||
}
|
||||
|
||||
void CPythonApplication::RunIMECloseReadingWndEvent()
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunCloseReading();
|
||||
}
|
||||
|
||||
void CPythonApplication::RunPressExitKey()
|
||||
{
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
rkWndMgr.RunPressExitKey();
|
||||
}
|
||||
|
||||
void CPythonApplication::OnMouseUpdate()
|
||||
{
|
||||
if (!s_poMouseHandler)
|
||||
return;
|
||||
|
||||
UI::CWindowManager& rkWndMgr = UI::CWindowManager::Instance();
|
||||
long lx, ly;
|
||||
rkWndMgr.GetMousePosition(lx, ly);
|
||||
PyCallClassMemberFunc(s_poMouseHandler, "Update", Py_BuildValue("(ii)", lx, ly));
|
||||
}
|
||||
|
||||
void CPythonApplication::OnMouseRender()
|
||||
{
|
||||
if (!s_poMouseHandler)
|
||||
return;
|
||||
|
||||
PyCallClassMemberFunc(s_poMouseHandler, "Render", Py_BuildValue("()"));
|
||||
}
|
||||
Reference in New Issue
Block a user