代码拉取完成,页面将自动刷新
// 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();
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。