summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-01-05 20:18:16 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-01-05 20:18:16 -0500
commitf976b5c0f095a881fc20f6ce5dcf5a50ebb2b5da (patch)
tree260fa7579e1c361283bda09c2616783c3fdb5b9a /src
parentd34f369d35290bca96cc7225d9765d1a8a66fa8b (diff)
parent48959375b9ef52abf7c7a9404d43aac6ba780047 (diff)
downloadSMAPI-f976b5c0f095a881fc20f6ce5dcf5a50ebb2b5da.tar.gz
SMAPI-f976b5c0f095a881fc20f6ce5dcf5a50ebb2b5da.tar.bz2
SMAPI-f976b5c0f095a881fc20f6ce5dcf5a50ebb2b5da.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI.Installer/unix-launcher.sh6
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs255
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/manifest.json4
-rw-r--r--src/SMAPI.Mods.SaveBackup/manifest.json4
-rw-r--r--src/SMAPI.Toolkit/Framework/ModData/ModWarning.cs7
-rw-r--r--src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs32
-rw-r--r--src/SMAPI.Web/Controllers/IndexController.cs3
-rw-r--r--src/SMAPI.Web/Controllers/JsonValidatorController.cs64
-rw-r--r--src/SMAPI.Web/Controllers/LogParserController.cs178
-rw-r--r--src/SMAPI.Web/Framework/Clients/Pastebin/IPastebinClient.cs5
-rw-r--r--src/SMAPI.Web/Framework/Clients/Pastebin/PasteInfo.cs8
-rw-r--r--src/SMAPI.Web/Framework/Clients/Pastebin/PastebinClient.cs58
-rw-r--r--src/SMAPI.Web/Framework/Clients/Pastebin/SavePasteResult.cs15
-rw-r--r--src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs27
-rw-r--r--src/SMAPI.Web/Framework/ConfigModels/MongoDbConfig.cs23
-rw-r--r--src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs3
-rw-r--r--src/SMAPI.Web/Framework/Extensions.cs14
-rw-r--r--src/SMAPI.Web/Framework/LogParsing/LogParser.cs2
-rw-r--r--src/SMAPI.Web/Framework/Storage/IStorageProvider.cs18
-rw-r--r--src/SMAPI.Web/Framework/Storage/StorageProvider.cs181
-rw-r--r--src/SMAPI.Web/Framework/Storage/StoredFileInfo.cs23
-rw-r--r--src/SMAPI.Web/Framework/Storage/UploadResult.cs33
-rw-r--r--src/SMAPI.Web/SMAPI.Web.csproj4
-rw-r--r--src/SMAPI.Web/Startup.cs39
-rw-r--r--src/SMAPI.Web/ViewModels/IndexModel.cs7
-rw-r--r--src/SMAPI.Web/ViewModels/JsonValidator/JsonValidatorModel.cs19
-rw-r--r--src/SMAPI.Web/Views/Index/Index.cshtml24
-rw-r--r--src/SMAPI.Web/Views/Index/Privacy.cshtml8
-rw-r--r--src/SMAPI.Web/Views/JsonValidator/Index.cshtml71
-rw-r--r--src/SMAPI.Web/Views/LogParser/Index.cshtml27
-rw-r--r--src/SMAPI.Web/appsettings.Development.json21
-rw-r--r--src/SMAPI.Web/appsettings.json22
-rw-r--r--src/SMAPI.Web/wwwroot/Content/css/json-validator.css6
-rw-r--r--src/SMAPI.Web/wwwroot/Content/js/json-validator.js8
-rw-r--r--src/SMAPI.Web/wwwroot/schemas/content-patcher.json45
-rw-r--r--src/SMAPI/Constants.cs2
-rw-r--r--src/SMAPI/Events/ChestInventoryChangedEventArgs.cs48
-rw-r--r--src/SMAPI/Events/IWorldEvents.cs3
-rw-r--r--src/SMAPI/Events/InventoryChangedEventArgs.cs34
-rw-r--r--src/SMAPI/Events/ItemStackChange.cs20
-rw-r--r--src/SMAPI/Framework/Content/AssetDataForImage.cs4
-rw-r--r--src/SMAPI/Framework/Content/AssetInterceptorChange.cs93
-rw-r--r--src/SMAPI/Framework/Content/ContentCache.cs5
-rw-r--r--src/SMAPI/Framework/ContentCoordinator.cs107
-rw-r--r--src/SMAPI/Framework/ContentManagers/BaseContentManager.cs38
-rw-r--r--src/SMAPI/Framework/ContentManagers/GameContentManager.cs49
-rw-r--r--src/SMAPI/Framework/ContentManagers/IContentManager.cs4
-rw-r--r--src/SMAPI/Framework/ContentManagers/ModContentManager.cs30
-rw-r--r--src/SMAPI/Framework/Events/EventManager.cs4
-rw-r--r--src/SMAPI/Framework/Events/ModWorldEvents.cs7
-rw-r--r--src/SMAPI/Framework/IModMetadata.cs4
-rw-r--r--src/SMAPI/Framework/Input/SInputState.cs3
-rw-r--r--src/SMAPI/Framework/ModHelpers/DataHelper.cs48
-rw-r--r--src/SMAPI/Framework/ModLoading/AssemblyLoader.cs5
-rw-r--r--src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs3
-rw-r--r--src/SMAPI/Framework/ModLoading/ModMetadata.cs21
-rw-r--r--src/SMAPI/Framework/Models/ModFolderExport.cs21
-rw-r--r--src/SMAPI/Framework/Models/SConfig.cs6
-rw-r--r--src/SMAPI/Framework/Reflection/ReflectedMethod.cs4
-rw-r--r--src/SMAPI/Framework/SCore.cs154
-rw-r--r--src/SMAPI/Framework/SGame.cs75
-rw-r--r--src/SMAPI/Framework/SnapshotItemListDiff.cs66
-rw-r--r--src/SMAPI/Framework/StateTracking/ChestTracker.cs101
-rw-r--r--src/SMAPI/Framework/StateTracking/FieldWatchers/NetListWatcher.cs143
-rw-r--r--src/SMAPI/Framework/StateTracking/FieldWatchers/ObservableCollectionWatcher.cs28
-rw-r--r--src/SMAPI/Framework/StateTracking/FieldWatchers/WatcherFactory.cs8
-rw-r--r--src/SMAPI/Framework/StateTracking/LocationTracker.cs60
-rw-r--r--src/SMAPI/Framework/StateTracking/PlayerTracker.cs32
-rw-r--r--src/SMAPI/Framework/StateTracking/Snapshots/LocationSnapshot.cs13
-rw-r--r--src/SMAPI/Framework/StateTracking/Snapshots/PlayerSnapshot.cs15
-rw-r--r--src/SMAPI/Metadata/CoreAssetPropagator.cs144
-rw-r--r--src/SMAPI/Metadata/InstructionMetadata.cs1
-rw-r--r--src/SMAPI/SMAPI.config.json6
-rw-r--r--src/SMAPI/SMAPI.csproj21
-rw-r--r--src/SMAPI/i18n/es.json3
-rw-r--r--src/SMAPI/i18n/ja.json3
-rw-r--r--src/SMAPI/i18n/pt.json3
-rw-r--r--src/SMAPI/i18n/zh.json6
78 files changed, 1746 insertions, 963 deletions
diff --git a/src/SMAPI.Installer/unix-launcher.sh b/src/SMAPI.Installer/unix-launcher.sh
index bebba9fe..b72eed22 100644
--- a/src/SMAPI.Installer/unix-launcher.sh
+++ b/src/SMAPI.Installer/unix-launcher.sh
@@ -61,8 +61,8 @@ else
COMMAND="type"
fi
- # select terminal (prefer $TERMINAL for overrides and testing, then xterm for best compatibility, then known supported terminals)
- for terminal in "$TERMINAL" xterm gnome-terminal kitty terminator xfce4-terminal konsole terminal termite alacritty x-terminal-emulator; do
+ # select terminal (prefer xterm for best compatibility, then known supported terminals)
+ for terminal in xterm gnome-terminal kitty terminator xfce4-terminal konsole terminal termite alacritty mate-terminal x-terminal-emulator; do
if $COMMAND "$terminal" 2>/dev/null; then
# Find the true shell behind x-terminal-emulator
if [ "$(basename "$(readlink -f $(which "$terminal"))")" != "x-terminal-emulator" ]; then
@@ -108,7 +108,7 @@ else
alacritty -e sh -c 'TERM=xterm ./StardewModdingAPI.bin.x86 $*'
fi
;;
- xterm|xfce4-terminal|gnome-terminal|terminal|termite)
+ xterm|xfce4-terminal|gnome-terminal|terminal|termite|mate-terminal)
$LAUNCHTERM -e "sh -c 'TERM=xterm $LAUNCHER'"
;;
konsole)
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs
index 0648aa2b..08dd8eed 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs
@@ -46,12 +46,16 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
yield return this.TryCreate(ItemType.Tool, this.CustomIDOffset + 2, () => new Pan());
yield return this.TryCreate(ItemType.Tool, this.CustomIDOffset + 3, () => new Wand());
+ // clothing
+ foreach (int id in Game1.clothingInformation.Keys)
+ yield return this.TryCreate(ItemType.Clothing, id, () => new Clothing(id));
+
// wallpapers
for (int id = 0; id < 112; id++)
yield return this.TryCreate(ItemType.Wallpaper, id, () => new Wallpaper(id) { Category = SObject.furnitureCategory });
// flooring
- for (int id = 0; id < 40; id++)
+ for (int id = 0; id < 56; id++)
yield return this.TryCreate(ItemType.Flooring, id, () => new Wallpaper(id, isFloor: true) { Category = SObject.furnitureCategory });
// equipment
@@ -59,11 +63,6 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
yield return this.TryCreate(ItemType.Boots, id, () => new Boots(id));
foreach (int id in Game1.content.Load<Dictionary<int, string>>("Data\\hats").Keys)
yield return this.TryCreate(ItemType.Hat, id, () => new Hat(id));
- foreach (int id in Game1.objectInformation.Keys)
- {
- if (id >= Ring.ringLowerIndexRange && id <= Ring.ringUpperIndexRange)
- yield return this.TryCreate(ItemType.Ring, id, () => new Ring(id));
- }
// weapons
foreach (int id in Game1.content.Load<Dictionary<int, string>>("Data\\weapons").Keys)
@@ -87,147 +86,141 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
foreach (int id in Game1.bigCraftablesInformation.Keys)
yield return this.TryCreate(ItemType.BigCraftable, id, () => new SObject(Vector2.Zero, id));
- // secret notes
- foreach (int id in Game1.content.Load<Dictionary<int, string>>("Data\\SecretNotes").Keys)
- {
- yield return this.TryCreate(ItemType.Object, this.CustomIDOffset + id, () =>
- {
- SObject note = new SObject(79, 1);
- note.name = $"{note.name} #{id}";
- return note;
- });
- }
-
// objects
foreach (int id in Game1.objectInformation.Keys)
{
- if (id == 79)
- continue; // secret note handled above
- if (id >= Ring.ringLowerIndexRange && id <= Ring.ringUpperIndexRange)
- continue; // handled separated
-
- // spawn main item
- SObject item;
- {
- SearchableItem main = this.TryCreate(ItemType.Object, id, () => id == 812
- ? new ColoredObject(id, 1, Color.White)
- : new SObject(id, 1)
- );
- yield return main;
- item = main?.Item as SObject;
- }
- if (item == null)
- continue;
+ string[] fields = Game1.objectInformation[id]?.Split('/');
- // fruit products
- if (item.Category == SObject.FruitsCategory)
+ // secret notes
+ if (id == 79)
{
- // wine
- yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 2 + id, () =>
+ foreach (int secretNoteId in Game1.content.Load<Dictionary<int, string>>("Data\\SecretNotes").Keys)
{
- SObject wine = new SObject(348, 1)
+ yield return this.TryCreate(ItemType.Object, this.CustomIDOffset + secretNoteId, () =>
{
- Name = $"{item.Name} Wine",
- Price = item.Price * 3
- };
- wine.preserve.Value = SObject.PreserveType.Wine;
- wine.preservedParentSheetIndex.Value = item.ParentSheetIndex;
- return wine;
- });
-
- // jelly
- yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 3 + id, () =>
- {
- SObject jelly = new SObject(344, 1)
- {
- Name = $"{item.Name} Jelly",
- Price = 50 + item.Price * 2
- };
- jelly.preserve.Value = SObject.PreserveType.Jelly;
- jelly.preservedParentSheetIndex.Value = item.ParentSheetIndex;
- return jelly;
- });
+ SObject note = new SObject(79, 1);
+ note.name = $"{note.name} #{secretNoteId}";
+ return note;
+ });
+ }
}
- // vegetable products
- else if (item.Category == SObject.VegetableCategory)
- {
- // juice
- yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 4 + id, () =>
- {
- SObject juice = new SObject(350, 1)
- {
- Name = $"{item.Name} Juice",
- Price = (int)(item.Price * 2.25d)
- };
- juice.preserve.Value = SObject.PreserveType.Juice;
- juice.preservedParentSheetIndex.Value = item.ParentSheetIndex;
- return juice;
- });
-
- // pickled
- yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 5 + id, () =>
- {
- SObject pickled = new SObject(342, 1)
- {
- Name = $"Pickled {item.Name}",
- Price = 50 + item.Price * 2
- };
- pickled.preserve.Value = SObject.PreserveType.Pickle;
- pickled.preservedParentSheetIndex.Value = item.ParentSheetIndex;
- return pickled;
- });
- }
+ // ring
+ else if (id != 801 && fields?.Length >= 4 && fields[3] == "Ring") // 801 = wedding ring, which isn't an equippable ring
+ yield return this.TryCreate(ItemType.Ring, id, () => new Ring(id));
- // flower honey
- else if (item.Category == SObject.flowersCategory)
+ // item
+ else
{
- yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 5 + id, () =>
+ // spawn main item
+ SObject item = null;
+ yield return this.TryCreate(ItemType.Object, id, () =>
{
- SObject honey = new SObject(Vector2.Zero, 340, $"{item.Name} Honey", false, true, false, false)
- {
- Name = $"{item.Name} Honey",
- preservedParentSheetIndex = { item.ParentSheetIndex }
- };
- honey.Price += item.Price * 2;
- return honey;
+ return item = (id == 812 // roe
+ ? new ColoredObject(id, 1, Color.White)
+ : new SObject(id, 1)
+ );
});
- }
+ if (item == null)
+ continue;
- // roe and aged roe (derived from FishPond.GetFishProduce)
- else if (id == 812)
- {
- foreach (var pair in Game1.objectInformation)
+ // flavored items
+ switch (item.Category)
{
- // get input
- SObject input = new SObject(pair.Key, 1);
- if (input.Category != SObject.FishCategory)
- continue;
- Color color = TailoringMenu.GetDyeColor(input) ?? Color.Orange;
-
- // yield roe
- SObject roe = new ColoredObject(812, 1, color)
- {
- name = $"{input.Name} Roe",
- preserve = { Value = SObject.PreserveType.Roe },
- preservedParentSheetIndex = { Value = input.ParentSheetIndex }
- };
- roe.Price += input.Price / 2;
- yield return new SearchableItem(ItemType.Object, this.CustomIDOffset * 6 + 1, roe);
-
- // aged roe
- if (pair.Key != 698) // aged sturgeon roe is caviar, which is a separate item
- {
- ColoredObject agedRoe = new ColoredObject(447, 1, color)
+ // fruit products
+ case SObject.FruitsCategory:
+ // wine
+ yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 2 + id, () => new SObject(348, 1)
+ {
+ Name = $"{item.Name} Wine",
+ Price = item.Price * 3,
+ preserve = { SObject.PreserveType.Wine },
+ preservedParentSheetIndex = { item.ParentSheetIndex }
+ });
+
+ // jelly
+ yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 3 + id, () => new SObject(344, 1)
+ {
+ Name = $"{item.Name} Jelly",
+ Price = 50 + item.Price * 2,
+ preserve = { SObject.PreserveType.Jelly },
+ preservedParentSheetIndex = { item.ParentSheetIndex }
+ });
+ break;
+
+ // vegetable products
+ case SObject.VegetableCategory:
+ // juice
+ yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 4 + id, () => new SObject(350, 1)
+ {
+ Name = $"{item.Name} Juice",
+ Price = (int)(item.Price * 2.25d),
+ preserve = { SObject.PreserveType.Juice },
+ preservedParentSheetIndex = { item.ParentSheetIndex }
+ });
+
+ // pickled
+ 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 = { item.ParentSheetIndex }
+ });
+ break;
+
+ // flower honey
+ case SObject.flowersCategory:
+ yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 5 + id, () =>
+ {
+ SObject honey = new SObject(Vector2.Zero, 340, $"{item.Name} Honey", false, true, false, false)
+ {
+ Name = $"{item.Name} Honey",
+ preservedParentSheetIndex = { item.ParentSheetIndex }
+ };
+ honey.Price += item.Price * 2;
+ return honey;
+ });
+ break;
+
+ // roe and aged roe (derived from FishPond.GetFishProduce)
+ case SObject.sellAtFishShopCategory when id == 812:
+ foreach (var pair in Game1.objectInformation)
{
- name = $"Aged {input.Name} Roe",
- Category = -27,
- preserve = { Value = SObject.PreserveType.AgedRoe },
- preservedParentSheetIndex = { Value = input.ParentSheetIndex },
- Price = roe.Price * 2
- };
- yield return new SearchableItem(ItemType.Object, this.CustomIDOffset * 6 + 1, agedRoe);
- }
+ // get input
+ SObject input = this.TryCreate(ItemType.Object, -1, () => new SObject(pair.Key, 1))?.Item as SObject;
+ if (input