Advertisement
Guest User

GTA Buttons

a guest
Aug 30th, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.63 KB | None | 0 0
  1. //New variables
  2. bool rsPress = false;
  3. bool rbPress = false;
  4.  
  5. //Replace these functions in your source with the ones below
  6. void monitorButtons()
  7. {
  8.     SetupTimer(20);
  9.     if (submenu == Closed)
  10.     {
  11.         if (IsTimerReady())
  12.         {
  13.             if (CONTROLS::IS_CONTROL_PRESSED(0, Button_R1) && CONTROLS::IS_CONTROL_PRESSED(0, Dpad_Left))
  14.             {
  15.                 submenu = Main_Menu;
  16.                 submenuLevel = 0;
  17.                 currentOption = 1;
  18.                 playSound("YES");
  19.             }
  20.             else if (CONTROLS::IS_CONTROL_JUST_PRESSED(0, Button_A))
  21.             {
  22.                 optionPress = true;
  23.             }
  24.             else if (CONTROLS::IS_CONTROL_PRESSED(0, Button_R1))
  25.             {
  26.                 rbPress = true;
  27.             }
  28.             else if (CONTROLS::IS_CONTROL_PRESSED(0, Button_R3))
  29.             {
  30.                 rsPress = true;
  31.             }
  32.             ResetTimer();
  33.         }
  34.     }
  35.     else {
  36.         if (IsTimerReady())
  37.         {
  38.             if (CONTROLS::IS_CONTROL_JUST_PRESSED(0, Button_B))
  39.             {
  40.                 if (submenu == Main_Menu)
  41.                 {
  42.                     submenu = Closed;
  43.                 }
  44.                 else {
  45.                     submenu = lastSubmenu[submenuLevel - 1];
  46.                     currentOption = lastOption[submenuLevel - 1];
  47.                     submenuLevel--;
  48.                 }
  49.                 playSound("Back");
  50.             }
  51.             else if (CONTROLS::IS_CONTROL_JUST_PRESSED(0, Button_A))
  52.             {
  53.                 optionPress = true;
  54.                 playSound("SELECT");
  55.             }
  56.             else if (CONTROLS::IS_CONTROL_JUST_PRESSED(0, Dpad_Up))
  57.             {
  58.                 currentOption--;
  59.                 if (currentOption < 1)
  60.                 {
  61.                     currentOption = optionCount;
  62.                 }
  63.                 playSound("NAV_UP_DOWN");
  64.             }
  65.             else if (CONTROLS::IS_CONTROL_JUST_PRESSED(0, Dpad_Down))
  66.             {
  67.                 currentOption++;
  68.                 if (currentOption > optionCount)
  69.                 {
  70.                     currentOption = 1;
  71.                 }
  72.                 playSound("NAV_UP_DOWN");
  73.             }
  74.             else if (CONTROLS::IS_CONTROL_JUST_PRESSED(0, Dpad_Right))
  75.             {
  76.                 rightPress = true;
  77.             }
  78.             else if (CONTROLS::IS_CONTROL_JUST_PRESSED(0, Dpad_Left))
  79.             {
  80.                 leftPress = true;
  81.             }
  82.             else if (CONTROLS::IS_CONTROL_PRESSED(0, Dpad_Right))
  83.             {
  84.                 fastRightPress = true;
  85.             }
  86.             else if (CONTROLS::IS_CONTROL_PRESSED(0, Dpad_Left))
  87.             {
  88.                 fastLeftPress = true;
  89.             }
  90.             else if (CONTROLS::IS_CONTROL_JUST_PRESSED(0, Button_X))
  91.             {
  92.                 squarePress = true;
  93.             }
  94.             else if (CONTROLS::IS_CONTROL_PRESSED(0, Button_R1))
  95.             {
  96.                 rbPress = true;
  97.             }
  98.             else if (CONTROLS::IS_CONTROL_PRESSED(0, Button_R3))
  99.             {
  100.                 rsPress = true;
  101.             }
  102.             ResetTimer();
  103.         }
  104.     }
  105. }
  106. void resetVars()
  107. {
  108.     if (submenu != Closed)
  109.         normalMenuActions();
  110.     optionPress = false;
  111.     rightPress = false;
  112.     leftPress = false;
  113.     fastRightPress = false;
  114.     fastLeftPress = false;
  115.     squarePress = false;
  116.     rsPress = false;
  117.     rbPress = false;
  118.     infoText = NULL;
  119.     instructionsSetupThisFrame = false;
  120.     squareInstruction = false;
  121.     xInstruction = false;
  122.     lrInstruction = false;
  123. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement