Add pro design r/w

This commit is contained in:
Kurt 2020-04-23 17:09:52 -07:00
parent 776bc030fe
commit 4efbb00b4e
23 changed files with 889 additions and 34 deletions

View File

@ -31,6 +31,8 @@ public void SetVillagers(IReadOnlyList<Villager> villagers)
public DesignPattern GetDesign(int index) => Offsets.ReadPattern(Data, index);
public void SetDesign(DesignPattern value, int index) => Offsets.WritePattern(value, Data, index);
public DesignPatternPRO GetDesignPRO(int index) => Offsets.ReadPatternPRO(Data, index);
public void SetDesignPRO(DesignPatternPRO value, int index) => Offsets.WritePatternPRO(value, Data, index);
public IReadOnlyList<Item> RecycleBin
{
@ -101,6 +103,21 @@ public void SetDesigns(IReadOnlyList<DesignPattern> value)
SetDesign(value[i], i);
}
public DesignPatternPRO[] GetDesignsPRO()
{
var result = new DesignPatternPRO[MainSaveOffsets.PatternCount];
for (int i = 0; i < result.Length; i++)
result[i] = GetDesignPRO(i);
return result;
}
public void SetDesignsPRO(IReadOnlyList<DesignPatternPRO> value)
{
var count = Math.Min(MainSaveOffsets.PatternCount, value.Count);
for (int i = 0; i < count; i++)
SetDesignPRO(value[i], i);
}
private const int EventFlagsSaveCount = 0x400;
public short[] GetEventFlagLand()

View File

@ -15,6 +15,8 @@ public abstract class MainSaveOffsets
public abstract int Patterns { get; }
public const int PatternCount = 50;
public abstract int PatternsPRO { get; }
public abstract int PatternFlag { get; }
public abstract int Buildings { get; }
public const int BuildingCount = 46;
@ -64,6 +66,21 @@ public void WritePattern(DesignPattern p, byte[] data, int index)
p.Data.CopyTo(data, Patterns + (index * DesignPattern.SIZE));
}
public DesignPatternPRO ReadPatternPRO(byte[] data, int index)
{
if ((uint)index >= PatternCount)
throw new ArgumentOutOfRangeException(nameof(index));
var v = data.Slice(PatternsPRO + (index * DesignPatternPRO.SIZE), DesignPatternPRO.SIZE);
return new DesignPatternPRO(v);
}
public void WritePatternPRO(DesignPatternPRO p, byte[] data, int index)
{
if ((uint)index >= PatternCount)
throw new ArgumentOutOfRangeException(nameof(index));
p.Data.CopyTo(data, PatternsPRO + (index * DesignPatternPRO.SIZE));
}
public Villager ReadVillager(byte[] data, int index)
{
if ((uint)index >= VillagerCount)

View File

@ -7,6 +7,8 @@ public class MainSaveOffsets10 : MainSaveOffsets
{
public override int Villager => 0x110;
public override int Patterns => 0x1D72F0;
public override int PatternsPRO => Patterns + (PatternCount * DesignPattern.SIZE);
public override int PatternFlag => PatternsPRO + (PatternCount * DesignPatternPRO.SIZE);
public override int EventFlagLand => FieldItem - 0x800;
public override int FieldItem => 0x2018FC;

View File

@ -7,6 +7,8 @@ public class MainSaveOffsets11 : MainSaveOffsets
{
public override int Villager => 0x120;
public override int Patterns => 0x1D7310; // +0x20 from v1.0
public override int PatternsPRO => Patterns + (PatternCount * DesignPattern.SIZE);
public override int PatternFlag => PatternsPRO + (PatternCount * DesignPatternPRO.SIZE);
public override int EventFlagLand => FieldItem - 0x800;

View File

@ -7,6 +7,8 @@ public class MainSaveOffsets12 : MainSaveOffsets
{
public override int Villager => 0x120;
public override int Patterns => 0x1D7310;
public override int PatternsPRO => Patterns + (PatternCount * DesignPattern.SIZE);
public override int PatternFlag => PatternsPRO + (PatternCount * DesignPatternPRO.SIZE);
public override int EventFlagLand => FieldItem - 0x800;

View File

@ -20,6 +20,18 @@ public class DesignPattern : IVillagerOrigin
public DesignPattern(byte[] data) => Data = data;
public uint Hash
{
get => BitConverter.ToUInt32(Data, 0x00);
set => BitConverter.GetBytes(value).CopyTo(Data, 0x00);
}
public uint Version
{
get => BitConverter.ToUInt32(Data, 0x04);
set => BitConverter.GetBytes(value).CopyTo(Data, 0x04);
}
public string DesignName
{
get => StringUtil.GetString(Data, 0x10, 20);

View File

@ -0,0 +1,144 @@
using System;
namespace NHSE.Core
{
public class DesignPatternPRO : IVillagerOrigin
{
public const int Width = 32;
public const int Height = 32;
public const int SIZE = 0x8A8; // 3 bytes unused at end
public const int SheetCount = 4;
private const int PersonalOffset = 0x38;
private const int PaletteDataStart = 0x78;
public const int PaletteColorCount = 15; // y not 16???
private const int PaletteColorSize = 3; // R, G, B
private const int PixelDataOffset = PaletteDataStart + (PaletteColorCount * PaletteColorSize); // 0xA5
private const int PixelCount = 0x400; // Width * Height
private const int SheetDataSize = PixelCount / 2; // 4bit|4bit pixel packing
public readonly byte[] Data;
public DesignPatternPRO(byte[] data) => Data = data;
public uint Hash
{
get => BitConverter.ToUInt32(Data, 0x00);
set => BitConverter.GetBytes(value).CopyTo(Data, 0x00);
}
public uint Version
{
get => BitConverter.ToUInt32(Data, 0x04);
set => BitConverter.GetBytes(value).CopyTo(Data, 0x04);
}
public string DesignName
{
get => StringUtil.GetString(Data, 0x10, 20);
set => StringUtil.GetBytes(value, 20).CopyTo(Data, 0x10);
}
public uint TownID
{
get => BitConverter.ToUInt32(Data, PersonalOffset);
set => BitConverter.GetBytes(value).CopyTo(Data, PersonalOffset);
}
public string TownName
{
get => StringUtil.GetString(Data, PersonalOffset + 0x04, 10);
set => StringUtil.GetBytes(value, 10).CopyTo(Data, PersonalOffset + 0x04);
}
public byte[] GetTownIdentity() => Data.Slice(PersonalOffset + 0x00, 4 + 20);
public uint PlayerID
{
get => BitConverter.ToUInt32(Data, PersonalOffset + 0x1C);
set => BitConverter.GetBytes(value).CopyTo(Data, PersonalOffset + 0x1C);
}
public string PlayerName
{
get => StringUtil.GetString(Data, PersonalOffset + 0x20, 10);
set => StringUtil.GetBytes(value, 10).CopyTo(Data, PersonalOffset + 0x20);
}
public byte[] GetPlayerIdentity() => Data.Slice(PersonalOffset + 0x1C, 4 + 20);
public void SetPixelAtIndex(int sheet, int index, int value)
{
var ofs = PixelDataOffset + (index / 2) + (sheet * SheetDataSize);
var val = Data[ofs];
var update = ((index & 1) == 0)
? (val & 0xF0) | (value & 0xF)
: (value & 0xF) << 4 | (val & 0xF);
Data[ofs] = (byte) update;
}
private int GetPixelAtIndex(int sheet, int index)
{
var ofs = PixelDataOffset + (index / 2) + (sheet * SheetDataSize);
var val = Data[ofs];
return (index & 1) == 0 ? (val & 0x0F) : (val >> 4);
}
public static int GetPixelIndex(int sheet, int x, int y) => (sheet * SheetDataSize) + (y * Height) + x;
public int GetPixel(int sheet, int x, int y)
{
if ((uint)x >= Width)
throw new ArgumentException($"Argument out of range (0-{Width})", nameof(x));
if ((uint)y >= Height)
throw new ArgumentException($"Argument out of range (0-{Height})", nameof(y));
var index = GetPixelIndex(sheet, x, y);
return GetPixelAtIndex(sheet, index);
}
public static int GetColorOffset(int index)
{
if ((uint)index >= PaletteColorCount)
throw new ArgumentException($"Argument out of range (0-{PaletteColorCount})", nameof(index));
return PaletteDataStart + (index * PaletteColorSize);
}
/// <summary>
/// Builds a new array with unpacked 32bit pixel data.
/// </summary>
public byte[] GetBitmap(int sheet)
{
byte[] data = new byte[4 * Width * Height];
for (int i = 0; i < PixelCount; i++)
{
var choice = GetPixelAtIndex(sheet, i);
if (choice == PaletteColorCount)
continue; // transparent?
var palette = GetColorOffset(choice);
var ofs = i * 4;
data[ofs + 2] = Data[palette + 0];
data[ofs + 1] = Data[palette + 1];
data[ofs + 0] = Data[palette + 2];
data[ofs + 3] = 0xFF; // opaque
}
return data;
}
/// <summary>
/// Returns a raw slice of data containing the 24bit color pixels.
/// </summary>
public byte[] GetPaletteBitmap()
{
var result = new byte[3 * PaletteColorCount];
for (int i = 0; i < PaletteColorCount; i++)
{
var ofs = PaletteDataStart + (i * 3);
result[(i * 3) + 2] = Data[ofs + 0];
result[(i * 3) + 1] = Data[ofs + 1];
result[(i * 3) + 0] = Data[ofs + 2];
}
return result;
}
}
}

View File

@ -147,5 +147,35 @@ private static void Dump(this DesignPattern dp, string path)
var dest = Path.Combine(path, fn);
File.WriteAllBytes(dest, dp.Data);
}
/// <summary>
/// Dumps all designs to the requested <see cref="path"/>.
/// </summary>
/// <param name="sav">Save Data to dump from</param>
/// <param name="path">Path to dump to</param>
public static void DumpDesignsPRO(this MainSave sav, string path)
{
for (int i = 0; i < MainSaveOffsets.PatternCount; i++)
sav.GetDesignPRO(i).Dump(path);
}
/// <summary>
/// Dumps all designs to the requested <see cref="path"/>.
/// </summary>
/// <param name="patterns">Patterns to dump</param>
/// <param name="path">Path to dump to</param>
public static void Dump(this IEnumerable<DesignPatternPRO> patterns, string path)
{
foreach (var dp in patterns)
dp.Dump(path);
}
private static void Dump(this DesignPatternPRO dp, string path)
{
var name = dp.DesignName;
var fn = StringUtil.CleanFileName($"{name}.nhpd");
var dest = Path.Combine(path, fn);
File.WriteAllBytes(dest, dp.Data);
}
}
}

View File

@ -19,6 +19,16 @@ public static Bitmap GetPalette(this DesignPattern bg)
return GetBitmap(bg.GetPaletteBitmap(), DesignPattern.PaletteColorCount, 1, PixelFormat.Format24bppRgb);
}
public static Bitmap GetImage(this DesignPatternPRO bg, int sheet)
{
return GetBitmap(bg.GetBitmap(sheet), DesignPatternPRO.Width, DesignPatternPRO.Height);
}
public static Bitmap GetPalette(this DesignPatternPRO bg)
{
return GetBitmap(bg.GetPaletteBitmap(), DesignPatternPRO.PaletteColorCount, 1, PixelFormat.Format24bppRgb);
}
public static Bitmap GetBitmap(byte[] data, int width, int height, PixelFormat format = PixelFormat.Format32bppArgb)
{
var bmp = new Bitmap(width, height, format);

View File

@ -77,6 +77,7 @@ private void InitializeComponent()
this.PB_Player = new System.Windows.Forms.PictureBox();
this.TC_Editors = new System.Windows.Forms.TabControl();
this.B_EditPatterns = new System.Windows.Forms.Button();
this.B_EditPRODesigns = new System.Windows.Forms.Button();
this.Menu_Editor.SuspendLayout();
this.CM_Picture.SuspendLayout();
this.Tab_Map.SuspendLayout();
@ -211,6 +212,7 @@ private void InitializeComponent()
//
// Tab_Map
//
this.Tab_Map.Controls.Add(this.B_EditPRODesigns);
this.Tab_Map.Controls.Add(this.B_EditPatterns);
this.Tab_Map.Controls.Add(this.B_EditLandFlags);
this.Tab_Map.Controls.Add(this.L_PlayerHouse);
@ -269,7 +271,7 @@ private void InitializeComponent()
//
// B_LoadHouse
//
this.B_LoadHouse.Location = new System.Drawing.Point(106, 29);
this.B_LoadHouse.Location = new System.Drawing.Point(104, 29);
this.B_LoadHouse.Name = "B_LoadHouse";
this.B_LoadHouse.Size = new System.Drawing.Size(92, 40);
this.B_LoadHouse.TabIndex = 50;
@ -575,7 +577,7 @@ private void InitializeComponent()
//
// B_EditPatterns
//
this.B_EditPatterns.Location = new System.Drawing.Point(106, 168);
this.B_EditPatterns.Location = new System.Drawing.Point(104, 122);
this.B_EditPatterns.Name = "B_EditPatterns";
this.B_EditPatterns.Size = new System.Drawing.Size(92, 40);
this.B_EditPatterns.TabIndex = 54;
@ -583,6 +585,16 @@ private void InitializeComponent()
this.B_EditPatterns.UseVisualStyleBackColor = true;
this.B_EditPatterns.Click += new System.EventHandler(this.B_EditPatterns_Click);
//
// B_EditPRODesigns
//
this.B_EditPRODesigns.Location = new System.Drawing.Point(104, 168);
this.B_EditPRODesigns.Name = "B_EditPRODesigns";
this.B_EditPRODesigns.Size = new System.Drawing.Size(92, 40);
this.B_EditPRODesigns.TabIndex = 55;
this.B_EditPRODesigns.Text = "Edit PRO Designs";
this.B_EditPRODesigns.UseVisualStyleBackColor = true;
this.B_EditPRODesigns.Click += new System.EventHandler(this.B_EditPRODesigns_Click);
//
// Editor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -662,6 +674,7 @@ private void InitializeComponent()
private System.Windows.Forms.PictureBox PB_Player;
private System.Windows.Forms.TabControl TC_Editors;
private System.Windows.Forms.Button B_EditPatterns;
private System.Windows.Forms.Button B_EditPRODesigns;
}
}

View File

@ -442,5 +442,13 @@ private void B_EditPatterns_Click(object sender, EventArgs e)
if (editor.ShowDialog() == DialogResult.OK)
SAV.Main.SetDesigns(patterns);
}
private void B_EditPRODesigns_Click(object sender, EventArgs e)
{
var patterns = SAV.Main.GetDesignsPRO();
using var editor = new PatternEditorPRO(patterns);
if (editor.ShowDialog() == DialogResult.OK)
SAV.Main.SetDesignsPRO(patterns);
}
}
}

View File

@ -43,6 +43,9 @@
<Compile Update="Subforms\Map\LandFlagEditor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="Subforms\Map\PatternEditorPRO.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="Subforms\Map\PatternEditor.cs">
<SubType>Form</SubType>
</Compile>

View File

@ -4,6 +4,8 @@ BuildingEditor=Building Editor
FieldItemEditor=Field Item Editor
FlagEditor=Flag Editor
ItemReceivedEditor=Received Item List Editor
PatternEditor=Pattern Editor
PatternEditorPRO=Pro Design Editor
PlayerItemEditor=Inventory Editor
SimpleHexEditor=RAM Edit
SingleObjectEditor=Property Editor
@ -38,7 +40,6 @@ BuildingEditor.L_PlazaX=Plaza X:
BuildingEditor.L_PlazaY=Plaza Y:
BuildingEditor.L_StructureType=Structure Type:
BuildingEditor.L_StructureValues=Values:
Editor.B_DumpDesign=Dump Design
Editor.B_DumpHouse=Dump House
Editor.B_DumpVillager=Dump Villager
Editor.B_EditAchievements=Edit Achievements
@ -48,15 +49,16 @@ Editor.B_EditFieldItems=Edit Field Items
Editor.B_EditFurniture=Edit Furniture
Editor.B_EditHouses=Edit House
Editor.B_EditLandFlags=Edit Flags
Editor.B_EditPatterns=Edit Patterns
Editor.B_EditPlayerFlags=Edit Flags
Editor.B_EditPlayerItems=Edit Items
Editor.B_EditPlayerReceivedItems=Edit Received Items
Editor.B_EditPlayerRecipes=Edit Recipes
Editor.B_EditPlayerStorage=Edit Storage
Editor.B_EditPRODesigns=Edit PRO Designs
Editor.B_EditTerrain=Edit Terrain
Editor.B_EditTurnipExchange=Edit Turnip Exchange
Editor.B_EditVillagerFlags=Edit Flags
Editor.B_LoadDesign=Load Design
Editor.B_LoadHouse=Load House
Editor.B_LoadVillager=Load Villager
Editor.B_RecycleBin=Edit Recycle Bin
@ -64,7 +66,6 @@ Editor.CHK_VillagerMovingOut=Moving Out
Editor.L_BankBells=Bank Bells:
Editor.L_Catchphrase=Catchphrase:
Editor.L_NookMiles=Nook Miles:
Editor.L_PatternIndex=Design Index:
Editor.L_Personality=Personality:
Editor.L_PlayerHouse=Player House:
Editor.L_PlayerName=Player Name:
@ -83,7 +84,6 @@ Editor.Menu_SavePNG=Save .png
Editor.Menu_Settings=Settings
Editor.Menu_Tools=Tools
Editor.Menu_VerifyHashes=Verify Hashes
Editor.Tab_Designs=Designs
Editor.Tab_Map=Map
Editor.Tab_Players=Players
Editor.Tab_Villagers=Villagers
@ -120,6 +120,16 @@ ItemReceivedEditor.B_AllFish=Give All Fish
ItemReceivedEditor.B_Cancel=Cancel
ItemReceivedEditor.B_GiveAll=Give All
ItemReceivedEditor.B_Save=Save
PatternEditor.B_Cancel=Cancel
PatternEditor.B_DumpDesign=Dump Design
PatternEditor.B_LoadDesign=Load Design
PatternEditor.B_Save=Save
PatternEditor.Menu_SavePNG=Save .png
PatternEditorPRO.B_Cancel=Cancel
PatternEditorPRO.B_DumpDesign=Dump Design
PatternEditorPRO.B_LoadDesign=Load Design
PatternEditorPRO.B_Save=Save
PatternEditorPRO.Menu_SavePNG=Save .png
PlayerItemEditor.B_Cancel=Cancel
PlayerItemEditor.B_Dump=Dump
PlayerItemEditor.B_Inject=Inject

View File

@ -4,6 +4,8 @@ BuildingEditor=Building Editor
FieldItemEditor=Field Item Editor
FlagEditor=Flag Editor
ItemReceivedEditor=Received Item List Editor
PatternEditor=Pattern Editor
PatternEditorPRO=Pro Design Editor
PlayerItemEditor=Inventory Editor
SimpleHexEditor=RAM Edit
SingleObjectEditor=Property Editor
@ -38,7 +40,6 @@ BuildingEditor.L_PlazaX=Plaza X:
BuildingEditor.L_PlazaY=Plaza Y:
BuildingEditor.L_StructureType=Structure Type:
BuildingEditor.L_StructureValues=Values:
Editor.B_DumpDesign=Dump Design
Editor.B_DumpHouse=Dump House
Editor.B_DumpVillager=Dump Villager
Editor.B_EditAchievements=Edit Achievements
@ -48,15 +49,16 @@ Editor.B_EditFieldItems=Edit Field Items
Editor.B_EditFurniture=Edit Furniture
Editor.B_EditHouses=Edit House
Editor.B_EditLandFlags=Edit Flags
Editor.B_EditPatterns=Edit Patterns
Editor.B_EditPlayerFlags=Edit Flags
Editor.B_EditPlayerItems=Edit Items
Editor.B_EditPlayerReceivedItems=Edit Received Items
Editor.B_EditPlayerRecipes=Edit Recipes
Editor.B_EditPlayerStorage=Edit Storage
Editor.B_EditPRODesigns=Edit PRO Designs
Editor.B_EditTerrain=Edit Terrain
Editor.B_EditTurnipExchange=Edit Turnip Exchange
Editor.B_EditVillagerFlags=Edit Flags
Editor.B_LoadDesign=Load Design
Editor.B_LoadHouse=Load House
Editor.B_LoadVillager=Load Villager
Editor.B_RecycleBin=Edit Recycle Bin
@ -64,7 +66,6 @@ Editor.CHK_VillagerMovingOut=Moving Out
Editor.L_BankBells=Bank Bells:
Editor.L_Catchphrase=Catchphrase:
Editor.L_NookMiles=Nook Miles:
Editor.L_PatternIndex=Design Index:
Editor.L_Personality=Personality:
Editor.L_PlayerHouse=Player House:
Editor.L_PlayerName=Player Name:
@ -83,7 +84,6 @@ Editor.Menu_SavePNG=Save .png
Editor.Menu_Settings=Settings
Editor.Menu_Tools=Tools
Editor.Menu_VerifyHashes=Verify Hashes
Editor.Tab_Designs=Designs
Editor.Tab_Map=Map
Editor.Tab_Players=Players
Editor.Tab_Villagers=Villagers
@ -120,6 +120,16 @@ ItemReceivedEditor.B_AllFish=Give All Fish
ItemReceivedEditor.B_Cancel=Cancel
ItemReceivedEditor.B_GiveAll=Give All
ItemReceivedEditor.B_Save=Save
PatternEditor.B_Cancel=Cancel
PatternEditor.B_DumpDesign=Dump Design
PatternEditor.B_LoadDesign=Load Design
PatternEditor.B_Save=Save
PatternEditor.Menu_SavePNG=Save .png
PatternEditorPRO.B_Cancel=Cancel
PatternEditorPRO.B_DumpDesign=Dump Design
PatternEditorPRO.B_LoadDesign=Load Design
PatternEditorPRO.B_Save=Save
PatternEditorPRO.Menu_SavePNG=Save .png
PlayerItemEditor.B_Cancel=Cancel
PlayerItemEditor.B_Dump=Dump
PlayerItemEditor.B_Inject=Inject

View File

@ -4,6 +4,8 @@ BuildingEditor=Editor de Edificios
FieldItemEditor=Editor de Objetos (Terreno)
FlagEditor=Editor de Flags
ItemReceivedEditor=Editor de Objetos Recibidos
PatternEditor=Pattern Editor
PatternEditorPRO=Pro Design Editor
PlayerItemEditor=Inventory Editor
SimpleHexEditor=Editor de RAM
SingleObjectEditor=Property Editor
@ -38,7 +40,6 @@ BuildingEditor.L_PlazaX=Plaza X:
BuildingEditor.L_PlazaY=Plaza Y:
BuildingEditor.L_StructureType=Tipo de Estructura:
BuildingEditor.L_StructureValues=Valores:
Editor.B_DumpDesign=Dump Design
Editor.B_DumpHouse=Dump House
Editor.B_DumpVillager=Dump Villager
Editor.B_EditAchievements=Editar Logros
@ -48,15 +49,16 @@ Editor.B_EditFieldItems=Edit Field Items
Editor.B_EditFurniture=Editar Muebles
Editor.B_EditHouses=Editar la Casa
Editor.B_EditLandFlags=Editar Flags
Editor.B_EditPatterns=Edit Patterns
Editor.B_EditPlayerFlags=Editar Flags
Editor.B_EditPlayerItems=Editar Objetos
Editor.B_EditPlayerReceivedItems=Editar Objetos Recibidos
Editor.B_EditPlayerRecipes=Editar Recetas
Editor.B_EditPlayerStorage=Editar Almacen
Editor.B_EditPRODesigns=Edit PRO Designs
Editor.B_EditTerrain=Editar Terreno
Editor.B_EditTurnipExchange=Editar Intercambio de Nabos
Editor.B_EditVillagerFlags=Editar Flags
Editor.B_LoadDesign=Cargar Diseño
Editor.B_LoadHouse=Cargar Casa
Editor.B_LoadVillager=Cargar Ciudadano
Editor.B_RecycleBin=Editar Papelera de Reciclaje
@ -64,7 +66,6 @@ Editor.CHK_VillagerMovingOut=Moving Out
Editor.L_BankBells=Bayas (Banco):
Editor.L_Catchphrase=Catchphrase:
Editor.L_NookMiles=Millas Nook:
Editor.L_PatternIndex=Indice del Diseño:
Editor.L_Personality=Personalidad:
Editor.L_PlayerHouse=Casa del Jugador:
Editor.L_PlayerName=Nombre del Jugador:
@ -83,7 +84,6 @@ Editor.Menu_SavePNG=Guardar .png
Editor.Menu_Settings=Ajustes
Editor.Menu_Tools=Herramientas
Editor.Menu_VerifyHashes=Verificar Hashes
Editor.Tab_Designs=Diseños
Editor.Tab_Map=Mapa
Editor.Tab_Players=Jugadores
Editor.Tab_Villagers=Ciudadanos
@ -120,6 +120,16 @@ ItemReceivedEditor.B_AllFish=Dar Todos los Peces
ItemReceivedEditor.B_Cancel=Cancelar
ItemReceivedEditor.B_GiveAll=Dar Todo
ItemReceivedEditor.B_Save=Guardar
PatternEditor.B_Cancel=Cancel
PatternEditor.B_DumpDesign=Dump Design
PatternEditor.B_LoadDesign=Load Design
PatternEditor.B_Save=Save
PatternEditor.Menu_SavePNG=Save .png
PatternEditorPRO.B_Cancel=Cancel
PatternEditorPRO.B_DumpDesign=Dump Design
PatternEditorPRO.B_LoadDesign=Load Design
PatternEditorPRO.B_Save=Save
PatternEditorPRO.Menu_SavePNG=Save .png
PlayerItemEditor.B_Cancel=Cancel
PlayerItemEditor.B_Dump=Dump
PlayerItemEditor.B_Inject=Inject

View File

@ -4,6 +4,8 @@ BuildingEditor=Building Editor
FieldItemEditor=Field Item Editor
FlagEditor=Flag Editor
ItemReceivedEditor=Received Item List Editor
PatternEditor=Pattern Editor
PatternEditorPRO=Pro Design Editor
PlayerItemEditor=Inventory Editor
SimpleHexEditor=RAM Edit
SingleObjectEditor=Property Editor
@ -38,7 +40,6 @@ BuildingEditor.L_PlazaX=Plaza X:
BuildingEditor.L_PlazaY=Plaza Y:
BuildingEditor.L_StructureType=Structure Type:
BuildingEditor.L_StructureValues=Values:
Editor.B_DumpDesign=Dump Design
Editor.B_DumpHouse=Dump House
Editor.B_DumpVillager=Dump Villager
Editor.B_EditAchievements=Edit Achievements
@ -48,15 +49,16 @@ Editor.B_EditFieldItems=Edit Field Items
Editor.B_EditFurniture=Edit Furniture
Editor.B_EditHouses=Edit House
Editor.B_EditLandFlags=Edit Flags
Editor.B_EditPatterns=Edit Patterns
Editor.B_EditPlayerFlags=Edit Flags
Editor.B_EditPlayerItems=Edit Items
Editor.B_EditPlayerReceivedItems=Edit Received Items
Editor.B_EditPlayerRecipes=Edit Recipes
Editor.B_EditPlayerStorage=Edit Storage
Editor.B_EditPRODesigns=Edit PRO Designs
Editor.B_EditTerrain=Edit Terrain
Editor.B_EditTurnipExchange=Edit Turnip Exchange
Editor.B_EditVillagerFlags=Edit Flags
Editor.B_LoadDesign=Load Design
Editor.B_LoadHouse=Load House
Editor.B_LoadVillager=Load Villager
Editor.B_RecycleBin=Edit Recycle Bin
@ -64,7 +66,6 @@ Editor.CHK_VillagerMovingOut=Moving Out
Editor.L_BankBells=Bank Bells:
Editor.L_Catchphrase=Catchphrase:
Editor.L_NookMiles=Nook Miles:
Editor.L_PatternIndex=Design Index:
Editor.L_Personality=Personality:
Editor.L_PlayerHouse=Player House:
Editor.L_PlayerName=Player Name:
@ -83,7 +84,6 @@ Editor.Menu_SavePNG=Save .png
Editor.Menu_Settings=Settings
Editor.Menu_Tools=Tools
Editor.Menu_VerifyHashes=Verify Hashes
Editor.Tab_Designs=Designs
Editor.Tab_Map=Map
Editor.Tab_Players=Players
Editor.Tab_Villagers=Villagers
@ -120,6 +120,16 @@ ItemReceivedEditor.B_AllFish=Give All Fish
ItemReceivedEditor.B_Cancel=Cancel
ItemReceivedEditor.B_GiveAll=Give All
ItemReceivedEditor.B_Save=Save
PatternEditor.B_Cancel=Cancel
PatternEditor.B_DumpDesign=Dump Design
PatternEditor.B_LoadDesign=Load Design
PatternEditor.B_Save=Save
PatternEditor.Menu_SavePNG=Save .png
PatternEditorPRO.B_Cancel=Cancel
PatternEditorPRO.B_DumpDesign=Dump Design
PatternEditorPRO.B_LoadDesign=Load Design
PatternEditorPRO.B_Save=Save
PatternEditorPRO.Menu_SavePNG=Save .png
PlayerItemEditor.B_Cancel=Cancel
PlayerItemEditor.B_Dump=Dump
PlayerItemEditor.B_Inject=Inject

View File

@ -4,6 +4,8 @@ BuildingEditor=Building Editor
FieldItemEditor=Field Item Editor
FlagEditor=Flag Editor
ItemReceivedEditor=Received Item List Editor
PatternEditor=Pattern Editor
PatternEditorPRO=Pro Design Editor
PlayerItemEditor=Inventory Editor
SimpleHexEditor=RAM Edit
SingleObjectEditor=Property Editor
@ -38,7 +40,6 @@ BuildingEditor.L_PlazaX=Plaza X:
BuildingEditor.L_PlazaY=Plaza Y:
BuildingEditor.L_StructureType=Structure Type:
BuildingEditor.L_StructureValues=Values:
Editor.B_DumpDesign=Dump Design
Editor.B_DumpHouse=Dump House
Editor.B_DumpVillager=Dump Villager
Editor.B_EditAchievements=Edit Achievements
@ -48,15 +49,16 @@ Editor.B_EditFieldItems=Edit Field Items
Editor.B_EditFurniture=Edit Furniture
Editor.B_EditHouses=Edit House
Editor.B_EditLandFlags=Edit Flags
Editor.B_EditPatterns=Edit Patterns
Editor.B_EditPlayerFlags=Edit Flags
Editor.B_EditPlayerItems=Edit Items
Editor.B_EditPlayerReceivedItems=Edit Received Items
Editor.B_EditPlayerRecipes=Edit Recipes
Editor.B_EditPlayerStorage=Edit Storage
Editor.B_EditPRODesigns=Edit PRO Designs
Editor.B_EditTerrain=Edit Terrain
Editor.B_EditTurnipExchange=Edit Turnip Exchange
Editor.B_EditVillagerFlags=Edit Flags
Editor.B_LoadDesign=Load Design
Editor.B_LoadHouse=Load House
Editor.B_LoadVillager=Load Villager
Editor.B_RecycleBin=Edit Recycle Bin
@ -64,7 +66,6 @@ Editor.CHK_VillagerMovingOut=Moving Out
Editor.L_BankBells=Bank Bells:
Editor.L_Catchphrase=Catchphrase:
Editor.L_NookMiles=Nook Miles:
Editor.L_PatternIndex=Design Index:
Editor.L_Personality=Personality:
Editor.L_PlayerHouse=Player House:
Editor.L_PlayerName=Player Name:
@ -83,7 +84,6 @@ Editor.Menu_SavePNG=Save .png
Editor.Menu_Settings=Settings
Editor.Menu_Tools=Tools
Editor.Menu_VerifyHashes=Verify Hashes
Editor.Tab_Designs=Designs
Editor.Tab_Map=Map
Editor.Tab_Players=Players
Editor.Tab_Villagers=Villagers
@ -120,6 +120,16 @@ ItemReceivedEditor.B_AllFish=Give All Fish
ItemReceivedEditor.B_Cancel=Cancel
ItemReceivedEditor.B_GiveAll=Give All
ItemReceivedEditor.B_Save=Save
PatternEditor.B_Cancel=Cancel
PatternEditor.B_DumpDesign=Dump Design
PatternEditor.B_LoadDesign=Load Design
PatternEditor.B_Save=Save
PatternEditor.Menu_SavePNG=Save .png
PatternEditorPRO.B_Cancel=Cancel
PatternEditorPRO.B_DumpDesign=Dump Design
PatternEditorPRO.B_LoadDesign=Load Design
PatternEditorPRO.B_Save=Save
PatternEditorPRO.Menu_SavePNG=Save .png
PlayerItemEditor.B_Cancel=Cancel
PlayerItemEditor.B_Dump=Dump
PlayerItemEditor.B_Inject=Inject

View File

@ -4,6 +4,8 @@ BuildingEditor=Building Editor
FieldItemEditor=Field Item Editor
FlagEditor=Flag Editor
ItemReceivedEditor=Received Item List Editor
PatternEditor=Pattern Editor
PatternEditorPRO=Pro Design Editor
PlayerItemEditor=Inventory Editor
SimpleHexEditor=RAM Edit
SingleObjectEditor=Property Editor
@ -38,7 +40,6 @@ BuildingEditor.L_PlazaX=Plaza X:
BuildingEditor.L_PlazaY=Plaza Y:
BuildingEditor.L_StructureType=Structure Type:
BuildingEditor.L_StructureValues=Values:
Editor.B_DumpDesign=Dump Design
Editor.B_DumpHouse=Dump House
Editor.B_DumpVillager=Dump Villager
Editor.B_EditAchievements=Edit Achievements
@ -48,15 +49,16 @@ Editor.B_EditFieldItems=Edit Field Items
Editor.B_EditFurniture=Edit Furniture
Editor.B_EditHouses=Edit House
Editor.B_EditLandFlags=Edit Flags
Editor.B_EditPatterns=Edit Patterns
Editor.B_EditPlayerFlags=Edit Flags
Editor.B_EditPlayerItems=Edit Items
Editor.B_EditPlayerReceivedItems=Edit Received Items
Editor.B_EditPlayerRecipes=Edit Recipes
Editor.B_EditPlayerStorage=Edit Storage
Editor.B_EditPRODesigns=Edit PRO Designs
Editor.B_EditTerrain=Edit Terrain
Editor.B_EditTurnipExchange=Edit Turnip Exchange
Editor.B_EditVillagerFlags=Edit Flags
Editor.B_LoadDesign=Load Design
Editor.B_LoadHouse=Load House
Editor.B_LoadVillager=Load Villager
Editor.B_RecycleBin=Edit Recycle Bin
@ -64,7 +66,6 @@ Editor.CHK_VillagerMovingOut=Moving Out
Editor.L_BankBells=Bank Bells:
Editor.L_Catchphrase=Catchphrase:
Editor.L_NookMiles=Nook Miles:
Editor.L_PatternIndex=Design Index:
Editor.L_Personality=Personality:
Editor.L_PlayerHouse=Player House:
Editor.L_PlayerName=Player Name:
@ -83,7 +84,6 @@ Editor.Menu_SavePNG=Save .png
Editor.Menu_Settings=Settings
Editor.Menu_Tools=Tools
Editor.Menu_VerifyHashes=Verify Hashes
Editor.Tab_Designs=Designs
Editor.Tab_Map=Map
Editor.Tab_Players=Players
Editor.Tab_Villagers=Villagers
@ -120,6 +120,16 @@ ItemReceivedEditor.B_AllFish=Give All Fish
ItemReceivedEditor.B_Cancel=Cancel
ItemReceivedEditor.B_GiveAll=Give All
ItemReceivedEditor.B_Save=Save
PatternEditor.B_Cancel=Cancel
PatternEditor.B_DumpDesign=Dump Design
PatternEditor.B_LoadDesign=Load Design
PatternEditor.B_Save=Save
PatternEditor.Menu_SavePNG=Save .png
PatternEditorPRO.B_Cancel=Cancel
PatternEditorPRO.B_DumpDesign=Dump Design
PatternEditorPRO.B_LoadDesign=Load Design
PatternEditorPRO.B_Save=Save
PatternEditorPRO.Menu_SavePNG=Save .png
PlayerItemEditor.B_Cancel=Cancel
PlayerItemEditor.B_Dump=Dump
PlayerItemEditor.B_Inject=Inject

View File

@ -4,6 +4,8 @@ BuildingEditor=Building Editor
FieldItemEditor=Field Item Editor
FlagEditor=Flag Editor
ItemReceivedEditor=Received Item List Editor
PatternEditor=Pattern Editor
PatternEditorPRO=Pro Design Editor
PlayerItemEditor=Inventory Editor
SimpleHexEditor=RAM Edit
SingleObjectEditor=Property Editor
@ -38,7 +40,6 @@ BuildingEditor.L_PlazaX=Plaza X:
BuildingEditor.L_PlazaY=Plaza Y:
BuildingEditor.L_StructureType=Structure Type:
BuildingEditor.L_StructureValues=Values:
Editor.B_DumpDesign=Dump Design
Editor.B_DumpHouse=Dump House
Editor.B_DumpVillager=Dump Villager
Editor.B_EditAchievements=Edit Achievements
@ -48,15 +49,16 @@ Editor.B_EditFieldItems=Edit Field Items
Editor.B_EditFurniture=Edit Furniture
Editor.B_EditHouses=Edit House
Editor.B_EditLandFlags=Edit Flags
Editor.B_EditPatterns=Edit Patterns
Editor.B_EditPlayerFlags=Edit Flags
Editor.B_EditPlayerItems=Edit Items
Editor.B_EditPlayerReceivedItems=Edit Received Items
Editor.B_EditPlayerRecipes=Edit Recipes
Editor.B_EditPlayerStorage=Edit Storage
Editor.B_EditPRODesigns=Edit PRO Designs
Editor.B_EditTerrain=Edit Terrain
Editor.B_EditTurnipExchange=Edit Turnip Exchange
Editor.B_EditVillagerFlags=Edit Flags
Editor.B_LoadDesign=Load Design
Editor.B_LoadHouse=Load House
Editor.B_LoadVillager=Load Villager
Editor.B_RecycleBin=Edit Recycle Bin
@ -64,7 +66,6 @@ Editor.CHK_VillagerMovingOut=Moving Out
Editor.L_BankBells=Bank Bells:
Editor.L_Catchphrase=Catchphrase:
Editor.L_NookMiles=Nook Miles:
Editor.L_PatternIndex=Design Index:
Editor.L_Personality=Personality:
Editor.L_PlayerHouse=Player House:
Editor.L_PlayerName=Player Name:
@ -83,7 +84,6 @@ Editor.Menu_SavePNG=Save .png
Editor.Menu_Settings=Settings
Editor.Menu_Tools=Tools
Editor.Menu_VerifyHashes=Verify Hashes
Editor.Tab_Designs=Designs
Editor.Tab_Map=Map
Editor.Tab_Players=Players
Editor.Tab_Villagers=Villagers
@ -120,6 +120,16 @@ ItemReceivedEditor.B_AllFish=Give All Fish
ItemReceivedEditor.B_Cancel=Cancel
ItemReceivedEditor.B_GiveAll=Give All
ItemReceivedEditor.B_Save=Save
PatternEditor.B_Cancel=Cancel
PatternEditor.B_DumpDesign=Dump Design
PatternEditor.B_LoadDesign=Load Design
PatternEditor.B_Save=Save
PatternEditor.Menu_SavePNG=Save .png
PatternEditorPRO.B_Cancel=Cancel
PatternEditorPRO.B_DumpDesign=Dump Design
PatternEditorPRO.B_LoadDesign=Load Design
PatternEditorPRO.B_Save=Save
PatternEditorPRO.Menu_SavePNG=Save .png
PlayerItemEditor.B_Cancel=Cancel
PlayerItemEditor.B_Dump=Dump
PlayerItemEditor.B_Inject=Inject

View File

@ -4,6 +4,8 @@ BuildingEditor=Building Editor
FieldItemEditor=Field Item Editor
FlagEditor=Flag Editor
ItemReceivedEditor=Received Item List Editor
PatternEditor=Pattern Editor
PatternEditorPRO=Pro Design Editor
PlayerItemEditor=Inventory Editor
SimpleHexEditor=RAM Edit
SingleObjectEditor=Property Editor
@ -38,7 +40,6 @@ BuildingEditor.L_PlazaX=Plaza X:
BuildingEditor.L_PlazaY=Plaza Y:
BuildingEditor.L_StructureType=Structure Type:
BuildingEditor.L_StructureValues=Values:
Editor.B_DumpDesign=Dump Design
Editor.B_DumpHouse=Dump House
Editor.B_DumpVillager=Dump Villager
Editor.B_EditAchievements=Edit Achievements
@ -48,15 +49,16 @@ Editor.B_EditFieldItems=Edit Field Items
Editor.B_EditFurniture=Edit Furniture
Editor.B_EditHouses=Edit House
Editor.B_EditLandFlags=Edit Flags
Editor.B_EditPatterns=Edit Patterns
Editor.B_EditPlayerFlags=Edit Flags
Editor.B_EditPlayerItems=Edit Items
Editor.B_EditPlayerReceivedItems=Edit Received Items
Editor.B_EditPlayerRecipes=Edit Recipes
Editor.B_EditPlayerStorage=Edit Storage
Editor.B_EditPRODesigns=Edit PRO Designs
Editor.B_EditTerrain=Edit Terrain
Editor.B_EditTurnipExchange=Edit Turnip Exchange
Editor.B_EditVillagerFlags=Edit Flags
Editor.B_LoadDesign=Load Design
Editor.B_LoadHouse=Load House
Editor.B_LoadVillager=Load Villager
Editor.B_RecycleBin=Edit Recycle Bin
@ -64,7 +66,6 @@ Editor.CHK_VillagerMovingOut=Moving Out
Editor.L_BankBells=Bank Bells:
Editor.L_Catchphrase=Catchphrase:
Editor.L_NookMiles=Nook Miles:
Editor.L_PatternIndex=Design Index:
Editor.L_Personality=Personality:
Editor.L_PlayerHouse=Player House:
Editor.L_PlayerName=Player Name:
@ -83,7 +84,6 @@ Editor.Menu_SavePNG=Save .png
Editor.Menu_Settings=Settings
Editor.Menu_Tools=Tools
Editor.Menu_VerifyHashes=Verify Hashes
Editor.Tab_Designs=Designs
Editor.Tab_Map=Map
Editor.Tab_Players=Players
Editor.Tab_Villagers=Villagers
@ -120,6 +120,16 @@ ItemReceivedEditor.B_AllFish=Give All Fish
ItemReceivedEditor.B_Cancel=Cancel
ItemReceivedEditor.B_GiveAll=Give All
ItemReceivedEditor.B_Save=Save
PatternEditor.B_Cancel=Cancel
PatternEditor.B_DumpDesign=Dump Design
PatternEditor.B_LoadDesign=Load Design
PatternEditor.B_Save=Save
PatternEditor.Menu_SavePNG=Save .png
PatternEditorPRO.B_Cancel=Cancel
PatternEditorPRO.B_DumpDesign=Dump Design
PatternEditorPRO.B_LoadDesign=Load Design
PatternEditorPRO.B_Save=Save
PatternEditorPRO.Menu_SavePNG=Save .png
PlayerItemEditor.B_Cancel=Cancel
PlayerItemEditor.B_Dump=Dump
PlayerItemEditor.B_Inject=Inject

View File

@ -0,0 +1,236 @@
namespace NHSE.WinForms
{
partial class PatternEditorPRO
{
/// <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.components = new System.ComponentModel.Container();
this.B_Save = new System.Windows.Forms.Button();
this.B_Cancel = new System.Windows.Forms.Button();
this.LB_Items = new System.Windows.Forms.ListBox();
this.PB_Palette = new System.Windows.Forms.PictureBox();
this.L_PatternName = new System.Windows.Forms.Label();
this.B_LoadDesign = new System.Windows.Forms.Button();
this.B_DumpDesign = new System.Windows.Forms.Button();
this.PB_Sheet0 = new System.Windows.Forms.PictureBox();
this.CM_Picture = new System.Windows.Forms.ContextMenuStrip(this.components);
this.Menu_SavePNG = new System.Windows.Forms.ToolStripMenuItem();
this.PB_Sheet1 = new System.Windows.Forms.PictureBox();
this.PB_Sheet3 = new System.Windows.Forms.PictureBox();
this.PB_Sheet2 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.PB_Palette)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PB_Sheet0)).BeginInit();
this.CM_Picture.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.PB_Sheet1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PB_Sheet3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PB_Sheet2)).BeginInit();
this.SuspendLayout();
//
// 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(488, 276);
this.B_Save.Name = "B_Save";
this.B_Save.Size = new System.Drawing.Size(92, 40);
this.B_Save.TabIndex = 1;
this.B_Save.Text = "Save";
this.B_Save.UseVisualStyleBackColor = true;
this.B_Save.Click += new System.EventHandler(this.B_Save_Click);
//
// 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(390, 276);
this.B_Cancel.Name = "B_Cancel";
this.B_Cancel.Size = new System.Drawing.Size(92, 40);
this.B_Cancel.TabIndex = 2;
this.B_Cancel.Text = "Cancel";
this.B_Cancel.UseVisualStyleBackColor = true;
this.B_Cancel.Click += new System.EventHandler(this.B_Cancel_Click);
//
// LB_Items
//
this.LB_Items.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.LB_Items.FormattingEnabled = true;
this.LB_Items.Location = new System.Drawing.Point(12, 12);
this.LB_Items.Name = "LB_Items";
this.LB_Items.Size = new System.Drawing.Size(149, 303);
this.LB_Items.TabIndex = 3;
this.LB_Items.SelectedIndexChanged += new System.EventHandler(this.LB_Items_SelectedIndexChanged);
//
// PB_Palette
//
this.PB_Palette.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.PB_Palette.Location = new System.Drawing.Point(432, 12);
this.PB_Palette.Name = "PB_Palette";
this.PB_Palette.Size = new System.Drawing.Size(152, 12);
this.PB_Palette.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.PB_Palette.TabIndex = 34;
this.PB_Palette.TabStop = false;
//
// L_PatternName
//
this.L_PatternName.AutoSize = true;
this.L_PatternName.Location = new System.Drawing.Point(429, 28);
this.L_PatternName.Name = "L_PatternName";
this.L_PatternName.Size = new System.Drawing.Size(73, 13);
this.L_PatternName.TabIndex = 33;
this.L_PatternName.Text = "*PatternName";
//
// B_LoadDesign
//
this.B_LoadDesign.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.B_LoadDesign.Location = new System.Drawing.Point(266, 276);
this.B_LoadDesign.Name = "B_LoadDesign";
this.B_LoadDesign.Size = new System.Drawing.Size(92, 40);
this.B_LoadDesign.TabIndex = 32;
this.B_LoadDesign.Text = "Load Design";
this.B_LoadDesign.UseVisualStyleBackColor = true;
this.B_LoadDesign.Click += new System.EventHandler(this.B_LoadDesign_Click);
//
// B_DumpDesign
//
this.B_DumpDesign.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.B_DumpDesign.Location = new System.Drawing.Point(168, 276);
this.B_DumpDesign.Name = "B_DumpDesign";
this.B_DumpDesign.Size = new System.Drawing.Size(92, 40);
this.B_DumpDesign.TabIndex = 31;
this.B_DumpDesign.Text = "Dump Design";
this.B_DumpDesign.UseVisualStyleBackColor = true;
this.B_DumpDesign.Click += new System.EventHandler(this.B_DumpDesign_Click);
//
// PB_Sheet0
//
this.PB_Sheet0.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.PB_Sheet0.ContextMenuStrip = this.CM_Picture;
this.PB_Sheet0.Location = new System.Drawing.Point(168, 12);
this.PB_Sheet0.Name = "PB_Sheet0";
this.PB_Sheet0.Size = new System.Drawing.Size(130, 130);
this.PB_Sheet0.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.PB_Sheet0.TabIndex = 30;
this.PB_Sheet0.TabStop = false;
this.PB_Sheet0.MouseEnter += new System.EventHandler(this.PB_Pattern_MouseEnter);
this.PB_Sheet0.MouseLeave += new System.EventHandler(this.PB_Pattern_MouseLeave);
//
// CM_Picture
//
this.CM_Picture.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.Menu_SavePNG});
this.CM_Picture.Name = "CM_Picture";
this.CM_Picture.ShowImageMargin = false;
this.CM_Picture.Size = new System.Drawing.Size(101, 26);
//
// Menu_SavePNG
//
this.Menu_SavePNG.Name = "Menu_SavePNG";
this.Menu_SavePNG.Size = new System.Drawing.Size(100, 22);
this.Menu_SavePNG.Text = "Save .png";
this.Menu_SavePNG.Click += new System.EventHandler(this.Menu_SavePNG_Click);
//
// PB_Sheet1
//
this.PB_Sheet1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.PB_Sheet1.ContextMenuStrip = this.CM_Picture;
this.PB_Sheet1.Location = new System.Drawing.Point(298, 12);
this.PB_Sheet1.Name = "PB_Sheet1";
this.PB_Sheet1.Size = new System.Drawing.Size(130, 130);
this.PB_Sheet1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.PB_Sheet1.TabIndex = 35;
this.PB_Sheet1.TabStop = false;
//
// PB_Sheet3
//
this.PB_Sheet3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.PB_Sheet3.ContextMenuStrip = this.CM_Picture;
this.PB_Sheet3.Location = new System.Drawing.Point(298, 142);
this.PB_Sheet3.Name = "PB_Sheet3";
this.PB_Sheet3.Size = new System.Drawing.Size(130, 130);
this.PB_Sheet3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.PB_Sheet3.TabIndex = 37;
this.PB_Sheet3.TabStop = false;
//
// PB_Sheet2
//
this.PB_Sheet2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.PB_Sheet2.ContextMenuStrip = this.CM_Picture;
this.PB_Sheet2.Location = new System.Drawing.Point(168, 142);
this.PB_Sheet2.Name = "PB_Sheet2";
this.PB_Sheet2.Size = new System.Drawing.Size(130, 130);
this.PB_Sheet2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.PB_Sheet2.TabIndex = 36;
this.PB_Sheet2.TabStop = false;
//
// PatternEditorPRO
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(592, 328);
this.Controls.Add(this.PB_Sheet3);
this.Controls.Add(this.PB_Sheet2);
this.Controls.Add(this.PB_Sheet1);
this.Controls.Add(this.PB_Palette);
this.Controls.Add(this.L_PatternName);
this.Controls.Add(this.B_LoadDesign);
this.Controls.Add(this.B_DumpDesign);
this.Controls.Add(this.PB_Sheet0);
this.Controls.Add(this.LB_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 = "PatternEditorPRO";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Pro Design Editor";
((System.ComponentModel.ISupportInitialize)(this.PB_Palette)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.PB_Sheet0)).EndInit();
this.CM_Picture.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.PB_Sheet1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.PB_Sheet3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.PB_Sheet2)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button B_Save;
private System.Windows.Forms.Button B_Cancel;
private System.Windows.Forms.ListBox LB_Items;
private System.Windows.Forms.PictureBox PB_Palette;
private System.Windows.Forms.Label L_PatternName;
private System.Windows.Forms.Button B_LoadDesign;
private System.Windows.Forms.Button B_DumpDesign;
private System.Windows.Forms.PictureBox PB_Sheet0;
private System.Windows.Forms.ContextMenuStrip CM_Picture;
private System.Windows.Forms.ToolStripMenuItem Menu_SavePNG;
private System.Windows.Forms.PictureBox PB_Sheet1;
private System.Windows.Forms.PictureBox PB_Sheet3;
private System.Windows.Forms.PictureBox PB_Sheet2;
}
}

View File

@ -0,0 +1,156 @@
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Windows.Forms;
using NHSE.Core;
using NHSE.Sprites;
namespace NHSE.WinForms
{
public partial class PatternEditorPRO : Form
{
private readonly DesignPatternPRO[] Patterns;
private int Index;
private const int scale = 2;
public PatternEditorPRO(DesignPatternPRO[] patterns)
{
InitializeComponent();
this.TranslateInterface(GameInfo.CurrentLanguage);
Patterns = patterns;
DialogResult = DialogResult.Cancel;
foreach (var p in patterns)
LB_Items.Items.Add(GetPatternSummary(p));
LB_Items.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 void LB_Items_SelectedIndexChanged(object sender, EventArgs e)
{
if (LB_Items.SelectedIndex < 0)
return;
LoadPattern(Patterns[Index = LB_Items.SelectedIndex]);
}
private static string GetPatternSummary(DesignPatternPRO p) => p.DesignName;
private void B_DumpDesign_Click(object sender, EventArgs e)
{
if (ModifierKeys == Keys.Shift)
{
using var fbd = new FolderBrowserDialog();
if (fbd.ShowDialog() != DialogResult.OK)
return;
var dir = Path.GetDirectoryName(fbd.SelectedPath);
if (dir == null || !Directory.Exists(dir))
return;
Patterns.Dump(fbd.SelectedPath);
return;
}
var original = Patterns[Index];
var name = original.DesignName;
using var sfd = new SaveFileDialog
{
Filter = "New Horizons PRO Design (*.nhpd)|*.nhpd|All files (*.*)|*.*",
FileName = $"{name}.nhd",
};
if (sfd.ShowDialog() != DialogResult.OK)
return;
var d = original;
File.WriteAllBytes(sfd.FileName, d.Data);
}
private void B_LoadDesign_Click(object sender, EventArgs e)
{
var original = Patterns[Index];
var name = original.DesignName;
using var ofd = new OpenFileDialog
{
Filter = "New Horizons PRO Design (*.nhpd)|*.nhpd|All files (*.*)|*.*",
FileName = $"{name}.nhd",
};
if (ofd.ShowDialog() != DialogResult.OK)
return;
var file = ofd.FileName;
var expectLength = original.Data.Length;
var fi = new FileInfo(file);
if (fi.Length != expectLength)
{
var msg = string.Format(MessageStrings.MsgDataSizeMismatchImport, fi.Length, expectLength);
WinFormsUtil.Error(MessageStrings.MsgCanceling, msg);
return;
}
var data = File.ReadAllBytes(ofd.FileName);
var d = new DesignPatternPRO(data);
var player0 = original;
if (!d.IsOriginatedFrom(player0))
{
var notHost = string.Format(MessageStrings.MsgDataDidNotOriginateFromHost_0, player0.PlayerName);
var result = WinFormsUtil.Prompt(MessageBoxButtons.YesNoCancel, notHost, MessageStrings.MsgAskUpdateValues);
if (result == DialogResult.Cancel)
return;
if (result == DialogResult.Yes)
d.ChangeOrigins(player0, d.Data);
}
Patterns[Index] = d;
LoadPattern(d);
}
private void LoadPattern(DesignPatternPRO dp)
{
const int w = DesignPatternPRO.Width * scale;
const int h = DesignPatternPRO.Height * scale;
PB_Sheet0.Image = ImageUtil.ResizeImage(dp.GetImage(0), w, h);
PB_Sheet1.Image = ImageUtil.ResizeImage(dp.GetImage(1), w, h);
PB_Sheet2.Image = ImageUtil.ResizeImage(dp.GetImage(2), w, h);
PB_Sheet3.Image = ImageUtil.ResizeImage(dp.GetImage(3), w, h);
PB_Palette.Image = ImageUtil.ResizeImage(dp.GetPalette(), 150, 10);
L_PatternName.Text = dp.DesignName + Environment.NewLine +
dp.TownName + Environment.NewLine +
dp.PlayerName;
}
private void PB_Pattern_MouseEnter(object sender, EventArgs e) => PB_Sheet0.BackColor = Color.GreenYellow;
private void PB_Pattern_MouseLeave(object sender, EventArgs e) => PB_Sheet0.BackColor = Color.Transparent;
private void Menu_SavePNG_Click(object sender, EventArgs e)
{
var pb = WinFormsUtil.GetUnderlyingControl<PictureBox>(sender);
if (pb?.Image == null)
{
WinFormsUtil.Alert(MessageStrings.MsgNoPictureLoaded);
return;
}
var name = Patterns[Index].DesignName;
using var sfd = new SaveFileDialog
{
Filter = "png file (*.png)|*.png|All files (*.*)|*.*",
FileName = $"{name}.png",
};
if (sfd.ShowDialog() != DialogResult.OK)
return;
var bmp = pb.Image;
bmp.Save(sfd.FileName, ImageFormat.Png);
}
}
}

View File

@ -0,0 +1,123 @@
<?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>
<metadata name="CM_Picture.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>