Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (84,805 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. 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

    2. Red Dead Redemption

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

ISOFX

NativeUI Tutorials

Recommended Posts

ISOFX

I Have Realized that some people don't know how to do some things like me, this is only for people who use NativeUI, for those who don't know what NativeUI is, its a Rockstar themed menu base, so it looks exactly like the way Rockstars menus look. Hope this helps!

 

Download NativeUI - By Guad

Download My Template - By ISOFX

 

Simple Buttons -

var ButtonName = new UIMenuItem("Button Text", "Button Description.");MenuName.AddItem(ButtonName);

Adding a Function to a Button -

In "private void OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index)" Add the following code inside the void -

if (sender == mainMenu) // change the sender to your menu.{    switch (index)    {    case 0:       UI.Notify("Add Your Own Function.");       break;    }}

Adding a Sub menu -

1. At the top of your script where it says "private UIMenu mainMenu;" Write "private UIMenu Sub1;"

2. From your main menu, add a normal button with no function.

3. Under "RefreshIndex();" add "mainMenu.BindMenuToItem(SubMenu1(), ButtonYourBindingTo);"

4. Add the following code under "private UIMenu StartUpMenu()"

Step 4 Code -

   private UIMenu SubMenu1()   {        Sub1 = new UIMenu("TITLE", "~b~SUB HEADER");        _menuPool.Add(Sub1);                Sub1.OnItemSelect += OnItemSelect;        Sub1.OnCheckboxChange += OnCheckboxChange;        Sub1.OnListChange += new ListChangedEvent(OnListChange);        Sub1.OnListChange += new ListChangedEvent(OnListChange);        Sub1.RefreshIndex();        return Sub1;    } 

5. Add Buttons etc, and make sure you change the sender to, Sub1 when adding functions.

 

Fade Text -

ButtonName.Enabled = false;

Add a List -

1. Add the following to the top of your code where it says "private UIMenu mainMenu;"

private List<object> List1;private UIMenuListItem List1Item;

2. In the menu you want the list in add the following -

List1 = new List<object> { "Item 1", "Item 2", "Item 3" };List1Item = new UIMenuListItem("Your Text ", List1, 0);MenuName.AddItem(List1Item);

3. In "private void OnListChange(UIMenu sender, UIMenuListItem list, int index)" add the following code

if (sender == mainMenu) //change sender to your menu.{  if (list == List1Item)  {       switch (index)       {        case 0:           UI.Notify("Function in this case.");                break;       }   }}

Adding a Checkbox -

1. Add the following code below "private UIMenu mainMenu;"

private UIMenuCheckboxItem CheckboxOne;bool CheckboxOneActive = false; 

2. In "public void OnCheckboxChange(UIMenu sender, UIMenuCheckboxItem checkbox, bool Checked)" Add the following code:

if (sender == mainMenu && checkbox == CheckboxOne) // Change sender to your menu{   switch (Checked)   {        case true:             CheckboxOneActive = true;             break;        case false:             CheckboxOneActive = false;             break;    }}

3. In "private void OnTick(object sender, EventArgs e)" Add the following code:

if (CheckboxOneActive){   UI.Notify("Your functions in this if statement.");}

4. Done!

 

Hope This Helps!

Will be updating this regularly for people who need more help, if you need anything else here , just comment on what it is. :)

Edited by ISOFX

Share this post


Link to post
Share on other sites
FowardElement

Thanks, this is awesome!

Share this post


Link to post
Share on other sites
FowardElement

Do you know how to make a button that is unselectable and the text for it is centered? Im trying to make a "Settings" or "Options" spacer for my menu. Thanks

Share this post


Link to post
Share on other sites
ISOFX

Do you know how to make a button that is unselectable and the text for it is centered? Im trying to make a "Settings" or "Options" spacer for my menu. Thanks

This is the only way i found:

var Yourbutton = new UIMenuItem("                         " + "Button", "Description");yourMenu.AddItem(Yourbutton);

This centers the text, it does work, but its not the best way, ask on the coding section,

 

And to fade the text to show its unavailable you do this:

yourButton.Enabled = false;

Hope this helped! :)

Edited by ISOFX

Share this post


Link to post
Share on other sites
FowardElement

Thats a clever way to do that! Thanks

Share this post


Link to post
Share on other sites
YossiBz

if i want a list choose for example i want to teleport submarine part #2

and i have a list and i want to click to teleport and not to change

Share this post


Link to post
Share on other sites
HeshamAlking

what kind of button

 

var what i write here exactly? = new UIMenuItem("Button Text", "Button Description.");
yourMenu.AddItem
(what i write here exactly? );

Edited by HeshamAlking

Share this post


Link to post
Share on other sites
jaky2008

I've made a sub-menu that I want to load once I press on a button from the mainMenu... how can that be done? Can we only navigate menus using the "index" aka integers? I don't understand how to use that, it would be way better if I could navigate menu's using whatever button you specifically click on as opposed to all buttons from the mainMenu.

Edited by jaky2008

Share this post


Link to post
Share on other sites
h3adshotzz

ive built it in visual studio but where is the mod saved to in the folder? sorry if this is a dumb question im new to this. great tutorial by the way :) i subbed on youtube

Share this post


Link to post
Share on other sites
ISOFX

ive built it in visual studio but where is the mod saved to in the folder? sorry if this is a dumb question im new to this. great tutorial by the way :) i subbed on youtube

 

When you build it the build tab shows you the location of the created file. If you have anymore problems add me on skype.

Skype: isofxyt

Share this post


Link to post
Share on other sites
Azorah

Very very helpful :)

Share this post


Link to post
Share on other sites
123iamking

This is so awesome, man ;)

Share this post


Link to post
Share on other sites
123iamking

Anyway, Is the the same as the UI in Alexander Blade's Native Trainer?

Share this post


Link to post
Share on other sites
extractor404

Hi, I'm sorry if this is kind of late, but I'm just getting started with NativeUI.

I strongly believe it's possible to make a checkbox and have the player have invincibility/god mode whenever it's checked, and when it's unchecked/blank, the invincibility disappears. (Essentially a toggle).

I've searched wide and far for an answer and I've tried many "solutions" myself, but none have worked. Any help on that "issue"?

Share this post


Link to post
Share on other sites
unknown modder

Hi, I'm sorry if this is kind of late, but I'm just getting started with NativeUI.

I strongly believe it's possible to make a checkbox and have the player have invincibility/god mode whenever it's checked, and when it's unchecked/blank, the invincibility disappears. (Essentially a toggle).

I've searched wide and far for an answer and I've tried many "solutions" myself, but none have worked. Any help on that "issue"?

Use the CheckboxEvent event in the UIMenuCheckboxItem to toggle the invincibility when the checkbox is toggled

Item.CheckboxEvent += (sender, bToggle) => Game.Player.Character.IsInvincible = bToggle;

Share this post


Link to post
Share on other sites
extractor404

 

Hi, I'm sorry if this is kind of late, but I'm just getting started with NativeUI.

I strongly believe it's possible to make a checkbox and have the player have invincibility/god mode whenever it's checked, and when it's unchecked/blank, the invincibility disappears. (Essentially a toggle).

I've searched wide and far for an answer and I've tried many "solutions" myself, but none have worked. Any help on that "issue"?

Use the CheckboxEvent event in the UIMenuCheckboxItem to toggle the invincibility when the checkbox is toggled

Item.CheckboxEvent += (sender, bToggle) => Game.Player.Character.IsInvincible = bToggle;

Appreciate the response. We (me and my team of scripters) got it working in a different way. Thank you anyway, now I know that is a way if we decide to change it! :)

Share this post


Link to post
Share on other sites
LeeC2202

How can I dynamically change the List contents of a UIMenuListItem?

 

I have two List items, one that is a list of Dictionary Keys in a Dictionary<string, List<dynamic>>, the second is the List of items from the List<dynamic>. If I change the first item, I want the second item's List to change to whatever I pull from the corresponding Dictionary value.

 

Nothing I have tried works and we don't have access to a UIMenuListItem.Items property.

 

Is this one of those situations where I have to bodge a solution, by using a standard UIMenuItem for the second List and simply change the caption on a Left & Right control input? Or is there a proper way to dynamically alter the list contents?

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

×

Important Information

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