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 *Spoilers*
    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

Guad

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

Share this post


Link to post
Share on other sites
GeorgeZhang

 

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

Share this post


Link to post
Share on other sites
Guad

 

 

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.

Share this post


Link to post
Share on other sites
Guad

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

Share this post


Link to post
Share on other sites
TragicMods

 

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?

Share this post


Link to post
Share on other sites
Guad

 

 

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

Share this post


Link to post
Share on other sites
TragicMods

 

 

 

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.

Share this post


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

Share this post


Link to post
Share on other sites
GeorgeZhang

 

 

 

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

Share this post


Link to post
Share on other sites
ISOFX

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

Share this post


Link to post
Share on other sites
Guad

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);    }};
Edited by Guad

Share this post


Link to post
Share on other sites
ISOFX

 

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

Share this post


Link to post
Share on other sites
Guad

 

 

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

Share this post


Link to post
Share on other sites
ISOFX

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

Edited by ISOFX

Share this post


Link to post
Share on other sites
yossi2000

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

Share this post


Link to post
Share on other sites
Guad

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.

Share this post


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

 

Share this post


Link to post
Share on other sites
yossi2000

 

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 ?

Share this post


Link to post
Share on other sites
ISOFX

Made a thread on NativeUI showing some tutorials on how to do stuff, and thanks for the help :)

Thread

Edited by ISOFX

Share this post


Link to post
Share on other sites
FowardElement

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

Edited by FowardElement

Share this post


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

Share this post


Link to post
Share on other sites
yossi2000

 

 

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

Share this post


Link to post
Share on other sites
alexguirre

 

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.

Share this post


Link to post
Share on other sites
Guad

 

 

 

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

Share this post


Link to post
Share on other sites
yossi2000

 

 

 

 

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.

Share this post


Link to post
Share on other sites
Guad

 

 

 

 

 

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

Share this post


Link to post
Share on other sites
yossi2000

 

 

 

 

 

 

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.

Share this post


Link to post
Share on other sites
Guad

 

 

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

Share this post


Link to post
Share on other sites
alexguirre

Sure, as long as you release the sourcecode.

 

If you want to take a look at the source code here it is: https://github.com/alexguirre/RAGENativeUI

Thanks Guad.

Edited by alexguirre

Share this post


Link to post
Share on other sites
ISOFX

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

Thank You :)

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

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

×

Important Information

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