⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 menudifficulty.cpp

📁 Blood 2全套源码
💻 CPP
字号:
// MenuDifficulty.cpp: implementation of the CMenuDifficulty class.
//
//////////////////////////////////////////////////////////////////////

#include "MainMenus.h"
#include "MenuCommands.h"
#include "MenuDifficulty.h"
#include "BloodClientShell.h"
#include "SharedDefs.h"
#include "ClientRes.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CMenuDifficulty::CMenuDifficulty()
{
	m_bStoryMode  = DTRUE;
	m_bNightmares = DFALSE;
}

CMenuDifficulty::~CMenuDifficulty()
{

}

// Build the menu
void CMenuDifficulty::Build()
{
	// Make sure to call the base class
	CMenuBase::Build();

	CreateTitle("interface\\mainmenus\\singleplayer.pcx", IDS_MENU_TITLE_SINGLEPLAYER, m_pMainMenus->GetTitlePos());		
	SetOptionPos(m_pMainMenus->GetOptionsPos());
	SetItemSpacing(0);

	AddLargeTextItemOption(IDS_MENU_DIFFICULTY_GENOCIDE, MENU_CMD_DIFFICULTY_EASY);
	AddLargeTextItemOption(IDS_MENU_DIFFICULTY_HOMICIDE, MENU_CMD_DIFFICULTY_MEDIUM);
	AddLargeTextItemOption(IDS_MENU_DIFFICULTY_SUICIDE, MENU_CMD_DIFFICULTY_HARD);

	// Select medium difficulty
	SetCurrentItem(1);
}

// Starts the game
void CMenuDifficulty::StartGame(DDWORD dwDifficulty)
{
	// Start a nightmares game if requested
#ifdef _ADDON
	if (m_bNightmares)
	{
		g_pBloodClientShell->MenuNewNightmaresGame(dwDifficulty);
		return;
	}
#endif

	// Start a story mode game
	if (m_bStoryMode)
	{
		g_pBloodClientShell->MenuNewGame(dwDifficulty);
	}
	else
	{
		// Start a game in action mode
		g_pBloodClientShell->MenuNewGame(dwDifficulty, GetCharacter(), GAMETYPE_ACTION);
	}
}

DDWORD CMenuDifficulty::OnCommand(DDWORD dwCommand, DDWORD dwParam1, DDWORD dwParam2)
{	
	switch (dwCommand)
	{	
	case MENU_CMD_DIFFICULTY_EASY:
		{
			StartGame(DIFFICULTY_EASY);
			break;
		}
	case MENU_CMD_DIFFICULTY_MEDIUM:
		{
			StartGame(DIFFICULTY_MEDIUM);
			break;
		}
	case MENU_CMD_DIFFICULTY_HARD:
		{
			StartGame(DIFFICULTY_HARD);
			break;
		}
	}
	return 0;
}

⌨️ 快捷键说明

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