Big Update to include icons, separate intrinsic/extrinsic tracking, and streamable tracker

This commit is contained in:
2026-04-23 22:09:32 -05:00
parent cea723832c
commit e5efd0030c
88 changed files with 2535 additions and 599 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,16 @@
namespace NethackHelper {
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using System.Windows.Forms;
public partial class MainForm : Form {
private const int PORT = 5993;
private readonly List<SokobanSolution> sokobans = [];
private int sokobanStepIndex = 0;
@@ -46,6 +52,27 @@ namespace NethackHelper {
}
this.LoadSave();
this.RunWebserver();
}
private void RunWebserver() {
WebApplicationBuilder builder = WebApplication.CreateBuilder();
builder.Services.AddSignalR();
WebApplication app = builder.Build();
app.UseStaticFiles();
app.MapHub<TrackingHub>("/webview");
string baseUrl = $"http://localhost:{PORT}/";
Task _ = app.RunAsync(baseUrl);
IHubContext<TrackingHub, ITrackingClient>? hub = app.Services.GetService<IHubContext<TrackingHub, ITrackingClient>>();
if (hub != null) {
TrackerManager.Instance.Tracker = hub.Clients.All;
}
}
private void Reset(Version version) {
@@ -62,7 +89,7 @@ namespace NethackHelper {
this.Text = "NethackHelper - " + version.Name;
intrinsicsBindingSource.DataSource = save.Intrinsics;
propertiesBindingSource.DataSource = save.Properties;
charismaSelector.SelectedItem = save.CharismaClass;
@@ -196,7 +223,7 @@ namespace NethackHelper {
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) {
var save = SaveData.Instance;
save.Potions = this.potionDisplay.Export();
save.Rings = this.ringDisplay.Export();
@@ -209,5 +236,17 @@ namespace NethackHelper {
save.Save();
}
private void protectionPicker_ValueChanged(object sender, EventArgs e) {
TrackerManager.Instance.Tracker.UpdateProtection((int) protectionPicker.Value);
}
private void lastPrayerPicker_ValueChanged(object sender, EventArgs e) {
TrackerManager.Instance.Tracker.UpdatePrayer((int) lastPrayerPicker.Value);
}
private void godAngryCheckbox_CheckedChanged(object sender, EventArgs e) {
TrackerManager.Instance.Tracker.UpdateAngry(godAngryCheckbox.Checked);
}
}
}

View File

@@ -117,11 +117,17 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="extrinsicLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="intrinsicLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="saveSourceBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>410, 17</value>
<value>416, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>712, 17</value>
<value>718, 17</value>
</metadata>
<data name="potionDisplay.Columns" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
@@ -248,14 +254,14 @@
AAAAAACPAAAAAQYAAAAFAAAAAfj////5////AQAAAC0AAAAL
</value>
</data>
<metadata name="intrinsicsBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>232, 17</value>
</metadata>
<metadata name="charismaSourceBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="propertiesBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="charismaSourceBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>201, 17</value>
</metadata>
<metadata name="mainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>600, 17</value>
<value>606, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

View File

@@ -7,6 +7,7 @@
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>disable</ImplicitUsings>
<ApplicationIcon>icon.ico</ApplicationIcon>
<Version>2.0.0</Version>
</PropertyGroup>
<ItemGroup>
@@ -15,6 +16,7 @@
<ItemGroup>
<PackageReference Include="YamlDotNet" Version="15.1.6" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
@@ -24,12 +26,36 @@
<None Update="sokoban\*.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="wwwroot\icons\*.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="wwwroot\tracker.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="wwwroot\tracker.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="wwwroot\tracker.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="MainForm.resx">
<Generator></Generator>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

View File

@@ -5,6 +5,6 @@
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="Intrinsics" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>NethackHelper.Intrinsics, NethackHelper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
<GenericObjectDataSource DisplayName="PropertiesSource" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>NethackHelper.Properties, NethackHelper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@@ -0,0 +1,413 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace NethackHelper.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NethackHelper.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap acid_resistance {
get {
object obj = ResourceManager.GetObject("acid_resistance", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap aggravate_monster {
get {
object obj = ResourceManager.GetObject("aggravate_monster", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap angry_god {
get {
object obj = ResourceManager.GetObject("angry_god", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap cold_resistance {
get {
object obj = ResourceManager.GetObject("cold_resistance", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap conflict {
get {
object obj = ResourceManager.GetObject("conflict", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap disintegration_resistance {
get {
object obj = ResourceManager.GetObject("disintegration_resistance", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap fire_resistance {
get {
object obj = ResourceManager.GetObject("fire_resistance", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap food_appraisal {
get {
object obj = ResourceManager.GetObject("food_appraisal", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap free_action {
get {
object obj = ResourceManager.GetObject("free_action", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hunger {
get {
object obj = ResourceManager.GetObject("hunger", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap infravision {
get {
object obj = ResourceManager.GetObject("infravision", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap invisibility {
get {
object obj = ResourceManager.GetObject("invisibility", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap jumping {
get {
object obj = ResourceManager.GetObject("jumping", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap levitation {
get {
object obj = ResourceManager.GetObject("levitation", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap magic_resistance {
get {
object obj = ResourceManager.GetObject("magic_resistance", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap magical_breathing {
get {
object obj = ResourceManager.GetObject("magical_breathing", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap poison_resistance {
get {
object obj = ResourceManager.GetObject("poison_resistance", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap polymorph_control {
get {
object obj = ResourceManager.GetObject("polymorph_control", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap polymorphitis {
get {
object obj = ResourceManager.GetObject("polymorphitis", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap prayer_timeout {
get {
object obj = ResourceManager.GetObject("prayer_timeout", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap protection {
get {
object obj = ResourceManager.GetObject("protection", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap protection_from_shape_changers {
get {
object obj = ResourceManager.GetObject("protection_from_shape_changers", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap reflection {
get {
object obj = ResourceManager.GetObject("reflection", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap regeneration {
get {
object obj = ResourceManager.GetObject("regeneration", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap searching {
get {
object obj = ResourceManager.GetObject("searching", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap see_invisible {
get {
object obj = ResourceManager.GetObject("see_invisible", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap shock_resistance {
get {
object obj = ResourceManager.GetObject("shock_resistance", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap sleep_resistance {
get {
object obj = ResourceManager.GetObject("sleep_resistance", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap slow_digestion {
get {
object obj = ResourceManager.GetObject("slow_digestion", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap speed {
get {
object obj = ResourceManager.GetObject("speed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap stealth {
get {
object obj = ResourceManager.GetObject("stealth", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap telepathy {
get {
object obj = ResourceManager.GetObject("telepathy", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap teleport_control {
get {
object obj = ResourceManager.GetObject("teleport_control", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap teleportitis {
get {
object obj = ResourceManager.GetObject("teleportitis", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap warning {
get {
object obj = ResourceManager.GetObject("warning", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@@ -0,0 +1,226 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="acid_resistance" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\acid_resistance.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="aggravate_monster" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\aggravate_monster.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="angry_god" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\angry_god.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="cold_resistance" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\cold_resistance.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="conflict" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\conflict.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="disintegration_resistance" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\disintegration_resistance.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="fire_resistance" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\fire_resistance.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="food_appraisal" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\food_appraisal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="free_action" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\free_action.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="hunger" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\hunger.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="infravision" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\infravision.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="invisibility" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\invisibility.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="jumping" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\jumping.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="levitation" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\levitation.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="magical_breathing" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\magical_breathing.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="magic_resistance" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\magic_resistance.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="poison_resistance" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\poison_resistance.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="polymorphitis" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\polymorphitis.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="polymorph_control" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\polymorph_control.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="prayer_timeout" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\prayer_timeout.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="protection" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\protection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="protection_from_shape_changers" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\protection_from_shape_changers.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="reflection" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\reflection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="regeneration" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\regeneration.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="searching" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\searching.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="see_invisible" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\see_invisible.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="shock_resistance" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\shock_resistance.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sleep_resistance" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\sleep_resistance.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="slow_digestion" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\slow_digestion.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="speed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\speed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="stealth" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\stealth.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="telepathy" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\telepathy.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="teleportitis" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\teleportitis.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="teleport_control" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\teleport_control.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="warning" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\wwwroot\icons\warning.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

100
NethackHelper/PropertyBox.Designer.cs generated Normal file
View File

@@ -0,0 +1,100 @@
namespace NethackHelper {
partial class PropertyBox {
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.extrinsicCheckBox = new System.Windows.Forms.CheckBox();
this.intrinsicCheckBox = new System.Windows.Forms.CheckBox();
this.propertyLabel = new System.Windows.Forms.Label();
this.propertyIcon = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize) this.propertyIcon).BeginInit();
this.SuspendLayout();
//
// extrinsicCheckBox
//
this.extrinsicCheckBox.Dock = System.Windows.Forms.DockStyle.Left;
this.extrinsicCheckBox.Location = new System.Drawing.Point(0, 0);
this.extrinsicCheckBox.Name = "extrinsicCheckBox";
this.extrinsicCheckBox.Padding = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.extrinsicCheckBox.Size = new System.Drawing.Size(23, 30);
this.extrinsicCheckBox.TabIndex = 0;
this.extrinsicCheckBox.UseVisualStyleBackColor = true;
this.extrinsicCheckBox.CheckedChanged += this.extrinsicCheckBox_CheckedChanged;
//
// intrinsicCheckBox
//
this.intrinsicCheckBox.Dock = System.Windows.Forms.DockStyle.Left;
this.intrinsicCheckBox.Location = new System.Drawing.Point(23, 0);
this.intrinsicCheckBox.Name = "intrinsicCheckBox";
this.intrinsicCheckBox.Padding = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.intrinsicCheckBox.Size = new System.Drawing.Size(23, 30);
this.intrinsicCheckBox.TabIndex = 1;
this.intrinsicCheckBox.UseVisualStyleBackColor = true;
this.intrinsicCheckBox.CheckedChanged += this.intrinsicCheckBox_CheckedChanged;
//
// propertyLabel
//
this.propertyLabel.Dock = System.Windows.Forms.DockStyle.Fill;
this.propertyLabel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.propertyLabel.Location = new System.Drawing.Point(68, 0);
this.propertyLabel.Name = "propertyLabel";
this.propertyLabel.Padding = new System.Windows.Forms.Padding(0, 0, 0, 2);
this.propertyLabel.Size = new System.Drawing.Size(232, 30);
this.propertyLabel.TabIndex = 2;
this.propertyLabel.Text = "Silliness Resistance";
this.propertyLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// propertyIcon
//
this.propertyIcon.Dock = System.Windows.Forms.DockStyle.Left;
this.propertyIcon.Location = new System.Drawing.Point(46, 0);
this.propertyIcon.Margin = new System.Windows.Forms.Padding(0);
this.propertyIcon.Name = "propertyIcon";
this.propertyIcon.Size = new System.Drawing.Size(22, 30);
this.propertyIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.propertyIcon.TabIndex = 3;
this.propertyIcon.TabStop = false;
this.propertyIcon.Visible = false;
//
// PropertyBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.propertyLabel);
this.Controls.Add(this.propertyIcon);
this.Controls.Add(this.intrinsicCheckBox);
this.Controls.Add(this.extrinsicCheckBox);
this.Name = "PropertyBox";
this.Size = new System.Drawing.Size(300, 30);
((System.ComponentModel.ISupportInitialize) this.propertyIcon).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.CheckBox extrinsicCheckBox;
private System.Windows.Forms.CheckBox intrinsicCheckBox;
private System.Windows.Forms.Label propertyLabel;
private System.Windows.Forms.PictureBox propertyIcon;
}
}

View File

@@ -0,0 +1,99 @@
namespace NethackHelper {
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public partial class PropertyBox : UserControl {
public PropertyBox() {
InitializeComponent();
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public string PropertyKey { get; set; }
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public string PropertyName {
get {
return propertyLabel.Text;
}
set {
propertyLabel.Text = value;
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public bool AllowExtrinsic {
get {
return extrinsicCheckBox.Enabled;
}
set {
extrinsicCheckBox.Enabled = value;
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public bool AllowIntrinsic {
get {
return intrinsicCheckBox.Enabled;
}
set {
intrinsicCheckBox.Enabled = value;
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public bool HasExtrinsic {
get {
return extrinsicCheckBox.Checked;
}
set {
extrinsicCheckBox.Checked = value;
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public bool HasIntrinsic {
get {
return intrinsicCheckBox.Checked;
}
set {
intrinsicCheckBox.Checked = value;
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public Image? PropertyImage {
get {
return propertyIcon.Visible ? propertyIcon.Image : null;
}
set {
propertyIcon.Visible = value != null;
if (value != null) {
propertyIcon.Image = value;
}
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public Property Property {
get {
return new() {
Extrinsic = HasExtrinsic,
Intrinsic = HasIntrinsic,
};
}
set {
HasExtrinsic = value.Extrinsic;
HasIntrinsic = value.Intrinsic;
}
}
private void intrinsicCheckBox_CheckedChanged(object sender, System.EventArgs e) {
TrackerManager.Instance.Tracker.UpdateProperty(PropertyKey, "intrinsic", intrinsicCheckBox.Checked);
}
private void extrinsicCheckBox_CheckedChanged(object sender, System.EventArgs e) {
TrackerManager.Instance.Tracker.UpdateProperty(PropertyKey, "extrinsic", extrinsicCheckBox.Checked);
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -18,13 +18,18 @@
private SaveData() {
var fileName = Path.Combine(Application.UserAppDataPath, SAVE_NAME);
var save = YamlOptions.DeserializeFileOrDefault<SaveFile>(fileName);
SaveFile? save = null;
try {
save = YamlOptions.DeserializeFileOrDefault<SaveFile>(fileName);
} catch (YamlDotNet.Core.YamlException) {
}
if (save != null) {
this.Version = save.Version;
this.CharismaClass = save.CharismaClass;
this.Sucker = save.Sucker;
this.Intrinsics = save.Intrinsics;
this.Properties = save.Properties;
if (save.Potions != null && save.Potions.Count > 0) {
this.Potions = new(save.Potions);
}
@@ -59,7 +64,7 @@
Version = this.Version,
CharismaClass = this.CharismaClass,
Sucker = this.Sucker,
Intrinsics = this.Intrinsics,
Properties = this.Properties,
Potions = this.Potions?.Export() ?? [],
Rings = this.Rings?.Export() ?? [],
Scrolls = this.Scrolls?.Export() ?? [],
@@ -85,13 +90,13 @@
this.Amulets = null;
this.Tools = null;
this.Armor = null;
this.Intrinsics = new();
this.Properties = new();
}
public string Version { get; set; } = string.Empty;
public CharismaClass CharismaClass { get; set; } = CharismaClass.DefaultClass;
public bool Sucker { get; set; }
public Intrinsics Intrinsics { get; set; } = new();
public GameProperties Properties { get; set; } = new();
public IdentificationRecord? Potions { get; set; }
public IdentificationRecord? Rings { get; set; }
public IdentificationRecord? Scrolls { get; set; }
@@ -131,7 +136,7 @@
public string Version { get; set; } = string.Empty;
public CharismaClass CharismaClass { get; set; } = CharismaClass.DefaultClass;
public bool Sucker { get; set; }
public Intrinsics Intrinsics { get; set; } = new();
public GameProperties Properties { get; set; } = new();
public List<ItemRecord> Potions { get; set; } = [];
public List<ItemRecord> Rings { get; set; } = [];
@@ -143,29 +148,50 @@
public List<ItemRecord> Armor { get; set; } = [];
}
public class Intrinsics {
public bool ColdResistance { get; set; }
public bool DisintegrationResistance { get; set; }
public bool FireResistance { get; set; }
public bool Invisible { get; set; }
public bool PoisonResistance { get; set; }
public bool Searching { get; set; }
public bool SeeInvisible { get; set; }
public bool ShockResistance { get; set; }
public bool SleepResistance { get; set; }
public bool Speed { get; set; }
public bool Stealth { get; set; }
public bool Telepathy { get; set; }
public bool TeleportControl { get; set; }
public bool Teleportitis { get; set; }
public bool Warning { get; set; }
public int Protection { get; set; }
public int LastPrayer { get; set; }
public struct Property {
public bool Intrinsic { get; set; }
public bool Extrinsic { get; set; }
}
public class IntrinsicsSource : BindingSource {
public IntrinsicsSource() {
this.DataSource = SaveData.Instance.Intrinsics;
public class GameProperties {
public Property ColdResistance { get; set; }
public Property DisintegrationResistance { get; set; }
public Property FireResistance { get; set; }
public Property Invisibility { get; set; }
public Property PoisonResistance { get; set; }
public Property Searching { get; set; }
public Property SeeInvisible { get; set; }
public Property ShockResistance { get; set; }
public Property SleepResistance { get; set; }
public Property Speed { get; set; }
public Property Stealth { get; set; }
public Property Telepathy { get; set; }
public Property TeleportControl { get; set; }
public Property Teleportitis { get; set; }
public Property Warning { get; set; }
public Property ProtectionFromShapeChangers { get; set; }
public Property PolymorphControl { get; set; }
public Property Polymorphitis { get; set; }
public Property MagicResistance { get; set; }
public Property Reflection { get; set; }
public Property Regeneration { get; set; }
public Property Conflict { get; set; }
public Property AggravateMonster { get; set; }
public Property MagicalBreathing { get; set; }
public Property AcidResistance { get; set; }
public Property SlowDigestion { get; set; }
public Property FreeAction { get; set; }
public Property Hunger { get; set; }
public int Protection { get; set; }
public int LastPrayer { get; set; }
public bool GodAngry { get; set; }
}
public class PropertiesSource : BindingSource {
public PropertiesSource() {
this.DataSource = SaveData.Instance.Properties;
}
}

View File

@@ -0,0 +1,22 @@
namespace NethackHelper {
using System;
internal class TrackerManager {
private static TrackerManager? instance;
public static TrackerManager Instance {
get {
instance ??= new();
return instance;
}
}
public ITrackingClient Tracker { get; set; } = new DummyTrackingClient();
public void RequestUpdate() {
OnRequestUpdate?.Invoke();
}
public event Action? OnRequestUpdate;
}
}

View File

@@ -0,0 +1,17 @@
namespace NethackHelper {
using System.Threading.Tasks;
public interface ITrackingClient {
Task UpdateProperty(string property, string type, bool has);
Task UpdateProtection(int protection);
Task UpdatePrayer(int last_prayed);
Task UpdateAngry(bool is_angry);
}
internal class DummyTrackingClient : ITrackingClient {
public Task UpdateProperty(string property, string type, bool has) => Task.CompletedTask;
public Task UpdateProtection(int protection) => Task.CompletedTask;
public Task UpdatePrayer(int last_prayed) => Task.CompletedTask;
public Task UpdateAngry(bool is_angry) => Task.CompletedTask;
}
}

View File

@@ -0,0 +1,6 @@
namespace NethackHelper {
using Microsoft.AspNetCore.SignalR;
public class TrackingHub : Hub<ITrackingClient> { }
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 821 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

View File

@@ -0,0 +1,4 @@
for var in "$@"
do
magick "$var" -grayscale rec709luma -level 0,150% "$(dirname "$var")/no_$(basename "$var")"
done

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 789 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 800 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 762 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 831 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 706 B

View File

@@ -0,0 +1,83 @@
body {
--icon-size: 45px;
--gap-size: 4px;
--overlay-size: 30px;
}
.mainTable {
margin: auto;
}
.propertiesList {
margin: auto;
border-spacing: 0;
display: flex;
flex-direction: row;
width: fit-content;
flex-wrap: wrap;
max-width: calc(8 * var(--icon-size) + 16 * var(--gap-size));
justify-content: center;
}
.variablesList {
margin: auto;
display: flex;
width: fit-content;
padding-top: 25px;
padding-bottom: 15px;
gap: 20px;
}
.cell {
position: relative;
padding: var(--gap-size);
}
.hidden {
display: none !important;
}
img {
-ms-interpolation-mode: nearest-neighbor;
image-rendering: crisp-edges;
image-rendering: pixelated;
}
.cell-icon {
display: block;
width: var(--icon-size);
height: var(--icon-size);
}
.overlay-icon {
display: block;
position: absolute;
left: 0;
bottom: 0;
width: var(--overlay-size);
height: var(--overlay-size);
}
.pb-10 {
padding-bottom: 10px;
}
.mb-5 {
margin-bottom: 5px;
}
.inline {
display: inline;
vertical-align: middle;
}
.value-text {
font-family: 'Comic Mono';
font-size: 32px;
text-align: center;
color: white;
text-shadow: black 0 0 4px;
vertical-align: middle;
--webkit-font-smoothing: antialiased;
padding-top: 4px;
}

View File

@@ -0,0 +1,331 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Item Tracker</title>
<link rel="stylesheet" href="tracker.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/comic-mono@0.0.1/index.css">
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/microsoft-signalr/6.0.1/signalr.js"></script>
<script src="tracker.js"></script>
</head>
<body>
<div class="mainTable">
<div class="propertiesList pb-10">
<div class="cell">
<img class="cell-icon intrinsic has-not"
data-property="cold_resistance"
src="icons/no_cold_resistance.png" />
<img class="cell-icon intrinsic has hidden"
data-property="cold_resistance"
src="icons/cold_resistance.png" />
</div>
<div class="cell">
<img class="cell-icon intrinsic has-not"
data-property="fire_resistance"
src="icons/no_fire_resistance.png" />
<img class="cell-icon intrinsic has hidden"
data-property="fire_resistance"
src="icons/fire_resistance.png" />
</div>
<div class="cell">
<img class="cell-icon intrinsic has-not"
data-property="poison_resistance"
src="icons/no_poison_resistance.png" />
<img class="cell-icon intrinsic has hidden"
data-property="poison_resistance"
src="icons/poison_resistance.png" />
</div>
<div class="cell">
<img class="cell-icon intrinsic has-not"
data-property="shock_resistance"
src="icons/no_shock_resistance.png" />
<img class="cell-icon intrinsic has hidden"
data-property="shock_resistance"
src="icons/shock_resistance.png" />
</div>
<div class="cell">
<img class="cell-icon intrinsic has-not"
data-property="sleep_resistance"
src="icons/no_sleep_resistance.png" />
<img class="cell-icon intrinsic has hidden"
data-property="sleep_resistance"
src="icons/sleep_resistance.png" />
</div>
<div class="cell">
<img class="cell-icon intrinsic has-not"
data-property="see_invisible"
src="icons/no_see_invisible.png" />
<img class="cell-icon intrinsic has hidden"
data-property="see_invisible"
src="icons/see_invisible.png" />
</div>
<div class="cell">
<img class="cell-icon intrinsic has-not"
data-property="speed"
src="icons/no_speed.png" />
<img class="cell-icon intrinsic has hidden"
data-property="speed"
src="icons/speed.png" />
</div>
<div class="cell">
<img class="cell-icon intrinsic has-not"
data-property="telepathy"
src="icons/no_telepathy.png" />
<img class="cell-icon intrinsic has hidden"
data-property="telepathy"
src="icons/telepathy.png" />
</div>
</div>
<div class="propertiesList">
<div data-property="aggravate_monster"
class="cell intrinsic has hidden">
<img class="cell-icon"
src="icons/aggravate_monster.png" />
</div>
<div data-property="disintegration_resistance"
class="cell intrinsic has hidden">
<img class="cell-icon"
src="icons/disintegration_resistance.png" />
</div>
<div data-property="invisibility"
class="cell intrinsic has hidden">
<img class="cell-icon"
src="icons/invisibility.png" />
</div>
<div data-property="searching"
class="cell intrinsic has hidden">
<img class="cell-icon"
src="icons/searching.png" />
</div>
<div data-property="stealth"
class="cell intrinsic has hidden">
<img class="cell-icon"
src="icons/stealth.png" />
</div>
<div data-property="teleportitis"
class="cell intrinsic has hidden">
<img class="cell-icon"
src="icons/teleportitis.png" />
</div>
<div data-property="teleport_control"
class="cell intrinsic has hidden">
<img class="cell-icon"
src="icons/teleport_control.png" />
</div>
<div data-property="warning"
class="cell intrinsic has hidden">
<img class="cell-icon"
src="icons/warning.png" />
</div>
<div data-property="polymorphitis"
class="cell intrinsic has hidden">
<img class="cell-icon"
src="icons/polymorphitis.png" />
</div>
<div data-property="polymorph_control"
class="cell intrinsic has hidden">
<img class="cell-icon"
src="icons/polymorph_control.png" />
</div>
<div data-property="protection_from_shape_changers"
class="cell intrinsic has hidden">
<img class="cell-icon"
src="icons/protection_from_shape_changers.png" />
</div>
<div data-property="hunger"
class="cell intrinsic has hidden">
<img class="cell-icon"
src="icons/hunger.png" />
</div>
<div data-property="regeneration"
class="cell intrinsic has hidden">
<img class="cell-icon"
src="icons/regeneration.png" />
<img class="overlay-icon"
src="icons/hunger.png" />
</div>
<div data-property="conflict"
class="cell intrinsic has hidden">
<img class="cell-icon"
src="icons/conflict.png" />
<img class="overlay-icon"
src="icons/hunger.png" />
</div>
<div data-property="magical_breathing"
class="cell intrinsic has hidden">
<img class="cell-icon"
src="icons/magical_breathing.png" />
</div>
</div>
<div class="variablesList">
<div data-property="angry_god"
class="cell hidden">
<img class="cell-icon"
src="icons/angry_god.png" />
</div>
<div class="cell">
<img class="cell-icon inline mb-5"
src="icons/protection.png" />
<span class="value-text">
<span class="protection-value">0</span>
</span>
</div>
<div class="cell">
<img class="cell-icon inline"
src="icons/prayer_timeout.png" />
<span class="value-text">
<span class="prayer-timeout">0</span>
</span>
</div>
</div>
<div class="propertiesList">
<div data-property="acid_resistance"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/acid_resistance.png" />
</div>
<div data-property="free_action"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/free_action.png" />
</div>
<div data-property="magic_resistance"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/magic_resistance.png" />
</div>
<div data-property="reflection"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/reflection.png" />
</div>
<div data-property="slow_digestion"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/slow_digestion.png" />
</div>
<div data-property="cold_resistance"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/cold_resistance.png" />
</div>
<div data-property="fire_resistance"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/fire_resistance.png" />
</div>
<div data-property="poison_resistance"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/poison_resistance.png" />
</div>
<div data-property="shock_resistance"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/shock_resistance.png" />
</div>
<div data-property="sleep_resistance"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/sleep_resistance.png" />
</div>
<div data-property="see_invisible"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/see_invisible.png" />
</div>
<div data-property="speed"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/speed.png" />
</div>
<div data-property="telepathy"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/telepathy.png" />
</div>
<div data-property="aggravate_monster"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/aggravate_monster.png" />
</div>
<div data-property="disintegration_resistance"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/disintegration_resistance.png" />
</div>
<div data-property="invisibility"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/invisibility.png" />
</div>
<div data-property="searching"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/searching.png" />
</div>
<div data-property="stealth"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/stealth.png" />
</div>
<div data-property="teleportitis"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/teleportitis.png" />
</div>
<div data-property="teleport_control"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/teleport_control.png" />
</div>
<div data-property="warning"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/warning.png" />
</div>
<div data-property="polymorphitis"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/polymorphitis.png" />
</div>
<div data-property="polymorph_control"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/polymorph_control.png" />
</div>
<div data-property="protection_from_shape_changers"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/protection_from_shape_changers.png" />
</div>
<div data-property="hunger"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/hunger.png" />
</div>
<div data-property="regeneration"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/regeneration.png" />
</div>
<div data-property="conflict"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/conflict.png" />
</div>
<div data-property="magical_breathing"
class="cell extrinsic has hidden">
<img class="cell-icon"
src="icons/magical_breathing.png" />
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,48 @@
const connection =
new signalR.HubConnectionBuilder()
.withUrl("/webview")
.build();
async function start() {
try {
await connection.start();
} catch (err) {
console.log(err);
setTimeout(start, 2000);
}
}
start();
connection.onclose(async () => setTimeout(start, 2000));
connection.on("UpdateProperty", updateProperty);
connection.on("UpdatePrayer", updatePrayer);
connection.on("UpdateProtection", updateProtection);
connection.on("UpdateAngry", updateAngry);
function updateProperty(property, type, has) {
if (has) {
$(`.${type}.has[data-property='${property}']`).removeClass("hidden");
$(`.${type}.has-not[data-property='${property}']`).addClass("hidden");
} else {
$(`.${type}.has-not[data-property='${property}']`).removeClass("hidden");
$(`.${type}.has[data-property='${property}']`).addClass("hidden");
}
}
function updatePrayer(last_prayer) {
$(".prayer-timeout").text(last_prayer);
}
function updateProtection(protection) {
$(".protection-value").text(protection);
}
function updateAngry(is_angry) {
if (is_angry) {
$("[data-property='angry_god']").removeClass("hidden");
} else {
$("[data-property='angry_god']").addClass("hidden");
}
}