Advertisement
Guest User

Tyler Howard - Odyssey Menu Unrealscript

a guest
Mar 5th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Odyssey_MenuFrontEnd extends GFxMoviePlayer
  2.     config(UI);
  3.  
  4. var GFxClikWidget NewButton;
  5. var GFxClikWidget ContinueButton;
  6. var GFxClikWidget ControlsButton;
  7. var GFxClikWidget StoryButton;
  8. var GFxClikWidget JournalButton;
  9. var GFxClikWidget CreditsButton;
  10.  
  11. var GFxClikWidget QuitButton;
  12.  
  13. var GFxObject StoryWalls[17];
  14.  
  15. var GFxObject newImage;
  16. var GFxObject continueWind;
  17. var GFxObject continueEarth;
  18. var GFxObject continueLightning;
  19. var GFxObject continueFinal;
  20.  
  21. var GFxObject windMap;
  22. var GFxObject earthMap;
  23. var GFxObject lightningMap;
  24. var GFxObject finalMap;
  25. var GFxObject compass;
  26. var GFxObject touchupsCounter;
  27.  
  28. var GFxClikWidget OptionsButton;
  29. var GFxClikWidget OptionsBackButton;
  30. var GFxClikWidget ToggleInvertButton;
  31.  
  32. var GFxObject invertedText;
  33. var GFxObject notInvertedText;
  34.  
  35. var bool bContinueDisabled;
  36.  
  37. var SoundCue ButtonChangeSoundCue;
  38.  
  39. DefaultProperties
  40. {
  41.  
  42.     bEnableGammaCorrection=FALSE
  43.     bIgnoreMouseInput = false
  44.     bCaptureInput = true
  45.  
  46.     bContinueDisabled = false;
  47.  
  48.     // These are the button names set in the flash file
  49.     WidgetBindings.Add( ( WidgetName = "newButton", WidgetClass = class'GFxClikWidget') );
  50.     WidgetBindings.Add( ( WidgetName = "continueButton", WidgetClass = class'GFxClikWidget') );
  51.     WidgetBindings.Add( ( WidgetName = "controlsButton", WidgetClass = class'GFxClikWidget') );
  52.     WidgetBindings.Add( ( WidgetName = "journalButton", WidgetClass = class'GFxClikWidget') );
  53.     WidgetBindings.Add( ( WidgetName = "storyButton", WidgetClass = class'GFxClikWidget') );
  54.     WidgetBindings.Add( ( WidgetName = "creditsButton", WidgetClass = class'GFxClikWidget') );
  55.     WidgetBindings.Add( ( WidgetName = "quitButton", WidgetClass = class'GFxClikWidget') );
  56.  
  57.    
  58.     WidgetBindings.Add( ( WidgetName = "optionsButton", WidgetClass = class'GFxClikWidget') );
  59.     WidgetBindings.Add( ( WidgetName = "optionsBackButton", WidgetClass = class'GFxClikWidget') );
  60.     WidgetBindings.Add( ( WidgetName = "toggleInvertButton", WidgetClass = class'GFxClikWidget') );
  61.    
  62.  
  63.     ButtonChangeSoundCue = SoundCue'Common_EnvSounds_Odyssey.Sounds.BalOdyssey_PageTurn_Cue';
  64. }
  65.  
  66. function Init(optional LocalPlayer PC )
  67. {
  68.     //Start and load the SWF Movie
  69.     super.Start();
  70.     Advance(0.f);
  71.  
  72.     super.Init(PC);
  73. }
  74.  
  75. event bool WidgetInitialized( name WidgetName, name WidgetPath, GFxObject Widget )
  76. {
  77.     local int i;
  78.     local Odyssey_SaveGameState SGS;
  79.  
  80.     switch( WidgetName )
  81.     {
  82.         case ('newButton'):
  83.             if( NewButton == none )
  84.             {
  85.                 NewButton=GFxClikWidget( Widget );
  86.  
  87.                 NewButton.AddEventListener( 'CLIK_press', NewButtonFunction );
  88.                 NewButton.AddEventListener( 'CLIK_rollOver', NewButtonRollOver );
  89.  
  90.                 NewButton.AddEventListener( 'CLIK_focusIn', HideOptionsMenu );
  91.                 NewButton.AddEventListener( 'CLIK_focusIn', PlayPageFlipSound );
  92.  
  93.                 SGS = new () class'Odyssey_SaveGameState';
  94.                 class'Engine'.static.BasicLoadObject(SGS, "..\\..\\..\\Saves\\SaveGameState\\odysseysave2.bin", true, 1);
  95.                
  96.                 if((SGS.currentLevel == Wind && SGS.bLevelStart == true)
  97.                     ||
  98.                 (SGS.currentLevel == Mother && SGS.CheckpointInt == 50))
  99.                 {
  100.                     NewButton.SetBool("focused", true);
  101.                 }
  102.  
  103.                 return true;
  104.             }
  105.             break;
  106.  
  107.         case ('continueButton'):
  108.             if( ContinueButton == none )
  109.             {
  110.                 ContinueButton=GFxClikWidget( Widget );
  111.  
  112.                 ContinueButton.AddEventListener( 'CLIK_press', ContinueButtonFunction );
  113.                 ContinueButton.AddEventListener( 'CLIK_focusIn', ContinueButtonShow );
  114.                 ContinueButton.AddEventListener( 'CLIK_focusOut', ContinueButtonHide );
  115.                
  116.                 ContinueButton.AddEventListener( 'CLIK_rollOver', ContinueButtonRollOver );
  117.  
  118.                 ContinueButton.AddEventListener( 'CLIK_focusIn', HideOptionsMenu );
  119.                 ContinueButton.AddEventListener( 'CLIK_focusIn', PlayPageFlipSound );
  120.  
  121.                 newImage = getVariableObject("_root.newImage");
  122.                 continueWind = getVariableObject("_root.continueWind");
  123.                 continueEarth = getVariableObject("_root.continueEarth");
  124.                 continueLightning = getVariableObject("_root.continueLightning");
  125.                 continueFinal = getVariableObject("_root.continueFinal");
  126.  
  127.                 SGS = new () class'Odyssey_SaveGameState';
  128.                 class'Engine'.static.BasicLoadObject(SGS, "..\\..\\..\\Saves\\SaveGameState\\odysseysave2.bin", true, 1);
  129.  
  130.                 if((SGS.currentLevel == Wind && SGS.bLevelStart == true)
  131.                     ||
  132.                 (SGS.currentLevel == Mother && SGS.CheckpointInt == 50))
  133.                 {
  134.                     ContinueButton.SetBool("disabled", true);
  135.                     bContinueDisabled = true;
  136.                 }
  137.                 else
  138.                 {
  139.                     ContinueButton.SetBool("focused", true);
  140.                 }
  141.  
  142.                 return true;
  143.             }
  144.             break;
  145.  
  146.         case ('storyButton'):
  147.             if( StoryButton == none )
  148.             {
  149.                 StoryButton=GFxClikWidget( Widget );
  150.  
  151.                 StoryButton.AddEventListener( 'CLIK_focusIn', StoryButtonShow );
  152.                 StoryButton.AddEventListener( 'CLIK_focusOut', StoryButtonHide );
  153.  
  154.                 StoryButton.AddEventListener( 'CLIK_rollOver', StoryButtonRollOver );
  155.                
  156.                 StoryButton.AddEventListener( 'CLIK_focusIn', HideOptionsMenu );
  157.                 StoryButton.AddEventListener( 'CLIK_focusIn', PlayPageFlipSound );
  158.  
  159.                 for(i = 0; i < 17; i++)
  160.                 {
  161.                     StoryWalls[i] = GetVariableObject("_root.story"$i );
  162.                 }
  163.  
  164.                 return true;
  165.             }
  166.             break;
  167.  
  168.         case ('journalButton'):
  169.             if( JournalButton == none )
  170.             {
  171.                 JournalButton=GFxClikWidget( Widget );
  172.  
  173.                 JournalButton.AddEventListener( 'CLIK_focusIn', JournalButtonShow );
  174.                 JournalButton.AddEventListener( 'CLIK_focusOut', JournalButtonHide );
  175.  
  176.                 JournalButton.AddEventListener( 'CLIK_rollOver', JournalButtonRollOver );
  177.  
  178.                 JournalButton.AddEventListener( 'CLIK_focusIn', HideOptionsMenu );
  179.  
  180.                 JournalButton.AddEventListener( 'CLIK_focusIn', PlayPageFlipSound );
  181.  
  182.                 windMap = GetVariableObject("_root.windMap");
  183.                 earthMap = GetVariableObject("_root.earthMap");
  184.                 lightningMap = GetVariableObject("_root.lightningMap");
  185.                 finalMap = GetVariableObject("_root.finalMap");
  186.                 compass = GetVariableObject("_root.compass");
  187.                 touchupsCounter = GetVariableObject("_root.touchupsCounter");
  188.  
  189.                 return true;
  190.             }
  191.             break;
  192.  
  193.         //Handled in ActionScript
  194.         case ('controlsButton'):
  195.             if( ControlsButton == none )
  196.             {
  197.                 ControlsButton=GFxClikWidget( Widget );
  198.  
  199.                 ControlsButton.AddEventListener( 'CLIK_rollOver', ControlsButtonRollOver );
  200.  
  201.                 ControlsButton.AddEventListener( 'CLIK_focusIn', HideOptionsMenu );
  202.  
  203.                 ControlsButton.AddEventListener( 'CLIK_focusIn', PlayPageFlipSound );
  204.  
  205.                 return true;
  206.             }
  207.             break;
  208.  
  209.         case ('creditsButton'):
  210.             if( CreditsButton == none )
  211.             {
  212.                 CreditsButton=GFxClikWidget( Widget );
  213.                 CreditsButton.AddEventListener( 'CLIK_rollOver', CreditsButtonRollOver );
  214.  
  215.                 CreditsButton.AddEventListener( 'CLIK_focusIn', HideOptionsMenu );
  216.                 CreditsButton.AddEventListener( 'CLIK_focusIn', PlayPageFlipSound );
  217.                 return true;
  218.             }
  219.             break;
  220.  
  221.         case ('quitButton'):
  222.             if( QuitButton == none )
  223.             {
  224.                 QuitButton=GFxClikWidget( Widget );
  225.  
  226.                 QuitButton.AddEventListener( 'CLIK_press', QuitButtonFunction );
  227.                 QuitButton.AddEventListener( 'CLIK_rollOver', QuitButtonRollOver );
  228.  
  229.                 QuitButton.AddEventListener( 'CLIK_focusIn', HideOptionsMenu );
  230.                 QuitButton.AddEventListener( 'CLIK_focusIn', PlayPageFlipSound );
  231.                 return true;
  232.             }
  233.             break;
  234.  
  235.         case('optionsButton'):
  236.             if( OptionsButton  == none )
  237.             {
  238.                 OptionsButton=GFxClikWidget( Widget );
  239.  
  240.                 OptionsButton.AddEventListener( 'CLIK_press', OptionsButtonFunction );
  241.                 OptionsButton.AddEventListener( 'CLIK_rollOver', OptionsButtonRollOver );
  242.                
  243.                 OptionsButton.AddEventListener( 'CLIK_focusIn', OptionsButtonFocusIn);
  244.                 OptionsButton.AddEventListener( 'CLIK_focusOut', OptionsButtonFocusOut);
  245.                 OptionsButton.AddEventListener( 'CLIK_focusIn', PlayPageFlipSound );
  246.             }
  247.             break;
  248.         case('optionsBackButton'):
  249.             if( OptionsBackButton  == none )
  250.             {
  251.                 OptionsBackButton=GFxClikWidget( Widget );
  252.  
  253.                 OptionsBackButton.AddEventListener( 'CLIK_press', OptionsBackButtonFunction );
  254.                 OptionsBackButton.AddEventListener( 'CLIK_rollOver', OptionsBackButtonRollOver );
  255.                 OptionsBackButton.AddEventListener( 'CLIK_focusIn', PlayPageFlipSound );
  256.  
  257.                 OptionsBackButton.setVisible(false);
  258.             }
  259.             break;
  260.  
  261.         case('toggleInvertButton'):
  262.             if( ToggleInvertButton  == none )
  263.             {
  264.                 ToggleInvertButton=GFxClikWidget( Widget );
  265.  
  266.                 ToggleInvertButton.AddEventListener( 'CLIK_press', ToggleInvertButtonFunction );
  267.                 ToggleInvertButton.AddEventListener( 'CLIK_rollOver', ToggleInvertButtonRollOver );
  268.                 ToggleInvertButton.AddEventListener( 'CLIK_focusIn', PlayPageFlipSound );
  269.  
  270.                 invertedText = getVariableObject("_root.invertedText");
  271.                 notInvertedText = getVariableObject("_root.notInvertedText");
  272.             }
  273.             break;
  274.     }
  275.  
  276.     return true;
  277. }
  278.  
  279. // These functions are referred to by the WidgetInitialized() function
  280. function NewButtonFunction( GFxClikWidget.EventData ev )
  281. {
  282.     local Odyssey_SaveGameState SGS;
  283.     local Odyssey_PlayerController OPC;
  284.  
  285.     SGS = new () class'Odyssey_SaveGameState';
  286.     OPC = Odyssey_PlayerController(GetPC());
  287.  
  288.     OPC.SaveGameState = SGS;
  289.  
  290.     OPC.SaveGame(SGS);
  291.  
  292.     OPC.ConsoleCommand("open OdyJadeJournalCinematic");
  293. }
  294.  
  295. function NewButtonRollOver( GFxClikWidget.EventData ev )
  296. {
  297.     NewButton.SetBool("focused", true);
  298. }
  299.  
  300. function ContinueButtonRollOver( GFxClikWidget.EventData ev )
  301. {
  302.     ContinueButton.SetBool("focused", true);
  303. }
  304.  
  305. function StoryButtonRollOver( GFxClikWidget.EventData ev )
  306. {
  307.     StoryButton.SetBool("focused", true);
  308. }
  309.  
  310. function JournalButtonRollOver( GFxClikWidget.EventData ev )
  311. {
  312.     JournalButton.SetBool("focused", true);
  313. }
  314.  
  315. function ControlsButtonRollOver( GFxClikWidget.EventData ev )
  316. {
  317.     ControlsButton.SetBool("focused", true);
  318. }
  319.  
  320. function CreditsButtonRollOver( GFxClikWidget.EventData ev )
  321. {
  322.     CreditsButton.SetBool("focused", true);
  323. }
  324.  
  325. function QuitButtonRollOver( GFxClikWidget.EventData ev )
  326. {
  327.     QuitButton.SetBool("focused", true);
  328. }
  329.  
  330. function ContinueButtonShow( GFxClikWidget.EventData ev )
  331. {
  332.     local Odyssey_SaveGameState SGS;
  333.  
  334.     SGS = new () class'Odyssey_SaveGameState';
  335.  
  336.     class'Engine'.static.BasicLoadObject(SGS, "..\\..\\..\\Saves\\SaveGameState\\odysseysave2.bin", true, 1);
  337.  
  338.     if(SGS.currentLevel == Wind && SGS.bLevelStart == true)
  339.     {
  340.         newImage.setVisible(true);
  341.     }
  342.     else
  343.     {
  344.         switch(SGS.currentLevel)
  345.         {
  346.         case Wind:
  347.             continueWind.setVisible(true);
  348.             break;
  349.  
  350.         case Earth:
  351.             continueEarth.setVisible(true);
  352.             break;
  353.  
  354.         case Lightning:
  355.             continueLightning.setVisible(true);
  356.             break;
  357.  
  358.         case Mother:
  359.             continueFinal.setVisible(true);
  360.             break;
  361.         }
  362.     }
  363. }
  364.  
  365. function ContinueButtonHide( GFxClikWidget.EventData ev )
  366. {
  367.     newImage.setVisible(false);
  368.     continueWind.setVisible(false);
  369.     continueEarth.setVisible(false);
  370.     continueLightning.setVisible(false);
  371.     continueFinal.setVisible(false);
  372. }
  373.  
  374. function ContinueButtonFunction( GFxClikWidget.EventData ev )
  375. {
  376.     local Odyssey_SaveGameState SGS;
  377.     local Odyssey_PlayerController OPC;
  378.  
  379.     SGS = new () class'Odyssey_SaveGameState';
  380.     OPC = Odyssey_PlayerController(GetPC());
  381.  
  382.     if( class'Engine'.static.BasicLoadObject(SGS, "..\\..\\..\\Saves\\SaveGameState\\odysseysave2.bin", true, 1) )
  383.     {
  384.         if(SGS.currentLevel == Wind)
  385.         {
  386.             OPC.ConsoleCommand("open Wind_P");
  387.             return;
  388.         }
  389.         else if(SGS.currentLevel == Earth)
  390.         {
  391.             OPC.ConsoleCommand("open Earth_P");
  392.             return;
  393.         }
  394.         else if(SGS.currentLevel == Lightning)
  395.         {
  396.             OPC.ConsoleCommand("open Lightning_P");
  397.             return;
  398.         }
  399.         else if(SGS.currentLevel == Mother)
  400.         {
  401.             OPC.ConsoleCommand("open Mother_P");
  402.             return;
  403.         }
  404.     }
  405. }
  406.  
  407. //exit
  408. function QuitButtonFunction( GFxClikWidget.EventData ev )
  409. {
  410.     local Odyssey_PlayerController OPC;
  411.  
  412.     OPC = Odyssey_PlayerController(GetPC());
  413.  
  414.     OPC.ConsoleCommand("exit");
  415. }
  416.  
  417. function StoryButtonShow( GFxClikWidget.EventData ev )
  418. {
  419.     //get number of storywalls, hide/show data appropriately
  420.     local Odyssey_SaveGameState SGS;
  421.     local int i;
  422.  
  423.     StoryWalls[0].setVisible(true);
  424.  
  425.  
  426.     SGS = new () class'Odyssey_SaveGameState';
  427.     if( class'Engine'.static.BasicLoadObject(SGS, "..\\..\\..\\Saves\\SaveGameState\\odysseysave2.bin", true, 1) )
  428.     {
  429.  
  430.         for(i = 0; i < 4; ++i)
  431.         {
  432.             if(SGS.WindSW[i] > 0)               //1-4
  433.                 StoryWalls[i + 1].setVisible(true);
  434.  
  435.             if(SGS.EarthSW[i] > 0)              //5-8
  436.                 StoryWalls[i + 5].setVisible(true);
  437.  
  438.             if(SGS.LightSW[i] > 0)              //9-12
  439.                 StoryWalls[i + 9].setVisible(true);
  440.  
  441.             if(SGS.MotherSW[i] > 0)              //13-16
  442.                 StoryWalls[i + 13].setVisible(true);
  443.         }
  444.  
  445.         if(SGS.currentLevel == Mother && SGS.CheckpointInt == 50)
  446.         {
  447.             StoryWalls[16].setVisible(true);
  448.         }
  449.     }
  450. }
  451.  
  452. function StoryButtonHide( GFxClikWidget.EventData ev )
  453. {
  454.     local int i;
  455.     for(i = 0; i < 17; ++i)
  456.         StoryWalls[i].setVisible(false);
  457. }
  458.  
  459. function JournalButtonShow( GFxClikWidget.EventData ev )
  460. {
  461.     local int i;
  462.     local int j;
  463.  
  464.     local Odyssey_SaveGameState SGS;
  465.  
  466.     SGS = new () class'Odyssey_SaveGameState';
  467.  
  468.     class'Engine'.static.BasicLoadObject(SGS, "..\\..\\..\\Saves\\SaveGameState\\odysseysave2.bin", true, 1);
  469.  
  470.     j = 0;
  471.     for(i = 0; i < 11; ++i)
  472.     {
  473.         if(SGS.earthMap[i] > 0)
  474.             ++j;
  475.         if(SGS.WindMap[i] > 0)
  476.             ++j;
  477.         if(SGS.LightMap[i] > 0)
  478.             ++j;
  479.     }
  480.  
  481.     for(i = 0; i < 14; ++i)
  482.     {
  483.         if(SGS.MotherMap[i] > 0)
  484.             ++j;
  485.     }
  486.  
  487.     touchupsCounter.SetText(j $ "/ 32");
  488.  
  489.     if(SGS.currentLevel >= Wind)
  490.         windMap.setVisible(true);
  491.  
  492.     if(SGS.currentLevel >= Earth)
  493.         earthMap.setVisible(true);
  494.  
  495.     if(SGS.currentLevel >= Lightning)
  496.         lightningMap.setVisible(true);
  497.    
  498.     if(SGS.currentLevel >= Mother)
  499.         finalMap.setVisible(true);
  500.    
  501.     compass.setVisible(true);
  502.     touchupsCounter.setVisible(true);
  503. }
  504.  
  505. function JournalButtonHide( GFxClikWidget.EventData ev )
  506. {
  507.     windMap.setVisible(false);
  508.     earthMap.setVisible(false);
  509.     lightningMap.setVisible(false);
  510.     finalMap.setVisible(false);
  511.     compass.setVisible(false);
  512.     touchupsCounter.setVisible(false);
  513. }
  514.  
  515. function OptionsButtonFunction( GFxClikWidget.EventData ev )
  516. {
  517.     local Odyssey_PlayerController OPC;
  518.  
  519.     //disable all buttons on the side, enable toggle and back button
  520.     NewButton.setBool("disabled", true);
  521.     ContinueButton.setBool("disabled", true);
  522.     ControlsButton.setBool("disabled", true);
  523.     StoryButton.setBool("disabled", true);
  524.     JournalButton.setBool("disabled", true);
  525.     CreditsButton.setBool("disabled", true);
  526.     QuitButton.setBool("disabled", true);
  527.     OptionsButton.setBool("disabled", true);
  528.  
  529.     ToggleInvertButton.setBool("disabled", false);
  530.     OptionsBackButton.setBool("disabled", false);
  531.  
  532.     ToggleInvertButton.setVisible(true);
  533.     OptionsBackButton.setVisible(true);
  534.  
  535.     ToggleInvertButton.setBool("focused", true);
  536.  
  537.     OPC = Odyssey_PlayerController(GetPC());
  538.  
  539.     //show/hide text as appropriate
  540.     if(OPC.PlayerInput.bInvertMouse)
  541.     {
  542.         invertedText.setVisible(true);
  543.         notInvertedText.setVisible(false);
  544.     }
  545.     else
  546.     {
  547.         invertedText.setVisible(false);
  548.         notInvertedText.setVisible(true);
  549.     }
  550. }
  551.  
  552. function OptionsButtonRollOver( GFxClikWidget.EventData ev )
  553. {
  554.     OptionsButton.SetBool("focused", true);
  555.  
  556.     //options menu displayed, not selectable yet
  557.     //show/hide of options menu on rollover/out handled in actionscript
  558. }
  559.  
  560. function OptionsButtonFocusIn( GFxClikWidget.EventData ev )
  561. {
  562.     local Odyssey_PlayerController OPC;
  563.  
  564.     OptionsBackButton.SetBool("visible", true);
  565.     ToggleInvertButton.SetBool("visible", true);
  566.  
  567.     OptionsBackButton.SetBool("disabled", true);
  568.     ToggleInvertButton.SetBool("disabled", true);
  569.  
  570.     OPC = Odyssey_PlayerController(GetPC());
  571.  
  572.     //show/hide text as appropriate
  573.     if(OPC.PlayerInput.bInvertMouse)
  574.     {
  575.         invertedText.setVisible(true);
  576.         notInvertedText.setVisible(false);
  577.     }
  578.     else
  579.     {
  580.         invertedText.setVisible(false);
  581.         notInvertedText.setVisible(true);
  582.     }
  583. }
  584.  
  585. function OptionsButtonFocusOut( GFxClikWidget.EventData ev )
  586. {
  587.     invertedText.setVisible(false);
  588.     notInvertedText.setVisible(false);
  589. }
  590.  
  591. function OptionsBackButtonFunction( GFxClikWidget.EventData ev )
  592. {
  593.     //re-enable all buttons on side, disable toggle and back button
  594.     NewButton.setBool("disabled", false);
  595.    
  596.     if(!bContinueDisabled) ContinueButton.setBool("disabled", false);
  597.    
  598.     ControlsButton.setBool("disabled", false);
  599.     StoryButton.setBool("disabled", false);
  600.     JournalButton.setBool("disabled", false);
  601.     CreditsButton.setBool("disabled", false);
  602.     QuitButton.setBool("disabled", false);
  603.     OptionsButton.setBool("disabled", false);
  604.  
  605.     ToggleInvertButton.setBool("disabled", true);
  606.     OptionsBackButton.setBool("disabled", true);
  607.  
  608.     OptionsButton.SetBool("focused", true);
  609. }
  610.  
  611. function OptionsBackButtonRollOver( GFxClikWidget.EventData ev )
  612. {
  613.     OptionsBackButton.SetBool("focused", true);
  614. }
  615.  
  616. function ToggleInvertButtonRollOver( GFxClikWidget.EventData ev )
  617. {
  618.     ToggleInvertButton.SetBool("focused", true);
  619. }
  620.  
  621. function HideOptionsMenu( GFxClikWidget.EventData ev )
  622. {
  623.     if(OptionsBackButton != None) OptionsBackButton.SetBool("visible", false);
  624.     if(ToggleInvertButton != None) ToggleInvertButton.SetBool("visible", false);
  625.  
  626.     if(invertedText != None) invertedText.setVisible(false);
  627.     if(notInvertedText != None) notInvertedText.setVisible(false);
  628. }
  629.  
  630. function ToggleInvertButtonFunction( GFxClikWidget.EventData ev )
  631. {
  632.     local Odyssey_PlayerController OPC;
  633.  
  634.     OPC = Odyssey_PlayerController(GetPC());
  635.    
  636.     OPC.ConsoleCommand("invertmouse");
  637.  
  638.     //show/hide text as appropriate
  639.     if(OPC.PlayerInput.bInvertMouse)
  640.     {
  641.         invertedText.setVisible(true);
  642.         notInvertedText.setVisible(false);
  643.     }
  644.     else
  645.     {
  646.         invertedText.setVisible(false);
  647.         notInvertedText.setVisible(true);
  648.     }
  649. }
  650.  
  651. function PlayPageFlipSound( GFxClikWidget.EventData ev )
  652. {
  653.     GetPC().Pawn.PlaySound(ButtonChangeSoundCue, true);
  654. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement