Skip to content

Commit

Permalink
- Add some icon colors depending on item classifications
Browse files Browse the repository at this point in the history
  • Loading branch information
agilbert1412 committed Sep 8, 2024
1 parent f54416c commit 09e9fff
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public static bool TickUpdate_BirthingEvent_Prefix(BirthingEvent __instance, Gam
var playerName = Lexicon.capitalize(Game1.player.Name);
var spouseName = Game1.player.spouse;
var pronoun = "it";
var scoutedItemClassification = $"{scoutedItem.Classification.ToLower()} item";
var scoutedItemClassification = $"{scoutedItem.GetClassificationString()} item";

var multiplayerField = _helper.Reflection.GetField<Multiplayer>(typeof(Game1), "multiplayer");
var multiplayer = multiplayerField.GetValue();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Archipelago.MultiClient.Net.Enums;
using Archipelago.MultiClient.Net.Models;
using KaitoKid.ArchipelagoUtilities.Net;
using KaitoKid.ArchipelagoUtilities.Net.Client;
Expand Down Expand Up @@ -83,13 +84,38 @@ public ObtainableArchipelagoLocation(string locationDisplayName, string location
_locationChecker = locationChecker;

var isHinted = myActiveHints.Any(hint => archipelago.GetLocationName(hint.LocationId).Equals(locationName, StringComparison.OrdinalIgnoreCase));
var desiredTextureName = isHinted ? ArchipelagoTextures.PLEADING : ArchipelagoTextures.COLOR;
var scoutedLocation = archipelago.ScoutSingleLocation(LocationName);

var desiredTextureName = GetCorrectTexture(scoutedLocation, isHinted);
_archipelagoTexture = ArchipelagoTextures.GetArchipelagoLogo(logger, modHelper, 48, desiredTextureName);


var scoutedLocation = archipelago.ScoutSingleLocation(LocationName);
_description = scoutedLocation == null ? ScoutedLocation.GenericItemName() : scoutedLocation.ToString();
}
private static string GetCorrectTexture(ScoutedLocation scoutedLocation, bool isHinted)
{
if (isHinted)
{
return ArchipelagoTextures.PLEADING;
}

if (scoutedLocation.Classification.HasFlag(ItemFlags.Advancement))
{
return ArchipelagoTextures.PROGRESSION;
}

if (scoutedLocation.Classification.HasFlag(ItemFlags.NeverExclude))
{
return ArchipelagoTextures.COLOR;
}

if (scoutedLocation.Classification.HasFlag(ItemFlags.Trap))
{
return ArchipelagoTextures.RED;
}

return ArchipelagoTextures.BLACK;
}

public override void drawInMenu(SpriteBatch spriteBatch, Vector2 location, float scaleSize, float transparency, float layerDepth,
StackDrawType drawStackNumber, Color color, bool drawShadow)
Expand Down
2 changes: 1 addition & 1 deletion StardewArchipelago/StardewArchipelago.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="KaitoKid.ArchipelagoUtilities.Net" Version="1.1.8" />
<PackageReference Include="KaitoKid.ArchipelagoUtilities.Net" Version="1.1.10" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="4.1.1" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion StardewArchipelago/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Name": "StardewArchipelago",
"Author": "Kaito Kid",
"Version": "6.5.0",
"Version": "6.5.1",
"Description": "Stardew Valley Randomizer for Archipelago",
"UniqueID": "KaitoKid.StardewArchipelago",
"EntryDll": "StardewArchipelago.dll",
Expand Down

0 comments on commit 09e9fff

Please sign in to comment.