加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
PageWarrior.cpp 3.47 KB
一键复制 编辑 原始数据 按行查看 历史
Shaker 提交于 2014-08-12 21:17 . *提交到Git@OSC
// PageWarrior.cpp : 实现文件
//
#include "stdafx.h"
#include "TurboMir.h"
#include "GameMir.h"
#include "PageWarrior.h"
#include ".\pagewarrior.h"
// CPageWarrior 对话框
IMPLEMENT_DYNAMIC(CPageWarrior, CPageBase)
CPageWarrior::CPageWarrior( CGameMir& game, CWnd* pParent /*= NULL*/ )
: CPageBase(CPageWarrior::IDD, pParent)
, m_Game(game)
{
}
CPageWarrior::~CPageWarrior()
{
}
void CPageWarrior::DoDataExchange(CDataExchange* pDX)
{
CPageBase::DoDataExchange(pDX);
DDX_Control(pDX, IDC_CHECK1, m_AlwaysLongHit);
DDX_Control(pDX, IDC_AUTO_WIDEHIT, m_AutoWideHit);
DDX_Control(pDX, IDC_WIDEHIT_LEVEL, m_WideHitLevel);
DDX_Control(pDX, IDC_AUTO_FIREHIT, m_AutoFireHit);
DDX_Control(pDX, IDC_FIREHIT_DELAY, m_FireHitDelay);
DDX_Control(pDX, IDC_FIREHIT_CLOSEON, m_FireHitCloseOn);
}
BEGIN_MESSAGE_MAP(CPageWarrior, CPageBase)
ON_BN_CLICKED(IDC_ALWAYS_LONG_HIT, OnBnClickedAlwaysLongHit)
ON_BN_CLICKED(IDC_AUTO_WIDEHIT, OnBnClickedAutoWidehit)
ON_EN_CHANGE(IDC_WIDEHIT_LEVEL, OnEnChangeWidehitLevel)
ON_BN_CLICKED(IDC_AUTO_FIREHIT, OnBnClickedAutoFirehit)
ON_EN_CHANGE(IDC_FIREHIT_DELAY, OnEnChangeFirehitDelay)
ON_BN_CLICKED(IDC_FIREHIT_CLOSEON, OnBnClickedFirehitCloseon)
END_MESSAGE_MAP()
// CPageWarrior 消息处理程序
void CPageWarrior::UpdateSets()
{
Updating=true;
if ( m_Game.m_SettingMgr.AlwaysLongHit )
m_AlwaysLongHit.SetCheck(BST_CHECKED);
else
m_AlwaysLongHit.SetCheck(BST_UNCHECKED);
if ( m_Game.m_SettingMgr.AutoWideHit )
m_AutoWideHit.SetCheck(BST_CHECKED);
else
m_AutoWideHit.SetCheck(BST_UNCHECKED);
if ( m_Game.m_SettingMgr.AutoFireHit )
m_AutoFireHit.SetCheck(BST_CHECKED);
else
m_AutoFireHit.SetCheck(BST_UNCHECKED);
char str[16];
m_WideHitLevel.SetWindowText(itoa(m_Game.m_SettingMgr.WideHitLevel,str,10));
m_FireHitDelay.SetWindowText(itoa(m_Game.m_SettingMgr.FireHitDelay,str,10));
Updating=false;
}
void CPageWarrior::OnBnClickedAlwaysLongHit()
{
if( Updating ) return;
m_Game.m_SettingMgr.AlwaysLongHit=(m_AlwaysLongHit.GetCheck()==BST_CHECKED);
m_Game.m_SettingMgr.Save();
}
void CPageWarrior::OnBnClickedAutoWidehit()
{
if( Updating ) return;
m_Game.m_SettingMgr.AutoWideHit=(m_AutoWideHit.GetCheck()==BST_CHECKED);
m_Game.m_SettingMgr.Save();
}
void CPageWarrior::OnEnChangeWidehitLevel()
{
if( Updating ) return;
char str[16];
m_WideHitLevel.GetWindowText(str,16);
m_Game.m_SettingMgr.WideHitLevel=boost::lexical_cast<int>(str);
if ( m_Game.m_SettingMgr.WideHitLevel>4 )
{
m_Game.m_SettingMgr.WideHitLevel=4;
m_WideHitLevel.SetWindowText("4");
}
else if ( m_Game.m_SettingMgr.WideHitLevel<0 )
{
m_Game.m_SettingMgr.WideHitLevel=0;
m_WideHitLevel.SetWindowText("0");
}
m_Game.m_SettingMgr.Save();
}
void CPageWarrior::OnBnClickedAutoFirehit()
{
if( Updating ) return;
m_Game.m_SettingMgr.AutoFireHit=(m_AutoFireHit.GetCheck()==BST_CHECKED);
m_Game.m_SettingMgr.Save();
}
void CPageWarrior::OnEnChangeFirehitDelay()
{
if( Updating ) return;
char str[32];
m_FireHitDelay.GetWindowText(str,32);
m_Game.m_SettingMgr.FireHitDelay=boost::lexical_cast<int>(str);
if ( m_Game.m_SettingMgr.FireHitDelay>20000 )
{
m_Game.m_SettingMgr.FireHitDelay=20000;
m_FireHitDelay.SetWindowText("20000");
}
else if ( m_Game.m_SettingMgr.FireHitDelay<1000 )
{
m_Game.m_SettingMgr.FireHitDelay=1000;
m_FireHitDelay.SetWindowText("1000");
}
m_Game.m_SettingMgr.Save();
}
void CPageWarrior::OnBnClickedFirehitCloseon()
{
if( Updating ) return;
m_Game.m_SettingMgr.AlwaysLongHit=(m_AlwaysLongHit.GetCheck()==BST_CHECKED);
m_Game.m_SettingMgr.Save();
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化