Skip to content

Commit ea4e720

Browse files
committed
Merge branch 'develop'
2 parents 977d000 + 4d580c2 commit ea4e720

File tree

18 files changed

+290
-248
lines changed

18 files changed

+290
-248
lines changed

.github/workflows/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build releases
2+
on: push
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
permissions:
7+
id-token: write # for attestation
8+
attestations: write # for attestation
9+
env:
10+
RELEASE_REF: refs/heads/main # pushes to this branch are treated as public releases
11+
12+
steps:
13+
- name: Fetch code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-tags: false
17+
18+
- name: Add build environment
19+
uses: Pathoschild/SMAPI-ModBuildWorkflow/add-build-environment@v1
20+
21+
- name: Set prerelease versions
22+
uses: Pathoschild/SMAPI-ModBuildWorkflow/set-prerelease-versions@v1
23+
with:
24+
only_zipped: false # Bouhm's Pet Dogs is zipped in custom MSBuild code since it has no C# component
25+
if: github.ref != env.RELEASE_REF
26+
27+
- name: Build mods
28+
run: dotnet build
29+
30+
- name: Show _releases
31+
run: dir _releases
32+
33+
- name: Upload release zips
34+
uses: Pathoschild/SMAPI-ModBuildWorkflow/upload-release-artifacts@v1
35+
with:
36+
create_attestations: ${{github.ref == env.RELEASE_REF}}
37+
create_combined_zip: "all-mods"

Bouhm.Stardew.slnx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
<File Path="Directory.Packages.props" />
1212
<File Path="README.md" />
1313
</Folder>
14+
<Folder Name="/root/.github/" />
15+
<Folder Name="/root/.github/workflows/">
16+
<File Path=".github/workflows/build.yml" />
17+
</Folder>
1418
<Project Path="Bouhm.Shared/Bouhm.Shared.shproj" />
1519
<Project Path="LocationCompass/LocationCompass.csproj" />
1620
<Project Path="NPCMapLocations/NPCMapLocations.csproj" />

LocationCompass/LocationCompass.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<Version>1.5.2</Version>
3+
<Version>1.5.3</Version>
44
</PropertyGroup>
55

66
<ItemGroup>

LocationCompass/ModEntry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ private void UpdateLocators()
401401
{
402402
// Indoor locations
403403
// Intended behavior is for all characters in a building, including rooms within the building
404-
// to show up when the player is outside. So even if an character is not in the same location
404+
// to show up when the player is outside. So even if a character is not in the same location
405405
// ex. Maru in ScienceHouse, Sebastian in SebastianRoom, Sebastian will be placed in
406406
// ScienceHouse such that the player will know Sebastian is in that building.
407407
// Once the player is actually inside, Sebastian will be correctly placed in SebastianRoom.

LocationCompass/docs/release-notes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
[← back to readme](README.md)
22

33
# Release notes
4+
## 1.5.3
5+
Released 15 March 2026 for SMAPI 4.1.2 or later. Updated by Pathoschild.
6+
7+
* NPC Location Compass downloads are now created via [automated and attested builds](https://www.patreon.com/posts/automated-builds-148417912).
8+
_This guarantees that the download only contains what's in the public source code and hasn't been tampered with._
9+
410
## 1.5.2
511
Released 11 January 2026 for SMAPI 4.1.2 or later. Updated by Pathoschild.
612

NPCMapLocations/Framework/Menus/ModMapPage.cs

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ public override void performHoverAction(int x, int y)
8080
string[] hoveredNames;
8181
bool hasIndoorCharacters;
8282
{
83-
const int markerWidth = 32;
84-
const int markerHeight = 30;
83+
Point markerSize = this.GetNpcIconSize();
8584

8685
string regionId = this.RegionId;
8786
Point mousePos = Game1.getMousePosition();
@@ -94,7 +93,7 @@ public override void performHoverAction(int x, int y)
9493
{
9594
foreach ((string npcName, NpcMarker npcMarker) in this.NpcMarkers)
9695
{
97-
if (npcMarker.IsHidden || npcMarker.WorldMapRegionId != regionId || !this.IsMapPixelUnderCursor(mousePos, npcMarker.WorldMapX, npcMarker.WorldMapY, markerWidth, markerHeight))
96+
if (npcMarker.IsHidden || npcMarker.WorldMapRegionId != regionId || !this.IsMapPixelUnderCursor(mousePos, npcMarker.WorldMapX, npcMarker.WorldMapY, markerSize.X, markerSize.Y))
9897
continue;
9998

10099
newHoveredNames.Add(this.GetNpcDisplayName(npcMarker.DisplayName ?? npcName));
@@ -107,7 +106,7 @@ public override void performHoverAction(int x, int y)
107106
{
108107
foreach (FarmerMarker farmerMarker in this.FarmerMarkers.Values)
109108
{
110-
if (farmerMarker.WorldMapRegionId != regionId || !this.IsMapPixelUnderCursor(mousePos, farmerMarker.WorldMapX, farmerMarker.WorldMapY, markerWidth / 2, markerHeight / 2))
109+
if (farmerMarker.WorldMapRegionId != regionId || !this.IsMapPixelUnderCursor(mousePos, farmerMarker.WorldMapX, farmerMarker.WorldMapY, markerSize.X, markerSize.Y))
111110
continue;
112111

113112
newHoveredNames.Add(farmerMarker.Name);
@@ -124,7 +123,7 @@ public override void performHoverAction(int x, int y)
124123
{
125124
foreach ((string npcName, NpcMarker npcMarker) in this.NpcMarkers)
126125
{
127-
if (!npcMarker.IsHidden && npcMarker.LocationName != null && indoorLocationNames.Contains(npcMarker.LocationName))
126+
if (npcMarker is { IsHidden: false, LocationName: not null } && indoorLocationNames.Contains(npcMarker.LocationName))
128127
newHoveredNames.Add(this.GetNpcDisplayName(npcMarker.DisplayName ?? npcName));
129128
}
130129
}
@@ -254,8 +253,7 @@ public override void drawTooltip(SpriteBatch b)
254253

255254
// Draw indoor icon
256255
if (this.HasIndoorCharacter && !string.IsNullOrEmpty(this.HoveredNames))
257-
b.Draw(Game1.mouseCursors, this.IndoorIconVector, new Rectangle(448, 64, 32, 32), Color.White, 0f,
258-
Vector2.Zero, 0.75f, SpriteEffects.None, 0f);
256+
b.Draw(Game1.mouseCursors, this.IndoorIconVector, new Rectangle(448, 64, 32, 32), Color.White, 0f, Vector2.Zero, 0.75f, SpriteEffects.None, 0f);
259257
}
260258

261259

@@ -299,6 +297,8 @@ private void DrawMarkers(SpriteBatch b, float alpha)
299297
.Where(p => p.Value.WorldMapRegionId == regionId)
300298
.OrderBy(p => p.Value.Layer);
301299

300+
Point markerSize = this.GetNpcIconSize();
301+
302302
foreach ((string name, NpcMarker marker) in sortedMarkers)
303303
{
304304
// skip if invalid
@@ -326,22 +326,11 @@ private void DrawMarkers(SpriteBatch b, float alpha)
326326
Rectangle iconDestinationRect;
327327
{
328328
Rectangle iconSpriteRect = marker.GetSpriteSourceRect();
329-
float iconScale;
329+
float iconScale = iconSpriteRect.Width > iconSpriteRect.Height
330+
? markerSize.X / ((float)iconSpriteRect.Width)
331+
: markerSize.Y / ((float)iconSpriteRect.Height);
330332

331-
if (ModEntry.Config.NpcIconStyle == NpcIconStyle.Vanilla)
332-
{
333-
iconScale = iconSpriteRect.Width > iconSpriteRect.Height
334-
? 36f / iconSpriteRect.Width
335-
: 34f / iconSpriteRect.Height;
336-
}
337-
else
338-
{
339-
iconScale = iconSpriteRect.Width > iconSpriteRect.Height
340-
? 32f / iconSpriteRect.Width
341-
: 30f / iconSpriteRect.Height;
342-
}
343-
344-
float iconWidth = (int)(iconSpriteRect.Width * iconScale * scaleMultiplier);
333+
float iconWidth = (int)(iconSpriteRect.Width * iconScale * scaleMultiplier);
345334
float iconHeight = (int)(iconSpriteRect.Height * iconScale * scaleMultiplier);
346335

347336
iconDestinationRect = new Rectangle(
@@ -505,9 +494,17 @@ private bool IsMapPixelUnderCursor(Point mousePos, int worldMapX, int worldMapY,
505494
int y = this.mapBounds.Y + worldMapY;
506495

507496
return
508-
mousePos.X >= x
509-
&& mousePos.X <= x + markerWidth
510-
&& mousePos.Y >= y
511-
&& mousePos.Y <= y + markerHeight;
497+
mousePos.X >= x - (markerWidth / 2)
498+
&& mousePos.X <= x + (markerWidth / 2)
499+
&& mousePos.Y >= y - (markerHeight / 2)
500+
&& mousePos.Y <= y + (markerHeight / 2);
501+
}
502+
503+
/// <summary>Get the NPC icon sprite size, before scaling.</summary>
504+
private Point GetNpcIconSize()
505+
{
506+
return ModEntry.Config.NpcIconStyle == NpcIconStyle.Vanilla
507+
? new Point(36, 34)
508+
: new Point(32, 30);
512509
}
513510
}

NPCMapLocations/Framework/ModConstants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public static class MessageIds
4343
["Gunther"] = 3,
4444
["Haley"] = 2,
4545
["Harvey"] = -1,
46+
["Fizz"] = 4,
4647
["Jas"] = 7,
4748
["Jodi"] = 3,
4849
["Kent"] = -1,

NPCMapLocations/Framework/SummaryCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static string GetDescription()
3131
}
3232

3333
/// <summary>Handle the console command.</summary>
34-
/// <param name="monitor">The monitor with which to write output..</param>
34+
/// <param name="monitor">The monitor with which to write output.</param>
3535
/// <param name="locationUtil">Scans and maps locations in the game world.</param>
3636
/// <param name="customizations">Manages customized map recolors, NPCs, sprites, names, etc.</param>
3737
/// <param name="npcMarkers">The tracked NPC markers.</param>

NPCMapLocations/ModEntry.cs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -941,17 +941,7 @@ private void UpdateNpcs()
941941
if (locationName != null)
942942
npcMarker.WorldMapPosition = GetWorldMapPosition(locationName, npc.TilePoint.X, npc.TilePoint.Y, this.Customizations.LocationExclusions);
943943

944-
// apply NPC conditions
945-
if (!Config.ShowHiddenVillagers)
946-
{
947-
if (this.Data.Npcs.TryGetValue(npc.Name, out DataNpcModel? data) && data.Visible != null)
948-
{
949-
bool hidden = !GameStateQuery.CheckConditions(data.Visible);
950-
this.SetMarkerHiddenIfNeeded(npcMarker, npc.Name, hidden);
951-
}
952-
}
953-
954-
// apply 'show NPCs in location' option
944+
// check if NPC hidden
955945
{
956946
bool isSameLocation = false;
957947

@@ -1051,7 +1041,14 @@ void Hide(string setReason)
10511041

10521042
bool shownForQuest = ModEntry.Config.ShowQuests && (marker.HasQuest || marker.IsBirthday);
10531043

1054-
if (ModEntry.ShouldExcludeNpc(name, out string? reason))
1044+
if (!Config.ShowHiddenVillagers && this.Data.Npcs.TryGetValue(name, out DataNpcModel? data) && !GameStateQuery.CheckConditions(data.Visible))
1045+
{
1046+
Hide(GameStateQuery.IsImmutablyFalse(data.Visible)
1047+
? "hidden by default"
1048+
: $"conditional by default (\"{data.Visible}\")"
1049+
);
1050+
}
1051+
else if (ModEntry.ShouldExcludeNpc(name, out string? reason))
10551052
Hide($"hidden per config ({reason})");
10561053
else if (!shownForQuest && Config.FilterNpcsSpokenTo != null && Config.FilterNpcsSpokenTo != Game1.player.hasTalkedToFriendToday(name))
10571054
Hide($"hidden per config ({(Config.FilterNpcsSpokenTo is true ? "didn't talk" : "talked")} to them today)");

NPCMapLocations/NPCMapLocations.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<Version>3.5.0</Version>
3+
<Version>3.5.1</Version>
44
</PropertyGroup>
55

66
<ItemGroup>

0 commit comments

Comments
 (0)