From eaaba3238db18a404c8a2b6be3617ca37a2e7557 Mon Sep 17 00:00:00 2001 From: b3nk3lly Date: Fri, 4 Oct 2024 20:38:41 -0300 Subject: [PATCH 01/16] Add spawn rules for extended family fish --- LookupAnything/DataParser.cs | 9 +- .../Framework/Fields/FishSpawnRulesField.cs | 4 + .../Models/FishData/FishSpawnData.cs | 3 +- LookupAnything/assets/data.json | 87 +++++++++++++++++++ LookupAnything/i18n/de.json | 1 + LookupAnything/i18n/default.json | 1 + LookupAnything/i18n/es.json | 1 + LookupAnything/i18n/fr.json | 1 + LookupAnything/i18n/hu.json | 1 + LookupAnything/i18n/it.json | 1 + LookupAnything/i18n/ja.json | 1 + LookupAnything/i18n/ko.json | 1 + LookupAnything/i18n/pl.json | 1 + LookupAnything/i18n/pt.json | 1 + LookupAnything/i18n/ru.json | 1 + LookupAnything/i18n/th.json | 1 + LookupAnything/i18n/tr.json | 1 + LookupAnything/i18n/uk.json | 1 + LookupAnything/i18n/zh.json | 1 + 19 files changed, 115 insertions(+), 3 deletions(-) diff --git a/LookupAnything/DataParser.cs b/LookupAnything/DataParser.cs index 80a6afba5..1daf9fd5c 100644 --- a/LookupAnything/DataParser.cs +++ b/LookupAnything/DataParser.cs @@ -149,8 +149,9 @@ public IEnumerable GetFishPondDrops(FishPondData data) /// Derived from . public FishSpawnData? GetFishSpawnRules(string fishID, Metadata metadata) { - // parse location data + // parse location and condition data var locations = new List(); + bool isLegendaryFamily = false; foreach ((string locationId, LocationData data) in DataLoader.Locations(Game1.content)) { if (metadata.IgnoreFishingLocations.Contains(locationId)) @@ -181,6 +182,9 @@ public IEnumerable GetFishPondDrops(FishPondData data) } curLocations.Add(new FishSpawnLocationData(locationId, fish.FishAreaId, seasons.ToArray())); } + + // check if fish is part of Qi's Extended Family quest + isLegendaryFamily = conditionData.Any(condition => !condition.Negated && condition.Query.SequenceEqual(["PLAYER_SPECIAL_ORDER_RULE_ACTIVE", "Current", "LEGENDARY_FAMILY"])); } else curLocations.Add(new FishSpawnLocationData(locationId, fish.FishAreaId, new[] { "spring", "summer", "fall", "winter" })); @@ -252,7 +256,8 @@ from areaGroup in curLocations.GroupBy(p => p.Area) TimesOfDay: timesOfDay.ToArray(), Weather: weather, MinFishingLevel: minFishingLevel, - IsUnique: isUnique + IsUnique: isUnique, + IsLegendaryFamily: isLegendaryFamily ); } diff --git a/LookupAnything/Framework/Fields/FishSpawnRulesField.cs b/LookupAnything/Framework/Fields/FishSpawnRulesField.cs index 3ca7cdcd2..e3516d455 100644 --- a/LookupAnything/Framework/Fields/FishSpawnRulesField.cs +++ b/LookupAnything/Framework/Fields/FishSpawnRulesField.cs @@ -53,6 +53,10 @@ private IEnumerable> GetConditions(GameHelp if (spawnRules.MinFishingLevel > 0) yield return this.GetCondition(I18n.Item_FishSpawnRules_MinFishingLevel(level: spawnRules.MinFishingLevel), Game1.player.FishingLevel >= spawnRules.MinFishingLevel); + // extended family quest + if (spawnRules.IsLegendaryFamily) + yield return this.GetCondition(I18n.Item_FishSpawnRules_ExtendedFamilyQuestActive(), Game1.player.team.SpecialOrderRuleActive("LEGENDARY_FAMILY")); + // weather if (spawnRules.Weather == FishSpawnWeather.Sunny) yield return this.GetCondition(I18n.Item_FishSpawnRules_WeatherSunny(), !Game1.isRaining); diff --git a/LookupAnything/Framework/Models/FishData/FishSpawnData.cs b/LookupAnything/Framework/Models/FishData/FishSpawnData.cs index 5d65a2e19..0ff19046f 100644 --- a/LookupAnything/Framework/Models/FishData/FishSpawnData.cs +++ b/LookupAnything/Framework/Models/FishData/FishSpawnData.cs @@ -9,7 +9,8 @@ namespace Pathoschild.Stardew.LookupAnything.Framework.Models.FishData /// The weather in which the fish will spawn. /// The minimum fishing level. /// Whether the fish can only be caught once. - internal record FishSpawnData(string FishID, FishSpawnLocationData[]? Locations, FishSpawnTimeOfDayData[]? TimesOfDay, FishSpawnWeather Weather, int MinFishingLevel, bool IsUnique) + /// Whether the fish is part of Qi's Extended Family quest. + internal record FishSpawnData(string FishID, FishSpawnLocationData[]? Locations, FishSpawnTimeOfDayData[]? TimesOfDay, FishSpawnWeather Weather, int MinFishingLevel, bool IsUnique, bool IsLegendaryFamily) { /********* ** Public methods diff --git a/LookupAnything/assets/data.json b/LookupAnything/assets/data.json index bcc20b431..e9ac40dfd 100644 --- a/LookupAnything/assets/data.json +++ b/LookupAnything/assets/data.json @@ -349,6 +349,93 @@ You shouldn't change this file unless you know what you're doing. "Seasons": [ "winter" ] } ] + }, + + // Son of Crimsonfish + "898": { + "MinFishingLevel": 5, + "Locations": [ + { + "LocationId": "Beach", + "Area": "east-pier", + "Seasons": [ "spring", "summer", "fall", "winter" ] + } + ], + "TimesOfDay": [ + { + "MinTime": "600", + "MaxTime": "2600" + } + ] + }, + + // Ms. Angler + "899": { + "MinFishingLevel": 3, + "Locations": [ + { + "LocationId": "Town", + "Area": "northmost-bridge", + "Seasons": [ "spring", "summer", "fall", "winter" ] + } + ], + "TimesOfDay": [ + { + "MinTime": "600", + "MaxTime": "2600" + } + ] + }, + + // Legend II + "900": { + "MinFishingLevel": 10, + "Locations": [ + { + "LocationId": "Mountain", + "Seasons": [ "spring", "summer", "fall", "winter" ] + } + ], + "TimesOfDay": [ + { + "MinTime": "600", + "MaxTime": "2600" + } + ] + }, + + // Radioactive Carp + "901": { + "Locations": [ + { + "LocationId": "Sewer", + "Seasons": [ "spring", "summer", "fall", "winter" ] + } + ], + "TimesOfDay": [ + { + "MinTime": "600", + "MaxTime": "2600" + } + ] + }, + + // Glacierfish Jr. + "902": { + "MinFishingLevel": 6, + "Locations": [ + { + "LocationId": "Forest", + "Area": "island-tip", + "Seasons": [ "spring", "summer", "fall", "winter" ] + } + ], + "TimesOfDay": [ + { + "MinTime": "600", + "MaxTime": "2600" + } + ] } }, diff --git a/LookupAnything/i18n/de.json b/LookupAnything/i18n/de.json index 0e5cb915e..559e761ac 100644 --- a/LookupAnything/i18n/de.json +++ b/LookupAnything/i18n/de.json @@ -398,6 +398,7 @@ // values "item.fish-spawn-rules.min-fishing-level": "Mindest-Angelstufe: {{level}}", "item.fish-spawn-rules.not-caught-yet": "Noch nicht gefangen (kann nur einmal gefangen werden)", + "item.fish-spawn-rules.extended-family-quest-active": "\"Extended Family\" quest active", // TODO "item.fish-spawn-rules.locations": "Standorte: {{locations}}", "item.fish-spawn-rules.locations-by-season.label": "Standorte:", "item.fish-spawn-rules.locations-by-season.season-locations": "{{season}}: {{locations}}", diff --git a/LookupAnything/i18n/default.json b/LookupAnything/i18n/default.json index fe82c6f5e..93f2d3add 100644 --- a/LookupAnything/i18n/default.json +++ b/LookupAnything/i18n/default.json @@ -398,6 +398,7 @@ // values "item.fish-spawn-rules.min-fishing-level": "min fishing level: {{level}}", "item.fish-spawn-rules.not-caught-yet": "not caught yet (can only be caught once)", + "item.fish-spawn-rules.extended-family-quest-active": "\"Extended Family\" quest active", "item.fish-spawn-rules.locations": "locations: {{locations}}", "item.fish-spawn-rules.locations-by-season.label": "locations:", "item.fish-spawn-rules.locations-by-season.season-locations": "{{season}}: {{locations}}", diff --git a/LookupAnything/i18n/es.json b/LookupAnything/i18n/es.json index a89270a79..0953e3f57 100644 --- a/LookupAnything/i18n/es.json +++ b/LookupAnything/i18n/es.json @@ -399,6 +399,7 @@ // values "item.fish-spawn-rules.min-fishing-level": "nivel de pescar mínimo: {{level}}", "item.fish-spawn-rules.not-caught-yet": "aún no ha sido atrapado (solo se puede atrapar una vez)", + "item.fish-spawn-rules.extended-family-quest-active": "\"Extended Family\" quest active", // TODO "item.fish-spawn-rules.locations": "ubicaciones: {{locations}}", "item.fish-spawn-rules.locations-by-season.label": "ubicaciones:", "item.fish-spawn-rules.locations-by-season.season-locations": "{{season}}: {{locations}}", diff --git a/LookupAnything/i18n/fr.json b/LookupAnything/i18n/fr.json index 4381bac16..4718bb347 100644 --- a/LookupAnything/i18n/fr.json +++ b/LookupAnything/i18n/fr.json @@ -401,6 +401,7 @@ // values "item.fish-spawn-rules.min-fishing-level": "niveau minimum de pêche : {{level}}", "item.fish-spawn-rules.not-caught-yet": "pas encore attrapé (ne peux être attrapé qu'une fois)", + "item.fish-spawn-rules.extended-family-quest-active": "\"Extended Family\" quest active", // TODO "item.fish-spawn-rules.locations": "emplacements : {{locations}}", "item.fish-spawn-rules.locations-by-season.label": "emplacements :", "item.fish-spawn-rules.locations-by-season.season-locations": "{{season}} : {{locations}}", diff --git a/LookupAnything/i18n/hu.json b/LookupAnything/i18n/hu.json index 8a3b9b25f..7ab70cbc3 100644 --- a/LookupAnything/i18n/hu.json +++ b/LookupAnything/i18n/hu.json @@ -399,6 +399,7 @@ // values "item.fish-spawn-rules.min-fishing-level": "minimum horgász szint: {{level}}", "item.fish-spawn-rules.not-caught-yet": "nem fogtál még (csak egyszer lehet elkapni)", + "item.fish-spawn-rules.extended-family-quest-active": "\"Extended Family\" quest active", // TODO "item.fish-spawn-rules.locations": "helyszínek: {{locations}}", "item.fish-spawn-rules.locations-by-season.label": "helyszínek:", "item.fish-spawn-rules.locations-by-season.season-locations": "{{season}}: {{locations}}", diff --git a/LookupAnything/i18n/it.json b/LookupAnything/i18n/it.json index 970d95f96..c14c3542b 100644 --- a/LookupAnything/i18n/it.json +++ b/LookupAnything/i18n/it.json @@ -397,6 +397,7 @@ // values "item.fish-spawn-rules.min-fishing-level": "livello minimo di pesca: {{level}}", "item.fish-spawn-rules.not-caught-yet": "Non ancora pescato (si può pescare solo una volta)", + "item.fish-spawn-rules.extended-family-quest-active": "\"Extended Family\" quest active", // TODO "item.fish-spawn-rules.locations": "luogo: {{locations}}", "item.fish-spawn-rules.locations-by-season.label": "luoghi:", "item.fish-spawn-rules.locations-by-season.season-locations": "{{season}}: {{locations}}", diff --git a/LookupAnything/i18n/ja.json b/LookupAnything/i18n/ja.json index 025880db6..cb6dc73cb 100644 --- a/LookupAnything/i18n/ja.json +++ b/LookupAnything/i18n/ja.json @@ -398,6 +398,7 @@ // values "item.fish-spawn-rules.min-fishing-level": "必要釣りレベル:{{level}}", "item.fish-spawn-rules.not-caught-yet": "まだ釣った事がない(釣れるのは一度だけです)", + "item.fish-spawn-rules.extended-family-quest-active": "\"Extended Family\" quest active", // TODO "item.fish-spawn-rules.locations": "場所:{{locations}}", "item.fish-spawn-rules.locations-by-season.label": "場所:", "item.fish-spawn-rules.locations-by-season.season-locations": "{{season}}:{{locations}}", diff --git a/LookupAnything/i18n/ko.json b/LookupAnything/i18n/ko.json index 0e7e52e4e..3a35ff906 100644 --- a/LookupAnything/i18n/ko.json +++ b/LookupAnything/i18n/ko.json @@ -398,6 +398,7 @@ // values "item.fish-spawn-rules.min-fishing-level": "최소 낚시 레벨: {{level}}", "item.fish-spawn-rules.not-caught-yet": "아직 잡히지 않음(한 번만 잡을 수 있음)", + "item.fish-spawn-rules.extended-family-quest-active": "\"Extended Family\" quest active", // TODO "item.fish-spawn-rules.locations": "장소: {{locations}}", "item.fish-spawn-rules.locations-by-season.label": "장소:", "item.fish-spawn-rules.locations-by-season.season-locations": "{{season}}: {{locations}}", diff --git a/LookupAnything/i18n/pl.json b/LookupAnything/i18n/pl.json index 388eaa506..6a2886a96 100644 --- a/LookupAnything/i18n/pl.json +++ b/LookupAnything/i18n/pl.json @@ -399,6 +399,7 @@ // values "item.fish-spawn-rules.min-fishing-level": "min. poziom wędkarstwa: {{level}}", "item.fish-spawn-rules.not-caught-yet": "jeszcze nie złowiono (można złapać tylko raz na grę)", + "item.fish-spawn-rules.extended-family-quest-active": "\"Extended Family\" quest active", // TODO "item.fish-spawn-rules.locations": "lokacje: {{locations}}", "item.fish-spawn-rules.locations-by-season.label": "lokacje:", "item.fish-spawn-rules.locations-by-season.season-locations": "{{season}}: {{locations}}", diff --git a/LookupAnything/i18n/pt.json b/LookupAnything/i18n/pt.json index 69023b4d4..0be173382 100644 --- a/LookupAnything/i18n/pt.json +++ b/LookupAnything/i18n/pt.json @@ -399,6 +399,7 @@ // values "item.fish-spawn-rules.min-fishing-level": "nível mínimo de pesca: {{level}}", "item.fish-spawn-rules.not-caught-yet": "não capturado ainda (pode ser capturado apenas uma vez)", + "item.fish-spawn-rules.extended-family-quest-active": "\"Extended Family\" quest active", // TODO "item.fish-spawn-rules.locations": "localizações: {{locations}}", "item.fish-spawn-rules.locations-by-season.label": "localizações:", "item.fish-spawn-rules.locations-by-season.season-locations": "{{season}}: {{locations}}", diff --git a/LookupAnything/i18n/ru.json b/LookupAnything/i18n/ru.json index cbb5df891..c5b237c6a 100644 --- a/LookupAnything/i18n/ru.json +++ b/LookupAnything/i18n/ru.json @@ -398,6 +398,7 @@ // values "item.fish-spawn-rules.min-fishing-level": "минимальный уровень рыбалки: {{level}}", "item.fish-spawn-rules.not-caught-yet": "пока не пойман (может быть пойман только один раз)", + "item.fish-spawn-rules.extended-family-quest-active": "\"Extended Family\" quest active", // TODO "item.fish-spawn-rules.locations": "местонахождение: {{locations}}", "item.fish-spawn-rules.locations-by-season.label": "местонахождение:", "item.fish-spawn-rules.locations-by-season.season-locations": "{{season}}: {{locations}}", diff --git a/LookupAnything/i18n/th.json b/LookupAnything/i18n/th.json index 9baa4edb1..98fb61bc8 100644 --- a/LookupAnything/i18n/th.json +++ b/LookupAnything/i18n/th.json @@ -399,6 +399,7 @@ // values "item.fish-spawn-rules.min-fishing-level": "เลเวลตกปลาขั้นต่ำ: {{level}}", "item.fish-spawn-rules.not-caught-yet": "ยังตกไม่ได้ (ตกได้ครั้งเดียว)", + "item.fish-spawn-rules.extended-family-quest-active": "\"Extended Family\" quest active", // TODO "item.fish-spawn-rules.locations": "สถานที่: {{locations}}", "item.fish-spawn-rules.locations-by-season.label": "สถานที่:", "item.fish-spawn-rules.locations-by-season.season-locations": "{{season}}: {{locations}}", diff --git a/LookupAnything/i18n/tr.json b/LookupAnything/i18n/tr.json index 299b5c140..8e33b96b3 100644 --- a/LookupAnything/i18n/tr.json +++ b/LookupAnything/i18n/tr.json @@ -398,6 +398,7 @@ // values "item.fish-spawn-rules.min-fishing-level": "minimum balıkçılık seviyesi: {{level}}", "item.fish-spawn-rules.not-caught-yet": "henüz yakalanmamış (sadece bir defa yakalanabilir)", + "item.fish-spawn-rules.extended-family-quest-active": "\"Extended Family\" quest active", // TODO "item.fish-spawn-rules.locations": "bölgeler: {{locations}}", "item.fish-spawn-rules.locations-by-season.label": "bölgeler:", "item.fish-spawn-rules.locations-by-season.season-locations": "{{season}}: {{locations}}", diff --git a/LookupAnything/i18n/uk.json b/LookupAnything/i18n/uk.json index 78b83237b..a57ed709c 100644 --- a/LookupAnything/i18n/uk.json +++ b/LookupAnything/i18n/uk.json @@ -399,6 +399,7 @@ // values "item.fish-spawn-rules.min-fishing-level": "Мінімальний рівень рибальства: {{level}}", "item.fish-spawn-rules.not-caught-yet": "Поки-що не зловлено (Можна зловити лише один раз)", + "item.fish-spawn-rules.extended-family-quest-active": "\"Extended Family\" quest active", // TODO "item.fish-spawn-rules.locations": "Місцезнаходження: {{locations}}", "item.fish-spawn-rules.locations-by-season.label": "Місцезнаходження:", "item.fish-spawn-rules.locations-by-season.season-locations": "{{season}}: {{locations}}", diff --git a/LookupAnything/i18n/zh.json b/LookupAnything/i18n/zh.json index c7845659d..65636c8e5 100644 --- a/LookupAnything/i18n/zh.json +++ b/LookupAnything/i18n/zh.json @@ -399,6 +399,7 @@ "item.fish-spawn-rules.min-fishing-level": "最低钓鱼等级:{{level}}", "item.fish-spawn-rules.not-caught-yet": "尚未被抓住(只能被抓住一次)", + "item.fish-spawn-rules.extended-family-quest-active": "\"Extended Family\" quest active", // TODO "item.fish-spawn-rules.locations": "地点:{{locations}}", "item.fish-spawn-rules.locations-by-season.label": "地点:", "item.fish-spawn-rules.locations-by-season.season-locations": "{{season}}: {{locations}}", From 05412da268b6bf572c5014320102ca5b84f25633 Mon Sep 17 00:00:00 2001 From: Epitopus <105813595+Epitopus@users.noreply.github.com> Date: Sat, 5 Oct 2024 03:58:48 +0200 Subject: [PATCH 02/16] Polish tranlation improvement for LookupAnything --- LookupAnything/i18n/pl.json | 180 +++++++++++++++++------------------- 1 file changed, 87 insertions(+), 93 deletions(-) diff --git a/LookupAnything/i18n/pl.json b/LookupAnything/i18n/pl.json index 388eaa506..8e8ef1cb9 100644 --- a/LookupAnything/i18n/pl.json +++ b/LookupAnything/i18n/pl.json @@ -31,7 +31,7 @@ "generic.price": "{{price}}zł", "generic.price-for-quality": "{{price}}zł ({{quality}})", "generic.price-for-stack": "{{price}}zł za {{count}}", - "generic.show-x-results": "show {{count}} results", // TODO + "generic.show-x-results": "pokaż {{count}} wyników", // types "type.building": "Budowla", @@ -51,7 +51,7 @@ "quality.iridium": "irydowe", // item names shown in recipes - "item.wild-seeds": "Wild Seeds (Any)", // TODO + "item.wild-seeds": "Dzikie nasiona (Każde)", // NPC friendship "friendship-status.friendly": "Sympatia", @@ -75,7 +75,7 @@ "bundle-area.abandoned-joja-mart": "Opuszczony JojaMarket", // shop names - "shop.adventure-guild": "Gildia Poszukiwaczy Przygód", + "shop.adventure-guild": "Gildia Awanturników", "shop.clint": "Clint", "shop.marnie": "Marnie", "shop.pierre": "Pierre", @@ -107,7 +107,7 @@ // location names "location.beach.east-pier": "plaża (wschodnie molo)", "location.bugLand": "legowisko zmutowanych robaków", - "location.desert.topPond": "desert (north pond)", // TODO + "location.desert.topPond": "pustynia (staw na północy)", "location.farmCave": "jaskinia na farmie", "location.farmHouse": "dom na farmie", "location.forest.island-tip": "leśna rzeka (południowy kraniec dużej wyspy)", @@ -136,31 +136,30 @@ /********* ** Conditions & context tags *********/ - // TODO - "condition-or-context-tag.negate": "not {{value}}", + "condition-or-context-tag.negate": "nie {{value}}", - "condition.day-of-month": "on specific days ({{days}})", - "condition.day-of-month.even": "even days", - "condition.day-of-month.odd": "odd days", + "condition.day-of-month": "w konkretne dni ({{days}})", + "condition.day-of-month.even": "dni parzyste", + "condition.day-of-month.odd": "dni nieparzyste", - "condition.item-type.input": "input item", - "condition.item-type.target": "target item", + "condition.item-type.input": "przedmiot wejściowy", + "condition.item-type.target": "przedmiot docelowy", - "condition.raw-context-tag": "context tag \"{{tag}}\"", - "condition.raw-condition": "query \"{{tag}}\"", + "condition.raw-context-tag": "tag kontekstowy \"{{tag}}\"", + "condition.raw-condition": "zapytanie \"{{tag}}\"", - "condition.item-context-tag": "{{item}} has context tag {{tags}}", - "condition.item-context-tags": "{{item}} has context tags {{tags}}", + "condition.item-context-tag": "{{item}} ma tag kontekstowy {{tags}}", + "condition.item-context-tags": "{{item}} ma tag kontekstowy {{tags}}", "condition.item-context-tag.value": "'{{tag}}'", // the format of each context tag in the list (each context tag isn't translated) - "condition.item-edibility.edible": "{{item}} is edible", - "condition.item-edibility.min": "{{item}} has edibility of {{min}} or more", - "condition.item-edibility.range": "{{item}} has edibility of {{min}} to {{max}}", + "condition.item-edibility.edible": "{{item}} jest jadalne", + "condition.item-edibility.min": "{{item}} ma jadalność {{min}} lub więcej", + "condition.item-edibility.range": "{{item}} ma jadalność od {{min}} do {{max}}", - "context-tag.bone": "any bone", - "context-tag.egg": "any egg", - "context-tag.large-egg": "any large egg", - "context-tag.preserved-item": "preserved {{name}}", + "context-tag.bone": "każda kość", + "context-tag.egg": "każde jajo", + "context-tag.large-egg": "każde duże jajo", + "context-tag.preserved-item": "zakonserwowane: {{name}}", /********* @@ -190,7 +189,7 @@ // labels "building.animals": "Zwierzęta", "building.construction": "Budowa", - "building.construction-costs": "Construction costs", // TODO + "building.construction-costs": "Koszt budowy", "building.feed-trough": "Koryta na paszę", "building.horse": "Koń", "building.horse-location": "Lokacja konia", @@ -211,7 +210,7 @@ "building.output-processing": "Wytwarzanie w trakcie", "building.output-ready": "Wytwarzanie ukończone", "building.slimes.summary": "{{count}} na maks. {{max}} szlamów", - "building.stored-hay.summary": "{{hayCount}} of {{maxHayInLocation}} hay in this location (max capacity in this building: {{maxHayInBuilding}})", // TODO + "building.stored-hay.summary": "{{hayCount}}/{{maxHayInLocation}} siana w tym miejscu (maks. pojemność w tym budynku: {{maxHayInBuilding}})", "building.upgrades.barn.0": "do 4 zwierząt; dodaje krowy", "building.upgrades.barn.1": "do 8 zwierząt; dodaje rozmnażanie i kozy", "building.upgrades.barn.2": "do 12 zwierząt; dodaje autokarmienie, świnie i owce", @@ -311,7 +310,7 @@ ** Item > generic lookups *********/ // labels - "item.custom-item": "Custom item", // TODO + "item.custom-item": "Niestandardowy przedmiot", "item.contents": "Zawartość", "item.loves-this": "Kocha to", "item.likes-this": "Lubi to", @@ -330,7 +329,7 @@ "item.produces-dye": "Tworzy barwnik", // values - "item.custom-item.summary": "added by {{modName}}", // TODO + "item.custom-item.summary": "dodane przez {{modName}}", "item.contents.placed": "{{name}} umieszczono", "item.contents.ready": "{{name}} ukończono", "item.contents.partial": "{{name}} za {{time}}", @@ -338,19 +337,19 @@ "item.undiscovered-gift-taste-appended": ", oraz {{count}} nieokreślonych mieszkańców", "item.needed-for.community-center": "centrum społeczności ({{bundles}})", "item.needed-for.full-shipment": "osiągnięcie szybka wysyłka (sprzedaj jeden)", - "item.needed-for.monoculture": "monoculture achievement (ship {{count}} more)", // TODO - "item.needed-for.polyculture": "osiągnięcie polikultura (sprzedaj {{count}} więcej)", + "item.needed-for.monoculture": "osiągnięcie monokultura (sprzedaj jeszcze {{count}})", + "item.needed-for.polyculture": "osiągnięcie polikultura (sprzedaj jeszcze {{count}})", "item.needed-for.full-collection": "osiągnięcie skończona kolekcja (podaruj jeden do muzeum)", "item.needed-for.gourmet-chef": "osiągnięcie smakosz (przyrządź {{recipes}})", "item.needed-for.craft-master": "osiągnięcie mistrz rzemieślników (wytwórz {{recipes}})", "item.needed-for.quests": "aktualne zadania ({{quests}})", - "item.unknown-recipes": "{{count}} unknown recipes", // TODO + "item.unknown-recipes": "{{count}} nieznanych przepisów", "item.sells-to.shipping-box": "skrzynka sprzedaży", "item.recipes-for-ingredient.entry": "{{name}} (potrzeba {{count}})", "item.recipes-for-machine.multiple-items": "{{name}} x{{count}}", - "item.recipes-for-machine.same-as-input": "[same as input]", // e.g. crystalarium produces same item that was put in // TODO - "item.recipes-for-machine.conditions": "[conditions: {{conditions}}]", // TODO - "item.recipes-for-machine.too-complex": "Some machine rules are too dynamic to display.", // TODO + "item.recipes-for-machine.same-as-input": "[tak samo jak wejście]", // e.g. crystalarium produces same item that was put in + "item.recipes-for-machine.conditions": "[warunki: {{conditions}}]", + "item.recipes-for-machine.too-complex": "Wyświetlenie niektórych reguł maszynowych jest zbyt dynamiczne.", "item.number-owned.summary": "masz takich {{count}}", "item.number-crafted.summary": "zrobiono takich {{count}}", @@ -385,7 +384,7 @@ "item.fence-health": "Wytrzymałość", // values - "item.fence-health.gold-clock": "brak podupadania dzięki Złotemu Zegarowi", + "item.fence-health.gold-clock": "Bez rozpadu dzięki Złotemu Zegarowi", "item.fence-health.summary": "{{percent}}% (pozostało około {{count}} dni)", @@ -413,24 +412,22 @@ ** Item > melee weapon lookups *********/ // labels - // TODO - "item.melee-weapon.accuracy": "Accuracy", - "item.melee-weapon.critical-chance": "Critical chance", - "item.melee-weapon.critical-damage": "Critical damage", - "item.melee-weapon.damage": "Damage", - "item.melee-weapon.defense": "Defense", - "item.melee-weapon.knockback": "Knockback", - "item.melee-weapon.reach": "Reach", - "item.melee-weapon.speed": "Attack speed", + "item.melee-weapon.accuracy": "Precyzja", + "item.melee-weapon.critical-chance": "Szansa na krytyk", + "item.melee-weapon.critical-damage": "Obrażenia krytyczne", + "item.melee-weapon.damage": "Obrażenia", + "item.melee-weapon.defense": "Obrona", + "item.melee-weapon.knockback": "Odrzut", + "item.melee-weapon.reach": "Zasięg", + "item.melee-weapon.speed": "Szybkość ataku", // values - // TODO - "item.melee-weapon.critical-damage.label": "{{multiplier}} times normal damage (before player bonuses)", - "item.melee-weapon.defense.label": "{{amount}} while equipped", - "item.melee-weapon.knockback.label": "{{amount}} ({{multiplier}} times normal distance)", - "item.melee-weapon.reach.label": "{{amount}} pixels", - "item.melee-weapon.speed.shown-vs-actual": "shown: {{shownSpeed}}{{lineBreak}}actual: {{actualSpeed}}", - "item.melee-weapon.speed.summary": "{{speed}} ({{milliseconds}} milliseconds per swing frame, before player speed bonuses)", + "item.melee-weapon.critical-damage.label": "{{multiplier}} razy normalne obrażenia (bez bonusów gracza)", + "item.melee-weapon.defense.label": "{{amount}} kiedy jest wyposażony", + "item.melee-weapon.knockback.label": "{{amount}} ({{multiplier}} razy normalny dystans)", + "item.melee-weapon.reach.label": "{{amount}} piksele", + "item.melee-weapon.speed.shown-vs-actual": "pokazana: {{shownSpeed}}{{lineBreak}}rzeczywista: {{actualSpeed}}", + "item.melee-weapon.speed.summary": "{{speed}} ({{milliseconds}} milisekund za zamach, bez bonusów szybkości gracza)", /********* @@ -442,7 +439,7 @@ "item.movie-ticket.loves-movie": "Kocha ten film", "item.movie-ticket.likes-movie": "Lubi ten film", "item.movie-ticket.dislikes-movie": "Nie lubi tego filmu", - "item.movie-ticket.rejects-movie": "Won't watch movie", // TODO + "item.movie-ticket.rejects-movie": "Nie chce oglądać filmu", // values "item.movie-snack-preference.love": "{{name}} kocha to", @@ -469,7 +466,7 @@ "monster.experience": "XP", "monster.defense": "Obrona", "monster.attack": "Atak", - "monster.adventure-guild": "Gildia Poszukiwaczy", + "monster.adventure-guild": "Gildia Awanturników", // values "monster.drops.nothing": "nic", @@ -482,7 +479,7 @@ // labels "npc.birthday": "Urodziny", "npc.can-romance": "Możliwość romansu", - "npc.friendship": "Relacja", + "npc.friendship": "Przyjaźń", "npc.talked-today": "Rozmawiano dzisiaj", "npc.gifted-today": "Sprezentowano dzisiaj", "npc.gifted-this-week": "Prezenty w tym tygodniu", @@ -501,7 +498,7 @@ "npc.friendship.need-bouquet": "potrzeba bukietu na następne", "npc.friendship.need-points": "następne za {{count}} pkt", "npc.undiscovered-gift-taste": "{{count}} nieodkrytych przedmiotów", - "npc.unowned-gift-taste": "{{count}} unowned items", // TODO + "npc.unowned-gift-taste": "{{count}} nieposiadanych przedmiotów", /********* @@ -652,17 +649,17 @@ "tree.name.oak": "Dąb", "tree.name.palm": "Palma", "tree.name.pine": "Sosna", - "tree.name.mossy": "Mossy Tree", // TODO - "tree.name.mystic": "Mystic Tree", // TODO - "tree.name.unknown": "Nieznane Drzewo", + "tree.name.mossy": "Omszałe drzewo", + "tree.name.mystic": "Mistyczne drzewo", + "tree.name.unknown": "Nieznane drzewo", "tree.stage.done": "w pełni wyrośnięte", "tree.stage.partial": "{{stageName}} ({{step}} z {{max}})", "tree.next-growth.winter": "nie może rosnąć zimą poza szklarnią, chyba że nawieziono", "tree.next-growth.adjacent-trees": "nie może rosnąć, ponieważ inne drzewa są zbyt blisko", "tree.next-growth.chance": "{{chance}}% szans, że jutro wyrośnie {{stage}}", - "tree.seed.not-ready": "Not ready", // TODO - "tree.seed.probability-daily": "{{chance}}% chance of {{itemName}} each day.", // TODO - "tree.seed.probability-on-chop": "{{chance}}% chance of dropping {{itemName}} when chopped down.", // TODO + "tree.seed.not-ready": "Nie gotowe", + "tree.seed.probability-daily": "{{chance}}% szansy na {{itemName}} każdego dnia.", + "tree.seed.probability-on-chop": "{{chance}}% szansy na upuszczenie {{itemName}} po ścięciu.", // growth stages "tree.stages.seed": "nasiono", @@ -682,49 +679,46 @@ "config.force-full-screen.desc": "Czy interfejs podglądu powinien być zawsze pełnoekranowy, a nie wyśrodkowany w oknie. Jest to przydatne głównie podczas przeglądania pól data miningu.", // progression mode - // TODO "config.title.progression": "Tryb progresji", - "config.progression.show-unknown-gift-tastes.name": "Show unknown gift tastes", - "config.progression.show-unknown-gift-tastes.desc": "Whether to show gift tastes you haven't learned about in-game yet (e.g. from dialogue text or experimenting).", + "config.progression.show-unknown-gift-tastes.name": "Pokaż nieznane upodobania prezentowe", + "config.progression.show-unknown-gift-tastes.desc": "Czy pokazywać upodobania prezentowe, których jeszcze nie ${nauczyłeś¦nauczyłaś}$ się w grze (np. z tekstu dialogowego lub eksperymentując).", - "config.progression.show-unknown-recipes.name": "Show unknown recipes", - "config.progression.show-unknown-recipes.desc": "Whether to show recipes you haven't learned in-game yet.", + "config.progression.show-unknown-recipes.name": "Pokaż nieznane przepisy", + "config.progression.show-unknown-recipes.desc": "Czy pokazywać przepisy, których jeszcze nie ${nauczyłeś¦nauczyłaś}$ się w grze.", - "config.progression.show-puzzle-solutions.name": "Show puzzle solutions", - "config.progression.show-puzzle-solutions.desc": "Whether to show puzzle solutions.", + "config.progression.show-puzzle-solutions.name": "Pokaż rozwiązania zagadek", + "config.progression.show-puzzle-solutions.desc": "Czy pokazywać rozwiązania zagadek.", // gift tastes - // TODO - "config.title.gift-tastes": "Gift tastes", - "config.show-gift-tastes.loved.name": "Show loved gifts", - "config.show-gift-tastes.loved.desc": "Whether to show loved gifts in NPC and item lookups.", - "config.show-gift-tastes.liked.name": "Show liked gifts", - "config.show-gift-tastes.liked.desc": "Whether to show liked gifts in NPC and item lookups.", - "config.show-gift-tastes.neutral.name": "Show neutral gifts", - "config.show-gift-tastes.neutral.desc": "Whether to show neutral gifts in NPC and item lookups.", - "config.show-gift-tastes.disliked.name": "Show disliked gifts", - "config.show-gift-tastes.disliked.desc": "Whether to show disliked gifts in NPC and item lookups.", - "config.show-gift-tastes.hated.name": "Show hated gifts", - "config.show-gift-tastes.hated.desc": "Whether to show hated gifts in NPC and item lookups.", - - "config.show-unowned-gifts.name": "Show unowned gift tastes", - "config.show-unowned-gifts.desc": "Whether to show gift tastes for items that the player doesn't own somewhere in the world.", - - "config.highlight-unrevealed-gift-tastes.name": "Wyróżnij nieodkryte upodobania", + "config.title.gift-tastes": "Upodobania prezentowe", + "config.show-gift-tastes.loved.name": "Pokaż ukochane prezenty", + "config.show-gift-tastes.loved.desc": "Czy pokazywać ukochane prezenty w podglądzie NPC i przedmiotu.", + "config.show-gift-tastes.liked.name": "Pokaż lubiane prezenty", + "config.show-gift-tastes.liked.desc": "Czy pokazywać lubiane prezenty w podglądzie NPC i przedmiotu.", + "config.show-gift-tastes.neutral.name": "Pokaż neutralne prezenty", + "config.show-gift-tastes.neutral.desc": "Czy pokazywać neutralne prezenty w podglądzie NPC i przedmiotu.", + "config.show-gift-tastes.disliked.name": "Pokaż nielubiane prezenty", + "config.show-gift-tastes.disliked.desc": "Czy pokazywać nielubiane prezenty w podglądzie NPC i przedmiotu.", + "config.show-gift-tastes.hated.name": "Pokaż znienawidzone prezenty", + "config.show-gift-tastes.hated.desc": "Czy pokazywać znienawidzone prezenty w podglądzie NPC i przedmiotu.", + + "config.show-unowned-gifts.name": "Pokaż nieposiadane prezenty", + "config.show-unowned-gifts.desc": "Czy pokazywać upodobania prezentowe dla przedmiotów, których gracz nie posiada gdziekolwiek w świecie.", + + "config.highlight-unrevealed-gift-tastes.name": "Wyróżnij nieodkryte prezenty", "config.highlight-unrevealed-gift-tastes.desc": "Czy wyróżniać przedmioty w upodobaniach prezentowych, które nie zostały odkryte w profilu NPC. Gdy ta opcja jest włączona, nieodkryte upodobania prezentowe będą pogrubione.", // collapse fields - // TODO - "config.title.collapse-fields": "Collapse large fields", + "config.title.collapse-fields": "Zwijanie dużych pól", - "config.collapse-fields.enabled.name": "Enabled", - "config.collapse-fields.enabled.desc": "Whether to collapse large fields, so the lookup menu will replace the list with a clickable 'show X values' link to expand it.", + "config.collapse-fields.enabled.name": "Włączone", + "config.collapse-fields.enabled.desc": "Czy zwinąć duże pola, tak aby menu podglądu zastąpiło listę klikalnym linkiem 'pokaż X wyników', aby ją rozwinąć.", - "config.collapse-fields.building-recipes.name": "Building lookup: recipes", - "config.collapse-fields.item-recipes.name": "Item lookup: recipes", - "config.collapse-fields.npc-gift-tastes.name": "NPC lookup: gift tastes", - "config.collapse-fields.any.desc": "If the field contains this many values, the lookup menu will replace the list with a clickable 'show X values' link to expand it.", + "config.collapse-fields.building-recipes.name": "Podgląd budynku: przepisy", + "config.collapse-fields.item-recipes.name": "Podgląd przedmiotu: przepisy", + "config.collapse-fields.npc-gift-tastes.name": "Podgląd NPC: upodobana prezentowe", + "config.collapse-fields.any.desc": "Jeśli pole zawiera wiele wyników, menu wyszukiwania zastąpi listę klikalnym linkiem 'pokaż X wyników', aby ją rozwinąć.", // advanced options "config.title.advanced-options": "Opcje zaawansowane", @@ -732,8 +726,8 @@ "config.tile-lookups.desc": "Czy uwzględnić kafelki mapy jako możliwe cele podglądu.", "config.data-mining-fields.name": "Pokaż pola data miningu", "config.data-mining-fields.desc": "Czy pokazywać surowe dane przydatne dla data minerów (jako oddzielne pola na dole wyników podglądu). Jest to zaawansowana funkcja, która nie jest przeznaczona dla większości graczy.", - "config.show-invalid-recipes.name": "Show invalid recipes", // TODO - "config.show-invalid-recipes.desc": "Whether to show recipes which require or produce broken items.", // TODO + "config.show-invalid-recipes.name": "Pokaż nieprawidłowe przepisy", + "config.show-invalid-recipes.desc": "Czy mają być wyświetlane przepisy, które wymagają lub tworzą zepsute przedmioty.", "config.target-redirection.name": "Przekieruj docelowo", "config.target-redirection.desc": "W niektórych przypadkach gra tworzy tymczasową postać, która reprezentuje inną. Na przykład, Abigail w kopalni jest w rzeczywistości tymczasowym NPC o nazwie 'AbigailMine', więc jej podgląd tam nie pokaże prawdziwych informacji o Abigail. Gdy ta opcja jest włączona, Lookup Anything wyszuka zamiast tego oryginalną Abigail.", "config.scroll-amount.name": "Szybkość przewijania", From c3cccae38a38170b205153258272c945b64ebc3b Mon Sep 17 00:00:00 2001 From: rokugin Date: Mon, 7 Oct 2024 15:45:21 -0700 Subject: [PATCH 03/16] [Data Layers]Fix NRE when Ultimate Fertilizer's is installed --- DataLayers/Layers/Crops/CropFertilizerLayer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DataLayers/Layers/Crops/CropFertilizerLayer.cs b/DataLayers/Layers/Crops/CropFertilizerLayer.cs index 194598808..24d61012a 100644 --- a/DataLayers/Layers/Crops/CropFertilizerLayer.cs +++ b/DataLayers/Layers/Crops/CropFertilizerLayer.cs @@ -137,7 +137,8 @@ select tile.Value if (this.Mods.MultiFertilizer.IsLoaded) applied = [.. this.Mods.MultiFertilizer.GetAppliedFertilizers(dirt)]; else if (this.HasUltimateFertilizer) - applied = [.. dirt.fertilizer.Value.Split('|', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)]; // Ultimate Fertilizer allows multiple fertilizers + if (dirt.fertilizer.Value != null) + applied = [.. dirt.fertilizer.Value.Split('|', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)]; // Ultimate Fertilizer allows multiple fertilizers else if (CommonHelper.IsItemId(dirt.fertilizer.Value, allowZero: false)) applied = [dirt.fertilizer.Value]; } From 1563ac71dff6a262e413c6c3091626971e5644ba Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 8 Oct 2024 19:54:54 -0400 Subject: [PATCH 04/16] use more consistently --- .../Framework/GameLocationNameComparer.cs | 8 +-- Automate/Framework/GenericObjectMachine.cs | 4 +- .../Machines/Buildings/FishPondMachine.cs | 8 +-- .../Machines/Buildings/JunimoHutMachine.cs | 8 +-- .../Machines/Buildings/ShippingBinMachine.cs | 8 +-- .../Machines/DataBasedObjectMachine.cs | 2 +- .../Machines/Objects/AutoGrabberMachine.cs | 8 +-- .../Machines/Objects/FeedHopperMachine.cs | 8 +-- .../Objects/MiniShippingBinMachine.cs | 8 +-- .../Machines/Objects/TapperMachine.cs | 6 +- .../Machines/TerrainFeatures/BushMachine.cs | 8 +-- .../TerrainFeatures/FruitTreeMachine.cs | 8 +-- .../Machines/TerrainFeatures/TreeMachine.cs | 8 +-- .../Machines/Tiles/TrashCanMachine.cs | 8 +-- Automate/Framework/OverlayMenu.cs | 3 +- Automate/ModEntry.cs | 49 ++++----------- .../Menus/Overlays/BaseChestOverlay.cs | 25 +++----- ChestsAnywhere/Menus/Overlays/ChestOverlay.cs | 18 ++---- .../Menus/Overlays/ShopMenuOverlay.cs | 3 +- ChestsAnywhere/ModEntry.cs | 24 ++----- Common/DrawHelper.cs | 2 +- Common/Integrations/BaseIntegration.cs | 3 +- Common/UI/BaseOverlay.cs | 34 +++------- Common/UI/Dropdown.cs | 4 +- Common/UI/DropdownList.cs | 4 +- Common/Utilities/ObjectReferenceComparer.cs | 8 +-- .../Framework/Commands/PatchInfo.cs | 2 +- ContentPatcher/Framework/DebugOverlay.cs | 3 +- .../Lexing/LexTokens/LexTokenInput.cs | 2 +- .../Lexing/LexTokens/LexTokenLiteral.cs | 2 +- .../Lexing/LexTokens/LexTokenToken.cs | 2 +- .../Locations/CustomLocationManager.cs | 3 +- ContentPatcher/Framework/PatchManager.cs | 2 +- ContentPatcher/Framework/ScreenManager.cs | 3 +- .../ModConvention/ConventionDelegates.cs | 2 +- .../ModConvention/ConventionWrapper.cs | 2 +- .../TriggerActions/MigrateIdsAction.cs | 2 +- .../StardewValley_1_3_36_Validator.cs | 7 +-- ContentPatcher/ModEntry.cs | 37 +++-------- CropsAnytimeAnywhere/ModEntry.cs | 7 +-- DataLayers/Layers/AccessibleLayer.cs | 6 +- DataLayers/Layers/BuildableLayer.cs | 6 +- DataLayers/Layers/Coverage/BeeHouseLayer.cs | 6 +- DataLayers/Layers/Coverage/JunimoHutLayer.cs | 6 +- DataLayers/Layers/Coverage/ScarecrowLayer.cs | 6 +- DataLayers/Layers/Coverage/SprinklerLayer.cs | 6 +- .../Layers/Crops/CropFertilizerLayer.cs | 6 +- DataLayers/Layers/Crops/CropHarvestLayer.cs | 6 +- .../Layers/Crops/CropPaddyWaterLayer.cs | 6 +- DataLayers/Layers/Crops/CropWaterLayer.cs | 6 +- DataLayers/Layers/GridLayer.cs | 6 +- DataLayers/Layers/MachineLayer.cs | 6 +- DataLayers/Layers/TillableLayer.cs | 6 +- DataLayers/ModEntry.cs | 23 ++----- DebugMode/ModEntry.cs | 16 ++--- FastAnimations/Handlers/ReadBookHandler.cs | 1 + FastAnimations/ModEntry.cs | 10 --- HorseFluteAnywhere/ModEntry.cs | 19 ++---- LookupAnything/Components/LookupMenu.cs | 36 ++++------- LookupAnything/Components/SearchMenu.cs | 29 +++------ LookupAnything/Components/SearchTextBox.cs | 2 +- .../Fields/CharacterFriendshipField.cs | 7 +-- .../Framework/Fields/CheckboxListField.cs | 7 +-- LookupAnything/Framework/Fields/ColorField.cs | 7 +-- .../Framework/Fields/FishPondDropsField.cs | 7 +-- .../Framework/Fields/ItemIconListField.cs | 7 +-- .../Framework/Fields/PercentageBarField.cs | 7 +-- .../Framework/Fields/SkillBarField.cs | 7 +-- .../Lookups/Buildings/BuildingSubject.cs | 10 +-- .../Lookups/Buildings/BuildingTarget.cs | 9 +-- .../Lookups/Characters/CharacterSubject.cs | 10 +-- .../Lookups/Characters/CharacterTarget.cs | 9 +-- .../Lookups/Characters/FarmAnimalSubject.cs | 10 +-- .../Lookups/Characters/FarmAnimalTarget.cs | 9 +-- .../Lookups/Characters/FarmerSubject.cs | 10 +-- .../Lookups/Characters/FarmerTarget.cs | 9 +-- .../Framework/Lookups/Items/CropTarget.cs | 9 +-- .../Framework/Lookups/Items/ItemSubject.cs | 10 +-- .../Lookups/Items/MovieSnackSubject.cs | 10 +-- .../Framework/Lookups/Items/ObjectTarget.cs | 9 +-- .../Lookups/TerrainFeatures/BushSubject.cs | 10 +-- .../Lookups/TerrainFeatures/BushTarget.cs | 10 +-- .../TerrainFeatures/FruitTreeSubject.cs | 11 +--- .../TerrainFeatures/FruitTreeTarget.cs | 9 +-- .../Lookups/TerrainFeatures/TreeSubject.cs | 10 +-- .../Lookups/TerrainFeatures/TreeTarget.cs | 9 +-- .../Lookups/Tiles/CrystalCavePuzzleSubject.cs | 2 +- .../Tiles/IslandMermaidPuzzleSubject.cs | 2 +- .../Tiles/IslandShrinePuzzleSubject.cs | 2 +- .../Framework/Lookups/Tiles/TileSubject.cs | 10 +-- .../Framework/Lookups/Tiles/TileTarget.cs | 2 +- LookupAnything/ModEntry.cs | 23 ++----- NoclipMode/ModEntry.cs | 11 +--- SkipIntro/ModEntry.cs | 15 ++--- SmallBeachFarm/ModEntry.cs | 8 +-- TestMod/ModEntry.cs | 11 +--- .../Framework/Attachments/AxeAttachment.cs | 15 +---- .../Framework/Attachments/CustomAttachment.cs | 15 +---- .../Attachments/FertilizerAttachment.cs | 15 +---- .../Attachments/GrassStarterAttachment.cs | 15 +---- .../Framework/Attachments/HoeAttachment.cs | 15 +---- .../Attachments/MeleeBluntAttachment.cs | 15 +---- .../Attachments/MeleeDaggerAttachment.cs | 15 +---- .../Attachments/MeleeSwordAttachment.cs | 15 +---- .../Attachments/MilkPailAttachment.cs | 15 +---- .../Attachments/PickaxeAttachment.cs | 15 +---- .../Framework/Attachments/ScytheAttachment.cs | 18 +----- .../Framework/Attachments/SeedAttachment.cs | 15 +---- .../Framework/Attachments/ShearsAttachment.cs | 15 +---- .../Attachments/SlingshotAttachment.cs | 15 +---- .../Attachments/WateringCanAttachment.cs | 15 +---- TractorMod/Framework/AudioManager.cs | 3 +- .../ModAttachments/SeedBagAttachment.cs | 15 +---- TractorMod/Framework/TextureManager.cs | 3 +- TractorMod/ModEntry.cs | 63 +++++-------------- _archived/RotateToolbar/ModEntry.cs | 7 +-- _archived/TheLongNight/ModEntry.cs | 7 +-- 117 files changed, 302 insertions(+), 899 deletions(-) diff --git a/Automate/Framework/GameLocationNameComparer.cs b/Automate/Framework/GameLocationNameComparer.cs index 6005156ad..cebc163c4 100644 --- a/Automate/Framework/GameLocationNameComparer.cs +++ b/Automate/Framework/GameLocationNameComparer.cs @@ -9,10 +9,7 @@ internal class GameLocationNameComparer : IEqualityComparer /********* ** Public methods *********/ - /// Determines whether the specified objects are equal. - /// true if the specified objects are equal; otherwise, false. - /// The first object to compare. - /// The second object to compare. + /// public bool Equals(GameLocation? left, GameLocation? right) { string? leftName = left?.NameOrUniqueName; @@ -27,8 +24,7 @@ public bool Equals(GameLocation? left, GameLocation? right) return leftName == rightName; } - /// Get a hash code for the specified object. - /// The value. + /// public int GetHashCode(GameLocation obj) { return (obj.NameOrUniqueName ?? string.Empty).GetHashCode(); diff --git a/Automate/Framework/GenericObjectMachine.cs b/Automate/Framework/GenericObjectMachine.cs index d27fdea19..20f75b3be 100644 --- a/Automate/Framework/GenericObjectMachine.cs +++ b/Automate/Framework/GenericObjectMachine.cs @@ -28,13 +28,13 @@ internal abstract class GenericObjectMachine : BaseMachine w /********* ** Public methods *********/ - /// Get the machine's processing state. + /// public override MachineState GetState() { return this.GetGenericState(); } - /// Get the output item. + /// public override ITrackedStack? GetOutput() { return this.GetTracked(this.Machine.heldObject.Value, onEmpty: this.GenericReset); diff --git a/Automate/Framework/Machines/Buildings/FishPondMachine.cs b/Automate/Framework/Machines/Buildings/FishPondMachine.cs index 0708b9499..29f5517ee 100644 --- a/Automate/Framework/Machines/Buildings/FishPondMachine.cs +++ b/Automate/Framework/Machines/Buildings/FishPondMachine.cs @@ -17,7 +17,7 @@ internal class FishPondMachine : BaseMachineForBuilding public FishPondMachine(FishPond pond, GameLocation location) : base(pond, location, BaseMachine.GetTileAreaFor(pond)) { } - /// Get the machine's processing state. + /// public override MachineState GetState() { if (this.Machine.isUnderConstruction()) @@ -28,15 +28,13 @@ public override MachineState GetState() : MachineState.Processing; } - /// Get the machine output. + /// public override ITrackedStack? GetOutput() { return this.GetTracked(this.Machine.output.Value, onEmpty: this.OnOutputTaken); } - /// Provide input to the machine. - /// The available items. - /// Returns whether the machine started processing an item. + /// public override bool SetInput(IStorage input) { return false; // no input diff --git a/Automate/Framework/Machines/Buildings/JunimoHutMachine.cs b/Automate/Framework/Machines/Buildings/JunimoHutMachine.cs index 7af6a71a4..83d12b390 100644 --- a/Automate/Framework/Machines/Buildings/JunimoHutMachine.cs +++ b/Automate/Framework/Machines/Buildings/JunimoHutMachine.cs @@ -57,7 +57,7 @@ gemBehavior is not JunimoHutBehavior.MoveIntoChests || seedBehavior is not JunimoHutBehavior.MoveIntoChests; } - /// Get the machine's processing state. + /// public override MachineState GetState() { if (this.Machine.isUnderConstruction()) @@ -71,15 +71,13 @@ public override MachineState GetState() : MachineState.Processing; } - /// Get the machine output. + /// public override ITrackedStack? GetOutput() { return this.GetTracked(this.GetNextOutput(), onEmpty: this.OnOutputTaken); } - /// Provide input to the machine. - /// The available items. - /// Returns whether the machine started processing an item. + /// public override bool SetInput(IStorage input) { if (!this.HasInput) diff --git a/Automate/Framework/Machines/Buildings/ShippingBinMachine.cs b/Automate/Framework/Machines/Buildings/ShippingBinMachine.cs index 73d15bcf4..0faafecbe 100644 --- a/Automate/Framework/Machines/Buildings/ShippingBinMachine.cs +++ b/Automate/Framework/Machines/Buildings/ShippingBinMachine.cs @@ -47,7 +47,7 @@ public ShippingBinMachine(ShippingBin bin, GameLocation location) this.Bin = bin; } - /// Get the machine's processing state. + /// public override MachineState GetState() { if (this.Bin?.isUnderConstruction() == true) @@ -56,15 +56,13 @@ public override MachineState GetState() return MachineState.Empty; // always accepts items } - /// Get the output item. + /// public override ITrackedStack? GetOutput() { return null; // no output } - /// Provide input to the machine. - /// The available items. - /// Returns whether the machine started processing an item. + /// public override bool SetInput(IStorage input) { // get next item diff --git a/Automate/Framework/Machines/DataBasedObjectMachine.cs b/Automate/Framework/Machines/DataBasedObjectMachine.cs index 9fee71d7b..d97f8cdac 100644 --- a/Automate/Framework/Machines/DataBasedObjectMachine.cs +++ b/Automate/Framework/Machines/DataBasedObjectMachine.cs @@ -70,7 +70,7 @@ public override bool SetInput(IStorage input) return addedInput; } - /// Get the output item. + /// /// This implementation is based on . public override ITrackedStack? GetOutput() { diff --git a/Automate/Framework/Machines/Objects/AutoGrabberMachine.cs b/Automate/Framework/Machines/Objects/AutoGrabberMachine.cs index 18d328a3f..5687fc125 100644 --- a/Automate/Framework/Machines/Objects/AutoGrabberMachine.cs +++ b/Automate/Framework/Machines/Objects/AutoGrabberMachine.cs @@ -20,7 +20,7 @@ internal class AutoGrabberMachine : GenericObjectMachine public AutoGrabberMachine(SObject machine, GameLocation location, Vector2 tile) : base(machine, location, tile) { } - /// Get the machine's processing state. + /// public override MachineState GetState() { return this.GetNextOutput() != null @@ -28,15 +28,13 @@ public override MachineState GetState() : MachineState.Processing; } - /// Get the output item. + /// public override ITrackedStack? GetOutput() { return this.GetTracked(this.GetNextOutput(), onEmpty: this.OnOutputTaken); } - /// Provide input to the machine. - /// The available items. - /// Returns whether the machine started processing an item. + /// public override bool SetInput(IStorage input) { return false; diff --git a/Automate/Framework/Machines/Objects/FeedHopperMachine.cs b/Automate/Framework/Machines/Objects/FeedHopperMachine.cs index 78eaca1e4..f5bdf9767 100644 --- a/Automate/Framework/Machines/Objects/FeedHopperMachine.cs +++ b/Automate/Framework/Machines/Objects/FeedHopperMachine.cs @@ -26,7 +26,7 @@ public FeedHopperMachine(GameLocation location, Vector2 tile) public FeedHopperMachine(Building silo, GameLocation location) : base(location, BaseMachine.GetTileAreaFor(silo)) { } - /// Get the machine's processing state. + /// public override MachineState GetState() { return this.CanStoreHay(out _, out _) @@ -34,15 +34,13 @@ public override MachineState GetState() : MachineState.Disabled; } - /// Get the output item. + /// public override ITrackedStack? GetOutput() { return null; } - /// Provide input to the machine. - /// The available items. - /// Returns whether the machine started processing an item. + /// public override bool SetInput(IStorage input) { if (!this.CanStoreHay(out GameLocation location, out int freeSpace)) diff --git a/Automate/Framework/Machines/Objects/MiniShippingBinMachine.cs b/Automate/Framework/Machines/Objects/MiniShippingBinMachine.cs index 3b3982088..047f4b45a 100644 --- a/Automate/Framework/Machines/Objects/MiniShippingBinMachine.cs +++ b/Automate/Framework/Machines/Objects/MiniShippingBinMachine.cs @@ -29,21 +29,19 @@ public MiniShippingBinMachine(Chest miniBin, GameLocation location) this.MiniBin = new ChestContainer(miniBin, location, miniBin.TileLocation, migrateLegacyOptions: false); } - /// Get the machine's processing state. + /// public override MachineState GetState() { return MachineState.Empty; // always accepts items } - /// Get the output item. + /// public override ITrackedStack? GetOutput() { return null; // no output } - /// Provide input to the machine. - /// The available items. - /// Returns whether the machine started processing an item. + /// public override bool SetInput(IStorage input) { foreach (ITrackedStack tracker in input.GetItems().Where(p => p.Sample.canBeShipped())) diff --git a/Automate/Framework/Machines/Objects/TapperMachine.cs b/Automate/Framework/Machines/Objects/TapperMachine.cs index 3ead729d5..45087b4c1 100644 --- a/Automate/Framework/Machines/Objects/TapperMachine.cs +++ b/Automate/Framework/Machines/Objects/TapperMachine.cs @@ -30,15 +30,13 @@ public TapperMachine(SObject machine, GameLocation location, Vector2 tile, Tree this.Tree = tree; } - /// Get the output item. + /// public override ITrackedStack? GetOutput() { return this.GetTracked(this.Machine.heldObject.Value, onEmpty: this.Reset); } - /// Provide input to the machine. - /// The available items. - /// Returns whether the machine started processing an item. + /// public override bool SetInput(IStorage input) { return false; // no input diff --git a/Automate/Framework/Machines/TerrainFeatures/BushMachine.cs b/Automate/Framework/Machines/TerrainFeatures/BushMachine.cs index 86d0523d7..13ea54dfd 100644 --- a/Automate/Framework/Machines/TerrainFeatures/BushMachine.cs +++ b/Automate/Framework/Machines/TerrainFeatures/BushMachine.cs @@ -50,7 +50,7 @@ public BushMachine(Bush bush, GameLocation location, Rectangle tileArea) ); } - /// Get the output item. + /// public override ITrackedStack GetOutput() { string itemId = this.Machine.GetShakeOffItem(); @@ -65,7 +65,7 @@ public override ITrackedStack GetOutput() return new TrackedItem(ItemRegistry.Create(itemId, count, quality), onReduced: this.OnOutputReduced); } - /// Get the machine's processing state. + /// public override MachineState GetState() { if (!this.IsInSeason.Value) @@ -76,9 +76,7 @@ public override MachineState GetState() : MachineState.Processing; } - /// Provide input to the machine. - /// The available items. - /// Returns whether the machine started processing an item. + /// public override bool SetInput(IStorage input) { return false; // no input required diff --git a/Automate/Framework/Machines/TerrainFeatures/FruitTreeMachine.cs b/Automate/Framework/Machines/TerrainFeatures/FruitTreeMachine.cs index a51d4eab5..eaa198eea 100644 --- a/Automate/Framework/Machines/TerrainFeatures/FruitTreeMachine.cs +++ b/Automate/Framework/Machines/TerrainFeatures/FruitTreeMachine.cs @@ -19,7 +19,7 @@ internal class FruitTreeMachine : BaseMachine public FruitTreeMachine(FruitTree tree, GameLocation location, Vector2 tile) : base(tree, location, BaseMachine.GetTileAreaFor(tile)) { } - /// Get the machine's processing state. + /// public override MachineState GetState() { if (this.Machine.growthStage.Value < FruitTree.treeStage) @@ -30,7 +30,7 @@ public override MachineState GetState() : MachineState.Processing; } - /// Get the output item. + /// public override ITrackedStack GetOutput() { FruitTree tree = this.Machine; @@ -43,9 +43,7 @@ public override ITrackedStack GetOutput() return new TrackedItem(tree.fruit[^1], onReduced: item => tree.fruit.Remove(item)); } - /// Provide input to the machine. - /// The available items. - /// Returns whether the machine started processing an item. + /// public override bool SetInput(IStorage input) { return false; // no input diff --git a/Automate/Framework/Machines/TerrainFeatures/TreeMachine.cs b/Automate/Framework/Machines/TerrainFeatures/TreeMachine.cs index 9440fb05d..f9097b149 100644 --- a/Automate/Framework/Machines/TerrainFeatures/TreeMachine.cs +++ b/Automate/Framework/Machines/TerrainFeatures/TreeMachine.cs @@ -58,7 +58,7 @@ public TreeMachine(Tree tree, GameLocation location, Vector2 tile, bool collectM ); } - /// Get the machine's processing state. + /// public override MachineState GetState() { if (this.Machine.growthStage.Value < Tree.treeStage || this.Machine.stump.Value) @@ -69,7 +69,7 @@ public override MachineState GetState() : MachineState.Processing; } - /// Get the output item. + /// public override ITrackedStack? GetOutput() { Tree tree = this.Machine; @@ -102,9 +102,7 @@ public override MachineState GetState() return null; } - /// Provide input to the machine. - /// The available items. - /// Returns whether the machine started processing an item. + /// public override bool SetInput(IStorage input) { return false; // no input diff --git a/Automate/Framework/Machines/Tiles/TrashCanMachine.cs b/Automate/Framework/Machines/Tiles/TrashCanMachine.cs index 123577c9d..8de7777d7 100644 --- a/Automate/Framework/Machines/Tiles/TrashCanMachine.cs +++ b/Automate/Framework/Machines/Tiles/TrashCanMachine.cs @@ -28,7 +28,7 @@ public TrashCanMachine(GameLocation location, Vector2 tile, string trashCanId) this.TrashCanId = this.GetActualTrashCanId(trashCanId); } - /// Get the machine's processing state. + /// public override MachineState GetState() { if (Game1.netWorldState.Value.CheckedGarbage.Contains(this.TrashCanId)) @@ -37,7 +37,7 @@ public override MachineState GetState() return MachineState.Done; } - /// Get the output item. + /// public override ITrackedStack? GetOutput() { // get item @@ -50,9 +50,7 @@ public override MachineState GetState() return null; } - /// Provide input to the machine. - /// The available items. - /// Returns whether the machine started processing an item. + /// public override bool SetInput(IStorage input) { return false; // no input diff --git a/Automate/Framework/OverlayMenu.cs b/Automate/Framework/OverlayMenu.cs index 62dbf42ea..5f247b03d 100644 --- a/Automate/Framework/OverlayMenu.cs +++ b/Automate/Framework/OverlayMenu.cs @@ -51,8 +51,7 @@ public OverlayMenu(IModEvents events, IInputHelper inputHelper, IReflectionHelpe /********* ** Protected *********/ - /// Draw the overlay to the screen under the UI. - /// The sprite batch being drawn. + /// [SuppressMessage("ReSharper", "PossibleLossOfFraction", Justification = "Deliberate discarded for conversion to tile coordinates.")] protected override void DrawWorld(SpriteBatch spriteBatch) { diff --git a/Automate/ModEntry.cs b/Automate/ModEntry.cs index c0055b0c7..1cac9d675 100644 --- a/Automate/ModEntry.cs +++ b/Automate/ModEntry.cs @@ -62,8 +62,7 @@ internal class ModEntry : Mod /********* ** Public methods *********/ - /// The mod entry point, called after the mod is first loaded. - /// Provides methods for interacting with the mod directory, such as read/writing a config file or custom JSON files. + /// public override void Entry(IModHelper helper) { I18n.Init(helper.Translation); @@ -127,7 +126,7 @@ public override void Entry(IModHelper helper) this.ReportMissingBridgeMods(this.Data.SuggestedIntegrations); } - /// Get an API that other mods can access. This is always called after . + /// public override object GetApi() { return new AutomateAPI(this.Monitor, this.MachineManager); @@ -140,9 +139,7 @@ public override object GetApi() /**** ** Event handlers ****/ - /// - /// The event sender. - /// The event data. + /// private void OnSaveLoaded(object? sender, SaveLoadedEventArgs e) { // disable if secondary player @@ -160,9 +157,7 @@ private void OnSaveLoaded(object? sender, SaveLoadedEventArgs e) } } - /// - /// The event sender. - /// The event data. + /// private void OnDayStarted(object? sender, DayStartedEventArgs e) { // reset machine state @@ -176,18 +171,14 @@ private void OnDayStarted(object? sender, DayStartedEventArgs e) this.DisableOverlay(); } - /// - /// The event sender. - /// The event data. + /// private void OnWarped(object? sender, WarpedEventArgs e) { if (e.IsLocalPlayer) this.ResetOverlayIfShown(); } - /// - /// The event sender. - /// The event data. + /// private void OnLocationListChanged(object? sender, LocationListChangedEventArgs e) { if (!this.EnableAutomationChangeTracking) @@ -208,9 +199,7 @@ private void OnLocationListChanged(object? sender, LocationListChangedEventArgs } } - /// - /// The event sender. - /// The event data. + /// private void OnBuildingListChanged(object? sender, BuildingListChangedEventArgs e) { if (!this.EnableAutomationChangeTracking || this.MachineManager.IsReloadQueued(e.Location)) @@ -223,9 +212,7 @@ private void OnBuildingListChanged(object? sender, BuildingListChangedEventArgs ); } - /// - /// The event sender. - /// The event data. + /// private void OnObjectListChanged(object? sender, ObjectListChangedEventArgs e) { if (!this.EnableAutomationChangeTracking || this.MachineManager.IsReloadQueued(e.Location)) @@ -238,9 +225,7 @@ private void OnObjectListChanged(object? sender, ObjectListChangedEventArgs e) ); } - /// - /// The event sender. - /// The event data. + /// private void OnTerrainFeatureListChanged(object? sender, TerrainFeatureListChangedEventArgs e) { if (!this.EnableAutomationChangeTracking || this.MachineManager.IsReloadQueued(e.Location)) @@ -253,9 +238,7 @@ private void OnTerrainFeatureListChanged(object? sender, TerrainFeatureListChang ); } - /// - /// The event sender. - /// The event data. + /// private void OnLargeTerrainFeatureListChanged(object? sender, LargeTerrainFeatureListChangedEventArgs e) { if (!this.EnableAutomationChangeTracking || this.MachineManager.IsReloadQueued(e.Location)) @@ -268,9 +251,7 @@ private void OnLargeTerrainFeatureListChanged(object? sender, LargeTerrainFeatur ); } - /// - /// The event sender. - /// The event data. + /// private void OnUpdateTicked(object? sender, UpdateTickedEventArgs e) { // add Generic Mod Config Menu integration @@ -319,9 +300,7 @@ private void OnUpdateTicked(object? sender, UpdateTickedEventArgs e) } } - /// - /// The event sender. - /// The event data. + /// private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) { if (!this.Config.Enabled) // don't check EnableAutomation, since overlay is still available for farmhands @@ -344,9 +323,7 @@ private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) } } - /// - /// The event sender. - /// The event data. + /// private void OnModMessageReceived(object? sender, ModMessageReceivedEventArgs e) { // update automation if chest options changed diff --git a/ChestsAnywhere/Menus/Overlays/BaseChestOverlay.cs b/ChestsAnywhere/Menus/Overlays/BaseChestOverlay.cs index 3f45b4899..6264c8c30 100644 --- a/ChestsAnywhere/Menus/Overlays/BaseChestOverlay.cs +++ b/ChestsAnywhere/Menus/Overlays/BaseChestOverlay.cs @@ -160,7 +160,7 @@ public void SelectChest(ManagedChest chest) this.OnChestSelected?.Invoke(chest); } - /// Release all resources. + /// public override void Dispose() { this.OnAutomateOptionsChanged = null; @@ -202,8 +202,7 @@ protected BaseChestOverlay(IClickableMenu menu, ManagedChest chest, ManagedChest this.ReinitializeBaseComponents(); } - /// Draw the overlay to the screen over the UI. - /// The sprite batch being drawn. + /// protected override void DrawUi(SpriteBatch batch) { if (this.DrawCount == 0) @@ -313,15 +312,13 @@ void DrawButtons(int yOffset) /**** ** Event handlers ****/ - /// The method invoked when the player resizes the game window. + /// protected override void ReceiveGameWindowResized() { this.ReinitializeComponents(); } - /// - /// The event sender. - /// The event data. + /// protected override void ReceiveButtonsChanged(object? sender, ButtonsChangedEventArgs e) { if (!this.IsInitialized) @@ -381,9 +378,7 @@ protected void SuppressAll(IEnumerable buttons) this.InputHelper.Suppress(button); } - /// The method invoked when the player scrolls the dropdown using the mouse wheel. - /// The scroll direction. - /// Whether the event has been handled and shouldn't be propagated further. + /// protected override bool ReceiveScrollWheelAction(int amount) { if (!this.IsInitialized) @@ -428,10 +423,7 @@ protected override bool ReceiveScrollWheelAction(int amount) } } - /// The method invoked when the player left-clicks. - /// The X-position of the cursor. - /// The Y-position of the cursor. - /// Whether the event has been handled and shouldn't be propagated further. + /// protected override bool ReceiveLeftClick(int x, int y) { if (!this.IsInitialized) @@ -543,10 +535,7 @@ protected override bool ReceiveLeftClick(int x, int y) } } - /// The method invoked when the cursor is hovered. - /// The cursor's X position. - /// The cursor's Y position. - /// Whether the event has been handled and shouldn't be propagated further. + /// protected override bool ReceiveCursorHover(int x, int y) { if (!this.IsInitialized) diff --git a/ChestsAnywhere/Menus/Overlays/ChestOverlay.cs b/ChestsAnywhere/Menus/Overlays/ChestOverlay.cs index dc466327d..a0cd2418c 100644 --- a/ChestsAnywhere/Menus/Overlays/ChestOverlay.cs +++ b/ChestsAnywhere/Menus/Overlays/ChestOverlay.cs @@ -76,10 +76,7 @@ protected override void Update() } } - /// The method invoked when the player left-clicks. - /// The X-position of the cursor. - /// The Y-position of the cursor. - /// Whether the event has been handled and shouldn't be propagated further. + /// protected override bool ReceiveLeftClick(int x, int y) { if (this.IsInitialized) @@ -117,10 +114,7 @@ protected override bool ReceiveLeftClick(int x, int y) return base.ReceiveLeftClick(x, y); } - /// The method invoked when the cursor is hovered. - /// The cursor's X position. - /// The cursor's Y position. - /// Whether the event has been handled and shouldn't be propagated further. + /// protected override bool ReceiveCursorHover(int x, int y) { if (this.IsInitialized) @@ -132,8 +126,7 @@ protected override bool ReceiveCursorHover(int x, int y) return base.ReceiveCursorHover(x, y); } - /// Draw the overlay to the screen over the UI. - /// The sprite batch being drawn. + /// protected override void DrawUi(SpriteBatch batch) { if (!this.ActiveElement.HasFlag(Element.EditForm)) @@ -145,7 +138,7 @@ protected override void DrawUi(SpriteBatch batch) base.DrawUi(batch); // run base logic last, to draw cursor over everything else } - /// Initialize the edit-chest overlay for rendering. + /// protected override void ReinitializeComponents() { base.ReinitializeComponents(); @@ -167,8 +160,7 @@ protected override void ReinitializeComponents() this.SortInventoryButton = null; } - /// Set whether the chest or inventory items should be clickable. - /// Whether items should be clickable. + /// protected override void SetItemsClickable(bool clickable) { if (clickable) diff --git a/ChestsAnywhere/Menus/Overlays/ShopMenuOverlay.cs b/ChestsAnywhere/Menus/Overlays/ShopMenuOverlay.cs index fc9d48702..3c6b68adf 100644 --- a/ChestsAnywhere/Menus/Overlays/ShopMenuOverlay.cs +++ b/ChestsAnywhere/Menus/Overlays/ShopMenuOverlay.cs @@ -48,8 +48,7 @@ public ShopMenuOverlay(ShopMenu menu, ManagedChest chest, ManagedChest[] chests, /********* ** Protected methods *********/ - /// Set whether the chest or inventory items should be clickable. - /// Whether items should be clickable. + /// protected override void SetItemsClickable(bool clickable) { if (clickable) diff --git a/ChestsAnywhere/ModEntry.cs b/ChestsAnywhere/ModEntry.cs index cf8228857..57e147d46 100644 --- a/ChestsAnywhere/ModEntry.cs +++ b/ChestsAnywhere/ModEntry.cs @@ -84,9 +84,7 @@ public override object GetApi() /********* ** Private methods *********/ - /// - /// The event sender. - /// The event data. + /// private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) { // add Generic Mod Config Menu integration @@ -100,9 +98,7 @@ private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) ).Register(); } - /// - /// The event sender. - /// The event data. + /// private void OnSaveLoaded(object? sender, SaveLoadedEventArgs e) { // validate game version @@ -118,9 +114,7 @@ private void OnSaveLoaded(object? sender, SaveLoadedEventArgs e) this.Monitor.Log("Multiplayer limitations: you can only access chests in synced locations since you're not the main player. This is due to limitations in the game's sync logic.", LogLevel.Info); } - /// - /// The event sender. - /// The event data. + /// private void OnRenderedHud(object? sender, RenderedHudEventArgs e) { // show chest label @@ -135,25 +129,19 @@ private void OnRenderedHud(object? sender, RenderedHudEventArgs e) } } - /// - /// The event sender. - /// The event data. + /// private void OnUpdateTicking(object? sender, UpdateTickingEventArgs e) { this.ChangeOverlayIfNeeded(); } - /// - /// The event sender. - /// The event data. + /// private void OnUpdateTicked(object? sender, UpdateTickedEventArgs e) { this.ChangeOverlayIfNeeded(); } - /// - /// The event sender. - /// The event data. + /// private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) { if (!Context.IsWorldReady) diff --git a/Common/DrawHelper.cs b/Common/DrawHelper.cs index 2ca881cda..c558b527f 100644 --- a/Common/DrawHelper.cs +++ b/Common/DrawHelper.cs @@ -45,7 +45,7 @@ public static void DrawSprite(this SpriteBatch spriteBatch, Texture2D sheet, Rec } } - /// + /// public static void DrawSprite(this SpriteBatch spriteBatch, Texture2D sheet, Rectangle sprite, float x, float y, Point errorSize, Color? color = null, float scale = 1) { try diff --git a/Common/Integrations/BaseIntegration.cs b/Common/Integrations/BaseIntegration.cs index 9641674bd..d8d58123b 100644 --- a/Common/Integrations/BaseIntegration.cs +++ b/Common/Integrations/BaseIntegration.cs @@ -114,8 +114,7 @@ protected BaseIntegration(string label, string modID, string minVersion, IModReg this.ModApi = this.GetValidatedApi(); } - /// Assert that the integration is loaded. - /// The integration isn't loaded. + /// [MemberNotNull(nameof(BaseIntegration.ModApi))] protected override void AssertLoaded() { diff --git a/Common/UI/BaseOverlay.cs b/Common/UI/BaseOverlay.cs index 7f79d8ec7..63de1b863 100644 --- a/Common/UI/BaseOverlay.cs +++ b/Common/UI/BaseOverlay.cs @@ -41,7 +41,7 @@ internal abstract class BaseOverlay : IDisposable /********* ** Public methods *********/ - /// Release all resources. + /// public virtual void Dispose() { this.Events.Display.RenderedActiveMenu -= this.OnRendered; @@ -112,9 +112,7 @@ protected virtual bool ReceiveLeftClick(int x, int y) return false; } - /// - /// The event sender. - /// The event data. + /// protected virtual void ReceiveButtonsChanged(object? sender, ButtonsChangedEventArgs e) { } /// The method invoked when the player uses the mouse scroll wheel. @@ -157,9 +155,7 @@ protected void DrawCursor() /**** ** Event listeners ****/ - /// - /// The event sender. - /// The event data. + /// private void OnRendered(object? sender, RenderedActiveMenuEventArgs e) { if (Context.ScreenId != this.ScreenId) @@ -168,9 +164,7 @@ private void OnRendered(object? sender, RenderedActiveMenuEventArgs e) this.DrawUi(Game1.spriteBatch); } - /// - /// The event sender. - /// The event data. + /// private void OnRenderedWorld(object? sender, RenderedWorldEventArgs e) { if (Context.ScreenId != this.ScreenId) @@ -179,9 +173,7 @@ private void OnRenderedWorld(object? sender, RenderedWorldEventArgs e) this.DrawWorld(e.SpriteBatch); } - /// - /// The event sender. - /// The event data. + /// private void OnUpdateTicked(object? sender, UpdateTickedEventArgs e) { // ignore if it's for a different screen @@ -213,9 +205,7 @@ private void OnUpdateTicked(object? sender, UpdateTickedEventArgs e) this.Update(); } - /// - /// The event sender. - /// The event data. + /// private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) { if (Context.ScreenId != this.ScreenId) @@ -224,9 +214,7 @@ private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) this.ReceiveButtonsChanged(sender, e); } - /// - /// The event sender. - /// The event data. + /// private void OnButtonPressed(object? sender, ButtonPressedEventArgs e) { if (Context.ScreenId != this.ScreenId) @@ -249,9 +237,7 @@ private void OnButtonPressed(object? sender, ButtonPressedEventArgs e) this.InputHelper.Suppress(e.Button); } - /// - /// The event sender. - /// The event data. + /// private void OnMouseWheelScrolled(object? sender, MouseWheelScrolledEventArgs e) { if (Context.ScreenId != this.ScreenId) @@ -274,9 +260,7 @@ private void OnMouseWheelScrolled(object? sender, MouseWheelScrolledEventArgs e) } } - /// - /// The event sender. - /// The event data. + /// private void OnCursorMoved(object? sender, CursorMovedEventArgs e) { if (Context.ScreenId != this.ScreenId) diff --git a/Common/UI/Dropdown.cs b/Common/UI/Dropdown.cs index 4634f1b4d..64d4ace4a 100644 --- a/Common/UI/Dropdown.cs +++ b/Common/UI/Dropdown.cs @@ -74,9 +74,7 @@ public Dropdown(int x, int y, SpriteFont font, TItem? selectedItem, TItem[] item this.ReinitializeComponents(); } - /// Get whether the dropdown contains the given UI pixel position. - /// The UI X position. - /// The UI Y position. + /// public override bool containsPoint(int x, int y) { return diff --git a/Common/UI/DropdownList.cs b/Common/UI/DropdownList.cs index 2551ea0fa..683c12229 100644 --- a/Common/UI/DropdownList.cs +++ b/Common/UI/DropdownList.cs @@ -170,9 +170,7 @@ public bool TrySelect(TValue value) return true; } - /// Get whether the dropdown list contains the given UI pixel position. - /// The UI X position. - /// The UI Y position. + /// public override bool containsPoint(int x, int y) { return diff --git a/Common/Utilities/ObjectReferenceComparer.cs b/Common/Utilities/ObjectReferenceComparer.cs index ad038aded..edc4bc9f1 100644 --- a/Common/Utilities/ObjectReferenceComparer.cs +++ b/Common/Utilities/ObjectReferenceComparer.cs @@ -11,17 +11,13 @@ internal class ObjectReferenceComparer : IEqualityComparer /********* ** Public methods *********/ - /// Determines whether the specified objects are equal. - /// true if the specified objects are equal; otherwise, false. - /// The first object to compare. - /// The second object to compare. + /// public bool Equals(T? x, T? y) { return object.ReferenceEquals(x, y); } - /// Get a hash code for the specified object. - /// The value. + /// [SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1024:Compare symbols correctly", Justification = "Comparing by object reference is intended.")] public int GetHashCode(T obj) { diff --git a/ContentPatcher/Framework/Commands/PatchInfo.cs b/ContentPatcher/Framework/Commands/PatchInfo.cs index 0c9d491a5..70e15576e 100644 --- a/ContentPatcher/Framework/Commands/PatchInfo.cs +++ b/ContentPatcher/Framework/Commands/PatchInfo.cs @@ -110,7 +110,7 @@ public IEnumerable GetChangeLabels() return this.Patch?.GetChangeLabels() ?? []; } - /// Get a human-readable reason that the patch isn't applied. + /// public override string? GetReasonNotLoaded() { return !this.IsApplied diff --git a/ContentPatcher/Framework/DebugOverlay.cs b/ContentPatcher/Framework/DebugOverlay.cs index 037a5da5c..995c4b1e1 100644 --- a/ContentPatcher/Framework/DebugOverlay.cs +++ b/ContentPatcher/Framework/DebugOverlay.cs @@ -76,8 +76,7 @@ public void PrevTexture() /********* ** Protected methods *********/ - /// Draw to the screen. - /// The sprite batch to which to draw. + /// protected override void DrawUi(SpriteBatch spriteBatch) { string name = this.CurrentName?.Name ?? "???"; diff --git a/ContentPatcher/Framework/Lexing/LexTokens/LexTokenInput.cs b/ContentPatcher/Framework/Lexing/LexTokens/LexTokenInput.cs index 8cab2c3ee..5e3389115 100644 --- a/ContentPatcher/Framework/Lexing/LexTokens/LexTokenInput.cs +++ b/ContentPatcher/Framework/Lexing/LexTokens/LexTokenInput.cs @@ -34,7 +34,7 @@ public void MigrateTo(ILexToken[] tokenParts) this.Parts = tokenParts; } - /// Get a text representation of the lexical token. + /// public override string ToString() { return string.Join("", this.Parts.Select(p => p.ToString())); diff --git a/ContentPatcher/Framework/Lexing/LexTokens/LexTokenLiteral.cs b/ContentPatcher/Framework/Lexing/LexTokens/LexTokenLiteral.cs index cd351b68d..fd03fe414 100644 --- a/ContentPatcher/Framework/Lexing/LexTokens/LexTokenLiteral.cs +++ b/ContentPatcher/Framework/Lexing/LexTokens/LexTokenLiteral.cs @@ -33,7 +33,7 @@ public void MigrateTo(string? text) this.Text = text ?? string.Empty; } - /// Get a text representation of the lexical token. + /// public override string ToString() { return this.Text; diff --git a/ContentPatcher/Framework/Lexing/LexTokens/LexTokenToken.cs b/ContentPatcher/Framework/Lexing/LexTokens/LexTokenToken.cs index 40300ce0b..d026fe690 100644 --- a/ContentPatcher/Framework/Lexing/LexTokens/LexTokenToken.cs +++ b/ContentPatcher/Framework/Lexing/LexTokens/LexTokenToken.cs @@ -62,7 +62,7 @@ public bool HasInputArgs() return this.InputArgs?.Parts.Length > 0; } - /// Get a text representation of the lexical token. + /// public override string ToString() { return LexTokenToken.GetRawText(this.Name, this.InputArgs, this.ImpliedBraces); diff --git a/ContentPatcher/Framework/Locations/CustomLocationManager.cs b/ContentPatcher/Framework/Locations/CustomLocationManager.cs index 076f92561..070176476 100644 --- a/ContentPatcher/Framework/Locations/CustomLocationManager.cs +++ b/ContentPatcher/Framework/Locations/CustomLocationManager.cs @@ -152,8 +152,7 @@ public void AddTmxlLocations(IList? saveLocations, IList - /// The event data. + /// /// Returns whether the asset was loaded for a custom location. public bool OnAssetRequested(AssetRequestedEventArgs e) { diff --git a/ContentPatcher/Framework/PatchManager.cs b/ContentPatcher/Framework/PatchManager.cs index a1d80c7fc..1785d769b 100644 --- a/ContentPatcher/Framework/PatchManager.cs +++ b/ContentPatcher/Framework/PatchManager.cs @@ -93,7 +93,7 @@ public PatchManager(IMonitor monitor, TokenManager tokenManager, IAssetValidator /**** ** Patching ****/ - /// + /// /// The event data. /// Whether to ignore any load patches for this asset. public void OnAssetRequested(AssetRequestedEventArgs e, bool ignoreLoadPatches) diff --git a/ContentPatcher/Framework/ScreenManager.cs b/ContentPatcher/Framework/ScreenManager.cs index b97f9f772..60ef1f241 100644 --- a/ContentPatcher/Framework/ScreenManager.cs +++ b/ContentPatcher/Framework/ScreenManager.cs @@ -94,8 +94,7 @@ public void Initialize(LoadedContentPack[] contentPacks, IInvariantSet installed this.UpdateContext(ContextUpdateType.All); } - /// - /// The event data. + /// public void OnAssetRequested(AssetRequestedEventArgs e) { bool ignoreLoads = this.CustomLocationManager.OnAssetRequested(e); diff --git a/ContentPatcher/Framework/Tokens/ValueProviders/ModConvention/ConventionDelegates.cs b/ContentPatcher/Framework/Tokens/ValueProviders/ModConvention/ConventionDelegates.cs index 919096cbf..fbac27ae9 100644 --- a/ContentPatcher/Framework/Tokens/ValueProviders/ModConvention/ConventionDelegates.cs +++ b/ContentPatcher/Framework/Tokens/ValueProviders/ModConvention/ConventionDelegates.cs @@ -14,7 +14,7 @@ internal static class ConventionDelegates /// Default true. internal delegate bool IsMutable(); - /// + /// /// Default false. internal delegate bool IsDeterministicForInput(); diff --git a/ContentPatcher/Framework/Tokens/ValueProviders/ModConvention/ConventionWrapper.cs b/ContentPatcher/Framework/Tokens/ValueProviders/ModConvention/ConventionWrapper.cs index 478c1c392..25a479f6d 100644 --- a/ContentPatcher/Framework/Tokens/ValueProviders/ModConvention/ConventionWrapper.cs +++ b/ContentPatcher/Framework/Tokens/ValueProviders/ModConvention/ConventionWrapper.cs @@ -157,7 +157,7 @@ public bool IsMutable() return this.IsMutableImpl?.Invoke() ?? true; } - /// + /// public bool IsDeterministicForInput() { return this.IsDeterministicForInputImpl?.Invoke() ?? false; diff --git a/ContentPatcher/Framework/TriggerActions/MigrateIdsAction.cs b/ContentPatcher/Framework/TriggerActions/MigrateIdsAction.cs index 9529e0825..7587f86da 100644 --- a/ContentPatcher/Framework/TriggerActions/MigrateIdsAction.cs +++ b/ContentPatcher/Framework/TriggerActions/MigrateIdsAction.cs @@ -34,7 +34,7 @@ internal class MigrateIdsAction ** Public methods *********/ /// Handle the action when it's called by the game. - /// + /// public bool Handle(string[] args, TriggerActionContext context, [NotNullWhen(false)] out string? error) { // validate context diff --git a/ContentPatcher/Framework/Validators/StardewValley_1_3_36_Validator.cs b/ContentPatcher/Framework/Validators/StardewValley_1_3_36_Validator.cs index 8e198ebd0..5a87c7d5c 100644 --- a/ContentPatcher/Framework/Validators/StardewValley_1_3_36_Validator.cs +++ b/ContentPatcher/Framework/Validators/StardewValley_1_3_36_Validator.cs @@ -28,12 +28,7 @@ internal class StardewValley_1_3_36_Validator : BaseValidator /********* ** Public methods *********/ - /// Validate a content pack. - /// The asset name being loaded. - /// The loaded asset data to validate. - /// The patch which loaded the asset. - /// An error message which indicates why validation failed. - /// Returns whether validation succeeded. + /// public override bool TryValidate(IAssetName assetName, T data, IPatch patch, [NotNullWhen(false)] out string? error) { // detect vanilla tilesheets removed in SDV 1.3.36 diff --git a/ContentPatcher/ModEntry.cs b/ContentPatcher/ModEntry.cs index e03929caf..68c9faec2 100644 --- a/ContentPatcher/ModEntry.cs +++ b/ContentPatcher/ModEntry.cs @@ -104,8 +104,7 @@ internal class ModEntry : Mod /********* ** Public methods *********/ - /// The mod entry point, called after the mod is first loaded. - /// Provides simplified APIs for writing mods. + /// public override void Entry(IModHelper helper) { CommonHelper.RemoveObsoleteFiles(this, "ContentPatcher.pdb"); // removed in 1.29.2 @@ -125,7 +124,7 @@ pyTk is not null && typeof(Constants).GetProperty("ExecutionPath") != null; // not SMAPI strict mode (which drops PyTK workarounds) } - /// Get an API that other mods can access. This is always called after . + /// public override object GetApi() { return new ContentPatcherAPI( @@ -146,9 +145,7 @@ public override object GetApi() /**** ** Event handlers ****/ - /// - /// The event sender. - /// The event data. + /// private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) { if (this.Config.EnableDebugFeatures) @@ -176,49 +173,37 @@ private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) } } - /// - /// The event sender. - /// The event data. + /// private void OnAssetRequested(object? sender, AssetRequestedEventArgs e) { this.ScreenManager.Value.OnAssetRequested(e); } - /// - /// The event sender. - /// The event data. + /// private void OnLoadStageChanged(object? sender, LoadStageChangedEventArgs e) { this.ScreenManager.Value.OnLoadStageChanged(e.OldStage, e.NewStage); } - /// - /// The event sender. - /// The event data. + /// private void OnDayStarted(object? sender, DayStartedEventArgs e) { this.ScreenManager.Value.OnDayStarted(); } - /// - /// The event sender. - /// The event data. + /// private void OnTimeChanged(object? sender, TimeChangedEventArgs e) { this.ScreenManager.Value.OnTimeChanged(); } - /// - /// The event sender. - /// The event data. + /// private void OnWarped(object? sender, WarpedEventArgs e) { this.ScreenManager.Value.OnWarped(); } - /// - /// The event sender. - /// The event data. + /// private void OnUpdateTicked(object? sender, UpdateTickedEventArgs e) { // initialize after first tick on main screen so other mods can register their tokens in SMAPI's GameLoop.GameLaunched event @@ -235,9 +220,7 @@ private void OnUpdateTicked(object? sender, UpdateTickedEventArgs e) this.ScreenManager.Value.OnUpdateTicked(); } - /// - /// The event sender. - /// The event data. + /// private void OnLocaleChanged(object? sender, LocaleChangedEventArgs e) { if (!this.IsFirstTick) diff --git a/CropsAnytimeAnywhere/ModEntry.cs b/CropsAnytimeAnywhere/ModEntry.cs index 3ee74b44c..f9d15fbb6 100644 --- a/CropsAnytimeAnywhere/ModEntry.cs +++ b/CropsAnytimeAnywhere/ModEntry.cs @@ -22,8 +22,7 @@ internal class ModEntry : Mod /********* ** Public methods *********/ - /// The mod entry point, called after the mod is first loaded. - /// Provides simplified APIs for writing mods. + /// public override void Entry(IModHelper helper) { CommonHelper.RemoveObsoleteFiles(this, "CropsAnytimeAnywhere.pdb"); // removed in 1.4.7 @@ -49,9 +48,7 @@ public override void Entry(IModHelper helper) /********* ** Private methods *********/ - /// - /// The event sender. - /// The event data. + /// private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) { // add Generic Mod Config Menu integration diff --git a/DataLayers/Layers/AccessibleLayer.cs b/DataLayers/Layers/AccessibleLayer.cs index 9456bd181..d43616ceb 100644 --- a/DataLayers/Layers/AccessibleLayer.cs +++ b/DataLayers/Layers/AccessibleLayer.cs @@ -58,11 +58,7 @@ public AccessibleLayer(LayerConfig config, ColorScheme colors) ]; } - /// Get the updated data layer tiles. - /// The current location. - /// The tile area currently visible on the screen. - /// The tile positions currently visible on the screen. - /// The tile position under the cursor. + /// public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) { List passableTiles = new(); diff --git a/DataLayers/Layers/BuildableLayer.cs b/DataLayers/Layers/BuildableLayer.cs index 962acab07..09b32fab1 100644 --- a/DataLayers/Layers/BuildableLayer.cs +++ b/DataLayers/Layers/BuildableLayer.cs @@ -41,11 +41,7 @@ public BuildableLayer(LayerConfig config, ColorScheme colors) ]; } - /// Get the updated data layer tiles. - /// The current location. - /// The tile area currently visible on the screen. - /// The tile positions currently visible on the screen. - /// The tile position under the cursor. + /// public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) { TileData[] tiles = this.GetTiles(location, visibleTiles).ToArray(); diff --git a/DataLayers/Layers/Coverage/BeeHouseLayer.cs b/DataLayers/Layers/Coverage/BeeHouseLayer.cs index e823e086e..2e9e601a2 100644 --- a/DataLayers/Layers/Coverage/BeeHouseLayer.cs +++ b/DataLayers/Layers/Coverage/BeeHouseLayer.cs @@ -48,11 +48,7 @@ public BeeHouseLayer(LayerConfig config, ColorScheme colors) .ToArray(); } - /// Get the updated data layer tiles. - /// The current location. - /// The tile area currently visible on the screen. - /// The tile positions currently visible on the screen. - /// The tile position under the cursor. + /// public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) { // get bee houses diff --git a/DataLayers/Layers/Coverage/JunimoHutLayer.cs b/DataLayers/Layers/Coverage/JunimoHutLayer.cs index 16eed0e2c..aaf1b5363 100644 --- a/DataLayers/Layers/Coverage/JunimoHutLayer.cs +++ b/DataLayers/Layers/Coverage/JunimoHutLayer.cs @@ -49,11 +49,7 @@ public JunimoHutLayer(LayerConfig config, ColorScheme colors, ModIntegrations mo ]; } - /// Get the updated data layer tiles. - /// The current location. - /// The tile area currently visible on the screen. - /// The tile positions currently visible on the screen. - /// The tile position under the cursor. + /// public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) { if (!location.IsBuildableLocation()) diff --git a/DataLayers/Layers/Coverage/ScarecrowLayer.cs b/DataLayers/Layers/Coverage/ScarecrowLayer.cs index 6e8c2a892..09de0e1dd 100644 --- a/DataLayers/Layers/Coverage/ScarecrowLayer.cs +++ b/DataLayers/Layers/Coverage/ScarecrowLayer.cs @@ -46,11 +46,7 @@ public ScarecrowLayer(LayerConfig config, ColorScheme colors) ]; } - /// Get the updated data layer tiles. - /// The current location. - /// The tile area currently visible on the screen. - /// The tile positions currently visible on the screen. - /// The tile position under the cursor. + /// public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) { // get scarecrows diff --git a/DataLayers/Layers/Coverage/SprinklerLayer.cs b/DataLayers/Layers/Coverage/SprinklerLayer.cs index 54fb17f72..71ba19b00 100644 --- a/DataLayers/Layers/Coverage/SprinklerLayer.cs +++ b/DataLayers/Layers/Coverage/SprinklerLayer.cs @@ -62,11 +62,7 @@ public SprinklerLayer(LayerConfig config, ColorScheme colors, ModIntegrations mo this.SearchRadius = Math.Max(this.SearchRadius, mods.LineSprinklers.MaxRadius); } - /// Get the updated data layer tiles. - /// The current location. - /// The tile area currently visible on the screen. - /// The tile positions currently visible on the screen. - /// The tile position under the cursor. + /// public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) { // get coverage diff --git a/DataLayers/Layers/Crops/CropFertilizerLayer.cs b/DataLayers/Layers/Crops/CropFertilizerLayer.cs index 194598808..1f336f3bc 100644 --- a/DataLayers/Layers/Crops/CropFertilizerLayer.cs +++ b/DataLayers/Layers/Crops/CropFertilizerLayer.cs @@ -63,11 +63,7 @@ public CropFertilizerLayer(LayerConfig config, ColorScheme colors, ModIntegratio this.HasUltimateFertilizer = mods.IsModInstalled("fox_white25.ultimate_fertilizer"); } - /// Get the updated data layer tiles. - /// The current location. - /// The tile area currently visible on the screen. - /// The tile positions currently visible on the screen. - /// The tile position under the cursor. + /// public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) { FertilizedTile[] fertilizedTiles = this.GetFertilizedTiles(location, visibleTiles).ToArray(); diff --git a/DataLayers/Layers/Crops/CropHarvestLayer.cs b/DataLayers/Layers/Crops/CropHarvestLayer.cs index e717cedd5..99ec8132f 100644 --- a/DataLayers/Layers/Crops/CropHarvestLayer.cs +++ b/DataLayers/Layers/Crops/CropHarvestLayer.cs @@ -41,11 +41,7 @@ public CropHarvestLayer(LayerConfig config, ColorScheme colors) ]; } - /// Get the updated data layer tiles. - /// The current location. - /// The tile area currently visible on the screen. - /// The tile positions currently visible on the screen. - /// The tile position under the cursor. + /// public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) { TileData[] tiles = this.GetTiles(location, visibleTiles).ToArray(); diff --git a/DataLayers/Layers/Crops/CropPaddyWaterLayer.cs b/DataLayers/Layers/Crops/CropPaddyWaterLayer.cs index ee0c0f40f..7e8c16dfd 100644 --- a/DataLayers/Layers/Crops/CropPaddyWaterLayer.cs +++ b/DataLayers/Layers/Crops/CropPaddyWaterLayer.cs @@ -49,11 +49,7 @@ public CropPaddyWaterLayer(LayerConfig config, ColorScheme colors) ]; } - /// Get the updated data layer tiles. - /// The current location. - /// The tile area currently visible on the screen. - /// The tile positions currently visible on the screen. - /// The tile position under the cursor. + /// public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) { // update cache on location change diff --git a/DataLayers/Layers/Crops/CropWaterLayer.cs b/DataLayers/Layers/Crops/CropWaterLayer.cs index 33427dbf3..aaf0aba94 100644 --- a/DataLayers/Layers/Crops/CropWaterLayer.cs +++ b/DataLayers/Layers/Crops/CropWaterLayer.cs @@ -37,11 +37,7 @@ public CropWaterLayer(LayerConfig config, ColorScheme colors) ]; } - /// Get the updated data layer tiles. - /// The current location. - /// The tile area currently visible on the screen. - /// The tile positions currently visible on the screen. - /// The tile position under the cursor. + /// public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) { return [ diff --git a/DataLayers/Layers/GridLayer.cs b/DataLayers/Layers/GridLayer.cs index 9ac0d9ebc..05192ee8e 100644 --- a/DataLayers/Layers/GridLayer.cs +++ b/DataLayers/Layers/GridLayer.cs @@ -26,11 +26,7 @@ public GridLayer(LayerConfig config) this.AlwaysShowGrid = true; } - /// Get the updated data layer tiles. - /// The current location. - /// The tile area currently visible on the screen. - /// The tile positions currently visible on the screen. - /// The tile position under the cursor. + /// public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) { return this.NoGroups; diff --git a/DataLayers/Layers/MachineLayer.cs b/DataLayers/Layers/MachineLayer.cs index 136d99689..e66d202d4 100644 --- a/DataLayers/Layers/MachineLayer.cs +++ b/DataLayers/Layers/MachineLayer.cs @@ -45,11 +45,7 @@ public MachineLayer(LayerConfig config, ColorScheme colors, ModIntegrations mods this.Mods = mods; } - /// Get the updated data layer tiles. - /// The current location. - /// The tile area currently visible on the screen. - /// The tile positions currently visible on the screen. - /// The tile position under the cursor. + /// public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) { // get tiles by color diff --git a/DataLayers/Layers/TillableLayer.cs b/DataLayers/Layers/TillableLayer.cs index 4715632eb..46a854239 100644 --- a/DataLayers/Layers/TillableLayer.cs +++ b/DataLayers/Layers/TillableLayer.cs @@ -48,11 +48,7 @@ public TillableLayer(LayerConfig config, ColorScheme colors) ]; } - /// Get the updated data layer tiles. - /// The current location. - /// The tile area currently visible on the screen. - /// The tile positions currently visible on the screen. - /// The tile position under the cursor. + /// public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) { var tiles = this.GetTiles(location, visibleArea.GetTiles()); diff --git a/DataLayers/ModEntry.cs b/DataLayers/ModEntry.cs index cf3164dc0..0fd632722 100644 --- a/DataLayers/ModEntry.cs +++ b/DataLayers/ModEntry.cs @@ -53,8 +53,7 @@ internal class ModEntry : Mod /********* ** Public methods *********/ - /// The mod entry point, called after the mod is first loaded. - /// Provides methods for interacting with the mod directory, such as read/writing a config file or custom JSON files. + /// public override void Entry(IModHelper helper) { CommonHelper.RemoveObsoleteFiles(this, "DataLayers.pdb"); // removed in 1.15.8 @@ -87,9 +86,7 @@ public override void Entry(IModHelper helper) /********* ** Private methods *********/ - /// - /// The event sender. - /// The event data. + /// private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) { // init mod integrations @@ -115,9 +112,7 @@ private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) ).Register(); } - /// - /// The event sender. - /// The event data. + /// private void OnSaveLoaded(object? sender, SaveLoadedEventArgs e) { // need to do this after the save is loaded so translations use the selected language @@ -162,9 +157,7 @@ private IEnumerable GetLayers(ModConfig config, ModIntegrations mods) yield return new GridLayer(layers.TileGrid); } - /// - /// The event sender. - /// The event data. + /// private void OnReturnedToTitle(object? sender, ReturnedToTitleEventArgs e) { this.CurrentOverlay.Value?.Dispose(); @@ -172,9 +165,7 @@ private void OnReturnedToTitle(object? sender, ReturnedToTitleEventArgs e) this.Layers = []; } - /// - /// The event sender. - /// The event data. + /// private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) { if (this.Layers.Length == 0) @@ -227,9 +218,7 @@ private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) }); } - /// - /// The event sender. - /// The event data. + /// private void OnUpdateTicked(object? sender, UpdateTickedEventArgs e) { DataLayerOverlay? overlay = this.CurrentOverlay.Value; diff --git a/DebugMode/ModEntry.cs b/DebugMode/ModEntry.cs index acf7dc850..c20a4609f 100644 --- a/DebugMode/ModEntry.cs +++ b/DebugMode/ModEntry.cs @@ -87,9 +87,7 @@ public override void Entry(IModHelper helper) /**** ** Event handlers ****/ - /// - /// The event sender. - /// The event data. + /// private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) { // add Generic Mod Config Menu integration @@ -103,9 +101,7 @@ private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) ).Register(); } - /// - /// The event sender. - /// The event data. + /// private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) { // toggle debug menu @@ -125,18 +121,14 @@ private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) } } - /// - /// The event sender. - /// The event data. + /// private void OnWarped(object? sender, WarpedEventArgs e) { if (this.GameDebugMode && e.IsLocalPlayer) this.CorrectEntryPosition(e.NewLocation, Game1.player); } - /// - /// The event sender. - /// The event data. + /// public void OnRendered(object? sender, RenderedEventArgs e) { if (this.ShowOverlay.Value) diff --git a/FastAnimations/Handlers/ReadBookHandler.cs b/FastAnimations/Handlers/ReadBookHandler.cs index 022a91637..5f77a529d 100644 --- a/FastAnimations/Handlers/ReadBookHandler.cs +++ b/FastAnimations/Handlers/ReadBookHandler.cs @@ -16,6 +16,7 @@ internal sealed class ReadBookHandler : BaseAnimationHandler public ReadBookHandler(float multiplier) : base(multiplier) { } + /// public override bool TryApply(int playerAnimationId) { Farmer player = Game1.player; diff --git a/FastAnimations/ModEntry.cs b/FastAnimations/ModEntry.cs index d93de74d0..aa91feb78 100644 --- a/FastAnimations/ModEntry.cs +++ b/FastAnimations/ModEntry.cs @@ -53,8 +53,6 @@ public override void Entry(IModHelper helper) ** Events ****/ /// - /// The event sender. - /// The event data. private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) { // add Generic Mod Config Menu integration @@ -78,8 +76,6 @@ private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) } /// - /// The event sender. - /// The event data. private void OnSaveLoaded(object? sender, SaveLoadedEventArgs e) { // initialize handlers @@ -88,8 +84,6 @@ private void OnSaveLoaded(object? sender, SaveLoadedEventArgs e) } /// - /// The event sender. - /// The event data. private void OnWarped(object? sender, WarpedEventArgs e) { if (!Context.IsWorldReady || Game1.eventUp || !this.Handlers.Any() || !e.IsLocalPlayer) @@ -100,8 +94,6 @@ private void OnWarped(object? sender, WarpedEventArgs e) } /// - /// The event sender. - /// The event data. private void OnObjectListChanged(object? sender, ObjectListChangedEventArgs e) { if (e.IsCurrentLocation) @@ -112,8 +104,6 @@ private void OnObjectListChanged(object? sender, ObjectListChangedEventArgs e) } /// - /// The event sender. - /// The event data. private void OnUpdateTicked(object? sender, UpdateTickedEventArgs e) { if (!this.Handlers.Any()) diff --git a/HorseFluteAnywhere/ModEntry.cs b/HorseFluteAnywhere/ModEntry.cs index 921f96aa0..800af52cd 100644 --- a/HorseFluteAnywhere/ModEntry.cs +++ b/HorseFluteAnywhere/ModEntry.cs @@ -38,8 +38,7 @@ internal class ModEntry : Mod /********* ** Public methods *********/ - /// The mod entry point, called after the mod is first loaded. - /// Provides methods for interacting with the mod directory, such as read/writing a config file or custom JSON files. + /// public override void Entry(IModHelper helper) { I18n.Init(helper.Translation); @@ -67,9 +66,7 @@ public override void Entry(IModHelper helper) /********* ** Private methods *********/ - /// - /// The event sender. - /// The event data. + /// private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) { // add Generic Mod Config Menu integration @@ -92,18 +89,14 @@ private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) ).Register(); } - /// - /// The event sender. - /// The event data. + /// private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) { if (this.SummonKey.JustPressed() && this.TryUseHorseFlute()) this.Helper.Input.SuppressActiveKeybinds(this.SummonKey); } - /// - /// The event sender. - /// The event data. + /// private void OnLocationListChanged(object? sender, LocationListChangedEventArgs e) { // rescue lost horses @@ -117,9 +110,7 @@ private void OnLocationListChanged(object? sender, LocationListChangedEventArgs } } - /// - /// The event sender. - /// The event data. + /// private void OnWarped(object? sender, WarpedEventArgs e) { if (!e.IsLocalPlayer || !this.IsRidingHorse(Game1.player)) diff --git a/LookupAnything/Components/LookupMenu.cs b/LookupAnything/Components/LookupMenu.cs index 64a1a3eca..80aaa6b90 100644 --- a/LookupAnything/Components/LookupMenu.cs +++ b/LookupAnything/Components/LookupMenu.cs @@ -146,23 +146,16 @@ public LookupMenu(ISubject subject, IMonitor monitor, IReflectionHelper reflecti /**** ** Events ****/ - /// The method invoked when the player left-clicks on the lookup UI. - /// The X-position of the cursor. - /// The Y-position of the cursor. - /// Whether to enable sound. + /// public override void receiveLeftClick(int x, int y, bool playSound = true) { this.HandleLeftClick(x, y); } - /// The method invoked when the player right-clicks on the lookup UI. - /// The X-position of the cursor. - /// The Y-position of the cursor. - /// Whether to enable sound. + /// public override void receiveRightClick(int x, int y, bool playSound = true) { } - /// The method invoked when the player scrolls the mouse wheel on the lookup UI. - /// The scroll direction. + /// public override void receiveScrollWheelAction(int direction) { if (direction > 0) // positive number scrolls content up @@ -171,16 +164,13 @@ public override void receiveScrollWheelAction(int direction) this.ScrollDown(); } - /// The method called when the game window changes size. - /// The former viewport. - /// The new viewport. + /// public override void gameWindowSizeChanged(Rectangle oldBounds, Rectangle newBounds) { this.UpdateLayout(); } - /// The method called when the player presses a controller button. - /// The controller button pressed. + /// public override void receiveGamePadButton(Buttons button) { switch (button) @@ -208,8 +198,7 @@ public override void receiveGamePadButton(Buttons button) } } - /// Update the menu state if needed. - /// The elapsed game time. + /// public override void update(GameTime time) { if (this.ExitOnNextTick && this.readyToClose()) @@ -271,9 +260,8 @@ public void HandleLeftClick(int x, int y) } } - /// Render the UI. - /// The sprite batch being drawn. - public override void draw(SpriteBatch spriteBatch) + /// + public override void draw(SpriteBatch b) { this.Monitor.InterceptErrors("drawing the lookup info", () => { @@ -422,9 +410,9 @@ public override void draw(SpriteBatch spriteBatch) // draw scroll icons if (this.MaxScroll > 0 && this.CurrentScroll > 0) - this.ScrollUpButton.draw(spriteBatch); + this.ScrollUpButton.draw(b); if (this.MaxScroll > 0 && this.CurrentScroll < this.MaxScroll) - this.ScrollDownButton.draw(spriteBatch); + this.ScrollDownButton.draw(b); // end draw contentBatch.End(); @@ -447,7 +435,7 @@ public override void draw(SpriteBatch spriteBatch) }, this.OnDrawError); } - /// Clean up after the menu when it's disposed. + /// public void Dispose() { this.ContentBlendState.Dispose(); @@ -498,7 +486,7 @@ private void OnDrawError(Exception ex) this.Monitor.InterceptErrors("handling an error in the lookup code", () => this.exitThisMenu()); } - /// Perform any cleanup needed when the menu exits. + /// protected override void cleanupBeforeExit() { this.CleanupImpl(); diff --git a/LookupAnything/Components/SearchMenu.cs b/LookupAnything/Components/SearchMenu.cs index 6f9f2cd5b..4e00ee721 100644 --- a/LookupAnything/Components/SearchMenu.cs +++ b/LookupAnything/Components/SearchMenu.cs @@ -92,10 +92,7 @@ public SearchMenu(IEnumerable searchSubjects, Action showLoo /**** ** Events ****/ - /// The method invoked when the player left-clicks on the lookup UI. - /// The X-position of the cursor. - /// The Y-position of the cursor. - /// Whether to enable sound. + /// public override void receiveLeftClick(int x, int y, bool playSound = true) { // search box @@ -123,8 +120,7 @@ public override void receiveLeftClick(int x, int y, bool playSound = true) } } - /// The method invoked when the player presses an input button. - /// The pressed input. + /// public override void receiveKeyPress(Keys key) { // deliberately avoid calling base, which may let another key close the menu @@ -132,8 +128,7 @@ public override void receiveKeyPress(Keys key) this.exitThisMenu(); } - /// The method called when the player presses a controller button. - /// The controller button pressed. + /// public override void receiveGamePadButton(Buttons button) { switch (button) @@ -159,8 +154,7 @@ public override void receiveGamePadButton(Buttons button) } } - /// The method invoked when the player scrolls the mouse wheel on the lookup UI. - /// The scroll direction. + /// public override void receiveScrollWheelAction(int direction) { if (direction > 0) // positive number scrolls content up @@ -169,9 +163,7 @@ public override void receiveScrollWheelAction(int direction) this.ScrollDown(); } - /// The method called when the game window changes size. - /// The former viewport. - /// The new viewport. + /// public override void gameWindowSizeChanged(Rectangle oldBounds, Rectangle newBounds) { this.UpdateLayout(); @@ -180,9 +172,8 @@ public override void gameWindowSizeChanged(Rectangle oldBounds, Rectangle newBou /**** ** Methods ****/ - /// Render the UI. - /// The sprite batch being drawn. - public override void draw(SpriteBatch spriteBatch) + /// + public override void draw(SpriteBatch b) { // calculate dimensions int x = this.xPositionOnScreen; @@ -270,9 +261,9 @@ public override void draw(SpriteBatch spriteBatch) // draw scroll icons if (this.MaxScroll > 0 && this.CurrentScroll > 0) - this.ScrollUpButton.draw(spriteBatch); + this.ScrollUpButton.draw(b); if (this.MaxScroll > 0 && this.CurrentScroll < this.MaxScroll) - this.ScrollDownButton.draw(spriteBatch); + this.ScrollDownButton.draw(b); // end draw contentBatch.End(); @@ -294,7 +285,7 @@ public override void draw(SpriteBatch spriteBatch) this.drawMouse(Game1.spriteBatch); } - /// Release all resources. + /// public void Dispose() { this.SearchTextbox.Dispose(); diff --git a/LookupAnything/Components/SearchTextBox.cs b/LookupAnything/Components/SearchTextBox.cs index d3f48971e..9198208ca 100644 --- a/LookupAnything/Components/SearchTextBox.cs +++ b/LookupAnything/Components/SearchTextBox.cs @@ -77,7 +77,7 @@ private void NotifyChange() } } - /// Release all resources. + /// public void Dispose() { this.OnChanged = null; diff --git a/LookupAnything/Framework/Fields/CharacterFriendshipField.cs b/LookupAnything/Framework/Fields/CharacterFriendshipField.cs index 2323be2bf..0645983e3 100644 --- a/LookupAnything/Framework/Fields/CharacterFriendshipField.cs +++ b/LookupAnything/Framework/Fields/CharacterFriendshipField.cs @@ -30,12 +30,7 @@ public CharacterFriendshipField(string label, FriendshipModel friendship) this.Friendship = friendship; } - /// Draw the value (or return null to render the using the default format). - /// The sprite batch being drawn. - /// The recommended font. - /// The position at which to draw. - /// The maximum width before which content should be wrapped. - /// Returns the drawn dimensions, or null to draw the using the default format. + /// public override Vector2? DrawValue(SpriteBatch spriteBatch, SpriteFont font, Vector2 position, float wrapWidth) { FriendshipModel friendship = this.Friendship; diff --git a/LookupAnything/Framework/Fields/CheckboxListField.cs b/LookupAnything/Framework/Fields/CheckboxListField.cs index b2c2e545d..7a5d45770 100644 --- a/LookupAnything/Framework/Fields/CheckboxListField.cs +++ b/LookupAnything/Framework/Fields/CheckboxListField.cs @@ -42,12 +42,7 @@ public CheckboxListField(string label, params KeyValuePairDraw the value (or return null to render the using the default format). - /// The sprite batch being drawn. - /// The recommended font. - /// The position at which to draw. - /// The maximum width before which content should be wrapped. - /// Returns the drawn dimensions, or null to draw the using the default format. + /// public override Vector2? DrawValue(SpriteBatch spriteBatch, SpriteFont font, Vector2 position, float wrapWidth) { float topOffset = 0; diff --git a/LookupAnything/Framework/Fields/ColorField.cs b/LookupAnything/Framework/Fields/ColorField.cs index 8cb7f031f..27ba096b5 100644 --- a/LookupAnything/Framework/Fields/ColorField.cs +++ b/LookupAnything/Framework/Fields/ColorField.cs @@ -59,12 +59,7 @@ public ColorField(string label, Item item) } } - /// Draw the value (or return null to render the using the default format). - /// The sprite batch being drawn. - /// The recommended font. - /// The position at which to draw. - /// The maximum width before which content should be wrapped. - /// Returns the drawn dimensions, or null to draw the using the default format. + /// public override Vector2? DrawValue(SpriteBatch spriteBatch, SpriteFont font, Vector2 position, float wrapWidth) { // get icon size diff --git a/LookupAnything/Framework/Fields/FishPondDropsField.cs b/LookupAnything/Framework/Fields/FishPondDropsField.cs index abf64f28b..4405aa9f0 100644 --- a/LookupAnything/Framework/Fields/FishPondDropsField.cs +++ b/LookupAnything/Framework/Fields/FishPondDropsField.cs @@ -47,12 +47,7 @@ public FishPondDropsField(GameHelper gameHelper, string label, int currentPopula this.Preface = preface; } - /// Draw the value (or return null to render the using the default format). - /// The sprite batch being drawn. - /// The recommended font. - /// The position at which to draw. - /// The maximum width before which content should be wrapped. - /// Returns the drawn dimensions, or null to draw the using the default format. + /// public override Vector2? DrawValue(SpriteBatch spriteBatch, SpriteFont font, Vector2 position, float wrapWidth) { float height = 0; diff --git a/LookupAnything/Framework/Fields/ItemIconListField.cs b/LookupAnything/Framework/Fields/ItemIconListField.cs index 137affe44..f4487ae83 100644 --- a/LookupAnything/Framework/Fields/ItemIconListField.cs +++ b/LookupAnything/Framework/Fields/ItemIconListField.cs @@ -42,12 +42,7 @@ public ItemIconListField(GameHelper gameHelper, string label, IEnumerable this.FormatItemName = formatItemName; } - /// Draw the value (or return null to render the using the default format). - /// The sprite batch being drawn. - /// The recommended font. - /// The position at which to draw. - /// The maximum width before which content should be wrapped. - /// Returns the drawn dimensions, or null to draw the using the default format. + /// public override Vector2? DrawValue(SpriteBatch spriteBatch, SpriteFont font, Vector2 position, float wrapWidth) { // get icon size diff --git a/LookupAnything/Framework/Fields/PercentageBarField.cs b/LookupAnything/Framework/Fields/PercentageBarField.cs index 9c61d9f49..d987b44bc 100644 --- a/LookupAnything/Framework/Fields/PercentageBarField.cs +++ b/LookupAnything/Framework/Fields/PercentageBarField.cs @@ -47,12 +47,7 @@ public PercentageBarField(string label, int currentValue, int maxValue, Color fi this.Text = text; } - /// Draw the value (or return null to render the using the default format). - /// The sprite batch being drawn. - /// The recommended font. - /// The position at which to draw. - /// The maximum width before which content should be wrapped. - /// Returns the drawn dimensions, or null to draw the using the default format. + /// public override Vector2? DrawValue(SpriteBatch spriteBatch, SpriteFont font, Vector2 position, float wrapWidth) { Vector2 barSize = this.DrawBar(spriteBatch, position, this.CurrentValue / (this.MaxValue * 1f), this.FilledColor, this.EmptyColor, wrapWidth); diff --git a/LookupAnything/Framework/Fields/SkillBarField.cs b/LookupAnything/Framework/Fields/SkillBarField.cs index 11e3971b2..a6c53ad8d 100644 --- a/LookupAnything/Framework/Fields/SkillBarField.cs +++ b/LookupAnything/Framework/Fields/SkillBarField.cs @@ -30,12 +30,7 @@ public SkillBarField(string label, int experience, int maxSkillPoints, int[] ski this.SkillPointsPerLevel = skillPointsPerLevel; } - /// Draw the value (or return null to render the using the default format). - /// The sprite batch being drawn. - /// The recommended font. - /// The position at which to draw. - /// The maximum width before which content should be wrapped. - /// Returns the drawn dimensions, or null to draw the using the default format. + /// public override Vector2? DrawValue(SpriteBatch spriteBatch, SpriteFont font, Vector2 position, float wrapWidth) { int[] pointsPerLevel = this.SkillPointsPerLevel; diff --git a/LookupAnything/Framework/Lookups/Buildings/BuildingSubject.cs b/LookupAnything/Framework/Lookups/Buildings/BuildingSubject.cs index c506e4939..ae9a94ee5 100644 --- a/LookupAnything/Framework/Lookups/Buildings/BuildingSubject.cs +++ b/LookupAnything/Framework/Lookups/Buildings/BuildingSubject.cs @@ -70,7 +70,7 @@ public BuildingSubject(ISubjectRegistry codex, GameHelper gameHelper, Building b this.Description = TokenParser.ParseText(buildingData?.Description) ?? this.Description; } - /// Get the data to display for this subject. + /// public override IEnumerable GetData() { // get info @@ -244,7 +244,7 @@ public override IEnumerable GetData() } } - /// Get raw debug data to display for this subject. + /// public override IEnumerable GetDebugFields() { Building target = this.Target; @@ -260,11 +260,7 @@ public override IEnumerable GetDebugFields() yield return field; } - /// Draw the subject portrait (if available). - /// The sprite batch being drawn. - /// The position at which to draw. - /// The size of the portrait to draw. - /// Returns true if a portrait was drawn, else false. + /// /// Derived from , modified to draw within the target size. public override bool DrawPortrait(SpriteBatch spriteBatch, Vector2 position, Vector2 size) { diff --git a/LookupAnything/Framework/Lookups/Buildings/BuildingTarget.cs b/LookupAnything/Framework/Lookups/Buildings/BuildingTarget.cs index b578e6ace..0403b48c7 100644 --- a/LookupAnything/Framework/Lookups/Buildings/BuildingTarget.cs +++ b/LookupAnything/Framework/Lookups/Buildings/BuildingTarget.cs @@ -44,13 +44,13 @@ public BuildingTarget(GameHelper gameHelper, Building value, Func getS this.TileArea = new Rectangle(value.tileX.Value, value.tileY.Value, value.tilesWide.Value, value.tilesHigh.Value); } - /// Get the sprite's source rectangle within its texture. + /// public override Rectangle GetSpritesheetArea() { return this.Value.getSourceRectForMenu() ?? this.Value.getSourceRect(); } - /// Get a rectangle which roughly bounds the visible sprite relative the viewport. + /// public override Rectangle GetWorldArea() { // get source rectangle adjusted for zoom @@ -74,10 +74,7 @@ public override Rectangle GetWorldArea() ); } - /// Get whether the visible sprite intersects the specified coordinate. This can be an expensive test. - /// The tile to search. - /// The viewport-relative coordinates to search. - /// The approximate sprite area calculated by . + /// public override bool SpriteIntersectsPixel(Vector2 tile, Vector2 position, Rectangle spriteArea) { Rectangle sourceRect = this.GetSpritesheetArea(); diff --git a/LookupAnything/Framework/Lookups/Characters/CharacterSubject.cs b/LookupAnything/Framework/Lookups/Characters/CharacterSubject.cs index 347a4ccd8..628531f30 100644 --- a/LookupAnything/Framework/Lookups/Characters/CharacterSubject.cs +++ b/LookupAnything/Framework/Lookups/Characters/CharacterSubject.cs @@ -119,7 +119,7 @@ public CharacterSubject(ISubjectRegistry codex, GameHelper gameHelper, NPC npc, this.DisablePortraits = CharacterSubject.ShouldDisablePortraits(npc, this.IsGourmand); } - /// Get the data to display for this subject. + /// public override IEnumerable GetData() { NPC npc = this.Target; @@ -138,7 +138,7 @@ public override IEnumerable GetData() }; } - /// Get raw debug data to display for this subject. + /// public override IEnumerable GetDebugFields() { NPC target = this.Target; @@ -160,11 +160,7 @@ public override IEnumerable GetDebugFields() yield return field; } - /// Draw the subject portrait (if available). - /// The sprite batch being drawn. - /// The position at which to draw. - /// The size of the portrait to draw. - /// Returns true if a portrait was drawn, else false. + /// public override bool DrawPortrait(SpriteBatch spriteBatch, Vector2 position, Vector2 size) { NPC npc = this.Target; diff --git a/LookupAnything/Framework/Lookups/Characters/CharacterTarget.cs b/LookupAnything/Framework/Lookups/Characters/CharacterTarget.cs index 340ae6eec..d023eae7c 100644 --- a/LookupAnything/Framework/Lookups/Characters/CharacterTarget.cs +++ b/LookupAnything/Framework/Lookups/Characters/CharacterTarget.cs @@ -21,13 +21,13 @@ internal class CharacterTarget : GenericTarget public CharacterTarget(GameHelper gameHelper, SubjectType type, NPC value, Vector2 tilePosition, Func getSubject) : base(gameHelper, type, value, tilePosition, getSubject) { } - /// Get the sprite's source rectangle within its texture. + /// public override Rectangle GetSpritesheetArea() { return this.Value.Sprite.SourceRect; } - /// Get a rectangle which roughly bounds the visible sprite relative the viewport. + /// public override Rectangle GetWorldArea() { NPC npc = this.Value; @@ -56,10 +56,7 @@ public override Rectangle GetWorldArea() return new Rectangle((int)(x - Game1.uiViewport.X), (int)(y - Game1.uiViewport.Y), width, height); } - /// Get whether the visible sprite intersects the specified coordinate. This can be an expensive test. - /// The tile to search. - /// The viewport-relative coordinates to search. - /// The approximate sprite area calculated by . + /// public override bool SpriteIntersectsPixel(Vector2 tile, Vector2 position, Rectangle spriteArea) { NPC npc = this.Value; diff --git a/LookupAnything/Framework/Lookups/Characters/FarmAnimalSubject.cs b/LookupAnything/Framework/Lookups/Characters/FarmAnimalSubject.cs index 33904d85d..5d0ff8543 100644 --- a/LookupAnything/Framework/Lookups/Characters/FarmAnimalSubject.cs +++ b/LookupAnything/Framework/Lookups/Characters/FarmAnimalSubject.cs @@ -39,7 +39,7 @@ public FarmAnimalSubject(ISubjectRegistry codex, GameHelper gameHelper, FarmAnim this.Target = animal; } - /// Get the data to display for this subject. + /// public override IEnumerable GetData() { FarmAnimal animal = this.Target; @@ -65,7 +65,7 @@ public override IEnumerable GetData() yield return new GenericField(I18n.Animal_SellsFor(), GenericField.GetSaleValueString(animal.getSellPrice(), 1)); } - /// Get raw debug data to display for this subject. + /// public override IEnumerable GetDebugFields() { FarmAnimal target = this.Target; @@ -81,11 +81,7 @@ public override IEnumerable GetDebugFields() yield return field; } - /// Draw the subject portrait (if available). - /// The sprite batch being drawn. - /// The position at which to draw. - /// The size of the portrait to draw. - /// Returns true if a portrait was drawn, else false. + /// public override bool DrawPortrait(SpriteBatch spriteBatch, Vector2 position, Vector2 size) { FarmAnimal animal = this.Target; diff --git a/LookupAnything/Framework/Lookups/Characters/FarmAnimalTarget.cs b/LookupAnything/Framework/Lookups/Characters/FarmAnimalTarget.cs index 624ac7f98..772a2bfc4 100644 --- a/LookupAnything/Framework/Lookups/Characters/FarmAnimalTarget.cs +++ b/LookupAnything/Framework/Lookups/Characters/FarmAnimalTarget.cs @@ -19,22 +19,19 @@ internal class FarmAnimalTarget : GenericTarget public FarmAnimalTarget(GameHelper gameHelper, FarmAnimal value, Vector2 tilePosition, Func getSubject) : base(gameHelper, SubjectType.FarmAnimal, value, tilePosition, getSubject) { } - /// Get the sprite's source rectangle within its texture. + /// public override Rectangle GetSpritesheetArea() { return this.Value.Sprite.SourceRect; } - /// Get a rectangle which roughly bounds the visible sprite relative the viewport. + /// public override Rectangle GetWorldArea() { return this.GetSpriteArea(this.Value.GetBoundingBox(), this.GetSpritesheetArea()); } - /// Get whether the visible sprite intersects the specified coordinate. This can be an expensive test. - /// The tile to search. - /// The viewport-relative coordinates to search. - /// The approximate sprite area calculated by . + /// public override bool SpriteIntersectsPixel(Vector2 tile, Vector2 position, Rectangle spriteArea) { SpriteEffects spriteEffects = this.Value.flip ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/LookupAnything/Framework/Lookups/Characters/FarmerSubject.cs b/LookupAnything/Framework/Lookups/Characters/FarmerSubject.cs index 707cc2f69..d75610dcd 100644 --- a/LookupAnything/Framework/Lookups/Characters/FarmerSubject.cs +++ b/LookupAnything/Framework/Lookups/Characters/FarmerSubject.cs @@ -47,7 +47,7 @@ public FarmerSubject(GameHelper gameHelper, SFarmer farmer, bool isLoadMenu = fa : null; } - /// Get the data to display for this subject. + /// public override IEnumerable GetData() { SFarmer target = this.Target; @@ -89,7 +89,7 @@ public override IEnumerable GetData() yield return new GenericField(I18n.Player_SaveFormat(), this.GetSaveFormat(this.RawSaveData?.Value)); } - /// Get raw debug data to display for this subject. + /// public override IEnumerable GetDebugFields() { SFarmer target = this.Target; @@ -104,11 +104,7 @@ public override IEnumerable GetDebugFields() yield return field; } - /// Draw the subject portrait (if available). - /// The sprite batch being drawn. - /// The position at which to draw. - /// The size of the portrait to draw. - /// Returns true if a portrait was drawn, else false. + /// public override bool DrawPortrait(SpriteBatch spriteBatch, Vector2 position, Vector2 size) { SFarmer target = this.Target; diff --git a/LookupAnything/Framework/Lookups/Characters/FarmerTarget.cs b/LookupAnything/Framework/Lookups/Characters/FarmerTarget.cs index 6ef5831ce..09e1b4e0a 100644 --- a/LookupAnything/Framework/Lookups/Characters/FarmerTarget.cs +++ b/LookupAnything/Framework/Lookups/Characters/FarmerTarget.cs @@ -17,22 +17,19 @@ internal class FarmerTarget : GenericTarget public FarmerTarget(GameHelper gameHelper, Farmer value, Func getSubject) : base(gameHelper, SubjectType.Farmer, value, value.Tile, getSubject) { } - /// Get the sprite's source rectangle within its texture. + /// public override Rectangle GetSpritesheetArea() { return this.Value.FarmerSprite.SourceRect; } - /// Get a rectangle which roughly bounds the visible sprite relative the viewport. + /// public override Rectangle GetWorldArea() { return this.GetSpriteArea(this.Value.GetBoundingBox(), this.GetSpritesheetArea()); } - /// Get whether the visible sprite intersects the specified coordinate. This can be an expensive test. - /// The tile to search. - /// The viewport-relative coordinates to search. - /// The approximate sprite area calculated by . + /// public override bool SpriteIntersectsPixel(Vector2 tile, Vector2 position, Rectangle spriteArea) { return spriteArea.Contains((int)position.X, (int)position.Y); diff --git a/LookupAnything/Framework/Lookups/Items/CropTarget.cs b/LookupAnything/Framework/Lookups/Items/CropTarget.cs index 332cdd79f..6f0976ba3 100644 --- a/LookupAnything/Framework/Lookups/Items/CropTarget.cs +++ b/LookupAnything/Framework/Lookups/Items/CropTarget.cs @@ -33,22 +33,19 @@ public CropTarget(GameHelper gameHelper, HoeDirt value, Vector2 tilePosition, Fu this.GetSpriteSheet(value.crop, out this.Texture, out this.SourceRect); } - /// Get the sprite's source rectangle within its texture. + /// public override Rectangle GetSpritesheetArea() { return this.SourceRect; } - /// Get a rectangle which roughly bounds the visible sprite relative the viewport. + /// public override Rectangle GetWorldArea() { return this.GetSpriteArea(this.Value.getBoundingBox(), this.GetSpritesheetArea()); } - /// Get whether the visible sprite intersects the specified coordinate. This can be an expensive test. - /// The tile to search. - /// The viewport-relative coordinates to search. - /// The approximate sprite area calculated by . + /// /// Derived from . public override bool SpriteIntersectsPixel(Vector2 tile, Vector2 position, Rectangle spriteArea) { diff --git a/LookupAnything/Framework/Lookups/Items/ItemSubject.cs b/LookupAnything/Framework/Lookups/Items/ItemSubject.cs index 2d2f88174..b074137c7 100644 --- a/LookupAnything/Framework/Lookups/Items/ItemSubject.cs +++ b/LookupAnything/Framework/Lookups/Items/ItemSubject.cs @@ -127,7 +127,7 @@ public ItemSubject(ISubjectRegistry codex, GameHelper gameHelper, bool showUnkno this.Initialize(this.Target.DisplayName, this.GetDescription(this.Target), this.GetTypeValue(this.Target)); } - /// Get the data to display for this subject. + /// public override IEnumerable GetData() { // get data @@ -413,7 +413,7 @@ select name } } - /// Get the data to display for this subject. + /// public override IEnumerable GetDebugFields() { Item target = this.Target; @@ -446,11 +446,7 @@ public override IEnumerable GetDebugFields() } } - /// Draw the subject portrait (if available). - /// The sprite batch being drawn. - /// The position at which to draw. - /// The size of the portrait to draw. - /// Returns true if a portrait was drawn, else false. + /// public override bool DrawPortrait(SpriteBatch spriteBatch, Vector2 position, Vector2 size) { this.Target.drawInMenu(spriteBatch, position, 1, 1f, 1f, StackDrawType.Hide, Color.White, false); diff --git a/LookupAnything/Framework/Lookups/Items/MovieSnackSubject.cs b/LookupAnything/Framework/Lookups/Items/MovieSnackSubject.cs index 044e67ec1..417a106a5 100644 --- a/LookupAnything/Framework/Lookups/Items/MovieSnackSubject.cs +++ b/LookupAnything/Framework/Lookups/Items/MovieSnackSubject.cs @@ -32,7 +32,7 @@ public MovieSnackSubject(GameHelper gameHelper, MovieConcession item) this.Initialize(item.DisplayName, item.getDescription(), I18n.Type_Other()); } - /// Get the data to display for this subject. + /// public override IEnumerable GetData() { MovieConcession item = this.Target; @@ -46,18 +46,14 @@ public override IEnumerable GetData() } } - /// Get raw debug data to display for this subject. + /// public override IEnumerable GetDebugFields() { foreach (IDebugField field in this.GetDebugFieldsFrom(this.Target)) yield return field; } - /// Draw the subject portrait (if available). - /// The sprite batch being drawn. - /// The position at which to draw. - /// The size of the portrait to draw. - /// Returns true if a portrait was drawn, else false. + /// public override bool DrawPortrait(SpriteBatch spriteBatch, Vector2 position, Vector2 size) { this.Target.drawInMenu(spriteBatch, position, 1, 1f, 1f, StackDrawType.Hide, Color.White, false); diff --git a/LookupAnything/Framework/Lookups/Items/ObjectTarget.cs b/LookupAnything/Framework/Lookups/Items/ObjectTarget.cs index edbbcf46b..49173c94e 100644 --- a/LookupAnything/Framework/Lookups/Items/ObjectTarget.cs +++ b/LookupAnything/Framework/Lookups/Items/ObjectTarget.cs @@ -32,7 +32,7 @@ public ObjectTarget(GameHelper gameHelper, SObject value, Vector2 tilePosition, this.CustomSprite = gameHelper.GetSprite(value, onlyCustom: true); // only get sprite if it's custom; else we'll use contextual logic (e.g. for fence direction) } - /// Get the sprite's source rectangle within its texture. + /// public override Rectangle GetSpritesheetArea() { if (this.CustomSprite != null) @@ -47,7 +47,7 @@ public override Rectangle GetSpritesheetArea() }; } - /// Get a rectangle which roughly bounds the visible sprite relative the viewport. + /// public override Rectangle GetWorldArea() { // get object info @@ -69,10 +69,7 @@ public override Rectangle GetWorldArea() return this.GetSpriteArea(boundingBox, this.GetSpritesheetArea()); } - /// Get whether the visible sprite intersects the specified coordinate. This can be an expensive test. - /// The tile to search. - /// The viewport-relative coordinates to search. - /// The approximate sprite area calculated by . + /// public override bool SpriteIntersectsPixel(Vector2 tile, Vector2 position, Rectangle spriteArea) { SObject obj = this.Value; diff --git a/LookupAnything/Framework/Lookups/TerrainFeatures/BushSubject.cs b/LookupAnything/Framework/Lookups/TerrainFeatures/BushSubject.cs index 27314b891..d6c96e3b6 100644 --- a/LookupAnything/Framework/Lookups/TerrainFeatures/BushSubject.cs +++ b/LookupAnything/Framework/Lookups/TerrainFeatures/BushSubject.cs @@ -47,7 +47,7 @@ public BushSubject(GameHelper gameHelper, Bush bush) this.Initialize(I18n.Bush_Name_Plain(), I18n.Bush_Description_Plain(), I18n.Type_Bush()); } - /// Get the data to display for this subject. + /// public override IEnumerable GetData() { // get basic info @@ -115,7 +115,7 @@ public override IEnumerable GetData() } } - /// Get the data to display for this subject. + /// public override IEnumerable GetDebugFields() { Bush target = this.Target; @@ -130,11 +130,7 @@ public override IEnumerable GetDebugFields() yield return field; } - /// Draw the subject portrait (if available). - /// The sprite batch being drawn. - /// The position at which to draw. - /// The size of the portrait to draw. - /// Returns true if a portrait was drawn, else false. + /// public override bool DrawPortrait(SpriteBatch spriteBatch, Vector2 position, Vector2 size) { Bush bush = this.Target; diff --git a/LookupAnything/Framework/Lookups/TerrainFeatures/BushTarget.cs b/LookupAnything/Framework/Lookups/TerrainFeatures/BushTarget.cs index 590878155..b344cf060 100644 --- a/LookupAnything/Framework/Lookups/TerrainFeatures/BushTarget.cs +++ b/LookupAnything/Framework/Lookups/TerrainFeatures/BushTarget.cs @@ -18,24 +18,20 @@ internal class BushTarget : GenericTarget public BushTarget(GameHelper gameHelper, Bush value, Func getSubject) : base(gameHelper, SubjectType.Bush, value, value.Tile, getSubject) { } - /// Get the sprite's source rectangle within its texture. + /// public override Rectangle GetSpritesheetArea() { Bush bush = this.Value; return bush.sourceRect.Value; } - /// Get a rectangle which roughly bounds the visible sprite relative the viewport. - /// Reverse-engineered from . + /// public override Rectangle GetWorldArea() { return this.GetSpriteArea(this.Value.getBoundingBox(), this.GetSpritesheetArea()); } - /// Get whether the visible sprite intersects the specified coordinate. This can be an expensive test. - /// The tile to search. - /// The viewport-relative coordinates to search. - /// The approximate sprite area calculated by . + /// /// Reverse engineered from . public override bool SpriteIntersectsPixel(Vector2 tile, Vector2 position, Rectangle spriteArea) { diff --git a/LookupAnything/Framework/Lookups/TerrainFeatures/FruitTreeSubject.cs b/LookupAnything/Framework/Lookups/TerrainFeatures/FruitTreeSubject.cs index bf2972361..3efacb9f0 100644 --- a/LookupAnything/Framework/Lookups/TerrainFeatures/FruitTreeSubject.cs +++ b/LookupAnything/Framework/Lookups/TerrainFeatures/FruitTreeSubject.cs @@ -41,8 +41,7 @@ public FruitTreeSubject(GameHelper gameHelper, FruitTree tree, Vector2 tile) this.Tile = tile; } - /// Get the data to display for this subject. - /// Tree growth algorithm reverse engineered from . + /// public override IEnumerable GetData() { FruitTree tree = this.Target; @@ -127,7 +126,7 @@ public override IEnumerable GetData() } } - /// Get raw debug data to display for this subject. + /// public override IEnumerable GetDebugFields() { FruitTree target = this.Target; @@ -142,11 +141,7 @@ public override IEnumerable GetDebugFields() yield return field; } - /// Draw the subject portrait (if available). - /// The sprite batch being drawn. - /// The position at which to draw. - /// The size of the portrait to draw. - /// Returns true if a portrait was drawn, else false. + /// public override bool DrawPortrait(SpriteBatch spriteBatch, Vector2 position, Vector2 size) { this.Target.drawInMenu(spriteBatch, position, Vector2.Zero, 1, 1); diff --git a/LookupAnything/Framework/Lookups/TerrainFeatures/FruitTreeTarget.cs b/LookupAnything/Framework/Lookups/TerrainFeatures/FruitTreeTarget.cs index 902c98702..4146683e7 100644 --- a/LookupAnything/Framework/Lookups/TerrainFeatures/FruitTreeTarget.cs +++ b/LookupAnything/Framework/Lookups/TerrainFeatures/FruitTreeTarget.cs @@ -33,7 +33,7 @@ public FruitTreeTarget(GameHelper gameHelper, FruitTree value, Vector2 tilePosit this.GetSpriteSheet(value, out this.Texture, out this.SourceRect); } - /// Get the sprite's source rectangle within its texture. + /// public override Rectangle GetSpritesheetArea() { FruitTree tree = this.Value; @@ -61,7 +61,7 @@ public override Rectangle GetSpritesheetArea() return new Rectangle(this.SourceRect.X + ((12 + (tree.IgnoresSeasonsHere() ? 1 : Game1.seasonIndex) * 3) * 16), this.SourceRect.Y, 48, 16 + 64); } - /// Get a rectangle which roughly bounds the visible sprite relative the viewport. + /// /// Reverse-engineered from . public override Rectangle GetWorldArea() { @@ -91,10 +91,7 @@ public override Rectangle GetWorldArea() return new Rectangle(x, y, width, height); } - /// Get whether the visible sprite intersects the specified coordinate. This can be an expensive test. - /// The tile to search. - /// The viewport-relative coordinates to search. - /// The approximate sprite area calculated by . + /// /// Reverse engineered from . public override bool SpriteIntersectsPixel(Vector2 tile, Vector2 position, Rectangle spriteArea) { diff --git a/LookupAnything/Framework/Lookups/TerrainFeatures/TreeSubject.cs b/LookupAnything/Framework/Lookups/TerrainFeatures/TreeSubject.cs index 4d0a27a30..2ea7bbb50 100644 --- a/LookupAnything/Framework/Lookups/TerrainFeatures/TreeSubject.cs +++ b/LookupAnything/Framework/Lookups/TerrainFeatures/TreeSubject.cs @@ -44,7 +44,7 @@ public TreeSubject(ISubjectRegistry codex, GameHelper gameHelper, Tree tree, Vec this.Tile = tile; } - /// Get the data to display for this subject. + /// /// Tree growth algorithm reverse engineered from . public override IEnumerable GetData() { @@ -110,7 +110,7 @@ public override IEnumerable GetData() } } - /// Get the data to display for this subject. + /// public override IEnumerable GetDebugFields() { Tree target = this.Target; @@ -125,11 +125,7 @@ public override IEnumerable GetDebugFields() yield return field; } - /// Draw the subject portrait (if available). - /// The sprite batch being drawn. - /// The position at which to draw. - /// The size of the portrait to draw. - /// Returns true if a portrait was drawn, else false. + /// public override bool DrawPortrait(SpriteBatch spriteBatch, Vector2 position, Vector2 size) { this.Target.drawInMenu(spriteBatch, position, Vector2.Zero, 1, 1); diff --git a/LookupAnything/Framework/Lookups/TerrainFeatures/TreeTarget.cs b/LookupAnything/Framework/Lookups/TerrainFeatures/TreeTarget.cs index 9d1d36c64..ccabde16d 100644 --- a/LookupAnything/Framework/Lookups/TerrainFeatures/TreeTarget.cs +++ b/LookupAnything/Framework/Lookups/TerrainFeatures/TreeTarget.cs @@ -21,7 +21,7 @@ internal class TreeTarget : GenericTarget public TreeTarget(GameHelper gameHelper, Tree value, Vector2 tilePosition, Func getSubject) : base(gameHelper, SubjectType.WildTree, value, tilePosition, getSubject) { } - /// Get the sprite's source rectangle within its texture. + /// public override Rectangle GetSpritesheetArea() { Tree tree = this.Value; @@ -46,17 +46,14 @@ public override Rectangle GetSpritesheetArea() return Tree.treeTopSourceRect; } - /// Get a rectangle which roughly bounds the visible sprite relative the viewport. + /// /// Reverse-engineered from . public override Rectangle GetWorldArea() { return this.GetSpriteArea(this.Value.getBoundingBox(), this.GetSpritesheetArea()); } - /// Get whether the visible sprite intersects the specified coordinate. This can be an expensive test. - /// The tile to search. - /// The viewport-relative coordinates to search. - /// The approximate sprite area calculated by . + /// /// Reverse engineered from . public override bool SpriteIntersectsPixel(Vector2 tile, Vector2 position, Rectangle spriteArea) { diff --git a/LookupAnything/Framework/Lookups/Tiles/CrystalCavePuzzleSubject.cs b/LookupAnything/Framework/Lookups/Tiles/CrystalCavePuzzleSubject.cs index 469b7ebb8..12a35af9d 100644 --- a/LookupAnything/Framework/Lookups/Tiles/CrystalCavePuzzleSubject.cs +++ b/LookupAnything/Framework/Lookups/Tiles/CrystalCavePuzzleSubject.cs @@ -40,7 +40,7 @@ public CrystalCavePuzzleSubject(GameHelper gameHelper, GameLocation location, Ve this.CrystalId = crystalId; } - /// Get the data to display for this subject. + /// public override IEnumerable GetData() { // island crystal puzzle diff --git a/LookupAnything/Framework/Lookups/Tiles/IslandMermaidPuzzleSubject.cs b/LookupAnything/Framework/Lookups/Tiles/IslandMermaidPuzzleSubject.cs index d2fe46263..4c849e1f4 100644 --- a/LookupAnything/Framework/Lookups/Tiles/IslandMermaidPuzzleSubject.cs +++ b/LookupAnything/Framework/Lookups/Tiles/IslandMermaidPuzzleSubject.cs @@ -35,7 +35,7 @@ public IslandMermaidPuzzleSubject(GameHelper gameHelper, GameLocation location, this.ShowPuzzleSolutions = showPuzzleSolutions; } - /// Get the data to display for this subject. + /// public override IEnumerable GetData() { // mermaid puzzle diff --git a/LookupAnything/Framework/Lookups/Tiles/IslandShrinePuzzleSubject.cs b/LookupAnything/Framework/Lookups/Tiles/IslandShrinePuzzleSubject.cs index 7c5c9ab10..37fba3799 100644 --- a/LookupAnything/Framework/Lookups/Tiles/IslandShrinePuzzleSubject.cs +++ b/LookupAnything/Framework/Lookups/Tiles/IslandShrinePuzzleSubject.cs @@ -34,7 +34,7 @@ public IslandShrinePuzzleSubject(GameHelper gameHelper, GameLocation location, V this.ShowPuzzleSolutions = showPuzzleSolutions; } - /// Get the data to display for this subject. + /// public override IEnumerable GetData() { // island shrine puzzle diff --git a/LookupAnything/Framework/Lookups/Tiles/TileSubject.cs b/LookupAnything/Framework/Lookups/Tiles/TileSubject.cs index 8e0b49240..1b28cc971 100644 --- a/LookupAnything/Framework/Lookups/Tiles/TileSubject.cs +++ b/LookupAnything/Framework/Lookups/Tiles/TileSubject.cs @@ -43,7 +43,7 @@ public TileSubject(GameHelper gameHelper, GameLocation location, Vector2 positio this.ShowRawTileInfo = showRawTileInfo; } - /// Get the data to display for this subject. + /// public override IEnumerable GetData() { if (this.ShowRawTileInfo) @@ -74,7 +74,7 @@ public override IEnumerable GetData() } } - /// Get raw debug data to display for this subject. + /// public override IEnumerable GetDebugFields() { string mapTileLabel = I18n.Type_MapTile(); @@ -93,11 +93,7 @@ public override IEnumerable GetDebugFields() yield return new GenericDebugField(field.Label, field.Value, field.HasValue, field.IsPinned) { OverrideCategory = locationLabel }; } - /// Draw the subject portrait (if available). - /// The sprite batch being drawn. - /// The position at which to draw. - /// The size of the portrait to draw. - /// Returns true if a portrait was drawn, else false. + /// public override bool DrawPortrait(SpriteBatch spriteBatch, Vector2 position, Vector2 size) { return false; diff --git a/LookupAnything/Framework/Lookups/Tiles/TileTarget.cs b/LookupAnything/Framework/Lookups/Tiles/TileTarget.cs index b2375370d..9a97e4a67 100644 --- a/LookupAnything/Framework/Lookups/Tiles/TileTarget.cs +++ b/LookupAnything/Framework/Lookups/Tiles/TileTarget.cs @@ -16,7 +16,7 @@ internal class TileTarget : GenericTarget public TileTarget(GameHelper gameHelper, Vector2 position, Func getSubject) : base(gameHelper, SubjectType.Tile, position, position, getSubject) { } - /// Get the sprite's source rectangle within its texture. + /// public override Rectangle GetSpritesheetArea() { return Rectangle.Empty; diff --git a/LookupAnything/ModEntry.cs b/LookupAnything/ModEntry.cs index d357c070e..a71725715 100644 --- a/LookupAnything/ModEntry.cs +++ b/LookupAnything/ModEntry.cs @@ -65,8 +65,7 @@ internal class ModEntry : Mod /********* ** Public methods *********/ - /// The mod entry point, called after the mod is first loaded. - /// Provides methods for interacting with the mod directory, such as read/writing a config file or custom JSON files. + /// public override void Entry(IModHelper helper) { CommonHelper.RemoveObsoleteFiles(this, "LookupAnything.pdb"); // removed in 1.40.0 @@ -105,9 +104,7 @@ public override void Entry(IModHelper helper) /**** ** Event handlers ****/ - /// - /// The event sender. - /// The event data. + /// private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) { if (!this.IsDataValid) @@ -129,9 +126,7 @@ private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) ).Register(); } - /// - /// The event sender. - /// The event data. + /// private void OnDayStarted(object? sender, DayStartedEventArgs e) { if (!this.IsDataValid) @@ -141,9 +136,7 @@ private void OnDayStarted(object? sender, DayStartedEventArgs e) this.GameHelper.ResetCache(this.Monitor); } - /// - /// The event sender. - /// The event data. + /// private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) { if (!this.IsDataValid) @@ -175,9 +168,7 @@ private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) }); } - /// - /// The event sender. - /// The event data. + /// private void OnMenuChanged(object? sender, MenuChangedEventArgs e) { // restore the previous menu if it was hidden to show the lookup UI @@ -188,9 +179,7 @@ private void OnMenuChanged(object? sender, MenuChangedEventArgs e) }); } - /// - /// The event sender. - /// The event data. + /// private void OnRenderedHud(object? sender, RenderedHudEventArgs e) { if (!this.IsDataValid) diff --git a/NoclipMode/ModEntry.cs b/NoclipMode/ModEntry.cs index 2d32e684c..0100e0563 100644 --- a/NoclipMode/ModEntry.cs +++ b/NoclipMode/ModEntry.cs @@ -26,8 +26,7 @@ public class ModEntry : Mod /********* ** Public methods *********/ - /// The mod entry point, called after the mod is first loaded. - /// Provides simplified APIs for writing mods. + /// public override void Entry(IModHelper helper) { CommonHelper.RemoveObsoleteFiles(this, "NoclipMode.pdb"); // removed in 1.3.8 @@ -45,9 +44,7 @@ public override void Entry(IModHelper helper) /********* ** Private methods *********/ - /// - /// The event sender. - /// The event data. + /// private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) { // add Generic Mod Config Menu integration @@ -61,9 +58,7 @@ private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) ).Register(); } - /// - /// The event sender. - /// The event data. + /// private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) { if (this.CanToggle() && this.ToggleKey.JustPressed()) diff --git a/SkipIntro/ModEntry.cs b/SkipIntro/ModEntry.cs index 560dc4bc9..4a30d0234 100644 --- a/SkipIntro/ModEntry.cs +++ b/SkipIntro/ModEntry.cs @@ -29,8 +29,7 @@ internal class ModEntry : Mod /********* ** Public methods *********/ - /// The mod entry point, called after the mod is first loaded. - /// Provides methods for interacting with the mod directory, such as read/writing a config file or custom JSON files. + /// public override void Entry(IModHelper helper) { I18n.Init(helper.Translation); @@ -50,9 +49,7 @@ public override void Entry(IModHelper helper) /**** ** Event handlers ****/ - /// - /// The event sender. - /// The event data. + /// private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) { // add Generic Mod Config Menu integration @@ -70,9 +67,7 @@ private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) ).Register(); } - /// - /// The event sender. - /// The event data. + /// private void OnMenuChanged(object? sender, MenuChangedEventArgs e) { if (Constants.TargetPlatform == GamePlatform.Android) @@ -82,9 +77,7 @@ private void OnMenuChanged(object? sender, MenuChangedEventArgs e) this.CurrentStage = Stage.SkipIntro; } - /// - /// The event sender. - /// The event data. + /// private void OnUpdateTicked(object? sender, UpdateTickedEventArgs e) { try diff --git a/SmallBeachFarm/ModEntry.cs b/SmallBeachFarm/ModEntry.cs index 15d317c79..187fe01f2 100644 --- a/SmallBeachFarm/ModEntry.cs +++ b/SmallBeachFarm/ModEntry.cs @@ -70,9 +70,7 @@ public override void Entry(IModHelper helper) /********* ** Private methods *********/ - /// - /// The event sender. - /// The event data. + /// private void OnAssetRequested(object? sender, AssetRequestedEventArgs e) { const string farmKey = "Pathoschild_SmallBeachFarm"; @@ -199,9 +197,7 @@ private void OnAssetRequested(object? sender, AssetRequestedEventArgs e) } } - /// - /// The event sender. - /// The event data. + /// private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) { // add Generic Mod Config Menu integration diff --git a/TestMod/ModEntry.cs b/TestMod/ModEntry.cs index 0825e1746..01985bd8d 100644 --- a/TestMod/ModEntry.cs +++ b/TestMod/ModEntry.cs @@ -22,8 +22,7 @@ internal class ModEntry : Mod /********* ** Public methods *********/ - /// The mod entry point, called after the mod is first loaded. - /// Provides simplified APIs for writing mods. + /// public override void Entry(IModHelper helper) { helper.Events.Content.AssetRequested += this.OnAssetRequested; @@ -34,9 +33,7 @@ public override void Entry(IModHelper helper) /********* ** Private methods *********/ - /// - /// The event sender. - /// The event data. + /// private void OnAssetRequested(object? sender, AssetRequestedEventArgs e) { this.LoadedAssets.Add(e.Name); @@ -52,9 +49,7 @@ private void OnAssetRequested(object? sender, AssetRequestedEventArgs e) //} } - /// - /// The event sender. - /// The event data. + /// private void OnButtonPressed(object? sender, ButtonPressedEventArgs e) { // print list of loaded assets diff --git a/TractorMod/Framework/Attachments/AxeAttachment.cs b/TractorMod/Framework/Attachments/AxeAttachment.cs index 0df584a3f..effe4f54b 100644 --- a/TractorMod/Framework/Attachments/AxeAttachment.cs +++ b/TractorMod/Framework/Attachments/AxeAttachment.cs @@ -47,24 +47,13 @@ public AxeAttachment(AxeConfig config, IModRegistry modRegistry, IReflectionHelp this.Reflection = reflection; } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return tool is Axe; } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { tool = tool.AssertNotNull(); diff --git a/TractorMod/Framework/Attachments/CustomAttachment.cs b/TractorMod/Framework/Attachments/CustomAttachment.cs index 1aebaf5dc..bdceab03d 100644 --- a/TractorMod/Framework/Attachments/CustomAttachment.cs +++ b/TractorMod/Framework/Attachments/CustomAttachment.cs @@ -30,11 +30,7 @@ public CustomAttachment(string[] customAttachments, IModRegistry modRegistry) this.CustomNames = new InvariantSet(customAttachments); } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return @@ -42,14 +38,7 @@ public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocati || (item != null && this.CustomNames.Contains(item.Name)); } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { // apply melee weapon diff --git a/TractorMod/Framework/Attachments/FertilizerAttachment.cs b/TractorMod/Framework/Attachments/FertilizerAttachment.cs index 51db9cd05..098feaa31 100644 --- a/TractorMod/Framework/Attachments/FertilizerAttachment.cs +++ b/TractorMod/Framework/Attachments/FertilizerAttachment.cs @@ -34,11 +34,7 @@ public FertilizerAttachment(GenericAttachmentConfig config, IModRegistry modRegi this.Reflection = reflection; } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return @@ -46,14 +42,7 @@ public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocati && item is { Category: SObject.fertilizerCategory, Stack: > 0 }; } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { if (item == null || item.Stack <= 0) diff --git a/TractorMod/Framework/Attachments/GrassStarterAttachment.cs b/TractorMod/Framework/Attachments/GrassStarterAttachment.cs index 5ae6a9a1f..f25c9af81 100644 --- a/TractorMod/Framework/Attachments/GrassStarterAttachment.cs +++ b/TractorMod/Framework/Attachments/GrassStarterAttachment.cs @@ -29,11 +29,7 @@ public GrassStarterAttachment(GenericAttachmentConfig config, IModRegistry modRe this.Config = config; } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return @@ -41,14 +37,7 @@ public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocati && item is { QualifiedItemId: "(O)297" or "(O)BlueGrassStarter", Stack: > 0 }; } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { if (item is not SObject obj || obj.Stack <= 0) diff --git a/TractorMod/Framework/Attachments/HoeAttachment.cs b/TractorMod/Framework/Attachments/HoeAttachment.cs index de809d3ec..ed5733622 100644 --- a/TractorMod/Framework/Attachments/HoeAttachment.cs +++ b/TractorMod/Framework/Attachments/HoeAttachment.cs @@ -35,11 +35,7 @@ public HoeAttachment(HoeConfig config, IModRegistry modRegistry) this.Config = config; } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return @@ -47,14 +43,7 @@ public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocati && tool is Hoe; } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { tool = tool.AssertNotNull(); diff --git a/TractorMod/Framework/Attachments/MeleeBluntAttachment.cs b/TractorMod/Framework/Attachments/MeleeBluntAttachment.cs index 7022c02b8..82cc83bf5 100644 --- a/TractorMod/Framework/Attachments/MeleeBluntAttachment.cs +++ b/TractorMod/Framework/Attachments/MeleeBluntAttachment.cs @@ -31,25 +31,14 @@ public MeleeBluntAttachment(MeleeBluntConfig config, IModRegistry modRegistry) this.Config = config; } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return tool is MeleeWeapon { type.Value: not (MeleeWeapon.dagger or MeleeWeapon.defenseSword) }; } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { tool = tool.AssertNotNull(); diff --git a/TractorMod/Framework/Attachments/MeleeDaggerAttachment.cs b/TractorMod/Framework/Attachments/MeleeDaggerAttachment.cs index ac74a47cf..d5cfc7433 100644 --- a/TractorMod/Framework/Attachments/MeleeDaggerAttachment.cs +++ b/TractorMod/Framework/Attachments/MeleeDaggerAttachment.cs @@ -33,24 +33,13 @@ public MeleeDaggerAttachment(MeleeDaggerConfig config, IModRegistry modRegistry) this.Config = config; } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return tool is MeleeWeapon { type.Value: MeleeWeapon.dagger }; } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { tool = tool.AssertNotNull(); diff --git a/TractorMod/Framework/Attachments/MeleeSwordAttachment.cs b/TractorMod/Framework/Attachments/MeleeSwordAttachment.cs index 6cd22c3f5..98f86b408 100644 --- a/TractorMod/Framework/Attachments/MeleeSwordAttachment.cs +++ b/TractorMod/Framework/Attachments/MeleeSwordAttachment.cs @@ -31,11 +31,7 @@ public MeleeSwordAttachment(MeleeSwordConfig config, IModRegistry modRegistry) this.Config = config; } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return @@ -43,14 +39,7 @@ public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocati && !weapon.isScythe(); } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { tool = tool.AssertNotNull(); diff --git a/TractorMod/Framework/Attachments/MilkPailAttachment.cs b/TractorMod/Framework/Attachments/MilkPailAttachment.cs index dbe050de6..16db26caf 100644 --- a/TractorMod/Framework/Attachments/MilkPailAttachment.cs +++ b/TractorMod/Framework/Attachments/MilkPailAttachment.cs @@ -35,11 +35,7 @@ public MilkPailAttachment(GenericAttachmentConfig config, IModRegistry modRegist this.Config = config; } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return @@ -47,14 +43,7 @@ public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocati && tool is MilkPail; } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { MilkPail milkPail = (MilkPail)tool.AssertNotNull(); diff --git a/TractorMod/Framework/Attachments/PickaxeAttachment.cs b/TractorMod/Framework/Attachments/PickaxeAttachment.cs index a136d6249..5dc9af599 100644 --- a/TractorMod/Framework/Attachments/PickaxeAttachment.cs +++ b/TractorMod/Framework/Attachments/PickaxeAttachment.cs @@ -48,24 +48,13 @@ public PickaxeAttachment(PickAxeConfig config, IModRegistry modRegistry, IReflec this.Reflection = reflection; } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return tool is Pickaxe; } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { tool = tool.AssertNotNull(); diff --git a/TractorMod/Framework/Attachments/ScytheAttachment.cs b/TractorMod/Framework/Attachments/ScytheAttachment.cs index 9a55ea129..b4a72fa44 100644 --- a/TractorMod/Framework/Attachments/ScytheAttachment.cs +++ b/TractorMod/Framework/Attachments/ScytheAttachment.cs @@ -50,11 +50,7 @@ public ScytheAttachment(ScytheConfig config, IModRegistry modRegistry, IReflecti this.Reflection = reflection; } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return @@ -62,14 +58,7 @@ tool is MeleeWeapon weapon && weapon.isScythe(); } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { tool = tool.AssertNotNull(); @@ -131,8 +120,7 @@ public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileF return false; } - /// Method called when the tractor attachments have been activated for a location. - /// The current tractor location. + /// public override void OnActivated(GameLocation location) { base.OnActivated(location); diff --git a/TractorMod/Framework/Attachments/SeedAttachment.cs b/TractorMod/Framework/Attachments/SeedAttachment.cs index 889e3a4d3..547f7425d 100644 --- a/TractorMod/Framework/Attachments/SeedAttachment.cs +++ b/TractorMod/Framework/Attachments/SeedAttachment.cs @@ -37,11 +37,7 @@ public SeedAttachment(GenericAttachmentConfig config, IModRegistry modRegistry, this.Reflection = reflection; } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return @@ -49,14 +45,7 @@ public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocati && item is { Category: SObject.SeedsCategory, Stack: > 0 }; } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { if (item is not { Stack: > 0 }) diff --git a/TractorMod/Framework/Attachments/ShearsAttachment.cs b/TractorMod/Framework/Attachments/ShearsAttachment.cs index 979a1a2d0..0ed48e095 100644 --- a/TractorMod/Framework/Attachments/ShearsAttachment.cs +++ b/TractorMod/Framework/Attachments/ShearsAttachment.cs @@ -35,11 +35,7 @@ public ShearsAttachment(GenericAttachmentConfig config, IModRegistry modRegistry this.Config = config; } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return @@ -47,14 +43,7 @@ public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocati && tool is Shears; } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { Shears shears = (Shears)tool.AssertNotNull(); diff --git a/TractorMod/Framework/Attachments/SlingshotAttachment.cs b/TractorMod/Framework/Attachments/SlingshotAttachment.cs index 78d8b42c4..fa12904a5 100644 --- a/TractorMod/Framework/Attachments/SlingshotAttachment.cs +++ b/TractorMod/Framework/Attachments/SlingshotAttachment.cs @@ -31,11 +31,7 @@ public SlingshotAttachment(GenericAttachmentConfig config, IModRegistry modRegis this.Config = config; } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return @@ -43,14 +39,7 @@ public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocati && tool is Slingshot; } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { Slingshot slingshot = (Slingshot)tool.AssertNotNull(); diff --git a/TractorMod/Framework/Attachments/WateringCanAttachment.cs b/TractorMod/Framework/Attachments/WateringCanAttachment.cs index 7d93044a7..03cf6a6cb 100644 --- a/TractorMod/Framework/Attachments/WateringCanAttachment.cs +++ b/TractorMod/Framework/Attachments/WateringCanAttachment.cs @@ -39,11 +39,7 @@ public WateringCanAttachment(GenericAttachmentConfig config, IModRegistry modReg this.Config = config; } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return @@ -51,14 +47,7 @@ public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocati && tool is WateringCan; } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// /// Volcano logic derived from . public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { diff --git a/TractorMod/Framework/AudioManager.cs b/TractorMod/Framework/AudioManager.cs index 78f87ced2..46aa6e2d4 100644 --- a/TractorMod/Framework/AudioManager.cs +++ b/TractorMod/Framework/AudioManager.cs @@ -53,8 +53,7 @@ public AudioManager(string directoryPath, Func isActive, Func getVolu this.GetVolume = getVolume; } - /// - /// The event data. + /// public void OnAssetRequested(AssetRequestedEventArgs e) { if (e.NameWithoutLocale.IsEquivalentTo("Data/AudioChanges")) diff --git a/TractorMod/Framework/ModAttachments/SeedBagAttachment.cs b/TractorMod/Framework/ModAttachments/SeedBagAttachment.cs index c423df6e3..79d2e60cb 100644 --- a/TractorMod/Framework/ModAttachments/SeedBagAttachment.cs +++ b/TractorMod/Framework/ModAttachments/SeedBagAttachment.cs @@ -37,11 +37,7 @@ public SeedBagAttachment(GenericAttachmentConfig config, IModRegistry modRegistr this.Config = config; } - /// Get whether the tool is currently enabled. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocation location) { return @@ -49,14 +45,7 @@ public override bool IsEnabled(Farmer player, Tool? tool, Item? item, GameLocati && tool is { Name: "Seed Bag" }; } - /// Apply the tool to the given tile. - /// The tile to modify. - /// The object on the tile. - /// The feature on the tile. - /// The current player. - /// The tool selected by the player (if any). - /// The item selected by the player (if any). - /// The current location. + /// public override bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location) { tool = tool.AssertNotNull(); diff --git a/TractorMod/Framework/TextureManager.cs b/TractorMod/Framework/TextureManager.cs index 350eb0ee5..86f265ad0 100644 --- a/TractorMod/Framework/TextureManager.cs +++ b/TractorMod/Framework/TextureManager.cs @@ -96,8 +96,7 @@ public void ApplyTextures(Horse? horse, Func isTractor) horse!.Sprite.spriteTexture = this.TractorTexture; } - /// - /// The event data. + /// public void OnAssetRequested(AssetRequestedEventArgs e) { // Allow for garages from older versions that didn't get normalized correctly. diff --git a/TractorMod/ModEntry.cs b/TractorMod/ModEntry.cs index 44775b12d..19d46f35e 100644 --- a/TractorMod/ModEntry.cs +++ b/TractorMod/ModEntry.cs @@ -75,8 +75,7 @@ internal class ModEntry : Mod /********* ** Public methods *********/ - /// The mod entry point, called after the mod is first loaded. - /// Provides simplified APIs for writing mods. + /// public override void Entry(IModHelper helper) { CommonHelper.RemoveObsoleteFiles(this, "TractorMod.pdb"); // removed in 4.16.5 @@ -135,9 +134,7 @@ public override void Entry(IModHelper helper) /**** ** Event handlers ****/ - /// - /// The event sender. - /// The event data. + /// private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) { // add Generic Mod Config Menu integration @@ -164,9 +161,7 @@ private void OnGameLaunched(object? sender, GameLaunchedEventArgs e) this.Monitor.Log("The 'Harvest With Scythe' mod is compatible with Tractor Mod, but it may break some tractor scythe features. You can ignore this warning if you don't have any scythe issues.", LogLevel.Warn); } - /// - /// The event sender. - /// The event data. + /// private void OnSaveLoaded(object? sender, SaveLoadedEventArgs e) { // load legacy data @@ -192,9 +187,7 @@ private void OnSaveLoaded(object? sender, SaveLoadedEventArgs e) } } - /// - /// The event sender. - /// The event data. + /// private void OnDayStarted(object? sender, DayStartedEventArgs e) { if (!this.IsEnabled) @@ -274,9 +267,7 @@ private void OnDayStarted(object? sender, DayStartedEventArgs e) } } - /// - /// The event sender. - /// The event data. + /// private void OnAssetRequested(object? sender, AssetRequestedEventArgs e) { this.AudioManager.OnAssetRequested(e); @@ -316,17 +307,13 @@ private void OnAssetRequested(object? sender, AssetRequestedEventArgs e) } } - /// - /// The event sender. - /// The event data. + /// private void OnLocaleChanged(object? sender, LocaleChangedEventArgs e) { this.Helper.GameContent.InvalidateCache("Data/Buildings"); } - /// - /// The event sender. - /// The event data. + /// private void OnLocationListChanged(object? sender, LocationListChangedEventArgs e) { if (!this.IsEnabled) @@ -343,9 +330,7 @@ private void OnLocationListChanged(object? sender, LocationListChangedEventArgs } } - /// - /// The event sender. - /// The event data. + /// private void OnNpcListChanged(object? sender, NpcListChangedEventArgs e) { if (!this.IsEnabled) @@ -367,9 +352,7 @@ private void OnNpcListChanged(object? sender, NpcListChangedEventArgs e) } } - /// - /// The event sender. - /// The event data. + /// private void OnWarped(object? sender, WarpedEventArgs e) { if (!e.IsLocalPlayer || !this.TractorManager.IsCurrentPlayerRiding) @@ -386,9 +369,7 @@ private void OnWarped(object? sender, WarpedEventArgs e) Game1.player.mount.dismount(); } - /// - /// The event sender. - /// The event data. + /// private void OnUpdateTicked(object? sender, UpdateTickedEventArgs e) { if (!this.IsEnabled) @@ -412,9 +393,7 @@ private void OnUpdateTicked(object? sender, UpdateTickedEventArgs e) this.AudioManager.SetEngineState(EngineState.Stop); } - /// - /// The event sender. - /// The event data. + /// private void OnDayEnding(object? sender, DayEndingEventArgs e) { if (!this.IsEnabled) @@ -436,25 +415,19 @@ private void OnDayEnding(object? sender, DayEndingEventArgs e) } } - /// - /// The event sender. - /// The event data. + /// private void OnReturnedToTitle(object? sender, ReturnedToTitleEventArgs e) { this.AudioManager.SetEngineState(EngineState.Stop); } - /// - /// The event sender. - /// The event data. + /// private void OnSaved(object? sender, SavedEventArgs e) { Migrator.AfterSave(); } - /// - /// The event sender. - /// The event data. + /// private void OnRenderedWorld(object? sender, RenderedWorldEventArgs e) { if (!this.IsEnabled) @@ -465,9 +438,7 @@ private void OnRenderedWorld(object? sender, RenderedWorldEventArgs e) this.TractorManager.DrawRadius(Game1.spriteBatch); } - /// - /// The event sender. - /// The event data. + /// private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) { if (!this.IsEnabled || !Context.IsPlayerFree) @@ -479,9 +450,7 @@ private void OnButtonsChanged(object? sender, ButtonsChangedEventArgs e) this.DismissTractor(Game1.player.mount); } - /// - /// The event sender. - /// The event data. + /// private void OnModMessageReceived(object? sender, ModMessageReceivedEventArgs e) { // tractor request from a farmhand diff --git a/_archived/RotateToolbar/ModEntry.cs b/_archived/RotateToolbar/ModEntry.cs index 977fac563..43b112365 100644 --- a/_archived/RotateToolbar/ModEntry.cs +++ b/_archived/RotateToolbar/ModEntry.cs @@ -24,8 +24,7 @@ internal class ModEntry : Mod /********* ** Public methods *********/ - /// The mod entry point, called after the mod is first loaded. - /// Provides methods for interacting with the mod directory, such as read/writing a config file or custom JSON files. + /// public override void Entry(IModHelper helper) { // read config @@ -42,9 +41,7 @@ public override void Entry(IModHelper helper) /**** ** Event handlers ****/ - /// Raised after the player presses any buttons on the keyboard, controller, or mouse. - /// The event sender. - /// The event data. + /// private void OnButtonsChanged(object sender, ButtonsChangedEventArgs e) { if (!Context.IsWorldReady) diff --git a/_archived/TheLongNight/ModEntry.cs b/_archived/TheLongNight/ModEntry.cs index 10fcb2e36..c8d69379e 100644 --- a/_archived/TheLongNight/ModEntry.cs +++ b/_archived/TheLongNight/ModEntry.cs @@ -21,8 +21,7 @@ internal class ModEntry : Mod, IAssetEditor /********* ** Public methods *********/ - /// The mod entry point, called after the mod is first loaded. - /// Provides simplified APIs for writing mods. + /// public override void Entry(IModHelper helper) { helper.Events.GameLoop.UpdateTicked += this.OnUpdateTicked; @@ -56,9 +55,7 @@ public void Edit(IAssetData asset) /********* ** Private methods *********/ - /// The method invoked after the game updates (roughly 60 times per second). - /// The event sender. - /// The event arguments. + /// /// /// All times are shown in the game's internal format, which is essentially military time with support for /// times past midnight (e.g. 2400 is midnight, 2600 is 2am). From 4eee0324ab739ad7e550ebe56e27c67653a04580 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 8 Oct 2024 22:37:39 -0400 Subject: [PATCH 05/16] reduce allocations in Data Layers This commit... - uses `ref readonly` for the main layer.Update arguments; - reuses `VisibleTiles` and `TileGroups` hash sets instead of creating new arrays each update; - passes hash sets to the layers so they can use O(1) tile lookups in future versions; - and reduces array copies within layer logic (e.g. `ToArray()`). --- .../Framework/Commands/ExportCommand.cs | 5 +++- DataLayers/Framework/DataLayerOverlay.cs | 28 +++++++++---------- DataLayers/Framework/ILayer.cs | 3 +- DataLayers/Layers/AccessibleLayer.cs | 4 +-- DataLayers/Layers/BaseLayer.cs | 3 +- DataLayers/Layers/BuildableLayer.cs | 13 +++++---- DataLayers/Layers/Coverage/BeeHouseLayer.cs | 19 ++++--------- DataLayers/Layers/Coverage/JunimoHutLayer.cs | 23 +++++++-------- DataLayers/Layers/Coverage/ScarecrowLayer.cs | 21 ++++---------- DataLayers/Layers/Coverage/SprinklerLayer.cs | 21 ++++---------- .../Layers/Crops/CropFertilizerLayer.cs | 4 +-- DataLayers/Layers/Crops/CropHarvestLayer.cs | 12 ++++---- .../Layers/Crops/CropPaddyWaterLayer.cs | 16 +++++++---- DataLayers/Layers/Crops/CropWaterLayer.cs | 6 ++-- DataLayers/Layers/GridLayer.cs | 3 +- DataLayers/Layers/MachineLayer.cs | 25 ++++++----------- DataLayers/Layers/TillableLayer.cs | 20 ++++++------- 17 files changed, 98 insertions(+), 128 deletions(-) diff --git a/DataLayers/Framework/Commands/ExportCommand.cs b/DataLayers/Framework/Commands/ExportCommand.cs index 86494216e..aa173a95f 100644 --- a/DataLayers/Framework/Commands/ExportCommand.cs +++ b/DataLayers/Framework/Commands/ExportCommand.cs @@ -108,7 +108,10 @@ private IEnumerable GetTileGroups(ILayer layer) int height = location.Map.Layers.Max(p => p.LayerHeight); var visibleArea = new Rectangle(0, 0, width, height); - return layer.Update(Game1.currentLocation, visibleArea, visibleArea.GetTiles().ToArray(), new Vector2(0, 0)); + IReadOnlySet visibleTiles = new HashSet(visibleArea.GetTiles()); + Vector2 cursorTile = Vector2.Zero; + + return layer.Update(ref location, ref visibleArea, ref visibleTiles, ref cursorTile); } /// A group of tiles associated with a given legend. diff --git a/DataLayers/Framework/DataLayerOverlay.cs b/DataLayers/Framework/DataLayerOverlay.cs index 934b5996f..47f1943bf 100644 --- a/DataLayers/Framework/DataLayerOverlay.cs +++ b/DataLayers/Framework/DataLayerOverlay.cs @@ -10,6 +10,7 @@ using StardewModdingAPI; using StardewModdingAPI.Events; using StardewValley; +using StardewValley.Extensions; using StardewValley.Menus; namespace Pathoschild.Stardew.DataLayers.Framework @@ -51,17 +52,11 @@ internal class DataLayerOverlay : BaseOverlay /// When two groups of the same color overlap, draw one border around their edges instead of their individual borders. private readonly bool CombineOverlappingBorders; - /// An empty set of tiles. - private readonly Vector2[] EmptyTiles = []; - - /// An empty set of tile groups. - private readonly TileGroup[] EmptyTileGroups = []; - /// The visible tiles. - private Vector2[] VisibleTiles = []; + private readonly HashSet VisibleTiles = new(); /// The tile layer data to render. - private TileGroup[] TileGroups; + private readonly List TileGroups = new(); /// The tick countdown until the next layer update. private int UpdateCountdown; @@ -161,12 +156,12 @@ public void TrySetLayer(string? id) /// Switch to the given data layer. /// The data layer to select. - [MemberNotNull(nameof(DataLayerOverlay.CurrentLayer), nameof(DataLayerOverlay.Legend), nameof(DataLayerOverlay.LegendEntries), nameof(DataLayerOverlay.NextButton), nameof(DataLayerOverlay.PrevButton), nameof(DataLayerOverlay.TileGroups))] + [MemberNotNull(nameof(DataLayerOverlay.CurrentLayer), nameof(DataLayerOverlay.Legend), nameof(DataLayerOverlay.LegendEntries), nameof(DataLayerOverlay.NextButton), nameof(DataLayerOverlay.PrevButton))] public void SetLayer(ILayer layer) { this.CurrentLayer = layer; this.LegendEntries = this.CurrentLayer.Legend.ToArray(); - this.TileGroups = this.EmptyTileGroups; + this.TileGroups.Clear(); this.UpdateCountdown = 0; this.ReinitializeComponents(); @@ -185,8 +180,8 @@ public void UpdateDataLayer() // get updated tiles if (Game1.currentLocation == null) { - this.VisibleTiles = this.EmptyTiles; - this.TileGroups = this.EmptyTileGroups; + this.VisibleTiles.Clear(); + this.TileGroups.Clear(); } else { @@ -195,8 +190,13 @@ public void UpdateDataLayer() { GameLocation location = Game1.currentLocation; Vector2 cursorTile = TileHelper.GetTileFromCursor(); - this.VisibleTiles = visibleArea.GetTiles().ToArray(); - this.TileGroups = this.CurrentLayer.Update(location, visibleArea, this.VisibleTiles, cursorTile).ToArray(); + + this.VisibleTiles.Clear(); + this.VisibleTiles.AddRange(visibleArea.GetTiles()); + + this.TileGroups.Clear(); + this.TileGroups.AddRange(this.CurrentLayer.Update(location, visibleArea, this.VisibleTiles, cursorTile)); + this.LastVisibleArea = visibleArea; this.UpdateCountdown = this.CurrentLayer.UpdateTickRate; } diff --git a/DataLayers/Framework/ILayer.cs b/DataLayers/Framework/ILayer.cs index 521ffb11f..086d992ab 100644 --- a/DataLayers/Framework/ILayer.cs +++ b/DataLayers/Framework/ILayer.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using Microsoft.Xna.Framework; using StardewModdingAPI.Utilities; using StardewValley; @@ -40,6 +41,6 @@ internal interface ILayer /// The tile area currently visible on the screen. /// The tile positions currently visible on the screen. /// The tile position under the cursor. - TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile); + TileGroup[] Update(ref readonly GameLocation location, ref readonly Rectangle visibleArea, ref readonly IReadOnlySet visibleTiles, ref readonly Vector2 cursorTile); } } diff --git a/DataLayers/Layers/AccessibleLayer.cs b/DataLayers/Layers/AccessibleLayer.cs index d43616ceb..9686ead9d 100644 --- a/DataLayers/Layers/AccessibleLayer.cs +++ b/DataLayers/Layers/AccessibleLayer.cs @@ -59,7 +59,7 @@ public AccessibleLayer(LayerConfig config, ColorScheme colors) } /// - public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) + public override TileGroup[] Update(ref readonly GameLocation location, ref readonly Rectangle visibleArea, ref readonly IReadOnlySet visibleTiles, ref readonly Vector2 cursorTile) { List passableTiles = new(); List warpTiles = new(); @@ -122,7 +122,7 @@ private TileData AdjustWarpTileIfOffScreen(TileData tile) /// Get the updated data layer tiles. /// The current location. /// The tiles currently visible on the screen. - private IEnumerable GetTiles(GameLocation location, IEnumerable visibleTiles) + private IEnumerable GetTiles(GameLocation location, IReadOnlySet visibleTiles) { // get building warps HashSet buildingDoors = []; diff --git a/DataLayers/Layers/BaseLayer.cs b/DataLayers/Layers/BaseLayer.cs index 373ea7e4d..891fbd782 100644 --- a/DataLayers/Layers/BaseLayer.cs +++ b/DataLayers/Layers/BaseLayer.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using Microsoft.Xna.Framework; using Pathoschild.Stardew.DataLayers.Framework; using StardewModdingAPI.Utilities; @@ -40,7 +41,7 @@ internal abstract class BaseLayer : ILayer ** Public methods *********/ /// - public abstract TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile); + public abstract TileGroup[] Update(ref readonly GameLocation location, ref readonly Rectangle visibleArea, ref readonly IReadOnlySet visibleTiles, ref readonly Vector2 cursorTile); /********* diff --git a/DataLayers/Layers/BuildableLayer.cs b/DataLayers/Layers/BuildableLayer.cs index 09b32fab1..34be94e27 100644 --- a/DataLayers/Layers/BuildableLayer.cs +++ b/DataLayers/Layers/BuildableLayer.cs @@ -42,14 +42,15 @@ public BuildableLayer(LayerConfig config, ColorScheme colors) } /// - public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) + public override TileGroup[] Update(ref readonly GameLocation location, ref readonly Rectangle visibleArea, ref readonly IReadOnlySet visibleTiles, ref readonly Vector2 cursorTile) { - TileData[] tiles = this.GetTiles(location, visibleTiles).ToArray(); - TileData[] buildableTiles = tiles.Where(p => p.Type.Id == this.Buildable.Id).ToArray(); + var buildableTiles = this + .GetTiles(location, visibleTiles) + .ToLookup(p => p.Type.Id == this.Buildable.Id); return [ - new TileGroup(buildableTiles, outerBorderColor: this.Buildable.Color), - new TileGroup(tiles.Except(buildableTiles)) + new TileGroup(buildableTiles[true], outerBorderColor: this.Buildable.Color), + new TileGroup(buildableTiles[false]) ]; } @@ -60,7 +61,7 @@ public override TileGroup[] Update(GameLocation location, in Rectangle visibleAr /// Get the updated data layer tiles. /// The current location. /// The tiles currently visible on the screen. - private IEnumerable GetTiles(GameLocation location, IEnumerable visibleTiles) + private IEnumerable GetTiles(GameLocation location, IReadOnlySet visibleTiles) { // buildable location if (location.IsBuildableLocation()) diff --git a/DataLayers/Layers/Coverage/BeeHouseLayer.cs b/DataLayers/Layers/Coverage/BeeHouseLayer.cs index 2e9e601a2..eaac6ce3d 100644 --- a/DataLayers/Layers/Coverage/BeeHouseLayer.cs +++ b/DataLayers/Layers/Coverage/BeeHouseLayer.cs @@ -49,24 +49,15 @@ public BeeHouseLayer(LayerConfig config, ColorScheme colors) } /// - public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) + public override TileGroup[] Update(ref readonly GameLocation location, ref readonly Rectangle visibleArea, ref readonly IReadOnlySet visibleTiles, ref readonly Vector2 cursorTile) { - // get bee houses - Vector2[] searchTiles = visibleArea.Expand(this.MaxRadius).GetTiles().ToArray(); - SObject[] beeHouses = - ( - from Vector2 tile in searchTiles - where location.objects.ContainsKey(tile) - let beeHouse = location.objects[tile] - where this.IsBeeHouse(beeHouse) - select beeHouse - ) - .ToArray(); - // yield coverage var groups = new List(); - foreach (SObject beeHouse in beeHouses) + foreach (Vector2 origin in visibleArea.Expand(this.MaxRadius).GetTiles()) { + if (!location.objects.TryGetValue(origin, out SObject beeHouse) || !this.IsBeeHouse(beeHouse)) + continue; + TileData[] tiles = this .GetCoverage(location, beeHouse.TileLocation) .Select(pos => new TileData(pos, this.Covered)) diff --git a/DataLayers/Layers/Coverage/JunimoHutLayer.cs b/DataLayers/Layers/Coverage/JunimoHutLayer.cs index aaf1b5363..b7d71d28c 100644 --- a/DataLayers/Layers/Coverage/JunimoHutLayer.cs +++ b/DataLayers/Layers/Coverage/JunimoHutLayer.cs @@ -50,26 +50,23 @@ public JunimoHutLayer(LayerConfig config, ColorScheme colors, ModIntegrations mo } /// - public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) + public override TileGroup[] Update(ref readonly GameLocation location, ref readonly Rectangle visibleArea, ref readonly IReadOnlySet visibleTiles, ref readonly Vector2 cursorTile) { if (!location.IsBuildableLocation()) return []; - // get Junimo huts - Rectangle searchArea = visibleArea; - JunimoHut[] huts = - ( - from JunimoHut hut in location.buildings.OfType() - where new Rectangle(hut.tileX.Value + 1, hut.tileY.Value + 1, hut.cropHarvestRadius, hut.cropHarvestRadius).Intersects(searchArea) // range centered on hut door - select hut - ) - .ToArray(); - // yield Junimo hut coverage var groups = new List(); var covered = new HashSet(); - foreach (JunimoHut hut in huts) + foreach (Building building in location.buildings) { + if (building is not JunimoHut hut) + continue; + + var range = new Rectangle(hut.tileX.Value + 1, hut.tileY.Value + 1, hut.cropHarvestRadius, hut.cropHarvestRadius); // range centered on hut door + if (!range.Intersects(visibleArea)) + continue; + TileData[] tiles = this .GetCoverage(hut, hut.tileX.Value, hut.tileY.Value) .Select(pos => new TileData(pos, this.Covered)) @@ -161,7 +158,7 @@ private IEnumerable GetCoverage(JunimoHut hut, int tileX, int tileY) /// The current location. /// The tiles currently visible on the screen. /// The tiles harvested by Junimo huts. - private IEnumerable GetUnharvestedCrops(GameLocation location, Vector2[] visibleTiles, HashSet coveredTiles) + private IEnumerable GetUnharvestedCrops(GameLocation location, IReadOnlySet visibleTiles, HashSet coveredTiles) { foreach (Vector2 tile in visibleTiles) { diff --git a/DataLayers/Layers/Coverage/ScarecrowLayer.cs b/DataLayers/Layers/Coverage/ScarecrowLayer.cs index 09de0e1dd..c6f1048b7 100644 --- a/DataLayers/Layers/Coverage/ScarecrowLayer.cs +++ b/DataLayers/Layers/Coverage/ScarecrowLayer.cs @@ -47,25 +47,16 @@ public ScarecrowLayer(LayerConfig config, ColorScheme colors) } /// - public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) + public override TileGroup[] Update(ref readonly GameLocation location, ref readonly Rectangle visibleArea, ref readonly IReadOnlySet visibleTiles, ref readonly Vector2 cursorTile) { - // get scarecrows - Vector2[] searchTiles = visibleArea.Expand(this.MaxSearchRadius).GetTiles().ToArray(); - SObject[] scarecrows = - ( - from Vector2 tile in searchTiles - where location.objects.ContainsKey(tile) - let scarecrow = location.objects[tile] - where scarecrow.IsScarecrow() - select scarecrow - ) - .ToArray(); - // yield scarecrow coverage var covered = new HashSet(); var groups = new List(); - foreach (SObject scarecrow in scarecrows) + foreach (Vector2 origin in visibleArea.Expand(this.MaxSearchRadius).GetTiles()) { + if (!location.objects.TryGetValue(origin, out Object scarecrow) || !scarecrow.IsScarecrow()) + continue; + TileData[] tiles = this .GetCoverage(scarecrow) .Select(pos => new TileData(pos, this.Covered)) @@ -131,7 +122,7 @@ private IEnumerable GetCoverage(SObject scarecrow, Vector2? overrideOri /// The current location. /// The tiles currently visible on the screen. /// The tiles protected by a scarecrow. - private IEnumerable GetExposedCrops(GameLocation location, Vector2[] visibleTiles, HashSet coveredTiles) + private IEnumerable GetExposedCrops(GameLocation location, IReadOnlySet visibleTiles, HashSet coveredTiles) { foreach (Vector2 tile in visibleTiles) { diff --git a/DataLayers/Layers/Coverage/SprinklerLayer.cs b/DataLayers/Layers/Coverage/SprinklerLayer.cs index 71ba19b00..08f771e15 100644 --- a/DataLayers/Layers/Coverage/SprinklerLayer.cs +++ b/DataLayers/Layers/Coverage/SprinklerLayer.cs @@ -63,28 +63,19 @@ public SprinklerLayer(LayerConfig config, ColorScheme colors, ModIntegrations mo } /// - public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) + public override TileGroup[] Update(ref readonly GameLocation location, ref readonly Rectangle visibleArea, ref readonly IReadOnlySet visibleTiles, ref readonly Vector2 cursorTile) { // get coverage IDictionary customCoverageBySprinklerId = this.GetCustomSprinklerTiles(); - // get sprinklers - Vector2[] searchTiles = visibleArea.Expand(this.SearchRadius).GetTiles().ToArray(); - SObject[] sprinklers = - ( - from Vector2 tile in searchTiles - where location.objects.ContainsKey(tile) - let sprinkler = location.objects[tile] - where this.IsSprinkler(sprinkler, customCoverageBySprinklerId) - select sprinkler - ) - .ToArray(); - // yield sprinkler coverage var covered = new HashSet(); var groups = new List(); - foreach (SObject sprinkler in sprinklers) + foreach (Vector2 origin in visibleArea.Expand(this.SearchRadius).GetTiles()) { + if (!location.objects.TryGetValue(origin, out SObject sprinkler) || !this.IsSprinkler(sprinkler, customCoverageBySprinklerId)) + continue; + TileData[] tiles = this .GetCoverage(sprinkler, sprinkler.TileLocation, customCoverageBySprinklerId, isHeld: false) .Select(pos => new TileData(pos, this.Wet)) @@ -199,7 +190,7 @@ private IEnumerable GetCoverage(SObject sprinkler, Vector2 origin, IDic /// The current location. /// The tiles currently visible on the screen. /// The tiles covered by a sprinkler. - private IEnumerable GetDryCrops(GameLocation location, Vector2[] visibleTiles, HashSet coveredTiles) + private IEnumerable GetDryCrops(GameLocation location, IReadOnlySet visibleTiles, HashSet coveredTiles) { foreach (Vector2 tile in visibleTiles) { diff --git a/DataLayers/Layers/Crops/CropFertilizerLayer.cs b/DataLayers/Layers/Crops/CropFertilizerLayer.cs index 1f336f3bc..d929089a1 100644 --- a/DataLayers/Layers/Crops/CropFertilizerLayer.cs +++ b/DataLayers/Layers/Crops/CropFertilizerLayer.cs @@ -64,7 +64,7 @@ public CropFertilizerLayer(LayerConfig config, ColorScheme colors, ModIntegratio } /// - public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) + public override TileGroup[] Update(ref readonly GameLocation location, ref readonly Rectangle visibleArea, ref readonly IReadOnlySet visibleTiles, ref readonly Vector2 cursorTile) { FertilizedTile[] fertilizedTiles = this.GetFertilizedTiles(location, visibleTiles).ToArray(); @@ -107,7 +107,7 @@ where match(tile) /// Get fertilized tiles. /// The current location. /// The tiles currently visible on the screen. - private IEnumerable GetFertilizedTiles(GameLocation location, IEnumerable visibleTiles) + private IEnumerable GetFertilizedTiles(GameLocation location, IReadOnlySet visibleTiles) { return ( from tilePos in visibleTiles diff --git a/DataLayers/Layers/Crops/CropHarvestLayer.cs b/DataLayers/Layers/Crops/CropHarvestLayer.cs index 99ec8132f..33c7e7af5 100644 --- a/DataLayers/Layers/Crops/CropHarvestLayer.cs +++ b/DataLayers/Layers/Crops/CropHarvestLayer.cs @@ -42,14 +42,14 @@ public CropHarvestLayer(LayerConfig config, ColorScheme colors) } /// - public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) + public override TileGroup[] Update(ref readonly GameLocation location, ref readonly Rectangle visibleArea, ref readonly IReadOnlySet visibleTiles, ref readonly Vector2 cursorTile) { - TileData[] tiles = this.GetTiles(location, visibleTiles).ToArray(); + var tiles = this.GetTiles(location, visibleTiles).ToLookup(p => p.Type.Id); return [ - new TileGroup(tiles.Where(p => p.Type.Id == this.Ready.Id), outerBorderColor: this.Ready.Color), - new TileGroup(tiles.Where(p => p.Type.Id == this.NotReady.Id)), - new TileGroup(tiles.Where(p => p.Type.Id == this.NotEnoughTimeOrDead.Id), outerBorderColor: this.NotEnoughTimeOrDead.Color) + new TileGroup(tiles[this.Ready.Id], outerBorderColor: this.Ready.Color), + new TileGroup(tiles[this.NotReady.Id]), + new TileGroup(tiles[this.NotEnoughTimeOrDead.Id], outerBorderColor: this.NotEnoughTimeOrDead.Color) ]; } @@ -60,7 +60,7 @@ public override TileGroup[] Update(GameLocation location, in Rectangle visibleAr /// Get all tiles. /// The current location. /// The tiles currently visible on the screen. - private IEnumerable GetTiles(GameLocation location, Vector2[] visibleTiles) + private IEnumerable GetTiles(GameLocation location, IReadOnlySet visibleTiles) { foreach (Vector2 tile in visibleTiles) { diff --git a/DataLayers/Layers/Crops/CropPaddyWaterLayer.cs b/DataLayers/Layers/Crops/CropPaddyWaterLayer.cs index 7e8c16dfd..168f231f1 100644 --- a/DataLayers/Layers/Crops/CropPaddyWaterLayer.cs +++ b/DataLayers/Layers/Crops/CropPaddyWaterLayer.cs @@ -50,7 +50,7 @@ public CropPaddyWaterLayer(LayerConfig config, ColorScheme colors) } /// - public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) + public override TileGroup[] Update(ref readonly GameLocation location, ref readonly Rectangle visibleArea, ref readonly IReadOnlySet visibleTiles, ref readonly Vector2 cursorTile) { // update cache on location change if (this.LastLocation == null || !object.ReferenceEquals(location, this.LastLocation)) @@ -60,10 +60,10 @@ public override TileGroup[] Update(GameLocation location, in Rectangle visibleAr } // get paddy tiles - HashSet tilesInRange = [..this.GetTilesInRange(location, visibleTiles)]; + var tilesInRange = visibleTiles.ToLookup(this.GetTilesInRange(location, visibleTiles).Contains); return [ - new TileGroup(tilesInRange.Select(pos => new TileData(pos, this.InRange)), outerBorderColor: this.InRange.Color), - new TileGroup(visibleTiles.Where(pos => !tilesInRange.Contains(pos)).Select(pos => new TileData(pos, this.NotInRange))) + new TileGroup(tilesInRange[true].Select(pos => new TileData(pos, this.InRange)), outerBorderColor: this.InRange.Color), + new TileGroup(tilesInRange[false].Select(pos => new TileData(pos, this.NotInRange))) ]; } @@ -75,16 +75,20 @@ public override TileGroup[] Update(GameLocation location, in Rectangle visibleAr /// The current location. /// The tiles currently visible on the screen. /// Derived from . - private IEnumerable GetTilesInRange(GameLocation location, Vector2[] visibleTiles) + private HashSet GetTilesInRange(GameLocation location, IReadOnlySet visibleTiles) { + HashSet tiles = new(); + foreach (Vector2 tile in visibleTiles) { if (!this.TilesInRange.TryGetValue(tile, out bool inRange)) this.TilesInRange[tile] = inRange = this.RecalculateTileInRange(location, tile, this.PaddyCrop); if (inRange) - yield return tile; + tiles.Add(tile); } + + return tiles; } /// Get whether the tile is in range, without caching. diff --git a/DataLayers/Layers/Crops/CropWaterLayer.cs b/DataLayers/Layers/Crops/CropWaterLayer.cs index aaf0aba94..73b02b157 100644 --- a/DataLayers/Layers/Crops/CropWaterLayer.cs +++ b/DataLayers/Layers/Crops/CropWaterLayer.cs @@ -38,7 +38,7 @@ public CropWaterLayer(LayerConfig config, ColorScheme colors) } /// - public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) + public override TileGroup[] Update(ref readonly GameLocation location, ref readonly Rectangle visibleArea, ref readonly IReadOnlySet visibleTiles, ref readonly Vector2 cursorTile) { return [ this.GetGroup(location, visibleTiles, HoeDirt.watered, this.Watered), @@ -55,7 +55,7 @@ public override TileGroup[] Update(GameLocation location, in Rectangle visibleAr /// The tiles currently visible on the screen. /// The watered state to match. /// The legend entry for the group. - private TileGroup GetGroup(GameLocation location, Vector2[] visibleTiles, int state, LegendEntry type) + private TileGroup GetGroup(GameLocation location, IReadOnlySet visibleTiles, int state, LegendEntry type) { var crops = this .GetCropsByStatus(location, visibleTiles, state) @@ -67,7 +67,7 @@ private TileGroup GetGroup(GameLocation location, Vector2[] visibleTiles, int st /// The current location. /// The tiles currently visible on the screen. /// The watered state to match. - private IEnumerable GetCropsByStatus(GameLocation location, Vector2[] visibleTiles, int state) + private IEnumerable GetCropsByStatus(GameLocation location, IReadOnlySet visibleTiles, int state) { foreach (Vector2 tile in visibleTiles) { diff --git a/DataLayers/Layers/GridLayer.cs b/DataLayers/Layers/GridLayer.cs index 05192ee8e..6b63457bb 100644 --- a/DataLayers/Layers/GridLayer.cs +++ b/DataLayers/Layers/GridLayer.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using Microsoft.Xna.Framework; using Pathoschild.Stardew.DataLayers.Framework; using StardewValley; @@ -27,7 +28,7 @@ public GridLayer(LayerConfig config) } /// - public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) + public override TileGroup[] Update(ref readonly GameLocation location, ref readonly Rectangle visibleArea, ref readonly IReadOnlySet visibleTiles, ref readonly Vector2 cursorTile) { return this.NoGroups; } diff --git a/DataLayers/Layers/MachineLayer.cs b/DataLayers/Layers/MachineLayer.cs index e66d202d4..26ade5201 100644 --- a/DataLayers/Layers/MachineLayer.cs +++ b/DataLayers/Layers/MachineLayer.cs @@ -46,24 +46,17 @@ public MachineLayer(LayerConfig config, ColorScheme colors, ModIntegrations mods } /// - public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) + public override TileGroup[] Update(ref readonly GameLocation location, ref readonly Rectangle visibleArea, ref readonly IReadOnlySet visibleTiles, ref readonly Vector2 cursorTile) { - // get tiles by color - IDictionary tiles = this + var tileGroups = this .GetTiles(location, visibleArea, visibleTiles) - .GroupBy(p => p.Type.Id) - .ToDictionary(p => p.Key, p => p.ToArray()); + .ToLookup(p => p.Type.Id); - // create tile groups - return new[] { this.Empty, this.Processing, this.Finished } - .Select(type => - { - if (!tiles.TryGetValue(type.Id, out TileData[]? groupTiles)) - groupTiles = []; - - return new TileGroup(groupTiles, outerBorderColor: type.Color); - }) - .ToArray(); + return [ + new TileGroup(tileGroups[this.Empty.Id], this.Empty.Color), + new TileGroup(tileGroups[this.Processing.Id], this.Processing.Color), + new TileGroup(tileGroups[this.Finished.Id], this.Finished.Color) + ]; } @@ -74,7 +67,7 @@ public override TileGroup[] Update(GameLocation location, in Rectangle visibleAr /// The current location. /// The tile area currently visible on the screen. /// The tile positions currently visible on the screen. - private IEnumerable GetTiles(GameLocation location, Rectangle visibleArea, Vector2[] visibleTiles) + private IEnumerable GetTiles(GameLocation location, Rectangle visibleArea, IReadOnlySet visibleTiles) { IDictionary machineStates = this.Mods.Automate.GetMachineStates(location, visibleArea); foreach (Vector2 tile in visibleTiles) diff --git a/DataLayers/Layers/TillableLayer.cs b/DataLayers/Layers/TillableLayer.cs index 46a854239..fda417288 100644 --- a/DataLayers/Layers/TillableLayer.cs +++ b/DataLayers/Layers/TillableLayer.cs @@ -49,14 +49,14 @@ public TillableLayer(LayerConfig config, ColorScheme colors) } /// - public override TileGroup[] Update(GameLocation location, in Rectangle visibleArea, in Vector2[] visibleTiles, in Vector2 cursorTile) + public override TileGroup[] Update(ref readonly GameLocation location, ref readonly Rectangle visibleArea, ref readonly IReadOnlySet visibleTiles, ref readonly Vector2 cursorTile) { - var tiles = this.GetTiles(location, visibleArea.GetTiles()); + var tiles = this.GetTiles(location, visibleTiles).ToLookup(p => p.Type.Id); return [ - new TileGroup(tiles[this.Tilled]), - new TileGroup(tiles[this.Tillable], outerBorderColor: this.Tillable.Color), - new TileGroup(tiles[this.Occupied]), - new TileGroup(tiles[this.NonTillable]) + new TileGroup(tiles[this.Tilled.Id]), + new TileGroup(tiles[this.Tillable.Id], outerBorderColor: this.Tillable.Color), + new TileGroup(tiles[this.Occupied.Id]), + new TileGroup(tiles[this.NonTillable.Id]) ]; } @@ -67,10 +67,8 @@ public override TileGroup[] Update(GameLocation location, in Rectangle visibleAr /// Get the updated data layer tiles. /// The current location. /// The tiles currently visible on the screen. - private IDictionary> GetTiles(GameLocation location, IEnumerable visibleTiles) + private IEnumerable GetTiles(GameLocation location, IReadOnlySet visibleTiles) { - IDictionary> tiles = new[] { this.Tillable, this.Tilled, this.Occupied, this.NonTillable }.ToDictionary(p => p, _ => new List()); - foreach (Vector2 tile in visibleTiles) { LegendEntry type; @@ -83,10 +81,8 @@ private IDictionary> GetTiles(GameLocation location, else type = this.Tillable; - tiles[type].Add(new TileData(tile, type)); + yield return new TileData(tile, type); } - - return tiles; } /// Get whether a tile is blocked due to something it contains. From be6bf55fc4318f08d3ad709d79ba8c1836308824 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 8 Oct 2024 22:38:16 -0400 Subject: [PATCH 06/16] fix Data Layers lagging if a mod adds a very large range --- DataLayers/Layers/BaseLayer.cs | 34 ++++++++++++++++++ DataLayers/Layers/Coverage/BeeHouseLayer.cs | 13 ++++--- DataLayers/Layers/Coverage/JunimoHutLayer.cs | 36 +++++++++++++------- DataLayers/Layers/Coverage/ScarecrowLayer.cs | 21 +++++------- DataLayers/Layers/Coverage/SprinklerLayer.cs | 10 +++--- DataLayers/docs/release-notes.md | 1 + 6 files changed, 82 insertions(+), 33 deletions(-) diff --git a/DataLayers/Layers/BaseLayer.cs b/DataLayers/Layers/BaseLayer.cs index 891fbd782..971b58049 100644 --- a/DataLayers/Layers/BaseLayer.cs +++ b/DataLayers/Layers/BaseLayer.cs @@ -88,5 +88,39 @@ protected bool IsDeadCrop(HoeDirt? dirt) { return dirt?.crop?.dead.Value == true; } + + /// Get the tile area around an origin that's both within a square radius and within the visible tile area. + /// The number of tiles around the origin tile to include. + /// The tile at the center of the radius. + /// The tile area currently visible on the screen. + protected Rectangle GetVisibleRadiusArea(int radius, Vector2 origin, Rectangle visibleArea) + { + int x = (int)origin.X - radius; + int y = (int)origin.Y - radius; + int width = radius + 1 + radius; + int height = radius + 1 + radius; + + // not visible + if (x > visibleArea.Right || y > visibleArea.Bottom || x + width < visibleArea.X || y + height < visibleArea.Y) + return Rectangle.Empty; + + // exclude areas outside visible area + if (x < visibleArea.X) + { + width -= visibleArea.X - x; + x = visibleArea.X; + } + if (y < visibleArea.Y) + { + height -= visibleArea.Y - y; + y = visibleArea.Y; + } + if (x + width > visibleArea.Right) + width = visibleArea.Right - x; + if (y + height > visibleArea.Bottom) + height = visibleArea.Bottom - y; + + return new Rectangle(x, y, width, height); + } } } diff --git a/DataLayers/Layers/Coverage/BeeHouseLayer.cs b/DataLayers/Layers/Coverage/BeeHouseLayer.cs index eaac6ce3d..1f9581215 100644 --- a/DataLayers/Layers/Coverage/BeeHouseLayer.cs +++ b/DataLayers/Layers/Coverage/BeeHouseLayer.cs @@ -59,7 +59,7 @@ public override TileGroup[] Update(ref readonly GameLocation location, ref reado continue; TileData[] tiles = this - .GetCoverage(location, beeHouse.TileLocation) + .GetCoverage(location, beeHouse.TileLocation, visibleTiles) .Select(pos => new TileData(pos, this.Covered)) .ToArray(); @@ -71,7 +71,7 @@ public override TileGroup[] Update(ref readonly GameLocation location, ref reado if (this.IsBeeHouse(heldObj)) { var tiles = this - .GetCoverage(location, cursorTile) + .GetCoverage(location, cursorTile, visibleTiles) .Select(pos => new TileData(pos, this.Covered, color: this.Covered.Color * 0.75f)); groups.Add(new TileGroup(tiles, outerBorderColor: this.SelectedColor, shouldExport: false)); } @@ -93,14 +93,19 @@ private bool IsBeeHouse(SObject? obj) /// Get a bee house tile radius. /// The bee house's location. /// The bee house's tile. + /// The tile positions currently visible on the screen. /// Derived from and . - private IEnumerable GetCoverage(GameLocation location, Vector2 origin) + private IEnumerable GetCoverage(GameLocation location, Vector2 origin, IReadOnlySet visibleTiles) { if (!location.IsOutdoors) yield break; // bee houses are hardcoded to only work outdoors foreach (Vector2 relativeTile in this.RelativeRange) - yield return origin + relativeTile; + { + Vector2 tile = origin + relativeTile; + if (visibleTiles.Contains(tile)) + yield return tile; + } } /// Get the relative tiles covered by a bee house. diff --git a/DataLayers/Layers/Coverage/JunimoHutLayer.cs b/DataLayers/Layers/Coverage/JunimoHutLayer.cs index b7d71d28c..463d230a2 100644 --- a/DataLayers/Layers/Coverage/JunimoHutLayer.cs +++ b/DataLayers/Layers/Coverage/JunimoHutLayer.cs @@ -63,12 +63,12 @@ public override TileGroup[] Update(ref readonly GameLocation location, ref reado if (building is not JunimoHut hut) continue; - var range = new Rectangle(hut.tileX.Value + 1, hut.tileY.Value + 1, hut.cropHarvestRadius, hut.cropHarvestRadius); // range centered on hut door + Rectangle range = this.GetCoverageArea(hut); if (!range.Intersects(visibleArea)) continue; TileData[] tiles = this - .GetCoverage(hut, hut.tileX.Value, hut.tileY.Value) + .GetCoverage(hut, hut.tileX.Value, hut.tileY.Value, visibleArea) .Select(pos => new TileData(pos, this.Covered)) .ToArray(); @@ -89,7 +89,7 @@ public override TileGroup[] Update(ref readonly GameLocation location, ref reado { Vector2 tile = TileHelper.GetTileFromCursor(); var tiles = this - .GetCoverage(new JunimoHut(), (int)tile.X, (int)tile.Y) // TODO: get hut from carpenter menu + .GetCoverage(new JunimoHut(), (int)tile.X, (int)tile.Y, visibleArea) // TODO: get hut from carpenter menu .Select(pos => new TileData(pos, this.Covered, this.Covered.Color * 0.75f)); groups.Add(new TileGroup(tiles, outerBorderColor: this.SelectedColor, shouldExport: false)); @@ -131,26 +131,36 @@ private bool IntersectsTile(JunimoHut hut, Vector2 tile) return new Rectangle(hut.tileX.Value, hut.tileY.Value, hut.tilesWide.Value, hut.tilesHigh.Value).Contains((int)tile.X, (int)tile.Y); } + /// Get a Junimo hut's coverage tile area. + /// The Junimo hut. /// Get a Junimo hut tile radius. + /// Derived from . + private Rectangle GetCoverageArea(JunimoHut hut) + { + // note: offset x/y by one so range to center on door + return new Rectangle( + hut.tileX.Value + 1 - hut.cropHarvestRadius, + hut.tileY.Value + 1 - hut.cropHarvestRadius, + hut.cropHarvestRadius + 1 + hut.cropHarvestRadius, + hut.cropHarvestRadius + 1 + hut.cropHarvestRadius + ); + } + + /// Get a Junimo hut's coverage tiles. /// The Junimo hut. /// Get a Junimo hut tile radius. /// The hut's tile X position. /// The hut's tile Y position. + /// The tile area currently visible on the screen. /// Derived from . - private IEnumerable GetCoverage(JunimoHut hut, int tileX, int tileY) + private IEnumerable GetCoverage(JunimoHut hut, int tileX, int tileY, Rectangle visibleArea) { - // center radius on door - tileX++; - tileY++; + Vector2 door = new Vector2(tileX + 1, tileY + 1); int radius = hut.cropHarvestRadius; - // get tiles - for (int x = tileX - radius; x <= tileX + radius; x++) + foreach (Vector2 tile in this.GetVisibleRadiusArea(radius, door, visibleArea).GetTiles()) { - for (int y = tileY - radius; y <= tileY + radius; y++) - { - yield return new Vector2(x, y); - } + yield return tile; } } diff --git a/DataLayers/Layers/Coverage/ScarecrowLayer.cs b/DataLayers/Layers/Coverage/ScarecrowLayer.cs index c6f1048b7..41ff50fec 100644 --- a/DataLayers/Layers/Coverage/ScarecrowLayer.cs +++ b/DataLayers/Layers/Coverage/ScarecrowLayer.cs @@ -54,11 +54,11 @@ public override TileGroup[] Update(ref readonly GameLocation location, ref reado var groups = new List(); foreach (Vector2 origin in visibleArea.Expand(this.MaxSearchRadius).GetTiles()) { - if (!location.objects.TryGetValue(origin, out Object scarecrow) || !scarecrow.IsScarecrow()) + if (!location.objects.TryGetValue(origin, out SObject scarecrow) || !scarecrow.IsScarecrow()) continue; TileData[] tiles = this - .GetCoverage(scarecrow) + .GetCoverage(scarecrow, visibleArea) .Select(pos => new TileData(pos, this.Covered)) .ToArray(); @@ -79,7 +79,7 @@ public override TileGroup[] Update(ref readonly GameLocation location, ref reado if (heldObj?.IsScarecrow() == true) { var tiles = this - .GetCoverage(heldObj, cursorTile) + .GetCoverage(heldObj, visibleArea, cursorTile) .Select(pos => new TileData(pos, this.Covered, this.Covered.Color * 0.75f)); groups.Add(new TileGroup(tiles, outerBorderColor: this.SelectedColor, shouldExport: false)); } @@ -100,21 +100,18 @@ private bool IsCrop(TerrainFeature terrain) /// Get a scarecrow tile radius. /// The scarecrow to check. - /// The tile position to check from, if different from . + /// The tile area currently visible on the screen. + /// The tile position to check from, if different from . /// Derived from . - private IEnumerable GetCoverage(SObject scarecrow, Vector2? overrideOrigin = null) + private IEnumerable GetCoverage(SObject scarecrow, Rectangle visibleArea, Vector2? overrideOrigin = null) { Vector2 origin = overrideOrigin ?? scarecrow.TileLocation; int radius = scarecrow.GetRadiusForScarecrow(); - for (int x = (int)origin.X - radius; x <= origin.X + radius; x++) + foreach (Vector2 tile in this.GetVisibleRadiusArea(radius, origin, visibleArea).GetTiles()) { - for (int y = (int)origin.Y - radius; y <= origin.Y + radius; y++) - { - Vector2 tile = new Vector2(x, y); - if (Vector2.Distance(tile, origin) < radius) - yield return tile; - } + if (Vector2.Distance(tile, origin) < radius) + yield return tile; } } diff --git a/DataLayers/Layers/Coverage/SprinklerLayer.cs b/DataLayers/Layers/Coverage/SprinklerLayer.cs index 08f771e15..a8e59d8c3 100644 --- a/DataLayers/Layers/Coverage/SprinklerLayer.cs +++ b/DataLayers/Layers/Coverage/SprinklerLayer.cs @@ -77,7 +77,7 @@ public override TileGroup[] Update(ref readonly GameLocation location, ref reado continue; TileData[] tiles = this - .GetCoverage(sprinkler, sprinkler.TileLocation, customCoverageBySprinklerId, isHeld: false) + .GetCoverage(sprinkler, sprinkler.TileLocation, customCoverageBySprinklerId, isHeld: false, visibleTiles) .Select(pos => new TileData(pos, this.Wet)) .ToArray(); @@ -98,7 +98,7 @@ public override TileGroup[] Update(ref readonly GameLocation location, ref reado if (this.IsSprinkler(heldObj, customCoverageBySprinklerId)) { var tiles = this - .GetCoverage(heldObj, cursorTile, customCoverageBySprinklerId, isHeld: true) + .GetCoverage(heldObj, cursorTile, customCoverageBySprinklerId, isHeld: true, visibleTiles) .Select(pos => new TileData(pos, this.Wet, this.Wet.Color * 0.75f)); groups.Add(new TileGroup(tiles, outerBorderColor: this.SelectedColor, shouldExport: false)); } @@ -171,8 +171,9 @@ private IDictionary GetCustomSprinklerTiles() /// The sprinkler's tile. /// The custom sprinkler ranges centered on (0, 0) indexed by qualified sprinkler ID. /// Whether the player is holding the sprinkler. + /// The tile positions currently visible on the screen. /// Derived from . - private IEnumerable GetCoverage(SObject sprinkler, Vector2 origin, IDictionary customSprinklerRanges, bool isHeld) + private IEnumerable GetCoverage(SObject sprinkler, Vector2 origin, IDictionary customSprinklerRanges, bool isHeld, IReadOnlySet visibleTiles) { // get vanilla tiles IEnumerable tiles = sprinkler.GetSprinklerTiles(); @@ -183,7 +184,8 @@ private IEnumerable GetCoverage(SObject sprinkler, Vector2 origin, IDic if (customSprinklerRanges.TryGetValue(sprinkler.QualifiedItemId, out Vector2[]? customTiles)) tiles = new HashSet(tiles.Concat(customTiles.Select(tile => tile + origin))); - return tiles; + // filter to visible tiles + return tiles.Where(visibleTiles.Contains); } /// Get tiles containing crops not covered by a sprinkler. diff --git a/DataLayers/docs/release-notes.md b/DataLayers/docs/release-notes.md index c6d9f1074..6affc92d0 100644 --- a/DataLayers/docs/release-notes.md +++ b/DataLayers/docs/release-notes.md @@ -5,6 +5,7 @@ * Updated for Stardew Valley 1.6.9. * On the _Accessible_ layer, warps that are hidden just off-screen are now drawn along the edge. * Added support for Ultimate Fertilizer's multi-fertilizer feature. +* Fixed lag if a bee house, Junimo hut, scarecrow, or sprinkler has an extremely large range. * Improved translations. Thanks to moonggae (updated Korean)! ## 1.17.2 From 74132336475808081110040d4406e56dc6c27dcf Mon Sep 17 00:00:00 2001 From: Chonsawat Date: Thu, 10 Oct 2024 19:25:33 +0700 Subject: [PATCH 07/16] Update i18n - TH (Fast Animations) --- FastAnimations/i18n/th.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/FastAnimations/i18n/th.json b/FastAnimations/i18n/th.json index a28deb157..227172d99 100644 --- a/FastAnimations/i18n/th.json +++ b/FastAnimations/i18n/th.json @@ -36,8 +36,8 @@ "config.mount.name": "ขึ้น/ลงจากหลังม้า", "config.mount.tooltip": "ต้องการขึ้นหรือลงจากม้าให้มันเร็วแค่ไหน (รวมถึงการขึ้นหรือการขี่แบบกำหนดเองเช่น ม็อดรถแทรกเตอร์) ค่าเริ่มต้นคือ {{defaultValue}}x", - "config.read-book.name": "Read book", // TODO - "config.read-book.tooltip": "How fast you read books. Default {{defaultValue}}x.", // TODO + "config.read-book.name": "อ่านหนังสือ", + "config.read-book.tooltip": "ต้องการอ่านหนังสือให้จบเร็วแค่ไหน ค่าเริ่มต้นคือ {{defaultValue}}x.", "config.shear.name": "เครื่องมือที่ตัด", "config.shear.tooltip": "ต้องการใช้เครื่องที่ตัดให้มันเร็วแค่ไหน ค่าเริ่มต้นคือ {{defaultValue}}x", @@ -48,8 +48,8 @@ "config.tool.name": "เครื่องมือที่แกว่ง", "config.tool.tooltip": "ต้องการใช้เครื่องมือที่แกว่งให้มันเร็วแค่ไหน (ยกเว้นอาวุธและคันเบ็ด) ค่าเริ่มต้นคือ {{defaultValue}}x, ขอแนะนำ {{defaultValue}}x", - "config.use-totem.name": "Use totem", // TODO - "config.use-totem.tooltip": "How fast you use a totem. Default {{defaultValue}}x.", // TODO + "config.use-totem.name": "ใช้โทเทม", + "config.use-totem.tooltip": "ต้องการใช้โทเทมให้เสร็จเร็วแค่ไหน ค่าเริ่มต้นคือ {{defaultValue}}x.", "config.weapon.name": "อาวุธที่แกว่ง", "config.weapon.tooltip": "ต้องการใช้อาวุธที่แกว่งให้มันเร็วแค่ไหน ค่าเริ่มต้นคือ {{defaultValue}}x, ขอแนะนำ {{defaultValue}}x", @@ -77,8 +77,8 @@ "config.forge.name": "Forge", // TODO "config.forge.tooltip": "How fast the volcano forge works. Default {{defaultValue}}x.", // TODO - "config.open-chest.name": "Open chest", // TODO - "config.open-chest.tooltip": "How fast you open chests. Default {{defaultValue}}x.", // TODO + "config.open-chest.name": "เปิดกล่องเก็บของ", + "config.open-chest.tooltip": "ต้องการให้เปิดกล่องเก็บของเร็วแค่ไหน ค่าเริ่มต้นคือ {{defaultValue}}x.", "config.parrot-express.name": "Parrot express", // TODO "config.parrot-express.tooltip": "How fast the parrot express runs. Default {{defaultValue}}x.", // TODO @@ -100,11 +100,11 @@ ****/ "config.ui-speeds": "ความเร็วของภาพเคลื่อนไหว UI", - "config.dialogue-typing.name": "Dialogue typing", // TODO - "config.dialogue-typing.tooltip": "How fast text appears in dialogue boxes. Default {{defaultValue}}x", // TODO + "config.dialogue-typing.name": "ความเร็วข้อความของบทสนทนา", + "config.dialogue-typing.tooltip": "ต้องการให้ข้อความบทสนทนาแสดงจบเร็วแค่ไหน ค่าเริ่มต้นคือ {{defaultValue}}x", - "config.open-dialogue-box.name": "Open dialogue box", // TODO - "config.open-dialogue-box.tooltip": "How fast dialogue boxes open. Default {{defaultValue}}x.", // TODO + "config.open-dialogue-box.name": "แสดงบทสทนา", + "config.open-dialogue-box.tooltip": "ต้องการแสดงบทสนทนาเร็วแค่ไหน ค่าเริ่มต้นคือ {{defaultValue}}x.", "config.title-menu.name": "การเปลี่ยนเมนูชื่อเรื่อง", "config.title-menu.tooltip": "ความเร็วในการเปลี่ยนเมนูชื่อเรื่องระหว่างหน้าจอ ค่าเริ่มต้นคือ {{defaultValue}}x", From df7db35f29ed33dc537b67bd88d5b963880fb25a Mon Sep 17 00:00:00 2001 From: Epitopus <105813595+Epitopus@users.noreply.github.com> Date: Thu, 10 Oct 2024 23:16:34 +0200 Subject: [PATCH 08/16] Update pl.json --- LookupAnything/i18n/pl.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LookupAnything/i18n/pl.json b/LookupAnything/i18n/pl.json index 8e8ef1cb9..647d663c9 100644 --- a/LookupAnything/i18n/pl.json +++ b/LookupAnything/i18n/pl.json @@ -157,8 +157,8 @@ "condition.item-edibility.range": "{{item}} ma jadalność od {{min}} do {{max}}", "context-tag.bone": "każda kość", - "context-tag.egg": "każde jajo", - "context-tag.large-egg": "każde duże jajo", + "context-tag.egg": "każde jajko", + "context-tag.large-egg": "każde duże jajko", "context-tag.preserved-item": "zakonserwowane: {{name}}", @@ -427,7 +427,7 @@ "item.melee-weapon.knockback.label": "{{amount}} ({{multiplier}} razy normalny dystans)", "item.melee-weapon.reach.label": "{{amount}} piksele", "item.melee-weapon.speed.shown-vs-actual": "pokazana: {{shownSpeed}}{{lineBreak}}rzeczywista: {{actualSpeed}}", - "item.melee-weapon.speed.summary": "{{speed}} ({{milliseconds}} milisekund za zamach, bez bonusów szybkości gracza)", + "item.melee-weapon.speed.summary": "{{speed}} ({{milliseconds}} milisekund na zamach, bez bonusów szybkości gracza)", /********* From 3366e0d4b86711d8eba3a79394cf51e26a48c3da Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 11 Oct 2024 00:59:14 -0400 Subject: [PATCH 09/16] update for save data change in Stardew Valley 1.6.9 --- ContentPatcher/Framework/TokenSaveReader.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ContentPatcher/Framework/TokenSaveReader.cs b/ContentPatcher/Framework/TokenSaveReader.cs index 4fb35c581..d4307e509 100644 --- a/ContentPatcher/Framework/TokenSaveReader.cs +++ b/ContentPatcher/Framework/TokenSaveReader.cs @@ -198,9 +198,11 @@ public string GetCurrentLocationContext(Farmer? player) // loading if (this.IsParsed) { - return SaveGame.loaded.cellarAssignments.TryGetValue(cellarNumber, out long owner) - ? owner - : null; + foreach (var pair in SaveGame.loaded.cellarAssignments) + { + if (pair.Key == cellarNumber) + return pair.Value; + } } return null; From 76ac373ca0503297e6111934c9bd6e90bc1e7c90 Mon Sep 17 00:00:00 2001 From: "Federico G." Date: Fri, 11 Oct 2024 18:39:35 +0200 Subject: [PATCH 10/16] (italian) updated chestsanywhere and cropsanytimeanywhere --- ChestsAnywhere/i18n/it.json | 12 ++++++------ CropsAnytimeAnywhere/i18n/it.json | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ChestsAnywhere/i18n/it.json b/ChestsAnywhere/i18n/it.json index d8a267d2f..3165c88de 100644 --- a/ChestsAnywhere/i18n/it.json +++ b/ChestsAnywhere/i18n/it.json @@ -68,7 +68,7 @@ /**** ** remote access ****/ - "config.title.remote-access": "Remote access", // TODO + "config.title.remote-access": "Accesso remoto", "config.range.name": "Raggio", "config.range.desc": "Il raggio a cui i bauli sono accessibili attraverso il menu.", @@ -86,16 +86,16 @@ /**** ** open menu hotkey ****/ - "config.title.open-menu-hotkey": "Hotkey to open chest UI", // TODO + "config.title.open-menu-hotkey": "Tasto rapido per IU Scrigno", "config.toggle-ui-key.name": "Attiva IU", "config.toggle-ui-key.desc": "I tasti che mostrano o nascondono l'interfaccia utente dello scrigno.", - "config.reopen-last-chest.name": "Reopen last chest", // TODO - "config.reopen-last-chest.desc": "When you press the 'toggle UI' button, whether to reopen the last chest you selected yourself during the current game session.", // TODO + "config.reopen-last-chest.name": "Riapri l'ultimo scrigno", + "config.reopen-last-chest.desc": "Quando premi il tasto 'Attiva IU', scegli se riaprire l'ultimo scrigno selezionato durante la sessione di gioco in corso.", - "config.default-category.name": "Default category", // TODO - "config.default-category.desc": "When you press the 'toggle UI' button, show the chests in this category by default (if set). This applies after 'reopen last chest'.", // TODO + "config.default-category.name": "Categoria predefinita", + "config.default-category.desc": "Quando premi il tasto 'Attiva IU', mostra gli scrigni di questa categoria per impostazione predefinita (se impostata). Questo si applica dopo 'riapri l'ultimo scrigno'.", /**** ** controls when chest UI is open diff --git a/CropsAnytimeAnywhere/i18n/it.json b/CropsAnytimeAnywhere/i18n/it.json index c989e8b28..db6edd46a 100644 --- a/CropsAnytimeAnywhere/i18n/it.json +++ b/CropsAnytimeAnywhere/i18n/it.json @@ -12,9 +12,8 @@ "config.grow-crops-out-of-season.name": "Coltiva in qualsiasi stagione", "config.grow-crops-out-of-season.desc": "Scegli se le colture crescono anche se normalmente sono fuori stagione. Si applica solo se è abilitata anche l'opzione 'Coltiva ovunque'.", - // TODO - "config.use-fruit-trees-seasonal-sprites.name": "Seasonal fruit trees sprites", - "config.use-fruit-trees-seasonal-sprites.desc": "Whether fruit trees should use their normal seasonal sprite (true) or their summer sprites (false) when 'grow crops in any season' is enabled.", + "config.use-fruit-trees-seasonal-sprites.name": "Sprite stagionali per alberi da frutto", + "config.use-fruit-trees-seasonal-sprites.desc": "Scegli se gli alberi da frutto devono usare il loro normale sprite stagionale (true) o il loro sprite estivo (false) quando è abilitata l'opzione 'Coltiva in qualsiasi stagione'.", "config.force-till-dirt.name": "Zappa qualsiasi terriccio", "config.force-till-dirt.desc": "Scegli se tutte le caselle di terriccio possono essere coltivabili con una zappa, anche se normalmente non lo sarebbero.", From 168d3d0d442e28f676d288a065ab8b016bbea09a Mon Sep 17 00:00:00 2001 From: Creeperkatze <178587183+Creeperkatze@users.noreply.github.com> Date: Sun, 27 Oct 2024 17:23:51 +0100 Subject: [PATCH 11/16] Update partial translations, Add "Crops Anytime Anywhere" translation --- ChestsAnywhere/i18n/de.json | 16 ++++----- CropsAnytimeAnywhere/i18n/de.json | 29 +++++++++++++++ DataLayers/i18n/de.json | 29 ++++++++------- FastAnimations/i18n/de.json | 60 +++++++++++++++---------------- LookupAnything/i18n/de.json | 20 +++++------ TractorMod/i18n/de.json | 30 +++++++--------- 6 files changed, 103 insertions(+), 81 deletions(-) create mode 100644 CropsAnytimeAnywhere/i18n/de.json diff --git a/ChestsAnywhere/i18n/de.json b/ChestsAnywhere/i18n/de.json index aba177803..1b7c51011 100644 --- a/ChestsAnywhere/i18n/de.json +++ b/ChestsAnywhere/i18n/de.json @@ -59,8 +59,8 @@ "config.enable-shipping-bin.name": "Versandbehälter aktivieren", "config.enable-shipping-bin.desc": "Ob der Zugriff auf den Versandbehälter ermöglicht werden soll.", - "config.enable-sprinkler-attachments.name": "Enable sprinkler attachments", // TODO - "config.enable-sprinkler-attachments.desc": "Whether to enable access to sprinkler attachments like enrichers.", // TODO + "config.enable-sprinkler-attachments.name": "Sprinkleraufsätze aktivieren", + "config.enable-sprinkler-attachments.desc": "Ob der Zugang zu Sprinkleraufsätzen wie Bereicherern ermöglicht werden soll.", "config.add-organize-player-items.name": "Button Spieler-Gegenstände Organisieren hinzufügen", "config.add-organize-player-items.desc": "Ob eine 'Organisieren' Taste in den Truhen UIs für das Spielerinventar hinzugefügt werden soll.", @@ -68,7 +68,7 @@ /**** ** remote access ****/ - "config.title.remote-access": "Remote access", // TODO + "config.title.remote-access": "Fernzugriff", "config.range.name": "Reichweite", "config.range.desc": "Der Abstand, in dem Truhen über das Menü zugänglich sind.", @@ -86,16 +86,16 @@ /**** ** open menu hotkey ****/ - "config.title.open-menu-hotkey": "Hotkey to open chest UI", // TODO + "config.title.open-menu-hotkey": "Hotkey zum Öffnen der Truhen-UI", "config.toggle-ui-key.name": "UI umschalten", "config.toggle-ui-key.desc": "Die Tasten, die die UI der Truhe anzeigen oder verbergen.", - "config.reopen-last-chest.name": "Reopen last chest", // TODO - "config.reopen-last-chest.desc": "When you press the 'toggle UI' button, whether to reopen the last chest you selected yourself during the current game session.", // TODO + "config.reopen-last-chest.name": "Letzte Truhe wieder öffnen", + "config.reopen-last-chest.desc": "Wenn du die Schaltfläche „UI umschalten“ drückst, kannst du entscheiden, ob du die letzte Truhe, die du während der aktuellen Spielsitzung ausgewählt hast, wieder öffnen möchtest.", - "config.default-category.name": "Default category", // TODO - "config.default-category.desc": "When you press the 'toggle UI' button, show the chests in this category by default (if set). This applies after 'reopen last chest'.", // TODO + "config.default-category.name": "Standard-Kategorie", + "config.default-category.desc": "Wenn du die Schaltfläche „UI umschalten“ drückst, werden standardmäßig die Truhen in dieser Kategorie angezeigt (falls eingestellt). Dies gilt nach „Letzte Truhe wieder öffnen“.", /**** ** controls when chest UI is open diff --git a/CropsAnytimeAnywhere/i18n/de.json b/CropsAnytimeAnywhere/i18n/de.json new file mode 100644 index 000000000..d7333d5da --- /dev/null +++ b/CropsAnytimeAnywhere/i18n/de.json @@ -0,0 +1,29 @@ +{ + /********* + ** Generic Mod Config Menu UI + *********/ + // warnings + "config.too-complex": "Du hast standortabhängige Einstellungen, die zu komplex sind, um sie über das allgemeine Mod-Konfigurationsmenü zu bearbeiten. Du kannst die config.json-Datei des Mods direkt bearbeiten oder die Mod-Einstellungen auf die Standardeinstellungen zurücksetzen (indem du auf die Schaltflächen „Standard“ und „Speichern“ klickst und dann das Spiel neu öffnest).", + + // options + "config.grow-crops.name": "Nutzpflanzen überall anbauen", + "config.grow-crops.desc": "Ob Nutzpflanzen an allen Standorten gepflanzt werden können.", + + "config.grow-crops-out-of-season.name": "Heranwachsen von Nutzpflanzen zu jeder Jahreszeit", + "config.grow-crops-out-of-season.desc": "Ob Nutzpflanzen wachsen, auch wenn sie normalerweise nicht in der Saison sind. Dies gilt nur, wenn „Nutzpflanzen überall anbauen“ ebenfalls aktiviert ist.", + + "config.use-fruit-trees-seasonal-sprites.name": "Saisonale Obstbaum-Sprites", + "config.use-fruit-trees-seasonal-sprites.desc": "Ob Obstbäume ihre normalen saisonalen Sprites (true) oder ihre Sommer-Sprites (false) verwenden sollen, wenn „Heranwachsen von Nutzpflanzen zu jeder Jahreszeit“ aktiviert ist.", + + "config.force-till-dirt.name": "Hacke jegliche Erde", + "config.force-till-dirt.desc": "Ob alle Erdkacheln mit einer Hacke bearbeitbar sein sollten, auch wenn sie dies normalerweise nicht wären.", + + "config.force-till-grass.name": "Hacke jegliches Gras", + "config.force-till-grass.desc": "Ob alle Graskacheln mit einer Hacke bearbeitbar sein sollten, auch wenn sie dies normalerweise nicht wären.", + + "config.force-till-stone.name": "Hacke jegliche Steine", + "config.force-till-stone.desc": "Ob alle Steinkacheln mit einer Hacke bearbeitbar sein sollten, auch wenn sie dies normalerweise nicht wären.", + + "config.force-till-other.name": "Jegliche andere Kachel hacken", + "config.force-till-other.desc": "Ob alle Kacheln, die nicht als Erde, Gras oder Stein gekennzeichnet sind, mit einer Hacke bearbeitbar sein sollten, auch wenn sie es normalerweise nicht wären." +} diff --git a/DataLayers/i18n/de.json b/DataLayers/i18n/de.json index ea8ef5562..69815137a 100644 --- a/DataLayers/i18n/de.json +++ b/DataLayers/i18n/de.json @@ -77,22 +77,21 @@ /********* ** Generic Mod Config Menu UI *********/ - // TODO // section names "config.section.main-options": "Main options", "config.section.main-controls": "Main controls", "config.section.layer": "'{{LayerName}}' layer", // {{LayerName}} is the layer name set above. // main options - "config.show-grid.name": "Show grid", - "config.show-grid.desc": "Whether to show a tile grid when a layer is open.", + "config.show-grid.name": "Gitter anzeigen", + "config.show-grid.desc": "Ob ein Kachelgitter angezeigt werden soll, wenn eine Ebene geöffnet ist.", - "config.combine-borders.name": "Combine overlapping borders", - "config.combine-borders.desc": "When two groups of the same color overlap, whether to draw one border around their combined edge instead of their individual borders.", + "config.combine-borders.name": "Kombiniere überlappende Ränder", + "config.combine-borders.desc": "Ob bei der Überlappung von zwei gleichfarbigen Gruppen anstelle der einzelnen Ränder ein gemeinsamer Rand gezeichnet werden soll.", - "config.color-scheme.name": "Color scheme", - "config.color-schene.desc": "The color scheme to apply, which changes the colors throughout all the data layers.", - "config.color-schemes.default": "default colors", + "config.color-scheme.name": "Farbschema", + "config.color-schene.desc": "Das anzuwendende Farbschema, welches die Farben für alle Datenebenen ändert.", + "config.color-schemes.default": "Standardfarben", // main controls "config.toggle-layer-key.name": "Toggle data layers", @@ -105,15 +104,15 @@ "config.next-layer-key.desc": "The key binding which cycles forward through the available data layers.", // data layers - "config.layer-enabled.name": "Enabled", - "config.layer-enabled.desc": "Whether this layer should be available in-game.", + "config.layer-enabled.name": "Aktiviert", + "config.layer-enabled.desc": "Ob diese Ebene im Spiel verfügbar sein soll.", - "config.layer-update-on-view-change.name": "Update when view changes", - "config.layer-update-on-view-change.desc": "Whether the drawn layer info should be updated when a new part of the world moves into view, regardless of the 'updates per second' setting.", + "config.layer-update-on-view-change.name": "Aktualisieren, wenn sich die Ansicht ändert", + "config.layer-update-on-view-change.desc": "Ob die Informationen über die gezeichnete Ebene aktualisiert werden sollen, wenn ein neuer Teil der Welt in die Sicht kommt, unabhängig von der Einstellung „Aktualisierungen pro Sekunde“.", - "config.layer-updates-per-second.name": "Updates per second", - "config.layer-updates-per-second.desc": "How often the layer should update when it's being displayed, as a number per second. Setting this to a higher value than the default may cause lag. Default {{defaultValue}}.", + "config.layer-updates-per-second.name": "Aktualisierungen pro Sekunde", + "config.layer-updates-per-second.desc": "Wie oft die Ebene aktualisiert werden soll, wenn sie angezeigt wird, als Zahl pro Sekunde. Wird hier ein höherer Wert als der Standardwert eingestellt, kann es zu Verzögerungen kommen. Standardwert {{defaultValue}}.", - "config.layer-shortcut.name": "Shortcut key", + "config.layer-shortcut.name": "Schnellzugriff-Taste", "config.layer-shortcut.desc": "The key binding which selects this layer when the overlay is open." } diff --git a/FastAnimations/i18n/de.json b/FastAnimations/i18n/de.json index 3aa0cd80d..d0ac8b5ab 100644 --- a/FastAnimations/i18n/de.json +++ b/FastAnimations/i18n/de.json @@ -24,8 +24,8 @@ "config.harvest.name": "Ernten", "config.harvest.tooltip": "Wie schnell Sie Getreide und Futter von Hand ernten. Standardwert {{defaultValue}}x.", - "config.hold-up-item.name": "Hold up item", // TODO - "config.hold-up-item.tooltip": "How fast you hold up an item. Default {{defaultValue}}x.", // TODO + "config.hold-up-item.name": "Gegenstand hochhalten", + "config.hold-up-item.tooltip": "Wie schnell du einen Gegenstand hochhältst. Standardwert {{defaultValue}}x.", "config.horse-flute.name": "Pferde-Flöte spielen", "config.horse-flute.tooltip": "Wie schnell Sie die Pferde-Flöte spielen. Standardwert {{defaultValue}}x.", @@ -36,8 +36,8 @@ "config.mount.name": "Auf-/Absteigen", "config.mount.tooltip": "Wie schnell Sie Pferde besteigen/absteigen (einschließlich benutzerdefinierter Reittiere wie die Traktor Mod). Standardwert {{defaultValue}}x.", - "config.read-book.name": "Read book", // TODO - "config.read-book.tooltip": "How fast you read books. Default {{defaultValue}}x.", // TODO + "config.read-book.name": "Buch lesen", + "config.read-book.tooltip": "Wie schnell du Bücher liest. Standardwert {{defaultValue}}x.", "config.shear.name": "Scheren", "config.shear.tooltip": "Wie schnell Sie die Schere verwenden. Standardwert {{defaultValue}}x.", @@ -48,8 +48,8 @@ "config.tool.name": "Werkzeug schwingen", "config.tool.tooltip": "Wie schnell Sie Ihre Werkzeuge schwingen (außer Waffen und Angelrute). Standardwert {{defaultValue}}x, vorgeschlagen {{suggestedValue}}x.", - "config.use-totem.name": "Use totem", // TODO - "config.use-totem.tooltip": "How fast you use a totem. Default {{defaultValue}}x.", // TODO + "config.use-totem.name": "Totem verwenden", + "config.use-totem.tooltip": "Wie schnell du ein Totem verwendest. Standardwert {{defaultValue}}x.", "config.weapon.name": "Waffen schwingen", "config.weapon.tooltip": "Wie schnell Sie Ihre Waffen schwingen. Standardwert {{defaultValue}}x, vorgeschlagen {{suggestedValue}}x.", @@ -68,43 +68,43 @@ "config.casino-slots.name": "Casino-Slots", "config.casino-slots.tooltip": "Wie schnell sich die Casino-Slots drehen. Standardwert {{defaultValue}}x.", - "config.fade.name": "Fade", // TODO - "config.fade.tooltip": "How fast the screen fades to black and fades back in. Default {{defaultValue}}x.", // TODO + "config.fade.name": "Übergang", + "config.fade.tooltip": "Wie schnell der Bildschirm auf Schwarz wechselt und wieder eingeblendet wird. Standardwert {{defaultValue}}x.", - "config.fishing-treasure.name": "Fishing treasure chest", // TODO - "config.fishing-treasure.tooltip": "How fast you open a fishing treasure chest. Default {{defaultValue}}x.", // TODO + "config.fishing-treasure.name": "Schatztruhe beim Fischen", + "config.fishing-treasure.tooltip": "Wie schnell du eine Schatztruhe beim Fischen öffnest. Standardwert {{defaultValue}}x.", - "config.forge.name": "Forge", // TODO - "config.forge.tooltip": "How fast the volcano forge works. Default {{defaultValue}}x.", // TODO + "config.forge.name": "Schmiede", + "config.forge.tooltip": "Wie schnell die Vulkanschmiede funktioniert. Standardwert {{defaultValue}}x.", - "config.open-chest.name": "Open chest", // TODO - "config.open-chest.tooltip": "How fast you open chests. Default {{defaultValue}}x.", // TODO + "config.open-chest.name": "Kiste öffnen", + "config.open-chest.tooltip": "Wie schnell du Kisten öffnest. Standardwert {{defaultValue}}x.", - "config.parrot-express.name": "Parrot express", // TODO - "config.parrot-express.tooltip": "How fast the parrot express runs. Default {{defaultValue}}x.", // TODO + "config.parrot-express.name": "Papageien-Express", + "config.parrot-express.tooltip": "Wie schnell der Papageienexpress fährt. Standardwert {{defaultValue}}x.", - "config.prize-ticket-machine.name": "Prize ticket machine", // TODO - "config.prize-ticket-machine.tooltip": "How fast Lewis' prize ticket machine accepts a ticket and produces an item. Default {{defaultValue}}x.", // TODO + "config.prize-ticket-machine.name": "Gewinnkartenautomat", + "config.prize-ticket-machine.tooltip": "Wie schnell Lewis' Gewinnkartenautomat eine Karte annimmt und einen Artikel produziert. Standardwert {{defaultValue}}x.", - "config.tailor.name": "Tailor", // TODO - "config.tailor.tooltip": "How fast the sewing machine works. Default {{defaultValue}}x.", // TODO + "config.tailor.name": "Nähen", + "config.tailor.tooltip": "Wie schnell die Nähmaschine funktioniert. Default {{defaultValue}}x.", "config.tree-fall.name": "Baum fällt", "config.tree-fall.tooltip": "Wie schnell Bäume fallen, nachdem Sie sie gefällt haben. Standardwert {{defaultValue}}x, vorgeschlagen {{suggestedValue}}x.", - "config.wheel-spin.name": "Wheel spin", // TODO - "config.wheel-spin.tooltip": "How fast the Stardew Valley Fair wheel minigame spins. Default {{defaultValue}}x.", // TODO + "config.wheel-spin.name": "Am Rad drehen", + "config.wheel-spin.tooltip": "Wie schnell sich das Sternentautaler Volksfest-Rad-Minispiel dreht. Standardwert {{defaultValue}}x.", /**** ** 'UI Animation Speeds' section ****/ "config.ui-speeds": "UI-Animationsgeschwindigkeiten", - "config.dialogue-typing.name": "Dialogue typing", // TODO - "config.dialogue-typing.tooltip": "How fast text appears in dialogue boxes. Default {{defaultValue}}x", // TODO + "config.dialogue-typing.name": "Tippen von Dialogen", + "config.dialogue-typing.tooltip": "Wie schnell Text in Dialogfeldern erscheint. Standardwert {{defaultValue}}x", - "config.open-dialogue-box.name": "Open dialogue box", // TODO - "config.open-dialogue-box.tooltip": "How fast dialogue boxes open. Default {{defaultValue}}x.", // TODO + "config.open-dialogue-box.name": "Öffnen eines Dialogfeldes", + "config.open-dialogue-box.tooltip": "Wie schnell sich Dialogfelder öffnen. Standardwert {{defaultValue}}x.", "config.title-menu.name": "Übergänge im Titelmenü", "config.title-menu.tooltip": "Wie schnell das Titelmenü zwischen den Bildschirmen wechselt. Standardwert {{defaultValue}}x.", @@ -115,9 +115,9 @@ /**** ** 'Experimental' section ****/ - "config.experimental": "Experimental options", // TODO - "config.experimental-warning": "These options aren't fully stable yet, and may cause issues like freezes and crashes. Enabling any of these isn't recommended.", // TODO + "config.experimental": "Experimentelle Optionen", + "config.experimental-warning": "Diese Optionen sind noch nicht absolut stabil und können zu Problemen wie Einfrieren und Abstürzen führen. Eine dieser Optionen zu aktivieren wird nicht empfohlen.", - "config.event.name": "Event cutscene", // TODO - "config.event.tooltip": "How fast event cutscenes play. Default {{defaultValue}}x, suggested {{suggestedValue}}x." // TODO + "config.event.name": "Ereignis-Zwischensequenz", + "config.event.tooltip": "Wie schnell Ereignis-Zwischensequenzen abgespielt werden. Standardwert {{defaultValue}}x, empfohlen {{suggestedValue}}x." } diff --git a/LookupAnything/i18n/de.json b/LookupAnything/i18n/de.json index 0e5cb915e..cffb8561b 100644 --- a/LookupAnything/i18n/de.json +++ b/LookupAnything/i18n/de.json @@ -51,7 +51,7 @@ "quality.iridium": "Iridium", // item names shown in recipes - "item.wild-seeds": "Wild Seeds (Any)", // TODO + "item.wild-seeds": "Wilde Samen (Beliebig)", // NPC friendship "friendship-status.friendly": "Freundlich", @@ -138,15 +138,15 @@ *********/ "condition-or-context-tag.negate": "nicht {{value}}", - "condition.day-of-month": "on specific days ({{days}})", // TODO - "condition.day-of-month.even": "even days", // TODO - "condition.day-of-month.odd": "odd days", // TODO + "condition.day-of-month": "An bestimmten Tagen ({{days}})", + "condition.day-of-month.even": "Gerade Tage", + "condition.day-of-month.odd": "Ungerade Tage", "condition.item-type.input": "Eingabe Item", "condition.item-type.target": "Ziel Item", - "condition.raw-context-tag": "context tag \"{{tag}}\"", // TODO - "condition.raw-condition": "query \"{{tag}}\"", // TODO + "condition.raw-context-tag": "Kontext-Tag \"{{tag}}\"", + "condition.raw-condition": "Abfrage \"{{tag}}\"", "condition.item-context-tag": "{{item}} hat Kontext Tag {{tags}}", "condition.item-context-tags": "{{item}} hat Kontext Tags {{tags}}", @@ -189,7 +189,7 @@ // labels "building.animals": "Tiere", "building.construction": "Bau", - "building.construction-costs": "Construction costs", // TODO + "building.construction-costs": "Baukosten", "building.feed-trough": "Futtertrog", "building.horse": "Pferd", "building.horse-location": "Pferd Standort", @@ -337,7 +337,7 @@ "item.undiscovered-gift-taste-appended": " und {{count}} unaufgedeckte Dorfbewohner", "item.needed-for.community-center": "Gemeinschaftszentrum ({{bundles}})", "item.needed-for.full-shipment": "\"Volle Lieferung\" Errungenschaft (liefere einen)", - "item.needed-for.monoculture": "monoculture achievement (ship {{count}} more)", // TODO + "item.needed-for.monoculture": "Monokultur-Erfolg (verschiffe {{count}} mehr)", "item.needed-for.polyculture": "\"Polykultur\" Errungenschaft (liefere noch {{count}})", "item.needed-for.full-collection": "\"Eine vollständige Sammlung\" Errungenschaft (Spende eines dem Museum)", "item.needed-for.gourmet-chef": "\"Gourmetkoch\" Errungenschaft (koche {{recipes}})", @@ -726,8 +726,8 @@ "config.tile-lookups.desc": "Ob Kartenkacheln als Nachschlageziele einbezogen werden sollen.", "config.data-mining-fields.name": "Data Mining Felder anzeigen", "config.data-mining-fields.desc": "Ob Rohdaten angezeigt werden sollen, die für Data Miner nützlich sind (als separate Felder am Ende der Suchergebnisse). Dies ist eine erweiterte Funktion, die nicht für die meisten Spieler gedacht ist.", - "config.show-invalid-recipes.name": "Show invalid recipes", // TODO - "config.show-invalid-recipes.desc": "Whether to show recipes which require or produce broken items.", // TODO + "config.show-invalid-recipes.name": "Ungültige Rezepte anzeigen", + "config.show-invalid-recipes.desc": "Ob Rezepte angezeigt werden sollen, die ungültige Gegenstände erfordern oder erzeugen", "config.target-redirection.name": "Ziel Umleitung", "config.target-redirection.desc": "In manchen Fällen legt das Spiel eine temporäre Entität an, um eine andere zu repräsentieren. Zum Beispiel ist Abigail in den Minen in Wirklichkeit ein temporärer NSC mit dem Namen 'AbigailMine', so dass die Suche nach ihr dort nicht Abigails wirkliche Informationen zeigen wird. Wenn diese Option aktiviert ist, sucht Lookup Anything stattdessen nach der ursprünglichen Abigail.", "config.scroll-amount.name": "Scroll Anzahl", diff --git a/TractorMod/i18n/de.json b/TractorMod/i18n/de.json index 184bdca6a..71612439f 100644 --- a/TractorMod/i18n/de.json +++ b/TractorMod/i18n/de.json @@ -14,7 +14,7 @@ ** Section titles ****/ "config.main-options": "Hauptoptionen", - "config.audio": "Audio", // TODO + "config.audio": "Audio", "config.controls": "Steuerung", "config.axe": "Axteigenschaften", "config.hoe": "Hackeneigenschaften", @@ -30,8 +30,7 @@ /**** ** Warnings ****/ - // TODO - "config.questable-tractor-warning": "You have Questable Tractor installed. That mod works by overriding the tractor settings, so it may reset changes you make here.", + "config.questable-tractor-warning": "Du hast Questable Tractor installiert. Diese Mod funktioniert, indem sie die Traktoreinstellungen überschreibt, sodass hier vorgenommene Änderungen möglicherweise zurückgesetzt werden. ", /**** @@ -49,9 +48,8 @@ "config.build-price.name": "Baupreis", "config.build-price.tooltip": "Der Goldpreis für den Kauf einer Traktor-Garage. Standard {{defaultValue}}g.", - // TODO - "config.require-build-materials.name": "Require Build Materials", - "config.require-build-materials.tooltip": "Whether you need to provide materials to build a tractor garage, in addition to the gold price.", + "config.require-build-materials.name": "Erforderliche Baumaterialien", + "config.require-build-materials.tooltip": "Ob du Materialien für den Bau einer Traktorgarage bereitstellen musst, zusätzlich zum Goldpreis.", "config.can-summon-without-garage.name": "Kann ohne Garage beschworen werden", "config.can-summon-without-garage.tooltip": "Ob man einen vorübergehenden Traktor herbeirufen kann, ohne vorher eine Garage zu bauen.", @@ -72,9 +70,8 @@ "config.tractor-sounds.value.Horse": "Pferdegeräusche", "config.tractor-sounds.value.Tractor": "Traktorgeräusche", - // TODO - "config.tractor-volume.name": "Sound Effects Volume", - "config.tractor-volume.tooltip": "The volume level for the tractor sound effects. Default {{defaultValue}}%.", + "config.tractor-volume.name": "Soundeffekt-Laustärke", + "config.tractor-volume.tooltip": "Die Lautstärke für die Traktor-Soundeffekte. Standard {{defaultValue}}%.", /**** @@ -120,13 +117,11 @@ "config.harvest-fruit-trees.name": "Obstbäume ernten", "config.harvest-fruit-trees.tooltip": "Ob Obstbäume geerntet werden sollen.", - // TODO - "config.harvest-tree-moss.name": "Harvest Tree Moss", - "config.harvest-tree-moss.tooltip": "Whether to collect moss from trees.", + "config.harvest-tree-moss.name": "Baummoos ernten", + "config.harvest-tree-moss.tooltip": "Ob Moos von Bäumen gesammelt werden soll.", - // TODO - "config.harvest-tree-seeds.name": "Harvest Tree Seeds", - "config.harvest-tree-seeds.tooltip": "Whether to collect seeds from trees.", + "config.harvest-tree-seeds.name": "Baumsaat ernten", + "config.harvest-tree-seeds.tooltip": "Ob Saat von Bäumen gesammelt werden soll.", /**** @@ -176,9 +171,8 @@ "config.dig-artifact-spots.name": "Artefakt-Spots ausgraben", "config.dig-artifact-spots.tooltip": "Ob Artefaktstellen ausgegraben werden sollen.", - // TODO - "config.dig-seed-spots.name": "Dig Seed Spots", - "config.dig-seed-spots.tooltip": "Whether to dig up seed spots.", + "config.dig-seed-spots.name": "Aufgraben von Saatstellen", + "config.dig-seed-spots.tooltip": "Ob Saatstellen ausgegraben werden sollen.", "config.clear-tilled-dirt.name": "Entferne gepflügten Dreck", "config.clear-tilled-dirt.tooltip": "Ob gepflügter Dreck entfernt werden soll", From 1450ea3e5b2b3a0732dec1cb0277ec0e42679b7b Mon Sep 17 00:00:00 2001 From: b3nk3lly Date: Sat, 5 Oct 2024 18:08:46 -0300 Subject: [PATCH 12/16] Qualify new fish IDs in metadata --- LookupAnything/assets/data.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LookupAnything/assets/data.json b/LookupAnything/assets/data.json index e9ac40dfd..306419119 100644 --- a/LookupAnything/assets/data.json +++ b/LookupAnything/assets/data.json @@ -352,7 +352,7 @@ You shouldn't change this file unless you know what you're doing. }, // Son of Crimsonfish - "898": { + "(O)898": { "MinFishingLevel": 5, "Locations": [ { @@ -370,7 +370,7 @@ You shouldn't change this file unless you know what you're doing. }, // Ms. Angler - "899": { + "(O)899": { "MinFishingLevel": 3, "Locations": [ { @@ -388,7 +388,7 @@ You shouldn't change this file unless you know what you're doing. }, // Legend II - "900": { + "(O)900": { "MinFishingLevel": 10, "Locations": [ { @@ -405,7 +405,7 @@ You shouldn't change this file unless you know what you're doing. }, // Radioactive Carp - "901": { + "(O)901": { "Locations": [ { "LocationId": "Sewer", @@ -421,7 +421,7 @@ You shouldn't change this file unless you know what you're doing. }, // Glacierfish Jr. - "902": { + "(O)902": { "MinFishingLevel": 6, "Locations": [ { From 5b7dfbe51c56bc04f4d012c0e6572aea0c3d3733 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 27 Oct 2024 22:20:10 -0400 Subject: [PATCH 13/16] remove unneeded TimesOfDay blocks --- LookupAnything/assets/data.json | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/LookupAnything/assets/data.json b/LookupAnything/assets/data.json index 306419119..d2276bdfa 100644 --- a/LookupAnything/assets/data.json +++ b/LookupAnything/assets/data.json @@ -360,12 +360,6 @@ You shouldn't change this file unless you know what you're doing. "Area": "east-pier", "Seasons": [ "spring", "summer", "fall", "winter" ] } - ], - "TimesOfDay": [ - { - "MinTime": "600", - "MaxTime": "2600" - } ] }, @@ -378,12 +372,6 @@ You shouldn't change this file unless you know what you're doing. "Area": "northmost-bridge", "Seasons": [ "spring", "summer", "fall", "winter" ] } - ], - "TimesOfDay": [ - { - "MinTime": "600", - "MaxTime": "2600" - } ] }, @@ -395,12 +383,6 @@ You shouldn't change this file unless you know what you're doing. "LocationId": "Mountain", "Seasons": [ "spring", "summer", "fall", "winter" ] } - ], - "TimesOfDay": [ - { - "MinTime": "600", - "MaxTime": "2600" - } ] }, @@ -411,12 +393,6 @@ You shouldn't change this file unless you know what you're doing. "LocationId": "Sewer", "Seasons": [ "spring", "summer", "fall", "winter" ] } - ], - "TimesOfDay": [ - { - "MinTime": "600", - "MaxTime": "2600" - } ] }, @@ -429,12 +405,6 @@ You shouldn't change this file unless you know what you're doing. "Area": "island-tip", "Seasons": [ "spring", "summer", "fall", "winter" ] } - ], - "TimesOfDay": [ - { - "MinTime": "600", - "MaxTime": "2600" - } ] } }, From 95e21110255aabb68a5276da89ab214fd59f574c Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 27 Oct 2024 22:46:54 -0400 Subject: [PATCH 14/16] update release notes & translation docs --- ChestsAnywhere/docs/release-notes.md | 2 +- CropsAnytimeAnywhere/docs/release-notes.md | 2 +- DataLayers/docs/release-notes.md | 3 ++- FastAnimations/docs/release-notes.md | 2 +- FastAnimations/i18n/th.json | 2 +- LookupAnything/docs/release-notes.md | 3 ++- README.md | 6 +++--- TractorMod/docs/release-notes.md | 2 +- 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ChestsAnywhere/docs/release-notes.md b/ChestsAnywhere/docs/release-notes.md index c51776b16..8a91c38e8 100644 --- a/ChestsAnywhere/docs/release-notes.md +++ b/ChestsAnywhere/docs/release-notes.md @@ -8,7 +8,7 @@ - a category name to open by default (if set). * The default category for chests now uses the location's display name (if available), instead of its internal name. * Improved dropdown positioning to reduce overlap with big chest UI. -* Improved translations. Thanks to celr00 (updated Spanish), ForgottenZ (updated Chinese), MakinDay (updated Italian), and moonggae (updated Korean)! +* Improved translations. Thanks to celr00 (updated Spanish), Creeperkatze (updated German), ForgottenZ (updated Chinese), MakinDay (updated Italian), and moonggae (updated Korean)! ## 1.24.1 Released 01 July 2024 for SMAPI 4.0.7 or later. diff --git a/CropsAnytimeAnywhere/docs/release-notes.md b/CropsAnytimeAnywhere/docs/release-notes.md index 159d3fdd8..35913f051 100644 --- a/CropsAnytimeAnywhere/docs/release-notes.md +++ b/CropsAnytimeAnywhere/docs/release-notes.md @@ -4,7 +4,7 @@ ## Upcoming release * Updated for Stardew Valley 1.6.9. * Added config option to draw fruit trees' seasonal sprites, even if 'grow crops out of season' is enabled. -* Improved translations. Thanks to celr00 (added Spanish) and moonggae (added Korean)! +* Improved translations. Thanks to celr00 (added Spanish), Creeperkatze (added German), MakinDay (updated Italian), and moonggae (added Korean)! ## 1.5.1 Released 29 June 2024 for SMAPI 4.0.7 or later. diff --git a/DataLayers/docs/release-notes.md b/DataLayers/docs/release-notes.md index 6affc92d0..e6c46b109 100644 --- a/DataLayers/docs/release-notes.md +++ b/DataLayers/docs/release-notes.md @@ -6,7 +6,8 @@ * On the _Accessible_ layer, warps that are hidden just off-screen are now drawn along the edge. * Added support for Ultimate Fertilizer's multi-fertilizer feature. * Fixed lag if a bee house, Junimo hut, scarecrow, or sprinkler has an extremely large range. -* Improved translations. Thanks to moonggae (updated Korean)! +* Fixed error with unfertilized tiles when Ultimate Fertilizer is installed. +* Improved translations. Thanks to Creeperkatze (updated German) and moonggae (updated Korean)! ## 1.17.2 Released 29 June 2024 for SMAPI 4.0.7 or later. diff --git a/FastAnimations/docs/release-notes.md b/FastAnimations/docs/release-notes.md index 17e975931..0c247ec97 100644 --- a/FastAnimations/docs/release-notes.md +++ b/FastAnimations/docs/release-notes.md @@ -3,7 +3,7 @@ # Release notes ## Upcoming release * Updated for Stardew Valley 1.6.9. -* Improved translations. Thanks to MakinDay (updated Italian) and moonggae (updated Korean)! +* Improved translations. Thanks to chonsawat (updated Thai), Creeperkatze (updated German), MakinDay (updated Italian), and moonggae (updated Korean)! ## 1.13.3 Released 07 July 2024 for SMAPI 4.0.7 or later. diff --git a/FastAnimations/i18n/th.json b/FastAnimations/i18n/th.json index 227172d99..566552363 100644 --- a/FastAnimations/i18n/th.json +++ b/FastAnimations/i18n/th.json @@ -104,7 +104,7 @@ "config.dialogue-typing.tooltip": "ต้องการให้ข้อความบทสนทนาแสดงจบเร็วแค่ไหน ค่าเริ่มต้นคือ {{defaultValue}}x", "config.open-dialogue-box.name": "แสดงบทสทนา", - "config.open-dialogue-box.tooltip": "ต้องการแสดงบทสนทนาเร็วแค่ไหน ค่าเริ่มต้นคือ {{defaultValue}}x.", + "config.open-dialogue-box.tooltip": "ต้องการแสดงบทสนทนาเร็วแค่ไหน ค่าเริ่มต้นคือ {{defaultValue}}x.", "config.title-menu.name": "การเปลี่ยนเมนูชื่อเรื่อง", "config.title-menu.tooltip": "ความเร็วในการเปลี่ยนเมนูชื่อเรื่องระหว่างหน้าจอ ค่าเริ่มต้นคือ {{defaultValue}}x", diff --git a/LookupAnything/docs/release-notes.md b/LookupAnything/docs/release-notes.md index 343b5af14..b67df504e 100644 --- a/LookupAnything/docs/release-notes.md +++ b/LookupAnything/docs/release-notes.md @@ -16,13 +16,14 @@ * Fixed support for custom polyculture crops in 'needed for' field (thanks to Mushymato!). * Fixed hidden items being counted when deciding whether to collapse a field (thanks to b3nk3lly!). * Fixed fish spawn fields... + - not shown for extended family fish (thanksto b3nk3lly!); - not showing some locations' display names (thanks to b3nk3lly!); - sometimes shown for the wrong item (thanks to Mushymato!); - always showing one-time fish as not caught (thanks to Mushymato!). * Fixed errors when another mod adds invalid data. * Fixed error if an old version of Custom Bush is installed. * Fixed format for `DAY_OF_MONTH` queries in lookups (thanks to Mushymato!). -* Improved translations. Thanks to MakinDay (updated Italian), moonggae (updated Korean), and Mushymato (updated Chinese)! +* Improved translations. Thanks to Creeperkatze (updated German), Epitopus (updated Polish), MakinDay (updated Italian), moonggae (updated Korean), and Mushymato (updated Chinese)! ## 1.45.3 Released 07 July 2024 for SMAPI 4.0.7 or later. diff --git a/README.md b/README.md index fb107cc73..353b2be3a 100644 --- a/README.md +++ b/README.md @@ -85,11 +85,11 @@ on the wiki for help contributing translations.   | Automate | Chests Anywhere | Crops Anytime Anywhere | Data Layers | Debug Mode | Fast Animations | Horse Flute Anywhere | Lookup Anything | Noclip Mode | Skip Intro | Small Beach Farm | Tractor Mod :----------- | :------------------------- | :------------------------------- | :------------------------------------- | :--------------------------- | :-------------------------- | :------------------------------- | :----------------------------------- | :------------------------------- | :--------------------------- | :-------------------------- | :------------------------------- | :--------------------------- -Chinese | [✓](Automate/i18n/zh.json) | [↻](ChestsAnywhere/i18n/zh.json) | [↻](CropsAnytimeAnywhere/i18n/zh.json) | [✓](DataLayers/i18n/zh.json) | [✓](DebugMode/i18n/zh.json) | [↻](FastAnimations/i18n/zh.json) | [✓](HorseFluteAnywhere/i18n/zh.json) | [✓](LookupAnything/i18n/zh.json) | [✓](NoclipMode/i18n/zh.json) | [✓](SkipIntro/i18n/zh.json) | [✓](SmallBeachFarm/i18n/zh.json) | [✓](TractorMod/i18n/zh.json) +Chinese | [✓](Automate/i18n/zh.json) | [↻](ChestsAnywhere/i18n/zh.json) | [↻](CropsAnytimeAnywhere/i18n/zh.json) | [✓](DataLayers/i18n/zh.json) | [✓](DebugMode/i18n/zh.json) | [↻](FastAnimations/i18n/zh.json) | [✓](HorseFluteAnywhere/i18n/zh.json) | [↻](LookupAnything/i18n/zh.json) | [✓](NoclipMode/i18n/zh.json) | [✓](SkipIntro/i18n/zh.json) | [✓](SmallBeachFarm/i18n/zh.json) | [✓](TractorMod/i18n/zh.json) French | [✓](Automate/i18n/fr.json) | [↻](ChestsAnywhere/i18n/fr.json) | [❑](CropsAnytimeAnywhere/i18n) | [↻](DataLayers/i18n/fr.json) | [✓](DebugMode/i18n/fr.json) | [↻](FastAnimations/i18n/fr.json) | [✓](HorseFluteAnywhere/i18n/fr.json) | [↻](LookupAnything/i18n/fr.json) | [✓](NoclipMode/i18n/fr.json) | [✓](SkipIntro/i18n/fr.json) | [✓](SmallBeachFarm/i18n/fr.json) | [↻](TractorMod/i18n/fr.json) -German | [✓](Automate/i18n/de.json) | [↻](ChestsAnywhere/i18n/de.json) | [❑](CropsAnytimeAnywhere/i18n) | [↻](DataLayers/i18n/de.json) | [✓](DebugMode/i18n/de.json) | [↻](FastAnimations/i18n/de.json) | [✓](HorseFluteAnywhere/i18n/de.json) | [↻](LookupAnything/i18n/de.json) | [✓](NoclipMode/i18n/de.json) | [✓](SkipIntro/i18n/de.json) | [✓](SmallBeachFarm/i18n/de.json) | [↻](TractorMod/i18n/de.json) +German | [✓](Automate/i18n/de.json) | [✓](ChestsAnywhere/i18n/de.json) | [✓](CropsAnytimeAnywhere/i18n/de.json) | [✓](DataLayers/i18n/de.json) | [✓](DebugMode/i18n/de.json) | [✓](FastAnimations/i18n/de.json) | [✓](HorseFluteAnywhere/i18n/de.json) | [↻](LookupAnything/i18n/de.json) | [✓](NoclipMode/i18n/de.json) | [✓](SkipIntro/i18n/de.json) | [✓](SmallBeachFarm/i18n/de.json) | [✓](TractorMod/i18n/de.json) Hungarian | [✓](Automate/i18n/hu.json) | [↻](ChestsAnywhere/i18n/hu.json) | [❑](CropsAnytimeAnywhere/i18n) | [↻](DataLayers/i18n/hu.json) | [↻](DebugMode/i18n/hu.json) | [↻](FastAnimations/i18n/hu.json) | [✓](HorseFluteAnywhere/i18n/hu.json) | [↻](LookupAnything/i18n/hu.json) | [✓](NoclipMode/i18n/hu.json) | [❑](SkipIntro/i18n) | [↻](SmallBeachFarm/i18n/hu.json) | [↻](TractorMod/i18n/hu.json) -Italian | [✓](Automate/i18n/it.json) | [↻](ChestsAnywhere/i18n/it.json) | [↻](CropsAnytimeAnywhere/i18n/it.json) | [✓](DataLayers/i18n/it.json) | [✓](DebugMode/i18n/it.json) | [✓](FastAnimations/i18n/it.json) | [✓](HorseFluteAnywhere/i18n/it.json) | [✓](LookupAnything/i18n/it.json) | [✓](NoclipMode/i18n/it.json) | [✓](SkipIntro/i18n/it.json) | [✓](SmallBeachFarm/i18n/it.json) | [✓](TractorMod/i18n/it.json) +Italian | [✓](Automate/i18n/it.json) | [✓](ChestsAnywhere/i18n/it.json) | [✓](CropsAnytimeAnywhere/i18n/it.json) | [✓](DataLayers/i18n/it.json) | [✓](DebugMode/i18n/it.json) | [✓](FastAnimations/i18n/it.json) | [✓](HorseFluteAnywhere/i18n/it.json) | [↻](LookupAnything/i18n/it.json) | [✓](NoclipMode/i18n/it.json) | [✓](SkipIntro/i18n/it.json) | [✓](SmallBeachFarm/i18n/it.json) | [✓](TractorMod/i18n/it.json) Japanese | [❑](Automate/i18n) | [↻](ChestsAnywhere/i18n/ja.json) | [❑](CropsAnytimeAnywhere/i18n) | [✓](DataLayers/i18n/ja.json) | [✓](DebugMode/i18n/ja.json) | [↻](FastAnimations/i18n/ja.json) | [✓](HorseFluteAnywhere/i18n/ja.json) | [↻](LookupAnything/i18n/ja.json) | [✓](NoclipMode/i18n/ja.json) | [✓](SkipIntro/i18n/ja.json) | [✓](SmallBeachFarm/i18n/ja.json) | [✓](TractorMod/i18n/ja.json) Korean | [✓](Automate/i18n/ko.json) | [↻](ChestsAnywhere/i18n/ko.json) | [↻](CropsAnytimeAnywhere/i18n/ko.json) | [✓](DataLayers/i18n/ko.json) | [✓](DebugMode/i18n/ko.json) | [✓](FastAnimations/i18n/ko.json) | [✓](HorseFluteAnywhere/i18n/ko.json) | [↻](LookupAnything/i18n/ko.json) | [✓](NoclipMode/i18n/ko.json) | [✓](SkipIntro/i18n/ko.json) | [✓](SmallBeachFarm/i18n/ko.json) | [✓](TractorMod/i18n/ko.json) [Polish] | [❑](Automate/i18n) | [↻](ChestsAnywhere/i18n/pl.json) | [❑](CropsAnytimeAnywhere/i18n) | [↻](DataLayers/i18n/pl.json) | [↻](DebugMode/i18n/pl.json) | [❑](FastAnimations/i18n) | [❑](HorseFluteAnywhere/i18n) | [↻](LookupAnything/i18n/pl.json) | [↻](NoclipMode/i18n/pl.json) | [❑](SkipIntro/i18n) | [❑](SmallBeachFarm/i18n) | [↻](TractorMod/i18n/pl.json) diff --git a/TractorMod/docs/release-notes.md b/TractorMod/docs/release-notes.md index 392639b24..2b99f3215 100644 --- a/TractorMod/docs/release-notes.md +++ b/TractorMod/docs/release-notes.md @@ -8,7 +8,7 @@ * invalid or duplicate tractors are now removed; * duplicate garage IDs are now reassigned. * Fixed able to place unplaceable items using the 'custom attachments' option. -* Improved translations. Thanks to moonggae (updated Korean)! +* Improved translations. Thanks to Creeperkatze (updated German) and moonggae (updated Korean)! ## 4.19.2 Released 29 June 2024 for SMAPI 4.0.7 or later. From 995a9ae8a8790fe5ab52286ac7b3b26ad16d2468 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 27 Oct 2024 22:47:52 -0400 Subject: [PATCH 15/16] reuse new fertilizer null check --- DataLayers/Layers/Crops/CropFertilizerLayer.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/DataLayers/Layers/Crops/CropFertilizerLayer.cs b/DataLayers/Layers/Crops/CropFertilizerLayer.cs index 533f76c4d..f9d14e64d 100644 --- a/DataLayers/Layers/Crops/CropFertilizerLayer.cs +++ b/DataLayers/Layers/Crops/CropFertilizerLayer.cs @@ -132,11 +132,13 @@ select tile.Value { if (this.Mods.MultiFertilizer.IsLoaded) applied = [.. this.Mods.MultiFertilizer.GetAppliedFertilizers(dirt)]; - else if (this.HasUltimateFertilizer) - if (dirt.fertilizer.Value != null) + else if (dirt.fertilizer.Value != null) + { + if (this.HasUltimateFertilizer) applied = [.. dirt.fertilizer.Value.Split('|', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)]; // Ultimate Fertilizer allows multiple fertilizers - else if (CommonHelper.IsItemId(dirt.fertilizer.Value, allowZero: false)) - applied = [dirt.fertilizer.Value]; + else if (CommonHelper.IsItemId(dirt.fertilizer.Value, allowZero: false)) + applied = [dirt.fertilizer.Value]; + } } // get fertilizer info From 8f39cce51fd779a4464dd6104780041a47ef13dc Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 28 Oct 2024 19:12:00 -0400 Subject: [PATCH 16/16] fix held sprinkler range display in recent game versions --- DataLayers/Layers/Coverage/SprinklerLayer.cs | 4 ++-- DataLayers/docs/release-notes.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DataLayers/Layers/Coverage/SprinklerLayer.cs b/DataLayers/Layers/Coverage/SprinklerLayer.cs index a8e59d8c3..e088cb640 100644 --- a/DataLayers/Layers/Coverage/SprinklerLayer.cs +++ b/DataLayers/Layers/Coverage/SprinklerLayer.cs @@ -177,8 +177,8 @@ private IEnumerable GetCoverage(SObject sprinkler, Vector2 origin, IDic { // get vanilla tiles IEnumerable tiles = sprinkler.GetSprinklerTiles(); - if (isHeld) - tiles = tiles.Select(tile => tile + origin); // when the sprinkler is held, the vanilla coverage is relative to (0, 0) + if (isHeld && sprinkler.TileLocation == Vector2.Zero) + tiles = tiles.Select(tile => tile + origin); // add custom tiles if (customSprinklerRanges.TryGetValue(sprinkler.QualifiedItemId, out Vector2[]? customTiles)) diff --git a/DataLayers/docs/release-notes.md b/DataLayers/docs/release-notes.md index e6c46b109..aa2a19a44 100644 --- a/DataLayers/docs/release-notes.md +++ b/DataLayers/docs/release-notes.md @@ -7,6 +7,7 @@ * Added support for Ultimate Fertilizer's multi-fertilizer feature. * Fixed lag if a bee house, Junimo hut, scarecrow, or sprinkler has an extremely large range. * Fixed error with unfertilized tiles when Ultimate Fertilizer is installed. +* Fixed held sprinkler's range not shown correctly in newer game versions. * Improved translations. Thanks to Creeperkatze (updated German) and moonggae (updated Korean)! ## 1.17.2