Skip to content

Commit

Permalink
Merge branch 'develop' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Pathoschild committed Oct 5, 2023
2 parents 31777f0 + 0f72611 commit 5919337
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build/common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repo. It imports the other MSBuild files as needed.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!--set general build properties -->
<Version>3.18.5</Version>
<Version>3.18.6</Version>
<Product>SMAPI</Product>
<LangVersion>latest</LangVersion>
<AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>
Expand Down
15 changes: 14 additions & 1 deletion docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
_If needed, you can update to SMAPI 3.16.0 first and then install the latest version._
-->

## 3.18.6
Released 05 October 2023 for Stardew Valley 1.5.6 or later.

* For players:
* Fixed SpriteMaster compatibility in SMAPI 3.18.5+ with temporary workaround.
* Fixed `player_add` and `list_items` console commands not including Pickled Ginger, and returning Honey instead of Wild Honey _(in Console Commands)_.

* For mod authors:
* Added asset propagation for `LooseSprites/chatBox` and `LooseSprites/emojis`.

* For the web UI:
* Fixed uploaded log/JSON file expiry alway shown as renewed.

## 3.18.5
Released 26 August 2023 for Stardew Valley 1.5.6 or later.

Expand Down Expand Up @@ -77,7 +90,7 @@ Released 09 January 2023 for Stardew Valley 1.5.6 or later.

* For players:
* Fixed empty save backups for some macOS players.
* Fixed `player_add` console command not handling custom slingshots correctly (thanks too DaLion!).
* Fixed `player_add` console command not handling custom slingshots correctly (thanks to DaLion!).

* For mod authors:
* Added `DelegatingModHooks` utility for mods which need to override SMAPI's mod hooks directly.
Expand Down
42 changes: 32 additions & 10 deletions src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,21 +171,31 @@ public IEnumerable<SearchableItem> GetAll(ItemType[]? itemTypes = null, bool inc
else if (ShouldGet(ItemType.Object))
{
// spawn main item
SObject? item = null;
yield return this.TryCreate(ItemType.Object, id, p =>
SearchableItem? mainItem = this.TryCreate(ItemType.Object, id, p =>
{
return item = (p.ID == 812 // roe
? new ColoredObject(p.ID, 1, Color.White)
: new SObject(p.ID, 1)
);
// roe
if (p.ID == 812)
return new ColoredObject(p.ID, 1, Color.White);
// Wild Honey
if (p.ID == 340)
{
return new SObject(Vector2.Zero, 340, "Wild Honey", false, true, false, false)
{
Name = "Wild Honey",
preservedParentSheetIndex = { -1 }
};
}
// else plain item
return new SObject(p.ID, 1);
});
if (item == null)
continue;
yield return mainItem;

// flavored items
if (includeVariants)
if (includeVariants && mainItem?.Item != null)
{
foreach (SearchableItem? variant in this.GetFlavoredObjectVariants(item))
foreach (SearchableItem? variant in this.GetFlavoredObjectVariants((SObject)mainItem.Item))
yield return variant;
}
}
Expand Down Expand Up @@ -356,6 +366,18 @@ select item
}
break;
}

// ginger => pickled ginger
if (id == 829 && item.Category != SObject.VegetableCategory)
{
yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 5 + id, _ => new SObject(342, 1)
{
Name = $"Pickled {item.Name}",
Price = 50 + item.Price * 2,
preserve = { SObject.PreserveType.Pickle },
preservedParentSheetIndex = { id }
});
}
}

/// <summary>Get optimized lookups to match items which produce roe in a fish pond.</summary>
Expand Down
4 changes: 2 additions & 2 deletions src/SMAPI.Mods.ConsoleCommands/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Name": "Console Commands",
"Author": "SMAPI",
"Version": "3.18.5",
"Version": "3.18.6",
"Description": "Adds SMAPI console commands that let you manipulate the game.",
"UniqueID": "SMAPI.ConsoleCommands",
"EntryDll": "ConsoleCommands.dll",
"MinimumApiVersion": "3.18.5"
"MinimumApiVersion": "3.18.6"
}
4 changes: 2 additions & 2 deletions src/SMAPI.Mods.ErrorHandler/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Name": "Error Handler",
"Author": "SMAPI",
"Version": "3.18.5",
"Version": "3.18.6",
"Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.",
"UniqueID": "SMAPI.ErrorHandler",
"EntryDll": "ErrorHandler.dll",
"MinimumApiVersion": "3.18.5"
"MinimumApiVersion": "3.18.6"
}
4 changes: 2 additions & 2 deletions src/SMAPI.Mods.SaveBackup/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Name": "Save Backup",
"Author": "SMAPI",
"Version": "3.18.5",
"Version": "3.18.6",
"Description": "Automatically backs up all your saves once per day into its folder.",
"UniqueID": "SMAPI.SaveBackup",
"EntryDll": "SaveBackup.dll",
"MinimumApiVersion": "3.18.5"
"MinimumApiVersion": "3.18.6"
}
5 changes: 4 additions & 1 deletion src/SMAPI.Web/Framework/Storage/StorageProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,12 @@ public async Task<StoredFileInfo> GetAsync(string id, bool forceRenew)
string content = this.GzipHelper.DecompressString(await reader.ReadToEndAsync());

// extend expiry if needed
DateTimeOffset newExpiry = oldExpiry;
if (forceRenew || this.IsWithinAutoRenewalWindow(result.Details.LastModified))
{
await blob.SetMetadataAsync(new Dictionary<string, string> { ["expiryRenewed"] = DateTime.UtcNow.ToString("O") }); // change the blob's last-modified date (the specific property set doesn't matter)
DateTimeOffset newExpiry = this.GetExpiry(DateTimeOffset.UtcNow);
newExpiry = this.GetExpiry(DateTimeOffset.UtcNow);
}

// build model
return new StoredFileInfo(content, oldExpiry, newExpiry);
Expand Down
2 changes: 1 addition & 1 deletion src/SMAPI/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ internal static class EarlyConstants
internal static int? LogScreenId { get; set; }

/// <summary>SMAPI's current raw semantic version.</summary>
internal static string RawApiVersion = "3.18.5";
internal static string RawApiVersion = "3.18.6";
}

/// <summary>Contains SMAPI's constants and assumptions.</summary>
Expand Down
2 changes: 1 addition & 1 deletion src/SMAPI/Events/AssetEditPriority.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace StardewModdingAPI.Events
{
/// <summary>The priority for an asset edit when multiple apply for the same asset.</summary>
/// <remarks>You can also specify arbitrary intermediate values, like <c>AssetLoadPriority.Low + 5</c>.</remarks>
/// <remarks>You can also specify arbitrary intermediate values, like <c>AssetEditPriority.Early + 5</c>.</remarks>
public enum AssetEditPriority
{
/// <summary>This edit should be applied before (i.e. 'under') <see cref="Default"/> edits.</summary>
Expand Down
13 changes: 13 additions & 0 deletions src/SMAPI/Framework/ModLoading/RewriteFacades/AccessToolsFacade.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#if SMAPI_DEPRECATED
using System;
using System.Diagnostics.CodeAnalysis;
using StardewModdingAPI.Framework.ModLoading.Framework;

namespace StardewModdingAPI.Framework.ModLoading.RewriteFacades
{
/// <summary>Stub version of <see cref="StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_5.AccessToolsFacade"/> to avoid breaking SpriteMaster.</summary>
[Obsolete("This only exists for compatibility with older versions of SpriteMaster.")]
[SuppressMessage("ReSharper", "UnusedMember.Global", Justification = SuppressReasons.UsedViaRewriting)]
public class AccessToolsFacade { }
}
#endif
24 changes: 24 additions & 0 deletions src/SMAPI/Metadata/CoreAssetPropagator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,18 @@ static ISet<string> GetWarpSet(GameLocation location)
Game1.birdsSpriteSheet = content.Load<Texture2D>(key);
return true;

case "loosesprites/chatbox": // ChatBox constructor
if (Game1.chatBox?.chatBox != null)
{
Texture2D texture = content.Load<Texture2D>(key);

this.Reflection.GetField<Texture2D>(Game1.chatBox.chatBox, "_textBoxTexture").SetValue(texture);
this.Reflection.GetField<Texture2D>(Game1.chatBox.emojiMenu, "chatBoxTexture").SetValue(texture);

return true;
}
return false;

case "loosesprites/concessions": // Game1.LoadContent
Game1.concessionsSpriteSheet = content.Load<Texture2D>(key);
return true;
Expand Down Expand Up @@ -423,6 +435,18 @@ static ISet<string> GetWarpSet(GameLocation location)
Game1.daybg = content.Load<Texture2D>(key);
return true;

case "loosesprites/emojis": // ChatBox constructor
if (Game1.chatBox != null)
{
Texture2D texture = content.Load<Texture2D>(key);

this.Reflection.GetField<Texture2D>(Game1.chatBox.emojiMenu, "emojiTexture").SetValue(texture);
Game1.chatBox.emojiMenuIcon.texture = texture;

return true;
}
return false;

case "loosesprites/font_bold": // Game1.LoadContent
SpriteText.spriteTexture = content.Load<Texture2D>(key);
return true;
Expand Down

0 comments on commit 5919337

Please sign in to comment.