unknown modder Posted July 28, 2015 Share Posted July 28, 2015 Hello Again, sorry for asking so many questions but can someone help me with this code, it doesnt seem to work. Thanks http://pastebin.com/D7D52tmb Whats not working. It wont compile, it throws an error when you run it - in which case post error logs(scripthookvdotnet), the menu doesnt show, the menu shows but options dont work etc Link to comment Share on other sites More sharing options...
ISOFX Posted July 28, 2015 Share Posted July 28, 2015 Hello Again, sorry for asking so many questions but can someone help me with this code, it doesnt seem to work. Thanks http://pastebin.com/D7D52tmb Whats not working. It wont compile, it throws an error when you run it - in which case post error logs(scripthookvdotnet), the menu doesnt show, the menu shows but options dont work etc Oh no i was so stupid i got the sub menu parts wrong but i got it all working perfectly but now im going to learn how to use check boxes from the example menu. btw @Guad Nice Menu Base! (BEST) Link to comment Share on other sites More sharing options...
frodzet Posted July 29, 2015 Share Posted July 29, 2015 (edited) Suggestion: New feature: when you hover over your screen's edge, the camera will rotate and the cursor will change sprites. should be disabled by default :-) The feature only occurs at a few of GTA's own menus. Edited July 29, 2015 by frodzet Link to comment Share on other sites More sharing options...
Guad Posted July 29, 2015 Author Share Posted July 29, 2015 Suggestion: New feature: when you hover over your screen's edge, the camera will rotate and the cursor will change sprites. should be disabled by default :-) The feature only occurs at a few of GTA's own menus. Well you can disable it yourself if you wish to. Link to comment Share on other sites More sharing options...
frodzet Posted July 29, 2015 Share Posted July 29, 2015 (edited) Suggestion: New feature: when you hover over your screen's edge, the camera will rotate and the cursor will change sprites. should be disabled by default :-) The feature only occurs at a few of GTA's own menus. Well you can disable it yourself if you wish to. Oh, i'm aware of that :-) Just saying being disabled by default would make more sense :-) Nevermind! I just figured it is actually on my default, it's just that the screen turns even when the mouse is hovering an item in the menu (this should not be the case) :-) Edited July 29, 2015 by frodzet Link to comment Share on other sites More sharing options...
frodzet Posted July 29, 2015 Share Posted July 29, 2015 Is it possible to prevent the menu from going back one step when pressing P and instead open the pause menu? :-) I've tried to suppress the key, but can't seem to get it working :-) Thanks :-) Williambob 1 Link to comment Share on other sites More sharing options...
Guad Posted July 29, 2015 Author Share Posted July 29, 2015 Is it possible to prevent the menu from going back one step when pressing P and instead open the pause menu? :-) I've tried to suppress the key, but can't seem to get it working :-) Thanks :-) myMenu.ResetKey(MenuControls.Back); myMenu.SetKey(MenuControls.Back, GTA.Control.PhoneCancel); Williambob 1 Link to comment Share on other sites More sharing options...
frodzet Posted July 30, 2015 Share Posted July 30, 2015 (edited) Is it possible to prevent the menu from going back one step when pressing P and instead open the pause menu? :-) I've tried to suppress the key, but can't seem to get it working :-) Thanks :-) myMenu.ResetKey(MenuControls.Back); myMenu.SetKey(MenuControls.Back, GTA.Control.PhoneCancel); Alright, so is there a way that i can override the Menu so that the pause menu opens on P (or any other keypress for that matter)? :-) Because i want to be able to set a marker on the map while the menu is open so that when i exit the pause menu i'm back at the same place in my menu as before :-) Else i would have to first close the menu, set a marker, then open the menu and go to my TeleportToMarkerButton. Edited July 30, 2015 by frodzet Link to comment Share on other sites More sharing options...
GeorgeZhang Posted July 30, 2015 Share Posted July 30, 2015 (edited) is it possible to make a picture attach to an item (much like how the item descriptions work)? it would be even more amazing EDIT:also, is it possible to add support for "foreach" method to MenuPool? 'cause when i was trying to get all menus in _menupool with "foreach", it says " NativeUI.MenuPool does not contain a public definition for GetEnumerator" Edited July 30, 2015 by GeorgeZhang Link to comment Share on other sites More sharing options...
Guad Posted July 30, 2015 Author Share Posted July 30, 2015 is it possible to make a picture attach to an item (much like how the item descriptions work)? it would be even more amazing EDIT:also, is it possible to add support for "foreach" method to MenuPool? 'cause when i was trying to get all menus in _menupool with "foreach", it says " NativeUI.MenuPool does not contain a public definition for GetEnumerator" For the picture, you can call Sprite.DrawTexture in a loop. And for the menupool use the ToList() method Link to comment Share on other sites More sharing options...
GeorgeZhang Posted July 30, 2015 Share Posted July 30, 2015 is it possible to make a picture attach to an item (much like how the item descriptions work)? it would be even more amazing EDIT:also, is it possible to add support for "foreach" method to MenuPool? 'cause when i was trying to get all menus in _menupool with "foreach", it says " NativeUI.MenuPool does not contain a public definition for GetEnumerator" For the picture, you can call Sprite.DrawTexture in a loop. And for the menupool use the ToList() method ok thanks. btw, i am still having trouble changing controls, like i cannot set control keys to numpad keys, i use this code: mainmenu.ResetKey(UIMenu.MenuControls.Up);mainmenu.SetKey(UIMenu.MenuControls.Up, Keys.NumPad8); please help Link to comment Share on other sites More sharing options...
Guad Posted July 30, 2015 Author Share Posted July 30, 2015 is it possible to make a picture attach to an item (much like how the item descriptions work)? it would be even more amazing EDIT:also, is it possible to add support for "foreach" method to MenuPool? 'cause when i was trying to get all menus in _menupool with "foreach", it says " NativeUI.MenuPool does not contain a public definition for GetEnumerator" For the picture, you can call Sprite.DrawTexture in a loop. And for the menupool use the ToList() method ok thanks. btw, i am still having trouble changing controls, like i cannot set control keys to numpad keys, i use this code: mainmenu.ResetKey(UIMenu.MenuControls.Up);mainmenu.SetKey(UIMenu.MenuControls.Up, Keys.NumPad8); please help If you're using Keys, you need to have a menuPool.ProcessKey(key.KeyCode) in your OnKeyDown event Link to comment Share on other sites More sharing options...
alex8b Posted July 31, 2015 Share Posted July 31, 2015 Bug: If an item in the list is double then there are problems with displaying 0.0 and 0.1 (-0.1). It shows something like E323483480984092238489023+32423423423 Link to comment Share on other sites More sharing options...
frodzet Posted July 31, 2015 Share Posted July 31, 2015 Bug: If an item in the list is double then there are problems with displaying 0.0 and 0.1 (-0.1). It shows something like E323483480984092238489023+32423423423 It's something on your side, not something related to NativeUI. As you can see in the picture below, lists accepts double values: Link to comment Share on other sites More sharing options...
alex8b Posted July 31, 2015 Share Posted July 31, 2015 Bug: If an item in the list is double then there are problems with displaying 0.0 and 0.1 (-0.1). It shows something like E323483480984092238489023+32423423423 It's something on your side, not something related to NativeUI. As you can see in the picture below, lists accepts double values: It's because of the way I generate the list. I iterate and add 0.1. But it should apply rounding when displays it anyway... Link to comment Share on other sites More sharing options...
frodzet Posted July 31, 2015 Share Posted July 31, 2015 Bug: If an item in the list is double then there are problems with displaying 0.0 and 0.1 (-0.1). It shows something like E323483480984092238489023+32423423423 It's something on your side, not something related to NativeUI. As you can see in the picture below, lists accepts double values: It's because of the way I generate the list. I iterate and add 0.1. But it should apply rounding when displays it anyway... You're sure you are iterating using the right type? :-) Link to comment Share on other sites More sharing options...
GeorgeZhang Posted July 31, 2015 Share Posted July 31, 2015 (edited) ok i have another problem; when i set my own key, the menu will process the key multiple times, for instance i have four layers of menu and when i select the item in mainmenu it jumped straight to 4th. menu... tested, only happens when i set my own key, thanks for all your help! EDIT: how to i set a "game sprite" to the banner? also is there a way to make the menu only takes keyboard commands but not mouse buttons? Edited August 1, 2015 by GeorgeZhang Link to comment Share on other sites More sharing options...
Guad Posted July 31, 2015 Author Share Posted July 31, 2015 (edited) Bug: If an item in the list is double then there are problems with displaying 0.0 and 0.1 (-0.1). It shows something like E323483480984092238489023+32423423423 It's something on your side, not something related to NativeUI. As you can see in the picture below, lists accepts double values: It's because of the way I generate the list. I iterate and add 0.1. But it should apply rounding when displays it anyway... The list just calls the ToString method of your dynamic item. You can do it yourself by rounding it, calling ToString and then add it to the list. Edited July 31, 2015 by Guad Link to comment Share on other sites More sharing options...
frodzet Posted July 31, 2015 Share Posted July 31, 2015 Can i ask why OnItemSelect has an index identifier while OnCheckChange does not? :-) Link to comment Share on other sites More sharing options...
ardaozkal Posted August 2, 2015 Share Posted August 2, 2015 Looks awesome! Will take a while to recode ~6000 lines of code with this, but that's what the community wants http://strawpoll.me/5094464/r Link to comment Share on other sites More sharing options...
ISOFX Posted August 2, 2015 Share Posted August 2, 2015 Recreated my Particle Effects menu on the menu base, Thanks for this credited for this as well. https://www.gta5-mods.com/scripts/particle-effects-net(Waiting Approval Atm) Link to comment Share on other sites More sharing options...
Guad Posted August 2, 2015 Author Share Posted August 2, 2015 Can i ask why OnItemSelect has an index identifier while OnCheckChange does not? :-) Dunno, but you can always access your checkbox item's Parent property, which returns the menu, and then access CurrentSelection. Link to comment Share on other sites More sharing options...
frodzet Posted August 2, 2015 Share Posted August 2, 2015 Can i ask why OnItemSelect has an index identifier while OnCheckChange does not? :-) Dunno, but you can always access your checkbox item's Parent property, which returns the menu, and then access CurrentSelection. Yeah, i figured :-) Just wondering why the behavior of those two events are working differently :-) Link to comment Share on other sites More sharing options...
GeorgeZhang Posted August 3, 2015 Share Posted August 3, 2015 (edited) ok i have another problem; when i set my own key, the menu will process the key multiple times, for instance i have four layers of menu and when i select the item in mainmenu it jumped straight to 4th. menu... tested, only happens when i set my own key, thanks for all your help! EDIT: how to i set a "game sprite" to the banner? also is there a way to make the menu only takes keyboard commands but not mouse buttons? please help me EDIT: ok i figured out how to fix the key: if (e.KeyCode == Keys.F9) _pool.ProcessKey(Keys.F9); but still, how to set the banner to game sprite?? Edited August 3, 2015 by GeorgeZhang Link to comment Share on other sites More sharing options...
Guad Posted August 3, 2015 Author Share Posted August 3, 2015 ok i have another problem; when i set my own key, the menu will process the key multiple times, for instance i have four layers of menu and when i select the item in mainmenu it jumped straight to 4th. menu... tested, only happens when i set my own key, thanks for all your help! EDIT: how to i set a "game sprite" to the banner? also is there a way to make the menu only takes keyboard commands but not mouse buttons? please help me EDIT: ok i figured out how to fix the key: if (e.KeyCode == Keys.F9) _pool.ProcessKey(Keys.F9); but still, how to set the banner to game sprite?? myMenu.SetBannerType(new Sprite("yourSpriteLibrary", "yourSpriteName", new Point(0,0), new Size(0,0)); also you should have set it to _pool.ProcessKey(e.KeyCode); at the beginning of your OnKeyDown event handler Link to comment Share on other sites More sharing options...
GTA Imperium Posted August 6, 2015 Share Posted August 6, 2015 Would awesome to have this base in C++. Link to comment Share on other sites More sharing options...
GeorgeZhang Posted August 7, 2015 Share Posted August 7, 2015 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? Link to comment Share on other sites More sharing options...
Guad Posted August 7, 2015 Author Share Posted August 7, 2015 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. Link to comment Share on other sites More sharing options...
GeorgeZhang Posted August 8, 2015 Share Posted August 8, 2015 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? Link to comment Share on other sites More sharing options...
dehan Posted August 8, 2015 Share Posted August 8, 2015 Any way to disable backspace/right click making the menu close, Guad? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now