Jump to content

Recommended Posts

Any way to disable backspace/right click making the menu close, Guad?

 

Sure

 

mymenu.ResetKey(NativeUI.UIMenu.MenuControls.Back);

Then you can either choose a different control or key with mymenu.SetKey(), or you can handle that yourself and call mymenu.GoBack().

 

 

 

 

Hello I have a question, i thought you might know how to use UI.DrawTexture? What is the param "filename"? Where can I find textures to draw, like radar blips or weapon icons?

You can use NativeUI.Sprite.DrawTexture(string filename, Point position, Size size)

filename parameter is the path to your custom texture, you can place your picture in the scripts folder and pass "scripts\\mypic.png" as the filename.

You can also use pictures embedded in your project. For that drag your picture to your project in the project solution, and select it's property as "Embedded Resource". then call once string myPicturePath = NativeUI.Sprite.WriteFileFromResources(Assembly.GetExecutingAssembly(), "myNamespace.mypic.png"); and then use it in DrawTexture. Note that you have to include your default namespace in WriteFileFromResources. You can view it in Properties.

 

As for what textures, that's up to you.

 

The first one worked. but the second one crashed the game...I guess it's my problem. What about ingame textures?

 

 

Use the Sprite object, more info here: https://github.com/Guad/NativeUI/wiki/UI-Drawing

Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067856042
Share on other sites

 

Any way to disable backspace/right click making the menu close, Guad?

Sure

mymenu.ResetKey(NativeUI.UIMenu.MenuControls.Back);
Then you can either choose a different control or key with mymenu.SetKey(), or you can handle that yourself and call mymenu.GoBack().

 

 

 

 

Hello I have a question, i thought you might know how to use UI.DrawTexture? What is the param "filename"? Where can I find textures to draw, like radar blips or weapon icons?

You can use NativeUI.Sprite.DrawTexture(string filename, Point position, Size size)

filename parameter is the path to your custom texture, you can place your picture in the scripts folder and pass "scripts\\mypic.png" as the filename.

You can also use pictures embedded in your project. For that drag your picture to your project in the project solution, and select it's property as "Embedded Resource". then call once string myPicturePath = NativeUI.Sprite.WriteFileFromResources(Assembly.GetExecutingAssembly(), "myNamespace.mypic.png"); and then use it in DrawTexture. Note that you have to include your default namespace in WriteFileFromResources. You can view it in Properties.

 

As for what textures, that's up to you.

 

The first one worked. but the second one crashed the game...I guess it's my problem. What about ingame textures?

 

Use the Sprite object, more info here: https://github.com/Guad/NativeUI/wiki/UI-Drawing

Thanks for the info, but I meant to ask where are these texture dict/name like the one (commonmenu/bgd_gradient)in the post?

 

EDIT: also for the reset key, I reset it to numpad keys, it worked but it doesn't stop mouse buttons from being active, did I miss something?

Edited by GeorgeZhang
Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067872904
Share on other sites

 

 

Any way to disable backspace/right click making the menu close, Guad?

Sure

mymenu.ResetKey(NativeUI.UIMenu.MenuControls.Back);
Then you can either choose a different control or key with mymenu.SetKey(), or you can handle that yourself and call mymenu.GoBack().

 

 

 

 

Hello I have a question, i thought you might know how to use UI.DrawTexture? What is the param "filename"? Where can I find textures to draw, like radar blips or weapon icons?

You can use NativeUI.Sprite.DrawTexture(string filename, Point position, Size size)

filename parameter is the path to your custom texture, you can place your picture in the scripts folder and pass "scripts\\mypic.png" as the filename.

You can also use pictures embedded in your project. For that drag your picture to your project in the project solution, and select it's property as "Embedded Resource". then call once string myPicturePath = NativeUI.Sprite.WriteFileFromResources(Assembly.GetExecutingAssembly(), "myNamespace.mypic.png"); and then use it in DrawTexture. Note that you have to include your default namespace in WriteFileFromResources. You can view it in Properties.

 

As for what textures, that's up to you.

 

The first one worked. but the second one crashed the game...I guess it's my problem. What about ingame textures?

 

Use the Sprite object, more info here: https://github.com/Guad/NativeUI/wiki/UI-Drawing

Thanks for the info, but I meant to ask where are these texture dict/name like the one (commonmenu/bgd_gradient)in the post?

 

EDIT: also for the reset key, I reset it to numpad keys, it worked but it doesn't stop mouse buttons from being active, did I miss something?

 

Use OpenIV, and for mousebuttons, they all should be disabled with ResetKey.

Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067875328
Share on other sites

NativeUI ver 1.3 has been released. Changelog:

  • Fixed arrow spacing in UIMenuListItem.
  • Fixed UIMenuCheckboxItem being misaligned.
  • You can now press keys repeatedly without any delay.
  • Added a lot of helper functions to MenuPool.
  • More properties for UIResText.
  • Scroll wheel is now part of the control dictionary.
  • FormatDescription now uses the new StringMeasurer
Edited by Guad
  • Like 1
Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067875521
Share on other sites

 

NativeUI ver 1.3 has been released. Changelog:

  • Fixed arrow spacing in UIMenuListItem.
  • Fixed UIMenuCheckboxItem being misaligned.
  • You can now press keys repeatedly without any delay.
  • Added a lot of helper functions to MenuPool.
  • More properties for UIResText.
  • Scroll wheel is now part of the control dictionary.
  • FormatDescription now uses the new StringMeasurer

 

Hi, i created a class liberary in C# but i cant seem to define Windows.Forms is that a problem or not?

Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067876620
Share on other sites

 

 

NativeUI ver 1.3 has been released. Changelog:

  • Fixed arrow spacing in UIMenuListItem.
  • Fixed UIMenuCheckboxItem being misaligned.
  • You can now press keys repeatedly without any delay.
  • Added a lot of helper functions to MenuPool.
  • More properties for UIResText.
  • Scroll wheel is now part of the control dictionary.
  • FormatDescription now uses the new StringMeasurer

 

Hi, i created a class liberary in C# but i cant seem to define Windows.Forms is that a problem or not?

 

Make sure you added it to References

Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067876986
Share on other sites

 

 

 

NativeUI ver 1.3 has been released. Changelog:

  • Fixed arrow spacing in UIMenuListItem.
  • Fixed UIMenuCheckboxItem being misaligned.
  • You can now press keys repeatedly without any delay.
  • Added a lot of helper functions to MenuPool.
  • More properties for UIResText.
  • Scroll wheel is now part of the control dictionary.
  • FormatDescription now uses the new StringMeasurer

 

Hi, i created a class liberary in C# but i cant seem to define Windows.Forms is that a problem or not?

 

Make sure you added it to References

 

I have added NativeUI.dll and ScriptHookDotNet.dll as a reference but Keys won't define for me.

Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067877496
Share on other sites

unknown modder

 

 

 

 

NativeUI ver 1.3 has been released. Changelog:

  • Fixed arrow spacing in UIMenuListItem.
  • Fixed UIMenuCheckboxItem being misaligned.
  • You can now press keys repeatedly without any delay.
  • Added a lot of helper functions to MenuPool.
  • More properties for UIResText.
  • Scroll wheel is now part of the control dictionary.
  • FormatDescription now uses the new StringMeasurer

 

Hi, i created a class liberary in C# but i cant seem to define Windows.Forms is that a problem or not?

 

Make sure you added it to References

 

I have added NativeUI.dll and ScriptHookDotNet.dll as a reference but Keys won't define for me.

 

Thats because you need to add system.windows.forms as a reference. when you are on the add reference screen, go to assembleys and then framework, and scroll down to the windows.forms one and check it

8cc58038c3.png

  • Like 2
Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067878261
Share on other sites

 

 

 

Any way to disable backspace/right click making the menu close, Guad?

Sure

mymenu.ResetKey(NativeUI.UIMenu.MenuControls.Back);
Then you can either choose a different control or key with mymenu.SetKey(), or you can handle that yourself and call mymenu.GoBack().

 

 

 

 

Hello I have a question, i thought you might know how to use UI.DrawTexture? What is the param "filename"? Where can I find textures to draw, like radar blips or weapon icons?

You can use NativeUI.Sprite.DrawTexture(string filename, Point position, Size size)

filename parameter is the path to your custom texture, you can place your picture in the scripts folder and pass "scripts\\mypic.png" as the filename.

You can also use pictures embedded in your project. For that drag your picture to your project in the project solution, and select it's property as "Embedded Resource". then call once string myPicturePath = NativeUI.Sprite.WriteFileFromResources(Assembly.GetExecutingAssembly(), "myNamespace.mypic.png"); and then use it in DrawTexture. Note that you have to include your default namespace in WriteFileFromResources. You can view it in Properties.

 

As for what textures, that's up to you.

 

The first one worked. but the second one crashed the game...I guess it's my problem. What about ingame textures?

 

Use the Sprite object, more info here: https://github.com/Guad/NativeUI/wiki/UI-Drawing

Thanks for the info, but I meant to ask where are these texture dict/name like the one (commonmenu/bgd_gradient)in the post?

 

EDIT: also for the reset key, I reset it to numpad keys, it worked but it doesn't stop mouse buttons from being active, did I miss something?

 

Use OpenIV, and for mousebuttons, they all should be disabled with ResetKey.

 

ResetKey works, thanks:D

Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067878907
Share on other sites

  • 2 weeks later...

 

Hello :) How do i show a subtitle or notification while i hover over a checkbox. Thanks :)

myMenu.OnIndexChange += (menu, index) =>{    if(menu.MenuItems[index] == myItem)    {        UI.ShowSubtitle("This is my item", 100);    }};

Thank you, it works, also i have another question, how do i remove cash for example $3000 as if it was a button when i click a checkbox, so i want to know how to remove $3000 from the player if they click a checkbox and not loop it. Thanks again :)

Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067929157
Share on other sites

 

 

Hello :) How do i show a subtitle or notification while i hover over a checkbox. Thanks :)

myMenu.OnIndexChange += (menu, index) =>{    if(menu.MenuItems[index] == myItem)    {        UI.ShowSubtitle("This is my item", 100);    }};

Thank you, it works, also i have another question, how do i remove cash for example $3000 as if it was a button when i click a checkbox, so i want to know how to remove $3000 from the player if they click a checkbox and not loop it. Thanks again :)

 

 

myCheckbox.OnCheckboxEvent += (item, checkd) =>{    if(!checkd) return;    Game.Player.Money -= 3000;};
Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067931143
Share on other sites

Thank you again Guadmaz, i have 1 more question, How do you fade the text to show its not available or something, like you done in Map Editor also how do you add a description to a list?. Thanks :)

 

myItem.Enabled = false;

and the description you'd change them yourself as you scroll the list.

how can i see the text of an item that is in a binded menu ?

 

 

MyItem.Text

There's no difference if an item is inside a menu or not.

Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067935679
Share on other sites

unknown modder

Can I suggest changing the target framework to 4.5.2 in preparation for the next version of shv.net, The current menu inside there is getting removed so more people will probably resort to using this. Also what is the issue with Custom texture files or has that been fixed

 

Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067935989
Share on other sites

 

Thank you again Guadmaz, i have 1 more question, How do you fade the text to show its not available or something, like you done in Map Editor also how do you add a description to a list?. Thanks :)

myItem.Enabled = false;

and the description you'd change them yourself as you scroll the list.

how can i see the text of an item that is in a binded menu ?

MyItem.Text

There's no difference if an item is inside a menu or not.

 

what is the public for this code ?

can you show me an example please ?

Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067937494
Share on other sites

unknown modder

Is there a way to make a button "unselectable"? Basically if you are scrolling through the menu, it would be skipped.

No, but you can make set Enabled to false which means you cant activate/change the item

Edited by unknown modder
Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067944922
Share on other sites

 

 

Thank you again Guadmaz, i have 1 more question, How do you fade the text to show its not available or something, like you done in Map Editor also how do you add a description to a list?. Thanks :)

myItem.Enabled = false;

and the description you'd change them yourself as you scroll the list.

how can i see the text of an item that is in a binded menu ?

MyItem.Text

There's no difference if an item is inside a menu or not.

 

what is the public for this code ?

can you show me an example please ?

 

please help me....

Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067945669
Share on other sites

 

NativeUI Library

Download 1.3.1

ScriptHookVDotNet based library for easy and fast Rockstar-like menus.

ui.PNG

Features:

  • Support for simple buttons, checkboxes and lists.
  • Support for custom banners from game sprites and your own textures.
  • Easy nested menus for fast and painless nested menu system.
  • Controller support.
  • Mouse controls.
  • Custom instructional buttons.
  • Support for all screen resolutions.
  • Item descriptions.
  • Rebindable keys and controls.
  • Badges to decorate your items.
  • Event-based callbacks.

 

Installation

After installing ScriptHookVDotNet, copy NativeUI.dll to your scripts/ folder.

 

Usage

Add NativeUI.dll your references in Visual Studio just like you did with ScriptHookDotNet.dll and add "using NativeUI;" to the top of your script.

You can read the documentation at the wiki.

 

Changelog

-1.3

-- See github release for more information.

-1.2

-- Cursor resets when menu is open. You can disable this setting ResetCursorOnOpen to false.

-1.1

-- You can read the changelog here.

- 1.0

-- You can read the full changelog here.

- 0.9

-- Removed debug stuff from last release.

-- Lied a base for controller detection.

- 0.8

-- Menu mantains aspect ratio in all screen resolutions.

- 0.7

-- Added menu nesting methods: BindMenuToItem and ReleaseMenuFromItem

-- Added back/exit buttons.

-- Added a helper class, MenuPool, to easily call your process methods of all of your menus with just one method, ProcessMenus.

- 0.6

-- Added mouse controls. Place ProcessMouse() in your OnTick event.

-- Restyled the menu to look a lot more like an official Rockstar menu.

- 0.5

-- Added controller support.

- 0.4

-- Support for both keys and controls

-- Disabled phone when menu is open

-- Added Select support for list items

- 0.3

-- Fixed graphical errors when there were more than 12 items on screen.

- 0.2

-- Added badges.

- 0.1

-- Initial Release.

 

Distribution

Please, do not distribute the .dll with your mod. This causes many old versions floating around on the internet. Instead, point your users to this post.

 

Media

 

Screenshots were taken in 0.7

3jvnop.PNG

ua35o6.PNG

r3c22j.PNG

frywy3.PNG

 

 

Extra Credits

Thanks to jedijosh920 for helping out on natives and making it look a lot more like Rockstar, thanks man.

 

Sourcecode

You can find the source at https://github.com/Guad/NativeUI

 

 

I want to ask you for permission to port it to RAGEPluginHook, obviously with proper credit. It will be me and maybe few other people who will port it. I hope you will let us do it.

Great job, Guad.

Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067945891
Share on other sites

 

 

 

Thank you again Guadmaz, i have 1 more question, How do you fade the text to show its not available or something, like you done in Map Editor also how do you add a description to a list?. Thanks :)

myItem.Enabled = false;

and the description you'd change them yourself as you scroll the list.

how can i see the text of an item that is in a binded menu ?

MyItem.Text

There's no difference if an item is inside a menu or not.

 

 

what is the public for this code ?

can you show me an example please ?

 

 

You can view the wiki at github for more examples.

 

Can I suggest changing the target framework to 4.5.2 in preparation for the next version of shv.net, The current menu inside there is getting removed so more people will probably resort to using this. Also what is the issue with Custom texture files or has that been fixed

 

 

I'll do that along with some fixes. The custom texture was being misplaced and distortioned on some resolutions. I thought it was ScriptHookVDotNet's bad implementation, which has been fixed, I guess.

 

 

 

NativeUI Library

Download 1.3.1

ScriptHookVDotNet based library for easy and fast Rockstar-like menus.

ui.PNG

Features:

  • Support for simple buttons, checkboxes and lists.
  • Support for custom banners from game sprites and your own textures.
  • Easy nested menus for fast and painless nested menu system.
  • Controller support.
  • Mouse controls.
  • Custom instructional buttons.
  • Support for all screen resolutions.
  • Item descriptions.
  • Rebindable keys and controls.
  • Badges to decorate your items.
  • Event-based callbacks.

 

Installation

After installing ScriptHookVDotNet, copy NativeUI.dll to your scripts/ folder.

 

Usage

Add NativeUI.dll your references in Visual Studio just like you did with ScriptHookDotNet.dll and add "using NativeUI;" to the top of your script.

You can read the documentation at the wiki.

 

Changelog

-1.3

-- See github release for more information.

-1.2

-- Cursor resets when menu is open. You can disable this setting ResetCursorOnOpen to false.

-1.1

-- You can read the changelog here.

- 1.0

-- You can read the full changelog here.

- 0.9

-- Removed debug stuff from last release.

-- Lied a base for controller detection.

- 0.8

-- Menu mantains aspect ratio in all screen resolutions.

- 0.7

-- Added menu nesting methods: BindMenuToItem and ReleaseMenuFromItem

-- Added back/exit buttons.

-- Added a helper class, MenuPool, to easily call your process methods of all of your menus with just one method, ProcessMenus.

- 0.6

-- Added mouse controls. Place ProcessMouse() in your OnTick event.

-- Restyled the menu to look a lot more like an official Rockstar menu.

- 0.5

-- Added controller support.

- 0.4

-- Support for both keys and controls

-- Disabled phone when menu is open

-- Added Select support for list items

- 0.3

-- Fixed graphical errors when there were more than 12 items on screen.

- 0.2

-- Added badges.

- 0.1

-- Initial Release.

 

Distribution

Please, do not distribute the .dll with your mod. This causes many old versions floating around on the internet. Instead, point your users to this post.

 

Media

 

Screenshots were taken in 0.7

3jvnop.PNG

ua35o6.PNG

r3c22j.PNG

frywy3.PNG

 

 

Extra Credits

Thanks to jedijosh920 for helping out on natives and making it look a lot more like Rockstar, thanks man.

 

Sourcecode

You can find the source at https://github.com/Guad/NativeUI

 

 

 

I want to ask you for permission to port it to RAGEPluginHook, obviously with proper credit. It will be me and maybe few other people who will port it. I hope you will let us do it.

Great job, Guad.

 

Sure, as long as you release the sourcecode.

Edited by Guad
Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067946100
Share on other sites

 

 

 

 

Thank you again Guadmaz, i have 1 more question, How do you fade the text to show its not available or something, like you done in Map Editor also how do you add a description to a list?. Thanks :)

myItem.Enabled = false;

and the description you'd change them yourself as you scroll the list.

how can i see the text of an item that is in a binded menu ?

MyItem.Text

There's no difference if an item is inside a menu or not.

 

 

what is the public for this code ?

can you show me an example please ?

 

 

You can view the wiki at github for more examples.

 

Can I suggest changing the target framework to 4.5.2 in preparation for the next version of shv.net, The current menu inside there is getting removed so more people will probably resort to using this. Also what is the issue with Custom texture files or has that been fixed

 

 

I'll do that along with some fixes. The custom texture was being misplaced and distortioned on some resolutions. I thought it was ScriptHookVDotNet's bad implementation, which has been fixed, I guess.

 

 

 

NativeUI Library

Download 1.3.1

ScriptHookVDotNet based library for easy and fast Rockstar-like menus.

ui.PNG

Features:

  • Support for simple buttons, checkboxes and lists.
  • Support for custom banners from game sprites and your own textures.
  • Easy nested menus for fast and painless nested menu system.
  • Controller support.
  • Mouse controls.
  • Custom instructional buttons.
  • Support for all screen resolutions.
  • Item descriptions.
  • Rebindable keys and controls.
  • Badges to decorate your items.
  • Event-based callbacks.

 

Installation

After installing ScriptHookVDotNet, copy NativeUI.dll to your scripts/ folder.

 

Usage

Add NativeUI.dll your references in Visual Studio just like you did with ScriptHookDotNet.dll and add "using NativeUI;" to the top of your script.

You can read the documentation at the wiki.

 

Changelog

-1.3

-- See github release for more information.

-1.2

-- Cursor resets when menu is open. You can disable this setting ResetCursorOnOpen to false.

-1.1

-- You can read the changelog here.

- 1.0

-- You can read the full changelog here.

- 0.9

-- Removed debug stuff from last release.

-- Lied a base for controller detection.

- 0.8

-- Menu mantains aspect ratio in all screen resolutions.

- 0.7

-- Added menu nesting methods: BindMenuToItem and ReleaseMenuFromItem

-- Added back/exit buttons.

-- Added a helper class, MenuPool, to easily call your process methods of all of your menus with just one method, ProcessMenus.

- 0.6

-- Added mouse controls. Place ProcessMouse() in your OnTick event.

-- Restyled the menu to look a lot more like an official Rockstar menu.

- 0.5

-- Added controller support.

- 0.4

-- Support for both keys and controls

-- Disabled phone when menu is open

-- Added Select support for list items

- 0.3

-- Fixed graphical errors when there were more than 12 items on screen.

- 0.2

-- Added badges.

- 0.1

-- Initial Release.

 

Distribution

Please, do not distribute the .dll with your mod. This causes many old versions floating around on the internet. Instead, point your users to this post.

 

Media

 

Screenshots were taken in 0.7

3jvnop.PNG

ua35o6.PNG

r3c22j.PNG

frywy3.PNG

 

 

Extra Credits

Thanks to jedijosh920 for helping out on natives and making it look a lot more like Rockstar, thanks man.

 

Sourcecode

You can find the source at https://github.com/Guad/NativeUI

 

 

 

I want to ask you for permission to port it to RAGEPluginHook, obviously with proper credit. It will be me and maybe few other people who will port it. I hope you will let us do it.

Great job, Guad.

 

Sure, as long as you release the sourcecode.

 

i tried doing that but it didn't worked...

this is my code:

http://pastebin.com/XgzMDR8V

 

please look at the lines 260 - 266.

at those lines, i'm trying to print the item text, but its not working.

Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067946372
Share on other sites

 

 

 

 

 

Thank you again Guadmaz, i have 1 more question, How do you fade the text to show its not available or something, like you done in Map Editor also how do you add a description to a list?. Thanks :)

myItem.Enabled = false;

and the description you'd change them yourself as you scroll the list.

how can i see the text of an item that is in a binded menu ?

MyItem.Text

There's no difference if an item is inside a menu or not.

 

 

what is the public for this code ?

can you show me an example please ?

 

 

You can view the wiki at github for more examples.

 

Can I suggest changing the target framework to 4.5.2 in preparation for the next version of shv.net, The current menu inside there is getting removed so more people will probably resort to using this. Also what is the issue with Custom texture files or has that been fixed

 

 

I'll do that along with some fixes. The custom texture was being misplaced and distortioned on some resolutions. I thought it was ScriptHookVDotNet's bad implementation, which has been fixed, I guess.

 

 

 

NativeUI Library

Download 1.3.1

ScriptHookVDotNet based library for easy and fast Rockstar-like menus.

ui.PNG

Features:

  • Support for simple buttons, checkboxes and lists.
  • Support for custom banners from game sprites and your own textures.
  • Easy nested menus for fast and painless nested menu system.
  • Controller support.
  • Mouse controls.
  • Custom instructional buttons.
  • Support for all screen resolutions.
  • Item descriptions.
  • Rebindable keys and controls.
  • Badges to decorate your items.
  • Event-based callbacks.

 

Installation

After installing ScriptHookVDotNet, copy NativeUI.dll to your scripts/ folder.

 

Usage

Add NativeUI.dll your references in Visual Studio just like you did with ScriptHookDotNet.dll and add "using NativeUI;" to the top of your script.

You can read the documentation at the wiki.

 

Changelog

-1.3

-- See github release for more information.

-1.2

-- Cursor resets when menu is open. You can disable this setting ResetCursorOnOpen to false.

-1.1

-- You can read the changelog here.

- 1.0

-- You can read the full changelog here.

- 0.9

-- Removed debug stuff from last release.

-- Lied a base for controller detection.

- 0.8

-- Menu mantains aspect ratio in all screen resolutions.

- 0.7

-- Added menu nesting methods: BindMenuToItem and ReleaseMenuFromItem

-- Added back/exit buttons.

-- Added a helper class, MenuPool, to easily call your process methods of all of your menus with just one method, ProcessMenus.

- 0.6

-- Added mouse controls. Place ProcessMouse() in your OnTick event.

-- Restyled the menu to look a lot more like an official Rockstar menu.

- 0.5

-- Added controller support.

- 0.4

-- Support for both keys and controls

-- Disabled phone when menu is open

-- Added Select support for list items

- 0.3

-- Fixed graphical errors when there were more than 12 items on screen.

- 0.2

-- Added badges.

- 0.1

-- Initial Release.

 

Distribution

Please, do not distribute the .dll with your mod. This causes many old versions floating around on the internet. Instead, point your users to this post.

 

Media

 

Screenshots were taken in 0.7

3jvnop.PNG

ua35o6.PNG

r3c22j.PNG

frywy3.PNG

 

 

Extra Credits

Thanks to jedijosh920 for helping out on natives and making it look a lot more like Rockstar, thanks man.

 

Sourcecode

You can find the source at https://github.com/Guad/NativeUI

 

 

 

I want to ask you for permission to port it to RAGEPluginHook, obviously with proper credit. It will be me and maybe few other people who will port it. I hope you will let us do it.

Great job, Guad.

 

Sure, as long as you release the sourcecode.

 

i tried doing that but it didn't worked...

this is my code:

http://pastebin.com/XgzMDR8V

 

please look at the lines 260 - 266.

at those lines, i'm trying to print the item text, but its not working.

 

Your code will only execute if the sender is both mainMenu and newMenu, which is impossible.

The fixed code would be

 

public void OnItemSelect (UIMenu sender, UIMenuItem selectedItem, int index)    {        // You can also detect the button by using index        if (sender == mainMenu)        {            if (selectedItem == cookItem)            {                string dish = dishesListItem.IndexToItem (dishesListItem.Index).ToString ();                bool ketchup = ketchupCheckbox.Checked;                string output = ketchup                    ? "You have ordered ~b~{0}~w~ ~r~with~w~ ketchup."                    : "You have ordered ~b~{0}~w~ ~r~without~w~ ketchup.";                UI.ShowSubtitle (String.Format (output, dish));            }      }            for (int i = 0, j = 69; i < j; i++)            {                if (sender == newMenu[i])                {                    UI.ShowSubtitle (selectedItem.Text);                }            }           }
Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067946799
Share on other sites

 

 

 

 

 

 

Thank you again Guadmaz, i have 1 more question, How do you fade the text to show its not available or something, like you done in Map Editor also how do you add a description to a list?. Thanks :)

myItem.Enabled = false;

and the description you'd change them yourself as you scroll the list.

how can i see the text of an item that is in a binded menu ?

MyItem.Text

There's no difference if an item is inside a menu or not.

 

 

what is the public for this code ?

can you show me an example please ?

 

 

You can view the wiki at github for more examples.

 

Can I suggest changing the target framework to 4.5.2 in preparation for the next version of shv.net, The current menu inside there is getting removed so more people will probably resort to using this. Also what is the issue with Custom texture files or has that been fixed

 

 

I'll do that along with some fixes. The custom texture was being misplaced and distortioned on some resolutions. I thought it was ScriptHookVDotNet's bad implementation, which has been fixed, I guess.

 

 

 

NativeUI Library

Download 1.3.1

ScriptHookVDotNet based library for easy and fast Rockstar-like menus.

ui.PNG

Features:

  • Support for simple buttons, checkboxes and lists.
  • Support for custom banners from game sprites and your own textures.
  • Easy nested menus for fast and painless nested menu system.
  • Controller support.
  • Mouse controls.
  • Custom instructional buttons.
  • Support for all screen resolutions.
  • Item descriptions.
  • Rebindable keys and controls.
  • Badges to decorate your items.
  • Event-based callbacks.

 

Installation

After installing ScriptHookVDotNet, copy NativeUI.dll to your scripts/ folder.

 

Usage

Add NativeUI.dll your references in Visual Studio just like you did with ScriptHookDotNet.dll and add "using NativeUI;" to the top of your script.

You can read the documentation at the wiki.

 

Changelog

-1.3

-- See github release for more information.

-1.2

-- Cursor resets when menu is open. You can disable this setting ResetCursorOnOpen to false.

-1.1

-- You can read the changelog here.

- 1.0

-- You can read the full changelog here.

- 0.9

-- Removed debug stuff from last release.

-- Lied a base for controller detection.

- 0.8

-- Menu mantains aspect ratio in all screen resolutions.

- 0.7

-- Added menu nesting methods: BindMenuToItem and ReleaseMenuFromItem

-- Added back/exit buttons.

-- Added a helper class, MenuPool, to easily call your process methods of all of your menus with just one method, ProcessMenus.

- 0.6

-- Added mouse controls. Place ProcessMouse() in your OnTick event.

-- Restyled the menu to look a lot more like an official Rockstar menu.

- 0.5

-- Added controller support.

- 0.4

-- Support for both keys and controls

-- Disabled phone when menu is open

-- Added Select support for list items

- 0.3

-- Fixed graphical errors when there were more than 12 items on screen.

- 0.2

-- Added badges.

- 0.1

-- Initial Release.

 

Distribution

Please, do not distribute the .dll with your mod. This causes many old versions floating around on the internet. Instead, point your users to this post.

 

Media

 

Screenshots were taken in 0.7

3jvnop.PNG

ua35o6.PNG

r3c22j.PNG

frywy3.PNG

 

 

Extra Credits

Thanks to jedijosh920 for helping out on natives and making it look a lot more like Rockstar, thanks man.

 

Sourcecode

You can find the source at https://github.com/Guad/NativeUI

 

 

 

I want to ask you for permission to port it to RAGEPluginHook, obviously with proper credit. It will be me and maybe few other people who will port it. I hope you will let us do it.

Great job, Guad.

 

Sure, as long as you release the sourcecode.

 

i tried doing that but it didn't worked...

this is my code:

http://pastebin.com/XgzMDR8V

 

please look at the lines 260 - 266.

at those lines, i'm trying to print the item text, but its not working.

 

Your code will only execute if the sender is both mainMenu and newMenu, which is impossible.

The fixed code would be

public void OnItemSelect (UIMenu sender, UIMenuItem selectedItem, int index)    {        // You can also detect the button by using index        if (sender == mainMenu)        {            if (selectedItem == cookItem)            {                string dish = dishesListItem.IndexToItem (dishesListItem.Index).ToString ();                bool ketchup = ketchupCheckbox.Checked;                string output = ketchup                    ? "You have ordered ~b~{0}~w~ ~r~with~w~ ketchup."                    : "You have ordered ~b~{0}~w~ ~r~without~w~ ketchup.";                UI.ShowSubtitle (String.Format (output, dish));            }      }            for (int i = 0, j = 69; i < j; i++)            {                if (sender == newMenu[i])                {                    UI.ShowSubtitle (selectedItem.Text);                }            }           }

still, its not working, here is the new code:

http://pastebin.com/XgzMDR8V

if i press the button the reffers me to the skins menu its showing me the message, but if i press on an item in that menu, it wont show up the message....

lines: 263 - 270.

Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067948290
Share on other sites

 

 

Your code will only execute if the sender is both mainMenu and newMenu, which is impossible.

The fixed code would be

public void OnItemSelect (UIMenu sender, UIMenuItem selectedItem, int index)    {        // You can also detect the button by using index        if (sender == mainMenu)        {            if (selectedItem == cookItem)            {                string dish = dishesListItem.IndexToItem (dishesListItem.Index).ToString ();                bool ketchup = ketchupCheckbox.Checked;                string output = ketchup                    ? "You have ordered ~b~{0}~w~ ~r~with~w~ ketchup."                    : "You have ordered ~b~{0}~w~ ~r~without~w~ ketchup.";                UI.ShowSubtitle (String.Format (output, dish));            }      }            for (int i = 0, j = 69; i < j; i++)            {                if (sender == newMenu[i])                {                    UI.ShowSubtitle (selectedItem.Text);                }            }           }

 

still, its not working, here is the new code:

http://pastebin.com/XgzMDR8V

if i press the button the reffers me to the skins menu its showing me the message, but if i press on an item in that menu, it wont show up the message....

lines: 263 - 270.

 

You didn't hook up your newMenu[] for the events.

You need to add newMenu.OnItemSelect += OnItemSelect when you create them.

 

 

Also version 1.4 released with compatibilities with ScriptHookVDotNet 2.0

Edited by Guad
Link to comment
https://gtaforums.com/topic/809284-net-nativeui/page/4/#findComment-1067953136
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
  • 4 Users Currently Viewing
    0 members, 0 Anonymous, 4 Guests

×
×
  • Create New...

Important Information

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