public void Clear() { hudList.ClearRows(); HudList.HudListRowAccessor newRow = hudList.AddRow(); ((HudStaticText)newRow[0]).Text = "Time"; ((HudStaticText)newRow[1]).Text = "Message"; }
void InventorySearch_Change(object sender, EventArgs e) { try { inventoryList.ClearRows(); var regex = new Regex(inventorySearch.Text, RegexOptions.IgnoreCase); foreach (var wo in CoreManager.Current.WorldFilter.GetInventory()) { var itemInfo = new ItemInfo.ItemInfo(wo); if (regex.IsMatch(itemInfo.ToString())) { HudList.HudListRowAccessor newRow = inventoryList.AddRow(); ((HudPictureBox)newRow[0]).Image = wo.Icon + 0x6000000; ((HudStaticText)newRow[1]).Text = wo.Name; ((HudStaticText)newRow[2]).Text = wo.Id.ToString(CultureInfo.InvariantCulture); } } } catch (Exception ex) { Debug.LogException(ex); } }
private void UpdateArmorHuds(HudList hud) { try { hud.ClearRows(); HashSet<InventoryObject> SearchSet1 = new HashSet<InventoryObject>(); HashSet<InventoryObject> SearchSet2 = new HashSet<InventoryObject>(); HashSet<InventoryObject> SearchSet3 = new HashSet<InventoryObject>(); if (Search.ObjectClass != AObjectClass.Unknown) { SearchSet1 = nVenTory.GetByObjectClass(Search.ObjectClass); } if (Search.SearchSpellIds.Count > 0) { SearchSet2.UnionWith(nVenTory.GetBySpellIds(Search.SearchSpellIds)); } if (Search.SearchNames.Count > 0) foreach (string name in Search.SearchNames) { SearchSet3.UnionWith(nVenTory.GetByObjectName(@name)); } if (Search.SearchFragments.Count > 0) foreach (string fragment in Search.SearchFragments) { SearchSet3.UnionWith(nVenTory.GetByLowercaseFragment(@fragment)); } if (Search.ObjectClass != AObjectClass.Unknown && SearchSet1.Count == 0) { return; } if (Search.SearchSpellIds.Count > 0 && SearchSet2.Count == 0) { return; } if ((Search.SearchNames.Count > 0 || Search.SearchFragments.Count > 0) && SearchSet3.Count == 0) { return; } HashSet<InventoryObject> SearchInventoryItems = new HashSet<InventoryObject>(); if (Search.ObjectClass != AObjectClass.Unknown && Search.SearchSpellIds.Count > 0 && (Search.SearchNames.Count > 0 || Search.SearchFragments.Count > 0)) { SearchInventoryItems = SearchSet1; SearchInventoryItems.IntersectWith(SearchSet2); SearchInventoryItems.IntersectWith(SearchSet3); } else if (Search.ObjectClass != AObjectClass.Unknown && Search.SearchSpellIds.Count > 0 && Search.SearchNames.Count == 0 && Search.SearchFragments.Count == 0) { SearchInventoryItems = SearchSet1; SearchInventoryItems.IntersectWith(SearchSet2); } else if (Search.ObjectClass != AObjectClass.Unknown && Search.SearchSpellIds.Count == 0 && (Search.SearchNames.Count > 0 || Search.SearchFragments.Count > 0)) { SearchInventoryItems = SearchSet1; SearchInventoryItems.IntersectWith(SearchSet3); } else if (Search.ObjectClass == AObjectClass.Unknown && Search.SearchSpellIds.Count > 0 && (Search.SearchNames.Count > 0 || Search.SearchFragments.Count > 0)) { SearchInventoryItems = SearchSet2; SearchInventoryItems.IntersectWith(SearchSet3); } else if (Search.ObjectClass != AObjectClass.Unknown && Search.SearchSpellIds.Count == 0 && Search.SearchNames.Count == 0 && Search.SearchFragments.Count == 0) { SearchInventoryItems = SearchSet1; } else if (Search.ObjectClass == AObjectClass.Unknown && Search.SearchSpellIds.Count > 0 && Search.SearchNames.Count == 0 && Search.SearchFragments.Count == 0) { SearchInventoryItems = SearchSet2; } else if (Search.ObjectClass == AObjectClass.Unknown && Search.SearchSpellIds.Count == 0 && (Search.SearchNames.Count > 0 || Search.SearchFragments.Count > 0)) { SearchInventoryItems = SearchSet3; } if (Search.EquipSkill != 0) { SearchInventoryItems.RemoveWhere(x => x.EquipSkill != Search.EquipSkill); } if (Search.ArmorSet != 0) { SearchInventoryItems.RemoveWhere(x => x.ArmorSet != Search.ArmorSet); } if (Search.ArmorCoverage != 0) { SearchInventoryItems.RemoveWhere(x => x.Coverage != Search.ArmorCoverage); } if (Search.ArmorLevel != 0) { SearchInventoryItems.RemoveWhere(x => x.WieldReqValue != Search.ArmorLevel); } if (Search.ArmorRatings != 0) { SearchInventoryItems.RemoveWhere(x => x.aetherObject.Values((ALongValueKeys)Search.ArmorRatings) == 0); } if (Search.Material != 0) { SearchInventoryItems.RemoveWhere(x => x.Material != Search.Material); } if (SearchInventoryItems.Count == 0) { return; } HudList.HudListRowAccessor HudRow; foreach (InventoryObject io in SearchInventoryItems) { HudRow = hud.AddRow(); StringConstructor sc = new StringConstructor(io); ((HudPictureBox)HudRow[0]).Image = io.Icon + 0x6000000; ((HudStaticText)HudRow[1]).Text = sc.NameInfo; if (sc.SetInfo.Length > 1) ((HudStaticText)HudRow[2]).Text = sc.SetInfo.Substring(1); if (sc.RatingsInfo.Length > 1) ((HudStaticText)HudRow[3]).Text = sc.RatingsInfo.Substring(1); ((HudStaticText)HudRow[4]).Text = io.OwnerOrChest; ((HudStaticText)HudRow[5]).Text = sc.SpellInfo; ((HudStaticText)HudRow[6]).Text = io.Id.ToString(); } } catch (Exception ex) { LogError(ex); } }
//// Use this for lists simply needing a selection to be made private void populateLst(HudList lstView, List<IDNameLoadable> lst, int mlist) { lstView.ClearRows(); foreach (IDNameLoadable element in lst) { try { string vname = element.name; string snum = element.ID.ToString(); bool mchecked = false; lstView.AddRow(); HudList.HudListRowAccessor newRow = lstView.AddRow(); switch (mlist) { case 3: ((HudCheckBox)newRow[0]).Checked = mchecked; ((HudStaticText)newRow[1]).Text = vname; ((HudStaticText)newRow[2]).Text = snum; break; case 5: ((HudStaticText)newRow[0]).Text = vname; ((HudStaticText)newRow[1]).Text = snum; ((HudPictureBox)newRow[1]).Image = 0x6005e6a; break; } } catch (Exception ex) { LogError(ex); } } }
////Basic function to populate the listviews. It receives the listview name, the ////list from which it is populated, and the number of columns that are displayed. ////For each item in the list it pulls out the variables, then sets up the lists, private void populateLst(HudList lstView, List<XElement> lst, int mlist) { try { lstView.ClearRows(); string mdescr = ""; string vcombine = ""; string spriority = ""; string vname = ""; string mname = ""; string vID = ""; foreach (XElement element in lst) { if (mlist == 4) { mchecked = Convert.ToBoolean(element.Element("Enabled").Value); mname = element.Element("Name").Value.ToString().Trim(); spriority = element.Element("Priority").Value.ToString(); } else if (mlist == 5) { // mchecked = Convert.ToBoolean(element.Element("checked").Value); vname = element.Element("Name").Value.ToString(); vID = element.Element("ID").Value.ToString(); } else { mchecked = Convert.ToBoolean(element.Element("checked").Value); vname = element.Element("key").Value.ToString(); if (lstView == lstNotifySalvage) { vcombine = element.Element("combine").Value.ToString(); } } lstView.AddRow(); HudList.HudListRowAccessor newRow = lstView.AddRow(); switch (mlist) { case 1: ((HudCheckBox)newRow[0]).Checked = mchecked; ((HudStaticText)newRow[1]).Text = vname; ((HudPictureBox)newRow[2]).Image = 0x6005e6a; break; case 2: ((HudCheckBox)newRow[0]).Checked = mchecked; ((HudStaticText)newRow[1]).Text = vname; ((HudStaticText)newRow[2]).Text = vcombine; break; case 4: ((HudCheckBox)newRow[0]).Checked = mchecked; ((HudStaticText)newRow[1]).Text = spriority; ((HudStaticText)newRow[2]).Text = mname; ((HudStaticText)newRow[3]).Text = mdescr; ((HudPictureBox)newRow[4]).Image = 0x6005e6a; break; case 5: ((HudStaticText)newRow[0]).Text = mname; ((HudPictureBox)newRow[1]).Image = 0x6005e6a; break; } } } catch (Exception ex) { LogError(ex); } }
private void _PopulateList(HudList target, List<IDNameLoadable> source, List<int> selected) { try { HudList.HudListRowAccessor row = new HudList.HudListRowAccessor(); target.ClearRows(); foreach(IDNameLoadable entry in source) { row = target.AddRow(); if (selected.Contains(entry.ID)) { ((HudCheckBox)row[0]).Checked = true; ((HudTextBox)row[1]).Text = entry.name; ((HudTextBox)row[2]).Text = entry.ID.ToString(); } } }catch(Exception ex){LogError(ex);} }