diff options
Diffstat (limited to 'src/DbgEquipInfo.cpp')
-rw-r--r-- | src/DbgEquipInfo.cpp | 60 |
1 files changed, 33 insertions, 27 deletions
diff --git a/src/DbgEquipInfo.cpp b/src/DbgEquipInfo.cpp index b9c4487..13928cb 100644 --- a/src/DbgEquipInfo.cpp +++ b/src/DbgEquipInfo.cpp @@ -1,10 +1,10 @@ +#include "StdAfx.h" #include "DbgEquipInfo.h" -#include "LArray.h" -#include "T2CrossEquipArray.h" -#include "T2EquipDef.h" -#include "T2FloorInfo.h" -#include "T2Mover.h" -#include "T2Tenant.h" +#include "T2DLL/LArray.h" +#include "T2DLL/T2CrossEquipArray.h" +#include "T2DLL/T2FloorInfo.h" +#include "T2DLL/T2Mover.h" +#include "T2DLL/T2Tenant.h" #include "T2TowerDoc.h" #include "T2TowerMainView.h" @@ -14,18 +14,22 @@ static char THIS_FILE[] = __FILE__; #endif -DbgEquipInfo::DbgEquipInfo(CWnd *pParentWnd) - : CDialog(160, pParentWnd) +DbgEquipInfo::DbgEquipInfo(CWnd *pParent) + : CDialog(IDD, pParent) { + //{{AFX_DATA_INIT(DbgEquipInfo) + //}}AFX_DATA_INIT } /*virtual*/ void DbgEquipInfo::DoDataExchange(CDataExchange *pDX) { CWnd::DoDataExchange(pDX); - DDX_Control(pDX, 1014, mButton); - DDX_Control(pDX, 1013, mList1); - DDX_Control(pDX, 1011, mStatic1); - DDX_Control(pDX, 1012, mStatic2); - DDX_Control(pDX, 1010, mList2); + //{{AFX_DATA_MAP(DbgEquipInfo) + DDX_Control(pDX, IDC_DEBUG_INFO, mDebugInfoButton); + DDX_Control(pDX, IDC_DEBUG_INFO_LIST, mDebugInfoList); + DDX_Control(pDX, IDC_EQUIP_NAME, mEquipName); + DDX_Control(pDX, IDC_EQUIP_ID, mEquipID); + DDX_Control(pDX, IDC_CROSS_EQUIP_LIST, mCrossEquipList); + //}}AFX_DATA_MAP } void DbgEquipInfo::SetEquip(T2Equip *inEquip) { @@ -41,7 +45,9 @@ void DbgEquipInfo::SetTowerMainView(T2TowerMainView *inView) { } BEGIN_MESSAGE_MAP(DbgEquipInfo, CDialog) - ON_NOTIFY(NM_CLICK, 1010, OnListClick) + //{{AFX_MSG_MAP(DbgEquipInfo) + ON_NOTIFY(NM_CLICK, IDC_CROSS_EQUIP_LIST, OnListClick) + //}}AFX_MSG_MAP END_MESSAGE_MAP() /*virtual*/ BOOL DbgEquipInfo::OnInitDialog() { @@ -49,16 +55,16 @@ END_MESSAGE_MAP() CString str; - mStatic1.SetWindowText(mEquip->GetEquipDef()->mStr48); + mEquipName.SetWindowText(mEquip->GetEquipDef()->mStr48); str.Format("%d", mEquip->mEquipID); - mStatic2.SetWindowText(str); + mEquipID.SetWindowText(str); RECT rect; - mList2.GetClientRect(&rect); + mCrossEquipList.GetClientRect(&rect); int width = rect.right; - mList2.InsertColumn(0, "ID", LVCFMT_LEFT, width / 3); - mList2.InsertColumn(1, "Type", LVCFMT_LEFT, (width * 2) / 3); + mCrossEquipList.InsertColumn(0, "ID", LVCFMT_LEFT, width / 3); + mCrossEquipList.InsertColumn(1, "Type", LVCFMT_LEFT, (width * 2) / 3); LArrayIterator iterator(*mEquip->mCEArray); unsigned int id; @@ -67,32 +73,32 @@ END_MESSAGE_MAP() while (iterator.Next(&id)) { if (id >= 1000) { str.Format("%d", id); - mList2.InsertItem(index, str); + mCrossEquipList.InsertItem(index, str); T2Tenant *tenant = mDocument->mFloorInfo->GetTenant(id); if (tenant) - mList2.SetItemText(index, 1, tenant->GetEquipDef()->mStr48); + mCrossEquipList.SetItemText(index, 1, tenant->GetEquipDef()->mStr48); else - mList2.SetItemText(index, 1, "UNKNOWN"); + mCrossEquipList.SetItemText(index, 1, "UNKNOWN"); } else if (id >= 1) { str.Format("%d", id); - mList2.InsertItem(index, str); + mCrossEquipList.InsertItem(index, str); T2Mover *mover = mDocument->mFloorInfo->GetMover(id); if (mover) - mList2.SetItemText(index, 1, mover->GetEquipDef()->mStr48); + mCrossEquipList.SetItemText(index, 1, mover->GetEquipDef()->mStr48); else - mList2.SetItemText(index, 1, "UNKNOWN"); + mCrossEquipList.SetItemText(index, 1, "UNKNOWN"); } index++; } - mEquip->GetEquipDef()->DebugInfo(mButton, mList1, mEquip); + mEquip->GetEquipDef()->DebugInfo(mDebugInfoButton, mDebugInfoList, mEquip); return true; } void DbgEquipInfo::OnListClick(NMHDR *inHdr, LRESULT *outResult) { - int item = mList2.GetNextItem(-1, LVNI_SELECTED); + int item = mCrossEquipList.GetNextItem(-1, LVNI_SELECTED); if (item != -1) mTowerMainView->SendMessage(WM_COMMAND, MAKELONG(10000 + item, 0), 0); *outResult = 0; |