Quantcast

Jump to content

» «
Photo

[.NET] NativeUI

V WIP
195 replies to this topic
Guad
  • Guad

    Punk-ass Bitch

  • Members
  • Joined: 08 May 2015
  • Spain

#1

Posted 18 July 2015 - 11:43 PM Edited by Guad, 29 June 2016 - 05:17 PM.

NativeUI Library

Download 1.7

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

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

-- Fixed issue when UIMenuListItem had more than 100k items
-- Added mouse controls to TabView
-- Added TabInteractiveListItem
-- Added UIMenu.ScaleWithSafezone
-- Removed useless BarTimerBar.Text

- 1.6.1

-- Fixed Wasted & Busted messages not going away.

- 1.6

-- Added Timer bars.

-- Added pause menu style menus.

-- Added BigMessage class. See wiki for a tutorial.

- 1.5

-- Fixed crash related to instructional buttons. Thanks zorg93 for the find.

- 1.4

-- Compatibilities with ScriptHookVDotNet 2.0

-- Mouse controls are disabled when controller is used.

-- Bugfixes.

- 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

Spoiler

 

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

  • gamerzworld, Hanneswasco, Zer0w5 and 30 others like this

Zer0w5
  • Zer0w5

    There are no stupid questions, just stupid people.

  • Members
  • Joined: 07 Dec 2008
  • None

#2

Posted 19 July 2015 - 11:55 AM

This is going to make things pretty interesting.


TheFlareEntercounter
  • TheFlareEntercounter

    Arms Dealer

  • Members
  • Joined: 28 Aug 2012
  • Croatia

#3

Posted 19 July 2015 - 07:14 PM

Awesome! Will be using this for a personal project.


Enumerator
  • Enumerator

    Coder

  • Members
  • Joined: 16 Jun 2015
  • United-Kingdom

#4

Posted 20 July 2015 - 12:15 PM

 

NativeUI Library

Download 0.3

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.
  • Item descriptions.
  • Rebindable keys.
  • 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.

Spoiler

 

Example Script

Spoiler

 

Changelog

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

 

Sourcecode

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

 

I approve of this UI


jedijosh920
  • jedijosh920

    ⭐⭐⭐⭐⭐

  • Members
  • Joined: 01 Mar 2012
  • United-States

#5

Posted 21 July 2015 - 02:18 AM

Thanks for the menu/credits man, I look forward into helping you make this look more like Rockstar's menu.


mlgthatsme
  • mlgthatsme

    Square Civilian

  • Members
  • Joined: 07 Sep 2013
  • None

#6

Posted 21 July 2015 - 03:37 AM

Damn this is exactly like my DLL haha. If you need help with stuff, like measuring strings and stuff, send me a message.


qiangqiang101
  • qiangqiang101

    I'm Not MentaL

  • Members
  • Joined: 02 Feb 2010
  • Malaysia

#7

Posted 22 July 2015 - 08:38 AM

Erm Visual Basic Example??


GeorgeZhang
  • GeorgeZhang

    I'm New

  • Members
  • Joined: 04 Jul 2015
  • None

#8

Posted 22 July 2015 - 08:56 AM

it says this : the primary reference "NativeUI" could not be resolved because it was built against the ".NETFramework,Version=v4.5.2" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5".

what does it mean?


unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#9

Posted 22 July 2015 - 09:00 AM

it says this : the primary reference "NativeUI" could not be resolved because it was built against the ".NETFramework,Version=v4.5.2" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5".
what does it mean?

go to your project settings and change the net framework to 4.5.2

qiangqiang101
  • qiangqiang101

    I'm Not MentaL

  • Members
  • Joined: 02 Feb 2010
  • Malaysia

#10

Posted 22 July 2015 - 09:22 AM

why isn't my code working?
 
Inherits Script
 
    Private player As Player
    Private playerPed As Ped
    Private simeon As Ped
    Private mainMenu As UIMenu
 
    Public Sub menuExample()
        AddHandler mainMenu.OnItemSelect, AddressOf ItemSelectHandler
        AddHandler Tick, AddressOf OnTick
        AddHandler KeyDown, AddressOf OnKeyDown
 
        mainMenu = New UIMenu("NativeUI", "~b~NATIVEUI SHOWCASE")
        mainMenu.SetKey(UIMenu.MenuControls.Up, GTA.Control.FrontendDown)
        mainMenu.SetKey(UIMenu.MenuControls.Down, GTA.Control.FrontendUp)
        mainMenu.SetKey(UIMenu.MenuControls.Select, GTA.Control.FrontendSelect)
        mainMenu.SetKey(UIMenu.MenuControls.Back, GTA.Control.FrontendCancel)
 
        mainMenu.AddItem(New UIMenuItem("Simple Button"))
        mainMenu.AddItem(New UIMenuCheckboxItem("Simple Checkbox", False))
        mainMenu.AddItem(New UIMenuListItem("Simple List", New List(Of Object)() From {
                                            "Item 1",
                                            "Item 2",
                                            "Item 3"
                                            }, 0))
        mainMenu.AddItem(New UIMenuItem("Another Button", "Items Can have descriptions too!"))
        mainMenu.RefreshIndex()
    End Sub
 
    Public Sub ItemSelectHandler(sender As UIMenu, selectedItem As UIMenuItem, index As Integer)
        UI.Notify("You have selected: ~b~" + selectedItem.Text)
    End Sub
 
    Public Sub OnTick(o As Object, e As EventArgs)
        'mainMenu.ProcessControl()
        'mainMenu.ProcessMouse()
        'mainMenu.Draw()
        MenuPool.ProcessMenus()
    End Sub
 
    Public Sub OnKeyDown(o As Object, e As KeyEventArgs)
        'mainMenu.ProcessKey(e.KeyCode)
        If e.KeyCode = Keys.F9 Then
            mainMenu.Visible = Not mainMenu.Visible
        Else
            mainMenu.Visible = mainMenu.Visible
        End If
    End Sub

Guad
  • Guad

    Punk-ass Bitch

  • Members
  • Joined: 08 May 2015
  • Spain

#11

Posted 22 July 2015 - 03:41 PM Edited by Guad, 22 July 2015 - 03:41 PM.

 

why isn't my code working?
Spoiler

 

What error does it show you?

You should change

If e.KeyCode = Keys.F9 Then
            mainMenu.Visible = Not mainMenu.Visible
        Else
            mainMenu.Visible = mainMenu.Visible
        End If

to

If e.KeyCode = Keys.F9 Then
            mainMenu.Visible = Not mainMenu.Visible
        End If

qiangqiang101
  • qiangqiang101

    I'm Not MentaL

  • Members
  • Joined: 02 Feb 2010
  • Malaysia

#12

Posted 22 July 2015 - 04:12 PM

 

 

why isn't my code working?
Spoiler

 

What error does it show you?

You should change

If e.KeyCode = Keys.F9 Then
            mainMenu.Visible = Not mainMenu.Visible
        Else
            mainMenu.Visible = mainMenu.Visible
        End If

to

If e.KeyCode = Keys.F9 Then
            mainMenu.Visible = Not mainMenu.Visible
        End If

No Error sir, just the menu is not showing

below is my full code

 

Imports System
Imports System.Collections.Generic
Imports System.Drawing
Imports System.Windows.Forms
Imports GTA
Imports GTA.Native
Imports NativeUI
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
 
Public Class pdmcarshop
    Inherits Script
 
    Private player As Player
    Private playerPed As Ped
    Private simeon As Ped
    Private mainMenu As UIMenu
 
    Public Sub menuExample()
        AddHandler mainMenu.OnItemSelect, AddressOf ItemSelectHandler
        AddHandler Tick, AddressOf OnTick
        AddHandler KeyDown, AddressOf OnKeyDown
 
        mainMenu = New UIMenu("NativeUI", "~b~NATIVEUI SHOWCASE")
        mainMenu.SetKey(UIMenu.MenuControls.Up, GTA.Control.FrontendDown)
        mainMenu.SetKey(UIMenu.MenuControls.Down, GTA.Control.FrontendUp)
        mainMenu.SetKey(UIMenu.MenuControls.Select, GTA.Control.FrontendSelect)
        mainMenu.SetKey(UIMenu.MenuControls.Back, GTA.Control.FrontendCancel)
 
        mainMenu.AddItem(New UIMenuItem("Simple Button"))
        mainMenu.AddItem(New UIMenuCheckboxItem("Simple Checkbox", False))
        mainMenu.AddItem(New UIMenuListItem("Simple List", New List(Of Object)() From {
                                            "Item 1",
                                            "Item 2",
                                            "Item 3"
                                            }, 0))
        mainMenu.AddItem(New UIMenuItem("Another Button", "Items Can have descriptions too!"))
        mainMenu.RefreshIndex()
    End Sub
 
    Public Sub ItemSelectHandler(sender As UIMenu, selectedItem As UIMenuItem, index As Integer)
        UI.Notify("You have selected: ~b~" + selectedItem.Text)
    End Sub
 
    Public Sub OnTick(o As Object, e As EventArgs)
        MenuPool.ProcessMenus()
    End Sub
 
    Public Sub OnKeyDown(o As Object, e As KeyEventArgs)
        If e.KeyCode = Keys.F9 Then
            mainMenu.Visible = Not mainMenu.Visible
        End If
    End Sub
End Class
  • jedijosh920 likes this

Guad
  • Guad

    Punk-ass Bitch

  • Members
  • Joined: 08 May 2015
  • Spain

#13

Posted 22 July 2015 - 05:11 PM

 

 

 

why isn't my code working?
Spoiler

 

What error does it show you?

You should change

If e.KeyCode = Keys.F9 Then
            mainMenu.Visible = Not mainMenu.Visible
        Else
            mainMenu.Visible = mainMenu.Visible
        End If

to

If e.KeyCode = Keys.F9 Then
            mainMenu.Visible = Not mainMenu.Visible
        End If

No Error sir, just the menu is not showing

below is my full code

 

Spoiler

 

First of all your code is not in a constructor. Second is that you called your menu before it was created. Third, the buttons you listed are already added by default.

So this is how your code should look

Spoiler

CamxxCore
  • CamxxCore

    Mark Chump

  • Members
  • Joined: 19 Oct 2013
  • Canada

#14

Posted 22 July 2015 - 05:55 PM

 

NativeUI Library

Download 0.9

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.
  • Easy nested menus for fast and painless nested menu system.
  • Controller support.
  • Mouse controls.
  • 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.

Spoiler

 

Example Script

Spoiler

 

Changelog

- 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

Spoiler

 

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

 

 

This is so awesome. I'm using it re-create the menus in some of my scripts. Looks so much better. May I suggest the addition of an ItemActivated event for the UIMenuItem? Thanks, this has saved me a ton of time!!

  • jedijosh920 likes this

Guad
  • Guad

    Punk-ass Bitch

  • Members
  • Joined: 08 May 2015
  • Spain

#15

Posted 22 July 2015 - 06:32 PM

 

Spoiler

 

This is so awesome. I'm using it re-create the menus in some of my scripts. Looks so much better. May I suggest the addition of an ItemActivated event for the UIMenuItem? Thanks, this has saved me a ton of time!!

 

What do you mean ItemActived event? You can use OnIndexChange, which is called when the player selects an item with a mouse/moves up or down


CamxxCore
  • CamxxCore

    Mark Chump

  • Members
  • Joined: 19 Oct 2013
  • Canada

#16

Posted 22 July 2015 - 07:51 PM Edited by CamxxCore, 22 July 2015 - 07:52 PM.

 

 

Spoiler

 

This is so awesome. I'm using it re-create the menus in some of my scripts. Looks so much better. May I suggest the addition of an ItemActivated event for the UIMenuItem? Thanks, this has saved me a ton of time!!

 

What do you mean ItemActived event? You can use OnIndexChange, which is called when the player selects an item with a mouse/moves up or down

 

 

I just find it messy handling all button events in one method. Only personal opinion. It would be nice to be able to use lambda to perform the button action. I know you provided the source and I added it myself. But i'm just making the suggestion.


Guad
  • Guad

    Punk-ass Bitch

  • Members
  • Joined: 08 May 2015
  • Spain

#17

Posted 22 July 2015 - 08:03 PM

 

 

 

Spoiler

 

This is so awesome. I'm using it re-create the menus in some of my scripts. Looks so much better. May I suggest the addition of an ItemActivated event for the UIMenuItem? Thanks, this has saved me a ton of time!!

 

What do you mean ItemActived event? You can use OnIndexChange, which is called when the player selects an item with a mouse/moves up or down

 

 

I just find it messy handling all button events in one method. Only personal opinion. It would be nice to be able to use lambda to perform the button action. I know you provided the source and I added it myself. But i'm just making the suggestion.

 

 

You can have each menu have it's button handler. Also you can make a pull request to the repo and I'll have it merged.


FIFSA
  • FIFSA

    Ass Kisser

  • Members
  • Joined: 14 May 2015
  • United-States

#18

Posted 23 July 2015 - 06:47 AM

Genius!


jedijosh920
  • jedijosh920

    ⭐⭐⭐⭐⭐

  • Members
  • Joined: 01 Mar 2012
  • United-States

#19

Posted 23 July 2015 - 07:38 AM

s7CNjcZ.jpg

 

 

Nice added buttons and working mouse :p

  • EdUaRdO - Brazil and ISOFX like this

GeorgeZhang
  • GeorgeZhang

    I'm New

  • Members
  • Joined: 04 Jul 2015
  • None

#20

Posted 23 July 2015 - 11:57 AM

great,got it working. two questions:how to customize the banner? does it affect performance if i have alot of menus?(does it process all menus at the same time?)

Guad
  • Guad

    Punk-ass Bitch

  • Members
  • Joined: 08 May 2015
  • Spain

#21

Posted 23 July 2015 - 12:35 PM Edited by Guad, 23 July 2015 - 12:35 PM.

great,got it working. two questions:how to customize the banner? does it affect performance if i have alot of menus?(does it process all menus at the same time?)

1. You can set a customize the banner by:

- Set a game sprite to the banner

- Set a solid color rectangle as the banner

- Set an external texture as the banner -- this is currently broken because UI.DrawTexture uses a different coordinate system

You can do all of this using the SetBannerType method.

You can also change the title color/size/position/font by accessing the myMenu.Title property.

2. Only visible menus get processed, so no.


unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#22

Posted 23 July 2015 - 05:03 PM

 

great,got it working. two questions:how to customize the banner? does it affect performance if i have alot of menus?(does it process all menus at the same time?)

1. You can set a customize the banner by:

- Set a game sprite to the banner

- Set a solid color rectangle as the banner

- Set an external texture as the banner -- this is currently broken because UI.DrawTexture uses a different coordinate system

You can do all of this using the SetBannerType method.

You can also change the title color/size/position/font by accessing the myMenu.Title property.

2. Only visible menus get processed, so no.

 

whats up with UI.Textures coordinate system, That one works on x-y integer coordinate system from 1080x720


qiangqiang101
  • qiangqiang101

    I'm Not MentaL

  • Members
  • Joined: 02 Feb 2010
  • Malaysia

#23

Posted 23 July 2015 - 07:34 PM Edited by qiangqiang101, 23 July 2015 - 07:46 PM.

There's a bug: if you press enter on the previous menu, and it will goto new menu. But it also select the item in new menu.

How to fix it??

 

 

In the Video my codes...

 

Public Sub CategoryItemSelectHandler(sender As UIMenu, selectedItem As UIMenuItem, index As Integer)
        Dim nl = Environment.NewLine
        UI.Notify("Name: ~b~" & selectedItem.Text & nl & "~s~Model: ~r~" & selectedItem.Model & nl & "~s~Hash: ~y~" & selectedItem.Hash & nl & "~s~Price: ~g~" & selectedItem.Price)
    End Sub
 
    Public Sub CategoryItemChange(sender As UIMenu, index As Integer)
        Dim nl = Environment.NewLine
        UI.ShowSubtitle("Name: ~b~" & sender.MenuItems(index).Text & nl & "~s~Model: ~r~" & sender.MenuItems(index).Model & nl & "~s~Hash: ~y~" & sender.MenuItems(index).Hash & nl & "~s~Price: ~g~" & sender.MenuItems(index).Price)
    End Sub

ISOFX
  • ISOFX

    Trick

  • Members
  • Joined: 31 May 2015
  • United-Kingdom

#24

Posted 23 July 2015 - 07:50 PM

Hello Guadmaz, 
Error:
'NativeUI.UIMenu.Title.get' must declare a body because it is not marked abstract or extern. Automatically implemented properties must define both get and set accessors.
 
and this was what the error was for
 public UIResText Title { get; }
 
I am new to C# so i dont know much but can you help me? :D

qiangqiang101
  • qiangqiang101

    I'm Not MentaL

  • Members
  • Joined: 02 Feb 2010
  • Malaysia

#25

Posted 23 July 2015 - 07:56 PM

s7CNjcZ.jpg

 

 

Nice added buttons and working mouse :p

Sir, how do you add the "Nearby Pedestrian J", "Back <-" and "Select" on the screen?


Guad
  • Guad

    Punk-ass Bitch

  • Members
  • Joined: 08 May 2015
  • Spain

#26

Posted 23 July 2015 - 09:20 PM

 

There's a bug: if you press enter on the previous menu, and it will goto new menu. But it also select the item in new menu.

How to fix it??

 

 

In the Video my codes...

Public Sub CategoryItemSelectHandler(sender As UIMenu, selectedItem As UIMenuItem, index As Integer)
        Dim nl = Environment.NewLine
        UI.Notify("Name: ~b~" & selectedItem.Text & nl & "~s~Model: ~r~" & selectedItem.Model & nl & "~s~Hash: ~y~" & selectedItem.Hash & nl & "~s~Price: ~g~" & selectedItem.Price)
    End Sub
 
    Public Sub CategoryItemChange(sender As UIMenu, index As Integer)
        Dim nl = Environment.NewLine
        UI.ShowSubtitle("Name: ~b~" & sender.MenuItems(index).Text & nl & "~s~Model: ~r~" & sender.MenuItems(index).Model & nl & "~s~Hash: ~y~" & sender.MenuItems(index).Hash & nl & "~s~Price: ~g~" & sender.MenuItems(index).Price)
    End Sub

 

That has been fixed already, you can grab it off girhub.


 

 

great,got it working. two questions:how to customize the banner? does it affect performance if i have alot of menus?(does it process all menus at the same time?)

1. You can set a customize the banner by:

- Set a game sprite to the banner

- Set a solid color rectangle as the banner

- Set an external texture as the banner -- this is currently broken because UI.DrawTexture uses a different coordinate system

You can do all of this using the SetBannerType method.

You can also change the title color/size/position/font by accessing the myMenu.Title property.

2. Only visible menus get processed, so no.

 

whats up with UI.Textures coordinate system, That one works on x-y integer coordinate system from 1080x720

 

It uses 1080 as base height then calculates the width based on the user's aspect ratio, then converts it to ScriptHookVDotNet's UI coordinate system for drawing.

  • qiangqiang101 likes this

thewhitehammer99
  • thewhitehammer99

    the magical guy

  • Members
  • Joined: 17 Nov 2014
  • Australia

#27

Posted 24 July 2015 - 05:31 AM

Good job mate! Really nice addition for some of the plain menu designs :)

GeorgeZhang
  • GeorgeZhang

    I'm New

  • Members
  • Joined: 04 Jul 2015
  • None

#28

Posted 24 July 2015 - 05:33 AM

I have another question:when using ScriptHookVDotNet UI, we have this to trigger a function:

button.Activated += (sender, args) =>
        {
            UI.Notify("You cannot afford it");
        };

my question is, can I do something similar with the NativeUI, so that i don't have to make every button's function in the "OnItemSelect"?


qiangqiang101
  • qiangqiang101

    I'm Not MentaL

  • Members
  • Joined: 02 Feb 2010
  • Malaysia

#29

Posted 24 July 2015 - 08:35 AM Edited by qiangqiang101, 24 July 2015 - 09:03 AM.

 

 

There's a bug: if you press enter on the previous menu, and it will goto new menu. But it also select the item in new menu.

How to fix it??

 

 

In the Video my codes...

Public Sub CategoryItemSelectHandler(sender As UIMenu, selectedItem As UIMenuItem, index As Integer)
        Dim nl = Environment.NewLine
        UI.Notify("Name: ~b~" & selectedItem.Text & nl & "~s~Model: ~r~" & selectedItem.Model & nl & "~s~Hash: ~y~" & selectedItem.Hash & nl & "~s~Price: ~g~" & selectedItem.Price)
    End Sub
 
    Public Sub CategoryItemChange(sender As UIMenu, index As Integer)
        Dim nl = Environment.NewLine
        UI.ShowSubtitle("Name: ~b~" & sender.MenuItems(index).Text & nl & "~s~Model: ~r~" & sender.MenuItems(index).Model & nl & "~s~Hash: ~y~" & sender.MenuItems(index).Hash & nl & "~s~Price: ~g~" & sender.MenuItems(index).Price)
    End Sub

 

That has been fixed already, you can grab it off girhub.

Sir, another error after update to your latest source code on github

 

Both your example menu and my menu wasn't show while i press the hotkey

 

[17:02:00] [DEBUG] Instantiating script 'PremiumDeluxeMotorsport.NET.pdmcarshop' in script domain 'ScriptDomain_E9FE744' ...
[17:02:00] [DEBUG] Started script 'PremiumDeluxeMotorsport.NET.pdmcarshop'.
[17:02:00] [ERROR] Caught fatal unhandled exception:
System.NullReferenceException: Object reference not set to an instance of an object.
   at NativeUI.MenuPool.<>c.<ProcessControl>b__8_0(UIMenu menu)
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at NativeUI.MenuPool.ProcessControl()
   at NativeUI.MenuPool.ProcessMenus()
   at PremiumDeluxeMotorsport.NET.pdmcarshop.OnTick(Object o, EventArgs e)
   at GTA.Script.raise_Tick(Object value0, EventArgs value1)
   at GTA.Script.MainLoop()

unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#30

Posted 24 July 2015 - 08:41 AM

 

 
There's a bug: if you press enter on the previous menu, and it will goto new menu. But it also select the item in new menu.
How to fix it??
 
https://www.youtube....eature=youtu.be
 
In the Video my codes...

Public Sub CategoryItemSelectHandler(sender As UIMenu, selectedItem As UIMenuItem, index As Integer)
        Dim nl = Environment.NewLine
        UI.Notify("Name: ~b~" & selectedItem.Text & nl & "~s~Model: ~r~" & selectedItem.Model & nl & "~s~Hash: ~y~" & selectedItem.Hash & nl & "~s~Price: ~g~" & selectedItem.Price)
    End Sub
 
    Public Sub CategoryItemChange(sender As UIMenu, index As Integer)
        Dim nl = Environment.NewLine
        UI.ShowSubtitle("Name: ~b~" & sender.MenuItems(index).Text & nl & "~s~Model: ~r~" & sender.MenuItems(index).Model & nl & "~s~Hash: ~y~" & sender.MenuItems(index).Hash & nl & "~s~Price: ~g~" & sender.MenuItems(index).Price)
    End Sub
 
That has been fixed already, you can grab it off girhub.
Sir, another error after update to your latest source code on github
 
System.NullReferenceException: Object reference not set to an instance of an object.
   at NativeUI.MenuPool.<>c.<ProcessControl>b__8_0(UIMenu menu)
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at NativeUI.MenuPool.ProcessControl()
   at NativeUI.MenuPool.ProcessMenus()
   at PremiumDeluxeMotorsport.NET.pdmcarshop.OnTick(Object o, EventArgs e)
   at GTA.Script.raise_Tick(Object value0, EventArgs value1)
   at GTA.Script.MainLoop()
the code causing the error is just as helpful as the error code if not more




10 user(s) are reading this topic

0 members, 10 guests, 0 anonymous users