diff --git a/NethackHelper/Item.cs b/NethackHelper/Item.cs index 42b701a..a0330f9 100644 --- a/NethackHelper/Item.cs +++ b/NethackHelper/Item.cs @@ -15,6 +15,7 @@ public class ItemAppearance { public string Appearance { get; set; } = string.Empty; public string Slot { get; set; } = string.Empty; + public string Notes { get; set; } = string.Empty; } public class ItemList { diff --git a/NethackHelper/ItemDisplay.Designer.cs b/NethackHelper/ItemDisplay.Designer.cs index 5ebceba..b5e0631 100644 --- a/NethackHelper/ItemDisplay.Designer.cs +++ b/NethackHelper/ItemDisplay.Designer.cs @@ -36,6 +36,7 @@ itemListView.Location = new System.Drawing.Point(0, 0); itemListView.MultiSelect = false; itemListView.Name = "itemListView"; + itemListView.ShowItemToolTips = true; itemListView.Size = new System.Drawing.Size(610, 568); itemListView.Sorting = System.Windows.Forms.SortOrder.Ascending; itemListView.TabIndex = 0; diff --git a/NethackHelper/ItemDisplay.cs b/NethackHelper/ItemDisplay.cs index 372bae3..a705c37 100644 --- a/NethackHelper/ItemDisplay.cs +++ b/NethackHelper/ItemDisplay.cs @@ -10,6 +10,7 @@ using System.ComponentModel; namespace NethackHelper { public partial class ItemDisplay : UserControl { public const string UNIDENTIFIED = "[randomized]"; + public const string TOOLTIP_SUFFIX = " *"; public static readonly Color SELECTED_COLOR = Color.Black; public static readonly Color UNSELECTED_COLOR = Color.Gray; @@ -67,11 +68,12 @@ namespace NethackHelper { this.appearanceContextMenus.Clear(); var appearanceSlots = itemList.Appearances.Select(app => app.Slot).Distinct().ToList(); + var appearanceMap = itemList.Appearances.ToDictionary(appearance => appearance.Appearance); foreach (var slot in appearanceSlots) { ContextMenuStrip contextMenuStrip = new(); - var appearances = itemList.Appearances.Where(app => app.Slot == slot).Select(app => app.Appearance).Order().ToList(); + var appearances = itemList.Appearances.Where(app => app.Slot == slot).OrderBy(appearance => appearance.Appearance).ToList(); foreach (var appearance in appearances) { - contextMenuStrip.Items.Add(appearance, null, (sender, e) => this.PickAppearance(appearance)); + contextMenuStrip.Items.Add(appearance.Appearance, null, (sender, e) => this.PickAppearance(appearance)); } this.appearanceContextMenus.Add(slot, contextMenuStrip); } @@ -142,6 +144,10 @@ namespace NethackHelper { for (var i = 0; i < this.Columns.Count; i++) { if (this.Columns[i].Attribute == ItemAttribute.Appearance) { listViewItem.SubItems[i].Text = record.Appearance; + if (appearanceMap.TryGetValue(record.Appearance, out var appearance) && appearance.Notes != string.Empty) { + listViewItem.ToolTipText = appearance.Notes; + listViewItem.SubItems[i].Text += TOOLTIP_SUFFIX; + } } } } @@ -201,16 +207,19 @@ namespace NethackHelper { subItem.ForeColor = SELECTED_COLOR; } } + if (!item.Checked) { + item.ToolTipText = ""; + } this.itemListView.Sort(); this.ProcessCurrentItemContextMenu(); } } - private void PickAppearance(string appearance) { + private void PickAppearance(ItemAppearance appearance) { if (itemListView.SelectedItems.Count == 1) { var item = this.itemListView.SelectedItems[0]; var name = item.Text; - this.AppearanceMap[name] = appearance; + this.AppearanceMap[name] = appearance.Appearance; item.Checked = true; var baseFont = item.Font; for (var i = 0; i < this.Columns.Count; i++) { @@ -218,9 +227,13 @@ namespace NethackHelper { subItem.Font = new Font(baseFont, FontStyle.Regular); subItem.ForeColor = UNSELECTED_COLOR; if (this.Columns[i].Attribute == ItemAttribute.Appearance) { - subItem.Text = appearance; + subItem.Text = appearance.Appearance; + if (appearance.Notes != string.Empty) { + subItem.Text += TOOLTIP_SUFFIX; + } } } + item.ToolTipText = appearance.Notes; this.itemListView.Sort(); this.ProcessCurrentItemContextMenu(); } diff --git a/NethackHelper/items/armor-36.yaml b/NethackHelper/items/armor-36.yaml index 7b543d6..2e3c998 100644 --- a/NethackHelper/items/armor-36.yaml +++ b/NethackHelper/items/armor-36.yaml @@ -78,6 +78,7 @@ appearances: slot: helm - appearance: visored helmet slot: helm + notes: protectes against blinding attacks of ravens and venom-spitting attacks of cobras - appearance: piece of cloth slot: cloak - appearance: opera cloak @@ -92,6 +93,7 @@ appearances: slot: gloves - appearance: riding gloves slot: gloves + notes: increases chance of successfully saddling a steed - appearance: fencing gloves slot: gloves - appearance: mud boots @@ -100,8 +102,10 @@ appearances: slot: boots - appearance: riding boots slot: boots + notes: increases chance of successfully saddling a steed - appearance: snow boots slot: boots + notes: prevents fumbling effect of ice - appearance: hiking boots slot: boots - appearance: combat boots diff --git a/NethackHelper/items/armor-37.yaml b/NethackHelper/items/armor-37.yaml index cf9d7ca..62bb9bf 100644 --- a/NethackHelper/items/armor-37.yaml +++ b/NethackHelper/items/armor-37.yaml @@ -82,6 +82,7 @@ appearances: slot: helm - appearance: visored helmet slot: helm + notes: protectes against blinding attacks of ravens and venom-spitting attacks of cobras - appearance: piece of cloth slot: cloak - appearance: opera cloak @@ -96,6 +97,7 @@ appearances: slot: gloves - appearance: riding gloves slot: gloves + notes: increases chance of successfully saddling a steed - appearance: fencing gloves slot: gloves - appearance: mud boots @@ -104,8 +106,10 @@ appearances: slot: boots - appearance: riding boots slot: boots + notes: increases chance of successfully saddling a steed - appearance: snow boots slot: boots + notes: prevents fumbling effect of ice - appearance: hiking boots slot: boots - appearance: combat boots diff --git a/NethackHelper/items/potions-36.yaml b/NethackHelper/items/potions-36.yaml index ffb43fe..a2ca458 100644 --- a/NethackHelper/items/potions-36.yaml +++ b/NethackHelper/items/potions-36.yaml @@ -60,6 +60,7 @@ appearances: - appearance: dark green - appearance: purple-red - appearance: smoky + notes: can summon djinni - appearance: brown - appearance: pink - appearance: cyan @@ -69,6 +70,7 @@ appearances: - appearance: orange - appearance: sky blue - appearance: milky + notes: can summon ghost - appearance: effervescent - appearance: dark - appearance: yellow diff --git a/NethackHelper/items/potions-37.yaml b/NethackHelper/items/potions-37.yaml index 45d8aea..143a279 100644 --- a/NethackHelper/items/potions-37.yaml +++ b/NethackHelper/items/potions-37.yaml @@ -60,6 +60,7 @@ appearances: - appearance: dark green - appearance: purple-red - appearance: smoky + notes: can summon djinni - appearance: brown - appearance: pink - appearance: cyan @@ -69,6 +70,7 @@ appearances: - appearance: orange - appearance: sky blue - appearance: milky + notes: can summon ghost - appearance: effervescent - appearance: dark - appearance: yellow diff --git a/NethackHelper/items/rings.yaml b/NethackHelper/items/rings.yaml index 800ef1c..5845340 100644 --- a/NethackHelper/items/rings.yaml +++ b/NethackHelper/items/rings.yaml @@ -62,29 +62,46 @@ appearances: - appearance: pearl - appearance: engagement + notes: edible by rock moles, xorns, and rust monsters - appearance: silver + notes: edible by rock moles and xorns - appearance: clay - appearance: jade - appearance: diamond + notes: can be used for semi-permanent engraving - appearance: iron + notes: edible by rock moles, xorns, and rust monsters - appearance: shiny + notes: edible by rock moles, xorns, and rust monsters - appearance: gold + notes: edible by rock moles and xorns - appearance: coral - appearance: agate - appearance: ivory - appearance: twisted + notes: edible by rock moles, xorns, and rust monsters - appearance: bronze + notes: edible by rock moles and xorns - appearance: wooden + notes: edible by gelatinous cubes - appearance: black onyx - appearance: topaz + notes: can be used for semi-permanent engraving - appearance: emerald + notes: can be used for semi-permanent engraving - appearance: steel + notes: can be used for semi-permanent engraving; edible by rock moles, xorns, and rust monsters - appearance: brass + notes: edible by rock moles and xorns - appearance: granite - appearance: moonstone - appearance: sapphire + notes: can be used for semi-permanent engraving - appearance: wire + notes: edible by rock moles, xorns, and rust monsters - appearance: copper + notes: edible by rock moles and xorns - appearance: opal - appearance: tiger eye - - appearance: ruby \ No newline at end of file + - appearance: ruby + notes: can be used for semi-permanent engraving \ No newline at end of file diff --git a/NethackHelper/items/spellbooks-36.yaml b/NethackHelper/items/spellbooks-36.yaml index 0ce82c9..3f71dd2 100644 --- a/NethackHelper/items/spellbooks-36.yaml +++ b/NethackHelper/items/spellbooks-36.yaml @@ -147,6 +147,7 @@ appearances: - appearance: dark brown - appearance: copper - appearance: dull + notes: can put you to sleep - appearance: dog eared - appearance: white - appearance: velvet diff --git a/NethackHelper/items/spellbooks-37.yaml b/NethackHelper/items/spellbooks-37.yaml index 994389f..6e44eff 100644 --- a/NethackHelper/items/spellbooks-37.yaml +++ b/NethackHelper/items/spellbooks-37.yaml @@ -150,6 +150,7 @@ appearances: - appearance: dark brown - appearance: copper - appearance: dull + notes: can put you to sleep - appearance: dog eared - appearance: white - appearance: velvet diff --git a/NethackHelper/items/wands.yaml b/NethackHelper/items/wands.yaml index 74d11af..4832008 100644 --- a/NethackHelper/items/wands.yaml +++ b/NethackHelper/items/wands.yaml @@ -52,9 +52,11 @@ appearances: - appearance: curved - appearance: iridium - appearance: marble + notes: stone to flesh will make into a meat stick - appearance: short - appearance: uranium - appearance: balsa + notes: requires only 5 strength to break - appearance: ebony - appearance: iron - appearance: oak @@ -67,10 +69,12 @@ appearances: - appearance: spiked - appearance: copper - appearance: glass + notes: fragile - appearance: long - appearance: platinum - appearance: steel - appearance: crystal + notes: fragile - appearance: hexagonal - appearance: maple - appearance: runed