Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Toggling the Menu
- if (MenuState == false and (keyboard_check_pressed(ord("C")) or keyboard_check_pressed(vk_control)) and obj_player.Frisk_State == PlayerStates.Normal)
- {
- MenuState = true;
- audio_play_sound(sfx_move_select, 1, false);
- obj_player.Frisk_State = PlayerStates.Frozen;
- }
- 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)
- {
- MenuState = false;
- obj_player.Frisk_State = PlayerStates.Normal;
- }
- //Actions inside the Menu
- if (MenuState == true)
- {
- if (global.CurrentItems == 0)
- {
- ItemState = false;
- }
- else
- {
- ItemState = true;
- }
- //Moving the selector along the menu
- if (keyboard_check_pressed(vk_up))
- {
- if (BlankMenuState == false)
- {
- if (Selector_Position > 0)
- {
- Selector_Position -= 1;
- audio_play_sound(sfx_move_select, 1, false);
- }
- }
- if (InItemMenu == true)
- {
- if (ItemMenu_Selector_Position > 0 and ItemMenu_Stage == 1)
- {
- ItemMenu_Selector_Position -= 1;
- audio_play_sound(sfx_move_select, 1, false);
- }
- }
- }
- else if (keyboard_check_pressed(vk_down))
- {
- if (BlankMenuState == false)
- {
- if (Selector_Position < 1 and CellState == false)
- {
- Selector_Position += 1;
- audio_play_sound(sfx_move_select, 1, false);
- }
- else if (Selector_Position < 2 and CellState == true)
- {
- Selector_Position += 1;
- audio_play_sound(sfx_move_select, 1, false);
- }
- }
- if (InItemMenu == true)
- {
- if (ItemMenu_Selector_Position < 7 and ItemMenu_Selector_Position < global.CurrentItems - 1 and ItemMenu_Stage == 1)
- {
- ItemMenu_Selector_Position += 1;
- audio_play_sound(sfx_move_select, 1, false);
- }
- }
- }
- else if (keyboard_check_pressed(vk_right))
- {
- if (InItemMenu == true)
- {
- if (ItemMenu_Stage == 2)
- {
- if (ItemMenu_Selector_Options < 2)
- {
- ItemMenu_Selector_Options += 1;
- audio_play_sound(sfx_move_select, 1, false);
- }
- }
- }
- }
- else if (keyboard_check_pressed(vk_left))
- {
- if (InItemMenu == true)
- {
- if (ItemMenu_Stage == 2)
- {
- if (ItemMenu_Selector_Options > 0)
- {
- ItemMenu_Selector_Options -= 1;
- audio_play_sound(sfx_move_select, 1, false);
- }
- }
- }
- }
- //Selected Options
- if ((keyboard_check_pressed(ord("Z")) or keyboard_check_pressed(vk_enter)) and BlankMenuState == false)
- {
- if (Selector_Position == 0 and ItemState == true) //ITEMS
- {
- alarm[0] = 2;
- }
- else if (Selector_Position == 1 and StatState == true) //STATS
- {
- audio_play_sound(sfx_select_confirmed, 1, false);
- BlankMenuState = true;
- InStatMenu = true;
- Selector_Alpha = 0;
- }
- else if (Selector_Position == 2 and CellState == true) //CELL
- {
- audio_play_sound(sfx_select_confirmed, 1, false);
- BlankMenuState = true;
- InCellMenu = true;
- Selector_Alpha = 0;
- }
- }
- else if ((keyboard_check_pressed(ord("X")) or keyboard_check_pressed(vk_shift)) and BlankMenuState == true and InItemMenu == false)
- {
- BlankMenuState = false;
- Selector_Alpha = 1;
- if (Selector_Position > -1)
- {
- audio_play_sound(sfx_move_select, 1, false);
- }
- if (Selector_Position == 0)
- {
- alarm[1] = 2;
- }
- else if (Selector_Position == 1)
- {
- InStatMenu = false;
- }
- else if (Selector_Position == 2)
- {
- InCellMenu = false;
- }
- }
- //Selecting Items in the inventory
- if ((keyboard_check_pressed(ord("Z")) or keyboard_check_pressed(vk_enter)) and InItemMenu == true)
- {
- global.item_selected = global.Inventory[# 1, ItemMenu_Selector_Position];
- if (ItemMenu_Stage == 1)
- {
- audio_play_sound(sfx_select_confirmed, 1, false);
- ItemMenu_Stage = 2;
- }
- else if (ItemMenu_Stage == 2)
- {
- if (ItemMenu_Selector_Options == 0)
- {
- obj_inventory.Item_Message = true;
- obj_inventory.USE_Item = true;
- ItemMenu_Stage = 3;
- ItemMenu_Draw = false;
- }
- else if (ItemMenu_Selector_Options == 1)
- {
- obj_inventory.Item_Message = true;
- obj_inventory.INFO_Item = true;
- ItemMenu_Stage = 3;
- ItemMenu_Draw = false;
- }
- else if (ItemMenu_Selector_Options == 2)
- {
- obj_inventory.Item_Message = true;
- obj_inventory.DROP_Item = true;
- ItemMenu_Stage = 3;
- ItemMenu_Draw = false;
- }
- }
- }
- else if ((keyboard_check_pressed(ord("X")) or keyboard_check_pressed(vk_shift)) and InItemMenu == true)
- {
- var item_selected = global.Inventory[# 1, ItemMenu_Selector_Position];
- if (ItemMenu_Stage == 2)
- {
- audio_play_sound(sfx_move_select, 1, false);
- ItemMenu_Stage = 1;
- }
- else if (ItemMenu_Stage == 1)
- {
- audio_play_sound(sfx_move_select, 1, false);
- ItemMenu_Stage = 0;
- InItemMenu = false;
- BlankMenuState = false;
- Selector_Alpha = 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment