Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
Add new previewed location sprites
Browse files Browse the repository at this point in the history
Start transition helper
  • Loading branch information
syyePhenomenol committed Jan 14, 2022
1 parent 96d9d8d commit b8c72d4
Show file tree
Hide file tree
Showing 37 changed files with 255 additions and 12 deletions.
9 changes: 2 additions & 7 deletions MapModS/Map/Pin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ internal class Pin : MonoBehaviour
public SpriteRenderer SR => gameObject.GetComponent<SpriteRenderer>();

private readonly Color _inactiveColor = Color.gray;
private readonly Color _previewedColor = Color.yellow;
private Color _origColor;

public void SetPinData(PinDef pd)
Expand Down Expand Up @@ -138,12 +137,8 @@ public void SetSizeAndColor()

transform.localScale = 1.45f * scale * new Vector2(1.0f, 1.0f);

if (RandomizerMod.RandomizerMod.RS.TrackerData.previewedLocations.Contains(PinData.name))
{
SR.color = _previewedColor; return;
}

if (RandomizerMod.RandomizerMod.RS.TrackerData.uncheckedReachableLocations.Contains(PinData.name))
if (RandomizerMod.RandomizerMod.RS.TrackerData.uncheckedReachableLocations.Contains(PinData.name)
|| RandomizerMod.RandomizerMod.RS.TrackerData.previewedLocations.Contains(PinData.name))
{
SR.color = _origColor;
}
Expand Down
13 changes: 9 additions & 4 deletions MapModS/Map/PinsCustom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private void MakePin(PinDef pinData, GameMap gameMap)
SpriteRenderer sr = goPin.AddComponent<SpriteRenderer>();

// Initialize sprite to vanillaPool
sr.sprite = SpriteManager.GetSpriteFromPool(pinData.vanillaPool);
sr.sprite = SpriteManager.GetSpriteFromPool(pinData.vanillaPool, false);
sr.sortingLayerName = "HUD";
sr.size = new Vector2(1f, 1f);

Expand Down Expand Up @@ -233,13 +233,18 @@ public void RefreshSprites()
{
foreach (Pin pin in _pins)
{
if (MapModS.LS.SpoilerOn || RandomizerMod.RandomizerMod.RS.TrackerData.previewedLocations.Contains(pin.PinData.name))
if (RandomizerMod.RandomizerMod.RS.TrackerData.previewedLocations.Contains(pin.PinData.name))
{
pin.SR.sprite = SpriteManager.GetSpriteFromPool(pin.PinData.spoilerPool);
pin.SR.sprite = SpriteManager.GetSpriteFromPool(pin.PinData.spoilerPool, true);
continue;
}
if (MapModS.LS.SpoilerOn)
{
pin.SR.sprite = SpriteManager.GetSpriteFromPool(pin.PinData.spoilerPool, false);
}
else
{
pin.SR.sprite = SpriteManager.GetSpriteFromPool(pin.PinData.vanillaPool);
pin.SR.sprite = SpriteManager.GetSpriteFromPool(pin.PinData.vanillaPool, false);
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion MapModS/Map/SpriteManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void LoadEmbeddedPngs(string prefix)
}
}

public static Sprite GetSpriteFromPool(PoolGroup pool)
public static Sprite GetSpriteFromPool(PoolGroup pool, bool yellow)
{
string spriteName = "undefined";

Expand Down Expand Up @@ -108,6 +108,11 @@ public static Sprite GetSpriteFromPool(PoolGroup pool)
break;
}

if (yellow)
{
spriteName += "Yellow";
}

return GetSprite(spriteName);
}

Expand Down
12 changes: 12 additions & 0 deletions MapModS/Map/WorldMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using MapModS.Data;
using MapModS.Settings;
using MapModS.Trackers;
using MapModS.UI;
using RandomizerCore;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -59,6 +60,17 @@ private static void GameManager_SetGameMap(On.GameManager.orig_SetGameMap orig,
CustomPins.FindRandomizedGroups();

MapModS.Instance.Log("Adding Custom Pins done.");

//string startScene = PlayerData.instance.scenesVisited[1];
//string finalScene = PlayerData.instance.scenesVisited[6];

//MapModS.Instance.Log(startScene);
//MapModS.Instance.Log(finalScene);

//foreach (string transition in TransitionHelper.ShortestRoute(startScene, finalScene))
//{
// MapModS.Instance.Log(transition);
//}
}

// Called every time we open the World Map
Expand Down
63 changes: 63 additions & 0 deletions MapModS/MapModS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<Compile Remove="Data\Pool.cs" />
<Compile Remove="Data\ShopDef.cs" />
<Compile Remove="Shop\ShopHooks.cs" />
<Compile Remove="UI\TransitionHelper.cs" />
</ItemGroup>

<ItemGroup>
Expand All @@ -76,26 +77,43 @@
<None Remove="Resources\Pins\pinBenchGrey.png" />
<None Remove="Resources\Pins\pinCharm.png" />
<None Remove="Resources\Pins\pinCharmSlug.png" />
<None Remove="Resources\Pins\pinCharmYellow.png" />
<None Remove="Resources\Pins\pinCocoon.png" />
<None Remove="Resources\Pins\pinCocoonYellow.png" />
<None Remove="Resources\Pins\pinColosseum.png" />
<None Remove="Resources\Pins\pinDreamer.png" />
<None Remove="Resources\Pins\pinDreamerYellow.png" />
<None Remove="Resources\Pins\pinEgg.png" />
<None Remove="Resources\Pins\pinEggYellow.png" />
<None Remove="Resources\Pins\pinEssenceBoss.png" />
<None Remove="Resources\Pins\pinEssenceBossYellow.png" />
<None Remove="Resources\Pins\pinFlame.png" />
<None Remove="Resources\Pins\pinFlameYellow.png" />
<None Remove="Resources\Pins\pinGeo.png" />
<None Remove="Resources\Pins\pinGeoYellow.png" />
<None Remove="Resources\Pins\pinGodSeeker.png" />
<None Remove="Resources\Pins\pinGrub.png" />
<None Remove="Resources\Pins\pinGrubKing.png" />
<None Remove="Resources\Pins\pinGrubYellow.png" />
<None Remove="Resources\Pins\pinKey.png" />
<None Remove="Resources\Pins\pinKeyYellow.png" />
<None Remove="Resources\Pins\pinLore.png" />
<None Remove="Resources\Pins\pinLoreYellow.png" />
<None Remove="Resources\Pins\pinMap.png" />
<None Remove="Resources\Pins\pinMapYellow.png" />
<None Remove="Resources\Pins\pinMask.png" />
<None Remove="Resources\Pins\pinMaskYellow.png" />
<None Remove="Resources\Pins\pinNotch.png" />
<None Remove="Resources\Pins\pinNotchYellow.png" />
<None Remove="Resources\Pins\pinOre.png" />
<None Remove="Resources\Pins\pinOreYellow.png" />
<None Remove="Resources\Pins\pinQWhite.png" />
<None Remove="Resources\Pins\pinRelic.png" />
<None Remove="Resources\Pins\pinRelicYellow.png" />
<None Remove="Resources\Pins\pinRock.png" />
<None Remove="Resources\Pins\pinRockYellow.png" />
<None Remove="Resources\Pins\pinRoot.png" />
<None Remove="Resources\Pins\pinRootYellow.png" />
<None Remove="Resources\Pins\pinShop.png" />
<None Remove="Resources\Pins\pinShopBanker.png" />
<None Remove="Resources\Pins\pinShopHunter.png" />
Expand All @@ -105,21 +123,35 @@
<None Remove="Resources\Pins\pinShopNailsmith.png" />
<None Remove="Resources\Pins\pinShopRelicDealer.png" />
<None Remove="Resources\Pins\pinShopSly.png" />
<None Remove="Resources\Pins\pinShopYellow.png" />
<None Remove="Resources\Pins\pinSkill.png" />
<None Remove="Resources\Pins\pinSkillYellow.png" />
<None Remove="Resources\Pins\pinSpa.png" />
<None Remove="Resources\Pins\pinStag.png" />
<None Remove="Resources\Pins\pinStagYellow.png" />
<None Remove="Resources\Pins\pinTotem.png" />
<None Remove="Resources\Pins\pinTotemYellow.png" />
<None Remove="Resources\Pins\pinTramLocation.png" />
<None Remove="Resources\Pins\pinUnknown.png" />
<None Remove="Resources\Pins\pinUnknownYellow.png" />
<None Remove="Resources\Pins\pinUnknown_GeoRock.png" />
<None Remove="Resources\Pins\pinUnknown_GeoRockInv.png" />
<None Remove="Resources\Pins\pinUnknown_GeoRockInvYellow.png" />
<None Remove="Resources\Pins\pinUnknown_GeoRockYellow.png" />
<None Remove="Resources\Pins\pinUnknown_Grub.png" />
<None Remove="Resources\Pins\pinUnknown_GrubInv.png" />
<None Remove="Resources\Pins\pinUnknown_GrubInvYellow.png" />
<None Remove="Resources\Pins\pinUnknown_GrubYellow.png" />
<None Remove="Resources\Pins\pinUnknown_Lifeblood.png" />
<None Remove="Resources\Pins\pinUnknown_LifebloodInv.png" />
<None Remove="Resources\Pins\pinUnknown_LifebloodInvYellow.png" />
<None Remove="Resources\Pins\pinUnknown_LifebloodYellow.png" />
<None Remove="Resources\Pins\pinUnknown_Totem.png" />
<None Remove="Resources\Pins\pinUnknown_TotemInv.png" />
<None Remove="Resources\Pins\pinUnknown_TotemInvYellow.png" />
<None Remove="Resources\Pins\pinUnknown_TotemYellow.png" />
<None Remove="Resources\Pins\pinVessel.png" />
<None Remove="Resources\Pins\pinVesselYellow.png" />
<None Remove="Resources\pins_old.json" />
<None Remove="Resources\pins_unused.json" />
<None Remove="Resources\shop.json" />
Expand All @@ -133,36 +165,67 @@
<EmbeddedResource Include="Resources\pins.json" />
<EmbeddedResource Include="Resources\pinsAM.json" />
<EmbeddedResource Include="Resources\Pins\pinCharm.png" />
<EmbeddedResource Include="Resources\Pins\pinCharmYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinCocoon.png" />
<EmbeddedResource Include="Resources\Pins\pinCocoonYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinDreamer.png" />
<EmbeddedResource Include="Resources\Pins\pinDreamerYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinEgg.png" />
<EmbeddedResource Include="Resources\Pins\pinEggYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinEssenceBoss.png" />
<EmbeddedResource Include="Resources\Pins\pinEssenceBossYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinFlame.png" />
<EmbeddedResource Include="Resources\Pins\pinFlameYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinGeo.png" />
<EmbeddedResource Include="Resources\Pins\pinGeoYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinGrub.png" />
<EmbeddedResource Include="Resources\Pins\pinGrubYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinKey.png" />
<EmbeddedResource Include="Resources\Pins\pinKeyYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinLore.png" />
<EmbeddedResource Include="Resources\Pins\pinLoreYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinMap.png" />
<EmbeddedResource Include="Resources\Pins\pinMapYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinMask.png" />
<EmbeddedResource Include="Resources\Pins\pinMaskYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinNotch.png" />
<EmbeddedResource Include="Resources\Pins\pinNotchYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinOre.png" />
<EmbeddedResource Include="Resources\Pins\pinOreYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinRelic.png" />
<EmbeddedResource Include="Resources\Pins\pinRelicYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinRock.png" />
<EmbeddedResource Include="Resources\Pins\pinRockYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinRoot.png" />
<EmbeddedResource Include="Resources\Pins\pinRootYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinShop.png" />
<EmbeddedResource Include="Resources\Pins\pinShopYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinSkill.png" />
<EmbeddedResource Include="Resources\Pins\pinSkillYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinStag.png" />
<EmbeddedResource Include="Resources\Pins\pinStagYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinTotem.png" />
<EmbeddedResource Include="Resources\Pins\pinTotemYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknownYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_GeoRock.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_GeoRockInv.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_GeoRockInvYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_GeoRockYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_Grub.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_GrubInv.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_GrubInvYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_GrubYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_Lifeblood.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_LifebloodInv.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_LifebloodInvYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_LifebloodYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_Totem.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_TotemInv.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_TotemInvYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinUnknown_TotemYellow.png" />
<EmbeddedResource Include="Resources\Pins\pinVessel.png" />
<EmbeddedResource Include="Resources\Pins\pinVesselYellow.png" />
</ItemGroup>

<ItemGroup>
Expand Down
Binary file added MapModS/Resources/Pins/pinCharmYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinCocoonYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinDreamerYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinEggYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinEssenceBossYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinFlameYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinGeoYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinGrubYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinKeyYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinLoreYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinMapYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinMaskYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinNotchYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinOreYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinRelicYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinRockYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinRootYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinShopYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinSkillYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinStagYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinTotemYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinUnknownYellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapModS/Resources/Pins/pinUnknown_GrubYellow.png
Binary file added MapModS/Resources/Pins/pinUnknown_TotemYellow.png
Binary file added MapModS/Resources/Pins/pinVesselYellow.png
Loading

0 comments on commit b8c72d4

Please sign in to comment.