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


C++ Starshatter::ExecCutscene方法代码示例

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


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

示例1: if

void
CmdIntelDlg::ExecFrame()
{
	CmdDlg::ExecFrame();

	if (campaign != Campaign::GetCampaign() || campaign->GetUpdateTime() != update_time) {
		campaign    = Campaign::GetCampaign();
		update_time = campaign->GetUpdateTime();

		lst_news->ClearItems();
		txt_news->SetText("");

		if (img_news)
		img_news->SetPicture(bmp_default);
	}

	if (campaign) {
		List<CombatEvent>& events      = campaign->GetEvents();
		bool               auto_scroll = false;

		if (events.size() > lst_news->NumItems()) {
			while (events.size() > lst_news->NumItems()) {
				CombatEvent* info = events[lst_news->NumItems()];

				const char* unread = info->Visited() ? " " : "*";
				int i = lst_news->AddItemWithData(unread, (DWORD) info) - 1;

				char dateline[32];
				FormatDayTime(dateline, info->Time());
				lst_news->SetItemText(i, 1, dateline);
				lst_news->SetItemText(i, 2, info->Title());
				lst_news->SetItemText(i, 3, info->Region());
				lst_news->SetItemText(i, 4, Game::GetText(info->SourceName()));

				if (!info->Visited())
				auto_scroll = true;
			}

			if (lst_news->GetSortColumn() > 0)
			lst_news->SortItems();
		}

		else if (events.size() < lst_news->NumItems()) {
			lst_news->ClearItems();

			for (int i = 0; i < events.size(); i++) {
				CombatEvent* info = events[i];

				const char* unread = info->Visited() ? " " : "*";
				int j = lst_news->AddItemWithData(unread, (DWORD) info) - 1;

				char dateline[32];
				FormatDayTime(dateline, info->Time());
				lst_news->SetItemText(j, 1, dateline);
				lst_news->SetItemText(j, 2, info->Title());
				lst_news->SetItemText(j, 3, info->Region());
				lst_news->SetItemText(j, 4, Game::GetText(info->SourceName()));

				if (!info->Visited())
				auto_scroll = true;
			}

			if (lst_news->GetSortColumn() > 0)
			lst_news->SortItems();

			txt_news->SetText("");

			if (img_news)
			img_news->SetPicture(bmp_default);
		}

		if (auto_scroll) {
			int first_unread = -1;

			for (int i = 0; i < lst_news->NumItems(); i++) {
				if (lst_news->GetItemText(i, 0) == "*") {
					first_unread = i;
					break;
				}
			}

			if (first_unread >= 0)
			lst_news->ScrollTo(first_unread);
		}
	}

	Starshatter* stars = Starshatter::GetInstance();

	if (start_scene > 0) {
		ShowMovie();

		start_scene--;

		if (start_scene == 0) {
			if (stars && campaign) {
				stars->ExecCutscene(event_scene, campaign->Path());

				if (stars->InCutscene()) {
					Sim* sim = Sim::GetSim();

//.........这里部分代码省略.........
开发者ID:The-E,项目名称:Starshatter-Experimental,代码行数:101,代码来源:CmdIntelDlg.cpp


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