OmegaGamingHunters

obj_overworld_menu_step_event_update1

Oct 2nd, 2019
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.83 KB | None | 0 0
  1. //Toggling the Menu
  2. if (MenuState == false and (keyboard_check_pressed(ord("C")) or keyboard_check_pressed(vk_control)) and obj_player.Frisk_State == PlayerStates.Normal)
  3. {
  4.     MenuState = true;
  5.     audio_play_sound(sfx_move_select, 1, false);
  6.     obj_player.Frisk_State = PlayerStates.Frozen;
  7. }
  8. else if (MenuState == true and (keyboard_check_pressed(ord("C")) or keyboard_check_pressed(ord("X")) or keyboard_check_pressed(vk_control) or keyboard_check_pressed(vk_shift)) and BlankMenuState == false)
  9. {
  10.     MenuState = false;
  11.     obj_player.Frisk_State = PlayerStates.Normal;
  12. }
  13.  
  14. //Actions inside the Menu
  15. if (MenuState == true)
  16. {
  17.     if (global.CurrentItems == 0)
  18.     {
  19.         ItemState = false;
  20.     }
  21.     else
  22.     {
  23.         ItemState = true;
  24.     }
  25.     //Moving the selector along the menu
  26.     if (keyboard_check_pressed(vk_up))
  27.     {
  28.         if (BlankMenuState == false)
  29.         {
  30.             if (Selector_Position > 0)
  31.             {
  32.                     Selector_Position -= 1;
  33.                     audio_play_sound(sfx_move_select, 1, false);
  34.             }  
  35.         }
  36.        
  37.         if (InItemMenu == true)
  38.         {
  39.             if (ItemMenu_Selector_Position > 0 and ItemMenu_Stage == 1)
  40.             {
  41.                     ItemMenu_Selector_Position -= 1;
  42.                     audio_play_sound(sfx_move_select, 1, false);
  43.             }  
  44.         }
  45.     }
  46.     else if (keyboard_check_pressed(vk_down))
  47.     {
  48.         if (BlankMenuState == false)
  49.         {
  50.             if (Selector_Position < 1 and CellState == false)
  51.             {
  52.                 Selector_Position += 1;
  53.                 audio_play_sound(sfx_move_select, 1, false);
  54.             }
  55.             else if (Selector_Position < 2 and CellState == true)
  56.             {
  57.                 Selector_Position += 1;
  58.                 audio_play_sound(sfx_move_select, 1, false);
  59.             }
  60.         }
  61.        
  62.         if (InItemMenu == true)
  63.         {
  64.             if (ItemMenu_Selector_Position < 7 and ItemMenu_Selector_Position < global.CurrentItems - 1 and ItemMenu_Stage == 1)
  65.             {
  66.                     ItemMenu_Selector_Position += 1;
  67.                     audio_play_sound(sfx_move_select, 1, false);
  68.             }  
  69.         }
  70.     }
  71.     else if (keyboard_check_pressed(vk_right))
  72.     {
  73.         if (InItemMenu == true)
  74.         {
  75.             if (ItemMenu_Stage == 2)
  76.             {
  77.                 if (ItemMenu_Selector_Options < 2)
  78.                 {
  79.                     ItemMenu_Selector_Options += 1;
  80.                     audio_play_sound(sfx_move_select, 1, false);
  81.                 }
  82.             }
  83.         }
  84.     }
  85.     else if (keyboard_check_pressed(vk_left))
  86.     {
  87.         if (InItemMenu == true)
  88.         {
  89.             if (ItemMenu_Stage == 2)
  90.             {
  91.                 if (ItemMenu_Selector_Options > 0)
  92.                 {
  93.                     ItemMenu_Selector_Options -= 1;
  94.                     audio_play_sound(sfx_move_select, 1, false);
  95.                 }
  96.             }
  97.         }
  98.     }
  99.    
  100.     //Selected Options
  101.     if ((keyboard_check_pressed(ord("Z")) or keyboard_check_pressed(vk_enter)) and BlankMenuState == false)
  102.     {
  103.         if (Selector_Position == 0 and ItemState == true) //ITEMS
  104.         {
  105.             alarm[0] = 2;
  106.         }
  107.         else if (Selector_Position == 1 and StatState == true) //STATS
  108.         {
  109.             audio_play_sound(sfx_select_confirmed, 1, false);
  110.             BlankMenuState = true;
  111.             InStatMenu = true;
  112.             Selector_Alpha = 0;
  113.         }
  114.         else if (Selector_Position == 2 and CellState == true) //CELL
  115.         {
  116.             audio_play_sound(sfx_select_confirmed, 1, false);
  117.             BlankMenuState = true;
  118.             InCellMenu = true;
  119.             Selector_Alpha = 0;
  120.         }
  121.     }
  122.     else if ((keyboard_check_pressed(ord("X")) or keyboard_check_pressed(vk_shift)) and BlankMenuState == true and InItemMenu == false)
  123.     {
  124.         BlankMenuState = false;
  125.         Selector_Alpha = 1;
  126.        
  127.         if (Selector_Position > -1)
  128.         {
  129.             audio_play_sound(sfx_move_select, 1, false);
  130.         }
  131.        
  132.         if (Selector_Position == 0)
  133.         {
  134.             alarm[1] = 2;
  135.         }
  136.         else if (Selector_Position == 1)
  137.         {
  138.             InStatMenu = false;
  139.         }
  140.         else if (Selector_Position == 2)
  141.         {
  142.             InCellMenu = false;
  143.         }
  144.     }
  145.    
  146.     //Selecting Items in the inventory
  147.     if ((keyboard_check_pressed(ord("Z")) or keyboard_check_pressed(vk_enter)) and InItemMenu == true)
  148.     {
  149.         global.item_selected = global.Inventory[# 1, ItemMenu_Selector_Position];
  150.         if (ItemMenu_Stage == 1)
  151.         {
  152.             audio_play_sound(sfx_select_confirmed, 1, false);
  153.             ItemMenu_Stage = 2;
  154.         }
  155.         else if (ItemMenu_Stage == 2)
  156.         {
  157.             if (ItemMenu_Selector_Options == 0)
  158.             {
  159.                 obj_inventory.Item_Message = true;
  160.                 obj_inventory.USE_Item = true;
  161.                 ItemMenu_Stage = 3;
  162.                 ItemMenu_Draw = false;
  163.             }
  164.             else if (ItemMenu_Selector_Options == 1)
  165.             {
  166.                 obj_inventory.Item_Message = true;
  167.                 obj_inventory.INFO_Item = true;
  168.                 ItemMenu_Stage = 3;
  169.                 ItemMenu_Draw = false;
  170.             }
  171.             else if (ItemMenu_Selector_Options == 2)
  172.             {
  173.                 obj_inventory.Item_Message = true;
  174.                 obj_inventory.DROP_Item = true;
  175.                 ItemMenu_Stage = 3;
  176.                 ItemMenu_Draw = false;
  177.             }
  178.         }
  179.     }
  180.     else if ((keyboard_check_pressed(ord("X")) or keyboard_check_pressed(vk_shift)) and InItemMenu == true)
  181.     {
  182.         var item_selected = global.Inventory[# 1, ItemMenu_Selector_Position];
  183.         if (ItemMenu_Stage == 2)
  184.         {
  185.             audio_play_sound(sfx_move_select, 1, false);
  186.             ItemMenu_Stage = 1;
  187.         }
  188.         else if (ItemMenu_Stage == 1)
  189.         {
  190.             audio_play_sound(sfx_move_select, 1, false);
  191.             ItemMenu_Stage = 0;
  192.             InItemMenu = false;
  193.             BlankMenuState = false;
  194.             Selector_Alpha = 1;
  195.         }
  196.     }
  197. }
Advertisement
Add Comment
Please, Sign In to add comment