Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // DARTHBOLLO'S SKELETON MENU
- // for more info or help "not too much help though " add me as a friend http://steamcommunity.com/profiles/76561198029847665
- using System;
- using System.Collections.Generic;
- using GTA;
- using System.Windows.Forms;
- using Menu = GTA.Menu;
- namespace Skeleton_menu
- {
- public class Class1 : Script
- {
- Class1()
- {
- Tick += OnTick;
- KeyUp += OnKeyUp;
- }
- void OnTick(object sender, EventArgs e)
- {
- }
- void OnKeyUp(object sender, KeyEventArgs e)
- {
- if(e.KeyCode == Keys.F4)
- {
- Main_menu();
- }
- }
- private void Main_menu()
- {
- closemenus();
- var menulist = new List<IMenuItem>();
- var button = new MenuButton("Example button 1");
- button.Activated += (sender, args) => { UI.Notify("This is an example"); };
- menulist.Add(button);
- button = new MenuButton("Example button 2");
- button.Activated += (sender, args) => { UI.Notify("This is an example 2"); }; // either use this or a function call
- menulist.Add(button);
- var menutoggle = new MenuToggle("This is a toggle","Your description here");
- menutoggle.Changed += (sender, args) => { UI.Notify("You toggled me");};
- menulist.Add(button);
- Menu Active_Menu = new Menu("Example menu", menulist.ToArray()); // if you store the menu inside a var you can edit it
- View.AddMenu(Active_Menu);
- }
- private void closemenus()
- {
- View.CloseAllMenus();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement