Add special notes about particular appearances
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
public class ItemAppearance {
|
public class ItemAppearance {
|
||||||
public string Appearance { get; set; } = string.Empty;
|
public string Appearance { get; set; } = string.Empty;
|
||||||
public string Slot { get; set; } = string.Empty;
|
public string Slot { get; set; } = string.Empty;
|
||||||
|
public string Notes { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ItemList {
|
public class ItemList {
|
||||||
|
|||||||
1
NethackHelper/ItemDisplay.Designer.cs
generated
1
NethackHelper/ItemDisplay.Designer.cs
generated
@@ -36,6 +36,7 @@
|
|||||||
itemListView.Location = new System.Drawing.Point(0, 0);
|
itemListView.Location = new System.Drawing.Point(0, 0);
|
||||||
itemListView.MultiSelect = false;
|
itemListView.MultiSelect = false;
|
||||||
itemListView.Name = "itemListView";
|
itemListView.Name = "itemListView";
|
||||||
|
itemListView.ShowItemToolTips = true;
|
||||||
itemListView.Size = new System.Drawing.Size(610, 568);
|
itemListView.Size = new System.Drawing.Size(610, 568);
|
||||||
itemListView.Sorting = System.Windows.Forms.SortOrder.Ascending;
|
itemListView.Sorting = System.Windows.Forms.SortOrder.Ascending;
|
||||||
itemListView.TabIndex = 0;
|
itemListView.TabIndex = 0;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using System.ComponentModel;
|
|||||||
namespace NethackHelper {
|
namespace NethackHelper {
|
||||||
public partial class ItemDisplay : UserControl {
|
public partial class ItemDisplay : UserControl {
|
||||||
public const string UNIDENTIFIED = "[randomized]";
|
public const string UNIDENTIFIED = "[randomized]";
|
||||||
|
public const string TOOLTIP_SUFFIX = " *";
|
||||||
public static readonly Color SELECTED_COLOR = Color.Black;
|
public static readonly Color SELECTED_COLOR = Color.Black;
|
||||||
public static readonly Color UNSELECTED_COLOR = Color.Gray;
|
public static readonly Color UNSELECTED_COLOR = Color.Gray;
|
||||||
|
|
||||||
@@ -67,11 +68,12 @@ namespace NethackHelper {
|
|||||||
this.appearanceContextMenus.Clear();
|
this.appearanceContextMenus.Clear();
|
||||||
|
|
||||||
var appearanceSlots = itemList.Appearances.Select(app => app.Slot).Distinct().ToList();
|
var appearanceSlots = itemList.Appearances.Select(app => app.Slot).Distinct().ToList();
|
||||||
|
var appearanceMap = itemList.Appearances.ToDictionary(appearance => appearance.Appearance);
|
||||||
foreach (var slot in appearanceSlots) {
|
foreach (var slot in appearanceSlots) {
|
||||||
ContextMenuStrip contextMenuStrip = new();
|
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) {
|
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);
|
this.appearanceContextMenus.Add(slot, contextMenuStrip);
|
||||||
}
|
}
|
||||||
@@ -142,6 +144,10 @@ namespace NethackHelper {
|
|||||||
for (var i = 0; i < this.Columns.Count; i++) {
|
for (var i = 0; i < this.Columns.Count; i++) {
|
||||||
if (this.Columns[i].Attribute == ItemAttribute.Appearance) {
|
if (this.Columns[i].Attribute == ItemAttribute.Appearance) {
|
||||||
listViewItem.SubItems[i].Text = record.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;
|
subItem.ForeColor = SELECTED_COLOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!item.Checked) {
|
||||||
|
item.ToolTipText = "";
|
||||||
|
}
|
||||||
this.itemListView.Sort();
|
this.itemListView.Sort();
|
||||||
this.ProcessCurrentItemContextMenu();
|
this.ProcessCurrentItemContextMenu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PickAppearance(string appearance) {
|
private void PickAppearance(ItemAppearance appearance) {
|
||||||
if (itemListView.SelectedItems.Count == 1) {
|
if (itemListView.SelectedItems.Count == 1) {
|
||||||
var item = this.itemListView.SelectedItems[0];
|
var item = this.itemListView.SelectedItems[0];
|
||||||
var name = item.Text;
|
var name = item.Text;
|
||||||
this.AppearanceMap[name] = appearance;
|
this.AppearanceMap[name] = appearance.Appearance;
|
||||||
item.Checked = true;
|
item.Checked = true;
|
||||||
var baseFont = item.Font;
|
var baseFont = item.Font;
|
||||||
for (var i = 0; i < this.Columns.Count; i++) {
|
for (var i = 0; i < this.Columns.Count; i++) {
|
||||||
@@ -218,9 +227,13 @@ namespace NethackHelper {
|
|||||||
subItem.Font = new Font(baseFont, FontStyle.Regular);
|
subItem.Font = new Font(baseFont, FontStyle.Regular);
|
||||||
subItem.ForeColor = UNSELECTED_COLOR;
|
subItem.ForeColor = UNSELECTED_COLOR;
|
||||||
if (this.Columns[i].Attribute == ItemAttribute.Appearance) {
|
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.itemListView.Sort();
|
||||||
this.ProcessCurrentItemContextMenu();
|
this.ProcessCurrentItemContextMenu();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ appearances:
|
|||||||
slot: helm
|
slot: helm
|
||||||
- appearance: visored helmet
|
- appearance: visored helmet
|
||||||
slot: helm
|
slot: helm
|
||||||
|
notes: protectes against blinding attacks of ravens and venom-spitting attacks of cobras
|
||||||
- appearance: piece of cloth
|
- appearance: piece of cloth
|
||||||
slot: cloak
|
slot: cloak
|
||||||
- appearance: opera cloak
|
- appearance: opera cloak
|
||||||
@@ -92,6 +93,7 @@ appearances:
|
|||||||
slot: gloves
|
slot: gloves
|
||||||
- appearance: riding gloves
|
- appearance: riding gloves
|
||||||
slot: gloves
|
slot: gloves
|
||||||
|
notes: increases chance of successfully saddling a steed
|
||||||
- appearance: fencing gloves
|
- appearance: fencing gloves
|
||||||
slot: gloves
|
slot: gloves
|
||||||
- appearance: mud boots
|
- appearance: mud boots
|
||||||
@@ -100,8 +102,10 @@ appearances:
|
|||||||
slot: boots
|
slot: boots
|
||||||
- appearance: riding boots
|
- appearance: riding boots
|
||||||
slot: boots
|
slot: boots
|
||||||
|
notes: increases chance of successfully saddling a steed
|
||||||
- appearance: snow boots
|
- appearance: snow boots
|
||||||
slot: boots
|
slot: boots
|
||||||
|
notes: prevents fumbling effect of ice
|
||||||
- appearance: hiking boots
|
- appearance: hiking boots
|
||||||
slot: boots
|
slot: boots
|
||||||
- appearance: combat boots
|
- appearance: combat boots
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ appearances:
|
|||||||
slot: helm
|
slot: helm
|
||||||
- appearance: visored helmet
|
- appearance: visored helmet
|
||||||
slot: helm
|
slot: helm
|
||||||
|
notes: protectes against blinding attacks of ravens and venom-spitting attacks of cobras
|
||||||
- appearance: piece of cloth
|
- appearance: piece of cloth
|
||||||
slot: cloak
|
slot: cloak
|
||||||
- appearance: opera cloak
|
- appearance: opera cloak
|
||||||
@@ -96,6 +97,7 @@ appearances:
|
|||||||
slot: gloves
|
slot: gloves
|
||||||
- appearance: riding gloves
|
- appearance: riding gloves
|
||||||
slot: gloves
|
slot: gloves
|
||||||
|
notes: increases chance of successfully saddling a steed
|
||||||
- appearance: fencing gloves
|
- appearance: fencing gloves
|
||||||
slot: gloves
|
slot: gloves
|
||||||
- appearance: mud boots
|
- appearance: mud boots
|
||||||
@@ -104,8 +106,10 @@ appearances:
|
|||||||
slot: boots
|
slot: boots
|
||||||
- appearance: riding boots
|
- appearance: riding boots
|
||||||
slot: boots
|
slot: boots
|
||||||
|
notes: increases chance of successfully saddling a steed
|
||||||
- appearance: snow boots
|
- appearance: snow boots
|
||||||
slot: boots
|
slot: boots
|
||||||
|
notes: prevents fumbling effect of ice
|
||||||
- appearance: hiking boots
|
- appearance: hiking boots
|
||||||
slot: boots
|
slot: boots
|
||||||
- appearance: combat boots
|
- appearance: combat boots
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ appearances:
|
|||||||
- appearance: dark green
|
- appearance: dark green
|
||||||
- appearance: purple-red
|
- appearance: purple-red
|
||||||
- appearance: smoky
|
- appearance: smoky
|
||||||
|
notes: can summon djinni
|
||||||
- appearance: brown
|
- appearance: brown
|
||||||
- appearance: pink
|
- appearance: pink
|
||||||
- appearance: cyan
|
- appearance: cyan
|
||||||
@@ -69,6 +70,7 @@ appearances:
|
|||||||
- appearance: orange
|
- appearance: orange
|
||||||
- appearance: sky blue
|
- appearance: sky blue
|
||||||
- appearance: milky
|
- appearance: milky
|
||||||
|
notes: can summon ghost
|
||||||
- appearance: effervescent
|
- appearance: effervescent
|
||||||
- appearance: dark
|
- appearance: dark
|
||||||
- appearance: yellow
|
- appearance: yellow
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ appearances:
|
|||||||
- appearance: dark green
|
- appearance: dark green
|
||||||
- appearance: purple-red
|
- appearance: purple-red
|
||||||
- appearance: smoky
|
- appearance: smoky
|
||||||
|
notes: can summon djinni
|
||||||
- appearance: brown
|
- appearance: brown
|
||||||
- appearance: pink
|
- appearance: pink
|
||||||
- appearance: cyan
|
- appearance: cyan
|
||||||
@@ -69,6 +70,7 @@ appearances:
|
|||||||
- appearance: orange
|
- appearance: orange
|
||||||
- appearance: sky blue
|
- appearance: sky blue
|
||||||
- appearance: milky
|
- appearance: milky
|
||||||
|
notes: can summon ghost
|
||||||
- appearance: effervescent
|
- appearance: effervescent
|
||||||
- appearance: dark
|
- appearance: dark
|
||||||
- appearance: yellow
|
- appearance: yellow
|
||||||
|
|||||||
@@ -62,29 +62,46 @@
|
|||||||
appearances:
|
appearances:
|
||||||
- appearance: pearl
|
- appearance: pearl
|
||||||
- appearance: engagement
|
- appearance: engagement
|
||||||
|
notes: edible by rock moles, xorns, and rust monsters
|
||||||
- appearance: silver
|
- appearance: silver
|
||||||
|
notes: edible by rock moles and xorns
|
||||||
- appearance: clay
|
- appearance: clay
|
||||||
- appearance: jade
|
- appearance: jade
|
||||||
- appearance: diamond
|
- appearance: diamond
|
||||||
|
notes: can be used for semi-permanent engraving
|
||||||
- appearance: iron
|
- appearance: iron
|
||||||
|
notes: edible by rock moles, xorns, and rust monsters
|
||||||
- appearance: shiny
|
- appearance: shiny
|
||||||
|
notes: edible by rock moles, xorns, and rust monsters
|
||||||
- appearance: gold
|
- appearance: gold
|
||||||
|
notes: edible by rock moles and xorns
|
||||||
- appearance: coral
|
- appearance: coral
|
||||||
- appearance: agate
|
- appearance: agate
|
||||||
- appearance: ivory
|
- appearance: ivory
|
||||||
- appearance: twisted
|
- appearance: twisted
|
||||||
|
notes: edible by rock moles, xorns, and rust monsters
|
||||||
- appearance: bronze
|
- appearance: bronze
|
||||||
|
notes: edible by rock moles and xorns
|
||||||
- appearance: wooden
|
- appearance: wooden
|
||||||
|
notes: edible by gelatinous cubes
|
||||||
- appearance: black onyx
|
- appearance: black onyx
|
||||||
- appearance: topaz
|
- appearance: topaz
|
||||||
|
notes: can be used for semi-permanent engraving
|
||||||
- appearance: emerald
|
- appearance: emerald
|
||||||
|
notes: can be used for semi-permanent engraving
|
||||||
- appearance: steel
|
- appearance: steel
|
||||||
|
notes: can be used for semi-permanent engraving; edible by rock moles, xorns, and rust monsters
|
||||||
- appearance: brass
|
- appearance: brass
|
||||||
|
notes: edible by rock moles and xorns
|
||||||
- appearance: granite
|
- appearance: granite
|
||||||
- appearance: moonstone
|
- appearance: moonstone
|
||||||
- appearance: sapphire
|
- appearance: sapphire
|
||||||
|
notes: can be used for semi-permanent engraving
|
||||||
- appearance: wire
|
- appearance: wire
|
||||||
|
notes: edible by rock moles, xorns, and rust monsters
|
||||||
- appearance: copper
|
- appearance: copper
|
||||||
|
notes: edible by rock moles and xorns
|
||||||
- appearance: opal
|
- appearance: opal
|
||||||
- appearance: tiger eye
|
- appearance: tiger eye
|
||||||
- appearance: ruby
|
- appearance: ruby
|
||||||
|
notes: can be used for semi-permanent engraving
|
||||||
@@ -147,6 +147,7 @@ appearances:
|
|||||||
- appearance: dark brown
|
- appearance: dark brown
|
||||||
- appearance: copper
|
- appearance: copper
|
||||||
- appearance: dull
|
- appearance: dull
|
||||||
|
notes: can put you to sleep
|
||||||
- appearance: dog eared
|
- appearance: dog eared
|
||||||
- appearance: white
|
- appearance: white
|
||||||
- appearance: velvet
|
- appearance: velvet
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ appearances:
|
|||||||
- appearance: dark brown
|
- appearance: dark brown
|
||||||
- appearance: copper
|
- appearance: copper
|
||||||
- appearance: dull
|
- appearance: dull
|
||||||
|
notes: can put you to sleep
|
||||||
- appearance: dog eared
|
- appearance: dog eared
|
||||||
- appearance: white
|
- appearance: white
|
||||||
- appearance: velvet
|
- appearance: velvet
|
||||||
|
|||||||
@@ -52,9 +52,11 @@ appearances:
|
|||||||
- appearance: curved
|
- appearance: curved
|
||||||
- appearance: iridium
|
- appearance: iridium
|
||||||
- appearance: marble
|
- appearance: marble
|
||||||
|
notes: stone to flesh will make into a meat stick
|
||||||
- appearance: short
|
- appearance: short
|
||||||
- appearance: uranium
|
- appearance: uranium
|
||||||
- appearance: balsa
|
- appearance: balsa
|
||||||
|
notes: requires only 5 strength to break
|
||||||
- appearance: ebony
|
- appearance: ebony
|
||||||
- appearance: iron
|
- appearance: iron
|
||||||
- appearance: oak
|
- appearance: oak
|
||||||
@@ -67,10 +69,12 @@ appearances:
|
|||||||
- appearance: spiked
|
- appearance: spiked
|
||||||
- appearance: copper
|
- appearance: copper
|
||||||
- appearance: glass
|
- appearance: glass
|
||||||
|
notes: fragile
|
||||||
- appearance: long
|
- appearance: long
|
||||||
- appearance: platinum
|
- appearance: platinum
|
||||||
- appearance: steel
|
- appearance: steel
|
||||||
- appearance: crystal
|
- appearance: crystal
|
||||||
|
notes: fragile
|
||||||
- appearance: hexagonal
|
- appearance: hexagonal
|
||||||
- appearance: maple
|
- appearance: maple
|
||||||
- appearance: runed
|
- appearance: runed
|
||||||
|
|||||||
Reference in New Issue
Block a user