private void onSearchSubmit(Base sender, EventArgs arguments) { String name = text_manual_name.Text.ToLower(); if (String.IsNullOrWhiteSpace(name)) { return; } ComputerPedController controller = ComputerPedController.Instance; var ped = controller.LookupPersona(name); if (ped) { if (!ped.Ped) { text_manual_name.Error("The ped no longer exists"); } else { text_manual_name.ClearError(); list_manual_results.AddPed(ped); ComputerPedController.LastSelected = ped; ComputerPedController.ActivatePedView(); } } else { text_manual_name.Error("No matches"); } }
public void PopulateStoppedPedsList() { ComputerPedController controller = ComputerPedController.Instance; var peds = controller.PedsCurrentlyStoppedByPlayer; list_collected_ids.Clear(); foreach (var persona in peds.Select(x => controller.LookupPersona(x))) { list_collected_ids.AddPed(persona); } }
private void onListItemSelected(Base sender, ItemSelectedEventArgs arguments) { if (arguments.SelectedItem.UserData is ComputerPlusEntity) { ComputerPedController.LastSelected = arguments.SelectedItem.UserData as ComputerPlusEntity; ClearSelections(); ComputerPedController.ActivatePedView(); } else { Function.Log("ComputerPedSearch.onListItemSelected arguments were not valid"); } }
public void PopulateManualSearchPedsList() { ComputerPedController controller = ComputerPedController.Instance; list_collected_ids.Clear(); var results = controller.GetRecentSearches() .Where(x => x.Validate()).ToList(); //@TODO choose if we want to remove null items from the list -- may cause user confusion if (results != null && results.Count > 0) { results.ForEach(x => list_manual_results.AddPed(x)); } }
public void PopulateStoppedPedsList() { try { ComputerPedController controller = ComputerPedController.Instance; var peds = controller.PedsCurrentlyStoppedByPlayer; list_collected_ids.Clear(); foreach (var persona in peds.Select(x => controller.LookupPersona(x))) { list_collected_ids.AddPed(persona); } } catch (Exception e) { Function.Log(e.ToString()); } }
public void PopulateStoppedPedsList() { try { ComputerPedController controller = ComputerPedController.Instance; var peds = controller.PedsCurrentlyStoppedByPlayer; list_collected_ids.Clear(); foreach (var entity in peds.Select(x => controller.LookupPersona(x))) { if (entity != null) { list_collected_ids.AddPed(entity); ComputerReportsController.generateRandomHistory(entity); } } } catch (Exception e) { Function.Log(e.ToString()); } }
private void ShowDetailsView() { ComputerPedController.ShowPedView(); this.Close(); }