コード例 #1
0
std::string CEfxKeyUintCtrlImp::GetEditKeyText()
{
	std::string str1;
	std::string str2;

	if (GetEffectClassName())
		str1 = GetEffectClassName();
	if (GetCustomName())
		str2 = GetCustomName();

	if( !str2.empty() )
		str1 = str1 + " - " + str2;

	return str1;
}
コード例 #2
0
ファイル: game.cpp プロジェクト: SpaceManiac/Lunatic
void LunaticGame(MGLDraw *mgl, byte load)
{
	char custName[64];
	byte b, worldResult;

	if (!load) // don't do this if loading a game, it was already done and the player was filled with values
		InitPlayer(INIT_GAME, 0, 0);

	if (load > 0) // continuing a saved game
		worldResult = WORLD_LOAD;
	else
		worldResult = 0;
	while (1)
	{
		if (worldResult == WORLD_LOAD)
		{
			ReScanWorldNames();
			b = GetPlayerWorld();
		}
		else
		{
			b = 255;
			while (1)
			{
				msgFromOtherModules = 0;
				b = WorldPicker(mgl);
				if (b == 253)
				{
					b = WorldPickerPause();
					if (b == WORLD_QUITGAME)
					{
						b = 255;
						break;
					}
					if (msgFromOtherModules == MSG_LOADGAME) // load a game
					{
						ReScanWorldNames();
						b = GetPlayerWorld();
						break;
					}
				}
				else
					break;
			}
			if (b == 255)
				break;
			player.worldNum = b;
		}

		if (b < 5)
		{
			if (b == 4 && worldResult != WORLD_LOAD)
				// the asylum requires that you have all four loony keys to enter
				// unless you're loading a saved game saved in there, in which case watching
				// the animation would be a waste
			{

				if (PlayerHasLunacyKey(0) && PlayerHasLunacyKey(1) &&
						PlayerHasLunacyKey(2) && PlayerHasLunacyKey(3))
				{
					ShowVictoryAnim(12);
					garbageTime = 0;
					sprintf(custName, "worlds\\%s", GetCustomName());
					worldResult = LunaticWorld(b, custName);
				}
				else
				{
					ShowVictoryAnim(11);
					garbageTime = 0;
					worldResult = 0; // not allowed to enter
				}
			}
			else
			{
				sprintf(custName, "worlds\\%s", GetCustomName());
				worldResult = LunaticWorld(b, custName);
			}
		}
		else
		{
			sprintf(custName, "worlds\\%s", GetCustomName());
			worldResult = LunaticWorld(b, custName);
		}
		if (worldResult == WORLD_QUITGAME)
		{
			mgl->LastKeyPressed(); // just to clear key buffer
			break;
		}
	}
	ExitPlayer();
}