Advertisement
Guest User

Skeleton Menu for GTA V By darthbollo

a guest
Jul 2nd, 2015
476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.71 KB | None | 0 0
  1. // DARTHBOLLO'S SKELETON MENU
  2. // for more info or help "not too much help though " add me as a friend http://steamcommunity.com/profiles/76561198029847665
  3.  
  4. using System;
  5. using System.Collections.Generic;
  6. using GTA;
  7. using System.Windows.Forms;
  8. using Menu = GTA.Menu;
  9.  
  10.  
  11. namespace Skeleton_menu
  12. {
  13.     public class Class1 : Script
  14.     {
  15.  
  16.        
  17.         Class1()
  18.         {
  19.             Tick += OnTick;
  20.             KeyUp += OnKeyUp;
  21.        
  22.         }
  23.     void OnTick(object sender, EventArgs e)
  24.         {
  25.  
  26.         }
  27.  
  28.     void OnKeyUp(object sender, KeyEventArgs e)
  29.     {
  30.         if(e.KeyCode == Keys.F4)
  31.         {
  32.             Main_menu();
  33.         }
  34.     }
  35.    
  36.     private void Main_menu()
  37.     {
  38.         closemenus();
  39.         var menulist = new List<IMenuItem>();
  40.         var button = new MenuButton("Example button 1");
  41.         button.Activated += (sender, args) => { UI.Notify("This is an example"); };
  42.         menulist.Add(button);
  43.  
  44.         button = new MenuButton("Example button 2");
  45.         button.Activated += (sender, args) => { UI.Notify("This is an example 2"); }; // either use this or a function call
  46.         menulist.Add(button);
  47.  
  48.         var menutoggle = new MenuToggle("This is a toggle","Your description here");
  49.        menutoggle.Changed += (sender, args) => { UI.Notify("You toggled me");};
  50.         menulist.Add(button);
  51.       Menu Active_Menu = new Menu("Example menu", menulist.ToArray()); // if you store the menu inside a var you can edit it
  52.         View.AddMenu(Active_Menu);
  53.  
  54.     }
  55.    
  56.     private void closemenus()
  57.     {
  58.         View.CloseAllMenus();
  59.     }
  60.    
  61.    
  62.    
  63.    
  64.    
  65.    
  66.    
  67.    
  68.    
  69.    
  70.    
  71.    
  72.    
  73.    
  74.    
  75.    
  76.    
  77.     }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement