mirror of
https://github.com/kwsch/NHSE.git
synced 2026-09-27 20:36:55 -05:00
Relocate Fruits/Flowers + cleanup strings (#711)
Relocated island/sister fruit/flower functionality to new FruitsFlowersEditor out of MiscPlayer to better follow existing layout. Added new button for this editor to Map tab for the new form. MiscPlayer fruit now sets passport only, FruitsFlowersEditor sets both. Other functionality remains as before. Retired FieldGoods from the Map button in favour of above. Adjusted UI anchors and open positions for new forms + cleaned up recent lang_xx string additions.
This commit is contained in:
committed by
GitHub
parent
c412da8217
commit
9bcaee6fc9
@@ -244,9 +244,11 @@ private void InitializeComponent()
|
||||
Controls.Add(NUD_Species);
|
||||
Controls.Add(L_Species);
|
||||
Controls.Add(PB_Villager);
|
||||
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
Icon = Properties.Resources.icon;
|
||||
MaximizeBox = false;
|
||||
Name = "CampsiteEditor";
|
||||
SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
Text = "Campsite Editor";
|
||||
((System.ComponentModel.ISupportInitialize)PB_Villager).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)NUD_Variant).EndInit();
|
||||
|
||||
@@ -22,6 +22,8 @@ private void ChangeVillager()
|
||||
public CampsiteEditor(HorizonSave sav)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.TranslateInterface(GameInfo.CurrentLanguage);
|
||||
|
||||
SAV = sav;
|
||||
|
||||
CheckCampsiteStatus();
|
||||
|
||||
181
NHSE.WinForms/Subforms/Map/FruitsFlowersEditor.Designer.cs
generated
Normal file
181
NHSE.WinForms/Subforms/Map/FruitsFlowersEditor.Designer.cs
generated
Normal file
@@ -0,0 +1,181 @@
|
||||
namespace NHSE.WinForms
|
||||
{
|
||||
partial class FruitsFlowersEditor
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
CB_SisterFlower = new System.Windows.Forms.ComboBox();
|
||||
CB_ProfileFlower = new System.Windows.Forms.ComboBox();
|
||||
L_ProfileSisterFlower = new System.Windows.Forms.Label();
|
||||
L_ProfileSpecialtyFlower = new System.Windows.Forms.Label();
|
||||
RIS_SisterFruit = new RestrictedItemSelect();
|
||||
L_ProfileSisterFruit = new System.Windows.Forms.Label();
|
||||
RIS_ProfileFruit = new RestrictedItemSelect();
|
||||
L_ProfileSpecialtyFruit = new System.Windows.Forms.Label();
|
||||
B_Cancel = new System.Windows.Forms.Button();
|
||||
B_Save = new System.Windows.Forms.Button();
|
||||
SuspendLayout();
|
||||
//
|
||||
// CB_SisterFlower
|
||||
//
|
||||
CB_SisterFlower.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
CB_SisterFlower.FormattingEnabled = true;
|
||||
CB_SisterFlower.Location = new System.Drawing.Point(186, 106);
|
||||
CB_SisterFlower.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
CB_SisterFlower.Name = "CB_SisterFlower";
|
||||
CB_SisterFlower.Size = new System.Drawing.Size(162, 23);
|
||||
CB_SisterFlower.TabIndex = 71;
|
||||
//
|
||||
// CB_ProfileFlower
|
||||
//
|
||||
CB_ProfileFlower.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
CB_ProfileFlower.FormattingEnabled = true;
|
||||
CB_ProfileFlower.Location = new System.Drawing.Point(9, 106);
|
||||
CB_ProfileFlower.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
CB_ProfileFlower.Name = "CB_ProfileFlower";
|
||||
CB_ProfileFlower.Size = new System.Drawing.Size(164, 23);
|
||||
CB_ProfileFlower.TabIndex = 70;
|
||||
//
|
||||
// L_ProfileSisterFlower
|
||||
//
|
||||
L_ProfileSisterFlower.AutoSize = true;
|
||||
L_ProfileSisterFlower.Location = new System.Drawing.Point(183, 88);
|
||||
L_ProfileSisterFlower.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
L_ProfileSisterFlower.Name = "L_ProfileSisterFlower";
|
||||
L_ProfileSisterFlower.Size = new System.Drawing.Size(81, 15);
|
||||
L_ProfileSisterFlower.TabIndex = 69;
|
||||
L_ProfileSisterFlower.Text = "Flower (Sister)";
|
||||
//
|
||||
// L_ProfileSpecialtyFlower
|
||||
//
|
||||
L_ProfileSpecialtyFlower.AutoSize = true;
|
||||
L_ProfileSpecialtyFlower.Location = new System.Drawing.Point(6, 88);
|
||||
L_ProfileSpecialtyFlower.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
L_ProfileSpecialtyFlower.Name = "L_ProfileSpecialtyFlower";
|
||||
L_ProfileSpecialtyFlower.Size = new System.Drawing.Size(81, 15);
|
||||
L_ProfileSpecialtyFlower.TabIndex = 68;
|
||||
L_ProfileSpecialtyFlower.Text = "Flower (Local)";
|
||||
//
|
||||
// RIS_SisterFruit
|
||||
//
|
||||
RIS_SisterFruit.Location = new System.Drawing.Point(186, 26);
|
||||
RIS_SisterFruit.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3);
|
||||
RIS_SisterFruit.Name = "RIS_SisterFruit";
|
||||
RIS_SisterFruit.Size = new System.Drawing.Size(167, 55);
|
||||
RIS_SisterFruit.TabIndex = 67;
|
||||
//
|
||||
// L_ProfileSisterFruit
|
||||
//
|
||||
L_ProfileSisterFruit.AutoSize = true;
|
||||
L_ProfileSisterFruit.Location = new System.Drawing.Point(182, 8);
|
||||
L_ProfileSisterFruit.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
L_ProfileSisterFruit.Name = "L_ProfileSisterFruit";
|
||||
L_ProfileSisterFruit.Size = new System.Drawing.Size(70, 15);
|
||||
L_ProfileSisterFruit.TabIndex = 66;
|
||||
L_ProfileSisterFruit.Text = "Fruit (Sister)";
|
||||
//
|
||||
// RIS_ProfileFruit
|
||||
//
|
||||
RIS_ProfileFruit.Location = new System.Drawing.Point(9, 26);
|
||||
RIS_ProfileFruit.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3);
|
||||
RIS_ProfileFruit.Name = "RIS_ProfileFruit";
|
||||
RIS_ProfileFruit.Size = new System.Drawing.Size(167, 55);
|
||||
RIS_ProfileFruit.TabIndex = 65;
|
||||
//
|
||||
// L_ProfileSpecialtyFruit
|
||||
//
|
||||
L_ProfileSpecialtyFruit.AutoSize = true;
|
||||
L_ProfileSpecialtyFruit.Location = new System.Drawing.Point(6, 8);
|
||||
L_ProfileSpecialtyFruit.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
L_ProfileSpecialtyFruit.Name = "L_ProfileSpecialtyFruit";
|
||||
L_ProfileSpecialtyFruit.Size = new System.Drawing.Size(70, 15);
|
||||
L_ProfileSpecialtyFruit.TabIndex = 64;
|
||||
L_ProfileSpecialtyFruit.Text = "Fruit (Local)";
|
||||
//
|
||||
// B_Cancel
|
||||
//
|
||||
B_Cancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
|
||||
B_Cancel.Location = new System.Drawing.Point(173, 157);
|
||||
B_Cancel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
B_Cancel.Name = "B_Cancel";
|
||||
B_Cancel.Size = new System.Drawing.Size(84, 27);
|
||||
B_Cancel.TabIndex = 73;
|
||||
B_Cancel.Text = "Cancel";
|
||||
B_Cancel.UseVisualStyleBackColor = true;
|
||||
B_Cancel.Click += B_Cancel_Click;
|
||||
//
|
||||
// B_Save
|
||||
//
|
||||
B_Save.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
|
||||
B_Save.Location = new System.Drawing.Point(264, 157);
|
||||
B_Save.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
B_Save.Name = "B_Save";
|
||||
B_Save.Size = new System.Drawing.Size(84, 27);
|
||||
B_Save.TabIndex = 72;
|
||||
B_Save.Text = "Save";
|
||||
B_Save.UseVisualStyleBackColor = true;
|
||||
B_Save.Click += B_Save_Click;
|
||||
//
|
||||
// FruitsFlowersEditor
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
ClientSize = new System.Drawing.Size(361, 196);
|
||||
Controls.Add(B_Cancel);
|
||||
Controls.Add(B_Save);
|
||||
Controls.Add(CB_SisterFlower);
|
||||
Controls.Add(CB_ProfileFlower);
|
||||
Controls.Add(L_ProfileSisterFlower);
|
||||
Controls.Add(L_ProfileSpecialtyFlower);
|
||||
Controls.Add(RIS_SisterFruit);
|
||||
Controls.Add(L_ProfileSisterFruit);
|
||||
Controls.Add(RIS_ProfileFruit);
|
||||
Controls.Add(L_ProfileSpecialtyFruit);
|
||||
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
Icon = Properties.Resources.icon;
|
||||
MaximizeBox = false;
|
||||
Name = "FruitsFlowersEditor";
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
Text = "Fruits Flowers Editor";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ComboBox CB_SisterFlower;
|
||||
private System.Windows.Forms.ComboBox CB_ProfileFlower;
|
||||
private System.Windows.Forms.Label L_ProfileSisterFlower;
|
||||
private System.Windows.Forms.Label L_ProfileSpecialtyFlower;
|
||||
private RestrictedItemSelect RIS_SisterFruit;
|
||||
private System.Windows.Forms.Label L_ProfileSisterFruit;
|
||||
private RestrictedItemSelect RIS_ProfileFruit;
|
||||
private System.Windows.Forms.Label L_ProfileSpecialtyFruit;
|
||||
private System.Windows.Forms.Button B_Cancel;
|
||||
private System.Windows.Forms.Button B_Save;
|
||||
}
|
||||
}
|
||||
103
NHSE.WinForms/Subforms/Map/FruitsFlowersEditor.cs
Normal file
103
NHSE.WinForms/Subforms/Map/FruitsFlowersEditor.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
using NHSE.Core;
|
||||
using NHSE.Sprites;
|
||||
using System;
|
||||
using System.Runtime.Intrinsics.Arm;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace NHSE.WinForms;
|
||||
|
||||
public partial class FruitsFlowersEditor : Form
|
||||
{
|
||||
private readonly Player Player;
|
||||
private readonly MainSave Save;
|
||||
|
||||
public FruitsFlowersEditor(Player p, MainSave s)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.TranslateInterface(GameInfo.CurrentLanguage);
|
||||
Player = p;
|
||||
Save = s;
|
||||
|
||||
var fruitsSpecialty = ComboItemUtil.GetArray(GameLists.Fruits, GameInfo.Strings.itemlistdisplay);
|
||||
RIS_ProfileFruit.Initialize(fruitsSpecialty);
|
||||
|
||||
var fruitsSister = ComboItemUtil.GetArray(GameLists.Fruits, GameInfo.Strings.itemlistdisplay);
|
||||
RIS_SisterFruit.Initialize(fruitsSister);
|
||||
|
||||
LoadFruitsFlowers();
|
||||
}
|
||||
|
||||
private void LoadFruitsFlowers()
|
||||
{
|
||||
var p = Player;
|
||||
var pers = p.Personal;
|
||||
|
||||
var sav = Save;
|
||||
|
||||
RIS_ProfileFruit.Value = pers.ProfileFruit;
|
||||
RIS_SisterFruit.Value = sav.SisterFruit;
|
||||
|
||||
var flowersProfile = Enum.GetNames<IslandFlowers>();
|
||||
CB_ProfileFlower.Items.AddRange(flowersProfile);
|
||||
CB_ProfileFlower.SelectedIndex = (int)sav.SpecialtyFlower;
|
||||
|
||||
var flowersSister = Enum.GetNames<IslandFlowers>();
|
||||
CB_SisterFlower.Items.AddRange(flowersSister);
|
||||
CB_SisterFlower.SelectedIndex = (int)sav.SisterFlower;
|
||||
}
|
||||
|
||||
private void B_Cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void B_Save_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveFruitsFlowers();
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
|
||||
public void UpdateFruitFlags(MainSave sav)
|
||||
{
|
||||
var fruit = new byte[] { 00, 00, 00, 00, 00 };
|
||||
switch (sav.SpecialtyFruit)
|
||||
{
|
||||
case 2213: // Apple
|
||||
fruit[0] = 01;
|
||||
break;
|
||||
case 2287: // Cherry
|
||||
fruit[4] = 01;
|
||||
break;
|
||||
case 2214: // Orange
|
||||
fruit[1] = 01;
|
||||
break;
|
||||
case 2286: // Peach
|
||||
fruit[3] = 01;
|
||||
break;
|
||||
case 2285: // Pear
|
||||
fruit[2] = 01;
|
||||
break;
|
||||
}
|
||||
sav.FruitFlags = fruit;
|
||||
}
|
||||
|
||||
private void SaveFruitsFlowers()
|
||||
{
|
||||
var p = Player;
|
||||
var pers = p.Personal;
|
||||
|
||||
var sav = Save;
|
||||
|
||||
pers.ProfileFruit = RIS_ProfileFruit.Value;
|
||||
sav.SpecialtyFruit = RIS_ProfileFruit.Value;
|
||||
sav.SisterFruit = RIS_SisterFruit.Value;
|
||||
UpdateFruitFlags(sav);
|
||||
|
||||
sav.SpecialtyFlower = (IslandFlowers)CB_ProfileFlower.SelectedIndex;
|
||||
sav.SisterFlower = (IslandFlowers)CB_SisterFlower.SelectedIndex;
|
||||
}
|
||||
}
|
||||
|
||||
120
NHSE.WinForms/Subforms/Map/FruitsFlowersEditor.resx
Normal file
120
NHSE.WinForms/Subforms/Map/FruitsFlowersEditor.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>
|
||||
Reference in New Issue
Block a user