displaysettings.cpp

来自「The application wizard has created this 」· C++ 代码 · 共 44 行

CPP
44
字号
#include "StdAfx.h"
#include "SoccerDoctor.h" // theApp
#include "DisplaySettings.h"
CDisplaySettings::CDisplaySettings(void)
{
	LoadSettings();
}

CDisplaySettings::~CDisplaySettings(void)
{
	SaveSettings();
}
void CDisplaySettings::LoadSettings()
{
	CString strScale ;
	strScale.Format("%.3f",3.0);
	strScale = theApp.GetProfileString("Displayer","PlayerScale",strScale);
	m_dPlayerScale = atof(strScale);
	if( m_dPlayerScale < MIN_PLAYER_SCALE || m_dPlayerScale > MAX_PLAYER_SCALE){
		m_dPlayerScale = 3.0;
	}
	m_bNumber = (theApp.GetProfileInt("Displayer","Number",0) == 1);
	m_bKickmargin = (theApp.GetProfileInt("Displayer","Kickmargin",0) == 1);
	m_bViewarea = (theApp.GetProfileInt("Displayer","Viewarea",0) == 1);
	m_bStamina = (theApp.GetProfileInt("Displayer","Stamina",1) == 1);
	m_bVelocity = (theApp.GetProfileInt("Displayer","Velocity",0) == 1);
	m_bOffsideLine = (theApp.GetProfileInt("Displayer","OffsideLine",0) == 1);
	m_bBallDetail = (theApp.GetProfileInt("Displayer","BallDetail",0) == 1);
	m_bControlCourse = (theApp.GetProfileInt("Displayer","ControlCourse",0) == 1);
}
void CDisplaySettings::SaveSettings()
{
	CString strScale;
	strScale.Format("%.3f",m_dPlayerScale);
	theApp.WriteProfileString("Displayer","PlayerScale",strScale);
	theApp.WriteProfileInt("Displayer","Number",m_bNumber);
	theApp.WriteProfileInt("Displayer","Kickmargin",m_bKickmargin);
	theApp.WriteProfileInt("Displayer","Viewarea",m_bViewarea);
	theApp.WriteProfileInt("Displayer","Stamina",m_bStamina);
	theApp.WriteProfileInt("Displayer","Velocity",m_bVelocity);
	theApp.WriteProfileInt("Displayer","OffsideLine",m_bOffsideLine);
	theApp.WriteProfileInt("Displayer","BallDetail",m_bBallDetail);
	theApp.WriteProfileInt("Displayer","ControlCourse",m_bControlCourse);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?