Not sure if its brute forcing it but I can say it works thus far. Even setup my code to gen the second button as the first vehicleclass type in the type array by default and only change when you change the type. Also just got the vehicle spawn mechanic wired into it too thus far all is working.
xhiyikfkox
View profile on GTA5-Mods.com »
Posts made by xhiyikfkox
-
RE: Assistance Needed for a refresh of dynamic list item...
-
RE: Assistance Needed for a refresh of dynamic list item...
Asked my Dad if he could check the code a moment and told him what I was trying to do... Like a min later this is his change:
vehicleTypes = new UIMenuListItem("Vehicle: ", listOfVehicleHashesType, 0);
if(x == 1)
{
submenu.RemoveItemAt(submenu.MenuItems.Count() - 1 );
}
submenu.AddItem(vehicleTypes);
x = 1;and all works now just as I was wanting it to.
-
RE: Assistance Needed for a refresh of dynamic list item...
List<dynamic> listOfVehicleTypes = new List<dynamic>();
VehicleClass[] allVehicleTypes = (VehicleClass[])Enum.GetValues(typeof(VehicleClass));
for(int i = 0; i < allVehicleTypes.Length; i++)
{
listOfVehicleTypes.Add(allVehicleTypes[i]);
}
UIMenuListItem types = new UIMenuListItem("Vehicle Types: ", listOfVehicleTypes, 0);
submenu.AddItem(types);List<dynamic> listOfVehicleHashesType = new List<dynamic>(); VehicleHash[] allVehicleHashes = (VehicleHash[])Enum.GetValues(typeof(VehicleHash)); int x = 0; submenu.OnListChange += (sender, listItem, newIndex) => { if (listItem == types) { listOfVehicleHashesType = new List<dynamic>(); VehicleClass getter = allVehicleTypes[newIndex]; for (int i = 0; i < allVehicleHashes.Length; i++) { if (Function.Call<int>(Hash.GET_VEHICLE_CLASS_FROM_NAME, (int)allVehicleHashes[i]) == (int)getter) { listOfVehicleHashesType.Add(allVehicleHashes[i]); } if (listOfVehicleHashesType.Count == 0) UI.Notify("Nothing in the list"); else UI.Notify("List Count: " + listOfVehicleHashesType.Count); } vehicleTypes = new UIMenuListItem("Vehicle: ", listOfVehicleHashesType, 0); if(x == 0) { submenu.AddItem(vehicleTypes); x++; } } };
was trying to think how to describe the code but figured posting would be better. As you can see I only call the hashes and post to menu once you change the list on the first dynamic list. I have my second list, the hashes declared in the main class so its not having to be created over and over in this area. but I only add the second list after the first change, then each time after it just says the second list is new to over write it but it does not refresh in game is the issue.
-
RE: Assistance Needed for a refresh of dynamic list item...
is there a way to remove it from the menu? if so I could just remove it and repost it to the menu after the change has been made.
-
RE: Assistance Needed for a refresh of dynamic list item...
Not sure what you mean by that... I can say this though. I have been using NativeUI to make a modmenu, same one you helped me with before, but after getting the muscle car setup working I wanted to make a dynamic list setup. So the way it will work is dynaic list vehicleTypes gets all known vehicleclass's from the vehicleclass list, then fills it into the dynamic list ot vehicleTypes. When you select a type from that list I have dynamic list vehicleTypeHashes go and get all the vehicles of that type, ex vehicleTypes select muscle cehicleTyeHashes gets all the muscle car hashes. However if you then change the vehicleTypes to sports car, the vehicleTypeHashes dose not update with the new list. In otherwords its not refreshing.
-
Assistance Needed for a refresh of dynamic list item...
As the title says, I have a dynamic list item on my sub menu, I actually have 2 of them. I have a car model type setup I am working on so you select the type of vehicle you want aka muscle, and the second list populates with all the hashes of that type. The issue I have is if I select muscle, the list loads, but then if I change it to sport, the list remains the same with all the muscle cars listed. So my second dynamic list is not updating when I have changed the first one of model.
-
RE: Broken Spawn Mechanic, some experienced eyes for a review would help.
so for my delay on spawn for first and some times second try at spawning a car.... I realized I should try to set my game priority in processes to high like I do when I play online. With having done so everything works fine for spawning. Thank You everyone for the help in getting this to work, seems its my system causing the delay when I try to spawn the vehicle.
-
RE: Broken Spawn Mechanic, some experienced eyes for a review would help.
well its still progress, and progress is good
-
RE: Broken Spawn Mechanic, some experienced eyes for a review would help.
Hope you got it all worked out and reworking
-
RE: Broken Spawn Mechanic, some experienced eyes for a review would help.
@LeeC2202 said in Broken Spawn Mechanic, some experienced eyes for a review would help.:
@xhiyikfkox If you want me to try that code on my machine, host the dll somewhere (Google Drive or something) and PM me the link.
I've finished my 34 badges now, so I'm coding and testing stuff anyway, so dropping a script in to test is no hassle.
Glad you got your badges working