Annosz / UIInfoSuite2

Ongoing maintenance for the original UI Info Suite mod for Stardew Valley.
1.57k stars 290 forks source link

[Visual Bug]: Traveling Merchant Indicator does not make sure to tell the truth #469

Closed agilbert1412 closed 7 months ago

agilbert1412 commented 7 months ago

Mod Version

v2.3.1

Multiplayer

Single Player

Visual Settings

UI Scale: 100%, Zoom: 100%

SMAPI Log

No response

Description

Issue

The Traveling merchant indicator appears to be hard coded to fridays and sundays, instead of checking dynamically if the traveling merchant actually is there for the current day.

This is an issue because mods that change the merchant days end up being minorly-incompatible with UIIS2, because the tracking is accidentally lying about the days.

How to fix?

in Forest.cs, the following method exists

public bool ShouldTravelingMerchantVisitToday()

In this mod, in ShowTravelingMerchant.cs, simply calling this method would fix the problem, as mods that change the days would presumably patch the aforementioned method.

  private void UpdateTravelingMerchant()
  {
    int dayOfWeek = Game1.dayOfMonth % 7;
    _travelingMerchantIsHere = ((Forest)(Game1.getLocationFromName("Forest")).ShouldTravelingMerchantVisitToday();

    _travelingMerchantIsVisited = false;
  }
agilbert1412 commented 7 months ago

I PRed the fix to this bug here: https://github.com/Annosz/UIInfoSuite2/pull/470

drewhoener commented 7 months ago

Closed by @agilbert1412 PR #470, thank you :)