Difference between revisions of "User:Pathoschild/Modding wishlist"

From Stardew Valley Wiki
Jump to navigation Jump to search
(update deprecated source tags)
(→‎Medium changes: move consistent display name usage to done)
 
(30 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
==Wishlist==
 
==Wishlist==
 
===Bug fixes===
 
===Bug fixes===
* ☐ <tt>TrashBear.updateItemWanted</tt> is hardcoded to assume <tt>Data\CookingRecipes</tt> field 2 is an item ID, but it can actually be an item ID and count like <tt>272 5</tt> (e.g. see <tt>CraftingRecipe</tt> constructor). That means it crashes if it randomly chooses a recipe with multiple outputs.
+
''All done!''
  
 
===Small changes===
 
===Small changes===
* ☐ Add <tt>TouchAction Warp</tt> tile property, so mods don't all need to edit the same <tt>Warp</tt> map property.
+
''All done!''
* ☐ Change all remaining <code>internal class</code> and <code>private class</code> to <code>public class</code> to simplify mod access.
 
* ☐ Remove unused <tt>BloomComponent</tt>, <tt>BloomSettings</tt>, and all code which references them (this is broken and never enabled).
 
  
 
===Medium changes===
 
===Medium changes===
* ☐ Some XNB files have a separate display name field, but only in non-English. Using display names consistently regardless of language would let mods rename things without breaking keys:
+
* ☐ Add map property for default warp location (e.g. <samp>Utility.getDefaultWarpLocation</samp>).
** ☐ <tt>Data\Bundles</tt>
 
** ☐ <tt>Data\CraftingRecipes</tt>
 
** ☐ <tt>Data\CookingRecipes</tt>
 
** ☐ <tt>Data\Weapons</tt>
 
* ☐ Remove hardcoded logic that ignores display names when playing in English (e.g. for NPC gift taste dialogues); can search <code>LocalizedContentManager.LanguageCode.en</code> to find many of them. That causes a bug where renamed NPCs still show their internal name in some places.
 
* ☐ Get the spouse room offset from <tt>Data/NPCDispositions</tt>, instead of hardcoding it in <tt>FarmHouse.loadSpouseRoom</tt>.
 
* ☐ Call <tt>Game1.hooks.OnGameLocation_CheckAction</tt> from overridden <tt>checkAction</tt> methods too, not only the base one.
 
  
 
===Refactoring===
 
===Refactoring===
<ul>
+
* ☐ Change all <code>const</code> fields to <code>static readonly</code>. They're accessed the same way and the performance difference is negligible, but that'll make the decompiled code much easier to understand, and avoid issues where const values get 'baked in' to mod assemblies.
<li>☐ Replace <tt>Item.ParentSheetIndex</tt> with three properties:
 
  
{| class="wikitable"
+
==Completed items==
|-
+
See [[/Completed|the list of items completed in previous game versions]].
! field
 
! type
 
! notes
 
|-
 
| <tt>ID</tt>
 
| <tt>string</tt>
 
| An ID unique across all item types (like <tt>parsnip</tt> or <tt>radish_salad</tt>). That would allow unambiguous and human-readable item references throughout the code (e.g. gift tastes, machine behaviour, etc), fix bugs like the wallpaper glitch, and make it easy to avoid ID collisions in mods (e.g. <tt>spacechase0.JsonAssets/watermelon</tt>).
 
|-
 
| <tt>Sheet</tt>
 
| <tt>Texture2D</tt>
 
| The spritesheet to draw (e.g. <tt>Game1.objectSpriteSheet</tt>). This lets modders easily add custom items with their own spritesheet, and simplifies draw logic.
 
|-
 
| <tt>SheetIndex</tt>
 
| <tt>int</tt>
 
| Equivalent to the old <tt>ParentSheetIndex</tt>, but for the <tt>Sheet</tt> texture. No longer used as an ID.
 
|}
 
Files like <tt>Data/ObjectInformation</tt> would be updated to use the new IDs:
 
<syntaxhighlight lang="yaml">
 
# old format
 
634: "Apricot/50/15/Basic -79/Apricot/A tender little fruit with a rock-hard pit."
 
629: "Apricot Sapling/500/-300/Basic -74/Apricot Sapling/Takes 28 days to produce a mature Apricot tree. Bears fruit in the spring. Only grows if the 8 surrounding \"tiles\" are empty."
 
 
 
# new format
 
apricot: "634/Apricot/50/15/Basic -79/A tender little fruit with a rock-hard pit."
 
apricot_sapling: "629/Apricot Sapling/500/-300/Basic -74/Takes 28 days to produce a mature Apricot tree. Bears fruit in the spring. Only grows if the 8 surrounding \"tiles\" are empty."
 
</syntaxhighlight>
 
With equivalent changes in files like <tt>Data/NPCGiftTastes</tt>:
 
<syntaxhighlight lang="yaml">
 
# old format
 
Universal_Like: "-2 -7 -26 -75 -80 72 395 613 634 635 636 637 638 724 459"
 
 
 
# new format
 
Universal_Like: "-2 -7 -26 -75 -80 apple apricot cherry coffee maple_syrup mead orange peach pomegranate shrimp"
 
</syntaxhighlight>
 
 
 
Creating a vanilla item would use a key lookup like before:
 
<syntaxhighlight lang="C#">
 
Object item = new Object("apricot"); // equivalent to new Object("apricot", "Maps/springobjects", 634, ...);
 
</syntaxhighlight>
 
 
 
This also avoids needing to check item types in most code (e.g. no need to exclude bigcraftables in gift tastes, since there's no possible ID overlap with the IDs listed in <tt>Data/NPCGiftTastes</tt>).
 
</li>
 
<li>☐ Change all <code>const</code> fields to <code>static readonly</code>. They're accessed the same way and the performance difference is negligible, but that'll make the decompiled code much easier to understand, and avoid issues where const values get 'baked in' to mod assemblies.</li>
 
</ul>
 
 
 
==Done in Stardew Valley {{version|1.3.27}}==
 
===Bug fixes===
 
* ☑ Fix strange null handling with net fields (mostly fixed).
 
* ☑ Fix bee houses hardcoded to check <tt>Farm</tt> location, instead of their current location.
 
* ☑ On the load menu, clicking the 'back' button clicks the slot under it.
 
* ☑ <tt>Object.getOne()</tt> doesn't copy the 1.2+ fields: <tt>name</tt>, <tt>DisplayName</tt>, <tt>preserve</tt>, <tt>preservedParentSheetIndex</tt>, and <tt>honeyType</tt>.
 
 
 
===Small changes===
 
* ☑ Include <tt>Stardew Valley.pdb</tt> in the release, so we get line numbers when a crash happens in game code.
 
* ☑ Add a <tt>SerializableDictionary<string, string> CustomData</tt> property to <tt>SaveData</tt>, for SMAPI mods to safely store data.
 
* ☑ Remove <tt>Farmer</tt> namespace (so we don't need to alias the <tt>Farmer</tt> class anymore).
 
* ☑ Make these <tt>Game1</tt> fields protected instead of private: <tt>_debugStringBuilder</tt>, <tt>_fpsList</tt>, <tt>_fpsStopwatch</tt>, <tt>_fps</tt>, <tt>_newDayTask</tt>, <tt>_bgColor</tt>, <tt>screen</tt>, <tt>lightingBlend</tt>, <tt>drawFarmBuildings</tt>, <tt>drawHUD</tt>, <tt>drawDialogueBox</tt>, <tt>drawOverlays</tt>, and <tt>renderScreenBuffer</tt>. That will let SMAPI override the draw loop without reflection calls.
 
* ☑ Make <tt>LocalizedContentManager.languageCodeString</tt> public. That will let SMAPI override the draw loop without reflection calls.
 
* ☑ Remove <tt>LocalizedContentManager.LanguageOverride</tt>; it's unused, and that way SMAPI won't need to handle it.
 
* ☑ Replace <tt>ChatBox.enableCheats()</tt> with a property.
 
* ☑ Make these methods/properties virtual:
 
** ☑ <tt>Item</tt>:
 
*** ☑ <tt>canStackWith</tt>
 
*** ☑ <tt>CompareTo</tt>
 
** ☑ LocalizedContentManager:
 
*** ☑ <tt>CreateTemporary</tt>
 
*** ☑ <tt>Load(assetName, language)</tt>
 
*** ☑ <tt>LoadBase</tt>
 
*** ☑ <tt>CreateTemporary</tt>
 
*** ☑ <tt>LoadString</tt>
 
*** ☑ <tt>LoadBaseString</tt>
 
** ☑ <tt>Buildings/Building</tt>:
 
*** ☑ <tt>textureName</tt>
 
*** ☑ <tt>resetTexture</tt>
 
*** ☑ <tt>showUpgradeAnimation</tt>
 
*** ☑ <tt>getNameOfNextUpgrade</tt>
 
*** ☑ <tt>showDestroyedAnimation</tt>
 
*** ☑ <tt>updateInteriorWarps</tt>
 
*** ☑ <tt>drawInConstruction</tt>
 
** ☑ <tt>Buildings/Stable</tt>:
 
*** ☑ <tt>grabHorse</tt>
 
** ☑ <tt>Locations/FarmHouse</tt>:
 
*** ☑ <tt>showSpouseRoom</tt>
 
*** ☑ <tt>loadMapForUpgradeLevel</tt>
 
*** ☑ <tt>setMapForUpgradeLevel</tt>
 
*** ☑ <tt>loadSpouseRoom</tt>
 
** ☑ <tt>Menus/ChatBox</tt>:
 
*** ☑ <tt>textboxEnter</tt>
 
*** ☑ <tt>runCommand</tt> (and mark it protected)
 
*** ☑ <tt>addInfoMessage</tt>
 
*** ☑ <tt>globalInfoMessage</tt>
 
*** ☑ <tt>addErrorMessage</tt>
 
*** ☑ <tt>listPlayers</tt>
 
*** ☑ <tt>showHelp</tt>
 
*** ☑ <tt>setText</tt>
 
*** ☑ <tt>messageColor</tt> (and mark it protected)
 
*** ☑ <tt>receiveChatMessage</tt>
 
*** ☑ <tt>addMessage</tt>
 
** ☑ <tt>Menus/IClickableMenu</tt>:
 
*** ☑ <tt>receiveRightClick</tt> (currently abstract)
 
** ☑ <tt>Network/NetAudioCueManager</tt>:
 
*** ☑ <tt>Update</tt>
 
** ☑ <tt>Objects/Chest</tt>:
 
*** ☑ <tt>grabItemFromChest</tt>
 
*** ☑ <tt>addItem</tt>
 
*** ☑ <tt>grabItemFromInventory</tt>
 
*** ☑ <tt>isEmpty</tt>
 
*** ☑ <tt>clearNulls</tt>
 
*** ☑ <tt>draw</tt> (last overload)
 
** ☑ <tt>Objects/Object:</tt>
 
*** ☑ <tt>cutWeed</tt>
 
*** ☑ <tt>isAnimalProduct</tt>
 
*** ☑ <tt>canBeShipped</tt>
 
*** ☑ <tt>rot</tt>
 
*** ☑ <tt>isForage</tt>
 
*** ☑ <tt>initializeLightSource</tt>
 
*** ☑ <tt>consumeRecipe</tt>
 
*** ☑ <tt>performUseAction</tt>
 
*** ☑ <tt>grabItemFromAutoGrabber</tt>
 
*** ☑ <tt>farmerAdjacentAction</tt>
 
*** ☑ <tt>addWorkingAnimation</tt>
 
*** ☑ <tt>drawAsProp</tt>
 
*** ☑ <tt>sellToStorePrice</tt>
 
** ☑ <tt>Projectiles/Projectile</tt>:
 
*** ☑ <tt>update</tt>
 
** ☑ <tt>TV</tt>
 
* ☐ <s>Make <tt>Farmer.friendships</tt> internal to avoid confusion (replaced with <tt>friendshipData</tt>)</s> (would require significant changes to how the class is serialised).
 
* ☐ <s>Include <tt>Stardew Valley.xml</tt> in the release (if available), so we get code documentation</s> (no code documentation available).
 
 
 
===Medium changes===
 
* ☑ Add <tt>Game1.hooks</tt> to let SMAPI intercept some core game logic.
 
* ☑ Add <tt>Game1.input</tt>, which centralises <tt>Keyboard.GetState()</tt>, <tt>Mouse.GetState()</tt>, and <tt>GamePad.GetState()</tt>.
 
* ☑ Add a <tt>GameLocation.IsGreenhouse</tt> property, set it to true for the greenhouse, and use it anywhere the game checks <code>.Name.Equals("Greenhouse")</code>. That will let mods add custom indoor locations where crops can grow.
 
* ☑ Change <tt>GameLocation.updateSeasonalTilesheets</tt> to enable custom seasonal tilesheets.
 
* ☑ Instead of hardcoding non-social NPCs in <tt>new SocialMenu(...)</tt>, add a virtual <tt>npc.CanSocialise</tt> field.
 
* ☑ Integrate SMAPI's <tt>SDate</tt> features into the new <tt>WorldDate</tt> (like comparison operators and <tt>DayOfWeek</tt>).
 
* ☑ Add events to <tt>NetList</tt> for item added/removed/replaced (similar to the ones <tt>NetDictionary</tt> has). SMAPI will use them to watch for changes in some collections (like player inventory).
 
 
 
===Refactoring===
 
* ☑ Change static <tt>Multiplayer</tt> class into a <tt>Game1.multiplayer</tt> field so SMAPI can override it, and make its methods non-static and virtual.
 
* ☑ Use interfaces instead of concrete types to let SMAPI/mods override them:
 
** ☑ <tt>Farmer</tt>:
 
*** ☑ <tt>IList&lt;Buff&gt; buffs</tt>
 
*** ☑ <tt>IList&lt;OutgoingMessage&gt; messageQueue</tt>
 
** ☑ <tt>Game1</tt>:
 
*** ☑ <tt>NetBase&lt;IWorldState&gt; netWorldState</tt> (create interface)
 
*** ☑ <tt>IGameServer GameServer</tt> (create interface)
 
*** ☑ <tt>ISoundBank soundBank</tt> (create interface with thin wrapper around <tt>SoundBank</tt>)
 
*** ☑ <tt>IList&lt;GameLocation&gt; locations</tt>
 
*** ☑ <tt>IList&lt;Item&gt; itemsToShip</tt>
 
*** ☑ <tt>IList&lt;IClickableMenu&gt; onScreenMenus</tt>
 
*** ☑ <tt>IList&lt;DelayedAction&gt; delayedActions</tt>
 
*** ☑ <tt>IDictionary&lt;int, string&gt; objectInformation</tt>
 
*** ☑ <tt>IDictionary&lt;int, string&gt; bigCraftablesInformation</tt>
 
*** ☑ <tt>IDictionary&lt;string, string&gt; NPCGiftTastes</tt>
 
* ☑ [http://community.playstarbound.com/threads/multi-language-open-beta-available.130058/page-27#post-3159274 Use <code>Game1.CreateContentManager</code> consistently].
 
* ☑ Internal changes to <tt>CoopMenu</tt> so SMAPI can hook into it.
 
* ☑ Replace <code>obj.getType() == type</code> with <code>obj is type</code> to support mod subclasses in various places.
 
* ☐ <s>Update the bundled Mono to the latest version</s> (declined, too big a change).
 
* ☐ <s>Include a full (non-stripped) bundled Mono, to avoid issues with mod code</s> (declined, too big a change).
 
 
 
==Done in Stardew Valley {{version|1.3.28}}==
 
===Small changes===
 
* ☑ When creating honey, set <tt>preservedParentSheetIndex</tt> to the flower's item ID.
 
* ☑ Make <tt>LoadGameMenu</tt>'s inner classes <tt>public</tt>.
 
* ☑ Change <tt>ItemGrabMenu.sourceItem</tt> to <tt>public readonly object context</tt>, and track non-objects too. Suggested values:
 
** <tt>Chest</tt> instance when opening a chest (like current <tt>sourceItem</tt>);
 
** auto-grabber / <tt>Mill</tt> / <tt>JunimoHut</tt> instance when viewing their output;
 
** <tt>AdventureGuild</tt> / <tt>LibraryMuseum</tt> / <tt>JunimoNoteMenu</tt> / <tt>FishingRod</tt> instance for their rewards;
 
** <tt>Farm.shippingBin</tt> for the shipping bin;
 
** <tt>Item</tt> instance if opened by a method like <tt>addItemByMenuIfNecessary</tt>;
 
** <tt>null</tt> if not applicable.
 
* ☑ Change <tt>GameLocation.IsGreenhouse</tt> to a <tt>{ get; set; }</tt> property, and set it in the location constructor instead.
 
* ☑ When logging an exception, use <tt>Console.WriteLine(exception.ToString())</tt> instead of <tt>Console.WriteLine(exception.GetType())</tt> + <tt>Console.WriteLine(exception.Message)</tt> + <tt>Console.WriteLine(exception.StackTrace)</tt>. This will let SMAPI detect exception messages more easily.
 
* ☑ Make these methods virtual:
 
** ☑ <tt>Character</tt>:
 
*** ☑ <tt>checkForFootstep</tt>
 
** ☑ <tt>Locations\DecoratableLocation</tt>:
 
*** ☑ <tt>isTileOnWall</tt>
 
*** ☑ <tt>setFloors</tt>
 
*** ☑ <tt>setWallpapers</tt>
 
*** ☑ <tt>getFloorAt</tt>
 
*** ☑ <tt>getWallForRoomAt</tt>
 
*** ☑ <tt>setFloor</tt>
 
*** ☑ <tt>getWalls</tt> (and make it non-static)
 
*** ☑ <tt>getFloors</tt> (and make it non-static)
 
 
 
==Done in Stardew Valley {{version|1.3.32}}==
 
===Small changes===
 
<ul>
 
<li>☑ Tweak accessibility modifiers:
 
{| class="wikitable"
 
|-
 
! class
 
! changes
 
|-
 
| <tt>Multiplayer</tt>
 
| &#32;
 
* Make field protected: <tt>disconnectingFarmers</tt>.
 
|-
 
| <tt>Network/NetBufferReadStream</tt>,<br /><tt>Network/NetBufferWriteStream</tt>
 
| &#32;
 
* Make classes public.
 
|-
 
| <tt>Network/LidgrenServer</tt>
 
| &#32;
 
* Make fields protected: <tt>peers</tt> and <tt>server</tt>.
 
* Make methods protected virtual: <tt>sendMessage(NetConnection, OutgoingMessage)</tt> and <tt>parseDataMessageFromClient</tt>.
 
|-
 
| <tt>SDKs/GalaxyNetClient</tt>
 
| &#32;
 
* make fields protected: <tt>client</tt>.
 
* make methods protected virtual: <tt>onReceiveConnection</tt>, <tt>onReceiveMessage</tt>, <tt>onReceiveDisconnect</tt>, and <tt>onReceiveError</tt>.
 
|-
 
| <tt>SDKs/GalaxyNetServer</tt>
 
| &#32;
 
* make class public.
 
* make fields protected: <tt>server</tt> and <tt>peers</tt>.
 
* make methods protected virtual: <tt>onReceiveConnection</tt>, <tt>onReceiveMessage</tt>, <tt>onReceiveDisconnect</tt>, <tt>onReceiveError</tt>, and <tt>sendMessage(GalaxyID, OutgoingMessage)</tt>.
 
|}</li>
 
<li>☑ Changes to use <tt>IsGreenhouse</tt>:
 
{| class="wikitable"
 
|-
 
! location
 
! changes
 
|- valign="top"
 
| <tt>Crop.newDay</tt>
 
| <syntaxhighlight lang="c#">
 
// from:
 
if (... || !this.seasonsToGrowIn.Contains(Game1.currentSeason) || ...)
 
 
 
// to:
 
if (... || (!environment.IsGreenhouse && !this.seasonsToGrowIn.Contains(Game1.currentSeason)) || ...)
 
</syntaxhighlight>
 
|- valign="top"
 
| <tt>HoeDirt.canPlantThisSeedHere</tt>
 
| <syntaxhighlight lang="c#">
 
// from:
 
if (!Game1.currentLocation.IsOutdoors || crop.seasonsToGrowIn.Contains(Game1.currentSeason))
 
 
 
// to:
 
if (!Game1.currentLocation.IsOutdoors || Game1.currentLocation.IsGreenhouse || crop.seasonsToGrowIn.Contains(Game1.currentSeason))
 
</syntaxhighlight>
 
|- valign="top"
 
| <tt>HoeDirt.plant</tt>
 
| <syntaxhighlight lang="c#">
 
// from:
 
if (!who.currentLocation.isFarm && who.currentLocation.IsOutdoors)
 
 
 
// to:
 
if (!who.currentLocation.isFarm && !who.currentLocation.IsGreenhouse && who.currentLocation.IsOutdoors)
 
</syntaxhighlight>
 
<syntaxhighlight lang="c#">
 
// from:
 
if (!who.currentLocation.isOutdoors || crop.seasonsToGrowIn.Contains(Game1.currentSeason))
 
 
 
// to:
 
if (!who.currentLocation.isOutdoors || who.currentLocation.IsGreenhouse || crop.seasonsToGrowIn.Contains(Game1.currentSeason))
 
</syntaxhighlight>
 
|}
 
</li>
 
</ul>
 
 
 
==Done in Stardew Valley {{version|1.4}}==
 
===Bug fixes===
 
* When a fence is placed, its <tt>maxHealth</tt> is assigned to the same <tt>NetFloat</tt> instance as <tt>health</tt>. This causes the max health to deteriorate over time until the game is reloaded. (To fix it, <code>this.maxHealth = this.health</code> should become <code>this.maxHealth.Value = this.health.Value</code>.)
 
* Fix crash when wearing the [[Jukebox Ring]] (only obtainable via mods) in the mines.
 
* Fix <tt>MineShaft</tt> checking character count instead of monster count, which causes issues like ladders not spawning if a horse is present.
 
 
 
===Small changes===
 
<ul>
 
<li>☑ Add the game version to the save file. (That enables game/mod migrations when loading a save from an older game version.)</li>
 
<li>☑ Change <tt>Utility.getAllCharacters(List&lt;T&gt;)</tt> to also return the list, to simplify usage.</li>
 
<li>☑ Tweak accessibility modifiers:
 
{| class="wikitable"
 
|-
 
! class
 
! changes
 
|-
 
| <tt>InteriorDoor</tt><br /><tt>InteriorDoorDictionary</tt>
 
| &#32;
 
* make classes public.
 
|-
 
| <tt>NPC</tt>
 
| &#32;
 
* make fields public: <tt>scheduleTimeToTry</tt>, <tt>NO_TRY</tt>.
 
* make methods public: <tt>getTextureName</tt> (also it probably doesn't need to handle the rival anymore).
 
|-
 
| <tt>Locations/GameLocation</tt>
 
| &#32;
 
* make fields public: <tt>interiorDoors</tt>.
 
* make methods public: <tt>reloadMap</tt>, <tt>updateWarps</tt>.
 
|-
 
| <tt>Menus/GameMenu</tt>
 
| &#32;
 
* make fields public: <tt>tabs</tt>, <tt>pages</tt>.
 
|-
 
| <tt>Menus/ShopMenu</tt>
 
| &#32;
 
* make fields public: <tt>forSale</tt>, <tt>categoriesToSellHere</tt>, <tt>itemPriceAndStock</tt>, <tt>hoverPrice</tt>, <tt>heldItem</tt>, <tt>hoveredItem</tt>, <tt>currency</tt>, <tt>currentItemIndex</tt>.
 
|-
 
| <tt>Menus/TitleMenu</tt>
 
| &#32;
 
* make fields public: <tt>birds</tt>, <tt>cloudsTexture</tt>, <tt>titleButtonsTexture</tt>.
 
|-
 
| <tt>Minigames/AbigailGame</tt>
 
| &#32;
 
* make class public;
 
* make fields public: <tt>storeItems</tt>, <tt>abigailPortraitDuration</tt>, <tt>quit</tt>, <tt>died</tt>, <tt>targetMonster</tt>;
 
* make all <tt>CowboyMonster</tt>, <tt>Dracula</tt>, and <tt>Outlaw</tt> fields public.
 
|-
 
| <tt>Objects/Fence</tt>
 
| &#32;
 
* make fields public: <tt>fenceTexture</tt>.
 
|-
 
| <tt>SDKs/GalaxyNetClient</tt>
 
| &#32;
 
* make field protected: <tt>client</tt>.
 
|-
 
| <tt>TerrainFeatures/Bush</tt>
 
| &#32;
 
* make fields public: <tt>texture</tt>.
 
|-
 
| <tt>TerrainFeatures/Tree</tt>
 
| &#32;
 
* make fields public: <tt>texture</tt>.
 
|}</li>
 
<li>☑ Changes to use <tt>IsGreenhouse</tt>:
 
{| class="wikitable"
 
|-
 
! location
 
! changes
 
|- valign="top"
 
| <tt>FruitTree.dayUpdate</tt>
 
| <syntaxhighlight lang="c#">
 
// from:
 
if (... && (!Game1.currentSeason.Equals("winter") || Game1.currentLocation.name.Value.ToLower().Contains("greenhouse")))
 
 
 
// to:
 
if (... && (!Game1.IsWinter || Game1.currentLocation.IsGreenhouse))
 
</syntaxhighlight>
 
<syntaxhighlight lang="c#">
 
// from:
 
if (... || environment.name.Value.ToLower().Contains("greenhouse"))
 
 
 
// to:
 
if (... || environment.IsGreenhouse)
 
</source>
 
<syntaxhighlight lang="c#">
 
// from:
 
if (environment.name.Value.ToLower().Contains("greenhouse"))
 
 
 
// to:
 
if (environment.IsGreenhouse)
 
</syntaxhighlight>
 
|- valign="top"
 
| <tt>FruitTree.performUseAction</tt>
 
| <syntaxhighlight lang="c#">
 
// from:
 
if (... || Game1.currentLocation.name.Value.ToLower().Contains("greenhouse")))
 
 
 
// to:
 
if (... || Game1.currentLocation.IsGreenhouse))
 
</syntaxhighlight>
 
|- valign="top"
 
| <tt>Tree.dayUpdate</tt>
 
| <syntaxhighlight lang="c#">
 
// from:
 
if (!Game1.currentSeason.Equals("winter") || this.treeType == 6 || environment.Name.ToLower().Contains("greenhouse"))
 
 
 
// to:
 
if (!Game1.IsWinter || this.treeType == 6 || environment.IsGreenhouse)
 
</syntaxhighlight>
 
|}
 
</li>
 
<li>☑ Make methods virtual:
 
{| class="wikitable"
 
|-
 
! class
 
! methods
 
|-
 
| <tt>Game1</tt>
 
| <tt>_draw</tt>, <tt>drawHUD</tt>, <tt>drawMouseCursor</tt>, <tt>drawOverlays</tt>, <tt>drawWeather</tt>, <tt>renderScreenBuffer</tt>
 
|}</li>
 
<li>☑ Remove unused content files:
 
* <tt>Characters/schedules/beforePathfinding/*</tt>;
 
* <tt>Characters/schedules/newSchedules/*</tt>;
 
* <tt>Characters/schedules/spring/*</tt>.
 
</li>
 
<li>☑ Remove unused code:
 
* <tt>TerrainFeatures/DiggableWall</tt>;
 
* <tt>TerrainFeatures/TerrainFeatureFactory</tt>.
 
</li>
 
<li>☑ In <tt>GameLocation.loadObjects</tt>, split the door-finding logic into a separate <tt>updateDoors</tt> method for reuse.</li>
 
<li>☑ In <tt>Farmhouse.loadSpouseRoom</tt>, avoid <tt>dictionary.Add</tt> to fix a common crash when a mod has already added that property there.</li>
 
<li>☑ Remove confusing content folder fallback logic in <tt>Game1.Initialize</tt>, where the game looks for a hardcoded Windows path (and usually crashes with a confusing error) if the XACT folder isn't found.</li>
 
<li>☑ Load NPC schedules data through a helper function so it's easier to track down schedule load issues.</li>
 
</ul>
 
 
 
===Medium changes===
 
* ☑ Change the beehouse logic to allow honey from any hoed-dirt flower, instead of the vanilla subset.
 
* ☑ Fix reharvestable crops always dropping the min number of items, instead of a random number between the min and max values. (Stardew Valley 1.4 also adjusts the crop data so the end result for vanilla crops matches the 1.3.36 behavior.)
 
* ☑ Add an <tt>ICue</tt> interface and change references to <tt>Cue</tt>. That would let SMAPI/mods take control of sounds and music, which is hard to do currently.
 
* ☑ Some XNB files have a separate display name field, but only in non-English. Using display names consistently regardless of language would let mods rename things without breaking keys:
 
** ☑ <tt>Data\BigCraftablesInformation</tt>
 
** ☑ <tt>Data\ObjectInformation</tt>
 
* ☑ Consolidate <tt>Crop.harvest</tt> logic so it's consistent between scythe and hand harvesting.
 
* ☑ Move the <tt>Data\*</tt> loading logic out of the <tt>FarmAnimal</tt> and <tt>NPC</tt> constructors into <tt>reloadData()</tt> methods (so animal/NPC data can be refreshed when the asset changes).
 
* ☑ Reload farm animal & NPC data when the save is loaded, to fix inconsistency bugs and simplify mod changes to fields like an NPC's default location.
 
 
 
==Done in Stardew Valley 1.5==
 
===Bug fixes===
 
* ☑ The game handles <tt>this.Window.ClientSizeChanged</tt> unsafely in <tt>Game1</tt>, so the resize logic can run in the middle of a draw/update cycle and [https://smapi.io/log/f29188142be44430a00c802eea75812f cause ObjectDisposedException crashes]. For most players the crash is rare (if they avoid resizing the window while it's loading something), but a minority of players report constant crashes. Proposed fix: when the window resize event is called, set a flag and perform the resize logic on the next update tick instead.
 
* ☑ <tt>ItemGrabMenu</tt> exits immediately if it's opened for a chest in another location, unless it's given a null source chest.
 
* ☑ <tt>Game1.warpFarmer</tt> moves the player when they warp from any location marked <tt>IsGreenhouse</tt> to the farm; it should check <tt>Name == "Greenhouse"</tt> instead to allow for custom greenhouse locations.
 
 
 
===Small changes===
 
* ☑ Add <code>chest.GetCapacity()</code> method to simplify modded chest sizes.
 
* ☑ Add a <tt>modData</tt> dictionary field on <tt>Building</tt>, <tt>Character</tt>, <tt>GameLocation</tt>, <tt>Item</tt>, and <tt>TerrainFeature</tt> to store arbitrary mod data that's read/written to the save file and synchronized in multiplayer.
 
* ☑ In festival maps, allow adding NPC spawns by editing the festival data file instead of patching the characters tilesheet (which is conflict-prone).
 
* ☑ Add a utility method like <code>Utility.ModifyTime(0600, 70) == 0710</code> to simplify common time math in mod (and game) code.
 
* ☑ Tweak accessibility modifiers (all modifiers listed in wishlist done).
 
* ☑ Change the <tt>WarpGreenhouse</tt> action to use the farm warp position, instead of a hardcoded position.
 
<ul>
 
<li>☑ Tweak accessibility modifiers:
 
{| class="wikitable"
 
|-
 
! class
 
! changes
 
|-
 
| <tt>FarmAnimals\FarmAnimal</tt>
 
| &#32;
 
* make fields public: <tt>isEating</tt>.
 
|-
 
| <tt>Monsters\Bat</tt>
 
| &#32;
 
* make fields public: <tt>cursedDoll</tt>, <tt>hauntedSkull</tt>.
 
|-
 
| <tt>Menus\CollectionsPage</tt>
 
| &#32;
 
* make fields public: <tt>currentPage</tt>, <tt>currentTab</tt>, <tt>secretNotesData</tt>, <tt>secretNoteImageTexture</tt>.
 
|-
 
| <tt>Menus\CraftingPage</tt>
 
| &#32;
 
* make fields public: <tt>pagesOfCraftingRecipes</tt>, <tt>_materialContainers</tt>.
 
|-
 
| <tt>Menus\DialogueBox</tt>
 
| &#32;
 
* make fields public: <tt>dialogues</tt>, <tt>characterDialoguesBrokenUp</tt>, <tt>responses</tt>, <tt>selectedResponse</tt>, <tt>characterDialogue</tt>, <tt>dialogueContinuedOnNextPage</tt>, <tt>dialogueFinished</tt>.
 
|-
 
| <tt>Menus\LetterViewerMenu</tt>
 
| &#32;
 
* make fields public: <tt>cookingOrCrafting</tt>, <tt>learnedRecipe</tt>, <tt>mailMessage</tt>, <tt>moneyIncluded</tt>, <tt>scale</tt>, <tt>whichBG</tt>.
 
* make methods public and virtual: <tt>getTextColor</tt>.
 
|-
 
| <tt>TerrainFeatures\Grass</tt>
 
| &#32;
 
* make fields public: <tt>texture</tt>.
 
* make methods public: <tt>textureName</tt>.
 
|-
 
| <tt>AnimatedSprite</tt>
 
| &#32;
 
* make fields public: <tt>spriteTexture</tt>, <tt>loadedTexture</tt>, <tt>endOfAnimationFunction</tt>.
 
|-
 
| <tt>CraftingRecipe</tt>
 
| &#32;
 
* make fields public: <tt>recipeList</tt>, <tt>itemToProduce</tt>, <tt>description</tt>;
 
* make methods virtual: <tt>createItem</tt>, <tt>doesFarmerHaveIngredientsInInventory</tt>, <tt>drawMenuView</tt>, <tt>drawRecipeDescription</tt>, <tt>getCraftableCount</tt>, <tt>getCraftCountText</tt>, <tt>getNumberOfIngredients</tt>.
 
|-
 
| <tt>GameLocation</tt>
 
| &#32;
 
* make fields public: <tt>critters</tt>.
 
|-
 
| <tt>HUDMessage</tt>
 
| &#32;
 
* make methods virtual: <tt>draw</tt>, <tt>update</tt>.
 
|}</li>
 
</ul>
 
 
 
===Medium changes===
 
* ☑ Add support for specifying NPC gift tastes using item context tags instead of IDs.
 
* ☑ Add missing mod NPCs to the game for farmhands too, so they can be summoned in festivals.
 
* ☑ Map tilesheets exist in both <tt>Content</tt> and <tt>Content/Maps</tt>, but only the latter are used. Deleting the ones under <tt>Content</tt> would reduce confusion.
 
* ☑ Get the farmhouse and greenhouse locations from a map property, instead of static values in code. That would let map modders easily move it.
 
  
 
[[Category:Modding]]
 
[[Category:Modding]]

Latest revision as of 03:19, 4 December 2022

A list of requested changes in the game code to support modders. This list does not include complex refactoring or rewriting, which is unlikely to be accepted.

Wishlist

Bug fixes

All done!

Small changes

All done!

Medium changes

  • ☐ Add map property for default warp location (e.g. Utility.getDefaultWarpLocation).

Refactoring

  • ☐ Change all const fields to static readonly. They're accessed the same way and the performance difference is negligible, but that'll make the decompiled code much easier to understand, and avoid issues where const values get 'baked in' to mod assemblies.

Completed items

See the list of items completed in previous game versions.