当前位置: 首页>>代码示例>>C++>>正文


C++ Mission::Name方法代码示例

本文整理汇总了C++中Mission::Name方法的典型用法代码示例。如果您正苦于以下问题:C++ Mission::Name方法的具体用法?C++ Mission::Name怎么用?C++ Mission::Name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mission的用法示例。


在下文中一共展示了Mission::Name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

void
MsnSelectDlg::OnDel(AWEvent* event)
{
	const char* cname = 0;

	if (cmb_campaigns)
	cname = cmb_campaigns->GetSelectedItem();
	else if (lst_campaigns)
	cname = lst_campaigns->GetSelectedItem();

	Campaign* c = Campaign::SelectCampaign(cname);
	if (!c) return;

	Mission* m = c->GetMission(mission_id);
	if (!m) return;

	ConfirmDlg* confirm = manager->GetConfirmDlg();
	if (confirm) {
		char msg[256];
		sprintf_s(msg, Game::GetText("MsnSelectDlg.are-you-sure").data(), m->Name());
		confirm->SetMessage(msg);
		confirm->SetTitle(Game::GetText("MsnSelectDlg.confirm-delete"));
		confirm->SetParentControl(btn_del);

		manager->ShowConfirmDlg();
	}

	else {
		OnDelConfirm(event);
	}
}
开发者ID:The-E,项目名称:Starshatter-Experimental,代码行数:31,代码来源:MsnSelectDlg.cpp

示例2: BeginPaint

bool
StarServer::OnPaint()
{
    PAINTSTRUCT paintstruct;
    HDC hdc = BeginPaint(hwnd, &paintstruct);

    Text txt_title = title_text;
    Text txt_mode;
    Text txt_users = Game::GetText("server.no-users");
    char buf[256];

    txt_title += " ";
    txt_title += versionInfo;

    switch (game_mode) {
    case LOAD_MODE:
    case MENU_MODE:  
        txt_mode = Game::GetText("server.mode.lobby");

        if (lobby_server) {
            sprintf_s(buf, Game::GetText("server.users").data(), lobby_server->NumUsers());
            txt_users = buf;
        }
        break;

    case PLAY_MODE:  
        txt_mode = Game::GetText("server.mode.active");
        if (lobby_server) {
            sprintf_s(buf, Game::GetText("server.users-and-players").data(), lobby_server->NumUsers(), NetGame::NumPlayers());
        }
        else {
            sprintf_s(buf, Game::GetText("server.players").data(), NetGame::NumPlayers());
        }
        txt_users = buf;
        break;

    default:
        txt_mode = Game::GetText("server.mode.other");
        break;
    }

    if (lobby_server && lobby_server->GetStatus() == NetServerInfo::PERSISTENT)
    txt_mode += " " + Game::GetText("server.alt.persistent");

    if (paused)
    txt_mode += " " + Game::GetText("server.alt.paused");

    TextOut(hdc, 4,  4, txt_title, txt_title.length());
    TextOut(hdc, 4, 22, txt_mode,  txt_mode.length());
    TextOut(hdc, 4, 40, txt_users, txt_users.length());

    Sim* sim = Sim::GetSim();
    if (sim && sim->GetMission()) {
        Mission* mission = sim->GetMission();
        Text txt_msn = Game::GetText("server.mission");
        txt_msn += mission->Name();
        TextOut(hdc, 4, 58, txt_msn, txt_msn.length());
    }

    EndPaint(hwnd, &paintstruct);
    return true;
}
开发者ID:Banbury,项目名称:starshatter-open,代码行数:62,代码来源:StarServer.cpp


注:本文中的Mission::Name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。