Game client codebase including: - CharacterActionControl: Character and creature management - GlobalScript: Network, items, skills, quests, utilities - RYLClient: Main client application with GUI and event handlers - Engine: 3D rendering engine (RYLGL) - MemoryManager: Custom memory allocation - Library: Third-party dependencies (DirectX, boost, etc.) - Tools: Development utilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
101 lines
2.3 KiB
C++
101 lines
2.3 KiB
C++
// LogEdit.cpp : 구현 파일입니다.
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "LogEdit.h"
|
|
|
|
|
|
// CLogEdit
|
|
|
|
IMPLEMENT_DYNAMIC(CLogEdit, CEdit)
|
|
CLogEdit::CLogEdit()
|
|
{
|
|
}
|
|
|
|
CLogEdit::~CLogEdit()
|
|
{
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CLogEdit, CEdit)
|
|
ON_WM_CHAR()
|
|
ON_WM_RBUTTONDOWN()
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
|
|
// CLogEdit 메시지 처리기입니다.
|
|
|
|
|
|
void CLogEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
|
|
{
|
|
// TODO: 여기에 메시지 처리기 코드를 추가 및/또는 기본값을 호출합니다.
|
|
|
|
// CEdit::OnChar(nChar, nRepCnt, nFlags);
|
|
}
|
|
|
|
void CLogEdit::OnRButtonDown(UINT nFlags, CPoint point)
|
|
{
|
|
// TODO: 여기에 메시지 처리기 코드를 추가 및/또는 기본값을 호출합니다.
|
|
|
|
CEdit::OnRButtonDown(nFlags, point);
|
|
}
|
|
|
|
void CLogEdit::AddLine(LPCTSTR szLine, int nIndex, bool bNewLine)
|
|
{
|
|
m_szTempLine.SetString(szLine);
|
|
if (bNewLine) { m_szTempLine.Append("\r\n"); }
|
|
|
|
if (OpenClipboard())
|
|
{
|
|
BOOL bAddedLine = FALSE;
|
|
|
|
int nLength = m_szTempLine.GetLength();
|
|
HANDLE hGlobalCopy = GlobalAlloc(GMEM_MOVEABLE, (nLength + 1) * sizeof(TCHAR));
|
|
if (0 != hGlobalCopy)
|
|
{
|
|
// Lock the handle and copy the text to the buffer.
|
|
LPTSTR lptstrCopy = reinterpret_cast<LPTSTR>(GlobalLock(hGlobalCopy));
|
|
memcpy(lptstrCopy, m_szTempLine.GetString(), nLength * sizeof(TCHAR));
|
|
lptstrCopy[nLength] = _T('\0');
|
|
GlobalUnlock(hGlobalCopy);
|
|
|
|
// Place the handle on the clipboard.
|
|
if(0 != SetClipboardData(CF_TEXT, hGlobalCopy))
|
|
{
|
|
bAddedLine = TRUE;
|
|
}
|
|
else
|
|
{
|
|
GlobalFree(hGlobalCopy);
|
|
}
|
|
}
|
|
|
|
CloseClipboard();
|
|
|
|
if (bAddedLine)
|
|
{
|
|
int nCharPos = 0;
|
|
int nLinePos = 0;
|
|
|
|
if (-1 == nIndex || -1 == (nCharPos = LineIndex(nIndex)))
|
|
{
|
|
// 맨 마지막 라인에 추가
|
|
nLinePos = GetLineCount();
|
|
nCharPos = GetWindowTextLength();
|
|
SetSel(nCharPos, nCharPos);
|
|
}
|
|
else
|
|
{
|
|
// 현재 라인에 추가
|
|
SetSel(nCharPos, nCharPos);
|
|
nLinePos = LineFromChar(nCharPos);
|
|
}
|
|
|
|
Paste();
|
|
LineScroll(nLinePos);
|
|
}
|
|
}
|
|
}
|
|
|