// Mechwarrior: Vengeance // Copyright © 1999-2000 // Mechbay_main.script // Paolo Malabuyo // July 11, 2000 // jcem begin #include "Content\\ShellScripts\\ctcl_params.h" #define GAME_START_MSG " Start Game " // jcem end #include "Content\\ShellScripts\\stddefs.h" #include "Content\\ShellScripts\\MechLabHeaders.h" #include "Content\\ShellScripts\\ScriptStrings.h" #include "Content\\ShellScripts\\ShellFunctionHeaders.hpp" #include "Content\\ShellScripts\\buttons.script" #include "Content\\ShellScripts\\common_shell.script" #include "Content\\ShellScripts\\c_MoviePlayer.script" #define PM_INITIALMULTIPLAYSCREEN (-12345) #define PM_CHECK_DISPLAY_MODE (-3232) #define MAX_IDLETIME 15000 // 15 secs... main { GUI_CREATE { setresource("ScriptStrings.dll") font3d garbagefont = FPATH localize$(IDS_F_MAINMENU_GARBAGE) font3d smallfont = FPATH localize$(IDS_F_MAINMENU_COMPASS) int def_num_color = packcolor(20, 100, 200, 100) object screen = o_MainMenuScreen initialize(screen) focus(screen) } } o_MainMenuScreen { GUI_CREATE { // jcem - CTCL_IsConsoleX: -ctcltype 2/3, CTCL_IsConsole -ctcltype 1 if callback($$CTCL_CheckUseJPD$$) setpointer(0) int nInitialMultiplayScreen if callback($$CTCL_IsConsole$$) nInitialMultiplayScreen = 1 else nInitialMultiplayScreen = 0 if callback($$CTCL_CheckCOOP$$) { object o_fullscrbutton = s_fullscrbutton } if !callback($$CTCL_IsConsoleX$$) || callback($$CTCL_CheckCOOP$$) { if !callback($$CTCL_IsConsole$$) { object o_planet = panedisplay o_planet.filename = GPATH "planet.tga" o_planet.location = 800 - (356 + 20), 600 - (285 + 25), 0 o_planet.panecolor = packcolor(255, 255, 255, 200) initialize(o_planet) object o_moon = panedisplay o_moon.filename = GPATH "moon.tga" o_moon.location = 80, 190, 0 o_moon.panecolor = packcolor(255, 255, 255, 200) initialize(o_moon) // object o_starfield = starfield // o_starfield.location = 0, 0, 1 // initialize(o_starfield) // object o_blue_box = drawbox // o_blue_box.location = 0, 0, 2 // o_blue_box.boxtype = 1 // o_blue_box.boxwidth = getresx() // o_blue_box.boxheight = getresy() // initialize(o_blue_box) // int num_boxes = 3 // object boxes[num_boxes] // int i // for i = 0; i < num_boxes; i++ // { // boxes[i] = drawbox // boxes[i].location = 50, 55 + (160 * i), 4 // boxes[i].boxcolor = packcolor(100, 163, 221,random(50, 60)) // boxes[i].boxwidth = 250 // boxes[i].boxheight = 150 // boxes[i].randomcolor = 1 // } // for i = 0; i < 3; i++ // { // initialize(boxes[i]) // } // object o_circle = circle // o_circle.rotate_me = true // o_circle.location = getresx() / 2, getresy() / 2, 3 // object o_interlace = interlace // o_interlace.location = 0, 0, 10 // o_interlace.lace_color = packcolor (100, 150, 255, 175) } // if !callback($$CTCL_IsConsole$$) object o_frame = frame o_frame.type = 0 o_frame.location = 0, 0, 100 o_frame.screen_name = "BattleTech" // localize$(DNL_MECHWARRIOR_VENGEANCE) initialize(o_frame) // object o_mouselines = mouselines // o_mouselines.location = 0, 0, o_frame.location.z - 1 if !callback($$CTCL_IsConsole$$) { // int num_triangles = 5 // object triangle[num_triangles] // int t // for t = 0; t < num_triangles; t++ // { // triangle[t] = panedisplay // triangle[t].filename = GPATH "MM_triangle.tga" // triangle[t].panecolor = packcolor(170, 170, 60, 255) // } // triangle[0].location = 475, 470, 3 // triangle[1].location = 490, 485, 3 // triangle[2].scalex = 50 // triangle[2].scaley = 50 // triangle[2].location = 600, 335, 3 // triangle[3].scalex = 75 // triangle[3].scaley = 75 // triangle[3].location = 690, 360, 3 // triangle[4].scalex = 35 // triangle[4].scaley = 35 // triangle[4].location = 650, 450, 3 // for t = 0; t < num_triangles; t++ // { // initialize(triangle[t]) // } // object o_graphicblock = panedisplay // o_graphicblock.filename = GPATH "MM_graphicarrow.tga" // o_graphicblock.location = 40, 70, 3 // o_graphicblock.panecolor = packcolor(20, 100, 200, 75) // initialize(o_graphicblock) object o_dropship1 = panedisplay o_dropship1.filename = GPATH "MM_dropship1.tga" o_dropship1.location = 140, 20, 4 // o_dropship1.panecolor = packcolor(20, 100, 220, 175) o_dropship1.panecolor = packcolor(255, 255, 255, 200) initialize(o_dropship1) object o_dropship2 = panedisplay o_dropship2.filename = GPATH "MM_dropship2.tga" o_dropship2.location = 70, 350, 4 o_dropship2.scalex = 200 o_dropship2.scaley = 200 // o_dropship2.panecolor = packcolor(20, 100, 220, 175) o_dropship2.panecolor = packcolor(255, 255, 255, 200) initialize(o_dropship2) // object o_randomnumbers1 = randomnumbers // o_randomnumbers1.location = 60, 440, 15 // o_randomnumbers1.speed = 10 // o_randomnumbers1.alpha_val = 50 // initialize(o_randomnumbers1) // object o_randomnumbers2 = randomnumbers // o_randomnumbers2.location = 60, 455, 15 // o_randomnumbers2.speed = 7 // o_randomnumbers2.alpha_val = 110 // initialize(o_randomnumbers2) // object o_randomnumbers3 = randomnumbers // o_randomnumbers3.location = 60, 470, 15 // o_randomnumbers3.speed = 3 // o_randomnumbers3.alpha_val = 150 // initialize(o_randomnumbers3) // object o_randomnumbers4 = randomnumbers // o_randomnumbers4.location = 60, 485, 15 // o_randomnumbers4.speed = 7 // o_randomnumbers4.alpha_val = 110 // initialize(o_randomnumbers4) // object o_randomnumbers5 = randomnumbers // o_randomnumbers5.location = 60, 500, 15 // o_randomnumbers5.speed = 10 // o_randomnumbers5.alpha_val = 50 // initialize(o_randomnumbers5) // object o_compass = compass // o_compass.location = 0, 0, 15 } // if !callback($$CTCL_IsConsole$$) int display1 = random(10, 99) int display2 = random(100, 999) int display3 = random(10, 99) } if !callback($$CTCL_IsConsoleX$$) //|| callback($$CTCL_CheckCOOP$$) { int iloop int twidth int num_of_buttons if callback($$CTCL_CheckCOOP$$) { num_of_buttons = 1 } else { if callback($$CTCL_IsConsole$$) num_of_buttons = 2 else num_of_buttons = 9 } object mbutton[num_of_buttons] for iloop = 0; iloop < num_of_buttons; iloop++ { mbutton[iloop] = s_textbutton mbutton[iloop].textcolor = 0xffffffff mbutton[iloop].textsize = 1 mbutton[iloop].id = iloop } // jcem - start if callback($$CTCL_CheckCOOP$$) { mbutton[0].text = GAME_START_MSG } else { if callback($$CTCL_IsConsole$$) { mbutton[0].text = localize$(IDS_MM_MULTI) // mbutton[1].text = localize$(DNL_MECHLAB) mbutton[1].text = localize$(IDS_GN_QUIT_LC) } else { // jcem - end mbutton[0].text = localize$(IDS_MM_TRAINING) mbutton[1].text = localize$(IDS_MM_CAMPAIGN) mbutton[2].text = localize$(IDS_MM_INSTANTACTION) mbutton[3].text = localize$(IDS_MM_MULTI) mbutton[4].text = localize$(DNL_MECHLAB) mbutton[5].text = localize$(IDS_MM_OPTIONS) mbutton[6].text = localize$(IDS_MM_CINEMACREDITS) mbutton[7].text = localize$(IDS_MM_ROSTER) mbutton[8].text = localize$(IDS_GN_QUIT_LC) // jcem - start } } // jcem - end for iloop = 0; iloop < num_of_buttons; iloop++ { initialize(mbutton[iloop]) } } sound btnTriggeredSound = SPATH "sfx_button5.wav" framerate = 10 int only_once = true int game_started = false } GUI_INIT { if !callback($$CTCL_IsConsoleX$$) //|| callback($$CTCL_CheckCOOP$$) { if callback($$CTCL_CheckCOOP$$) { mbutton[0].location = (getresx() / 2) - (getprint3dwidth(GAME_START_MSG) / 2), 400, 50 } else { if callback($$CTCL_IsConsole$$) { mbutton[0].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_MM_MULTI)) / 2), 185, 50 // mbutton[1].location = (getresx() / 2) - (getprint3dwidth(localize$(DNL_MECHLAB)) / 2), 245, 50 mbutton[1].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_GN_QUIT_LC)) / 2), 360, 50 } else { mbutton[0].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_MM_TRAINING)) / 2), 45, 50 mbutton[1].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_MM_CAMPAIGN)) / 2), 103, 50 mbutton[2].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_MM_INSTANTACTION)) / 2), 161, 50 mbutton[3].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_MM_MULTI)) / 2), 219, 50 mbutton[4].location = (getresx() / 2) - (getprint3dwidth(localize$(DNL_MECHLAB)) / 2), 277, 50 mbutton[5].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_MM_OPTIONS)) / 2), 335, 50 mbutton[6].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_MM_CINEMACREDITS)) / 2), 393, 50 mbutton[7].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_MM_ROSTER)) / 2), 451, 50 mbutton[8].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_GN_QUIT_LC)) / 2), 509, 50 } } int i for i = 0; i < num_of_buttons; i++ { initialize(mbutton[i]) } } } GUI_EXECUTE { if (nInitialMultiplayScreen == 1) { nInitialMultiplayScreen = 0 mail(PM_INITIALMULTIPLAYSCREEN, this) return } if callback($$CTCL_CheckCOOP$$) { callback($$CTCL_PosCOOP$$, mouse.x, mouse.y) } //if 2 <= callback($$CTCL_GetCoinCount$$) // callback($$CTCL_StartCOOP$$) } GUI_DRAW { setpencolor(0xff000000) if (!callback($$CTCL_CheckPlayMovie$$)) { drawrect 0,0 to getresx(), getresy() } if !callback($$CTCL_IsConsoleX$$) //|| callback($$CTCL_CheckCOOP$$) { if !callback($$CTCL_IsConsole$$) { setpencolor(100, 163, 221,random(75, 125)) //(0xaa64a3dd) drawframe 570, 35 to 730, 200 } // if !callback($$CTCL_IsConsoleX$$) print3d_attributes = garbagefont, def_num_color,1,1,1,0,0, just_center print3d_margins = 50, 60 to 140, 75 print3d_position = 50, 60 print3d conv$(display1) ":" conv$(display2) ":" conv$(display3) //if callback($$CTCL_CheckCOOP$$) //{ //int nCoins = callback($$CTCL_GetCoinCount$$) //} } } GUI_MAILBOX { if !callback($$CTCL_IsConsoleX$$) || callback($$CTCL_CheckCOOP$$) { if callback($$CTCL_CheckCOOP$$) { if sender == o_fullscrbutton { if !game_started { if callback($$CTCL_StartCOOP$$) game_started = 1 else play btnTriggeredSound,1 } } //if (sender == mbutton[0]) //{ // play btnTriggeredSound,1 // unfocus //callback($$CTCL_DoReprint$$, 1) //callback($$Shell_CallbackHandler$$, ShellInitMechLabScreen) //@SHELL@lastScreenDepth++ //@SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU //@SHELL@currentScreen = MECHBAY_SCREEN //} } else { if callback($$CTCL_IsConsole$$) { if ((sender == this) && (getmessage() == PM_INITIALMULTIPLAYSCREEN)) || (sender == mbutton[0]) { play btnTriggeredSound,1 unfocus callback($$SetShellCommand$$, START_NETWORK_SHELLS_COMMAND) @SHELL@currentScreen = LAUNCHGAME @SHELL@lastScreenDepth-- //@SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU //@SHELL@currentScreen = MULTIPLAYER_SCREEN } // if (sender == mbutton[1]) // { // play btnTriggeredSound,1 // unfocus // callback($$Shell_CallbackHandler$$, ShellInitMechLabScreen) // @SHELL@lastScreenDepth++ // @SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU // @SHELL@currentScreen = MECHBAY_SCREEN // } if (sender == mbutton[1]) { play btnTriggeredSound,1 unfocus terminate } } else { if (sender == mbutton[0]) { if (only_once) { play btnTriggeredSound,1 script_end "mouse.script" callback($$Shell_CallbackHandler$$, ShellLaunchTrainingMission) callback($$SetShellCommand$$, START_SINGLE_PLAYER_GAME_COMMAND) @SHELL@currentScreen = LAUNCHGAME @SHELL@lastScreenDepth-- unfocus only_once = false } } if (sender == mbutton[1]) { play btnTriggeredSound,1 unfocus //spew"@SHELL@campaignMechlab",@SHELL@campaignMechlab @SHELL@lastScreenDepth++ @SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU @SHELL@currentScreen = CAMPAIGNLOBBY } if (sender == mbutton[2]) { play btnTriggeredSound,1 // callback($$Shell_CallbackHandler$$, ShellInitIAScreen) unfocus @SHELL@lastScreenDepth++ @SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU @SHELL@currentScreen = INSTANT_SCREEN } if ((sender == this) && (getmessage() == PM_INITIALMULTIPLAYSCREEN)) || (sender == mbutton[3]) { play btnTriggeredSound,1 unfocus callback($$SetShellCommand$$, START_NETWORK_SHELLS_COMMAND) @SHELL@currentScreen = LAUNCHGAME @SHELL@lastScreenDepth-- //@SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU //@SHELL@currentScreen = MULTIPLAYER_SCREEN } if (sender == mbutton[4]) { play btnTriggeredSound,1 unfocus callback($$Shell_CallbackHandler$$, ShellInitMechLabScreen) @SHELL@lastScreenDepth++ @SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU @SHELL@currentScreen = MECHBAY_SCREEN } if (sender == mbutton[5]) { play btnTriggeredSound,1 unfocus @SHELL@lastScreenDepth++ @SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU @SHELL@currentScreen = OPTIONS } if (sender == mbutton[6]) { play btnTriggeredSound,1 unfocus @SHELL@lastScreenDepth++ @SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU @SHELL@currentScreen = CINEMAOPTIONS } if (sender == mbutton[7]) { play btnTriggeredSound,1 @SHELL@lastScreenDepth++ @SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU @SHELL@currentScreen = PILOTENTRY } if (sender == mbutton[8]) { play btnTriggeredSound,1 unfocus terminate } } } } } } randomnumbers { GUI_CREATE { int random1 int random2 int random3 int random4 int random5 int speed int alpha_val = 255 int num_color = packcolor(255, 255, 255, alpha_val) framerate = 3 } GUI_INIT { framerate = speed num_color = packcolor(20, 100, 200, alpha_val) } GUI_EXECUTE { random1 = random(0, 9) random2 = random(0, 9) random3 = random(0, 9) random4 = random(0, 9) random5 = random(0, 9) } GUI_DRAW { print3d_attributes = garbagefont, num_color,1,1,1,0,0, just_center print3d_margins = location.x, location.y to location.x + 10, location.y + 15 print3d_position = location.x, location.y print3d random1 print3d_margins = location.x + 10, location.y to location.x + 20, location.y + 15 print3d_position = location.x + 10, location.y print3d random2 print3d_margins = location.x + 20, location.y to location.x + 30, location.y + 15 print3d_position = location.x + 20, location.y print3d random3 print3d_margins = location.x + 30, location.y to location.x + 40, location.y + 15 print3d_position = location.x + 30, location.y print3d random4 print3d_margins = location.x + 40, location.y to location.x + 50, location.y + 15 print3d_position = location.x + 40, location.y print3d random5 } } panedisplay { GUI_CREATE { pane p_pane string filename int panecolor = packcolor(255, 255, 255, 255) int scalex = 100 int scaley = 100 int alphatype } GUI_INIT { p_pane = filename color(p_pane) = panecolor scale(p_pane) = scalex, scaley if alphatype == 0 { alphamode(p_pane) = am_alpha_alphainvalpha } else { if alphatype == -1 // jcem alphamode(p_pane) = am_alpha_onezero else alphamode(p_pane) = am_alpha_oneone } } GUI_DRAW { render p_pane, location } } drawbox { GUI_CREATE { int boxcolor = packcolor(0, 0, 120, 80) int boxtype int boxwidth int boxheight int randomcolor } GUI_DRAW { if randomcolor { setpencolor(100, 163, 221,random(50, 75)) } else { setpencolor(boxcolor) } if boxtype == 0 { ldrawframe 0, 0 to boxwidth, boxheight } else { ldrawrect 0, 0 to boxwidth, boxheight } } } compass { GUI_CREATE { int linecolor = packcolor(100, 163, 221, 75) int display_num } GUI_DRAW { setpencolor(linecolor) drawline 0, 560 to 800, 560 int i for i = 0; i < 80; i++ { if (0 + (10 * i)) % 10 == 0 { if (0 + (10 * i)) % 50 == 0 { drawline 0 + (10 * i), 552 to 0 + (10 * i), 560 print3d_attributes = smallfont, linecolor,1,1,1,0,0, just_center print3d_margins = (0 + (10 * i)) - 10, 540 to (0 + (10 * i)) + 10, 550 print3d_position = (0 + (10 * i)) - 10, 540 display_num = i * 2 print3d display_num } else { drawline 0 + (10 * i), 555 to 0 + (10 * i), 560 } } } } } starfield { GUI_CREATE { int num_of_stars = 75 int starpointx[num_of_stars] int starpointy[num_of_stars] int i for i = 0; i < num_of_stars; i++ { starpointx[i] = random(20, getresx()) starpointy[i] = random(20, getresy()) } framerate = 10 } GUI_DRAW { int i for i = 0; i < num_of_stars; i++ { setpencolor(255, 255, 255, random(100, 150)) drawline starpointx[i], starpointy[i] to starpointx[i] + 1, starpointy[i] + 1 if i % 2 == 0 { drawline starpointx[i], starpointy[i] - 1 to starpointx[i], starpointy[i] + 1 } } } } s_lighting_movie { GUI_CREATE { location = 0, 285, 10000 movie mymovie = "hsh\\coop\\Final(lighting).avi" //movie mymovie = szPATH_MOVIES "Burnloop_lr_15.avi" scale(mymovie) = 100, 100 loop mymovie } GUI_DRAW { render mymovie, location } } s_coin_string { GUI_CREATE { string text font3d text_font = FPATH localize$(IDS_F_ML_LABEL) int text_color = packcolor(255,255,255,255) framerate = 20 int width = 100 int height = 20 } GUI_DRAW { if length$(text) > 0 { print3d_margins = location.x,location.y to location.x+width, location.y+height print3d_attributes = text_font, text_color, 1, 0, 1, 0, 0, just_left print3d_position = location.x + (width - getprint3dwidth(text) - 2), location.y + (height - getprint3dheight("text")) / 2 print3d text } } } s_fullscrbutton { GUI_CREATE { location = -500,-500 int id = -9988 //A R G B int width = 2000 int height = 2000 region = location.x,location.y to width,height sound btnRolloverSound = SPATH "sfx_button7.wav" // delay is frame based not time based int delay = 4 int time_delayed = 0 framerate = 2 } GUI_INIT { region = 0,0 to width, height } LBUTTON_UPDATE { if (time_delayed == delay) { if (mouse.left == BUTTON_CLICKED) //|| (mouse.right == BUTTON_CLICKED) { play btnRolloverSound, 1 mail(id, parent) } } } GUI_EXECUTE { if (time_delayed < delay) time_delayed++ } GUI_DRAW { } }