// Get rid of the reticule. // void driveDisableInterface(void) { intResetScreen(false); intRemoveReticule(); DriveInterfaceEnabled = false; }
// Reset the game when loading a save game bool saveGameReset(void) { debug(LOG_MAIN, "saveGameReset"); cdAudio_Stop(); freeAllStructs(); freeAllDroids(); freeAllFeatures(); freeAllFlagPositions(); initMission(); initTransporters(); //free up the gateway stuff? gwShutDown(); intResetScreen(true); intResetPreviousObj(); if (!mapShutdown()) { return false; } //clear out any messages freeMessages(); return true; }
bool intAddMultiMenu(void) { UDWORD i; //check for already open. if(widgGetFromID(psWScreen,MULTIMENU_FORM)) { intCloseMultiMenu(); return true; } if (intMode != INT_INTELMAP) { intResetScreen(false); } WIDGET *parent = psWScreen->psForm; // add form IntFormAnimated *multiMenuForm = new IntFormAnimated(parent); multiMenuForm->id = MULTIMENU_FORM; multiMenuForm->setGeometry(MULTIMENU_FORM_X, MULTIMENU_FORM_Y, MULTIMENU_FORM_W, MULTIMENU_PLAYER_H*game.maxPlayers + MULTIMENU_PLAYER_H + 7); // add any players for(i=0;i<MAX_PLAYERS;i++) { if(isHumanPlayer(i) || (game.type == SKIRMISH && i<game.maxPlayers && game.skDiff[i] ) ) { addMultiPlayer(i,NetPlay.players[i].position); } } // Add the close button. W_BUTINIT sButInit; sButInit.formID = MULTIMENU_FORM; sButInit.id = MULTIMENU_CLOSE; sButInit.x = MULTIMENU_FORM_W - CLOSE_WIDTH; sButInit.y = 0; sButInit.width = CLOSE_WIDTH; sButInit.height = CLOSE_HEIGHT; sButInit.pTip = _("Close"); sButInit.pDisplay = intDisplayImageHilight; sButInit.UserData = PACKDWORD_TRI(0,IMAGE_CLOSEHILIGHT , IMAGE_CLOSE); if (!widgAddButton(psWScreen, &sButInit)) { return false; } intShowPowerBar(); // add power bar if (intMode != INT_INTELMAP) { intMode = INT_MULTIMENU; // change interface mode. } MultiMenuUp = true; return true; }
//new function added to bring up the RMB order form for Factories as well as droids void intAddFactoryOrder(STRUCTURE *psStructure) { if (!OrderUp) { intResetScreen(false); intAddOrder((BASE_OBJECT *)psStructure); intMode = INT_ORDER; } else { intAddOrder((BASE_OBJECT *)psStructure); } }
/* The video playback loop */ void videoLoop() { bool videoFinished; ASSERT(videoMode == 1, "videoMode out of sync"); // display a frame of the FMV videoFinished = !seq_UpdateFullScreenVideo(nullptr); pie_ScreenFlip(CLEAR_BLACK); // should we stop playing? if (videoFinished || keyPressed(KEY_ESC) || mouseReleased(MOUSE_LMB)) { seq_StopFullScreenVideo(); //set the next video off - if any if (videoFinished && seq_AnySeqLeft()) { seq_StartNextFullScreenVideo(); } else { // remove the intelligence screen if necessary if (messageIsImmediate()) { intResetScreen(true); setMessageImmediate(false); } //don't do the callback if we're playing the win/lose video if (!getScriptWinLoseVideo()) { eventFireCallbackTrigger((TRIGGER_TYPE)CALL_VIDEO_QUIT); } else if (!bMultiPlayer) { displayGameOver(getScriptWinLoseVideo() == PLAY_WIN, false); } triggerEvent(TRIGGER_VIDEO_QUIT); } } }
// // Quick hack to throw up a ingame 'popup' for when the host drops connection. // void intAddInGamePopup(void) { //clear out any mission widgets - timers etc that may be on the screen clearMissionWidgets(); setWidgetsStatus(true); intResetScreen(false); if (isInGamePopupUp) return; audio_StopAll(); if(!gamePaused()) { kf_TogglePauseMode(); // Pause the game. } W_FORMINIT sFormInit; sFormInit.formID = 0; sFormInit.id = INTINGAMEPOPUP; sFormInit.style = WFORM_PLAIN; sFormInit.width = 600; sFormInit.height = 160; sFormInit.x = (SWORD)(20+D_W); sFormInit.y = (SWORD)((240-(160/2))+D_H); sFormInit.pDisplay = intOpenPlainForm; sFormInit.disableChildren= true; widgAddForm(psWScreen, &sFormInit); // add the text "buttons" now W_BUTINIT sButInit; sButInit.formID = INTINGAMEPOPUP; sButInit.style = OPALIGN; sButInit.width = 600; sButInit.FontID = font_large; sButInit.x = 0; sButInit.height = 10; sButInit.pDisplay = displayTextOption; sButInit.id = INTINGAMEOP_POPUP_MSG2; sButInit.y = 20; sButInit.pText = _("Host has quit the game!"); widgAddButton(psWScreen, &sButInit); sButInit.id = INTINGAMEOP_POPUP_MSG1; sButInit.y = 60; sButInit.pText = _("The game can't continue without the host."); widgAddButton(psWScreen, &sButInit); sButInit.id = INTINGAMEOP_POPUP_QUIT; sButInit.y = 124; sButInit.pText = _("--> QUIT <--"); widgAddButton(psWScreen, &sButInit); intMode = INT_POPUPMSG; // change interface mode. isInGamePopupUp = true; }
static bool _intAddInGameOptions(void) { audio_StopAll(); //clear out any mission widgets - timers etc that may be on the screen clearMissionWidgets(); setWidgetsStatus(true); //if already open, then close! if (widgGetFromID(psWScreen,INTINGAMEOP)) { intCloseInGameOptions(false, true); return true; } intResetScreen(false); // Pause the game. if(!gamePaused()) { kf_TogglePauseMode(); } W_FORMINIT sFormInit; sFormInit.width = INTINGAMEOP_W; // add form sFormInit.formID = 0; sFormInit.id = INTINGAMEOP; sFormInit.style = WFORM_PLAIN; sFormInit.x = (SWORD)INTINGAMEOP_X; sFormInit.y = (SWORD)INTINGAMEOP_Y; sFormInit.height = INTINGAMEOP_H; if ((!bMultiPlayer || (NetPlay.bComms == 0)) && !bInTutorial) { } else { sFormInit.height = INTINGAMEOP_HS; } sFormInit.pDisplay = intOpenPlainForm; sFormInit.disableChildren= true; widgAddForm(psWScreen, &sFormInit); // add 'quit' text if ((!bMultiPlayer || (NetPlay.bComms == 0)) && !bInTutorial) { addIGTextButton(INTINGAMEOP_QUIT, INTINGAMEOP_5_Y, INTINGAMEOP_OP_W, _("Quit"), OPALIGN); } else { addIGTextButton(INTINGAMEOP_QUIT, INTINGAMEOP_3_Y, INTINGAMEOP_OP_W, _("Quit"), OPALIGN); } // add 'resume' addIGTextButton(INTINGAMEOP_RESUME, INTINGAMEOP_1_Y, INTINGAMEOP_OP_W, _("Resume Game"), OPALIGN); // add 'options' addIGTextButton(INTINGAMEOP_OPTIONS, INTINGAMEOP_2_Y, INTINGAMEOP_OP_W, _("Audio Options"), OPALIGN); if ((!bMultiPlayer || (NetPlay.bComms == 0)) && !bInTutorial) { // add 'load' addIGTextButton(INTINGAMEOP_LOAD, INTINGAMEOP_3_Y, INTINGAMEOP_OP_W, _("Load Game"), OPALIGN); // add 'save' addIGTextButton(INTINGAMEOP_SAVE, INTINGAMEOP_4_Y, INTINGAMEOP_OP_W, _("Save Game"), OPALIGN); } intMode = INT_INGAMEOP; // change interface mode. InGameOpUp = true; // inform interface. wzSetCursor(CURSOR_DEFAULT); return true; }
BOOL intAddMultiMenu(void) { W_FORMINIT sFormInit; W_BUTINIT sButInit; UDWORD i; //check for already open. if(widgGetFromID(psWScreen,MULTIMENU_FORM)) { intCloseMultiMenu(); return true; } if (intMode != INT_INTELMAP) { intResetScreen(false); } // add form memset(&sFormInit, 0, sizeof(W_FORMINIT)); sFormInit.formID = 0; sFormInit.id = MULTIMENU_FORM; sFormInit.style = WFORM_PLAIN; sFormInit.x =(SWORD)(MULTIMENU_FORM_X); sFormInit.y =(SWORD)(MULTIMENU_FORM_Y); sFormInit.width = MULTIMENU_FORM_W; sFormInit.height = (UWORD)(MULTIMENU_PLAYER_H*game.maxPlayers + MULTIMENU_PLAYER_H+7); //MULTIMENU_FORM_H; sFormInit.pDisplay = intOpenPlainForm; sFormInit.disableChildren = true; if (!widgAddForm(psWScreen, &sFormInit)) { return false; } // add any players for(i=0;i<MAX_PLAYERS;i++) { if(isHumanPlayer(i) || (game.type == SKIRMISH && i<game.maxPlayers && game.skDiff[i] ) ) { addMultiPlayer(i,NetPlay.players[i].position); } } // Add the close button. memset(&sButInit, 0, sizeof(W_BUTINIT)); sButInit.formID = MULTIMENU_FORM; sButInit.id = MULTIMENU_CLOSE; sButInit.style = WBUT_PLAIN; sButInit.x = MULTIMENU_FORM_W - CLOSE_WIDTH; sButInit.y = 0; sButInit.width = CLOSE_WIDTH; sButInit.height = CLOSE_HEIGHT; sButInit.pTip = _("Close"); sButInit.FontID = font_regular; sButInit.pDisplay = intDisplayImageHilight; sButInit.UserData = PACKDWORD_TRI(0,IMAGE_CLOSEHILIGHT , IMAGE_CLOSE); if (!widgAddButton(psWScreen, &sButInit)) { return false; } intShowPowerBar(); // add power bar if (intMode != INT_INTELMAP) { intMode = INT_MULTIMENU; // change interface mode. } MultiMenuUp = true; return true; }
/* Opens/closes a 'watch' window (Default key combo: Alt+Space), * only available in debug mode */ BOOL addDebugMenu(BOOL bAdd) { W_FORMINIT sFormInit; UDWORD i,pos = 0,formHeight=0; /* Close */ if(!bAdd) //|| widgGetFromID(psWScreen,DEBUGMENU) { intCloseDebugMenuNoAnim(); return true; } intResetScreen(false); // calculate required height. formHeight = 12; //DEBUGMENU_ENTRY_H for(i=0;i<DEBUGMENU_MAX_ENTRIES;i++) { if(strcmp(debugMenuEntry[i],"")) formHeight += DEBUGMENU_ENTRY_H; } // add form memset(&sFormInit, 0, sizeof(W_FORMINIT)); sFormInit.formID = 0; sFormInit.id = DEBUGMENU; sFormInit.style = WFORM_PLAIN; sFormInit.x =(SWORD)(DEBUGMENU_FORM_X); sFormInit.y =(SWORD)(DEBUGMENU_FORM_Y); sFormInit.width = DEBUGMENU_FORM_W; sFormInit.height = (UWORD)formHeight; //MULTIMENU_FORM_H; sFormInit.pDisplay = intOpenPlainForm; sFormInit.disableChildren = true; if (!widgAddForm(psWScreen, &sFormInit)) { return false; } // add debug info pos = 0; for(i=0;i<DEBUGMENU_MAX_ENTRIES;i++) { if(strcmp(debugMenuEntry[i],"")) { // add form memset(&sFormInit, 0, sizeof(W_FORMINIT)); sFormInit.formID = DEBUGMENU; sFormInit.id = DEBUGMENU_CLOSE + pos + 1; sFormInit.style = WFORM_PLAIN; sFormInit.x = 5; sFormInit.y = 5 + DEBUGMENU_ENTRY_H * pos; sFormInit.width = DEBUGMENU_FORM_W; sFormInit.height = DEBUGMENU_ENTRY_H; sFormInit.pDisplay = displayDebugMenu; sFormInit.UserData = i; widgAddForm(psWScreen, &sFormInit); pos++; } } // Add the close button. /* memset(&sButInit, 0, sizeof(W_BUTINIT)); sButInit.formID = DEBUGMENU; sButInit.id = DEBUGMENU_CLOSE; sButInit.style = WBUT_PLAIN; sButInit.x = DEBUGMENU_FORM_W - CLOSE_WIDTH; sButInit.y = 0; sButInit.width = CLOSE_WIDTH; sButInit.height = CLOSE_HEIGHT; sButInit.pTip = _("Close"); sButInit.FontID = font_regular; sButInit.pDisplay = intDisplayImageHilight; sButInit.pUserData = (void*)PACKDWORD_TRI(0,IMAGE_CLOSEHILIGHT , IMAGE_CLOSE); if (!widgAddButton(psWScreen, &sButInit)) { return false; } */ DebugMenuUp = true; return true; }