mirror of
https://github.com/kwsch/NHSE.git
synced 2026-08-01 07:22:56 -05:00
Add received items list
has button to fill Bugs and Fish list in the Critterpedia
This commit is contained in:
parent
db4bba31f0
commit
ce631ae722
|
|
@ -18,6 +18,7 @@ public abstract class PersonalOffsets
|
|||
public abstract int Storage { get; }
|
||||
|
||||
public abstract int Recipes { get; }
|
||||
public abstract int ReceivedItems { get; }
|
||||
|
||||
public virtual int Pockets1Count { get; } = 20;
|
||||
public virtual int Pockets2Count { get; } = 20;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ public sealed class PersonalOffsets10 : PersonalOffsets
|
|||
public override int Pockets1 => 0x35BD4;
|
||||
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
|
||||
public override int Storage => Pockets2 + (8 * Pockets2Count) + 0x24;
|
||||
public override int ReceivedItems => 0x3FC1C;
|
||||
|
||||
public override int Recipes => 0x68BF4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,10 @@ public sealed class PersonalOffsets11 : PersonalOffsets
|
|||
public override int NookMiles => 0x11588;
|
||||
public override int Photo => 0x115C4;
|
||||
|
||||
public override int Pockets1 => 0x35C20;
|
||||
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 Recipes => 0x68C44; // + 0x50 from v1.0
|
||||
}
|
||||
|
|
|
|||
184
NHSE.Core/Structures/GameLists.cs
Normal file
184
NHSE.Core/Structures/GameLists.cs
Normal file
|
|
@ -0,0 +1,184 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace NHSE.Core.Structures
|
||||
{
|
||||
public static class GameLists
|
||||
{
|
||||
public static IReadOnlyList<ushort> Bugs = new ushort[]
|
||||
{
|
||||
582, // brown cicada
|
||||
583, // tiger butterfly
|
||||
584, // Rajah Brooke's birdwing
|
||||
585, // red dragonfly
|
||||
586, // Queen Alexandra's birdwing
|
||||
587, // pondskater
|
||||
588, // ant
|
||||
590, // pill bug
|
||||
591, // wharf roach
|
||||
592, // moth
|
||||
594, // diving beetle
|
||||
595, // darner dragonfly
|
||||
596, // goliath beetle
|
||||
597, // fly
|
||||
598, // orchid mantis
|
||||
599, // tiger beetle
|
||||
600, // horned hercules
|
||||
601, // evening cicada
|
||||
602, // cyclommatus stag
|
||||
603, // firefly
|
||||
604, // dung beetle
|
||||
605, // rice grasshopper
|
||||
606, // mosquito
|
||||
607, // mantis
|
||||
608, // stinkbug
|
||||
609, // citrus long-horned beetle
|
||||
610, // peacock butterfly
|
||||
611, // snail
|
||||
612, // horned dynastid
|
||||
613, // grasshopper
|
||||
614, // earth-boring dung beetle
|
||||
615, // horned atlas
|
||||
616, // walking leaf
|
||||
617, // cricket
|
||||
618, // giant cicada
|
||||
619, // spider
|
||||
620, // agrias butterfly
|
||||
621, // robust cicada
|
||||
622, // bagworm
|
||||
623, // honeybee
|
||||
624, // miyama stag
|
||||
625, // yellow butterfly
|
||||
626, // common butterfly
|
||||
627, // emperor butterfly
|
||||
628, // centipede
|
||||
630, // walking stick
|
||||
631, // rainbow stag
|
||||
632, // saw stag
|
||||
633, // flea
|
||||
634, // mole cricket
|
||||
635, // banded dragonfly
|
||||
636, // monarch butterfly
|
||||
637, // giant stag
|
||||
638, // golden stag
|
||||
639, // scarab beetle
|
||||
640, // scorpion
|
||||
641, // cicada shell
|
||||
642, // bell cricket
|
||||
643, // wasp
|
||||
644, // long locust
|
||||
645, // jewel beetle
|
||||
646, // tarantula
|
||||
647, // ladybug
|
||||
648, // migratory locust
|
||||
649, // walker cicada
|
||||
650, // violin beetle
|
||||
651, // hermit crab
|
||||
652, // Atlas moth
|
||||
653, // horned elephant
|
||||
3477, // common bluebottle
|
||||
3478, // paper kite butterfly
|
||||
3479, // great purple emperor
|
||||
3480, // drone beetle
|
||||
3482, // giraffe stag
|
||||
3483, // man-faced stink bug
|
||||
3484, // Madagascan sunset moth
|
||||
3485, // blue weevil beetle
|
||||
3487, // rosalia batesi beetle
|
||||
3539, // snowflake
|
||||
3540, // large snowflake
|
||||
4702, // Wisp spirit piece
|
||||
5157, // giant water bug
|
||||
5339, // damselfly
|
||||
5859, // cherry-blossom petal
|
||||
7374, // maple leaf
|
||||
};
|
||||
|
||||
public static IReadOnlyList<ushort> Fish = new ushort[]
|
||||
{
|
||||
0328, // crucian carp
|
||||
0329, // goldfish
|
||||
2215, // bitterling
|
||||
2216, // pale chub
|
||||
2217, // dace
|
||||
2219, // carp
|
||||
2220, // koi
|
||||
2221, // pop-eyed goldfish
|
||||
2222, // killifish
|
||||
2223, // crawfish
|
||||
2224, // soft-shelled turtle
|
||||
2225, // tadpole
|
||||
2226, // frog
|
||||
2227, // freshwater goby
|
||||
2228, // loach
|
||||
2229, // catfish
|
||||
2231, // giant snakehead
|
||||
2232, // bluegill
|
||||
2233, // yellow perch
|
||||
2234, // black bass
|
||||
2235, // pike
|
||||
2236, // pond smelt
|
||||
2237, // sweetfish
|
||||
2238, // cherry salmon
|
||||
2239, // char
|
||||
2241, // stringfish
|
||||
2242, // salmon
|
||||
2243, // king salmon
|
||||
2244, // mitten crab
|
||||
2245, // guppy
|
||||
2246, // nibble fish
|
||||
2247, // angelfish
|
||||
2248, // neon tetra
|
||||
2249, // piranha
|
||||
2250, // arowana
|
||||
2251, // dorado
|
||||
2252, // gar
|
||||
2253, // arapaima
|
||||
2254, // saddled bichir
|
||||
2255, // sea butterfly
|
||||
2256, // sea horse
|
||||
2257, // clown fish
|
||||
2258, // surgeonfish
|
||||
2259, // butterfly fish
|
||||
2260, // Napoleonfish
|
||||
2261, // zebra turkeyfish
|
||||
2262, // blowfish
|
||||
2263, // puffer fish
|
||||
2264, // horse mackerel
|
||||
2265, // barred knifejaw
|
||||
2266, // sea bass
|
||||
2267, // red snapper
|
||||
2268, // dab
|
||||
2269, // olive flounder
|
||||
2270, // squid
|
||||
2271, // moray eel
|
||||
2272, // ribbon eel
|
||||
2273, // football fish
|
||||
2274, // tuna
|
||||
2275, // blue marlin
|
||||
2276, // giant trevally
|
||||
2277, // ray
|
||||
2278, // ocean sunfish
|
||||
2279, // hammerhead shark
|
||||
2280, // great white shark
|
||||
2281, // saw shark
|
||||
2282, // whale shark
|
||||
2283, // oarfish
|
||||
2284, // coelacanth
|
||||
2502, // stone
|
||||
3466, // empty can
|
||||
3469, // boot
|
||||
3470, // old tire
|
||||
4189, // sturgeon
|
||||
4190, // tilapia
|
||||
4191, // betta
|
||||
4192, // snapping turtle
|
||||
4193, // golden trout
|
||||
4194, // rainbowfish
|
||||
4201, // anchovy
|
||||
4202, // mahi-mahi
|
||||
4203, // suckerfish
|
||||
4204, // barreleye
|
||||
5254, // ranchu goldfish
|
||||
};
|
||||
}
|
||||
}
|
||||
23
NHSE.Core/Util/FlagUtil.cs
Normal file
23
NHSE.Core/Util/FlagUtil.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
namespace NHSE.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Utility logic for dealing with bitflags in a byte array.
|
||||
/// </summary>
|
||||
public static class FlagUtil
|
||||
{
|
||||
public static bool GetFlag(byte[] arr, int offset, int bitIndex)
|
||||
{
|
||||
var b = arr[offset + (bitIndex >> 3)];
|
||||
var mask = 1 << (bitIndex & 7);
|
||||
return (b & mask) != 0;
|
||||
}
|
||||
|
||||
public static void SetFlag(byte[] arr, int offset, int bitIndex, bool value)
|
||||
{
|
||||
offset += (bitIndex >> 3);
|
||||
bitIndex &= 7; // ensure bit access is 0-7
|
||||
arr[offset] &= (byte)~(1 << bitIndex);
|
||||
arr[offset] |= (byte)((value ? 1 : 0) << bitIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
85
NHSE.WinForms/Editor.Designer.cs
generated
85
NHSE.WinForms/Editor.Designer.cs
generated
|
|
@ -36,6 +36,7 @@ private void InitializeComponent()
|
|||
this.Menu_Tools = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.Menu_DumpDecrypted = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.Menu_VerifyHashes = new System.Windows.Forms.ToolStripMenuItem();
|
||||
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_EditPlayerStorage = new System.Windows.Forms.Button();
|
||||
|
|
@ -56,6 +57,8 @@ private void InitializeComponent()
|
|||
this.CM_Picture = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.Menu_SavePNG = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.Tab_Villagers = new System.Windows.Forms.TabPage();
|
||||
this.B_EditFurniture = new System.Windows.Forms.Button();
|
||||
this.B_LoadVillager = new System.Windows.Forms.Button();
|
||||
this.B_DumpVillager = new System.Windows.Forms.Button();
|
||||
this.L_ExternalName = new System.Windows.Forms.Label();
|
||||
this.L_InternalName = new System.Windows.Forms.Label();
|
||||
|
|
@ -72,9 +75,7 @@ private void InitializeComponent()
|
|||
this.NUD_Villager = new System.Windows.Forms.NumericUpDown();
|
||||
this.Tab_Map = new System.Windows.Forms.TabPage();
|
||||
this.B_RecycleBin = new System.Windows.Forms.Button();
|
||||
this.Menu_LoadDecrypted = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.B_LoadVillager = new System.Windows.Forms.Button();
|
||||
this.B_EditFurniture = new System.Windows.Forms.Button();
|
||||
this.B_EditPlayerReceivedItems = new System.Windows.Forms.Button();
|
||||
this.Menu_Editor.SuspendLayout();
|
||||
this.TC_Editors.SuspendLayout();
|
||||
this.Tab_Players.SuspendLayout();
|
||||
|
|
@ -154,6 +155,14 @@ private void InitializeComponent()
|
|||
this.Menu_VerifyHashes.Text = "Verify Hashes";
|
||||
this.Menu_VerifyHashes.Click += new System.EventHandler(this.Menu_VerifyHashes_Click);
|
||||
//
|
||||
// Menu_LoadDecrypted
|
||||
//
|
||||
this.Menu_LoadDecrypted.Name = "Menu_LoadDecrypted";
|
||||
this.Menu_LoadDecrypted.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L)));
|
||||
this.Menu_LoadDecrypted.Size = new System.Drawing.Size(206, 22);
|
||||
this.Menu_LoadDecrypted.Text = "Load Decrypted";
|
||||
this.Menu_LoadDecrypted.Click += new System.EventHandler(this.Menu_LoadDecrypted_Click);
|
||||
//
|
||||
// TC_Editors
|
||||
//
|
||||
this.TC_Editors.Controls.Add(this.Tab_Players);
|
||||
|
|
@ -168,6 +177,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// Tab_Players
|
||||
//
|
||||
this.Tab_Players.Controls.Add(this.B_EditPlayerReceivedItems);
|
||||
this.Tab_Players.Controls.Add(this.B_EditPlayerStorage);
|
||||
this.Tab_Players.Controls.Add(this.B_EditPlayerRecipes);
|
||||
this.Tab_Players.Controls.Add(this.B_EditPlayerItems);
|
||||
|
|
@ -193,9 +203,9 @@ private void InitializeComponent()
|
|||
//
|
||||
// B_EditPlayerStorage
|
||||
//
|
||||
this.B_EditPlayerStorage.Location = new System.Drawing.Point(112, 168);
|
||||
this.B_EditPlayerStorage.Location = new System.Drawing.Point(104, 168);
|
||||
this.B_EditPlayerStorage.Name = "B_EditPlayerStorage";
|
||||
this.B_EditPlayerStorage.Size = new System.Drawing.Size(100, 40);
|
||||
this.B_EditPlayerStorage.Size = new System.Drawing.Size(92, 40);
|
||||
this.B_EditPlayerStorage.TabIndex = 14;
|
||||
this.B_EditPlayerStorage.Text = "Edit Storage";
|
||||
this.B_EditPlayerStorage.UseVisualStyleBackColor = true;
|
||||
|
|
@ -203,9 +213,9 @@ private void InitializeComponent()
|
|||
//
|
||||
// B_EditPlayerRecipes
|
||||
//
|
||||
this.B_EditPlayerRecipes.Location = new System.Drawing.Point(218, 168);
|
||||
this.B_EditPlayerRecipes.Location = new System.Drawing.Point(202, 168);
|
||||
this.B_EditPlayerRecipes.Name = "B_EditPlayerRecipes";
|
||||
this.B_EditPlayerRecipes.Size = new System.Drawing.Size(100, 40);
|
||||
this.B_EditPlayerRecipes.Size = new System.Drawing.Size(92, 40);
|
||||
this.B_EditPlayerRecipes.TabIndex = 13;
|
||||
this.B_EditPlayerRecipes.Text = "Edit Recipes";
|
||||
this.B_EditPlayerRecipes.UseVisualStyleBackColor = true;
|
||||
|
|
@ -215,7 +225,7 @@ private void InitializeComponent()
|
|||
//
|
||||
this.B_EditPlayerItems.Location = new System.Drawing.Point(6, 168);
|
||||
this.B_EditPlayerItems.Name = "B_EditPlayerItems";
|
||||
this.B_EditPlayerItems.Size = new System.Drawing.Size(100, 40);
|
||||
this.B_EditPlayerItems.Size = new System.Drawing.Size(92, 40);
|
||||
this.B_EditPlayerItems.TabIndex = 12;
|
||||
this.B_EditPlayerItems.Text = "Edit Items";
|
||||
this.B_EditPlayerItems.UseVisualStyleBackColor = true;
|
||||
|
|
@ -378,11 +388,31 @@ private void InitializeComponent()
|
|||
this.Tab_Villagers.Text = "Villagers";
|
||||
this.Tab_Villagers.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// B_EditFurniture
|
||||
//
|
||||
this.B_EditFurniture.Location = new System.Drawing.Point(202, 168);
|
||||
this.B_EditFurniture.Name = "B_EditFurniture";
|
||||
this.B_EditFurniture.Size = new System.Drawing.Size(92, 40);
|
||||
this.B_EditFurniture.TabIndex = 26;
|
||||
this.B_EditFurniture.Text = "Edit Furniture";
|
||||
this.B_EditFurniture.UseVisualStyleBackColor = true;
|
||||
this.B_EditFurniture.Click += new System.EventHandler(this.B_EditFurniture_Click);
|
||||
//
|
||||
// B_LoadVillager
|
||||
//
|
||||
this.B_LoadVillager.Location = new System.Drawing.Point(104, 168);
|
||||
this.B_LoadVillager.Name = "B_LoadVillager";
|
||||
this.B_LoadVillager.Size = new System.Drawing.Size(92, 40);
|
||||
this.B_LoadVillager.TabIndex = 25;
|
||||
this.B_LoadVillager.Text = "Load Villager";
|
||||
this.B_LoadVillager.UseVisualStyleBackColor = true;
|
||||
this.B_LoadVillager.Click += new System.EventHandler(this.B_LoadVillager_Click);
|
||||
//
|
||||
// B_DumpVillager
|
||||
//
|
||||
this.B_DumpVillager.Location = new System.Drawing.Point(6, 168);
|
||||
this.B_DumpVillager.Name = "B_DumpVillager";
|
||||
this.B_DumpVillager.Size = new System.Drawing.Size(100, 40);
|
||||
this.B_DumpVillager.Size = new System.Drawing.Size(92, 40);
|
||||
this.B_DumpVillager.TabIndex = 24;
|
||||
this.B_DumpVillager.Text = "Dump Villager";
|
||||
this.B_DumpVillager.UseVisualStyleBackColor = true;
|
||||
|
|
@ -544,39 +574,21 @@ private void InitializeComponent()
|
|||
//
|
||||
this.B_RecycleBin.Location = new System.Drawing.Point(6, 168);
|
||||
this.B_RecycleBin.Name = "B_RecycleBin";
|
||||
this.B_RecycleBin.Size = new System.Drawing.Size(100, 40);
|
||||
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);
|
||||
//
|
||||
// Menu_LoadDecrypted
|
||||
// B_EditPlayerReceivedItems
|
||||
//
|
||||
this.Menu_LoadDecrypted.Name = "Menu_LoadDecrypted";
|
||||
this.Menu_LoadDecrypted.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L)));
|
||||
this.Menu_LoadDecrypted.Size = new System.Drawing.Size(206, 22);
|
||||
this.Menu_LoadDecrypted.Text = "Load Decrypted";
|
||||
this.Menu_LoadDecrypted.Click += new System.EventHandler(this.Menu_LoadDecrypted_Click);
|
||||
//
|
||||
// B_LoadVillager
|
||||
//
|
||||
this.B_LoadVillager.Location = new System.Drawing.Point(112, 168);
|
||||
this.B_LoadVillager.Name = "B_LoadVillager";
|
||||
this.B_LoadVillager.Size = new System.Drawing.Size(100, 40);
|
||||
this.B_LoadVillager.TabIndex = 25;
|
||||
this.B_LoadVillager.Text = "Load Villager";
|
||||
this.B_LoadVillager.UseVisualStyleBackColor = true;
|
||||
this.B_LoadVillager.Click += new System.EventHandler(this.B_LoadVillager_Click);
|
||||
//
|
||||
// B_EditFurniture
|
||||
//
|
||||
this.B_EditFurniture.Location = new System.Drawing.Point(218, 168);
|
||||
this.B_EditFurniture.Name = "B_EditFurniture";
|
||||
this.B_EditFurniture.Size = new System.Drawing.Size(100, 40);
|
||||
this.B_EditFurniture.TabIndex = 26;
|
||||
this.B_EditFurniture.Text = "Edit Furniture";
|
||||
this.B_EditFurniture.UseVisualStyleBackColor = true;
|
||||
this.B_EditFurniture.Click += new System.EventHandler(this.B_EditFurniture_Click);
|
||||
this.B_EditPlayerReceivedItems.Location = new System.Drawing.Point(300, 168);
|
||||
this.B_EditPlayerReceivedItems.Name = "B_EditPlayerReceivedItems";
|
||||
this.B_EditPlayerReceivedItems.Size = new System.Drawing.Size(92, 40);
|
||||
this.B_EditPlayerReceivedItems.TabIndex = 15;
|
||||
this.B_EditPlayerReceivedItems.Text = "Edit Received Items";
|
||||
this.B_EditPlayerReceivedItems.UseVisualStyleBackColor = true;
|
||||
this.B_EditPlayerReceivedItems.Click += new System.EventHandler(this.B_EditPlayerReceivedItems_Click);
|
||||
//
|
||||
// Editor
|
||||
//
|
||||
|
|
@ -661,6 +673,7 @@ private void InitializeComponent()
|
|||
private System.Windows.Forms.ToolStripMenuItem Menu_LoadDecrypted;
|
||||
private System.Windows.Forms.Button B_LoadVillager;
|
||||
private System.Windows.Forms.Button B_EditFurniture;
|
||||
private System.Windows.Forms.Button B_EditPlayerReceivedItems;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -148,6 +148,13 @@ private void B_EditPlayerRecipes_Click(object sender, EventArgs e)
|
|||
editor.ShowDialog();
|
||||
}
|
||||
|
||||
private void B_EditPlayerReceivedItems_Click(object sender, EventArgs e)
|
||||
{
|
||||
var player = SAV.Players[PlayerIndex];
|
||||
using var editor = new ItemReceivedEditor(player);
|
||||
editor.ShowDialog();
|
||||
}
|
||||
|
||||
private void LoadPlayer(int index)
|
||||
{
|
||||
if (PlayerIndex >= 0)
|
||||
|
|
|
|||
|
|
@ -39,6 +39,9 @@
|
|||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Subforms\ItemReceivedEditor.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="$(TargetFramework.StartsWith('net4')) AND '$(Configuration)' == 'Release'">
|
||||
|
|
|
|||
122
NHSE.WinForms/Subforms/ItemReceivedEditor.Designer.cs
generated
Normal file
122
NHSE.WinForms/Subforms/ItemReceivedEditor.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
namespace NHSE.WinForms
|
||||
{
|
||||
partial class ItemReceivedEditor
|
||||
{
|
||||
/// <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.CLB_Items = new System.Windows.Forms.CheckedListBox();
|
||||
this.B_AllBugs = new System.Windows.Forms.Button();
|
||||
this.B_AllFish = new System.Windows.Forms.Button();
|
||||
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(130, 280);
|
||||
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(208, 280);
|
||||
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);
|
||||
//
|
||||
// CLB_Items
|
||||
//
|
||||
this.CLB_Items.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.CLB_Items.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.CLB_Items.FormattingEnabled = true;
|
||||
this.CLB_Items.Location = new System.Drawing.Point(12, 12);
|
||||
this.CLB_Items.Name = "CLB_Items";
|
||||
this.CLB_Items.Size = new System.Drawing.Size(268, 229);
|
||||
this.CLB_Items.TabIndex = 8;
|
||||
//
|
||||
// B_AllBugs
|
||||
//
|
||||
this.B_AllBugs.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.B_AllBugs.Location = new System.Drawing.Point(12, 252);
|
||||
this.B_AllBugs.Name = "B_AllBugs";
|
||||
this.B_AllBugs.Size = new System.Drawing.Size(82, 23);
|
||||
this.B_AllBugs.TabIndex = 11;
|
||||
this.B_AllBugs.Text = "Give All Bugs";
|
||||
this.B_AllBugs.UseVisualStyleBackColor = true;
|
||||
this.B_AllBugs.Click += new System.EventHandler(this.B_AllBugs_Click);
|
||||
//
|
||||
// B_AllFish
|
||||
//
|
||||
this.B_AllFish.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.B_AllFish.Location = new System.Drawing.Point(12, 280);
|
||||
this.B_AllFish.Name = "B_AllFish";
|
||||
this.B_AllFish.Size = new System.Drawing.Size(82, 23);
|
||||
this.B_AllFish.TabIndex = 12;
|
||||
this.B_AllFish.Text = "Give All Fish";
|
||||
this.B_AllFish.UseVisualStyleBackColor = true;
|
||||
this.B_AllFish.Click += new System.EventHandler(this.B_AllFish_Click);
|
||||
//
|
||||
// ItemReceivedEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(292, 315);
|
||||
this.Controls.Add(this.B_AllFish);
|
||||
this.Controls.Add(this.B_AllBugs);
|
||||
this.Controls.Add(this.CLB_Items);
|
||||
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 = "ItemReceivedEditor";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Received Item List Editor";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button B_Cancel;
|
||||
private System.Windows.Forms.Button B_Save;
|
||||
private System.Windows.Forms.CheckedListBox CLB_Items;
|
||||
private System.Windows.Forms.Button B_AllBugs;
|
||||
private System.Windows.Forms.Button B_AllFish;
|
||||
}
|
||||
}
|
||||
58
NHSE.WinForms/Subforms/ItemReceivedEditor.cs
Normal file
58
NHSE.WinForms/Subforms/ItemReceivedEditor.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using NHSE.Core;
|
||||
using NHSE.Core.Structures;
|
||||
|
||||
namespace NHSE.WinForms
|
||||
{
|
||||
public partial class ItemReceivedEditor : Form
|
||||
{
|
||||
private readonly Player Player;
|
||||
|
||||
public ItemReceivedEditor(Player player)
|
||||
{
|
||||
Player = player;
|
||||
InitializeComponent();
|
||||
FillCheckBoxes();
|
||||
}
|
||||
|
||||
private void FillCheckBoxes()
|
||||
{
|
||||
var items = GameInfo.Strings.itemlist.ToArray();
|
||||
items[0] = string.Empty;
|
||||
var ofs = Player.Personal.Offsets.ReceivedItems;
|
||||
var data = Player.Personal.Data;
|
||||
for (int i = 0; i < items.Length; i++)
|
||||
{
|
||||
var flag = FlagUtil.GetFlag(data, ofs, i);
|
||||
string value = items[i];
|
||||
if (string.IsNullOrEmpty(value))
|
||||
value = i.ToString();
|
||||
string name = $"0x{i:X3} - {value}";
|
||||
CLB_Items.Items.Add(name, flag);
|
||||
}
|
||||
}
|
||||
|
||||
public void GiveAll(IReadOnlyList<ushort> indexes, bool value = true)
|
||||
{
|
||||
foreach (var item in indexes)
|
||||
CLB_Items.SetItemChecked(item, value);
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
}
|
||||
|
||||
private void B_AllBugs_Click(object sender, EventArgs e) => GiveAll(GameLists.Bugs, ModifierKeys != Keys.Alt);
|
||||
private void B_AllFish_Click(object sender, EventArgs e) => GiveAll(GameLists.Fish, ModifierKeys != Keys.Alt);
|
||||
private void B_Cancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
private void B_Save_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ofs = Player.Personal.Offsets.ReceivedItems;
|
||||
var data = Player.Personal.Data;
|
||||
for (int i = 0; i < CLB_Items.Items.Count; i++)
|
||||
FlagUtil.SetFlag(data, ofs, i, CLB_Items.GetItemChecked(i));
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
NHSE.WinForms/Subforms/ItemReceivedEditor.resx
Normal file
120
NHSE.WinForms/Subforms/ItemReceivedEditor.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