Skip to content

A mod for Stardew Valley that displays a little marker next to items that are relevant for the community center bundles.

License

Notifications You must be signed in to change notification settings

Mikeliro/stardew-informant

Repository files navigation

Informant

A Mod for Stardew Valley

MIT Licence

A mod that displays additional information on various objects. It marks inventory items that are still necessary for the bundle, calculates how many days are still left until the harvest and displays what is in a machine and how much time is left on it.

Screenshot

This mod also provides a handy API to extend its functionality.

Content of this ReadMe:

User Manual

Prerequisites

You need SMAPI to run any kind of mods. And of course you need Stardew Valley.

Installing

  1. Install SMAPI
  2. Unzip the latest Informant.zip to the Mods/ folder
  3. If you want to use spacechase0's Generic Mod Config Menu, this mod automatically hooks into its menu

Using the Mod

The mod is automatically present in the game. You just need to move the mouse over the object you wish to get the information from.

If you don't like one or more of the displayed information (or worse, if there are conflicts with other mods), you can disable each type.

Decorators

There are two decorators, i.e. images displayed on the regular item tooltip, that have a specific meaning:

  • Bundle Image Bundles Decorator - displayed when the item is still needed for the bundles
  • Museum Image Museum Decorator - displayed when the item is still needed for the museum
  • Shipping Bin Image Shipping Decorator - displayed when the item was not yet shipped

Tooltips

You can also configure the tooltip "trigger", i.e. if you want the tooltip to show when the mouse hovers over an object, or if you want to press a key. You can also select the key to press.

On default, of all the big craftable objects in the game, only machines that produce something will get a tooltip. You can configure that to include all craftable objects, or all except chest (if you have a mod that shows specific information for them already).

Configuration

If you wish to configure this mod, it's advised to install spacechase0's Generic Mod Config Menu. Then there will be a config page.

Screenshot

Screenshot

But if you wish to change the config.json file manually, you can also do that. The config.json with all entries is:

{
  "DisplayIds": {
    "bundles": true,
    "challenger-decorator": true,
    "crop": true,
    "fruit-tree": true,
    "machine": true,
    "museum": true,
    "sell-price": true,
    "shipping": true,
    "tree": true
  },
  "HideMachineTooltips": "ForNonMachines",
  "TooltipTrigger": "Hover",
  "TooltipTriggerButton": "MouseRight"
}
Key in JSON Config Name Default Value Explanation
DisplayIds.bundles Bundles Decorator true True if the bundle decorator should be activated
DisplayIds.crop Crops Tooltip true True if the crops tooltip should be activated
DisplayIds.fruit-tree Fruit Trees Tooltip true True if the fruit trees tooltip should be activated
DisplayIds.machine Machines Tooltip true True if the machines tooltip should be activated
DisplayIds.museum Museum Decorator true True if the museum decorator should be activated
DisplayIds.sell-price Sell Price Decorator true True to show the item's price on the bottom of the tooltip
DisplayIds.shipping Shipping Decorator true True to marks items that were not shipped yet
DisplayIds.tree Trees Tooltip true True if the trees tooltip should be activated
HideMachineTooltips Hide Machine Tooltips ForNonMachines ForNonMachines displays tooltips only on machines that do work
ForChests hides tooltips only for chests
Never displays tooltip on every item
TooltipTrigger Tooltip Trigger Hover Hover to get tooltips when the mouse hovers over the item
ButtonHeld to get tooltips only when a button is held
TooltipTriggerButton Tooltip Button MouseRight If the trigger is ButtonHeld, this is the button that triggers the tooltip

Versions

Version Issues Changes
Future Issues
1.3.0 Issues Additional information
1.2.2 Issues Turkish translation
1.2.1 Issues Chinese translation
1.2.0 Issues Sell price feature
1.1.1 Issues Bugfixes from NexusMods feedback
1.1.0 Issues Split-screen & API fixes
1.0.0 Issues Nexus Release
0.4.0 Issues Prepare for Nexus Release
0.3.0 Issues Strutured PoC
0.2.0 - Crop Informant
0.1.0 - Bundle Informant

(All issues can be found here.)

Translator Guide

Right now, not all translations are provided. If you want to help, translate either file in the i18n/ and test it right in your Stardew Valley (the same folder exists in your Mods/ folder). You can than provide it to me via pull request or email.

Key Language Translated?
default English βœ…
de German βœ…
es Spanish πŸ”œ
fr French πŸ”œ
hu Hungarian πŸ”œ
it Italian πŸ”œ
ko Korean βœ… (thanks to brighteast99)
pt Portugese πŸ”œ
ru Russian πŸ”œ
tr Turkish βœ… (thanks to ExaBronto)
zh Chinese βœ… (thanks to gottyduke

Developer Notes

(This section contains notes to myself.)

Starting Development

To start developing this mod, you need to

  1. Create stardewvalley.targets file with the game folder

Use the Mod's API

There is a smaller API you can use without a direct dependency to this DLL. Just copy this interface:

using System;
using Microsoft.Xna.Framework.Graphics;
using StardewValley.TerrainFeatures;

namespace MyMod.ThirdParty; 

/// <summary>
/// Base class for the entire API. Can be used to add custom information providers.
/// </summary>
public interface IInformant {

    /// <summary>
    /// Adds a tooltip generator for the <see cref="TerrainFeature"/>(s) under the mouse position.
    /// </summary>
    void AddTerrainFeatureTooltipGenerator(string id, string displayName, string description, Func<TerrainFeature, string> generator); 
    
    /// <summary>
    /// Adds a tooltip generator for the <see cref="Object"/>(s) under the mouse position.
    /// </summary>
    void AddObjectTooltipGenerator(string id, string displayName, string description, Func<SObject, string?> generator); 
    
    /// <summary>
    /// Adds a decorator for the <see cref="Item"/>(s) under the mouse position.
    /// </summary>
    void AddItemDecorator(string id, string displayName, string description, Func<Item, Texture2D?> decorator); 
}

And then you can access the mod's API like this:

public class MyMod : Mod {
    public override void Entry(IModHelper modHelper) {
        Helper.Events.GameLoop.GameLaunched += (sender, args) => {
            var informant = Helper.ModRegistry.GetApi<IInformant>("Slothsoft.Informant");
            if (informant is null)
                return;

            // now call the methods of the informant
            informant.AddItemDecorator(...);
            informant.AddObjectTooltipGenerator(...);
            informant.AddTerrainFeatureTooltipGenerator(...);
        };
    }
}

If more control over the API is wanted or needed, a dependency to this mod can be added, and then the entire Api folder can be used.

Release

  1. Run build.bat, which only really works on my PC, but so what:
.\build
  1. Put the contents of bin/Informant*.zip in a fresh Stardew Valley and test if everything works
  2. Create a new tag and release on GitHub, append the ZIPs
  3. Increment the version in manifest.json and build/common.targets

Used Tutorials

License

This project is licensed under the MIT License - see the MIT license for details.

About

A mod for Stardew Valley that displays a little marker next to items that are relevant for the community center bundles.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 98.0%
  • PowerShell 1.8%
  • Batchfile 0.2%