Commit Graph

4023 Commits

Author SHA1 Message Date
Jesse Plamondon-Willard a593eda30f
use target-typed new 2022-04-06 18:24:59 -04:00
Jesse Plamondon-Willard 29f909a8d5
fix asset name truncation when loading XNB mod file without file extension 2022-04-06 00:37:10 -04:00
Jesse Plamondon-Willard a20413664b
split mod content load method, make error-handling more consistent 2022-04-03 21:17:40 -04:00
Jesse Plamondon-Willard c9af1c452a
fix incorrect deprecation warnings for helper.Content 2022-04-03 15:44:26 -04:00
Jesse Plamondon-Willard 627472c506
add temporary hack to fix compatibility between old & new APIs for some mods 2022-04-02 21:43:56 -04:00
Jesse Plamondon-Willard 546b58778c
switch to 'processing tick' for tick caching
This is incremented on each low-level tick (whether it's a game update, synchronized async operation, etc). That mainly avoids the cache persisting across the entire save loading process while it's being synchronized.
2022-04-02 19:13:27 -04:00
Jesse Plamondon-Willard f58cdde981
fix errors due to null asset names in asset propagation 2022-04-02 15:12:05 -04:00
Jesse Plamondon-Willard 6292b21f22
fix tick cache using game ticks instead of SMAPI ticks
The game ticks aren't incremented consistently in some cases (e.g. while loading a save), which leads to the cache values being kept too long.
2022-04-02 14:59:09 -04:00
Jesse Plamondon-Willard 4e2d7f2550
make mod file paths case-insensitive in all SMAPI APIs 2022-04-01 23:42:37 -04:00
Jesse Plamondon-Willard bac1f34f65
fix local file path asset name parsing locale codes in rare cases (#766)
Mod file paths can't be localized through the content pipeline. Normally the locale would be ignored anyway due to the file extension, but it'd be incorrectly parsed if the file name ended with a locale and no file extension (like "assets/example.fr-FR").
2022-04-01 22:59:50 -04:00
Patrick Müssig 61d857c41f
Added support for `--developer-mode true|false`
Minimal changes required to enable/disable developer mode  via command
line argument. This commit does not include any error handling for
invalid values how ever they will be ignored and not crash the game.
2022-04-02 04:08:49 +02:00
Jesse Plamondon-Willard 6ad8ca932e
keep old XNB file extension behavior for backwards compatibility (#766) 2022-04-01 00:33:35 -04:00
Jesse Plamondon-Willard 1d3c99cc25
split helper.Content API into game/mod content APIs 2022-03-27 13:42:14 -04:00
Jesse Plamondon-Willard d864f2ed77
add asset type to AssetRequested event (#766) 2022-03-27 12:16:28 -04:00
Jesse Plamondon-Willard 03efea2667
add LocaleChanged content event (#766) 2022-03-26 19:08:25 -04:00
Jesse Plamondon-Willard eebd8d54dc
expand obsolete attributes (#766) 2022-03-26 18:34:49 -04:00
Jesse Plamondon-Willard 5683bc9c7d
give Content Patcher internals access
This makes some of its low-level logic safer by avoiding unvalidated reflection.
2022-03-26 17:46:10 -04:00
Jesse Plamondon-Willard bacb851d7b
add IContentHelper.ParseAssetName (#766) 2022-03-26 17:44:48 -04:00
Jesse Plamondon-Willard 3a9ea66a20
update asset propagation for new content API (#766) 2022-03-26 17:37:01 -04:00
Jesse Plamondon-Willard 8d70415376
add deprecation notices for SMAPI 4.0.0 (#766) 2022-03-26 15:02:11 -04:00
Jesse Plamondon-Willard 4c64f9f644
rewrite content loading to allow handling locale variants (#766, #786, #812)
The game's content pipeline automatically loads localized variants if present. For example, it will try to load "Maps/cave.fr-FR", then "Maps/cave_international", then "Maps/cave". The old content API obfuscates this logic and treats them as interchangeable, which causes edge cases like bundle corruption (#812). This commit rewrites the loading logic to match the game logic when using the new content events, while maintaining the legacy behavior for the old IAssetLoader/IAssetEditor interfaces that'll be removed in SMAPI 4.0.0.
2022-03-26 14:07:16 -04:00
Jesse Plamondon-Willard ad8912047b
add asset edit priority (#766) 2022-03-26 01:43:40 -04:00
Jesse Plamondon-Willard e40907ab8b
add NameWithoutLocale fields (#766) 2022-03-26 01:19:44 -04:00
Jesse Plamondon-Willard 4da38e1317
add missing [Obsolete] tag 2022-03-26 00:52:04 -04:00
Jesse Plamondon-Willard 3707f481a5
extend load conflict resolution into load priority (#766) 2022-03-25 23:53:30 -04:00
Jesse Plamondon-Willard 021891ff0c
add load conflict resolution option (#766) 2022-03-25 22:49:14 -04:00
Jesse Plamondon-Willard 0e0c135604
add content pack label to more logs (#766) 2022-03-25 22:42:22 -04:00
Jesse Plamondon-Willard 9025b0dcc5
fix asset load conflict always showing multiple-mod form 2022-03-25 22:16:49 -04:00
Jesse Plamondon-Willard e1fc566e0a
add content pack labels (#766) 2022-03-25 21:46:37 -04:00
Jesse Plamondon-Willard b0011bf65c
use immutable set for invalidated asset names (#766) 2022-03-25 01:02:26 -04:00
Jesse Plamondon-Willard e88666f5b2
mark build scripts executable 2022-03-25 01:01:57 -04:00
Jesse Plamondon-Willard b77eab6e0a
add AssetReady content event (#766) 2022-03-25 00:35:31 -04:00
Jesse Plamondon-Willard 2b0ce2bb4d
add AssetInvalidated content event (#766) 2022-03-24 22:55:55 -04:00
Jesse Plamondon-Willard 6a43e6dfad
fix unneeded cloning (#766) 2022-03-23 01:16:42 -04:00
Jesse Plamondon-Willard 584725bb8e
add initial AssetRequested content event (#766) 2022-03-23 01:06:11 -04:00
Jesse Plamondon-Willard b07d2340a9
encapsulate & cache asset operation groups (#766)
This is needed for the upcoming Stardew Valley 1.6 to avoid duplicate checks between DoesAssetExist and Load calls, and to make sure the answer doesn't change between them.
2022-03-22 23:00:18 -04:00
Jesse Plamondon-Willard d3fbdf484a
reduce duplicated doc blocks 2022-03-22 20:46:21 -04:00
Jesse Plamondon-Willard a42926868a
encapsulate editor/loader operations (#766)
These will be used by the new content API, and allow handling the old one the same way.
2022-03-20 12:53:27 -04:00
Jesse Plamondon-Willard d96cec88e4
fix set_farm_type not updating warps 2022-03-10 23:24:01 -05:00
Jesse Plamondon-Willard 2216e37726
rework launch script argument parsing (#832)
This commit...

* replaces the internal `--no-reopen-terminal` arg with a documented `--use-current-shell` arg that works on Linux too;
* replaces the new SKIP_TERMINAL environment variable with the existing SMAPI_NO_TERMINAL one;
* moves argument parsing out of the 'initial setup' section (so it's easier for players to edit if needed);
* simplfies argument parsing (no need to support short opt names or add arguments for the default behavior);
* fixes arguments not parsed after the first unrecognized argument, so `--unknown --no-terminal` would still open a terminal.
2022-03-06 19:55:32 -05:00
Jesse Plamondon-Willard a4bd5cccd5
Merge pull request #832 from Ryhon0/develop
Make SKIP_TERMINAL default to false if not set
2022-03-06 18:37:13 -05:00
Jesse Plamondon-Willard debe177241
handle vanilla assets in DoesAssetExist (#766) 2022-03-05 18:12:00 -05:00
Jesse Plamondon-Willard b68b301b71
add DoesAssetExist to support the upcoming Stardew Valley 1.6 (#766) 2022-03-05 15:38:05 -05:00
Jesse Plamondon-Willard b0d8b23c2c
migrate more internal code to IAssetName (#766) 2022-03-05 15:31:06 -05:00
Jesse Plamondon-Willard e82406a845
fix error loading locale code cache when a mod adds custom languages (#766) 2022-03-05 15:30:51 -05:00
Jesse Plamondon-Willard 2f279708b3
fix regression with mod XNB files in the content pipeline (#766) 2022-03-05 15:30:17 -05:00
Jesse Plamondon-Willard c2086216fa
add Pintail to install package (#830) 2022-03-05 15:27:00 -05:00
Ryhon bb31f09977
Command line options 2022-03-05 20:40:01 +01:00
Ryhon 30d63f0a11
Make SKIP_TERMINAL default to false if not set 2022-03-04 19:20:39 +01:00
Jesse Plamondon-Willard 8429485e69
update schema for Content Patcher 1.25.0 2022-02-27 20:40:49 -05:00