// CharSheetView.cpp : ±¸Çö ÆÄÀÏÀÔ´Ï´Ù. // #include "stdafx.h" #include "AdminToolClient.h" #include "AdminStoreDlgBar.h" #include "CharSheetView.h" #include "PacketManager.h" #include "GlobalFunctions.h" #include #include // CCharSheetView IMPLEMENT_DYNCREATE(CCharSheetView, CFormView) CCharSheetView::CCharSheetView() : CFormView(CCharSheetView::IDD) , m_strSheetInfo(_T("[Not select character]")) , m_lpModifyCharInfo(NULL) , m_dwDocKey(0) { m_strSheetInfo = GetLocalString("MSG_0131"); } CCharSheetView::~CCharSheetView() { if( NULL != m_pCharPropertySheet ) { delete m_pCharPropertySheet; } } void CCharSheetView::DoDataExchange(CDataExchange* pDX) { CFormView::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CCharSheetView, CFormView) ON_WM_CTLCOLOR() ON_BN_CLICKED(IDC_CHARUPDATE_BTN, OnBnClickedCharupdateBtn) ON_BN_CLICKED(IDC_OVERLAPITEMLIST_BTN, OnBnClickedOverlapitemlistBtn) END_MESSAGE_MAP() // CCharSheetView Áø´ÜÀÔ´Ï´Ù. #ifdef _DEBUG void CCharSheetView::AssertValid() const { CFormView::AssertValid(); } void CCharSheetView::Dump(CDumpContext& dc) const { CFormView::Dump(dc); } #endif //_DEBUG // CCharSheetView ¸Þ½ÃÁö 󸮱âÀÔ´Ï´Ù. void CCharSheetView::OnInitialUpdate() { CFormView::OnInitialUpdate(); CWnd* pwndPropSheetHolder = GetDlgItem(IDC_PLACEHOLDER); // ÇÁ·ÎÆÛƼ ½ÃÆ®ÀÇ È¦´õ·Î ÇÈÃÄ ÄÁÆ®·Ñ »ç¿ë m_pCharPropertySheet = new CCharPropertySheet(_T("Character Property Sheet"), pwndPropSheetHolder); if(!m_pCharPropertySheet->Create(pwndPropSheetHolder, WS_CHILD | WS_VISIBLE, 0)) { delete m_pCharPropertySheet; m_pCharPropertySheet = NULL; return; } // ÇÈÃÄ ÄÁÆ®·Ñ Å©±â¿¡ ¸Â°Ô ÇÁ·ÎÆÛƼ ½ÃÆ® »çÀÌÁî ¼³Á¤ CRect rectPropSheet; pwndPropSheetHolder->GetWindowRect(rectPropSheet); m_pCharPropertySheet->SetWindowPos(NULL, 0, 0, rectPropSheet.Width(), rectPropSheet.Height(), SWP_NOZORDER | SWP_NOACTIVATE); SetUIString(this->m_hWnd, IDC_CHARUPDATE_BTN, "IDC_CHARUPDATE_BTN"); SetUIString(this->m_hWnd, IDC_OVERLAPITEMLIST_BTN, "IDC_OVERLAPITEMLIST_BTN"); } HBRUSH CCharSheetView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor); pDC->SetTextColor(RGB(0,0,255)); return hbr; } bool CCharSheetView::SetCharSheetInfo(unsigned int dwDocKey, CModifyCharacter* lpCharacter) { GetDlgItem(IDC_OVERLAPITEMLIST_BTN)->EnableWindow(false); if(0 != dwDocKey && NULL != lpCharacter) { m_lpModifyCharInfo = lpCharacter; m_dwDocKey = dwDocKey; // Áߺ¹ ¾ÆÀÌÅÛ °Ë»ç¿¡ ÇÊ¿äÇÑ º¯¼ö ÃʱâÈ­ m_lpModifyCharInfo->m_ModifyCharItemSerialInfo.clear(); m_lpModifyCharInfo->m_OverlapSerialInfo.clear(); m_lpModifyCharInfo->SetOwnCopyItemState(false); m_pCharPropertySheet->SetAllPage(dwDocKey, lpCharacter); // ÇÁ·ÎÆÛƼ ½ÃÆ®³»¿¡¼­ ¸ðµç ÆäÀÌÁö Á¤º¸ Ç¥½Ã GetDlgItem(IDC_CHARUPDATE_BTN)->EnableWindow(true); if(m_lpModifyCharInfo->IsOwnCopyItem()) { GetDlgItem(IDC_OVERLAPITEMLIST_BTN)->EnableWindow(true); Report(GetLocalString("MSG_0132"), NOTIFY); } UpdateData(false); return true; } else { return false; } } void CCharSheetView::PostNcDestroy() { CFormView::PostNcDestroy(); } void CCharSheetView::OnBnClickedCharupdateBtn() { CPacketMgr::GetInstance()->SendSetCharacter( m_lpModifyCharInfo->GetServerGroup(), m_lpModifyCharInfo->GetCID(), m_lpModifyCharInfo->GetUID(), m_dwDocKey, m_lpModifyCharInfo->GetOldServerGroupID()); } void CCharSheetView::OnBnClickedOverlapitemlistBtn() { CModifyCharacter::OverlapSerialInfo::iterator itr = m_lpModifyCharInfo->m_OverlapSerialInfo.begin(); CModifyCharacter::OverlapSerialInfo::iterator end = m_lpModifyCharInfo->m_OverlapSerialInfo.end(); CString strFormat; Report(_T("[Copy Item Serial List]"), NOTIFY); for(;itr != end; ++itr) { strFormat.Format(_T("0x%016I64x"), (*itr)); Report(strFormat, NOTIFY); } }