Exemplo n.º 1
0
void squeezeLiteGui::CliReady(void)
{
    DEBUGF("cliConnected Slot");

    m_playerInfo = new playerInfo(cli,encodedMacAddress);
    m_playerInfoThread = new playerInfoThread(m_playerInfo);
    m_playerInfo->moveToThread(m_playerInfoThread);

    // Error message processing
    connect(m_playerInfo,SIGNAL(playerInfoError(QString)),
            this,SLOT(ErrorMessageReceiver(QString)));
    connect(cli,SIGNAL(cliError(QString)),
            this,SLOT(ErrorMessageReceiver(QString)));

    // interface command issuing
    connect(this,SIGNAL(issueStandardCommand(CliCommand)),
            cli,SLOT(SendStandardCommand(CliCommand)));
    connect(this,SIGNAL(issueCommand(QByteArray)),
            cli,SLOT(SendCommand(QByteArray))); // so device can send messages

    connect(m_playerInfo,SIGNAL(PlayerInfoFilled()),
            this,SLOT(playerInfoReady()));
    connect(m_playerInfo,SIGNAL(PlayerStatus(PlayerState)),
            this,SLOT(PlayerStatus(PlayerState)));

    m_playerInfoThread->start();
    //    connect(this,SIGNAL(deviceStatusReady()),this,SLOT(initInterfaceConnections()));
}
Exemplo n.º 2
0
void StatusDisplay(void)
{
	char s[50];
	static time_t ot = -1;
	static time_t t = 0;
	static time_t td = 0;

	PlayerStatus(PLACE_LEFT, &gPlayer1Data, gPlayer1);
	if (gOptions.twoPlayers)
		PlayerStatus(PLACE_RIGHT, &gPlayer2Data, gPlayer2);

	if (!gPlayer1 && !gPlayer2) {
		if (!gCampaign.dogFight)
			TextStringAtCenter("Game Over!");
		else
			TextStringAtCenter("Double Kill!");
	}

	else if (MissionCompleted()) {
		sprintf(s, "Pickup in %d seconds\n",
			(gMission.pickupTime + 69) / 70);
		TextStringAtCenter(s);
	}

	if (gameIsPaused) {
		if (escExits)
			TextStringAtCenter("Press Esc again to quit");
		else
			TextStringAtCenter("Paused");
	}

	if (messageTicks > 0)
		TextStringSpecial(message, TEXT_XCENTER | TEXT_TOP, 0, 20);

	if (gOptions.displayFPS) {
		sprintf(s, "FPS: %d", fps);
		TextStringSpecial(s, TEXT_RIGHT | TEXT_BOTTOM, 10, 10);
	}
	if (gOptions.displayTime) {
		sprintf(s, "%02d:%02d", timeHours, timeMinutes);
		TextStringSpecial(s, TEXT_LEFT | TEXT_BOTTOM, 10, 10);
	}

#define KEY_WIDTH(n) (PicWidth(&cGeneralPics[gMission.keyPics[n]]))

	if (gMission.flags & FLAGS_KEYCARD_YELLOW)
		DrawKeycard(CenterX(KEY_WIDTH(0)) - 30, 20, &cGeneralPics[gMission.keyPics[0]]);
	if (gMission.flags & FLAGS_KEYCARD_GREEN)
		DrawKeycard(CenterX(KEY_WIDTH(1)) - 10, 20, &cGeneralPics[gMission.keyPics[1]]);
	if (gMission.flags & FLAGS_KEYCARD_BLUE)
		DrawKeycard(CenterX(KEY_WIDTH(2)) + 10, 20, &cGeneralPics[gMission.keyPics[2]]);
	if (gMission.flags & FLAGS_KEYCARD_RED)
		DrawKeycard(CenterX(KEY_WIDTH(3)) + 30, 20, &cGeneralPics[gMission.keyPics[3]]);

	if (ot == -1 || missionTime == 0) /* set the original time properly */
		ot = time(NULL);

	t = time(NULL);

	if (!gameIsPaused) {
		td = t - ot;
	}

	sprintf(s, "%d:%02d", (int)(td / 60), (int)(td % 60));
	TextStringSpecial(s, TEXT_TOP | TEXT_XCENTER, 0, 5);

	MissionStatus();
}