Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Guad

[.NET] NativeUI

Recommended Posts

Guad

Hello, How do i change the menu background, and the highlighter when your on the option.

Thank You :)

You can't

Share this post


Link to post
Share on other sites
dreddfoxx

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.

Share this post


Link to post
Share on other sites
Guad

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

Share this post


Link to post
Share on other sites
dreddfoxx

 

 

 

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);

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
nexus99

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Guad

 

 

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.

Share this post


Link to post
Share on other sites
nordi

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 !

Share this post


Link to post
Share on other sites
Guad

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()?

Share this post


Link to post
Share on other sites
xdidx

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;};

Share this post


Link to post
Share on other sites
Guad

 

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?

Share this post


Link to post
Share on other sites
ZZCOOL

now time to wait for all these mods to be updated for the new patch

Share this post


Link to post
Share on other sites
xdidx

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 ;)

Share this post


Link to post
Share on other sites
jaky2008

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

Share this post


Link to post
Share on other sites
TheCoon

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?

Share this post


Link to post
Share on other sites
nikita488

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

Share this post


Link to post
Share on other sites
GeorgeZhang

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.

Share this post


Link to post
Share on other sites
AndrewEiland

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

Share this post


Link to post
Share on other sites
Guad

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

Share this post


Link to post
Share on other sites
AndrewEiland

 

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

Share this post


Link to post
Share on other sites
Guad

 

 

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.

Share this post


Link to post
Share on other sites
AndrewEiland

@Guad i know but it doesnt create any log file

Share this post


Link to post
Share on other sites
ScoPeZs

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;        }

 

Share this post


Link to post
Share on other sites
ScoPeZs

@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.

Share this post


Link to post
Share on other sites
Guad

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.

Share this post


Link to post
Share on other sites
GeorgeZhang

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.

Share this post


Link to post
Share on other sites
Guad

Version 1.6 has been released! New features include timer bars, pause menu & an easy way to show those multiplayer big messages. Check out the wiki on how to do it: https://github.com/Guad/NativeUI/wiki

Share this post


Link to post
Share on other sites
ScoPeZs

 

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?

Share this post


Link to post
Share on other sites
Guad

 

 

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.

Share this post


Link to post
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

  • 6 Users Currently Viewing
    0 Members, 0 Anonymous, 6 Guests

×

Important Information

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