加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
MainFrm.h 6.90 KB
一键复制 编辑 原始数据 按行查看 历史
Shaker 提交于 2014-08-18 11:30 . *可编译了
// MainFrm.h : interface of the CMainFrame class
//
#pragma once
#include "BCGExtended\Workspacebar.h"
#include "gamemir.h"
#include "BCGExtended\ColorListCtrl.h"
#include "MapView.h"
#include "BCGExtended\splitterview.h"
#include "LeftView.h"
#include "HeroStatusToolBar.h"
#include "BCGExtended\trayicon.h"
#include "Advert.h"
#include "DialogSetting.h"
#include "TalktoNpcdlg.h"
enum eCharInfoIndex
{
CI_NONE,
CI_NAME,
CI_SEX,
CI_GOLD,//金币
CI_SPOUSE,//配偶
CI_HP,
CI_MP,
CI_PROF,//职业
CI_LEVEL,//等级
CI_AC,//防
CI_MAC,//魔防
CI_DC,//攻击力
CI_MC,//魔法力
CI_SC,//道术
CI_EXP,//经验
CI_BAGWEIGHT,//背包负重
CI_BODYWEIGHT,//负重
CI_HANDWEIGHT,//腕力
CI_ZHUNQUE,//准确
CI_MINJIE,//敏捷
CI_POS,//位置
CI_DRESS,
CI_WEAPON,
CI_RIGHTHAND,
CI_NECKLACE,
CI_HELMET,
CI_ARMRINGL,
CI_ARMRINGR,
CI_RINGL,
CI_RINGR,
CI_BUJUK,
CI_BELT,
CI_BOOTS,
CI_CHARM,
};
// CMessageBox 对话框
class CMessageBox : public CDialogEx
{
DECLARE_DYNAMIC(CMessageBox)
public:
CMessageBox( CWnd* pParent = NULL )
: CDialogEx( IDD, pParent )
{
}
virtual ~CMessageBox()
{
}
// 对话框数据
enum { IDD = IDD_MESSAGEBOX };
protected:
virtual void DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_TEXT, m_Text);
DDX_Control(pDX, IDOK, m_btnOK);
}
DECLARE_MESSAGE_MAP()
public:
CStatic m_Text;
CButton m_btnOK;
afx_msg void OnClose()
{
CDialogEx::OnClose();
delete this;
}
};
class CMainFrame : public CFrameWndEx, public boost::signals::trackable
{
public:
CMainFrame();
protected:
DECLARE_DYNAMIC(CMainFrame)
// Attributes
public:
// Operations
public:
// Overrides
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
CBitmap m_bmpIcon1;
CMFCStatusBar m_wndStatusBar;
UIExtended::CHeroStatusToolBar m_wndHeroStatusBar;
CRichEditView * m_wndView;
CMFCTabCtrl m_wndTabs;
CMessageBox m_wndMsgBox;
CMFCRibbonBar m_wndRibbonBar;
CMFCRibbonApplicationButton m_MainButton;
CMFCToolBarImages m_PanelImages;
void SetProgressPos (int nPos, UINT nID);
public:
CLeftView m_wndLeftView;
CMapView m_wndMap;
#ifdef PUBLIC_EDTION
CAdvert m_wndAdvert;
#endif
CTrayIcon m_TrayIcon;
UIExtended::CWorkspaceBar<CRichEditCtrl> m_wndSystemLog;
UIExtended::CWorkspaceBar<UIExtended::CColorListCtrl> m_wndActors;
UIExtended::CWorkspaceBar<UIExtended::CColorListCtrl> m_wndSelf;
UIExtended::CWorkspaceBar<UIExtended::CColorListCtrl> m_wndBag;
UIExtended::CWorkspaceBar<UIExtended::CColorListCtrl> m_wndUseItem;
UIExtended::CWorkspaceBar<UIExtended::CColorListCtrl> m_wndGround;
#ifndef PUBLIC_EDTION
UIExtended::CWorkspaceBar<CRichEditCtrl> m_wndDebug;
#endif
CDialogSetting m_SettingDialog;
CTalkToNpcDlg m_MerchantDlg;
CString GetTooltipTextBag( LVHITTESTINFO&,UIExtended::CColorListCtrl&,CString& );
COLORREF GetCellTextColorActors ( int , int, UIExtended::CColorListCtrl& );
COLORREF GetCellBkColorActors ( int , int, UIExtended::CColorListCtrl& );
void SetTrayGameStatus(LPCTSTR text);
protected:
BOOL CreateProgress(void);
afx_msg LRESULT OnTrayNotification(WPARAM wp, LPARAM lp);
afx_msg LRESULT OnToolbarReset(WPARAM,LPARAM);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSetFocus(CWnd *pOldWnd);
afx_msg void OnAppLook(UINT id);
afx_msg void OnUpdateAppLook(CCmdUI* pCmdUI);
DECLARE_MESSAGE_MAP()
virtual BOOL OnShowPopupMenu (CMFCPopupMenu* pMenuPopup);
UINT m_nAppLook;
public:
void OnHpChange( long Hp, long MaxHp );
void OnMpChange( long Mp, long MaxMp );
void OnExpChange( long Exp, long MaxExp );
void OnWeightChange( long Wt, long MaxWt );
void OnPositionChange( POINT p);
virtual BOOL LoadFrame(UINT nIDResource, DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, CWnd* pParentWnd = NULL, CCreateContext* pContext = NULL);
afx_msg void OnLogin();
//void DebugOut( const char *pMsg, ... );
void AddLog( sLogMessageType, COLORREF, COLORREF, LPCTSTR );
//void AddChat( LPCTSTR txt, BYTE crFont, BYTE crBack );
CGameMir m_Game;
afx_msg void OnUpdateLogin(CCmdUI *pCmdUI);
void UpdateActors(const CGameMir::sActor& actor, bool update);
void ClearActors() { m_wndActors.m_wndChild.DeleteAllItems(); }
void UpdateSelfInfo();
afx_msg void OnDisconnect();
afx_msg void OnUpdateDisconnect(CCmdUI *pCmdUI);
void ClearBag( ) { m_wndBag.m_wndChild.DeleteAllItems(); }
void UpdateBag( const sClientItem& ci, bool isAdd );
afx_msg void OnUpdateScriptRun(CCmdUI *pCmdUI);
private:
CRITICAL_SECTION m_logSC;
CRITICAL_SECTION m_chtSC;
CRITICAL_SECTION m_dbgSC;
public:
CFont m_Font;
afx_msg void OnSetting();
afx_msg void OnUpdateSetting(CCmdUI *pCmdUI);
afx_msg LRESULT OnAddLog( WPARAM, LPARAM );
afx_msg LRESULT OnDebugOut( WPARAM, LPARAM );
afx_msg LRESULT OnAddChat( WPARAM , LPARAM );
afx_msg void OnAttackmodeChange();
afx_msg void OnAttackmode(UINT nID);
afx_msg void OnUpdateAttackmode(CCmdUI *pCmdUI);
afx_msg void OnUpdateAttackmodeChange(CCmdUI *pCmdUI);
afx_msg void OnUseItem();
afx_msg void OnTimer(UINT nIDEvent);
void UpdateUseItem(void);
void OnItemShow( CGameMir::sDropedItem& di );
void OnItemHide( CGameMir::sDropedItem& di );
afx_msg void OnTalkTo();
afx_msg void OnTakeOn(UINT nID);
afx_msg void OnDropItem();
afx_msg void OnViewActors();
afx_msg void OnViewBag();
afx_msg void OnViewDebug();
afx_msg void OnViewDropeditem();
afx_msg void OnViewSelf();
afx_msg void OnViewUseitem();
afx_msg void OnViewSystemlog();
afx_msg void OnUpdateViewBag(CCmdUI *pCmdUI);
afx_msg void OnUpdateViewDebug(CCmdUI *pCmdUI);
afx_msg void OnUpdateViewDropeditem(CCmdUI *pCmdUI);
afx_msg void OnUpdateViewActors(CCmdUI *pCmdUI);
afx_msg void OnUpdateViewSelf(CCmdUI *pCmdUI);
afx_msg void OnUpdateViewSystemlog(CCmdUI *pCmdUI);
afx_msg void OnUpdateViewUseitem(CCmdUI *pCmdUI);
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnRefreshBag();
afx_msg void OnFightStart();
afx_msg void OnUpdateFightStart(CCmdUI *pCmdUI);
afx_msg void OnShowMain();
afx_msg void OnUpdateShowMain(CCmdUI *pCmdUI);
afx_msg void OnViewObjectWindow();
afx_msg void OnUpdateViewObjectWindow(CCmdUI *pCmdUI);
public:
afx_msg void OnHelpCommand();
public:
afx_msg void OnMoveTo();
public:
afx_msg void OnItemNopick();
afx_msg void OnNormalPickup();
afx_msg void OnFirstPickup();
afx_msg void OnMustPickup();
afx_msg void OnUpdateItemNopick(CCmdUI *pCmdUI);
afx_msg void OnUpdateItemNormalPickup(CCmdUI *pCmdUI);
afx_msg void OnUpdateItemFirstPickup(CCmdUI *pCmdUI);
afx_msg void OnUpdateItemMustPickup(CCmdUI *pCmdUI);
//void OnPropertyChanged(CMFCProp*pProp);
BOOL InitWndSetting(void);
void OnGameMessageBox(LPCTSTR,UINT);
int MyMessageBox(LPCTSTR lpText, LPCTSTR lpCaption, UINT uType);
afx_msg void OnUpdateInGameEnable(CCmdUI *pCmdUI);
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化