加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
PageSystem.cpp 2.50 KB
一键复制 编辑 原始数据 按行查看 历史
Shaker 提交于 2014-08-12 21:17 . *提交到Git@OSC
// DialogSystem.cpp : 实现文件
//
#include "stdafx.h"
#include "TurboMir.h"
#include "GameMir.h"
#include "PageSystem.h"
#include ".\pagesystem.h"
// CPageSystem 对话框
IMPLEMENT_DYNAMIC(CPageSystem, CPageBase)
CPageSystem::CPageSystem( CGameMir& game, CWnd* pParent /*= NULL*/ )
: CPageBase(CPageSystem::IDD, pParent)
, m_Game(game)
{
}
CPageSystem::~CPageSystem()
{
}
void CPageSystem::DoDataExchange(CDataExchange* pDX)
{
CPageBase::DoDataExchange(pDX);
DDX_Control(pDX, IDC_SMART_ACC, m_SmartAcc);
DDX_Control(pDX, IDC_MOVE_SPEED, m_MoveSpeed);
DDX_Control(pDX, IDC_ATTACK_SPEED, m_AttackSpeed);
DDX_Control(pDX, IDC_MOVE_SPEED_TEXT, m_MoveSpeedLabel);
DDX_Control(pDX, IDC_ATTACK_SPEED_TEXT, m_AttackSpeedLabel);
DDX_Control(pDX, IDC_SHOW_MINI_MAP, m_ShowMiniMap);
}
BEGIN_MESSAGE_MAP(CPageSystem, CPageBase)
ON_BN_CLICKED(IDC_SMART_ACC, OnBnClickedSmartAcc)
ON_WM_HSCROLL()
ON_BN_CLICKED(IDC_SHOW_MINI_MAP, OnBnClickedShowMiniMap)
END_MESSAGE_MAP()
// CPageSystem 消息处理程序
void CPageSystem::OnBnClickedSmartAcc()
{
if( Updating ) return;
m_Game.m_SettingMgr.SmartAccelerate=(m_SmartAcc.GetCheck()==BST_CHECKED);
m_Game.m_SettingMgr.Save();
}
void CPageSystem::UpdateSets()
{
Updating=true;
if ( m_Game.m_SettingMgr.SmartAccelerate )
m_SmartAcc.SetCheck(BST_CHECKED);
else
m_SmartAcc.SetCheck(BST_UNCHECKED);
if ( m_Game.m_SettingMgr.ShowMiniMap )
m_ShowMiniMap.SetCheck(BST_CHECKED);
else
m_ShowMiniMap.SetCheck(BST_UNCHECKED);
m_AttackSpeed.SetRange(10,2000);
m_MoveSpeed.SetRange(10,2000);
m_AttackSpeed.SetPos(m_Game.m_SettingMgr.AttackSpeed);
m_MoveSpeed.SetPos(m_Game.m_SettingMgr.MoveSpeed);
char strBuf[32];
sprintf(strBuf,"%d",m_Game.m_SettingMgr.AttackSpeed);
m_AttackSpeedLabel.SetWindowText(strBuf);
sprintf(strBuf,"%d",m_Game.m_SettingMgr.MoveSpeed);
m_MoveSpeedLabel.SetWindowText(strBuf);
Updating=false;
}
void CPageSystem::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
CPageBase::OnHScroll(nSBCode, nPos, pScrollBar);
if( Updating ) return;
char strBuf[32];
m_Game.m_SettingMgr.AttackSpeed=m_AttackSpeed.GetPos();
m_Game.m_SettingMgr.MoveSpeed=m_MoveSpeed.GetPos();
sprintf(strBuf,"%d",m_Game.m_SettingMgr.AttackSpeed);
m_AttackSpeedLabel.SetWindowText(strBuf);
sprintf(strBuf,"%d",m_Game.m_SettingMgr.MoveSpeed);
m_MoveSpeedLabel.SetWindowText(strBuf);
m_Game.m_SettingMgr.Save();
}
void CPageSystem::OnBnClickedShowMiniMap()
{
if( Updating ) return;
m_Game.m_SettingMgr.ShowMiniMap=(m_ShowMiniMap.GetCheck()==BST_CHECKED);
m_Game.m_SettingMgr.Save();
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化