mirror of
https://github.com/kwsch/NHSE.git
synced 2026-04-24 23:27:14 -05:00
Add activity count edit
See EventFlagsPlayerActivityParam.csv , unlabeled for now as I'm not sure how exactly these align
This commit is contained in:
parent
8aa1f9ad5e
commit
98a98f5cf4
|
|
@ -76,6 +76,18 @@ public IReadOnlyList<Item> Storage
|
|||
set => Item.SetArray(value).CopyTo(Data, Offsets.Storage);
|
||||
}
|
||||
|
||||
public uint[] GetActivities()
|
||||
{
|
||||
var result = new uint[Offsets.MaxActivityID];
|
||||
Buffer.BlockCopy(Data, Offsets.Activity, result, 0, sizeof(uint) * result.Length);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void SetActivities(uint[] activities)
|
||||
{
|
||||
Buffer.BlockCopy(activities, 0, Data, Offsets.Activity, sizeof(uint) * Offsets.MaxActivityID);
|
||||
}
|
||||
|
||||
public bool[] GetRecipeList() => ArrayUtil.GitBitFlagArray(Data, Offsets.Recipes, Offsets.MaxRecipeID + 1);
|
||||
public void SetRecipeList(bool[] value) => ArrayUtil.SetBitFlagArray(Data, Offsets.Recipes, value);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,18 +8,20 @@ namespace NHSE.Core
|
|||
public abstract class PersonalOffsets
|
||||
{
|
||||
public abstract int PersonalId { get; }
|
||||
public abstract int Activity { get; }
|
||||
public abstract int Wallet { get; }
|
||||
public abstract int Bank { get; }
|
||||
public abstract int NookMiles { get; }
|
||||
public abstract int Photo { get; }
|
||||
|
||||
public abstract int Pockets1 { get; }
|
||||
public abstract int Pockets2 { get; }
|
||||
public abstract int Storage { get; }
|
||||
|
||||
public abstract int Recipes { get; }
|
||||
public abstract int ReceivedItems { get; }
|
||||
|
||||
public abstract int Bank { get; }
|
||||
public abstract int Recipes { get; }
|
||||
|
||||
public int MaxActivityID { get; } = 100; // guess
|
||||
public int Pockets1Count { get; } = 20;
|
||||
public int Pockets2Count { get; } = 20;
|
||||
public int StorageCount { get; } = 5000;
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
public sealed class PersonalOffsets10 : PersonalOffsets
|
||||
{
|
||||
public override int PersonalId => 0xB0A0;
|
||||
public override int Activity => 0xCF6C;
|
||||
public override int Wallet => 0x11578;
|
||||
public override int Bank => 0x68BE4;
|
||||
public override int NookMiles => 0x11570;
|
||||
public override int Photo => 0x11598;
|
||||
|
||||
|
|
@ -16,6 +16,7 @@ public sealed class PersonalOffsets10 : PersonalOffsets
|
|||
public override int Storage => Pockets2 + (8 * Pockets2Count) + 0x24;
|
||||
public override int ReceivedItems => 0x3FC1C;
|
||||
|
||||
public override int Bank => 0x68BE4;
|
||||
public override int Recipes => 0x68BF4;
|
||||
}
|
||||
}
|
||||
|
|
@ -5,17 +5,18 @@
|
|||
/// </summary>
|
||||
public sealed class PersonalOffsets11 : PersonalOffsets
|
||||
{
|
||||
public override int PersonalId => 0xB0B8;
|
||||
public override int Wallet => 0x11590;
|
||||
public override int Bank => 0x68C34;
|
||||
public override int NookMiles => 0x11588;
|
||||
public override int Photo => 0x115C4;
|
||||
public override int PersonalId => 0xB0B8; // +0x18 from v1.0
|
||||
public override int Activity => 0xCF84; // +0x18 from v1.0
|
||||
public override int Wallet => 0x11590; // +0x18 from v1.0
|
||||
public override int NookMiles => 0x11588; // +0x18 from v1.0
|
||||
public override int Photo => 0x115C4; // +0x18 from v1.0
|
||||
|
||||
public override int Pockets1 => 0x35C20; // +0x4C from v1.0
|
||||
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
|
||||
public override int Storage => Pockets2 + (8 * Pockets2Count) + 0x24;
|
||||
public override int ReceivedItems => 0x3FC68; // +0x4C from v1.0
|
||||
|
||||
public override int Bank => 0x68C34; // +0x50 from v1.0
|
||||
public override int Recipes => 0x68C44; // + 0x50 from v1.0
|
||||
}
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@ public class Building : INamedObject
|
|||
[Category(Details), Description("Y Coordinate of Building")]
|
||||
public ushort Y { get; set; }
|
||||
|
||||
public ushort Z { get; set; } // Guess
|
||||
public ushort Rotation { get; set; }
|
||||
|
||||
public uint Unk08 { get; set; }
|
||||
public uint Unk0C { get; set; }
|
||||
|
|
@ -29,7 +29,7 @@ public class Building : INamedObject
|
|||
public void Clear()
|
||||
{
|
||||
BuildingId = 0;
|
||||
X = Y = Z = 0;
|
||||
X = Y = Rotation = 0;
|
||||
Unk08 = Unk0C = Unk10 = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
81
NHSE.Core/Structures/Records/ActivityNames.cs
Normal file
81
NHSE.Core/Structures/Records/ActivityNames.cs
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace NHSE.Core
|
||||
{
|
||||
public static class ActivityNames
|
||||
{
|
||||
private const string Unknown = "???";
|
||||
|
||||
private static readonly IReadOnlyDictionary<int, string> Dictionary = new Dictionary<int, string>
|
||||
{
|
||||
// {00,"PlayTime"},
|
||||
// {01,"GetFishCount"},
|
||||
// {02,"GetInsectCount"},
|
||||
// {03,"GetShellfishCount"},
|
||||
// {04,"GetShellDriftCount"},
|
||||
// {05,"BreakBalloonCount"},
|
||||
// {06,"WishStarCount"},
|
||||
// {07,"ShakeTreeCount"},
|
||||
// {08,"DropWoodCount"},
|
||||
// {09,"CutTreeCount"},
|
||||
// {10,"PlantTreeCount"},
|
||||
// {11,"WaterFlowerCount"},
|
||||
// {12,"UseReactionCount"},
|
||||
// {13,"VisitOtherIslandCount"},
|
||||
// {14,"InviteVisitorNum"},
|
||||
// {15,"DiyCount"},
|
||||
// {16,"BreakToolCount"},
|
||||
// {17,"InMyHouseTime"},
|
||||
// {18,"InFieldTime"},
|
||||
// {19,"FillPitCount"},
|
||||
// {20,"CaughtPitCount"},
|
||||
// {21,"InteriorModeTime"},
|
||||
// {22,"DesignEditTime"},
|
||||
// {34,"TalkNpc0Count"},
|
||||
// {35,"TalkNpc1Count"},
|
||||
// {36,"TalkNpc2Count"},
|
||||
// {37,"TalkNpc3Count"},
|
||||
// {38,"TalkNpc4Count"},
|
||||
// {39,"TalkNpc5Count"},
|
||||
// {40,"TalkNpc6Count"},
|
||||
// {41,"TalkNpc7Count"},
|
||||
// {42,"TalkNpc8Count"},
|
||||
// {43,"TalkNpc9Count"},
|
||||
// {44,"TalkAllNpcCount"},
|
||||
// {45,"BittenBeeCount"},
|
||||
// {46,"DigFossilCount"},
|
||||
// {47,"HitStoneCount"},
|
||||
// {48,"PlantMoneyFlag"},
|
||||
// {49,"PickUpFruitsCount"},
|
||||
// {50,"UseSmartphoneFieldCount"},
|
||||
// {51,"UseSmartphoneFieldTime"},
|
||||
// {52,"WayEditCount"},
|
||||
// {53,"RiverEditCount"},
|
||||
// {54,"CliffEditCount"},
|
||||
// {55,"FenceEditCount"},
|
||||
// {56,"MoveFurnitureFieldCount"},
|
||||
// {57,"GetMiles"},
|
||||
// {58,"ReturnLoanFlag"},
|
||||
// {59,"EnterShopCount"},
|
||||
// {60,"ChangeMelodyFlag"},
|
||||
// {61,"ChangeFlagFlag"},
|
||||
// {62,"TransformFieldCount"},
|
||||
// {63,"JumpWithPoleCount"},
|
||||
// {64,"TurnipBuyTotal"},
|
||||
// {65,"TurnipSellPrice"},
|
||||
// {66,"ChatBalloonCount"},
|
||||
// {67,"PullWeedCount"},
|
||||
// {68,"ChangeHairFlag"},
|
||||
// {69,"ChangeFaceFlag"},
|
||||
// {70,"TakePictureCount"},
|
||||
};
|
||||
|
||||
public static string GetActivityName(int index, uint count)
|
||||
{
|
||||
var dict = Dictionary;
|
||||
if (dict.TryGetValue(index, out var val))
|
||||
return $"{index:00} - {val} = {count}";
|
||||
return $"{index:00} - {Unknown} = {count}";
|
||||
}
|
||||
}
|
||||
}
|
||||
65
NHSE.WinForms/Editor.Designer.cs
generated
65
NHSE.WinForms/Editor.Designer.cs
generated
|
|
@ -39,6 +39,7 @@ private void InitializeComponent()
|
|||
this.Menu_LoadDecrypted = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.TC_Editors = new System.Windows.Forms.TabControl();
|
||||
this.Tab_Players = new System.Windows.Forms.TabPage();
|
||||
this.B_EditActivities = new System.Windows.Forms.Button();
|
||||
this.B_EditPlayerReceivedItems = new System.Windows.Forms.Button();
|
||||
this.B_EditPlayerStorage = new System.Windows.Forms.Button();
|
||||
this.B_EditPlayerRecipes = new System.Windows.Forms.Button();
|
||||
|
|
@ -83,8 +84,8 @@ private void InitializeComponent()
|
|||
this.NUD_PatternIndex = new System.Windows.Forms.NumericUpDown();
|
||||
this.PB_Pattern = new System.Windows.Forms.PictureBox();
|
||||
this.Tab_Map = new System.Windows.Forms.TabPage();
|
||||
this.B_RecycleBin = new System.Windows.Forms.Button();
|
||||
this.B_EditBuildings = new System.Windows.Forms.Button();
|
||||
this.B_RecycleBin = new System.Windows.Forms.Button();
|
||||
this.Menu_Editor.SuspendLayout();
|
||||
this.TC_Editors.SuspendLayout();
|
||||
this.Tab_Players.SuspendLayout();
|
||||
|
|
@ -191,6 +192,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// Tab_Players
|
||||
//
|
||||
this.Tab_Players.Controls.Add(this.B_EditActivities);
|
||||
this.Tab_Players.Controls.Add(this.B_EditPlayerReceivedItems);
|
||||
this.Tab_Players.Controls.Add(this.B_EditPlayerStorage);
|
||||
this.Tab_Players.Controls.Add(this.B_EditPlayerRecipes);
|
||||
|
|
@ -215,6 +217,16 @@ private void InitializeComponent()
|
|||
this.Tab_Players.Text = "Players";
|
||||
this.Tab_Players.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// B_EditActivities
|
||||
//
|
||||
this.B_EditActivities.Location = new System.Drawing.Point(301, 122);
|
||||
this.B_EditActivities.Name = "B_EditActivities";
|
||||
this.B_EditActivities.Size = new System.Drawing.Size(92, 40);
|
||||
this.B_EditActivities.TabIndex = 16;
|
||||
this.B_EditActivities.Text = "Edit Activities";
|
||||
this.B_EditActivities.UseVisualStyleBackColor = true;
|
||||
this.B_EditActivities.Click += new System.EventHandler(this.B_EditActivities_Click);
|
||||
//
|
||||
// B_EditPlayerReceivedItems
|
||||
//
|
||||
this.B_EditPlayerReceivedItems.Location = new System.Drawing.Point(300, 168);
|
||||
|
|
@ -257,7 +269,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// L_Wallet
|
||||
//
|
||||
this.L_Wallet.Location = new System.Drawing.Point(142, 59);
|
||||
this.L_Wallet.Location = new System.Drawing.Point(142, 51);
|
||||
this.L_Wallet.Name = "L_Wallet";
|
||||
this.L_Wallet.Size = new System.Drawing.Size(84, 20);
|
||||
this.L_Wallet.TabIndex = 11;
|
||||
|
|
@ -266,7 +278,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// NUD_Wallet
|
||||
//
|
||||
this.NUD_Wallet.Location = new System.Drawing.Point(232, 59);
|
||||
this.NUD_Wallet.Location = new System.Drawing.Point(232, 51);
|
||||
this.NUD_Wallet.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
|
|
@ -278,7 +290,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// L_NookMiles
|
||||
//
|
||||
this.L_NookMiles.Location = new System.Drawing.Point(142, 111);
|
||||
this.L_NookMiles.Location = new System.Drawing.Point(142, 95);
|
||||
this.L_NookMiles.Name = "L_NookMiles";
|
||||
this.L_NookMiles.Size = new System.Drawing.Size(84, 20);
|
||||
this.L_NookMiles.TabIndex = 9;
|
||||
|
|
@ -287,7 +299,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// NUD_NookMiles
|
||||
//
|
||||
this.NUD_NookMiles.Location = new System.Drawing.Point(232, 111);
|
||||
this.NUD_NookMiles.Location = new System.Drawing.Point(232, 95);
|
||||
this.NUD_NookMiles.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
|
|
@ -299,7 +311,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// L_BankBells
|
||||
//
|
||||
this.L_BankBells.Location = new System.Drawing.Point(142, 85);
|
||||
this.L_BankBells.Location = new System.Drawing.Point(142, 73);
|
||||
this.L_BankBells.Name = "L_BankBells";
|
||||
this.L_BankBells.Size = new System.Drawing.Size(84, 20);
|
||||
this.L_BankBells.TabIndex = 7;
|
||||
|
|
@ -308,7 +320,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// NUD_BankBells
|
||||
//
|
||||
this.NUD_BankBells.Location = new System.Drawing.Point(232, 85);
|
||||
this.NUD_BankBells.Location = new System.Drawing.Point(232, 73);
|
||||
this.NUD_BankBells.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
|
|
@ -320,14 +332,14 @@ private void InitializeComponent()
|
|||
//
|
||||
// TB_TownName
|
||||
//
|
||||
this.TB_TownName.Location = new System.Drawing.Point(232, 33);
|
||||
this.TB_TownName.Location = new System.Drawing.Point(232, 29);
|
||||
this.TB_TownName.Name = "TB_TownName";
|
||||
this.TB_TownName.Size = new System.Drawing.Size(100, 20);
|
||||
this.TB_TownName.TabIndex = 5;
|
||||
//
|
||||
// L_TownName
|
||||
//
|
||||
this.L_TownName.Location = new System.Drawing.Point(142, 33);
|
||||
this.L_TownName.Location = new System.Drawing.Point(142, 29);
|
||||
this.L_TownName.Name = "L_TownName";
|
||||
this.L_TownName.Size = new System.Drawing.Size(84, 20);
|
||||
this.L_TownName.TabIndex = 4;
|
||||
|
|
@ -456,7 +468,7 @@ private void InitializeComponent()
|
|||
//
|
||||
this.L_InternalName.AutoSize = true;
|
||||
this.L_InternalName.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.L_InternalName.Location = new System.Drawing.Point(275, 35);
|
||||
this.L_InternalName.Location = new System.Drawing.Point(275, 31);
|
||||
this.L_InternalName.Name = "L_InternalName";
|
||||
this.L_InternalName.Size = new System.Drawing.Size(91, 14);
|
||||
this.L_InternalName.TabIndex = 22;
|
||||
|
|
@ -464,14 +476,14 @@ private void InitializeComponent()
|
|||
//
|
||||
// TB_Catchphrase
|
||||
//
|
||||
this.TB_Catchphrase.Location = new System.Drawing.Point(232, 85);
|
||||
this.TB_Catchphrase.Location = new System.Drawing.Point(232, 73);
|
||||
this.TB_Catchphrase.Name = "TB_Catchphrase";
|
||||
this.TB_Catchphrase.Size = new System.Drawing.Size(100, 20);
|
||||
this.TB_Catchphrase.TabIndex = 21;
|
||||
//
|
||||
// L_Catchphrase
|
||||
//
|
||||
this.L_Catchphrase.Location = new System.Drawing.Point(142, 85);
|
||||
this.L_Catchphrase.Location = new System.Drawing.Point(142, 73);
|
||||
this.L_Catchphrase.Name = "L_Catchphrase";
|
||||
this.L_Catchphrase.Size = new System.Drawing.Size(84, 20);
|
||||
this.L_Catchphrase.TabIndex = 20;
|
||||
|
|
@ -480,7 +492,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// L_Personality
|
||||
//
|
||||
this.L_Personality.Location = new System.Drawing.Point(142, 59);
|
||||
this.L_Personality.Location = new System.Drawing.Point(142, 51);
|
||||
this.L_Personality.Name = "L_Personality";
|
||||
this.L_Personality.Size = new System.Drawing.Size(84, 20);
|
||||
this.L_Personality.TabIndex = 19;
|
||||
|
|
@ -489,7 +501,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// NUD_Variant
|
||||
//
|
||||
this.NUD_Variant.Location = new System.Drawing.Point(232, 33);
|
||||
this.NUD_Variant.Location = new System.Drawing.Point(232, 29);
|
||||
this.NUD_Variant.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
|
|
@ -502,7 +514,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// L_Variant
|
||||
//
|
||||
this.L_Variant.Location = new System.Drawing.Point(142, 33);
|
||||
this.L_Variant.Location = new System.Drawing.Point(142, 29);
|
||||
this.L_Variant.Name = "L_Variant";
|
||||
this.L_Variant.Size = new System.Drawing.Size(84, 20);
|
||||
this.L_Variant.TabIndex = 17;
|
||||
|
|
@ -535,7 +547,7 @@ private void InitializeComponent()
|
|||
//
|
||||
this.CB_Personality.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.CB_Personality.FormattingEnabled = true;
|
||||
this.CB_Personality.Location = new System.Drawing.Point(232, 59);
|
||||
this.CB_Personality.Location = new System.Drawing.Point(232, 51);
|
||||
this.CB_Personality.Name = "CB_Personality";
|
||||
this.CB_Personality.Size = new System.Drawing.Size(100, 21);
|
||||
this.CB_Personality.TabIndex = 14;
|
||||
|
|
@ -697,16 +709,6 @@ private void InitializeComponent()
|
|||
this.Tab_Map.Text = "Map";
|
||||
this.Tab_Map.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// B_RecycleBin
|
||||
//
|
||||
this.B_RecycleBin.Location = new System.Drawing.Point(6, 168);
|
||||
this.B_RecycleBin.Name = "B_RecycleBin";
|
||||
this.B_RecycleBin.Size = new System.Drawing.Size(92, 40);
|
||||
this.B_RecycleBin.TabIndex = 13;
|
||||
this.B_RecycleBin.Text = "Edit Recycle Bin";
|
||||
this.B_RecycleBin.UseVisualStyleBackColor = true;
|
||||
this.B_RecycleBin.Click += new System.EventHandler(this.B_RecycleBin_Click);
|
||||
//
|
||||
// B_EditBuildings
|
||||
//
|
||||
this.B_EditBuildings.Location = new System.Drawing.Point(104, 168);
|
||||
|
|
@ -717,6 +719,16 @@ private void InitializeComponent()
|
|||
this.B_EditBuildings.UseVisualStyleBackColor = true;
|
||||
this.B_EditBuildings.Click += new System.EventHandler(this.B_EditBuildings_Click);
|
||||
//
|
||||
// B_RecycleBin
|
||||
//
|
||||
this.B_RecycleBin.Location = new System.Drawing.Point(6, 168);
|
||||
this.B_RecycleBin.Name = "B_RecycleBin";
|
||||
this.B_RecycleBin.Size = new System.Drawing.Size(92, 40);
|
||||
this.B_RecycleBin.TabIndex = 13;
|
||||
this.B_RecycleBin.Text = "Edit Recycle Bin";
|
||||
this.B_RecycleBin.UseVisualStyleBackColor = true;
|
||||
this.B_RecycleBin.Click += new System.EventHandler(this.B_RecycleBin_Click);
|
||||
//
|
||||
// Editor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
|
@ -815,6 +827,7 @@ private void InitializeComponent()
|
|||
private System.Windows.Forms.Label L_PatternName;
|
||||
private System.Windows.Forms.PictureBox PB_Palette;
|
||||
private System.Windows.Forms.Button B_EditBuildings;
|
||||
private System.Windows.Forms.Button B_EditActivities;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -216,6 +216,16 @@ private void SavePlayer(int index)
|
|||
wallet.Value = (uint)NUD_Wallet.Value;
|
||||
pers.Wallet = wallet;
|
||||
}
|
||||
|
||||
private void B_EditActivities_Click(object sender, EventArgs e)
|
||||
{
|
||||
var pers = SAV.Players[PlayerIndex].Personal;
|
||||
var records = pers.GetActivities();
|
||||
using var editor = new ActivityEditor(records);
|
||||
if (editor.ShowDialog() == DialogResult.OK)
|
||||
pers.SetActivities(records);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Villager Editing
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@
|
|||
<Compile Update="Subforms\ItemReceivedEditor.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Subforms\ActivityEditor.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="$(TargetFramework.StartsWith('net4')) AND '$(Configuration)' == 'Release'">
|
||||
|
|
|
|||
126
NHSE.WinForms/Subforms/ActivityEditor.Designer.cs
generated
Normal file
126
NHSE.WinForms/Subforms/ActivityEditor.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
namespace NHSE.WinForms
|
||||
{
|
||||
partial class ActivityEditor
|
||||
{
|
||||
/// <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 Windows Form 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.B_Cancel = new System.Windows.Forms.Button();
|
||||
this.B_Save = new System.Windows.Forms.Button();
|
||||
this.LB_Counts = new System.Windows.Forms.ListBox();
|
||||
this.NUD_Count = new System.Windows.Forms.NumericUpDown();
|
||||
this.L_Count = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.NUD_Count)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// B_Cancel
|
||||
//
|
||||
this.B_Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.B_Cancel.Location = new System.Drawing.Point(200, 226);
|
||||
this.B_Cancel.Name = "B_Cancel";
|
||||
this.B_Cancel.Size = new System.Drawing.Size(72, 23);
|
||||
this.B_Cancel.TabIndex = 7;
|
||||
this.B_Cancel.Text = "Cancel";
|
||||
this.B_Cancel.UseVisualStyleBackColor = true;
|
||||
this.B_Cancel.Click += new System.EventHandler(this.B_Cancel_Click);
|
||||
//
|
||||
// B_Save
|
||||
//
|
||||
this.B_Save.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.B_Save.Location = new System.Drawing.Point(200, 197);
|
||||
this.B_Save.Name = "B_Save";
|
||||
this.B_Save.Size = new System.Drawing.Size(72, 23);
|
||||
this.B_Save.TabIndex = 6;
|
||||
this.B_Save.Text = "Save";
|
||||
this.B_Save.UseVisualStyleBackColor = true;
|
||||
this.B_Save.Click += new System.EventHandler(this.B_Save_Click);
|
||||
//
|
||||
// LB_Counts
|
||||
//
|
||||
this.LB_Counts.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.LB_Counts.FormattingEnabled = true;
|
||||
this.LB_Counts.Location = new System.Drawing.Point(12, 12);
|
||||
this.LB_Counts.Name = "LB_Counts";
|
||||
this.LB_Counts.Size = new System.Drawing.Size(177, 238);
|
||||
this.LB_Counts.TabIndex = 8;
|
||||
this.LB_Counts.SelectedIndexChanged += new System.EventHandler(this.LB_Counts_SelectedIndexChanged);
|
||||
//
|
||||
// NUD_Count
|
||||
//
|
||||
this.NUD_Count.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.NUD_Count.Location = new System.Drawing.Point(200, 28);
|
||||
this.NUD_Count.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.NUD_Count.Name = "NUD_Count";
|
||||
this.NUD_Count.Size = new System.Drawing.Size(72, 20);
|
||||
this.NUD_Count.TabIndex = 9;
|
||||
this.NUD_Count.ValueChanged += new System.EventHandler(this.NUD_Count_ValueChanged);
|
||||
//
|
||||
// L_Count
|
||||
//
|
||||
this.L_Count.AutoSize = true;
|
||||
this.L_Count.Location = new System.Drawing.Point(197, 12);
|
||||
this.L_Count.Name = "L_Count";
|
||||
this.L_Count.Size = new System.Drawing.Size(38, 13);
|
||||
this.L_Count.TabIndex = 10;
|
||||
this.L_Count.Text = "Count:";
|
||||
//
|
||||
// RecordEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(284, 261);
|
||||
this.Controls.Add(this.L_Count);
|
||||
this.Controls.Add(this.NUD_Count);
|
||||
this.Controls.Add(this.LB_Counts);
|
||||
this.Controls.Add(this.B_Cancel);
|
||||
this.Controls.Add(this.B_Save);
|
||||
this.Icon = global::NHSE.WinForms.Properties.Resources.icon;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "RecordEditor";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Record Editor";
|
||||
((System.ComponentModel.ISupportInitialize)(this.NUD_Count)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button B_Cancel;
|
||||
private System.Windows.Forms.Button B_Save;
|
||||
private System.Windows.Forms.ListBox LB_Counts;
|
||||
private System.Windows.Forms.NumericUpDown NUD_Count;
|
||||
private System.Windows.Forms.Label L_Count;
|
||||
}
|
||||
}
|
||||
49
NHSE.WinForms/Subforms/ActivityEditor.cs
Normal file
49
NHSE.WinForms/Subforms/ActivityEditor.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
using NHSE.Core;
|
||||
|
||||
namespace NHSE.WinForms
|
||||
{
|
||||
public partial class ActivityEditor : Form
|
||||
{
|
||||
private readonly uint[] Counts;
|
||||
|
||||
public ActivityEditor(uint[] counts)
|
||||
{
|
||||
Counts = counts;
|
||||
InitializeComponent();
|
||||
for (int i = 0; i < counts.Length; i++)
|
||||
LB_Counts.Items.Add(ActivityNames.GetActivityName(i, counts[i]));
|
||||
DialogResult = DialogResult.Cancel;
|
||||
LB_Counts.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
private void B_Cancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
private void B_Save_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
|
||||
private int Index;
|
||||
|
||||
private void NUD_Count_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Index < 0)
|
||||
return;
|
||||
|
||||
Counts[Index] = (uint) NUD_Count.Value;
|
||||
LB_Counts.Items[Index] = ActivityNames.GetActivityName(Index, Counts[Index]);
|
||||
}
|
||||
|
||||
private void LB_Counts_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (LB_Counts.SelectedIndex < 0)
|
||||
return;
|
||||
|
||||
var val = Counts[Index = LB_Counts.SelectedIndex];
|
||||
NUD_Count.Value = (int) val;
|
||||
}
|
||||
}
|
||||
}
|
||||
120
NHSE.WinForms/Subforms/ActivityEditor.resx
Normal file
120
NHSE.WinForms/Subforms/ActivityEditor.resx
Normal 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>
|
||||
Loading…
Reference in New Issue
Block a user