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

    2. News

    1. Red Dead Redemption 2

      1. News
      2. Red Dead Online
      3. The Armadillo Inn
    1. GTA Online

      1. After Hours
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

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

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

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

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

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

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

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. 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. Forum Support

    2. Site Suggestions

Guad

[.NET] NativeUI

Recommended Posts

ayylmao420

 

 

 

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?

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.

 

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

Share this post


Link to post
Share on other sites
Krashadam

1.5 would be good...

Share this post


Link to post
Share on other sites
torguin

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.

Share this post


Link to post
Share on other sites
Guad

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.

Share this post


Link to post
Share on other sites
GeorgeZhang

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

Share this post


Link to post
Share on other sites
Guad

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.

Share this post


Link to post
Share on other sites
GeorgeZhang

 

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?

Share this post


Link to post
Share on other sites
Bkp666

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

Share this post


Link to post
Share on other sites
Guad

 

 

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.

Share this post


Link to post
Share on other sites
Guad

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.

Share this post


Link to post
Share on other sites
Rugz007

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

Share this post


Link to post
Share on other sites
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"

Share this post


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

Share this post


Link to post
Share on other sites
Guad

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?

Share this post


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

Share this post


Link to post
Share on other sites
Guad

 

 

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.

Share this post


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

Share this post


Link to post
Share on other sites
Willco2

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

Edited by Willco2

Share this post


Link to post
Share on other sites
Jezperr

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? :/

Share this post


Link to post
Share on other sites
Guad

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.

Share this post


Link to post
Share on other sites
Jezperr

 

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

Share this post


Link to post
Share on other sites
Guad

Post your ScriptHookVDotNet-[date].log

Share this post


Link to post
Share on other sites
Jezperr

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

Share this post


Link to post
Share on other sites
nkjellman

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

Share this post


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

Share this post


Link to post
Share on other sites
Jezperr

 

 

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

Share this post


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

Share this post


Link to post
Share on other sites
Guad

@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";

Share this post


Link to post
Share on other sites
Jezperr

 

 

 

 

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

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

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

×

Important Information

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