Minor work on shop editor controls

This commit is contained in:
Cuyler36 2018-11-09 00:39:50 -05:00
parent 2f77c57311
commit 30970f92bf
4 changed files with 33 additions and 2 deletions

View file

@ -100,6 +100,12 @@ public void SetSize(byte size)
case SaveGeneration.GCN:
saveFile.Write(saveFile.SaveDataStartOffset + shopOffsets.FurnitureShopUpgrade,
(byte)((saveFile.ReadByte(saveFile.SaveDataStartOffset + shopOffsets.FurnitureShopUpgrade) & 0x3F) | ((size & 3) << 6)));
if (size == 3 && VisitorBellsSum < 1)
{
VisitorBellsSum = int.MaxValue;
}
break;
case SaveGeneration.N3DS:
saveFile.Write(saveFile.SaveDataStartOffset + shopOffsets.FurnitureShopUpgrade, size);

View file

@ -94,7 +94,10 @@
<Compile Include="Controls\RegexTextBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\ShopEditorControl.cs">
<Compile Include="Controls\ShopControls\FurnitureShopEditorControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\ShopControls\ShopEditorControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\SingleItemEditor.cs">

View file

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ACSE.Core.Town.Shops;
namespace ACSE.WinForms.Controls.ShopControls
{
public class FurnitureShopEditorControl : ShopEditorControl
{
public FurnitureShopEditorControl(MainForm form, Shop shop, int itemsPerRow, bool hasBellsSum = false)
: base(form, shop, itemsPerRow, hasBellsSum)
{
}
}
}

View file

@ -1,15 +1,17 @@
using System.Globalization;
using System.Windows.Forms;
using ACSE.Core.Items;
using ACSE.Core.Patterns;
using ACSE.Core.Town.Shops;
namespace ACSE.WinForms.Controls
namespace ACSE.WinForms.Controls.ShopControls
{
public class ShopEditorControl : Panel
{
protected ItemEditor ShopEditor;
protected Label ShopLabel;
protected NumericTextBox BellsSumTextBox;
protected Pattern[] Patterns;
public Shop Shop;
@ -48,6 +50,8 @@ public ShopEditorControl(MainForm mainWindow, Shop shop, int itemsPerRow, bool h
shop.BellsSum = value;
}
};
Controls.Add(BellsSumTextBox);
}
ShopEditor = new ItemEditor(mainWindow, shop.Stock, itemsPerRow, 16);