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 Apr 9, 2023
2 parents b4e95a9 + 4694768 commit 53e0e8c
Show file tree
Hide file tree
Showing 29 changed files with 115 additions and 91 deletions.
30 changes: 0 additions & 30 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Troubleshooting guide for players
url: https://smapi.io/troubleshoot
about: See if your question is already answered first!
- name: Get help or discuss
url: https://smapi.io/help
about: Ask for help from the community, or join the Stardew Valley Discord to ask questions, report issues, or discuss with the SMAPI developer, players, and mod authors. The SMAPI developer is @Pathoschild#0001 on Discord.
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Create a development task
about: DON'T DO THIS BEFORE READING. This is for specific changes to the code or technical bug reports. See below if something isn't working, you have questions or ideas, or you want to discuss something.

---

<!--
STOP!
Is this a specific development task? Don't create an issue if not!
See https://smapi.io/community if something isn't working, you have questions or ideas, or you want
to discuss something.
If you're absolutely sure it's a specific development task (e.g. a specific bug, not just
'something went wrong on my computer'), edit the template below.
-->

**Describe the bug**
A clear and concise description of what the bug is. Provide any other details you think might be relevant here.

**To Reproduce**
Exact steps which reproduce the bug, if possible. For example:
1. Load save '...'.
2. Walk to '....'.
3. Click '....'.
4. Error occurs.

**Log file**
Upload your SMAPI log to https://smapi.io/log and post a link here.

**Screenshots**
If applicable, add screenshots to help explain your problem.
12 changes: 0 additions & 12 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

12 changes: 0 additions & 12 deletions .github/ISSUE_TEMPLATE/general.md

This file was deleted.

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.2</Version>
<Version>3.18.3</Version>
<Product>SMAPI</Product>
<LangVersion>latest</LangVersion>
<AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>
Expand Down
2 changes: 1 addition & 1 deletion build/unix/prepare-install-package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

#
#
Expand Down
2 changes: 1 addition & 1 deletion build/unix/set-smapi-version.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

#
#
Expand Down
2 changes: 1 addition & 1 deletion build/windows/finalize-install-package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

##########
## Read config
Expand Down
19 changes: 19 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@
_If needed, you can update to SMAPI 3.16.0 first and then install the latest version._
-->

## 3.18.3
Released 09 April 2023 for Stardew Valley 1.5.6 or later.

* For players:
* Fixed `findstr` installer error for some players.
* Fixed installer error for some Linux players due to a non-portable shebang (thanks to freyacoded!).
* Fixed error using load order overrides when there are broken mods installed (thanks to atravita!).
* Removed `LargeAddressAware` flag on SMAPI (no longer needed since it's 64-bit now).
* Improved translations. Thganks to stylemate (updated Korean)!

* For mod authors:
* Added `IsActiveForScreen()` method to `PerScreen<T>`.
* Updated to [FluentHttpClient](https://github.com/Pathoschild/FluentHttpClient#readme) 4.3.0 (see [changes](https://github.com/Pathoschild/FluentHttpClient/blob/develop/RELEASE-NOTES.md#430)).
* Adjusted `ModContentManager.HandleUnknownFileType` to let mods patch it.
* Fixed `Context.IsWorldReady` being editable by mods.

* For the web UI:
* Updated the JSON validator/schema for Content Patcher 1.29.0.

## 3.18.2
Released 09 January 2023 for Stardew Valley 1.5.6 or later.

Expand Down
4 changes: 4 additions & 0 deletions docs/technical/mod-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ There are two places you can put them:
2. Open the `.csproj` file in a text editor (Notepad is fine).
3. Add the properties between the first `<PropertyGroup>` and `</PropertyGroup>` tags you find.

**Note:** you can't use a property before it's defined. That mainly means that when setting
`GameModsPath`, you'll need to either specify `GamePath` manually or put the full path in
`GameModsPath`.

### Available properties
These are the options you can set:

Expand Down
2 changes: 1 addition & 1 deletion src/SMAPI.Installer/assets/install on Linux.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

cd "`dirname "$0"`"
internal/linux/SMAPI.Installer
4 changes: 3 additions & 1 deletion src/SMAPI.Installer/assets/install on Windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ setlocal enabledelayedexpansion
SET installerDir="%~dp0"

REM make sure we're not running within a zip folder
echo %installerDir% | findstr /C:"%TEMP%" 1>nul
REM The error level is usually 0 (install dir contains temp path), 1 (it doesn't), or 9009 (findstr doesn't exist due to a Windows issue).
REM If the command doesn't exist, just skip this check.
echo %installerDir% | findstr /C:"%TEMP%" 1>nul 2>null
if %ERRORLEVEL% EQU 0 (
echo Oops! It looks like you're running the installer from inside a zip file. Make sure you unzip the download first.
echo.
Expand Down
2 changes: 1 addition & 1 deletion src/SMAPI.Installer/assets/install on macOS.command
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

cd "`dirname "$0"`"

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.2",
"Version": "3.18.3",
"Description": "Adds SMAPI console commands that let you manipulate the game.",
"UniqueID": "SMAPI.ConsoleCommands",
"EntryDll": "ConsoleCommands.dll",
"MinimumApiVersion": "3.18.2"
"MinimumApiVersion": "3.18.3"
}
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.2",
"Version": "3.18.3",
"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.2"
"MinimumApiVersion": "3.18.3"
}
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.2",
"Version": "3.18.3",
"Description": "Automatically backs up all your saves once per day into its folder.",
"UniqueID": "SMAPI.SaveBackup",
"EntryDll": "SaveBackup.dll",
"MinimumApiVersion": "3.18.2"
"MinimumApiVersion": "3.18.3"
}
2 changes: 1 addition & 1 deletion src/SMAPI.Toolkit/SMAPI.Toolkit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.46" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Pathoschild.Http.FluentClient" Version="4.2.0" />
<PackageReference Include="Pathoschild.Http.FluentClient" Version="4.3.0" />
<PackageReference Include="System.Management" Version="5.0.0" Condition="'$(OS)' == 'Windows_NT'" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" Condition="'$(OS)' == 'Windows_NT'" />
<PackageReference Include="VdfConverter" Version="1.0.3" Condition="'$(OS)' == 'Windows_NT'" Private="False" />
Expand Down
2 changes: 1 addition & 1 deletion src/SMAPI.Web/SMAPI.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.1" />
<PackageReference Include="Newtonsoft.Json.Schema" Version="3.0.14" />
<PackageReference Include="Pathoschild.FluentNexus" Version="1.0.5" />
<PackageReference Include="Pathoschild.Http.FluentClient" Version="4.2.0" />
<PackageReference Include="Pathoschild.Http.FluentClient" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.1" />
Expand Down
4 changes: 2 additions & 2 deletions src/SMAPI.Web/wwwroot/schemas/content-patcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"title": "Format version",
"description": "The format version. You should always use the latest version to enable the latest features, avoid obsolete behavior, and reduce load times.",
"type": "string",
"pattern": "^1\\.28\\.[0-9]+$",
"pattern": "^1\\.29\\.[0-9]+$",
"@errorMessages": {
"pattern": "Incorrect value '@value'. You should always use the latest format version (currently 1.28.0) to enable the latest features, avoid obsolete behavior, and reduce load times."
"pattern": "Incorrect value '@value'. You should always use the latest format version (currently 1.29.0) to enable the latest features, avoid obsolete behavior, and reduce load times."
}
},
"ConfigSchema": {
Expand Down
5 changes: 2 additions & 3 deletions src/SMAPI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{4B1C
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEMPLATE", "{F4453AB6-D7D6-447F-A973-956CC777968F}"
ProjectSection(SolutionItems) = preProject
..\.github\ISSUE_TEMPLATE\bug_report.md = ..\.github\ISSUE_TEMPLATE\bug_report.md
..\.github\ISSUE_TEMPLATE\feature_request.md = ..\.github\ISSUE_TEMPLATE\feature_request.md
..\.github\ISSUE_TEMPLATE\general.md = ..\.github\ISSUE_TEMPLATE\general.md
..\.github\ISSUE_TEMPLATE\config.yml = ..\.github\ISSUE_TEMPLATE\config.yml
..\.github\ISSUE_TEMPLATE\custom.md = ..\.github\ISSUE_TEMPLATE\custom.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{09CF91E5-5BAB-4650-A200-E5EA9A633046}"
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.2";
internal static string RawApiVersion = "3.18.3";
}

/// <summary>Contains SMAPI's constants and assumptions.</summary>
Expand Down
2 changes: 1 addition & 1 deletion src/SMAPI/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ internal static LoadStage LoadStage
public static bool IsWorldReady
{
get => Context.IsWorldReadyForScreen.Value;
set => Context.IsWorldReadyForScreen.Value = value;
internal set => Context.IsWorldReadyForScreen.Value = value;
}

/// <summary>Whether <see cref="IsWorldReady"/> is true and the player is free to act in the world (no menu is displayed, no cutscene is in progress, etc).</summary>
Expand Down
10 changes: 6 additions & 4 deletions src/SMAPI/Framework/ContentManagers/ModContentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public override T LoadExact<T>(IAssetName assetName, bool useCache)
".png" => this.LoadImageFile<T>(assetName, file),
".tbin" or ".tmx" => this.LoadMapFile<T>(assetName, file),
".xnb" => this.LoadXnbFile<T>(assetName),
_ => this.HandleUnknownFileType<T>(assetName, file)
_ => (T)this.HandleUnknownFileType(assetName, file, typeof(T))
};
}
catch (Exception ex)
Expand Down Expand Up @@ -323,13 +323,15 @@ private T LoadXnbFile<T>(IAssetName assetName)
}

/// <summary>Handle a request to load a file type that isn't supported by SMAPI.</summary>
/// <typeparam name="T">The expected file type.</typeparam>
/// <param name="assetName">The asset name relative to the loader root directory.</param>
/// <param name="file">The file to load.</param>
private T HandleUnknownFileType<T>(IAssetName assetName, FileInfo file)
/// <param name="assetType">The expected file type.</param>
private object HandleUnknownFileType(IAssetName assetName, FileInfo file, Type assetType)
{
this.ThrowLoadError(assetName, ContentLoadErrorType.InvalidName, $"unknown file extension '{file.Extension}'; must be one of '.fnt', '.json', '.png', '.tbin', '.tmx', or '.xnb'.");
return default;
return assetType.IsValueType
? Activator.CreateInstance(assetType)
: null;
}

/// <summary>Assert that the asset type is compatible with one of the allowed types.</summary>
Expand Down
13 changes: 8 additions & 5 deletions src/SMAPI/Framework/ModLoading/ModResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,16 @@ public IModMetadata[] ApplyLoadOrderOverrides(IModMetadata[] mods, HashSet<strin
return mods
.OrderBy(mod =>
{
string id = mod.Manifest.UniqueID;
string? id = mod.Manifest?.UniqueID;
if (modIdsToLoadEarly.TryGetValue(id, out string? actualId))
return -int.MaxValue + Array.IndexOf(earlyArray, actualId);
if (id is not null)
{
if (modIdsToLoadEarly.TryGetValue(id, out string? actualId))
return -int.MaxValue + Array.IndexOf(earlyArray, actualId);
if (modIdsToLoadLate.TryGetValue(id, out actualId))
return int.MaxValue - Array.IndexOf(lateArray, actualId);
if (modIdsToLoadLate.TryGetValue(id, out actualId))
return int.MaxValue - Array.IndexOf(lateArray, actualId);
}
return 0;
})
Expand Down
2 changes: 1 addition & 1 deletion src/SMAPI/Framework/SCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ private void InitializeBeforeFirstAssetLoaded()
// apply load order customizations
if (this.Settings.ModsToLoadEarly.Any() || this.Settings.ModsToLoadLate.Any())
{
HashSet<string> installedIds = new HashSet<string>(mods.Select(p => p.Manifest.UniqueID), StringComparer.OrdinalIgnoreCase);
HashSet<string> installedIds = new HashSet<string>(mods.Select(p => p.Manifest?.UniqueID).Where(p => p is not null), StringComparer.OrdinalIgnoreCase);

string[] missingEarlyMods = this.Settings.ModsToLoadEarly.Where(id => !installedIds.Contains(id)).OrderBy(p => p, StringComparer.OrdinalIgnoreCase).ToArray();
string[] missingLateMods = this.Settings.ModsToLoadLate.Where(id => !installedIds.Contains(id)).OrderBy(p => p, StringComparer.OrdinalIgnoreCase).ToArray();
Expand Down
4 changes: 1 addition & 3 deletions src/SMAPI/SMAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<OutputType>Exe</OutputType>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<LargeAddressAware Condition="'$(OS)' == 'Windows_NT'">true</LargeAddressAware>
<ApplicationIcon>icon.ico</ApplicationIcon>

<!--copy dependency DLLs to bin folder so we can include them in installer bundle -->
Expand All @@ -22,11 +21,10 @@
<Import Project="..\..\build\common.targets" />

<ItemGroup>
<PackageReference Include="LargeAddressAware" Version="1.0.6" />
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
<PackageReference Include="MonoMod.Common" Version="22.3.5.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Pathoschild.Http.FluentClient" Version="4.2.0" />
<PackageReference Include="Pathoschild.Http.FluentClient" Version="4.3.0" />
<PackageReference Include="Pintail" Version="2.2.2" />
<PackageReference Include="Platonymous.TMXTile" Version="1.5.9" />
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
Expand Down
6 changes: 6 additions & 0 deletions src/SMAPI/Utilities/PerScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ public void ResetAllScreens()
this.RemoveScreens(_ => true);
}

/// <summary>Get whether the current screen has a value created yet.</summary>
public bool IsActiveForScreen()
{
return this.States.ContainsKey(Context.ScreenId);
}


/*********
** Private methods
Expand Down
4 changes: 2 additions & 2 deletions src/SMAPI/i18n/ko.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
// short date format for SDate
// tokens: {{day}} (like 15), {{season}} (like Spring), {{seasonLowercase}} (like spring), {{year}} (like 2)
"generic.date": "{{season}} {{day}}",
"generic.date-with-year": "{{year}} 학년 {{season}} {{day}}"
"generic.date": "{{season}} {{day}}",
"generic.date-with-year": "{{year}}년차 {{season}} {{day}}"
}

0 comments on commit 53e0e8c

Please sign in to comment.