// //////////////////////////////////////////////////////////////////////////// // Audio Options Menu static bool startAudioOptionsMenu(void) { addBackdrop(); addTopForm(); addBottomForm(); // 2d audio addTextButton(FRONTEND_FX, FRONTEND_POS2X-25,FRONTEND_POS2Y, _("Voice Volume"), 0); addFESlider(FRONTEND_FX_SL, FRONTEND_BOTFORM, FRONTEND_POS2M, FRONTEND_POS2Y+5, AUDIO_VOL_MAX, sound_GetUIVolume() * 100.0); // 3d audio addTextButton(FRONTEND_3D_FX, FRONTEND_POS3X-25,FRONTEND_POS3Y, _("FX Volume"), 0); addFESlider(FRONTEND_3D_FX_SL, FRONTEND_BOTFORM, FRONTEND_POS3M, FRONTEND_POS3Y+5, AUDIO_VOL_MAX, sound_GetEffectsVolume() * 100.0); // cd audio addTextButton(FRONTEND_MUSIC, FRONTEND_POS4X-25,FRONTEND_POS4Y, _("Music Volume"), 0); addFESlider(FRONTEND_MUSIC_SL, FRONTEND_BOTFORM, FRONTEND_POS4M, FRONTEND_POS4Y+5, AUDIO_VOL_MAX, sound_GetMusicVolume() * 100.0); // quit. addMultiBut(psWScreen, FRONTEND_BOTFORM, FRONTEND_QUIT, 10, 10, 30, 29, P_("menu", "Return"), IMAGE_RETURN, IMAGE_RETURN_HI, IMAGE_RETURN_HI); //add some text down the side of the form addSideText (FRONTEND_SIDETEXT , FRONTEND_SIDEX,FRONTEND_SIDEY, _("AUDIO OPTIONS")); return true; }
static bool addSlideOptions(void) { if (widgGetFromID(psWScreen,INTINGAMEOP)) { widgDelete(psWScreen, INTINGAMEOP); // get rid of the old stuff. } W_FORMINIT sFormInit; // add form sFormInit.formID = 0; sFormInit.id = INTINGAMEOP; sFormInit.style = WFORM_PLAIN; sFormInit.x = (SWORD)INTINGAMEOP2_X; sFormInit.y = (SWORD)INTINGAMEOP2_Y; sFormInit.width = INTINGAMEOP2_W; sFormInit.height = INTINGAMEOP2_H; sFormInit.pDisplay = intOpenPlainForm; sFormInit.disableChildren= true; widgAddForm(psWScreen, &sFormInit); // fx vol addIGTextButton(INTINGAMEOP_FXVOL, INTINGAMEOP_1_Y, INTINGAMEOP_OP_W, _("Voice Volume"), WBUT_PLAIN); addFESlider(INTINGAMEOP_FXVOL_S, INTINGAMEOP, INTINGAMEOP_MID, INTINGAMEOP_1_Y-5, AUDIO_VOL_MAX, (int)(sound_GetUIVolume() * 100.0)); // fx vol addIGTextButton(INTINGAMEOP_3DFXVOL, INTINGAMEOP_2_Y, INTINGAMEOP_OP_W, _("FX Volume"), WBUT_PLAIN); addFESlider(INTINGAMEOP_3DFXVOL_S, INTINGAMEOP, INTINGAMEOP_MID, INTINGAMEOP_2_Y-5, AUDIO_VOL_MAX, (int)(sound_GetEffectsVolume() * 100.0)); // cd vol addIGTextButton(INTINGAMEOP_CDVOL, INTINGAMEOP_3_Y, INTINGAMEOP_OP_W, _("Music Volume"), WBUT_PLAIN); addFESlider(INTINGAMEOP_CDVOL_S, INTINGAMEOP, INTINGAMEOP_MID, INTINGAMEOP_3_Y-5, AUDIO_VOL_MAX, (int)(sound_GetMusicVolume() * 100)); #ifdef DEBUG // Tactical UI: Target Origin if(tuiTargetOrigin) { addIGTextButton(INTINGAMEOP_TUI_TARGET_ORIGIN_SW, INTINGAMEOP_4_Y, INTINGAMEOP_SW_W, _("Tactical UI (Target Origin Icon): Show"), WBUT_PLAIN); } else { addIGTextButton(INTINGAMEOP_TUI_TARGET_ORIGIN_SW, INTINGAMEOP_4_Y, INTINGAMEOP_SW_W, _("Tactical UI (Target Origin Icon): Hide"), WBUT_PLAIN); } #endif addIGTextButton(INTINGAMEOP_RESUME, INTINGAMEOP_5_Y, INTINGAMEOP_SW_W, _("Resume Game"), OPALIGN); return true; }
// //////////////////////////////////////////////////////////////////////////// bool startLimitScreen(void) { addBackdrop();//background // load stats... if(!bLimiterLoaded) { initLoadingScreen(true); if (!resLoad("wrf/limiter_tex.wrf", 501)) { return false; } if (!resLoad("wrf/piestats.wrf", 502)) { return false; } if (!resLoad("wrf/limiter_data.wrf", 503)) { return false; } bLimiterLoaded = true; closeLoadingScreen(); } if (challengeActive) { // reset the sliders.. // it's a HACK since the actual limiter structure was cleared in the startMultiOptions function for (unsigned i = 0; i < numStructureStats; ++i) { asStructLimits[0][i].limit = asStructLimits[0][i].globalLimit; } // turn off the sliders sliderEnableDrag(false); } else { //enable the sliders sliderEnableDrag(true); } addSideText(FRONTEND_SIDETEXT1,LIMITSX-2,LIMITSY,"LIMITS"); // draw sidetext... WIDGET *parent = widgGetFromID(psWScreen, FRONTEND_BACKDROP); IntFormAnimated *limitsForm = new IntFormAnimated(parent, false); limitsForm->id = IDLIMITS; limitsForm->setGeometry(LIMITSX, LIMITSY, LIMITSW, LIMITSH); // return button. addMultiBut(psWScreen,IDLIMITS,IDLIMITS_RETURN, LIMITS_OKX-40,LIMITS_OKY, iV_GetImageWidth(FrontImages, IMAGE_NO), iV_GetImageHeight(FrontImages, IMAGE_NO), _("Apply Defaults and Return To Previous Screen"),IMAGE_NO,IMAGE_NO,true); // ok button addMultiBut(psWScreen,IDLIMITS,IDLIMITS_OK, LIMITS_OKX,LIMITS_OKY, iV_GetImageWidth(FrontImages,IMAGE_OK), iV_GetImageHeight(FrontImages,IMAGE_OK), _("Accept Settings"),IMAGE_OK,IMAGE_OK,true); // add tab form.. IntListTabWidget *limitsList = new IntListTabWidget(limitsForm); limitsList->setChildSize(BARWIDTH, BARHEIGHT); limitsList->setChildSpacing(5, 5); limitsList->setGeometry(50, 10, BARWIDTH, 370); //Put the buttons on it int limitsButtonId = IDLIMITS_ENTRIES_START; for (unsigned i = 0; i < numStructureStats; ++i) { if (asStructLimits[0][i].globalLimit != LOTS_OF) { W_FORM *button = new W_FORM(limitsList); button->id = limitsButtonId; button->displayFunction = displayStructureBar; button->UserData = i; limitsList->addWidgetToLayout(button); ++limitsButtonId; addFESlider(limitsButtonId, limitsButtonId - 1, 290, 11, asStructLimits[0][i].globalLimit, asStructLimits[0][i].limit); ++limitsButtonId; } } return true; }
// //////////////////////////////////////////////////////////////////////////// // Game Options Menu static bool startGameOptionsMenu(void) { UDWORD w, h; int playercolor; addBackdrop(); addTopForm(); addBottomForm(); // Difficulty addTextButton(FRONTEND_DIFFICULTY, FRONTEND_POS2X-25, FRONTEND_POS2Y, _("Difficulty"), 0); switch (getDifficultyLevel()) { case DL_EASY: addTextButton(FRONTEND_DIFFICULTY_R, FRONTEND_POS2M-25, FRONTEND_POS2Y, _("Easy"), 0); break; case DL_NORMAL: addTextButton(FRONTEND_DIFFICULTY_R, FRONTEND_POS2M-25,FRONTEND_POS2Y, _("Normal"), 0); break; case DL_HARD: default: addTextButton(FRONTEND_DIFFICULTY_R, FRONTEND_POS2M-25, FRONTEND_POS2Y, _("Hard"), 0); break; } // Scroll speed addTextButton(FRONTEND_SCROLLSPEED, FRONTEND_POS3X-25, FRONTEND_POS3Y, _("Scroll Speed"), 0); addFESlider(FRONTEND_SCROLLSPEED_SL, FRONTEND_BOTFORM, FRONTEND_POS3M, FRONTEND_POS3Y+5, 16, scroll_speed_accel / 100); // Colour stuff w = iV_GetImageWidth(FrontImages, IMAGE_PLAYERN); h = iV_GetImageHeight(FrontImages, IMAGE_PLAYERN); addMultiBut(psWScreen, FRONTEND_BOTFORM, FE_P0, FRONTEND_POS4M+(0*(w+6)), FRONTEND_POS4Y, w, h, NULL, IMAGE_PLAYERN, IMAGE_PLAYERX, true, 0); addMultiBut(psWScreen, FRONTEND_BOTFORM, FE_P4, FRONTEND_POS4M+(1*(w+6)), FRONTEND_POS4Y, w, h, NULL, IMAGE_PLAYERN, IMAGE_PLAYERX, true, 4); addMultiBut(psWScreen, FRONTEND_BOTFORM, FE_P5, FRONTEND_POS4M+(2*(w+6)), FRONTEND_POS4Y, w, h, NULL, IMAGE_PLAYERN, IMAGE_PLAYERX, true, 5); addMultiBut(psWScreen, FRONTEND_BOTFORM, FE_P6, FRONTEND_POS4M+(3*(w+6)), FRONTEND_POS4Y, w, h, NULL, IMAGE_PLAYERN, IMAGE_PLAYERX, true, 6); addMultiBut(psWScreen, FRONTEND_BOTFORM, FE_P7, FRONTEND_POS4M+(4*(w+6)), FRONTEND_POS4Y, w, h, NULL, IMAGE_PLAYERN, IMAGE_PLAYERX, true, 7); // language addTextButton(FRONTEND_LANGUAGE, FRONTEND_POS2X - 25, FRONTEND_POS5Y, _("Language"), 0); addTextButton(FRONTEND_LANGUAGE_R, FRONTEND_POS2M - 25, FRONTEND_POS5Y, getLanguageName(), 0); // FIXME: if playercolor = 1-3, then we Assert in widgSetButtonState() since we don't define FE_P1 - FE_P3 // I assume the reason is that in SP games, those are reserved for the AI? Valid values are 0, 4-7. // This is a workaround, until we find what is setting that to 1-3. See configuration.c:701 playercolor = war_GetSPcolor(); if (playercolor >= 1 && playercolor <= 3) { playercolor = 0; } widgSetButtonState(psWScreen, FE_P0 + playercolor, WBUT_LOCK); addTextButton(FRONTEND_COLOUR, FRONTEND_POS4X-25, FRONTEND_POS4Y, _("Unit Colour"), 0); // Radar addTextButton(FRONTEND_RADAR, FRONTEND_POS6X - 25, FRONTEND_POS6Y, _("Radar"), 0); addTextButton(FRONTEND_RADAR_R, FRONTEND_POS6M - 25, FRONTEND_POS6Y, rotateRadar ? _("Rotating") : _("Fixed"), 0); // Quit addMultiBut(psWScreen, FRONTEND_BOTFORM, FRONTEND_QUIT, 10, 10, 30, 29, P_("menu", "Return"), IMAGE_RETURN, IMAGE_RETURN_HI, IMAGE_RETURN_HI); // Add some text down the side of the form addSideText(FRONTEND_SIDETEXT, FRONTEND_SIDEX, FRONTEND_SIDEY, _("GAME OPTIONS")); return true; }
// //////////////////////////////////////////////////////////////////////////// bool startLimitScreen(void) { UDWORD numButtons = 0; UDWORD i; addBackdrop();//background // load stats... if(!bLimiterLoaded) { initLoadingScreen(true); if (!resLoad("wrf/limiter_tex.wrf", 501)) { return false; } if (!resLoad("wrf/piestats.wrf", 502)) { return false; } if (!resLoad("wrf/limiter_data.wrf", 503)) { return false; } bLimiterLoaded = true; closeLoadingScreen(); } if (challengeActive) { // reset the sliders.. // it's a HACK since the actual limiter structure was cleared in the startMultiOptions function for (i = 0; i < numStructureStats ; ++i) { asStructLimits[0][i].limit = asStructLimits[0][i].globalLimit; } // turn off the sliders sliderEnableDrag(false); } else { //enable the sliders sliderEnableDrag(true); } addSideText(FRONTEND_SIDETEXT1,LIMITSX-2,LIMITSY,"LIMITS"); // draw sidetext... W_FORMINIT sFormInit; sFormInit.formID = FRONTEND_BACKDROP; sFormInit.id = IDLIMITS; sFormInit.style = WFORM_PLAIN; sFormInit.x = LIMITSX; sFormInit.y = LIMITSY; sFormInit.width = LIMITSW; sFormInit.height = LIMITSH; sFormInit.pDisplay = intDisplayPlainForm; widgAddForm(psWScreen, &sFormInit); // return button. addMultiBut(psWScreen,IDLIMITS,IDLIMITS_RETURN, LIMITS_OKX-40,LIMITS_OKY, iV_GetImageWidth(FrontImages,IMAGE_RETURN), iV_GetImageHeight(FrontImages,IMAGE_RETURN), _("Apply Defaults and Return To Previous Screen"),IMAGE_NO,IMAGE_NO,true); // ok button addMultiBut(psWScreen,IDLIMITS,IDLIMITS_OK, LIMITS_OKX,LIMITS_OKY, iV_GetImageWidth(FrontImages,IMAGE_OK), iV_GetImageHeight(FrontImages,IMAGE_OK), _("Accept Settings"),IMAGE_OK,IMAGE_OK,true); // Count the number of minor tabs needed numButtons = 0; for(i=0; i<numStructureStats; i++ ) { if(useStruct(numButtons,i)) { numButtons++; } } if(numButtons >(4*BUTPERFORM)) numButtons =(4*BUTPERFORM); // add tab form.. sFormInit = W_FORMINIT(); sFormInit.formID = IDLIMITS; sFormInit.id = IDLIMITS_TABS; sFormInit.style = WFORM_TABBED; sFormInit.x = 50; sFormInit.y = 10; sFormInit.width = LIMITSW - 100; sFormInit.height =LIMITSH - 4; sFormInit.numMajor = numForms(numButtons, BUTPERFORM); sFormInit.majorPos = WFORM_TABTOP; sFormInit.minorPos = WFORM_TABNONE; sFormInit.majorSize = OBJ_TABWIDTH+3; //!! sFormInit.majorOffset = OBJ_TABOFFSET; sFormInit.tabVertOffset = (OBJ_TABHEIGHT/2); //(DES_TAB_HEIGHT/2)+2; sFormInit.tabMajorThickness = OBJ_TABHEIGHT; sFormInit.pUserData = &StandardTab; sFormInit.pTabDisplay = intDisplayTab; // TABFIXME --unsure if needs fixing yet. for (i=0; i< sFormInit.numMajor; i++) { sFormInit.aNumMinors[i] = 1; } widgAddForm(psWScreen, &sFormInit); //Put the buttons on it W_FORMINIT sButInit; sButInit.formID = IDLIMITS_TABS;//IDLIMITS; sButInit.style = WFORM_PLAIN; sButInit.width = BARWIDTH; sButInit.height = BARHEIGHT; sButInit.pDisplay = displayStructureBar; sButInit.x = 2; sButInit.y = 5; sButInit.id = IDLIMITS_ENTRIES_START; numButtons =0; for(i=0; i<numStructureStats ; i++) { if(useStruct(numButtons,i)) { numButtons++; sButInit.UserData= i; widgAddForm(psWScreen, &sButInit); sButInit.id ++; addFESlider(sButInit.id,sButInit.id-1, 290,11, asStructLimits[0][i].globalLimit, asStructLimits[0][i].limit); sButInit.id ++; if (sButInit.y + BARHEIGHT + 2 > (BUTPERFORM*(BARHEIGHT+2) - 4) ) { sButInit.y = 5; sButInit.majorID += 1; } else { sButInit.y += BARHEIGHT +5; } } } return true; }