Skip to content

Commit a02bd32

Browse files
committed
Merge branch 'develop' into stable
2 parents 92b6d55 + 0fec001 commit a02bd32

File tree

173 files changed

+1820
-706
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+1820
-706
lines changed

Automate/Automate.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<Version>2.3.3</Version>
3+
<Version>2.3.4</Version>
44
<RootNamespace>Pathoschild.Stardew.Automate</RootNamespace>
55
</PropertyGroup>
66

Automate/Framework/MachineManager.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ public IDictionary<string, ModConfigMachine> GetMachineOverrides()
127127
{
128128
string locationKey = this.Factory.GetLocationKey(location);
129129

130-
return this.MachineData.TryGetValue(locationKey, out MachineDataForLocation? data)
131-
? data
132-
: null;
130+
return this.MachineData.GetValueOrDefault(locationKey);
133131
}
134132

135133
/****

Automate/Framework/Machines/DataBasedObjectMachine.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ public override bool SetInput(IStorage input)
9191

9292
machine.OutputMachine(machineData, outputRule, machine.lastInputItem.Value, null, machine.Location, false);
9393

94-
if (machine.heldObject.Value == null)
95-
machine.heldObject.Value = prevOutput;
94+
machine.heldObject.Value ??= prevOutput;
9695
}
9796
}
9897

Automate/Framework/Machines/TerrainFeatures/BushMachine.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public override ITrackedStack GetOutput()
6868
/// <inheritdoc />
6969
public override MachineState GetState()
7070
{
71-
if (!this.IsInSeason.Value)
71+
if (this.Machine.Location is null || !this.IsInSeason.Value)
7272
return MachineState.Disabled;
7373

7474
return this.Machine.tileSheetOffset.Value == 1

Automate/Framework/Machines/TerrainFeatures/TreeMachine.cs

+6
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,16 @@ public override bool SetInput(IStorage input)
112112
/// <param name="tree">The tree to automate.</param>
113113
public static bool CanAutomate(Tree tree)
114114
{
115+
// skip: stumps will never produce anything
116+
if (tree.stump.Value)
117+
return false;
118+
119+
// skip: no data to automate
115120
WildTreeData? data = tree.GetData();
116121
if (data is null)
117122
return false;
118123

124+
// check data
119125
return
120126
data.GrowsMoss
121127
|| (

Automate/ModEntry.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e)
321321
private void OnModMessageReceived(object? sender, ModMessageReceivedEventArgs e)
322322
{
323323
// update automation if chest options changed
324-
if (Context.IsMainPlayer && e.FromModID == "Pathoschild.ChestsAnywhere" && e.Type == nameof(AutomateUpdateChestMessage))
324+
if (Context.IsMainPlayer && e is { FromModID: "Pathoschild.ChestsAnywhere", Type: nameof(AutomateUpdateChestMessage) })
325325
{
326326
var message = e.ReadAs<AutomateUpdateChestMessage>();
327327
var location = message.LocationName != null

Automate/TrackedItemCollection.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ public class TrackedItemCollection : ITrackedStack
1919
** Accessors
2020
*********/
2121
/// <inheritdoc />
22-
public Item Sample { get; private set; }
22+
public Item Sample { get; }
2323

2424
/// <inheritdoc />
25-
public string Type { get; private set; }
25+
public string Type { get; }
2626

2727
/// <inheritdoc />
2828
public int Count => this.Stacks.Sum(p => p.Count);

Automate/docs/release-notes.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
[← back to readme](README.md)
22

33
# Release notes
4+
## 2.3.4
5+
Released 26 March 2025 for SMAPI 4.1.10 or later.
6+
7+
* Tree stumps are no longer automated, since they'll never produce anything.
8+
* Fixed crash if an automated berry bush is chopped down.
9+
* Improved translations. Thanks to Naciux1088 (added Polish)!
10+
411
## 2.3.3
512
Released 07 February 2025 for SMAPI 4.1.10 or later.
613

Automate/i18n/pl.json

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
/*********
3+
** Generic Mod Config Menu UI (Interfejs Menu Konfiguracji Modu)
4+
*********/
5+
// main options (główne opcje)
6+
"config.title.main-options": "Główne opcje",
7+
"config.enabled.name": "Włączone",
8+
"config.enabled.desc": "Określa, czy funkcje Automate są włączone. Jeśli ta opcja jest wyłączona, maszyny nie będą automatyzowane, a nakładka nie będzie się pojawiać.",
9+
"config.automation-interval.name": "Interwał automatyzacji",
10+
"config.automation-interval.desc": "Liczba ticków między każdym procesem automatyzacji (60 to raz na sekundę, 120 to co dwie sekundy itp.).",
11+
"config.min-minutes-for-fairy-dust.name": "Minimalny czas dla pyłku wróżki",
12+
"config.min-minutes-for-fairy-dust.desc": "Minimalny czas przetwarzania maszyny w minutach, po którym należy zastosować pyłek wróżki. Na przykład ustawienie tej wartości na 30 minut oznacza, że pyłek wróżki nie zostanie zastosowany, jeśli maszyna zakończy proces w 20 minut.",
13+
"config.toggle-overlay-key.name": "Przełącz klawisz nakładki",
14+
"config.toggle-overlay-key.desc": "Klawisze, które przełączają nakładkę automatyzacji.",
15+
"config.warn-for-missing-bridge-mod.name": "Ostrzeżenie o brakującym modzie mostu",
16+
"config.warn-for-missing-bridge-mod.desc": "Określa, czy wyświetlić ostrzeżenie przy starcie, jeśli zainstalowałeś mod maszynowy wymagający osobnej łatki kompatybilności, której nie ma.",
17+
18+
// connectors (łączniki)
19+
"config.title.connectors": "Włączone łączniki",
20+
"config.connector.desc": "Określa, czy {{itemName}} łączy maszyny i skrzynie.",
21+
"config.custom-connectors.name": "Niestandardowe łączniki",
22+
"config.custom-connectors.desc": "Dokładne angielskie nazwy przedmiotów, które łączą sąsiednie maszyny. Można podać wiele przedmiotów oddzielonych przecinkami.",
23+
24+
// Junimo hut options (opcje chatki Junimo)
25+
"config.title.junimo-huts": "Zachowanie chatki Junimo",
26+
"config.junimo-hut-gems.name": "Kamienie szlachetne",
27+
"config.junimo-hut-gems.desc": "Co chatki Junimo mają robić z przedmiotami kamieni szlachetnych. 'Auto-detekcja' je zignoruje.",
28+
"config.junimo-hut-fertilizer.name": "Nawóz",
29+
"config.junimo-hut-fertilizer.desc": "Co chatki Junimo mają robić z przedmiotami nawozu. 'Auto-detekcja' je zignoruje, jeśli zainstalowany jest mod Better Junimos, w przeciwnym razie przeniesie je z chatki do połączonych skrzyń.",
30+
"config.junimo-hut-seeds.name": "Nasiona",
31+
"config.junimo-hut-seeds.desc": "Co chatki Junimo mają robić z przedmiotami nasion. 'Auto-detekcja' je zignoruje, jeśli zainstalowany jest mod Better Junimos, w przeciwnym razie przeniesie je z chatki do połączonych skrzyń.",
32+
33+
// Junimo hut dropdown values (rozwijane wartości chatki Junimo)
34+
"config.junimo-huts.auto-detect": "Auto-detekcja",
35+
"config.junimo-huts.ignore": "Zignoruj je",
36+
"config.junimo-huts.move-into-chests": "Przenieś z chatki do skrzyń",
37+
"config.junimo-huts.move-into-huts": "Przenieś ze skrzyń do chatki",
38+
39+
// per-machine settings (ustawienia dla maszyn)
40+
"config.title.machine-settings": "Ustawienia {{machineName}}",
41+
"config.machine-settings-enabled.Name": "Włączone",
42+
"config.machine-settings-enabled.desc": "Określa, czy automatyzacja {{machineName}} jest włączona.",
43+
"config.machine-settings-priority.name": "Priorytet",
44+
"config.machine-settings-priority.desc": "Kolejność przetwarzania maszyn {{machineName}} w stosunku do innych maszyn. Maszyny mają domyślny priorytet 0, wyższe wartości są przetwarzane jako pierwsze.",
45+
46+
// machine names (nazwy maszyn)
47+
"config.machines.bush": "Krzak",
48+
"config.machines.fruit-tree": "Drzewo (Owocowe)",
49+
"config.machines.trash-can": "Kosz na śmieci",
50+
"config.machines.wild-tree": "Drzewo (Dziki)",
51+
"config.machines.feed-hopper": "Silos i podajnik siana",
52+
53+
// specjalne ustawienia dla poszczególnych maszyn
54+
"config.machines.wild-tree.collect-moss.name": "Zbieraj mech",
55+
"config.machines.wild-tree.collect-moss.desc": "Określa, czy zbierać mech z drzew. Na przykład pozostawienie mchu na drzewach zwiększy jakość grzybów z pobliskich kłód grzybowych."
56+
}

Automate/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Name": "Automate",
33
"Author": "Pathoschild",
4-
"Version": "2.3.3",
4+
"Version": "2.3.4",
55
"MinimumApiVersion": "4.1.10",
66
"Description": "Lets you automate crafting machines, fruit trees, and more by connecting them to chests.",
77
"UniqueID": "Pathoschild.Automate",

CentralStation/CentralStation.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<Version>1.2.0</Version>
3+
<Version>1.2.1</Version>
44
<RootNamespace>Pathoschild.Stardew.CentralStation</RootNamespace>
55

66
<IgnoreModFilePaths>assets/.paths.png, assets/.spring_outdoorsTileSheet.png, assets/.spring_outdoorsTileSheet2.png, assets/.spring_Shadows.png</IgnoreModFilePaths>

CentralStation/Framework/ContentManager.cs

+25-10
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,30 @@ public void OnDayStarted(object? sender, DayStartedEventArgs e)
8282
/// <inheritdoc cref="IContentEvents.AssetRequested" />
8383
public void OnAssetRequested(object? sender, AssetRequestedEventArgs e)
8484
{
85-
// edit vanilla locations
86-
if (e.NameWithoutLocale.IsEquivalentTo("Maps/BusStop"))
87-
e.Edit(asset => this.EditBusStopMap(asset.AsMap()), AssetEditPriority.Late);
88-
if (e.NameWithoutLocale.IsEquivalentTo("Maps/Railroad"))
89-
e.Edit(asset => this.EditRailroadMap(asset.AsMap()), AssetEditPriority.Late);
90-
91-
// edit Central Station map
92-
if (e.NameWithoutLocale.IsEquivalentTo($"Maps/{Constant.ModId}"))
93-
e.Edit(this.EditCentralStationMap, AssetEditPriority.Early);
85+
if (e.NameWithoutLocale.IsDirectlyUnderPath("Maps"))
86+
{
87+
// edit vanilla locations
88+
if (e.NameWithoutLocale.IsEquivalentTo("Maps/BusStop"))
89+
e.Edit(asset => this.EditBusStopMap(asset.AsMap()), AssetEditPriority.Late);
90+
else if (e.NameWithoutLocale.IsEquivalentTo("Maps/Railroad"))
91+
e.Edit(asset => this.EditRailroadMap(asset.AsMap()), AssetEditPriority.Late);
92+
93+
// edit Central Station map
94+
else if (e.NameWithoutLocale.IsEquivalentTo($"Maps/{Constant.ModId}"))
95+
e.Edit(this.EditCentralStationMap, AssetEditPriority.Early);
96+
}
97+
}
98+
99+
/// <inheritdoc cref="IContentEvents.AssetReady" />
100+
public void OnAssetReady(object? sender, AssetReadyEventArgs e)
101+
{
102+
// re-edit current location's map if it's reloaded
103+
GameLocation location = Game1.currentLocation;
104+
if (location?.map != null && e.NameWithoutLocale.IsEquivalentTo(location.mapPath.Value))
105+
{
106+
this.ConvertPreviousTicketMachines(location);
107+
this.AddTicketMachineForMapProperty(location);
108+
}
94109
}
95110

96111
/// <inheritdoc cref="IPlayerEvents.Warped" />
@@ -548,7 +563,7 @@ private void AddCentralStationTourists(IAssetDataForMap assetData)
548563
}
549564

550565
// collect available NPCs
551-
List<TouristSpawnOption> validTourists = new();
566+
List<TouristSpawnOption> validTourists = [];
552567
foreach ((string mapId, TouristMapModel? touristMapData) in this.ContentHelper.Load<Dictionary<string, TouristMapModel?>>(AssetNames.Tourists))
553568
{
554569
// skip empty entry

CentralStation/Framework/Integrations/BusLocationsStopProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public IEnumerable<Stop> GetAvailableStops(StopNetworks networks)
8787
}
8888

8989
// load stops
90-
List<Stop> stops = new();
90+
List<Stop> stops = [];
9191
foreach (object location in locations)
9292
{
9393
if (location is null)

CentralStation/Framework/LiveMessageQueue.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal class LiveMessageQueue
1414
** Fields
1515
*********/
1616
/// <summary>The messages returned since the last loop reset.</summary>
17-
private readonly PerScreen<HashSet<string>> SeenMessages = new(() => new());
17+
private readonly PerScreen<HashSet<string>> SeenMessages = new(() => []);
1818

1919
/// <summary>Whether to restart once all messages have been seen.</summary>
2020
private readonly bool Loop;

CentralStation/Framework/StopManager.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private List<ICustomStopProvider> GetCustomStopProviders()
7979
{
8080
if (this.CustomStopProviders is null)
8181
{
82-
this.CustomStopProviders = new();
82+
this.CustomStopProviders = [];
8383

8484
BusLocationsStopProvider busLocations = new(this.ModRegistry, this.Monitor, this.ContentManager.GetTranslation);
8585
if (busLocations.IsNeeded())

CentralStation/ModEntry.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public override void Entry(IModHelper helper)
5959
// hook events
6060
helper.Events.GameLoop.DayStarted += this.ContentManager.OnDayStarted;
6161
helper.Events.Content.AssetRequested += this.ContentManager.OnAssetRequested;
62+
helper.Events.Content.AssetReady += this.ContentManager.OnAssetReady;
6263
helper.Events.Display.MenuChanged += this.OnMenuChanged;
6364
helper.Events.Player.Warped += this.OnWarped;
6465

@@ -481,7 +482,7 @@ private bool ValidateInstall()
481482

482483
if (contentPack is null)
483484
{
484-
this.Monitor.Log("Central Station is missing its content files, so it won't work. Please delete and reinstall the mod to fix this.", LogLevel.Error);
485+
this.Monitor.Log("Central Station is installed incorrectly, so it won't work. You're missing the 'Central Station content' content pack. Please delete and reinstall the mod to fix this.", LogLevel.Error);
485486
return false;
486487
}
487488

CentralStation/docs/release-notes.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
[← back to readme](README.md)
22

33
# Release notes
4+
## 1.2.1
5+
Released 26 March 2025 for SMAPI 4.1.10 or later.
6+
7+
* For players:
8+
* Improved error message when the content pack isn't installed to be clearer.
9+
* Fixed edge case where a ticket machine could disappear if a mod reloaded its location's map while you were there.
10+
411
## 1.2.0
512
Released 26 February 2025 for SMAPI 4.1.10 or later.
613

CentralStation/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Name": "Central Station",
33
"Author": "Pathoschild",
4-
"Version": "1.2.0",
4+
"Version": "1.2.1",
55
"MinimumApiVersion": "4.1.10",
66
"Description": "Lets you travel to other mods' destinations by boat, bus, or train through the Central Station.",
77
"UniqueID": "Pathoschild.CentralStation",

ChestsAnywhere/ChestsAnywhere.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<Version>1.26.1</Version>
3+
<Version>1.27.0</Version>
44
<RootNamespace>Pathoschild.Stardew.ChestsAnywhere</RootNamespace>
55
</PropertyGroup>
66

ChestsAnywhere/Menus/Overlays/BaseChestOverlay.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ internal abstract class BaseChestOverlay : BaseOverlay, IStorageOverlay
4343
protected bool IsInitialized => this.DrawCount > 1;
4444

4545
/// <summary>The backing field for <see cref="ActiveElement"/>; shouldn't be edited directly.</summary>
46-
private Element _activeElement;
46+
private Element ActiveElementImpl;
4747

4848
/// <summary>The unique chest categories.</summary>
4949
private readonly string[] Categories;
@@ -128,10 +128,10 @@ internal abstract class BaseChestOverlay : BaseOverlay, IStorageOverlay
128128
/// <inheritdoc />
129129
public Element ActiveElement
130130
{
131-
get => this._activeElement;
131+
get => this.ActiveElementImpl;
132132
protected set
133133
{
134-
this._activeElement = value;
134+
this.ActiveElementImpl = value;
135135
this.OnActiveElementChanged(value);
136136
}
137137
}

ChestsAnywhere/ModEntry.cs

+16-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Pathoschild.Stardew.ChestsAnywhere.Framework.Containers;
66
using Pathoschild.Stardew.ChestsAnywhere.Menus.Overlays;
77
using Pathoschild.Stardew.Common;
8+
using Pathoschild.Stardew.Common.Integrations.BetterGameMenu;
89
using Pathoschild.Stardew.Common.Integrations.GenericModConfigMenu;
910
using Pathoschild.Stardew.Common.Integrations.IconicFramework;
1011
using Pathoschild.Stardew.Common.Messages;
@@ -44,6 +45,8 @@ internal class ModEntry : Mod
4445
/// <summary>The overlay for the current menu, which lets the player navigate and edit chests (or <c>null</c> if not applicable).</summary>
4546
private readonly PerScreen<IStorageOverlay?> CurrentOverlay = new();
4647

48+
/// <summary>The Better Game Menu integration.</summary>
49+
private BetterGameMenuIntegration? BetterGameMenu;
4750

4851
/*********
4952
** Public methods
@@ -96,6 +99,9 @@ private void OnGameLaunched(object? sender, GameLaunchedEventArgs e)
9699
set: config => this.Config = config
97100
);
98101

102+
// add Better Game Menu support
103+
this.BetterGameMenu = new(this.Helper.ModRegistry, this.Monitor);
104+
99105
// add Iconic Framework icon
100106
IconicFrameworkIntegration iconicFramework = new(this.Helper.ModRegistry, this.Monitor);
101107
if (iconicFramework.IsLoaded)
@@ -166,9 +172,8 @@ private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e)
166172
}
167173

168174
// open from inventory if it's safe to close the inventory screen
169-
else if (Game1.activeClickableMenu is GameMenu gameMenu && gameMenu.currentTab == GameMenu.inventoryTab)
175+
else if (this.GetGameMenuPage() is InventoryPage inventoryPage)
170176
{
171-
IClickableMenu inventoryPage = gameMenu.pages[GameMenu.inventoryTab];
172177
if (inventoryPage.readyToClose())
173178
this.OpenMenu();
174179
}
@@ -180,6 +185,15 @@ private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e)
180185
}
181186
}
182187

188+
/// <summary>Get the current page of the open active game menu, if applicable.</summary>
189+
private IClickableMenu? GetGameMenuPage()
190+
{
191+
if (Game1.activeClickableMenu is GameMenu gameMenu)
192+
return gameMenu.GetCurrentPage();
193+
194+
return this.BetterGameMenu?.GetCurrentPage(Game1.activeClickableMenu);
195+
}
196+
183197
/// <summary>Change the chest UI overlay if needed to match the current menu.</summary>
184198
/// <remarks>Since the menu gets reopened whenever the chest inventory changes, this method needs to be called before/after tick to avoid a visible UI flicker.</remarks>
185199
private void ChangeOverlayIfNeeded()

ChestsAnywhere/docs/release-notes.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
[← back to readme](README.md)
22

33
# Release notes
4+
## 1.27.0
5+
Released 26 March 2025 for SMAPI 4.1.10 or later.
6+
7+
* Added integration with Better Game Menu (thanks to KhloeLeclair!).
8+
* Improved translations. Thanks to mehmetgorkemarslan (updated Turkish)!
9+
410
## 1.26.1
511
Released 11 February 2025 for SMAPI 4.1.10 or later.
612

ChestsAnywhere/i18n/tr.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@
130130
/*********
131131
** Iconic Framework icon
132132
*********/
133-
// TODO
134-
"icon.open-menu.name": "Chests Anywhere",
135-
"icon.open-menu.desc": "Open Menu"
133+
"icon.open-menu.name": "Her Yerden Ulaşılabilir Sandıklar",
134+
"icon.open-menu.desc": "Menüyü Aç"
136135
}

ChestsAnywhere/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Name": "Chests Anywhere",
33
"Author": "Pathoschild",
4-
"Version": "1.26.1",
4+
"Version": "1.27.0",
55
"MinimumApiVersion": "4.1.10",
66
"Description": "Access your chests from anywhere and organize them your way.",
77
"UniqueID": "Pathoschild.ChestsAnywhere",

0 commit comments

Comments
 (0)