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

 

 

 

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.

 

hi man, how to create pause menu? can you please give example on how to use new tabview?

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.

 

hi man, how to create pause menu? can you please give example on how to use new tabview?

 

 

Create your tabview. Then start adding your tabs with myTabView.Tabs.Add(). Then call .Update() on tick to draw the menu. e.g.

 

var tabView = new TabView("Grand Theft Auto V");tabView.Tabs.Add(new TabTextItem("Test", "test")); // OnTicktabView.Update();
Link to comment
Share on other sites

So signed up just to report a "glitch". When ever I die or get busted the "wasted or busted" overlay persists and wont go away when i respawn. Luckily I had 1.5 i think saved and it works normally. Just a heads up. Anyways great work Guad.

Link to comment
Share on other sites

So signed up just to report a "glitch". When ever I die or get busted the "wasted or busted" overlay persists and wont go away when i respawn. Luckily I had 1.5 i think saved and it works normally. Just a heads up. Anyways great work Guad.

Fixed, thanks for the report.

Link to comment
Share on other sites

Wonderful Update !! I have few questions.

1.I haven't switch to 1.6/1.6.1 and I wish to know how to make big messages with NativeUI?

2.Do big messages here have the sound effects ? I can't find the sound to play.

3.Do you plan to add Mission Passed Screen ? The class you provided in NOoSE source is very cool and helpful.

 

Edit: by asking how to, I meant I read the wiki but I don't know how to execute it?

Edited by GeorgeZhang
Link to comment
Share on other sites

Wonderful Update !! I have few questions.

1.I haven't switch to 1.6/1.6.1 and I wish to know how to make big messages with NativeUI?

2.Do big messages here have the sound effects ? I can't find the sound to play.

3.Do you plan to add Mission Passed Screen ? The class you provided in NOoSE source is very cool and helpful.

 

Edit: by asking how to, I meant I read the wiki but I don't know how to execute it?

 

You call it like any other method: BigMessageThread.MessageInstance.ShowMissionPassedMessage("Hello!");

No it doesn't have any sound effects.

Dunno, it's pretty ugly though.

Link to comment
Share on other sites

 

Wonderful Update !! I have few questions.

1.I haven't switch to 1.6/1.6.1 and I wish to know how to make big messages with NativeUI?

2.Do big messages here have the sound effects ? I can't find the sound to play.

3.Do you plan to add Mission Passed Screen ? The class you provided in NOoSE source is very cool and helpful.

 

Edit: by asking how to, I meant I read the wiki but I don't know how to execute it?

 

You call it like any other method: BigMessageThread.MessageInstance.ShowMissionPassedMessage("Hello!");

No it doesn't have any sound effects.

Dunno, it's pretty ugly though.

 

Ok thanks. I've another problem here:

One of player encountered this "Fatal: directx texture 'C:\Users\Администратор\AppData\Local\Temp\tmp4E4B.tmp' creation failed"

However, none others have the problem. I have embedded my custom sprite, and the path is

Sprite.WriteFileFromResources(Assembly.GetExecutingAssembly(), "Gang_War_Standalone.gangwarsprite_template.png")

I call it only once at startup. The player having this issue has re-installed .net framework and redis- pack and run his game as administrator.

I don't know how to help him because 1.no idea what caused it 2.it works fine for me and other players. Can you help?

Link to comment
Share on other sites

Hello, I think that NativeUI is causing a strange issue, sometimes when I am entering Snapmatic the controls at the bottom disappear(it will look like this: http://i.imgur.com/AeOb8Fi.jpg )

And is not happening straight away when I load the game but after some time, and when I remove NativeUI from the scripts folder, Snapmatic is fine. I don't have any other scripts or mods installed, just ScriptHookV and ScriptHookV .Net

Link to comment
Share on other sites

 

 

Wonderful Update !! I have few questions.

1.I haven't switch to 1.6/1.6.1 and I wish to know how to make big messages with NativeUI?

2.Do big messages here have the sound effects ? I can't find the sound to play.

3.Do you plan to add Mission Passed Screen ? The class you provided in NOoSE source is very cool and helpful.

 

Edit: by asking how to, I meant I read the wiki but I don't know how to execute it?

 

You call it like any other method: BigMessageThread.MessageInstance.ShowMissionPassedMessage("Hello!");

No it doesn't have any sound effects.

Dunno, it's pretty ugly though.

 

Ok thanks. I've another problem here:

One of player encountered this "Fatal: directx texture 'C:\Users\Администратор\AppData\Local\Temp\tmp4E4B.tmp' creation failed"

However, none others have the problem. I have embedded my custom sprite, and the path is

Sprite.WriteFileFromResources(Assembly.GetExecutingAssembly(), "Gang_War_Standalone.gangwarsprite_template.png")

I call it only once at startup. The player having this issue has re-installed .net framework and redis- pack and run his game as administrator.

I don't know how to help him because 1.no idea what caused it 2.it works fine for me and other players. Can you help?

 

 

This is caused by ScriptHookV not being able to read the file. By looking at the path my best guess is that ScriptHookV doesn't support unicode characters in the filepath, so tell him to either log in as a different user, or extract the files to GTA5 directory.

Link to comment
Share on other sites

Hello, I think that NativeUI is causing a strange issue, sometimes when I am entering Snapmatic the controls at the bottom disappear(it will look like this: http://i.imgur.com/AeOb8Fi.jpg )

And is not happening straight away when I load the game but after some time, and when I remove NativeUI from the scripts folder, Snapmatic is fine. I don't have any other scripts or mods installed, just ScriptHookV and ScriptHookV .Net

 

Thanks, I'll look into it.

Link to comment
Share on other sites

  • 4 weeks later...
qiangqiang101

how to make big message text red? I want it for mission failed.

 

"~r~RED TEXT"

"~y~YELLOW TEXT"

"~w~WHITE TEXT"

"~b~BLUE TEXT"

"~g~GREEN TEXT"

"~r~RED ~w~AND ~b~BLUE"

Link to comment
Share on other sites

  • 2 months later...
unknown modder

May seem like an odd request, but could you support for a listmenuitem which also has a checkbox. I dont like having an off option in a list of settings

Link to comment
Share on other sites

May seem like an odd request, but could you support for a listmenuitem which also has a checkbox. I dont like having an off option in a list of settings

How would that look? Like < Some text [X] > or just < [X] >? Should all items have checkboxes?

Link to comment
Share on other sites

unknown modder

 

May seem like an odd request, but could you support for a listmenuitem which also has a checkbox. I dont like having an off option in a list of settings

How would that look? Like < Some text [X] > or just < [X] >? Should all items have checkboxes?

 

I was thinking like {Item Text <List> [X] }. I just think that would be nicer than having Off or None in a list. Only 1 checkbox though, checkboxes in the list would be pretty confusing.

Im able to create a new class that looks correct, but as controls are handled in UIMenu I cannot edit the items

1fd4291353.jpg

Edited by unknown modder
Link to comment
Share on other sites

 

 

May seem like an odd request, but could you support for a listmenuitem which also has a checkbox. I dont like having an off option in a list of settings

How would that look? Like < Some text [X] > or just < [X] >? Should all items have checkboxes?

 

I was thinking like {Item Text <List> [X] }. I just think that would be nicer than having Off or None in a list. Only 1 checkbox though, checkboxes in the list would be pretty confusing.

Im able to create a new class that looks correct, but as controls are handled in UIMenu I cannot edit the items

 

 

1fd4291353.jpg

 

 

 

I see, that looks very specific. I'll include a way to completely customize items and menus by overriding controls.

Link to comment
Share on other sites

unknown modder

I see, that looks very specific. I'll include a way to completely customize items and menus by overriding controls.

Yeah, that would be a nicer idea, letting menu items handle control inputs instead of the menu class

Link to comment
Share on other sites

Great work on this mod! Makes for some amazing looking menus that really fit the game.

Edited by Willco2
Link to comment
Share on other sites

  • 2 weeks later...

I'm sorry if this is sort of irrelevant (I'm a beginner with C languages) but I made a small little menu, and it's in .cs... But how do I make it a .dll file? :/

Link to comment
Share on other sites

I'm sorry if this is sort of irrelevant (I'm a beginner with C languages) but I made a small little menu, and it's in .cs... But how do I make it a .dll file? :/

 

You need to compile it. Use Visual Studio, or the command line.

Link to comment
Share on other sites

 

I'm sorry if this is sort of irrelevant (I'm a beginner with C languages) but I made a small little menu, and it's in .cs... But how do I make it a .dll file? :/

 

You need to compile it. Use Visual Studio, or the command line.

 

Ok so I made a C# Class Library, copied and pasted the .cs code and built the .dll, but pressing the hotkey ingame does nothing. I also added both NativeUI and ScriptHookVDotNet into the .cs and put the .dll in the scripts folder. Help?

Edited by Jezperr
Link to comment
Share on other sites

@Guad: Would it be possible to update the UI to have the wardrobe/clothing store/barber/tattoo parlor interface? The UI is the same, but the sounds when you move the courser, select, and go back are all different.

Link to comment
Share on other sites

unknown modder

 

Post your ScriptHookVDotNet-[date].log

http://pastebin.com/sEZjMzg7<- there it is for you, that's the last tiem I tried starting GTAV with the menu in \scripts

 

it looks like your dll file wasnt placed inside the scripts folder, thats why nothing is happening

Link to comment
Share on other sites

 

 

Post your ScriptHookVDotNet-[date].log

http://pastebin.com/sEZjMzg7<- there it is for you, that's the last tiem I tried starting GTAV with the menu in \scripts

 

it looks like your dll file wasnt placed inside the scripts folder, thats why nothing is happening

 

Except... I know I did it. I separately put every single "MenuExample".dll I could find in the scripts folder.... none worked

Link to comment
Share on other sites

unknown modder

 

 

 

Post your ScriptHookVDotNet-[date].log

http://pastebin.com/sEZjMzg7<- there it is for you, that's the last tiem I tried starting GTAV with the menu in \scripts

 

it looks like your dll file wasnt placed inside the scripts folder, thats why nothing is happening

 

Except... I know I did it. I separately put every single "MenuExample".dll I could find in the scripts folder.... none worked

 

Then the issue is your MenuExample, can you post the code(preferbly on a site like pastebin) to see why it thinks there are no scripts inside

Link to comment
Share on other sites

@Guad: Would it be possible to update the UI to have the wardrobe/clothing store/barber/tattoo parlor interface? The UI is the same, but the sounds when you move the courser, select, and go back are all different.

 

You can change the audio files as you want with myMenu.AUDIO_LIBRARY = "whatever". The default values are

 

public string AUDIO_LIBRARY = "HUD_FRONTEND_DEFAULT_SOUNDSET";public string AUDIO_UPDOWN = "NAV_UP_DOWN";public string AUDIO_LEFTRIGHT = "NAV_LEFT_RIGHT";public string AUDIO_SELECT = "SELECT";public string AUDIO_BACK = "BACK";public string AUDIO_ERROR = "ERROR";
Link to comment
Share on other sites

 

 

 

 

Post your ScriptHookVDotNet-[date].log

http://pastebin.com/sEZjMzg7<- there it is for you, that's the last tiem I tried starting GTAV with the menu in \scripts

 

it looks like your dll file wasnt placed inside the scripts folder, thats why nothing is happening

 

Except... I know I did it. I separately put every single "MenuExample".dll I could find in the scripts folder.... none worked

 

Then the issue is your MenuExample, can you post the code(preferbly on a site like pastebin) to see why it thinks there are no scripts inside

 

I made the menu from the example script that was on Guad's github (just to test what it would be like) and since there it said menuexample.cs I made it cs, you can find the code for it on the github

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

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

×
×
  • Create New...

Important Information

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