本文整理汇总了C++中Campaign::Name方法的典型用法代码示例。如果您正苦于以下问题:C++ Campaign::Name方法的具体用法?C++ Campaign::Name怎么用?C++ Campaign::Name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Campaign
的用法示例。
在下文中一共展示了Campaign::Name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
CmpLoadDlg::Show()
{
FormWindow::Show();
Campaign* campaign = Campaign::GetCampaign();
if (campaign) {
Bitmap* bmp = campaign->GetImage(3);
if (img_title && bmp) {
Rect tgt_rect;
tgt_rect.w = img_title->Width();
tgt_rect.h = img_title->Height();
img_title->SetTargetRect(tgt_rect);
img_title->SetPicture(*bmp);
}
if (lbl_title)
lbl_title->SetText(campaign->Name());
}
show_time = Game::RealTime();
}
示例2: if
void
MsnSelectDlg::Show()
{
FormWindow::Show();
campaign = Campaign::GetCampaign();
if (cmb_campaigns) {
int n = 0;
cmb_campaigns->ClearItems();
ListIter<Campaign> iter = Campaign::GetAllCampaigns();
while (++iter) {
Campaign* c = iter.value();
if (c->GetCampaignId() >= Campaign::SINGLE_MISSIONS) {
cmb_campaigns->AddItem(c->Name());
if (campaign->GetCampaignId() < Campaign::SINGLE_MISSIONS) {
campaign = Campaign::SelectCampaign(c->Name());
cmb_campaigns->SetSelection(n);
}
else if (campaign->GetCampaignId() == c->GetCampaignId()) {
cmb_campaigns->SetSelection(n);
}
n++;
}
}
}
else if (lst_campaigns) {
int n = 0;
lst_campaigns->ClearItems();
ListIter<Campaign> iter = Campaign::GetAllCampaigns();
while (++iter) {
Campaign* c = iter.value();
if (c->GetCampaignId() >= Campaign::SINGLE_MISSIONS) {
lst_campaigns->AddItem(c->Name());
if (campaign->GetCampaignId() < Campaign::SINGLE_MISSIONS) {
campaign = Campaign::SelectCampaign(c->Name());
lst_campaigns->SetSelected(n);
}
else if (campaign->GetCampaignId() == c->GetCampaignId()) {
lst_campaigns->SetSelected(n);
}
n++;
}
}
}
if (campaign) {
int id = campaign->GetCampaignId();
editable = (id >= Campaign::MULTIPLAYER_MISSIONS &&
id <= Campaign::CUSTOM_MISSIONS);
if (btn_new) btn_new->SetEnabled(editable);
if (btn_edit) btn_edit->SetEnabled(false);
if (btn_del) btn_del->SetEnabled(false);
}
if (description)
description->SetText(Game::GetText("MsnSelectDlg.choose"));
if (lst_missions) {
lst_missions->ClearItems();
if (campaign) {
ListIter<MissionInfo> iter = campaign->GetMissionList();
while (++iter) {
MissionInfo* info = iter.value();
Mission* m = info->mission;
lst_missions->AddItem(info->name);
if (m && m == edit_mission) {
lst_missions->SetSelected(lst_missions->NumItems()-1);
}
}
if (selected_mission >= 0 && lst_missions->GetSelCount() == 0) {
lst_missions->SetSelected(selected_mission);
}
}
OnMissionSelect(0);
edit_mission = 0;
}
}