Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
409 changes: 240 additions & 169 deletions BaseOverlay.cs

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions DeliveryService/DeliveryService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DeliveryService</RootNamespace>
<AssemblyName>DeliveryService</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<LangVersion>latest</LangVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -55,7 +57,6 @@
<Compile Include="Framework\LocationHelper.cs" />
<Compile Include="Framework\SaveDataModel.cs" />
<Compile Include="Framework\SyncDataModel.cs" />
<Compile Include="Framework\WizardMail.cs" />
<Compile Include="Pathoschild\ItemType.cs" />
<Compile Include="Pathoschild\UI\CommonSprites.cs" />
<Compile Include="Pathoschild\CommonHelper.cs" />
Expand All @@ -75,11 +76,11 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Pathoschild.Stardew.ModBuildConfig.3.0.0\build\Pathoschild.Stardew.ModBuildConfig.targets" Condition="Exists('..\packages\Pathoschild.Stardew.ModBuildConfig.3.0.0\build\Pathoschild.Stardew.ModBuildConfig.targets')" />
<Import Project="..\packages\Pathoschild.Stardew.ModBuildConfig.4.2.0\build\Pathoschild.Stardew.ModBuildConfig.targets" Condition="Exists('..\packages\Pathoschild.Stardew.ModBuildConfig.4.2.0\build\Pathoschild.Stardew.ModBuildConfig.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Pathoschild.Stardew.ModBuildConfig.3.0.0\build\Pathoschild.Stardew.ModBuildConfig.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Pathoschild.Stardew.ModBuildConfig.3.0.0\build\Pathoschild.Stardew.ModBuildConfig.targets'))" />
<Error Condition="!Exists('..\packages\Pathoschild.Stardew.ModBuildConfig.4.2.0\build\Pathoschild.Stardew.ModBuildConfig.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Pathoschild.Stardew.ModBuildConfig.4.2.0\build\Pathoschild.Stardew.ModBuildConfig.targets'))" />
</Target>
</Project>
8 changes: 4 additions & 4 deletions DeliveryService/Menus/Overlays/DeliveryOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ internal class DeliveryOverlay : BaseOverlay

/// <summary>The menu instance for which the overlay was created.</summary>
public DeliveryOverlay(IMonitor monitor, ItemGrabMenu menu, DeliveryChest chest, IModHelper helper, string modid, long hostid)
: base(helper.Events, helper.Input, keepAlive: () => Game1.activeClickableMenu is ItemGrabMenu)
: base(helper.Events, helper.Input, helper.Reflection, keepAlive: () => Game1.activeClickableMenu is ItemGrabMenu)
{
this.Menu = menu;
this.Chest = chest;
Expand Down Expand Up @@ -138,7 +138,7 @@ public DeliveryOverlay(IMonitor monitor, ItemGrabMenu menu, DeliveryChest chest,
if (! Context.IsMainPlayer)
this.Multiplayer.SendMessage(new SerializableChestLocation(chest), "RequestDeliveryOptions", modIDs: new[] { this.ModID }, playerIDs: new[] { this.HostID });
}
protected override void Draw(SpriteBatch batch)
protected override void DrawUi(SpriteBatch batch)
{
if (!this.isDrawn)
{
Expand Down Expand Up @@ -237,7 +237,7 @@ protected void ReinitializeComponents()
this.maxLabelWidth = 24 + 10 + (int)this.SendCategories.Select(p => font.MeasureString(p.Name()).X).Max();
this.LabelHeight = (int)font.MeasureString("ABC").Y + 2;
Rectangle sprite = Sprites.Icons.Junimo;
int topOffset = -Game1.pixelZoom * 12;
int topOffset = -Game1.pixelZoom * 25;
int leftOffset = Game1.pixelZoom * 16;
float zoom = 2f * Game1.pixelZoom / 2f;
int checkbox_width = 26;
Expand Down Expand Up @@ -306,7 +306,7 @@ public override void Dispose()
Monitor.Log($"Disposing {Chest.Location}", LogLevel.Trace);
base.Dispose();
}
protected override void ReceiveGameWindowResized(xTile.Dimensions.Rectangle oldBounds, xTile.Dimensions.Rectangle newBounds)
protected override void ReceiveGameWindowResized()
{
this.ReinitializeComponents();
}
Expand Down
21 changes: 18 additions & 3 deletions DeliveryService/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,22 @@ public override void Entry(IModHelper helper)
private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
{
if (Config.WaitForWizardShop)
Helper.Content.AssetEditors.Add(new WizardMail());
//Helper.Content.AssetEditors.Add(new WizardMail());
Helper.Events.Content.AssetRequested += this.OnAssetRequested;


}

private void OnAssetRequested(object sender, AssetRequestedEventArgs e)
{
if (e.NameWithoutLocale.IsEquivalentTo("Data/mail"))
{
e.Edit(asset =>
{
var data = asset.AsDictionary<string, string>().Data;
data["DeliveryServiceWizardMail"] = "Hello @... ^I have noticed that the Junimos have been rummaging around in my chests. I've been doing some experiments, and believe we can take advantage of this. If you place these runes on your chests, the Junimos should deliver items between chests while you sleep.^^ - M";
});
}
}

private void OnMenuChanged(object sender, MenuChangedEventArgs e)
Expand Down Expand Up @@ -283,7 +298,7 @@ private int CheckCategoryEnabledInSave(DeliveryCategories cat, List<string> matc
private void MoveItems(DeliveryChest from, DeliveryChest to, Tuple<DeliveryCategories, int>[] filter)
{
// Store items because removing items aborts foreach()
Item[] items = from.Chest.items.ToArray();
Item[] items = from.Chest.Items.ToArray();
foreach (Item item in items)
{
string type = "";
Expand All @@ -304,7 +319,7 @@ private void MoveItems(DeliveryChest from, DeliveryChest to, Tuple<DeliveryCateg
continue;
}
//this.Monitor.Log($"Removing item", LogLevel.Trace);
from.Chest.items.Remove(item);
from.Chest.Items.Remove(item);
}
}
private DeliveryChest GetDeliveryChestFromMessage(SerializableChestLocation message)
Expand Down
Loading