Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Forum Support

    3. Suggestions

[.NET] NativeUI


Guad
 Share

Recommended Posts

How do you compile the (NativeUI) assembly? Last night I was able to compile the debug version, but not the release. This morning I went to compare the setting (debug/release) and now neither will compile. Many compiling errors.

Error	1	; expected	C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs	1264	46	NativeUIError	2	Invalid token '(' in class, struct, or interface member declaration	C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs	1264	69	NativeUIError	3	Invalid token ',' in class, struct, or interface member declaration	C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs	1264	97	NativeUIError	4	; expected	C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs	1270	25	NativeUIError	5	Invalid token ';' in class, struct, or interface member declaration	C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs	1270	43	NativeUIError	6	Invalid token '=' in class, struct, or interface member declaration	C:\Users\Josh\Documents\GitHub\NativeUI\UIResText.cs	33	46	NativeUIError	7	Invalid token '=' in class, struct, or interface member declaration	C:\Users\Josh\Documents\GitHub\NativeUI\UIResText.cs	34	43	NativeUIError	8	Invalid expression term '.'	C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs	459	35	NativeUI

That's is just the first eight (out of 40).

 

Thanks.

Link to comment
Share on other sites

How do you compile the (NativeUI) assembly? Last night I was able to compile the debug version, but not the release. This morning I went to compare the setting (debug/release) and now neither will compile. Many compiling errors.

Error	1	; expected	C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs	1264	46	NativeUIError	2	Invalid token '(' in class, struct, or interface member declaration	C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs	1264	69	NativeUIError	3	Invalid token ',' in class, struct, or interface member declaration	C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs	1264	97	NativeUIError	4	; expected	C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs	1270	25	NativeUIError	5	Invalid token ';' in class, struct, or interface member declaration	C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs	1270	43	NativeUIError	6	Invalid token '=' in class, struct, or interface member declaration	C:\Users\Josh\Documents\GitHub\NativeUI\UIResText.cs	33	46	NativeUIError	7	Invalid token '=' in class, struct, or interface member declaration	C:\Users\Josh\Documents\GitHub\NativeUI\UIResText.cs	34	43	NativeUIError	8	Invalid expression term '.'	C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs	459	35	NativeUI

That's is just the first eight (out of 40).

 

Thanks.

 

You need Visual Studio 2015

Link to comment
Share on other sites

 

 

 

You need Visual Studio 2015

 

Ah, i see, new language features.Okay, thank you.

 

I'm guessing that this

OnMenuClose?.Invoke(this)

is equivenlent to:

if (OnMenuClose != null)    OnMenuClose(this);
Link to comment
Share on other sites

unknown modder

When the new update for ScriptHookV comes out, opening any menu without disabling instructional buttons will cause your game to crash instantly. This is a bug with ScriptHookVdotnet that for some reason didnt crash the game on previous versions.

Link to comment
Share on other sites

When the new update for ScriptHookV comes out, opening any menu without disabling instructional buttons will cause your game to crash instantly. This is a bug with ScriptHookVdotnet that for some reason didnt crash the game on previous versions.

 

It was causing crash also in previous version. https://github.com/Guad/NativeUI/issues/13

Link to comment
Share on other sites

unknown modder

 

When the new update for ScriptHookV comes out, opening any menu without disabling instructional buttons will cause your game to crash instantly. This is a bug with ScriptHookVdotnet that for some reason didnt crash the game on previous versions.

 

It was causing crash also in previous version. https://github.com/Guad/NativeUI/issues/13

 

Strange, It only started to cause a crash for me when I updated to 463.1

Link to comment
Share on other sites

 

 

When the new update for ScriptHookV comes out, opening any menu without disabling instructional buttons will cause your game to crash instantly. This is a bug with ScriptHookVdotnet that for some reason didnt crash the game on previous versions.

 

It was causing crash also in previous version. https://github.com/Guad/NativeUI/issues/13

 

Strange, It only started to cause a crash for me when I updated to 463.1

 

This should be fixed now.

Link to comment
Share on other sites

  • 1 month later...

Hey everyone, I've been using scripthookvdotnet menus so far, but I decided to use NativeUI from now on, but I can't get my menus to work: nothing appear on my screen...

Here is my code:

//Global variables:private UIMenu mainMenu;        private UIMenu activeMenu2;        private UIMenuCheckboxItem CalloutsCheckBox;        private UIMenuItem button;        private MenuPool _menuPool = new MenuPool();//Here is my keydown function:if (e.KeyCode == KeyMenu)            {                if (Mod_ON == true)                {                    if (TabMenu == false)                    {                        TabMenu = true;                        Menu = true;                        mainMenu.Visible = true;                        mainMenu.ProcessKey(KeyMenu);                        GeneralMenu();                    }                }                else                {                    UI.ShowSubtitle("You must launch the mod first. ", 5000);                }            }//Here is the tick where I display the menu: private void infotick(Object myObject, EventArgs myEventArgs)        {                if(Menu == true)                {                    _menuPool.ProcessMenus();                }                    }//And Here is my menu function:public  void GeneralMenu()        {                       var myMenu = new UIMenu("Choose an action", "Choose an action");                         myMenu.AddItem(CalloutsCheckBox = new UIMenuCheckboxItem("Callouts", calls == true ? true : false, "Enable / Disable calls"));                        CalloutsCheckBox.CheckboxEvent += (sender, args) => this.DisableCall(); myMenu.AddItem(button = new UIMenuItem("Backup menu", "Call for Backup"));                       button.Activated += (sender, args) => this.BackupMenu(); myMenu.RefreshIndex();            _menuPool.Add(myMenu);                    }

Thanks for the help !

Link to comment
Share on other sites

Hey everyone, I've been using scripthookvdotnet menus so far, but I decided to use NativeUI from now on, but I can't get my menus to work: nothing appear on my screen...

Here is my code:

 

//Global variables:private UIMenu mainMenu;        private UIMenu activeMenu2;        private UIMenuCheckboxItem CalloutsCheckBox;        private UIMenuItem button;        private MenuPool _menuPool = new MenuPool();//Here is my keydown function:if (e.KeyCode == KeyMenu)            {                if (Mod_ON == true)                {                    if (TabMenu == false)                    {                        TabMenu = true;                        Menu = true;                        mainMenu.Visible = true;                        mainMenu.ProcessKey(KeyMenu);                        GeneralMenu();                    }                }                else                {                    UI.ShowSubtitle("You must launch the mod first. ", 5000);                }            }//Here is the tick where I display the menu: private void infotick(Object myObject, EventArgs myEventArgs)        {                if(Menu == true)                {                    _menuPool.ProcessMenus();                }                    }//And Here is my menu function:public  void GeneralMenu()        {                       var myMenu = new UIMenu("Choose an action", "Choose an action");                         myMenu.AddItem(CalloutsCheckBox = new UIMenuCheckboxItem("Callouts", calls == true ? true : false, "Enable / Disable calls"));                        CalloutsCheckBox.CheckboxEvent += (sender, args) => this.DisableCall(); myMenu.AddItem(button = new UIMenuItem("Backup menu", "Call for Backup"));                       button.Activated += (sender, args) => this.BackupMenu(); myMenu.RefreshIndex();            _menuPool.Add(myMenu);                    }

 

Thanks for the help !

Try removing the if(Menu == true) before ProcessMenus()?

Link to comment
Share on other sites

Hi !

First, thx for your job !

 

I just tried to use menus in my script but it's always flashing (when it's open, 3 or 4 times per sec)

 

Did I miss something?

_menuPool = new MenuPool();var mainMenu = new UIMenu("Native UI", "~b~NATIVEUI SHOWCASE");_menuPool.Add(mainMenu);mainMenu.AddItem(new UIMenuItem("Simple Button"));mainMenu.RefreshIndex();Tick += (o, e) => _menuPool.ProcessMenus();KeyDown += (o, e) =>{    if (e.KeyCode == Keys.F5 && !_menuPool.IsAnyMenuOpen()) // Our menu on/off switch        mainMenu.Visible = !mainMenu.Visible;};
Link to comment
Share on other sites

 

Hi !

First, thx for your job !

 

I just tried to use menus in my script but it's always flashing (when it's open, 3 or 4 times per sec)

 

Did I miss something?

_menuPool = new MenuPool();var mainMenu = new UIMenu("Native UI", "~b~NATIVEUI SHOWCASE");_menuPool.Add(mainMenu);mainMenu.AddItem(new UIMenuItem("Simple Button"));mainMenu.RefreshIndex();Tick += (o, e) => _menuPool.ProcessMenus();KeyDown += (o, e) =>{    if (e.KeyCode == Keys.F5 && !_menuPool.IsAnyMenuOpen()) // Our menu on/off switch        mainMenu.Visible = !mainMenu.Visible;};

What FPS are you getting? Do other mod's menus work fine?

Link to comment
Share on other sites

What FPS are you getting? Do other mod's menus work fine?

Sorry for reply time,

Other mods worked perfectly, I tested several things and it just was the Script.Interval property...

Knowing it, I found this... : http://gtaforums.com/topic/805655-c-qtriggering-menu-when-in-distance/?p=1067697944

 

I just have to remove it from constructor.

 

Anyway, thank you for your help ;)

Link to comment
Share on other sites

  • 3 weeks later...

Hey, I've used many templates for the NativeUI menu's and none of them display at all. Is it because i'm making a mod with two classes? One for the actual events in game and the other for the NativeUI menu? I just don't understand why even the templates don't work for me, even if I do mix the two together as one class nothing happens; it completely makes it as though I didn't have a mod.

 

I made the most stupid mistake; I didn't add the NativeUI to my actual scripts folder in GTA. Now it works it just kills my frames. Sorry for this post!

Edited by jaky2008
Link to comment
Share on other sites

  • 3 weeks later...

I found a Bug playing with NativeUI.

If you play with NativeUI Franklins Mansion is very buggy. You cant use the Bong or the Whine Bar anymore. You cant even seen this Items anymore
There are no more real Windows ins his Bedroom also. The Clothes on his Bed and in his closet are away too.

Am I the only one with this Bug?

If i delete the NativeUI file, it works perfekt again?

 

Help anyone?

Link to comment
Share on other sites

  • 4 weeks later...

Hi! How to add text to the right of the UIMenuItem? I want to add money count to the right :)

UPD: Guad answered on Github. Use this:

item.SetRightLabel(string text);
Edited by nikita488
Link to comment
Share on other sites

  • 2 weeks later...

Is it possible to modify a UIMenuListItem in an UIMenu which has been loaded but not visible? I wish to update the list in background while another menu is visible.

Link to comment
Share on other sites

  • 3 weeks later...

Iam very new in creating mods for GTA V and i cant find the error..

 

If i hit F5 ingame it doesnt show the menu

using System;using System.Collections.Generic;//using System.Linq;using System.Text;using GTA;using GTA.Native;using System.Windows.Forms;using NativeUI;namespace GTAVMOD{    class My_Mod : Script    {        MenuPool _myMenuPool = new MenuPool();        UIMenu myMenu = new UIMenu("Test", "~b~TEST");        public My_Mod()        {            this.Tick += onTick;            this.KeyUp += onKeyUp;            this.KeyDown += onKeyDown;            myMenu.AddItem(new UIMenuItem("Simple Button"));            myMenu.RefreshIndex();            _myMenuPool.Add(myMenu);        }        private void onTick(object sender, EventArgs e)        {            _myMenuPool.ProcessMenus();        }        private void onKeyDown(object sender, KeyEventArgs e)        {        }        private void onKeyUp(object sender, KeyEventArgs e)        {            if (e.KeyCode == Keys.F5 && !_myMenuPool.IsAnyMenuOpen())            {                myMenu.Visible = !myMenu.Visible;            }        }    }}

Hope anyone can help me

Link to comment
Share on other sites

Iam very new in creating mods for GTA V and i cant find the error..

 

If i hit F5 ingame it doesnt show the menu

using System;using System.Collections.Generic;//using System.Linq;using System.Text;using GTA;using GTA.Native;using System.Windows.Forms;using NativeUI;namespace GTAVMOD{    class My_Mod : Script    {        MenuPool _myMenuPool = new MenuPool();        UIMenu myMenu = new UIMenu("Test", "~b~TEST");        public My_Mod()        {            this.Tick += onTick;            this.KeyUp += onKeyUp;            this.KeyDown += onKeyDown;            myMenu.AddItem(new UIMenuItem("Simple Button"));            myMenu.RefreshIndex();            _myMenuPool.Add(myMenu);        }        private void onTick(object sender, EventArgs e)        {            _myMenuPool.ProcessMenus();        }        private void onKeyDown(object sender, KeyEventArgs e)        {        }        private void onKeyUp(object sender, KeyEventArgs e)        {            if (e.KeyCode == Keys.F5 && !_myMenuPool.IsAnyMenuOpen())            {                myMenu.Visible = !myMenu.Visible;            }        }    }}

Hope anyone can help me

Post your ScriptHookVDotNet.log

Link to comment
Share on other sites

 

Iam very new in creating mods for GTA V and i cant find the error..

 

If i hit F5 ingame it doesnt show the menu

using System;using System.Collections.Generic;//using System.Linq;using System.Text;using GTA;using GTA.Native;using System.Windows.Forms;using NativeUI;namespace GTAVMOD{    class My_Mod : Script    {        MenuPool _myMenuPool = new MenuPool();        UIMenu myMenu = new UIMenu("Test", "~b~TEST");        public My_Mod()        {            this.Tick += onTick;            this.KeyUp += onKeyUp;            this.KeyDown += onKeyDown;            myMenu.AddItem(new UIMenuItem("Simple Button"));            myMenu.RefreshIndex();            _myMenuPool.Add(myMenu);        }        private void onTick(object sender, EventArgs e)        {            _myMenuPool.ProcessMenus();        }        private void onKeyDown(object sender, KeyEventArgs e)        {        }        private void onKeyUp(object sender, KeyEventArgs e)        {            if (e.KeyCode == Keys.F5 && !_myMenuPool.IsAnyMenuOpen())            {                myMenu.Visible = !myMenu.Visible;            }        }    }}

Hope anyone can help me

Post your ScriptHookVDotNet.log

 

Thats weird... There is no log file in my GTA dir

But i tested my first mod where i spawned a car and this works, but with the NativeUI nothing works

Edited by AndrewEiland
Link to comment
Share on other sites

 

 

Iam very new in creating mods for GTA V and i cant find the error..

 

If i hit F5 ingame it doesnt show the menu

using System;using System.Collections.Generic;//using System.Linq;using System.Text;using GTA;using GTA.Native;using System.Windows.Forms;using NativeUI;namespace GTAVMOD{    class My_Mod : Script    {        MenuPool _myMenuPool = new MenuPool();        UIMenu myMenu = new UIMenu("Test", "~b~TEST");        public My_Mod()        {            this.Tick += onTick;            this.KeyUp += onKeyUp;            this.KeyDown += onKeyDown;            myMenu.AddItem(new UIMenuItem("Simple Button"));            myMenu.RefreshIndex();            _myMenuPool.Add(myMenu);        }        private void onTick(object sender, EventArgs e)        {            _myMenuPool.ProcessMenus();        }        private void onKeyDown(object sender, KeyEventArgs e)        {        }        private void onKeyUp(object sender, KeyEventArgs e)        {            if (e.KeyCode == Keys.F5 && !_myMenuPool.IsAnyMenuOpen())            {                myMenu.Visible = !myMenu.Visible;            }        }    }}

Hope anyone can help me

Post your ScriptHookVDotNet.log

 

Thats weird... There is no log file in my GTA dir

But i tested my first mod where i spawned a car and this works, but with the NativeUI nothing works

 

 

Your first mod should have generated a ScriptHookVDotNet.log file.

Link to comment
Share on other sites

Hey Guad awesome work.

 

I just downloaded and was trying out the menu and options. But when i open the menu my fps drops to 30 for like 1 second and if i hit F8 over and over the menu just keeps opening more menus.Also when i go into my submenu fps drops again and sometimes when i go past the 10th item in a submenu fps drops again or if i jump to the last item in the sub menu. Is there anyway to fix this?

 

My code.

 

public class Main : Script    {        private MenuPool _menuPool;        private UIMenu mainMenu;        private UIMenu SubMenuSM;        private bool Godmode = false;        public Main()        {            KeyUp += OnKeyUp;            Tick += OnTick;            _menuPool = new MenuPool();        }        private void OnKeyUp(object sender, KeyEventArgs e)        {            if (e.KeyCode == Keys.F8) // Change keys here.            {                this.StartUpMenu();            }        }        private void OnTick(object sender, EventArgs e)        {            _menuPool.ProcessMenus();        }        private UIMenu StartUpMenu()        {            mainMenu = new UIMenu("TEST", "~b~Main Menu");            _menuPool.Add(mainMenu);            //SubMenu            UIMenuItem MenuuiMenuItem = new UIMenuItem("Menu 1");            mainMenu.AddItem(MenuuiMenuItem);            mainMenu.BindMenuToItem(SubMenu(), MenuuiMenuItem);            mainMenu.Visible = !mainMenu.Visible;            return mainMenu;        }        private UIMenu SubMenu()        {            SubMenuSM = new UIMenu("Sub Menu", "~b~TEST: Sub Menu");            _menuPool.Add(SubMenuSM);            //CheckBox            var godmode = new UIMenuCheckboxItem("Godmode", Godmode, "Toggle Godmode On/Off.");            SubMenuSM.AddItem(godmode);            SubMenuSM.OnCheckboxChange += (sender, item, checked_) =>            {                if (item == godmode)                {                    switch (checked_)                    {                        case true:                            Godmode = true;                            Game.Player.Character.IsInvincible = true;                            break;                        case false:                            Godmode = false;                            Game.Player.Character.IsInvincible = false;                            break;                    }                    Godmode = checked_;                    UI.Notify("~r~Godmode status: ~b~" + Godmode);                }            };            //Button            var FixPlayer = new UIMenuItem("Fix Player", "Fix's Player.");            SubMenuSM.AddItem(FixPlayer);            SubMenuSM.OnItemSelect += (sender, item, index) =>            {                if (item == FixPlayer)                {                    UI.Notify("~g~Player Fixed!");                }            };            //List View            var WantedLevels = new List<dynamic> { 0, 1, 2, 3, 4, 5, };            var wantedLevel = new UIMenuListItem("Wanted Level", WantedLevels, 0);            SubMenuSM.AddItem(wantedLevel);            SubMenuSM.OnListChange += (sender, item, index) =>            {                if (item == wantedLevel)                {                    switch (index)                    {                        case 1:                            Game.Player.WantedLevel = 1;                            break;                        case 2:                            Game.Player.WantedLevel = 2;                            break;                        case 3:                            Game.Player.WantedLevel = 3;                            break;                        case 4:                            Game.Player.WantedLevel = 4;                            break;                        case 5:                            Game.Player.WantedLevel = 5;                            break;                        default:                            Game.Player.WantedLevel = 0;                            break;                    }                }            };            //Filler             var lulz = new UIMenuItem("lulz", "lulz Player.");            for (int i = 0; i < 10; i++)                SubMenuSM.AddItem(new UIMenuItem("PageFiller", "Sample description that takes more than one line. Moreso, it takes way more than two lines since it's so long. Wow, check out this length!"));            SubMenuSM.RefreshIndex();            return SubMenuSM;        }

 

Link to comment
Share on other sites

@Guad i know but it doesnt create any log file

Make sure you have ScriptHookV.dll,dinput8.dll,ScriptHookVDotNet.dll,ScriptHookVDotNet.asi all installed in your gta v directory and that you have put NativeUI.dll and yourmodname.dll in your scripts folder in you gta v directory.

Link to comment
Share on other sites

Hey Guad awesome work.

 

I just downloaded and was trying out the menu and options. But when i open the menu my fps drops to 30 for like 1 second and if i hit F8 over and over the menu just keeps opening more menus.Also when i go into my submenu fps drops again and sometimes when i go past the 10th item in a submenu fps drops again or if i jump to the last item in the sub menu. Is there anyway to fix this?

 

My code.

 

public class Main : Script    {        private MenuPool _menuPool;        private UIMenu mainMenu;        private UIMenu SubMenuSM;        private bool Godmode = false;        public Main()        {            KeyUp += OnKeyUp;            Tick += OnTick;            _menuPool = new MenuPool();        }        private void OnKeyUp(object sender, KeyEventArgs e)        {            if (e.KeyCode == Keys.F8) // Change keys here.            {                this.StartUpMenu();            }        }        private void OnTick(object sender, EventArgs e)        {            _menuPool.ProcessMenus();        }        private UIMenu StartUpMenu()        {            mainMenu = new UIMenu("TEST", "~b~Main Menu");            _menuPool.Add(mainMenu);            //SubMenu            UIMenuItem MenuuiMenuItem = new UIMenuItem("Menu 1");            mainMenu.AddItem(MenuuiMenuItem);            mainMenu.BindMenuToItem(SubMenu(), MenuuiMenuItem);            mainMenu.Visible = !mainMenu.Visible;            return mainMenu;        }        private UIMenu SubMenu()        {            SubMenuSM = new UIMenu("Sub Menu", "~b~TEST: Sub Menu");            _menuPool.Add(SubMenuSM);            //CheckBox            var godmode = new UIMenuCheckboxItem("Godmode", Godmode, "Toggle Godmode On/Off.");            SubMenuSM.AddItem(godmode);            SubMenuSM.OnCheckboxChange += (sender, item, checked_) =>            {                if (item == godmode)                {                    switch (checked_)                    {                        case true:                            Godmode = true;                            Game.Player.Character.IsInvincible = true;                            break;                        case false:                            Godmode = false;                            Game.Player.Character.IsInvincible = false;                            break;                    }                    Godmode = checked_;                    UI.Notify("~r~Godmode status: ~b~" + Godmode);                }            };            //Button            var FixPlayer = new UIMenuItem("Fix Player", "Fix's Player.");            SubMenuSM.AddItem(FixPlayer);            SubMenuSM.OnItemSelect += (sender, item, index) =>            {                if (item == FixPlayer)                {                    UI.Notify("~g~Player Fixed!");                }            };            //List View            var WantedLevels = new List<dynamic> { 0, 1, 2, 3, 4, 5, };            var wantedLevel = new UIMenuListItem("Wanted Level", WantedLevels, 0);            SubMenuSM.AddItem(wantedLevel);            SubMenuSM.OnListChange += (sender, item, index) =>            {                if (item == wantedLevel)                {                    switch (index)                    {                        case 1:                            Game.Player.WantedLevel = 1;                            break;                        case 2:                            Game.Player.WantedLevel = 2;                            break;                        case 3:                            Game.Player.WantedLevel = 3;                            break;                        case 4:                            Game.Player.WantedLevel = 4;                            break;                        case 5:                            Game.Player.WantedLevel = 5;                            break;                        default:                            Game.Player.WantedLevel = 0;                            break;                    }                }            };            //Filler             var lulz = new UIMenuItem("lulz", "lulz Player.");            for (int i = 0; i < 10; i++)                SubMenuSM.AddItem(new UIMenuItem("PageFiller", "Sample description that takes more than one line. Moreso, it takes way more than two lines since it's so long. Wow, check out this length!"));            SubMenuSM.RefreshIndex();            return SubMenuSM;        }

 

 

You are creating a new menu every time you press F8, don't do that. Create the menu on start and flip the Visible property on your existing menu when you press F8.

Link to comment
Share on other sites

Hello, I encountered an issue: when my Game run in Windowed mode, the custom sprite's offset gets out of place. I use SetBannerType method, and I didn't set the offset manually. Works fine in Fullscreen mode however.

Link to comment
Share on other sites

 

Hey Guad awesome work.

 

I just downloaded and was trying out the menu and options. But when i open the menu my fps drops to 30 for like 1 second and if i hit F8 over and over the menu just keeps opening more menus.Also when i go into my submenu fps drops again and sometimes when i go past the 10th item in a submenu fps drops again or if i jump to the last item in the sub menu. Is there anyway to fix this?

 

My code.

 

 

public class Main : Script    {        private MenuPool _menuPool;        private UIMenu mainMenu;        private UIMenu SubMenuSM;        private bool Godmode = false;        public Main()        {            KeyUp += OnKeyUp;            Tick += OnTick;            _menuPool = new MenuPool();        }        private void OnKeyUp(object sender, KeyEventArgs e)        {            if (e.KeyCode == Keys.F8) // Change keys here.            {                this.StartUpMenu();            }        }        private void OnTick(object sender, EventArgs e)        {            _menuPool.ProcessMenus();        }        private UIMenu StartUpMenu()        {            mainMenu = new UIMenu("TEST", "~b~Main Menu");            _menuPool.Add(mainMenu);            //SubMenu            UIMenuItem MenuuiMenuItem = new UIMenuItem("Menu 1");            mainMenu.AddItem(MenuuiMenuItem);            mainMenu.BindMenuToItem(SubMenu(), MenuuiMenuItem);            mainMenu.Visible = !mainMenu.Visible;            return mainMenu;        }        private UIMenu SubMenu()        {            SubMenuSM = new UIMenu("Sub Menu", "~b~TEST: Sub Menu");            _menuPool.Add(SubMenuSM);            //CheckBox            var godmode = new UIMenuCheckboxItem("Godmode", Godmode, "Toggle Godmode On/Off.");            SubMenuSM.AddItem(godmode);            SubMenuSM.OnCheckboxChange += (sender, item, checked_) =>            {                if (item == godmode)                {                    switch (checked_)                    {                        case true:                            Godmode = true;                            Game.Player.Character.IsInvincible = true;                            break;                        case false:                            Godmode = false;                            Game.Player.Character.IsInvincible = false;                            break;                    }                    Godmode = checked_;                    UI.Notify("~r~Godmode status: ~b~" + Godmode);                }            };            //Button            var FixPlayer = new UIMenuItem("Fix Player", "Fix's Player.");            SubMenuSM.AddItem(FixPlayer);            SubMenuSM.OnItemSelect += (sender, item, index) =>            {                if (item == FixPlayer)                {                    UI.Notify("~g~Player Fixed!");                }            };            //List View            var WantedLevels = new List<dynamic> { 0, 1, 2, 3, 4, 5, };            var wantedLevel = new UIMenuListItem("Wanted Level", WantedLevels, 0);            SubMenuSM.AddItem(wantedLevel);            SubMenuSM.OnListChange += (sender, item, index) =>            {                if (item == wantedLevel)                {                    switch (index)                    {                        case 1:                            Game.Player.WantedLevel = 1;                            break;                        case 2:                            Game.Player.WantedLevel = 2;                            break;                        case 3:                            Game.Player.WantedLevel = 3;                            break;                        case 4:                            Game.Player.WantedLevel = 4;                            break;                        case 5:                            Game.Player.WantedLevel = 5;                            break;                        default:                            Game.Player.WantedLevel = 0;                            break;                    }                }            };            //Filler             var lulz = new UIMenuItem("lulz", "lulz Player.");            for (int i = 0; i < 10; i++)                SubMenuSM.AddItem(new UIMenuItem("PageFiller", "Sample description that takes more than one line. Moreso, it takes way more than two lines since it's so long. Wow, check out this length!"));            SubMenuSM.RefreshIndex();            return SubMenuSM;        }

 

 

 

You are creating a new menu every time you press F8, don't do that. Create the menu on start and flip the Visible property on your existing menu when you press F8.

 

Got it! Thanks for the help. Is your a way i can PM you?

Link to comment
Share on other sites

 

 

Hey Guad awesome work.

 

I just downloaded and was trying out the menu and options. But when i open the menu my fps drops to 30 for like 1 second and if i hit F8 over and over the menu just keeps opening more menus.Also when i go into my submenu fps drops again and sometimes when i go past the 10th item in a submenu fps drops again or if i jump to the last item in the sub menu. Is there anyway to fix this?

 

My code.

 

 

public class Main : Script    {        private MenuPool _menuPool;        private UIMenu mainMenu;        private UIMenu SubMenuSM;        private bool Godmode = false;        public Main()        {            KeyUp += OnKeyUp;            Tick += OnTick;            _menuPool = new MenuPool();        }        private void OnKeyUp(object sender, KeyEventArgs e)        {            if (e.KeyCode == Keys.F8) // Change keys here.            {                this.StartUpMenu();            }        }        private void OnTick(object sender, EventArgs e)        {            _menuPool.ProcessMenus();        }        private UIMenu StartUpMenu()        {            mainMenu = new UIMenu("TEST", "~b~Main Menu");            _menuPool.Add(mainMenu);            //SubMenu            UIMenuItem MenuuiMenuItem = new UIMenuItem("Menu 1");            mainMenu.AddItem(MenuuiMenuItem);            mainMenu.BindMenuToItem(SubMenu(), MenuuiMenuItem);            mainMenu.Visible = !mainMenu.Visible;            return mainMenu;        }        private UIMenu SubMenu()        {            SubMenuSM = new UIMenu("Sub Menu", "~b~TEST: Sub Menu");            _menuPool.Add(SubMenuSM);            //CheckBox            var godmode = new UIMenuCheckboxItem("Godmode", Godmode, "Toggle Godmode On/Off.");            SubMenuSM.AddItem(godmode);            SubMenuSM.OnCheckboxChange += (sender, item, checked_) =>            {                if (item == godmode)                {                    switch (checked_)                    {                        case true:                            Godmode = true;                            Game.Player.Character.IsInvincible = true;                            break;                        case false:                            Godmode = false;                            Game.Player.Character.IsInvincible = false;                            break;                    }                    Godmode = checked_;                    UI.Notify("~r~Godmode status: ~b~" + Godmode);                }            };            //Button            var FixPlayer = new UIMenuItem("Fix Player", "Fix's Player.");            SubMenuSM.AddItem(FixPlayer);            SubMenuSM.OnItemSelect += (sender, item, index) =>            {                if (item == FixPlayer)                {                    UI.Notify("~g~Player Fixed!");                }            };            //List View            var WantedLevels = new List<dynamic> { 0, 1, 2, 3, 4, 5, };            var wantedLevel = new UIMenuListItem("Wanted Level", WantedLevels, 0);            SubMenuSM.AddItem(wantedLevel);            SubMenuSM.OnListChange += (sender, item, index) =>            {                if (item == wantedLevel)                {                    switch (index)                    {                        case 1:                            Game.Player.WantedLevel = 1;                            break;                        case 2:                            Game.Player.WantedLevel = 2;                            break;                        case 3:                            Game.Player.WantedLevel = 3;                            break;                        case 4:                            Game.Player.WantedLevel = 4;                            break;                        case 5:                            Game.Player.WantedLevel = 5;                            break;                        default:                            Game.Player.WantedLevel = 0;                            break;                    }                }            };            //Filler             var lulz = new UIMenuItem("lulz", "lulz Player.");            for (int i = 0; i < 10; i++)                SubMenuSM.AddItem(new UIMenuItem("PageFiller", "Sample description that takes more than one line. Moreso, it takes way more than two lines since it's so long. Wow, check out this length!"));            SubMenuSM.RefreshIndex();            return SubMenuSM;        }

 

 

 

You are creating a new menu every time you press F8, don't do that. Create the menu on start and flip the Visible property on your existing menu when you press F8.

 

Got it! Thanks for the help. Is your a way i can PM you?

 

 

Yeah, go to my profile and press Send me a message.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 19 Users Currently Viewing
    0 members, 0 Anonymous, 19 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.