#include "Content\\ShellScripts\\stddefs.h" #include "Content\\ShellScripts\\ScriptStrings.h" #include "Content\\ShellScripts\\common_shell.script" #include "Content\\ShellScripts\\ShellFunctionHeaders.hpp" #include "Content\\ShellScripts\\listboxes.script" #include "Content\\ShellScripts\\mc_listboxes.script" #include "Content\\ShellScripts\\buttons.script" #include "Content\\ShellScripts\\c_Pane.script" #include "Content\\ShellScripts\\c_MoviePlayer.script" #include "Content\\ShellScripts\\c_text.script" #include "Content\\ShellScripts\\c_rollover.script" main { GUI_CREATE { object oRollover = s_HelpRegion oRollover.nFontID = IDS_F_ROLLOVER_INFO oRollover.cTextColor= 0xFFff7200 oRollover.location = 31,516,255 oRollover.nWidth = 538 oRollover.nHeight = 56 initialize(oRollover) activate(oRollover) object screen = o_OptionsScreen focus(screen) } } o_OptionsScreen { GUI_CREATE { location.z = 5 int nMPConsole = 0 int nMPServerBrowser= 0 object oPane = s_Pane oPane.location = 0,0,0 oPane.szBitmap = GPATH "OM_Background.tga" oPane.nFrames = 1 oPane.nCurrFrame = 0 oPane.nMode = 0 oPane.fVolatile = 0 oPane.fRegion = 0 oPane.nHelpID = -1 initialize(oPane) object o_frame = frame o_frame.type = 1 o_frame.location = 0, 0, 150 //100 o_frame.screen_name = localize$(IDS_OM_TITLE) initialize(o_frame) object o_mouselines = mouselines o_mouselines.location = 0, 0, o_frame.location.z - 1 //Buttons object o_ok_button = s_multistatepane o_ok_button.total_states = 3 o_ok_button.textsize = 1 o_ok_button.text = localize$(IDS_GN_OK) o_ok_button.file = WPATH "button_main_196x41m_3state.tga" o_ok_button.location = 580, 540, o_frame.location.z + 1 initialize(o_ok_button) sound btnTriggeredSound = SPATH "sfx_button5.wav" string currentPilotName = "" callback($$Shell_CallbackHandler$$, ShellGetPilotName, currentPilotName) object oPilotName = s_Text oPilotName.location = 350, 35,nZ_TEXT oPilotName.nFontID = IDS_F_OM_TAB_TITLE oPilotName.szText = localize$(IDS_OM_PILOT_NAME) " " currentPilotName oPilotName.cTextColor = cWhite oPilotName.nJustify = 0 oPilotName.nLayoutWidth = 350 oPilotName.nLayoutHeight = 20 initialize(oPilotName) object oTabs = s_OptionTabs if(exists(@SHELL@)) { initialize(this) } int TabX = 34 int TabXSpace = 3 int TabY = 58 int TabW = 143 int boxwidth = 727 int boxheight = 369 int boxx1 = TabX + 2 int boxy1 = TabY + 41 int boxx2 = boxx1 + boxwidth int boxy2 = boxy1 + boxheight int tabsy1 = TabY + 2 int tabsy2 = TabY + 41 int tabsx1 = boxx1 int tabsx2 = tabsx1 + TabW int tabsx3 = tabsx1 + TabW + tabxSpace int tabsx4 = tabsx1 + (2 * TabW) + tabxSpace int tabsx5 = tabsx1 + (2 * TabW) + (2 * tabxSpace) int tabsx6 = tabsx1 + (3 * TabW) + (2 * tabxSpace) int tabsx7 = tabsx1 + (3 * TabW) + (3 * tabxSpace) int tabsx8 = tabsx1 + (4 * TabW) + (3 * tabxSpace) int tabsx9 = tabsx1 + (4 * TabW) + (4 * tabxSpace) int tabsx10 = tabsx1 + (5 * TabW) + (4 * tabxSpace) } GUI_DRAW { setpencolor(0, 0, 0, 150) drawrect boxx1, boxy1 to boxx2, boxy2 drawrect tabsx1, tabsy1 to tabsx2, tabsy2 drawrect tabsx3, tabsy1 to tabsx4, tabsy2 drawrect tabsx5, tabsy1 to tabsx6, tabsy2 drawrect tabsx7, tabsy1 to tabsx8, tabsy2 drawrect tabsx9, tabsy1 to tabsx10, tabsy2 setpencolor (0xffffffff) drawline boxx1, boxy1 to boxx1, boxy2 drawline tabsx2 - 2, tabsy2 to tabsx3 + 2, tabsy2 drawline tabsx4 - 2, tabsy2 to tabsx5 + 2, tabsy2 drawline tabsx6 - 2, tabsy2 to tabsx7 + 2, tabsy2 drawline tabsx8 - 2, tabsy2 to tabsx9 + 2, tabsy2 setpencolor (0xffbbbbcc) drawline boxx1 + 1, boxy1 - 1 to boxx1 + 1, boxy2 - 1 drawline boxx1 + 1, boxy2 - 2 to boxx2 - 2, boxy2 - 2 drawline boxx2 - 2, boxy1 to boxx2 - 2, boxy2 - 2 drawline tabsx2 - 2, tabsy2 + 1 to tabsx3 + 2, tabsy2 + 1 drawline tabsx4 - 2, tabsy2 + 1 to tabsx5 + 2, tabsy2 + 1 drawline tabsx6 - 2, tabsy2 + 1 to tabsx7 + 2, tabsy2 + 1 drawline tabsx8 - 2, tabsy2 + 1 to tabsx9 + 2, tabsy2 + 1 setpencolor (0xff777777) drawline boxx1, boxy2 - 1 to boxx2 - 1, boxy2 - 1 drawline boxx2 - 1, boxy1 to boxx2 - 1, boxy2 - 1 } GUI_INIT { if(nMPConsole == 1 || nMPServerBrowser == 1) { o_ok_button.nRollover = 1 o_ok_button.nHelpID = IDS_HELP_OM_M_MULTI initialize(o_ok_button) } else { o_ok_button.nRollover = 1 o_ok_button.nHelpID = IDS_GN_HELP_MAINMENU_BUTTON initialize(o_ok_button) } initialize(oTabs) } GUI_MAILBOX { switch (sender) { case o_ok_button: { play btnTriggeredSound,1 // BUGBUG DAN Fix the name on the callback and uncomment @OM_Controls@nMouseSlid = @OM_Controls@oSMouseSlid.nSelected callback($$Shell_CallbackHandler$$,SetMouseSensitivity,@OM_Controls@nMouseSlid) // Handle multiplayer name errors if (equal$(@OM_Multi@oEName.boxValue, "")) { @OM_Multi@nErrorActivated = 1 @OM_Multi@oErrorBox = o_ErrorScreen @OM_Multi@oErrorBox.error_message = localize$(IDS_ERROR_OM_M_NAME_MSG) initialize(@OM_Multi@oErrorBox) activate(@OM_Multi@oErrorBox) return } else { mail(MSG_SETOPTIONS, @OM_Multi@) @OM_Multi@szName = @OM_Multi@oEName.boxValue @OM_Multi@szTeam = @OM_Multi@oETeam.boxValue @OM_Multi@szPass = @OM_Multi@oEPass.boxValue @OM_Multi@nPassToggle = @OM_Multi@nPassToggle - 1 @OM_Multi@nAllowToggle= @OM_Multi@nAllowToggle - 1 if (callback($$LeaveMultiplayerOptionsScreen$$,@OM_Multi@szName,@OM_Multi@szTeam,@OM_Multi@nPassToggle,@OM_Multi@szPass,@OM_Multi@nPlayerI,@OM_Multi@nTeamI, @OM_Multi@szInsiginia[], @OM_Multi@szInsigniaFullName[], @OM_Multi@nInsigTotal,@OM_Multi@nAllowToggle) == -1) { @OM_Multi@nErrorActivated = 1 @OM_Multi@oErrorBox = o_ErrorScreen @OM_Multi@oErrorBox.error_message = localize$(IDS_ERROR_OM_M_CHAR_MSG) initialize(@OM_Multi@oErrorBox) activate(@OM_Multi@oErrorBox) return } @OM_Multi@nPassToggle = @OM_Multi@nPassToggle + 1 @OM_Multi@nAllowToggle= @OM_Multi@nAllowToggle + 1 } callback($$Shell_CallbackHandler$$, ShellSaveOptions) unfocus mail(nMSG_ENDOPTIONS,this) if(nMPConsole == 1) { script_run szPATH_SCRIPTS "\\multiplayer\\multiplayerconsole.script", 0x1000 script_end } else if(nMPServerBrowser == 1) { script_run szPATH_SCRIPTS "\\multiplayer\\listofgames.script", 0x1000 script_end } else if (exists(@SHELL@)) { @SHELL@currentScreen = @SHELL@lastScreen[@SHELL@lastScreenDepth] @SHELL@lastScreenDepth-- } if exists(@shell) { initialize(@shell@) } } break } switch (getmessage()) { case nMSG_ENDOPTIONS: { script_end "OM_Game.script" script_end "OM_Video.script" script_end "OM_Audio.script" script_end "OM_Controls.script" script_end "OM_Multi.script" } break } } GUI_DESTROY { unfocus } } s_OptionTabs { GUI_CREATE { //Tabs int TabX = 36 int TabXSpace = 3 int TabY = 58 int TabW = 143 int total_buttons = 5 int i string szScripts[total_buttons] szScripts[0] = "OM_Game.script" szScripts[1] = "OM_Video.script" szScripts[2] = "OM_Audio.script" szScripts[3] = "OM_Controls.script" szScripts[4] = "OM_Multi.script" object oOMTab[total_buttons] for(i = 0; i < total_buttons; i++) { oOMTab[i] = s_multistatepanetoggle oOMTab[i].location = TabX + (i * (TabW + TabXSpace)), TabY, nZ_BUTTON oOMTab[i].file = szPATH_GRAPHICS "3state_OM_tabs.tga" oOMTab[i].total_states = 3 oOMTab[i].nRollover = 1 oOMTab[i].id = i } oOMTab[0].text = localize$(IDS_OM_GAME) oOMTab[0].nHelpID = IDS_HELP_OM_GAME oOMTab[1].text = localize$(IDS_OM_VIDEO) oOMTab[1].nHelpID = IDS_HELP_OM_VIDEO oOMTab[2].text = localize$(IDS_OM_AUDIO) oOMTab[2].nHelpID = IDS_HELP_OM_AUDIO oOMTab[3].text = localize$(IDS_OM_CONTROLS) oOMTab[3].nHelpID = IDS_HELP_OM_CONTROLS oOMTab[4].text = localize$(IDS_OM_MULTIPLAYER) oOMTab[4].nHelpID = IDS_HELP_OM_MULTIPLAYER for(i = 0; i < total_buttons; i++) { initialize(oOMTab[i]) script_run szPATH_SCRIPTS szScripts[i], 0x1000 script_pause szScripts[i] } } GUI_INIT { if(parent.nMPServerBrowser != 1 && parent.nMPConsole != 1) { script_continue szScripts[0] mail(2, oOMTab[0]) } else { script_continue szScripts[4] mail(2, oOMTab[4]) } } GUI_MAILBOX { int i if (sender != oOMTab[4]) { if (equal$(@OM_Multi@oEName.boxValue, "")) { for (i = 0; i < total_buttons - 1; i++) { if sender == oOMTab[i] { oOMTab[i].state = 0 initialize(oOMTab[i]) break } } @OM_Multi@nErrorActivated = 1 @OM_Multi@oErrorBox = o_ErrorScreen @OM_Multi@oErrorBox.error_message = localize$(IDS_ERROR_OM_M_NAME_MSG) initialize(@OM_Multi@oErrorBox) activate(@OM_Multi@oErrorBox) return } else { mail(MSG_SETOPTIONS, @OM_Multi@) @OM_Multi@szName = @OM_Multi@oEName.boxValue @OM_Multi@szTeam = @OM_Multi@oETeam.boxValue @OM_Multi@szPass = @OM_Multi@oEPass.boxValue @OM_Multi@nPassToggle = @OM_Multi@nPassToggle - 1 @OM_Multi@nAllowToggle= @OM_Multi@nAllowToggle - 1 if (callback($$LeaveMultiplayerOptionsScreen$$,@OM_Multi@szName,@OM_Multi@szTeam,@OM_Multi@nPassToggle,@OM_Multi@szPass,@OM_Multi@nPlayerI,@OM_Multi@nTeamI, @OM_Multi@szInsiginia[], @OM_Multi@szInsigniaFullName[], @OM_Multi@nInsigTotal,@OM_Multi@nAllowToggle) == -1) { for (i = 0; i < total_buttons - 1; i++) { if sender == oOMTab[i] { oOMTab[i].state = 0 initialize(oOMTab[i]) break } } @OM_Multi@nErrorActivated = 1 @OM_Multi@oErrorBox = o_ErrorScreen @OM_Multi@oErrorBox.error_message = localize$(IDS_ERROR_OM_M_CHAR_MSG) initialize(@OM_Multi@oErrorBox) activate(@OM_Multi@oErrorBox) return } @OM_Multi@nPassToggle = @OM_Multi@nPassToggle + 1 @OM_Multi@nAllowToggle= @OM_Multi@nAllowToggle + 1 } } for(i = 0; i < total_buttons; i++) { if (sender != oOMTab[i]) { // turn off every button but the one just received mail(1, oOMTab[i]) script_pause szScripts[i] // script_pause "OM_Video_A.script" } } if sender == oOMTab[0] { script_continue szScripts[0] } if sender == oOMTab[1] { script_continue szScripts[1] } if sender == oOMTab[2] { script_continue szScripts[2] } if sender == oOMTab[3] { script_continue szScripts[3] } if sender == oOMTab[4] { script_continue szScripts[4] } } }