Guad Posted September 13, 2015 Author Share Posted September 13, 2015 Hello, How do i change the menu background, and the highlighter when your on the option. Thank You You can't Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1067975682 Share on other sites More sharing options...
dreddfoxx Posted September 14, 2015 Share Posted September 14, 2015 How do you compile the (NativeUI) assembly? Last night I was able to compile the debug version, but not the release. This morning I went to compare the setting (debug/release) and now neither will compile. Many compiling errors. Error 1 ; expected C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs 1264 46 NativeUIError 2 Invalid token '(' in class, struct, or interface member declaration C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs 1264 69 NativeUIError 3 Invalid token ',' in class, struct, or interface member declaration C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs 1264 97 NativeUIError 4 ; expected C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs 1270 25 NativeUIError 5 Invalid token ';' in class, struct, or interface member declaration C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs 1270 43 NativeUIError 6 Invalid token '=' in class, struct, or interface member declaration C:\Users\Josh\Documents\GitHub\NativeUI\UIResText.cs 33 46 NativeUIError 7 Invalid token '=' in class, struct, or interface member declaration C:\Users\Josh\Documents\GitHub\NativeUI\UIResText.cs 34 43 NativeUIError 8 Invalid expression term '.' C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs 459 35 NativeUI That's is just the first eight (out of 40). Thanks. Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1067977326 Share on other sites More sharing options...
Guad Posted September 15, 2015 Author Share Posted September 15, 2015 How do you compile the (NativeUI) assembly? Last night I was able to compile the debug version, but not the release. This morning I went to compare the setting (debug/release) and now neither will compile. Many compiling errors. Error 1 ; expected C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs 1264 46 NativeUIError 2 Invalid token '(' in class, struct, or interface member declaration C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs 1264 69 NativeUIError 3 Invalid token ',' in class, struct, or interface member declaration C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs 1264 97 NativeUIError 4 ; expected C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs 1270 25 NativeUIError 5 Invalid token ';' in class, struct, or interface member declaration C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs 1270 43 NativeUIError 6 Invalid token '=' in class, struct, or interface member declaration C:\Users\Josh\Documents\GitHub\NativeUI\UIResText.cs 33 46 NativeUIError 7 Invalid token '=' in class, struct, or interface member declaration C:\Users\Josh\Documents\GitHub\NativeUI\UIResText.cs 34 43 NativeUIError 8 Invalid expression term '.' C:\Users\Josh\Documents\GitHub\NativeUI\UIMenu.cs 459 35 NativeUI That's is just the first eight (out of 40). Thanks. You need Visual Studio 2015 Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1067979815 Share on other sites More sharing options...
dreddfoxx Posted September 15, 2015 Share Posted September 15, 2015 You need Visual Studio 2015 Ah, i see, new language features.Okay, thank you. I'm guessing that this OnMenuClose?.Invoke(this) is equivenlent to: if (OnMenuClose != null) OnMenuClose(this); Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1067980197 Share on other sites More sharing options...
unknown modder Posted September 16, 2015 Share Posted September 16, 2015 When the new update for ScriptHookV comes out, opening any menu without disabling instructional buttons will cause your game to crash instantly. This is a bug with ScriptHookVdotnet that for some reason didnt crash the game on previous versions. Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1067985536 Share on other sites More sharing options...
nexus99 Posted September 16, 2015 Share Posted September 16, 2015 When the new update for ScriptHookV comes out, opening any menu without disabling instructional buttons will cause your game to crash instantly. This is a bug with ScriptHookVdotnet that for some reason didnt crash the game on previous versions. It was causing crash also in previous version. https://github.com/Guad/NativeUI/issues/13 Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1067986361 Share on other sites More sharing options...
unknown modder Posted September 16, 2015 Share Posted September 16, 2015 When the new update for ScriptHookV comes out, opening any menu without disabling instructional buttons will cause your game to crash instantly. This is a bug with ScriptHookVdotnet that for some reason didnt crash the game on previous versions. It was causing crash also in previous version. https://github.com/Guad/NativeUI/issues/13 Strange, It only started to cause a crash for me when I updated to 463.1 Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1067986427 Share on other sites More sharing options...
Guad Posted September 16, 2015 Author Share Posted September 16, 2015 When the new update for ScriptHookV comes out, opening any menu without disabling instructional buttons will cause your game to crash instantly. This is a bug with ScriptHookVdotnet that for some reason didnt crash the game on previous versions. It was causing crash also in previous version. https://github.com/Guad/NativeUI/issues/13 Strange, It only started to cause a crash for me when I updated to 463.1 This should be fixed now. Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1067986549 Share on other sites More sharing options...
nordi Posted October 18, 2015 Share Posted October 18, 2015 Hey everyone, I've been using scripthookvdotnet menus so far, but I decided to use NativeUI from now on, but I can't get my menus to work: nothing appear on my screen... Here is my code: //Global variables:private UIMenu mainMenu; private UIMenu activeMenu2; private UIMenuCheckboxItem CalloutsCheckBox; private UIMenuItem button; private MenuPool _menuPool = new MenuPool();//Here is my keydown function:if (e.KeyCode == KeyMenu) { if (Mod_ON == true) { if (TabMenu == false) { TabMenu = true; Menu = true; mainMenu.Visible = true; mainMenu.ProcessKey(KeyMenu); GeneralMenu(); } } else { UI.ShowSubtitle("You must launch the mod first. ", 5000); } }//Here is the tick where I display the menu: private void infotick(Object myObject, EventArgs myEventArgs) { if(Menu == true) { _menuPool.ProcessMenus(); } }//And Here is my menu function:public void GeneralMenu() { var myMenu = new UIMenu("Choose an action", "Choose an action"); myMenu.AddItem(CalloutsCheckBox = new UIMenuCheckboxItem("Callouts", calls == true ? true : false, "Enable / Disable calls")); CalloutsCheckBox.CheckboxEvent += (sender, args) => this.DisableCall(); myMenu.AddItem(button = new UIMenuItem("Backup menu", "Call for Backup")); button.Activated += (sender, args) => this.BackupMenu(); myMenu.RefreshIndex(); _menuPool.Add(myMenu); } Thanks for the help ! Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068078604 Share on other sites More sharing options...
Guad Posted October 18, 2015 Author Share Posted October 18, 2015 Hey everyone, I've been using scripthookvdotnet menus so far, but I decided to use NativeUI from now on, but I can't get my menus to work: nothing appear on my screen... Here is my code: //Global variables:private UIMenu mainMenu; private UIMenu activeMenu2; private UIMenuCheckboxItem CalloutsCheckBox; private UIMenuItem button; private MenuPool _menuPool = new MenuPool();//Here is my keydown function:if (e.KeyCode == KeyMenu) { if (Mod_ON == true) { if (TabMenu == false) { TabMenu = true; Menu = true; mainMenu.Visible = true; mainMenu.ProcessKey(KeyMenu); GeneralMenu(); } } else { UI.ShowSubtitle("You must launch the mod first. ", 5000); } }//Here is the tick where I display the menu: private void infotick(Object myObject, EventArgs myEventArgs) { if(Menu == true) { _menuPool.ProcessMenus(); } }//And Here is my menu function:public void GeneralMenu() { var myMenu = new UIMenu("Choose an action", "Choose an action"); myMenu.AddItem(CalloutsCheckBox = new UIMenuCheckboxItem("Callouts", calls == true ? true : false, "Enable / Disable calls")); CalloutsCheckBox.CheckboxEvent += (sender, args) => this.DisableCall(); myMenu.AddItem(button = new UIMenuItem("Backup menu", "Call for Backup")); button.Activated += (sender, args) => this.BackupMenu(); myMenu.RefreshIndex(); _menuPool.Add(myMenu); } Thanks for the help ! Try removing the if(Menu == true) before ProcessMenus()? Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068079677 Share on other sites More sharing options...
xdidx Posted October 19, 2015 Share Posted October 19, 2015 Hi ! First, thx for your job ! I just tried to use menus in my script but it's always flashing (when it's open, 3 or 4 times per sec) Did I miss something? _menuPool = new MenuPool();var mainMenu = new UIMenu("Native UI", "~b~NATIVEUI SHOWCASE");_menuPool.Add(mainMenu);mainMenu.AddItem(new UIMenuItem("Simple Button"));mainMenu.RefreshIndex();Tick += (o, e) => _menuPool.ProcessMenus();KeyDown += (o, e) =>{ if (e.KeyCode == Keys.F5 && !_menuPool.IsAnyMenuOpen()) // Our menu on/off switch mainMenu.Visible = !mainMenu.Visible;}; Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068083080 Share on other sites More sharing options...
Guad Posted October 20, 2015 Author Share Posted October 20, 2015 Hi ! First, thx for your job ! I just tried to use menus in my script but it's always flashing (when it's open, 3 or 4 times per sec) Did I miss something? _menuPool = new MenuPool();var mainMenu = new UIMenu("Native UI", "~b~NATIVEUI SHOWCASE");_menuPool.Add(mainMenu);mainMenu.AddItem(new UIMenuItem("Simple Button"));mainMenu.RefreshIndex();Tick += (o, e) => _menuPool.ProcessMenus();KeyDown += (o, e) =>{ if (e.KeyCode == Keys.F5 && !_menuPool.IsAnyMenuOpen()) // Our menu on/off switch mainMenu.Visible = !mainMenu.Visible;}; What FPS are you getting? Do other mod's menus work fine? Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068087077 Share on other sites More sharing options...
ZZCOOL Posted October 21, 2015 Share Posted October 21, 2015 now time to wait for all these mods to be updated for the new patch Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068092405 Share on other sites More sharing options...
xdidx Posted October 22, 2015 Share Posted October 22, 2015 What FPS are you getting? Do other mod's menus work fine? Sorry for reply time, Other mods worked perfectly, I tested several things and it just was the Script.Interval property... Knowing it, I found this... : http://gtaforums.com/topic/805655-c-qtriggering-menu-when-in-distance/?p=1067697944 I just have to remove it from constructor. Anyway, thank you for your help Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068096479 Share on other sites More sharing options...
jaky2008 Posted November 8, 2015 Share Posted November 8, 2015 (edited) Hey, I've used many templates for the NativeUI menu's and none of them display at all. Is it because i'm making a mod with two classes? One for the actual events in game and the other for the NativeUI menu? I just don't understand why even the templates don't work for me, even if I do mix the two together as one class nothing happens; it completely makes it as though I didn't have a mod. I made the most stupid mistake; I didn't add the NativeUI to my actual scripts folder in GTA. Now it works it just kills my frames. Sorry for this post! Edited November 8, 2015 by jaky2008 Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068159040 Share on other sites More sharing options...
TheCoon Posted November 29, 2015 Share Posted November 29, 2015 I found a Bug playing with NativeUI. If you play with NativeUI Franklins Mansion is very buggy. You cant use the Bong or the Whine Bar anymore. You cant even seen this Items anymoreThere are no more real Windows ins his Bedroom also. The Clothes on his Bed and in his closet are away too.Am I the only one with this Bug? If i delete the NativeUI file, it works perfekt again? Help anyone? Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068210199 Share on other sites More sharing options...
nikita488 Posted December 25, 2015 Share Posted December 25, 2015 (edited) Hi! How to add text to the right of the UIMenuItem? I want to add money count to the right UPD: Guad answered on Github. Use this: item.SetRightLabel(string text); Edited December 26, 2015 by nikita488 Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068308448 Share on other sites More sharing options...
GeorgeZhang Posted January 9, 2016 Share Posted January 9, 2016 Is it possible to modify a UIMenuListItem in an UIMenu which has been loaded but not visible? I wish to update the list in background while another menu is visible. Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068371173 Share on other sites More sharing options...
AndrewEiland Posted January 24, 2016 Share Posted January 24, 2016 Iam very new in creating mods for GTA V and i cant find the error.. If i hit F5 ingame it doesnt show the menu using System;using System.Collections.Generic;//using System.Linq;using System.Text;using GTA;using GTA.Native;using System.Windows.Forms;using NativeUI;namespace GTAVMOD{ class My_Mod : Script { MenuPool _myMenuPool = new MenuPool(); UIMenu myMenu = new UIMenu("Test", "~b~TEST"); public My_Mod() { this.Tick += onTick; this.KeyUp += onKeyUp; this.KeyDown += onKeyDown; myMenu.AddItem(new UIMenuItem("Simple Button")); myMenu.RefreshIndex(); _myMenuPool.Add(myMenu); } private void onTick(object sender, EventArgs e) { _myMenuPool.ProcessMenus(); } private void onKeyDown(object sender, KeyEventArgs e) { } private void onKeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F5 && !_myMenuPool.IsAnyMenuOpen()) { myMenu.Visible = !myMenu.Visible; } } }} Hope anyone can help me Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068423262 Share on other sites More sharing options...
Guad Posted January 24, 2016 Author Share Posted January 24, 2016 Iam very new in creating mods for GTA V and i cant find the error.. If i hit F5 ingame it doesnt show the menu using System;using System.Collections.Generic;//using System.Linq;using System.Text;using GTA;using GTA.Native;using System.Windows.Forms;using NativeUI;namespace GTAVMOD{ class My_Mod : Script { MenuPool _myMenuPool = new MenuPool(); UIMenu myMenu = new UIMenu("Test", "~b~TEST"); public My_Mod() { this.Tick += onTick; this.KeyUp += onKeyUp; this.KeyDown += onKeyDown; myMenu.AddItem(new UIMenuItem("Simple Button")); myMenu.RefreshIndex(); _myMenuPool.Add(myMenu); } private void onTick(object sender, EventArgs e) { _myMenuPool.ProcessMenus(); } private void onKeyDown(object sender, KeyEventArgs e) { } private void onKeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F5 && !_myMenuPool.IsAnyMenuOpen()) { myMenu.Visible = !myMenu.Visible; } } }} Hope anyone can help me Post your ScriptHookVDotNet.log Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068423413 Share on other sites More sharing options...
AndrewEiland Posted January 24, 2016 Share Posted January 24, 2016 (edited) Iam very new in creating mods for GTA V and i cant find the error.. If i hit F5 ingame it doesnt show the menu using System;using System.Collections.Generic;//using System.Linq;using System.Text;using GTA;using GTA.Native;using System.Windows.Forms;using NativeUI;namespace GTAVMOD{ class My_Mod : Script { MenuPool _myMenuPool = new MenuPool(); UIMenu myMenu = new UIMenu("Test", "~b~TEST"); public My_Mod() { this.Tick += onTick; this.KeyUp += onKeyUp; this.KeyDown += onKeyDown; myMenu.AddItem(new UIMenuItem("Simple Button")); myMenu.RefreshIndex(); _myMenuPool.Add(myMenu); } private void onTick(object sender, EventArgs e) { _myMenuPool.ProcessMenus(); } private void onKeyDown(object sender, KeyEventArgs e) { } private void onKeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F5 && !_myMenuPool.IsAnyMenuOpen()) { myMenu.Visible = !myMenu.Visible; } } }} Hope anyone can help me Post your ScriptHookVDotNet.log Thats weird... There is no log file in my GTA dir But i tested my first mod where i spawned a car and this works, but with the NativeUI nothing works Edited January 24, 2016 by AndrewEiland Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068423446 Share on other sites More sharing options...
Guad Posted January 24, 2016 Author Share Posted January 24, 2016 Iam very new in creating mods for GTA V and i cant find the error.. If i hit F5 ingame it doesnt show the menu using System;using System.Collections.Generic;//using System.Linq;using System.Text;using GTA;using GTA.Native;using System.Windows.Forms;using NativeUI;namespace GTAVMOD{ class My_Mod : Script { MenuPool _myMenuPool = new MenuPool(); UIMenu myMenu = new UIMenu("Test", "~b~TEST"); public My_Mod() { this.Tick += onTick; this.KeyUp += onKeyUp; this.KeyDown += onKeyDown; myMenu.AddItem(new UIMenuItem("Simple Button")); myMenu.RefreshIndex(); _myMenuPool.Add(myMenu); } private void onTick(object sender, EventArgs e) { _myMenuPool.ProcessMenus(); } private void onKeyDown(object sender, KeyEventArgs e) { } private void onKeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F5 && !_myMenuPool.IsAnyMenuOpen()) { myMenu.Visible = !myMenu.Visible; } } }} Hope anyone can help me Post your ScriptHookVDotNet.log Thats weird... There is no log file in my GTA dir But i tested my first mod where i spawned a car and this works, but with the NativeUI nothing works Your first mod should have generated a ScriptHookVDotNet.log file. Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068423457 Share on other sites More sharing options...
AndrewEiland Posted January 24, 2016 Share Posted January 24, 2016 @Guad i know but it doesnt create any log file Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068423484 Share on other sites More sharing options...
gtaisded Posted January 27, 2016 Share Posted January 27, 2016 Hey Guad awesome work. I just downloaded and was trying out the menu and options. But when i open the menu my fps drops to 30 for like 1 second and if i hit F8 over and over the menu just keeps opening more menus.Also when i go into my submenu fps drops again and sometimes when i go past the 10th item in a submenu fps drops again or if i jump to the last item in the sub menu. Is there anyway to fix this? My code. public class Main : Script { private MenuPool _menuPool; private UIMenu mainMenu; private UIMenu SubMenuSM; private bool Godmode = false; public Main() { KeyUp += OnKeyUp; Tick += OnTick; _menuPool = new MenuPool(); } private void OnKeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F8) // Change keys here. { this.StartUpMenu(); } } private void OnTick(object sender, EventArgs e) { _menuPool.ProcessMenus(); } private UIMenu StartUpMenu() { mainMenu = new UIMenu("TEST", "~b~Main Menu"); _menuPool.Add(mainMenu); //SubMenu UIMenuItem MenuuiMenuItem = new UIMenuItem("Menu 1"); mainMenu.AddItem(MenuuiMenuItem); mainMenu.BindMenuToItem(SubMenu(), MenuuiMenuItem); mainMenu.Visible = !mainMenu.Visible; return mainMenu; } private UIMenu SubMenu() { SubMenuSM = new UIMenu("Sub Menu", "~b~TEST: Sub Menu"); _menuPool.Add(SubMenuSM); //CheckBox var godmode = new UIMenuCheckboxItem("Godmode", Godmode, "Toggle Godmode On/Off."); SubMenuSM.AddItem(godmode); SubMenuSM.OnCheckboxChange += (sender, item, checked_) => { if (item == godmode) { switch (checked_) { case true: Godmode = true; Game.Player.Character.IsInvincible = true; break; case false: Godmode = false; Game.Player.Character.IsInvincible = false; break; } Godmode = checked_; UI.Notify("~r~Godmode status: ~b~" + Godmode); } }; //Button var FixPlayer = new UIMenuItem("Fix Player", "Fix's Player."); SubMenuSM.AddItem(FixPlayer); SubMenuSM.OnItemSelect += (sender, item, index) => { if (item == FixPlayer) { UI.Notify("~g~Player Fixed!"); } }; //List View var WantedLevels = new List<dynamic> { 0, 1, 2, 3, 4, 5, }; var wantedLevel = new UIMenuListItem("Wanted Level", WantedLevels, 0); SubMenuSM.AddItem(wantedLevel); SubMenuSM.OnListChange += (sender, item, index) => { if (item == wantedLevel) { switch (index) { case 1: Game.Player.WantedLevel = 1; break; case 2: Game.Player.WantedLevel = 2; break; case 3: Game.Player.WantedLevel = 3; break; case 4: Game.Player.WantedLevel = 4; break; case 5: Game.Player.WantedLevel = 5; break; default: Game.Player.WantedLevel = 0; break; } } }; //Filler var lulz = new UIMenuItem("lulz", "lulz Player."); for (int i = 0; i < 10; i++) SubMenuSM.AddItem(new UIMenuItem("PageFiller", "Sample description that takes more than one line. Moreso, it takes way more than two lines since it's so long. Wow, check out this length!")); SubMenuSM.RefreshIndex(); return SubMenuSM; } Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068435279 Share on other sites More sharing options...
gtaisded Posted January 27, 2016 Share Posted January 27, 2016 @Guad i know but it doesnt create any log file Make sure you have ScriptHookV.dll,dinput8.dll,ScriptHookVDotNet.dll,ScriptHookVDotNet.asi all installed in your gta v directory and that you have put NativeUI.dll and yourmodname.dll in your scripts folder in you gta v directory. Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068435396 Share on other sites More sharing options...
Guad Posted January 28, 2016 Author Share Posted January 28, 2016 Hey Guad awesome work. I just downloaded and was trying out the menu and options. But when i open the menu my fps drops to 30 for like 1 second and if i hit F8 over and over the menu just keeps opening more menus.Also when i go into my submenu fps drops again and sometimes when i go past the 10th item in a submenu fps drops again or if i jump to the last item in the sub menu. Is there anyway to fix this? My code. public class Main : Script { private MenuPool _menuPool; private UIMenu mainMenu; private UIMenu SubMenuSM; private bool Godmode = false; public Main() { KeyUp += OnKeyUp; Tick += OnTick; _menuPool = new MenuPool(); } private void OnKeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F8) // Change keys here. { this.StartUpMenu(); } } private void OnTick(object sender, EventArgs e) { _menuPool.ProcessMenus(); } private UIMenu StartUpMenu() { mainMenu = new UIMenu("TEST", "~b~Main Menu"); _menuPool.Add(mainMenu); //SubMenu UIMenuItem MenuuiMenuItem = new UIMenuItem("Menu 1"); mainMenu.AddItem(MenuuiMenuItem); mainMenu.BindMenuToItem(SubMenu(), MenuuiMenuItem); mainMenu.Visible = !mainMenu.Visible; return mainMenu; } private UIMenu SubMenu() { SubMenuSM = new UIMenu("Sub Menu", "~b~TEST: Sub Menu"); _menuPool.Add(SubMenuSM); //CheckBox var godmode = new UIMenuCheckboxItem("Godmode", Godmode, "Toggle Godmode On/Off."); SubMenuSM.AddItem(godmode); SubMenuSM.OnCheckboxChange += (sender, item, checked_) => { if (item == godmode) { switch (checked_) { case true: Godmode = true; Game.Player.Character.IsInvincible = true; break; case false: Godmode = false; Game.Player.Character.IsInvincible = false; break; } Godmode = checked_; UI.Notify("~r~Godmode status: ~b~" + Godmode); } }; //Button var FixPlayer = new UIMenuItem("Fix Player", "Fix's Player."); SubMenuSM.AddItem(FixPlayer); SubMenuSM.OnItemSelect += (sender, item, index) => { if (item == FixPlayer) { UI.Notify("~g~Player Fixed!"); } }; //List View var WantedLevels = new List<dynamic> { 0, 1, 2, 3, 4, 5, }; var wantedLevel = new UIMenuListItem("Wanted Level", WantedLevels, 0); SubMenuSM.AddItem(wantedLevel); SubMenuSM.OnListChange += (sender, item, index) => { if (item == wantedLevel) { switch (index) { case 1: Game.Player.WantedLevel = 1; break; case 2: Game.Player.WantedLevel = 2; break; case 3: Game.Player.WantedLevel = 3; break; case 4: Game.Player.WantedLevel = 4; break; case 5: Game.Player.WantedLevel = 5; break; default: Game.Player.WantedLevel = 0; break; } } }; //Filler var lulz = new UIMenuItem("lulz", "lulz Player."); for (int i = 0; i < 10; i++) SubMenuSM.AddItem(new UIMenuItem("PageFiller", "Sample description that takes more than one line. Moreso, it takes way more than two lines since it's so long. Wow, check out this length!")); SubMenuSM.RefreshIndex(); return SubMenuSM; } You are creating a new menu every time you press F8, don't do that. Create the menu on start and flip the Visible property on your existing menu when you press F8. Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068440115 Share on other sites More sharing options...
GeorgeZhang Posted January 29, 2016 Share Posted January 29, 2016 Hello, I encountered an issue: when my Game run in Windowed mode, the custom sprite's offset gets out of place. I use SetBannerType method, and I didn't set the offset manually. Works fine in Fullscreen mode however. Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068441103 Share on other sites More sharing options...
Guad Posted January 29, 2016 Author Share Posted January 29, 2016 Version 1.6 has been released! New features include timer bars, pause menu & an easy way to show those multiplayer big messages. Check out the wiki on how to do it: https://github.com/Guad/NativeUI/wiki Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068444655 Share on other sites More sharing options...
gtaisded Posted January 30, 2016 Share Posted January 30, 2016 Hey Guad awesome work. I just downloaded and was trying out the menu and options. But when i open the menu my fps drops to 30 for like 1 second and if i hit F8 over and over the menu just keeps opening more menus.Also when i go into my submenu fps drops again and sometimes when i go past the 10th item in a submenu fps drops again or if i jump to the last item in the sub menu. Is there anyway to fix this? My code. public class Main : Script { private MenuPool _menuPool; private UIMenu mainMenu; private UIMenu SubMenuSM; private bool Godmode = false; public Main() { KeyUp += OnKeyUp; Tick += OnTick; _menuPool = new MenuPool(); } private void OnKeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F8) // Change keys here. { this.StartUpMenu(); } } private void OnTick(object sender, EventArgs e) { _menuPool.ProcessMenus(); } private UIMenu StartUpMenu() { mainMenu = new UIMenu("TEST", "~b~Main Menu"); _menuPool.Add(mainMenu); //SubMenu UIMenuItem MenuuiMenuItem = new UIMenuItem("Menu 1"); mainMenu.AddItem(MenuuiMenuItem); mainMenu.BindMenuToItem(SubMenu(), MenuuiMenuItem); mainMenu.Visible = !mainMenu.Visible; return mainMenu; } private UIMenu SubMenu() { SubMenuSM = new UIMenu("Sub Menu", "~b~TEST: Sub Menu"); _menuPool.Add(SubMenuSM); //CheckBox var godmode = new UIMenuCheckboxItem("Godmode", Godmode, "Toggle Godmode On/Off."); SubMenuSM.AddItem(godmode); SubMenuSM.OnCheckboxChange += (sender, item, checked_) => { if (item == godmode) { switch (checked_) { case true: Godmode = true; Game.Player.Character.IsInvincible = true; break; case false: Godmode = false; Game.Player.Character.IsInvincible = false; break; } Godmode = checked_; UI.Notify("~r~Godmode status: ~b~" + Godmode); } }; //Button var FixPlayer = new UIMenuItem("Fix Player", "Fix's Player."); SubMenuSM.AddItem(FixPlayer); SubMenuSM.OnItemSelect += (sender, item, index) => { if (item == FixPlayer) { UI.Notify("~g~Player Fixed!"); } }; //List View var WantedLevels = new List<dynamic> { 0, 1, 2, 3, 4, 5, }; var wantedLevel = new UIMenuListItem("Wanted Level", WantedLevels, 0); SubMenuSM.AddItem(wantedLevel); SubMenuSM.OnListChange += (sender, item, index) => { if (item == wantedLevel) { switch (index) { case 1: Game.Player.WantedLevel = 1; break; case 2: Game.Player.WantedLevel = 2; break; case 3: Game.Player.WantedLevel = 3; break; case 4: Game.Player.WantedLevel = 4; break; case 5: Game.Player.WantedLevel = 5; break; default: Game.Player.WantedLevel = 0; break; } } }; //Filler var lulz = new UIMenuItem("lulz", "lulz Player."); for (int i = 0; i < 10; i++) SubMenuSM.AddItem(new UIMenuItem("PageFiller", "Sample description that takes more than one line. Moreso, it takes way more than two lines since it's so long. Wow, check out this length!")); SubMenuSM.RefreshIndex(); return SubMenuSM; } You are creating a new menu every time you press F8, don't do that. Create the menu on start and flip the Visible property on your existing menu when you press F8. Got it! Thanks for the help. Is your a way i can PM you? Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068445535 Share on other sites More sharing options...
Guad Posted January 30, 2016 Author Share Posted January 30, 2016 Hey Guad awesome work. I just downloaded and was trying out the menu and options. But when i open the menu my fps drops to 30 for like 1 second and if i hit F8 over and over the menu just keeps opening more menus.Also when i go into my submenu fps drops again and sometimes when i go past the 10th item in a submenu fps drops again or if i jump to the last item in the sub menu. Is there anyway to fix this? My code. public class Main : Script { private MenuPool _menuPool; private UIMenu mainMenu; private UIMenu SubMenuSM; private bool Godmode = false; public Main() { KeyUp += OnKeyUp; Tick += OnTick; _menuPool = new MenuPool(); } private void OnKeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F8) // Change keys here. { this.StartUpMenu(); } } private void OnTick(object sender, EventArgs e) { _menuPool.ProcessMenus(); } private UIMenu StartUpMenu() { mainMenu = new UIMenu("TEST", "~b~Main Menu"); _menuPool.Add(mainMenu); //SubMenu UIMenuItem MenuuiMenuItem = new UIMenuItem("Menu 1"); mainMenu.AddItem(MenuuiMenuItem); mainMenu.BindMenuToItem(SubMenu(), MenuuiMenuItem); mainMenu.Visible = !mainMenu.Visible; return mainMenu; } private UIMenu SubMenu() { SubMenuSM = new UIMenu("Sub Menu", "~b~TEST: Sub Menu"); _menuPool.Add(SubMenuSM); //CheckBox var godmode = new UIMenuCheckboxItem("Godmode", Godmode, "Toggle Godmode On/Off."); SubMenuSM.AddItem(godmode); SubMenuSM.OnCheckboxChange += (sender, item, checked_) => { if (item == godmode) { switch (checked_) { case true: Godmode = true; Game.Player.Character.IsInvincible = true; break; case false: Godmode = false; Game.Player.Character.IsInvincible = false; break; } Godmode = checked_; UI.Notify("~r~Godmode status: ~b~" + Godmode); } }; //Button var FixPlayer = new UIMenuItem("Fix Player", "Fix's Player."); SubMenuSM.AddItem(FixPlayer); SubMenuSM.OnItemSelect += (sender, item, index) => { if (item == FixPlayer) { UI.Notify("~g~Player Fixed!"); } }; //List View var WantedLevels = new List<dynamic> { 0, 1, 2, 3, 4, 5, }; var wantedLevel = new UIMenuListItem("Wanted Level", WantedLevels, 0); SubMenuSM.AddItem(wantedLevel); SubMenuSM.OnListChange += (sender, item, index) => { if (item == wantedLevel) { switch (index) { case 1: Game.Player.WantedLevel = 1; break; case 2: Game.Player.WantedLevel = 2; break; case 3: Game.Player.WantedLevel = 3; break; case 4: Game.Player.WantedLevel = 4; break; case 5: Game.Player.WantedLevel = 5; break; default: Game.Player.WantedLevel = 0; break; } } }; //Filler var lulz = new UIMenuItem("lulz", "lulz Player."); for (int i = 0; i < 10; i++) SubMenuSM.AddItem(new UIMenuItem("PageFiller", "Sample description that takes more than one line. Moreso, it takes way more than two lines since it's so long. Wow, check out this length!")); SubMenuSM.RefreshIndex(); return SubMenuSM; } You are creating a new menu every time you press F8, don't do that. Create the menu on start and flip the Visible property on your existing menu when you press F8. Got it! Thanks for the help. Is your a way i can PM you? Yeah, go to my profile and press Send me a message. Link to comment https://gtaforums.com/topic/809284-net-nativeui/page/5/#findComment-1068446325 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