Exemple #1
0
BOOL CAddVariableDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_variable_name = "<Variable Name>";
	m_default_value = "<Default Value>";

	// Set variable type to number
	m_type_number = true;
	m_type_campaign_persistent = false;
	m_type_player_persistent = false;
	m_type_network_variable = false;
	set_variable_type();

	m_name_validated = false;
	m_data_validated = false;
	m_create = false;

	// Send default name and values into dialog box
	UpdateData(FALSE);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
void CAddVariableDlg::OnTypePlayerPersistent() {
	m_type_player_persistent = ((CButton *) GetDlgItem(IDC_TYPE_PLAYER_PERSISTENT))->GetCheck() ? true : false;

	if (m_type_player_persistent)
		m_type_campaign_persistent = false;

	set_variable_type();
}
void CAddVariableDlg::OnTypeEternal() {
	m_type_eternal = ((CButton *)GetDlgItem(IDC_TYPE_ETERNAL))->GetCheck() ? true : false;


	// if the variable isn't persistent, it can't be eternal
	if (!m_type_on_mission_close && !m_type_on_mission_progress) {
		m_type_eternal = false;
		MessageBox("Eternal variables must have a different persistence type set first!");
	}

	set_variable_type();
}
void CAddVariableDlg::OnTypeMissionProgress() {
	m_type_on_mission_progress = ((CButton *) GetDlgItem(IDC_TYPE_CAMPAIGN_PERSISTENT))->GetCheck() ? true : false;

	if (m_type_on_mission_progress)
		m_type_on_mission_close = false;

	// if the variable isn't persistent, it can't be eternal
	if (!m_type_on_mission_progress && !m_type_on_mission_close)
		m_type_eternal = false;

	set_variable_type();
}
BOOL CAddVariableDlg::OnInitDialog() {
	CDialog::OnInitDialog();

	// TODO: Add extra initialization here
	m_variable_name = "<Variable Name>";
	m_default_value = "<Default Value>";

	// Set variable type to number
	m_type_number = true;
	m_type_on_mission_progress = false;
	m_type_on_mission_close = false;
	m_type_eternal = false;
	m_type_network_variable = false;
	set_variable_type();

	m_name_validated = false;
	m_data_validated = false;
	m_create = false;

	//create tool tip controls
	m_ProgressToolTip = new CToolTipCtrl();
	m_ProgressToolTip->Create(this);
	m_CloseToolTip = new CToolTipCtrl();
	m_CloseToolTip->Create(this);
	m_EternalToolTip = new CToolTipCtrl();
	m_EternalToolTip->Create(this);

	CWnd* pWnd = GetDlgItem(IDC_TYPE_CAMPAIGN_PERSISTENT);
	m_ProgressToolTip->AddTool(pWnd, "This type of variable will save when the player clicks Accept to go to the next mission");
	m_ProgressToolTip->Activate(TRUE);

	pWnd = GetDlgItem(IDC_TYPE_PLAYER_PERSISTENT);
	m_CloseToolTip->AddTool(pWnd, "This type of variable will save when the player leaves the mission");
	m_CloseToolTip->Activate(TRUE);

	pWnd = GetDlgItem(IDC_TYPE_ETERNAL);
	m_EternalToolTip->AddTool(pWnd, "This type of variable is saved to the player file. So it can be referred to by other campaigns");
	m_EternalToolTip->Activate(TRUE);
	
	// Send default name and values into dialog box
	UpdateData(FALSE);

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
void CAddVariableDlg::OnTypeString() {
	m_type_number = false;
	set_variable_type();
}
void CAddVariableDlg::OnTypeNumber() {
	m_type_number = true;
	set_variable_type();
}
void CAddVariableDlg::OnTypeNetworkVariable() {
	m_type_network_variable = ((CButton *) GetDlgItem(IDC_TYPE_NETWORK_VARIABLE))->GetCheck() ? true : false;
	set_variable_type();
}